

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/* 

_|                  
_|_|_|      _|_|_|  
_|    _|  _|    _|  
_|    _|  _|    _|  
_|_|_|      _|_|_|  
                _|  
            _|_|    

*/

//Variables

clic=0;


$(function(){
	$(".photo-list a").hover(function(){
		$(this).find("span").fadeOut();
	}, function(){
		$(this).find("span").fadeIn();		
	})		
});




/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/*
													FUNCTION CONTENT LOAD
*/
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


function ContentLoad(php) {
	
	$("#background").css('display', 'none');
	$("#loader").fadeIn(500);
		
	//function LOAD	
	$("#background").load(php,
		   function() { 
		   
		  // alert("YEAH!!");

		   $("#background").css('display', 'none');	
		   $("#loader").fadeOut(500);
		  //  $("#background").fadeIn(500);
		   setTimeout(function () { $("#background").fadeIn(500); }, 1500);	
		   //alert("Yuhuhuhu!!");
		   
		   
	}); 	  
	  
}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/*
								FUNCTION Carrega text per a la imatge i moviment del menu
*/
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function HotspotText() {
	// carrega del text per a cada imatge i animació del menu 
	
	//alert(clic);
	
	/*
	
	 if(clic == 0){	 
		
		setTimeout('animTextOn()',4000);
	    setTimeout('animTextOff()',12000);						   
		
	 	var refreshIntervalId  =	setInterval(function () {		
	   			setTimeout('animTextOn()',4000);
		        setTimeout('animTextOff()',12000);				
				
	    }, 13000);
	
	 } else {
		 
		//alert("soc dins!");		 
		clearInterval(refreshIntervalId);
	    clearTimeout(refreshIntervalId)
	 
	 }
	 
	 
	 */
	 
	
}

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/*
								FUNCTIONS LOAD: Background, continguts i moure pastilla a baix de tot
*/
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


function BackgroundLoad(php) { //moure i carregar el background
	
	//animar pastilla a baix de tot
	$("#menu").animate({ height: "470px" }, 500 );
	setTimeout(function () { $("#background").fadeOut(300); }, 700);
	setTimeout(function () { $("#loader").fadeIn(300); }, 1050);	
	
	
	//////////////////////////////////////////////////
	//function LOAD Background
	/////////////////////////////////////////////////	
	setTimeout(function () { $("#background").load(php,
		  						 function() { 
		   
		  // alert("YEAH!!");

		   $("#background").css('display', 'none');	
		    setTimeout(function () { $("#loader").fadeOut(400); }, 1000);	
//		   $("#loader").fadeOut(500);
		  //  $("#background").fadeIn(500);
		   setTimeout(function () { $("#background").fadeIn(400); }, 1500);	
		   //alert("Yuhuhuhu!!");
		   
		   
	   }); 	
	}, 1350);	
	
}


//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//function LOAD Contingut
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function ContingutLoad(php) { //carregar el contingut davant del menu i el background

	
	setTimeout(function () { $("#contingut").fadeOut(300); }, 700);	
	setTimeout(function () { $("#contingut").load(php,
											function() { 
		   
		  // alert("YEAH!!");

			$("#contingut").css('display', 'none');	
			setTimeout(function () { $("#loader").fadeOut(400); }, 1000);	
			
			setTimeout(function () { $("#contingut").fadeIn(400); }, 1500);	
		   //alert("Yuhuhuhu!!");
		   
		   
	   }); 	
	}, 1450);

}


//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//function LOAD BLANK
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function BlankLoad(php) { //carregar el contingut davant del menu i el background

	
	setTimeout(function () { $("#contingut").fadeOut(300); }, 700);	
	setTimeout(function () { $("#contingut").load(php,
											function() { 
		   
		  // alert("YEAH!!");

			$("#contingut").css('display', 'none');	
			setTimeout(function () { $("#loader").fadeOut(400); }, 1000);	
			
			setTimeout(function () { $("#contingut").fadeIn(400); }, 1500);	
		   //alert("Yuhuhuhu!!");
		   
		   
	   }); 	
	}, 1450);

}


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/*
											FUNCTION LOAD AND MOVE PASTILLA
*/
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


function HomeLoad(php) {
	
	
	
	setTimeout(function () { $("#background").fadeOut(300); }, 200);
	setTimeout(function () { $("#contingut").fadeOut(300); }, 200);
	
	setTimeout(function () { $("#menu").animate({ height: "60px" }, 500 ); }, 700);
	
	setTimeout(function () { $("#loader").fadeIn(300); }, 1050);	
	
	//function LOAD
	setTimeout(function () { $("#background").load(php,
		  						 function() { 
		   
		  // alert("YEAH!!");

		   $("#background").css('display', 'none');	
		    setTimeout(function () { $("#loader").fadeOut(400); }, 1000);	
//		   $("#loader").fadeOut(500);
		  //  $("#background").fadeIn(500);
		   setTimeout(function () { $("#background").fadeIn(400); }, 1500);	
		   //alert("Yuhuhuhu!!");
		   
		   
	   }); 	
	}, 1350);	
}



/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/*
											FUNCTION CONTACT ON
*/
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

