$(document).ready(function(){
	$("table").each(function(){
		$("tr:even",this).addClass("evenrow");
	});
	
	loaded=0;
	$("input[name=ps]").change(function () {
	  $("input[name=ps]:checked").each(function () {
		if(loaded==1) {
			$(".listing-box").animate({opacity:0.15});
		}
		$('.bps_'+$(this).val()).animate({opacity:1});
	  });
	})
	.change();
	loaded=1;


	$('.pbs').click(function (){
		$(".listing-box").animate({opacity:0.15});
		$('.'+$(this).attr("id")).animate({opacity:1});		
		$(".pbs, .pbsAll").removeClass("selected");
		$(this).addClass("selected");		
	});

	$('.pbsAll').click(function (){
		$(".pbs").removeClass("selected");
		$('.listing-box').animate({opacity:1});
		$('.pbsAll').addClass("selected");		
	});
	
	/*
	$('.mzimage').hover(function(){		
		//$(this).parent().next("div").css("display","block");
		alert($(this).parent().next().attr("class"));
	}, function(){
		$(".mzhint").css("display","none");
	});
	*/
	
	if(document.getElementById('datenId') != null){
		if(document.getElementById('datenId').childNodes.length > 1){
			
			var childNodeArray = document.getElementById('datenId').getElementsByTagName('div');
			
			if(childNodeArray[0].className != '') {
				document.getElementById('datenId').style.borderBottom = '1px solid #d8d8d8';
				document.getElementById('datenId').style.paddingBottom = '10px';
			}
		}
	}

	if(document.getElementById('techId') != null){
		
		if(document.getElementById('techId').childNodes.length > 0){
			
			var techNodeArray = document.getElementById('techId').getElementsByTagName('td');
			if(techNodeArray.length > 0) {
				if(techNodeArray[0].className != '') {
					$("#techId").addClass("ttable");
				}
		   }  
		}
	}
});

function displayMzhint(elem) {
	document.getElementById(elem).style.display = "block";
}

function hideMzhint(elem) {
	document.getElementById(elem).style.display = "none";
}

function setSearchTextFocus(ctrl) {
	ctrl.value = ''; 
}

function setSearchBlur(ctrl,lng) {
	if(lng == 'en'){
		if(ctrl.value == '') {
			ctrl.value = 'Order code or Product description';
		}
	}
	else {
		if(ctrl.value == '') {
			ctrl.value = 'Art.-Nr. oder Produktname';
		}
	}
}


