jQuery(function($){
		
		if( jQuery.browser.mozilla && ( parseFloat(jQuery.browser.version.substr(0,3))<1.9 || parseFloat(jQuery.browser.version.substr(0,3))>=1.9 && parseFloat(jQuery.browser.version.substr(4,3))<=1.5 ) ){
			// 1.9.1.5 = Firefox/3.5.5
			// 1.9.2.3 = Firefox/3.6.3
			// do something special for ff3.5.5 and older..
		}else if( jQuery.browser.ie && parseFloat(jQuery.browser.version) <= 7.0 ){
			// do something special for ie7 and older..
		}else{
			$('form select').combobox();
			
		}
		


	/* INPUT_LABELS: */
		$.each($('input.txtInput'), function(){
			$(this).attr('alt', $(this).val())
			.focus(function(){
				if( $(this).val()==$(this).attr('alt') ){
					$(this).val('');
				}
			})
			.blur(function(){
				if( $(this).val()=='' ){
					$(this).val( $(this).attr('alt') );
				}
			});
		});

	/* :INPUT_LABELS */
	
		$.each($('#boxAdd input:checked'), function(){
			var prod = $('<a></a>');
			prod.attr( 'href', '#'+$(this).attr('name') );
			prod.html( $(this).next().html() );
			prod.click(function(){
				$(this).remove();
			});
			$('#box').append(prod);
			
			
		});
		
		$('#selAdd').click(function(){
			$('#boxAdd').toggle();
			return false;
		});
		$('#boxAdd input').change(function(){
			if( $(this).is(':checked') ){
				var prod = $('<a></a>');
				prod.attr( 'href', '#'+$(this).attr('name') );
				prod.html( $(this).next().html() );
				prod.css({cursor:'default'});
				prod.click(function(){
					//$(this).remove();
					return false;
					
				});
				$('#box').append(prod);
				
				//return false;
			}else{
				$('#box a[href="#'+$(this).attr('name')+'"]').remove();
				
				

			}
		});

		jQuery.each(jQuery('.links li'), function(){
		  if( jQuery(this).find('a').length<=0 ){
		    jQuery(this).hide();
		  }
		});


		$('.home_teaser > div').click(function(){
			if( $(this).find('a').length>0 ){
				var target = $(this).find('a').attr('target');
				if( typeof(target)=='undefined' || target=='' ){ target = '_self'; }
				var link = $(this).find('a:first').attr('href');
				if( link=='' && $(this).find('a:eq(1)').length>0 ){
					link = $(this).find('a:eq(1)').attr('href');
				}
				if( link.substr(0,1)!='/' && link.substr(0,7)!='http://' && link.substr(0,11)!='javascript:' ){
					link = '/'+link;
				}
				if( link!='' ){
					window.open(link, target);
				}
			}
			return false;
		});
		$.each($('.home_teaser > div'), function(){
			if( $(this).find('a').length>0 ){
				$(this).css({cursor:'pointer'});
			}
		});

});
