/* animazione homePage */
function homePage() {
	
	var vediHf = function vediHf() {
		$("#hf_enter").css("visibility","visible");
	}
	var vediCf = function vediCf() {
		$("#cf_enter").css("visibility","visible");
	}
	var vediZa = function vediZa() {
		$("#za_enter").css("visibility","visible");
	}
	
	var hf = false;
	var hfImg = parseFloat($("#hfImg").css("width"));
	var cfImg = parseFloat($("#cfImg").css("width"));
	var zaImg = parseFloat($("#zaImg").css("width"));
	
	function rollHf(div){
		$(div).bind("mouseover",function(){
			$("#installateur").stopAll().animate({style:"width:414px;", opacity:1},200);
			$("#particulier").stopAll().animate({style:"left:"+(622-hfImg)+"px;width:214px;", opacity:0.3},200);
			$("#zakelijk").stopAll().animate({style:"width:314px;", opacity:0.3},200);
			$("#hf").stopAll().animate({style:"left:"+(414-hfImg)+"px"},200);
			$("#hf_enter").css("visibility","visible");
		}).bind("mouseout",function(){
			$("#installateur").stopAll().animate({style:"width:314px;", opacity:1},200);
			$("#particulier").stopAll().animate({style:"left:"+(522-hfImg)+"px;width:314px;", opacity:1},200);
			$("#zakelijk").stopAll().animate({style:"width:314px;", opacity:1},200);
			$("#hf").stopAll().animate({style:"left:"+(314-hfImg)+"px"},200);
			$("#hf_enter").css("visibility","hidden");
		});
	};
	
	rollHf("#installateur img");
	rollHf("#hf");
	rollHf("#hf_enter");
	
	function rollCf(div){
		$(div).bind("mouseover",function(){
			$("#installateur").stopAll().animate({style:"width:264px;", opacity:0.3},200);
			$("#particulier").stopAll().animate({style:"left:"+(472-hfImg)+"px;width:414px;", opacity:1},200);
			$("#zakelijk").stopAll().animate({style:"width:264px;", opacity:0.3},200);
			$("#hf").stopAll().animate({style:"left:"+(264-hfImg)+"px"},200);
			$("#cf").stopAll().animate({style:"right:"+(112+hfImg)+"px"},200);
			$("#cf_enter").css("visibility","visible");
		}).bind("mouseout",function(){
			$("#installateur").stopAll().animate({style:"width:314px;", opacity:1},200);
			$("#particulier").stopAll().animate({style:"left:"+(522-hfImg)+"px;width:314px;", opacity:1},200);
			$("#zakelijk").stopAll().animate({style:"width:314px;", opacity:1},200);
			$("#hf").stopAll().animate({style:"left:"+(314-hfImg)+"px"},200);
			$("#cf").stopAll().animate({style:"right:"+(162+hfImg)+"px"},200);
			$("#cf_enter").css("visibility","hidden");
		});
	};
	
	rollCf("#particulier img");
	rollCf("#cf");
	rollCf("#cf_enter");

	function rollZa(div){
		$(div).bind("mouseover",function(){
			$("#installateur").stopAll().animate({style:"width:314px;", opacity:0.3},200);
			$("#particulier").stopAll().animate({style:"left:"+(522-hfImg)+"px;width:212px;", opacity:0.3},200);
			$("#zakelijk").stopAll().animate({style:"width:414px;", opacity:1},200);
			$("#cf").stopAll().animate({style:"right:"+(263+hfImg)+"px"},200);
			$("#za_enter").css("visibility","visible");
		}).bind("mouseout",function(){
			$("#installateur").stopAll().animate({style:"width:314px;", opacity:1},200);
			$("#particulier").stopAll().animate({style:"left:"+(522-hfImg)+"px;width:314px;", opacity:1},200);
			$("#zakelijk").stopAll().animate({style:"width:314px;", opacity:1},200);
			$("#cf").stopAll().animate({style:"right:"+(162+hfImg)+"px"},200);
			$("#za_enter").css("visibility","hidden");
		});
	};
	
	rollZa("#zakelijk img");
	rollZa("#za");
	rollZa("#za_enter");

}

/* init homePage */
$(document).ready(function(){
	homePage();
});