function ContactLoad(php) {
	
	
	
	setTimeout(function () { $("#contingut").fadeOut(300); }, 700);	
	setTimeout(function () { $("#contingut").fadeOut(300); }, 200);
	
	setTimeout(function () { $("#menu").animate({ height: "60px" }, 700 ); }, 700);
	
	setTimeout(function () { $("#loader1").fadeIn(300); }, 1050);	
	
	//function LOAD
	setTimeout(function () { $("#contingut").load(php,
		  						 function() { 

		   $("#background").css('display', 'none');	
		    setTimeout(function () { $("#loader1").fadeOut(400); }, 1000);	
		   setTimeout(function () { $("#contingut").fadeIn(400); }, 1500);	

		   
	   }); 	
	}, 1350);	
}


/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/*
								FUNCTIONS LOAD: Background, continguts i moure pastilla a baix de tot
*/
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


function BGContactLoad(php) { //moure i carregar el background
	
	//animar pastilla a baix de tot
	setTimeout(function () { $("#background").fadeOut(300); }, 700);
	setTimeout(function () { $("#loader").fadeIn(300); }, 1050);	
	
	
	//////////////////////////////////////////////////
	//function LOAD Background
	/////////////////////////////////////////////////	
	setTimeout(function () { $("#background").load(php,
		  						 function() { 
		   
		  // alert("YEAH!!");

		   $("#background").css('display', 'none');	
           setTimeout(function () { $("#loader").fadeOut(400); }, 1000);	

		   setTimeout(function () { $("#background").fadeIn(400); }, 1500);	
		   //alert("Yuhuhuhu!!");
		   
		   
	   }); 	
	}, 1350);	
	
}


/*////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

									FUNCTION Google Map

*///////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/	


function GooglemapLoad() { //moure i carregar el background

	 $("#GoogleMap").fadeIn(500);
	 $("#close").fadeIn(500);
	 
}

function GooglemapUnLoad() { //moure i carregar el background

	 $("#GoogleMap").fadeOut(500);
	 $("#close").fadeOut(500);
}

/*////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

									FUNCTION Botó Fullscreen

*///////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/	


function BotofullscreenOn() { //moure i carregar el background

	 $("#Bfullscreen").fadeIn(500);
	 
}

function BotofullscreenOff() { //moure i carregar el background

	 $("#Bfullscreen").fadeOut(500);
}



/*////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

									FUNCTION FULLSCREEN

*///////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/	




function FullscreenLoad(id) { //carregar el contingut davant del menu i el background
	
	 $("#fullscreen").fadeIn(500);	 
	setTimeout(function () { location.href = "http://serratdelfigaro.com/"+id; }, 800);	
	/* ANTIC LOAD FULL
	//setTimeout(function () { $("#fullscreen").fadeOut(300); }, 700);	
	 $("#fullscreen").fadeIn(500);
	 $("#closeScreen").fadeIn(500);	 	
	setTimeout(function () { $("#fullscreen").load(php,
		  						 function() { 
		   
		  // alert("YEAH!!");		   
	   }); 	
	}, 1450);	
	*/

}

function FullscreenUnload() { //carregar el contingut davant del menu i el background

	//setTimeout(function () { $("#fullscreen").fadeOut(300); }, 700);
	
	 $("#fullscreen").fadeOut(500);
	 $("#closeScreen").fadeOut(500);	 
	
}

/*////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

									FUNCTION MENU ILUMINATE

*///////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/	
	
	
function MenuIluminate(i) {
	
	if(i==0){		
		//alert(i);
		$("#boto1").css("color", '#FFFFFF');
		$("#boto2").css("color", '#FFFFFF');
		$("#boto3").css("color", '#FFFFFF');
		$("#boto4").css("color", '#FFFFFF');
		$("#boto5").css("color", '#FFFFFF');
	}
	
	if(i==1){		
		//alert(i);
		$("#boto1").css("color", '#F39800');
		$("#boto2").css("color", '#FFFFFF');
		$("#boto3").css("color", '#FFFFFF');
		$("#boto4").css("color", '#FFFFFF');
		$("#boto5").css("color", '#FFFFFF');
	}

	if(i==2){		
//		alert(i);
		$("#boto1").css("color", '#FFFFFF');
		$("#boto2").css("color", '#F39800');
		$("#boto3").css("color", '#FFFFFF');
		$("#boto4").css("color", '#FFFFFF');
		$("#boto5").css("color", '#FFFFFF');		
	}

	if(i==3){		
//		alert(i);
		$("#boto1").css("color", '#FFFFFF');
		$("#boto2").css("color", '#FFFFFF');
		$("#boto3").css("color", '#F39800');
		$("#boto4").css("color", '#FFFFFF');
		$("#boto5").css("color", '#FFFFFF');			
	}

	if(i==4){		
//		alert(i);
		$("#boto1").css("color", '#FFFFFF');
		$("#boto2").css("color", '#FFFFFF');
		$("#boto3").css("color", '#FFFFFF');
		$("#boto4").css("color", '#F39800');
		$("#boto5").css("color", '#FFFFFF');	
	}

	if(i==5){		
//		alert(i);
		$("#boto1").css("color", '#FFFFFF');
		$("#boto2").css("color", '#FFFFFF');
		$("#boto3").css("color", '#FFFFFF');
		$("#boto4").css("color", '#FFFFFF');
		$("#boto5").css("color", '#F39800');	
	}

	
}

	
