 $(document).ready(function() {
	var ES = 750;
	 setSelects();
	 
	 
	 $(".refThumb").fancybox({ "zoomSpeedIn": 300, "zoomSpeedOut": 300, "overlayShow": true}); 

	// document.location.href = document.location.href + "#c83";	 
	//alert($("#projectListing").height());
	 
	 var listHeight = $("#projectListing").height();
	 var newHeight = listHeight - 30;
	 
	 if(newHeight >= 580)
	 {
		 newHeight = 580;
		 
	 }
	 
	// alert(listHeight);
	 
	
	 
	 $("#nextPage").css("height",newHeight+"px" );
	 $("#nextPage a img").css("height",newHeight+"px" );
	 
	 $("#prevPage").css("height",newHeight+"px" );
	 $("#prevPage a img").css("height",newHeight+"px" );
	 $("#prevPageEmpty").css("height",newHeight+"px" );
	 
	 
	 
	 if(listHeight > 500)
	 {
		 $("#nextPage").css("background","url(fileadmin/assets/img/arr_right_long.png) no-repeat top right" );
		 $("#prevPage").css("background","url(fileadmin/assets/img/arr_left_long.png) no-repeat top left" );
		 
	 }
	
	 
	 
	 
	 $(".refThumb").fancybox({ "zoomSpeedIn": 300, "zoomSpeedOut": 300, "overlayShow": true }); 

	 $("#kunden_wahl").change( function()
								 {
									 filter();
								 });
	 
	 $("#jahres_wahl").change( function()
							 {
								 filter();
							 });
	 
	 $("#aufgaben_wahl").change( function()
								 {
									 filter();
								 });
	 function setSelects()
	 {
		 
		 $('#kunden_wahl option:selected').removeAttr('selected');   
		 $('#jahres_wahl option:selected').removeAttr('selected'); 
		 $('#aufgaben_wahl option:selected').removeAttr('selected');
		 $('#kunden_wahl option[id=kunde_'+phpKundenID+']').attr('selected','selected');       
		 $('#jahres_wahl option[id=jahr_'+phpJahr+']').attr('selected','selected');
		 $('#aufgaben_wahl option[id=aufgabe_'+phpAufgabenID+']').attr('selected','selected');
	 }
	 
	 function filter()
	 {
		 kundenID = $("select#kunden_wahl option:selected").attr("id");
		 kunden = kundenID.split("_");
		 
		 jahrN = $("select#jahres_wahl option:selected").attr("id");
		 jahr = jahrN.split("_");
		 
		 aufgabenID = $("select#aufgaben_wahl option:selected").attr("id");
		 aufgabe = aufgabenID.split("_");

		 
		document.location.href = '/' + phpBasePath + '?tx_h2refs_pi1[kundenID]='+kunden[1]+'&tx_h2refs_pi1[jahr]='+jahr[1]+'&tx_h2refs_pi1[aufgabenID]='+aufgabe[1]; //+'#c83';
		 
		 
		 
	 }
	 
	 
	 
	 
 });
 

