var t1_bath_2  = null;
var t2_bath_2 = null;
var t3_bath_2 = null;
var t4_bath_2 = null;
var t5_bath_2 = null;
var t6_bath_2 = null;
var t7_bath_2 = null;
var t8_bath_2 = null;

$(document).ready(function() {
	
	if(!isIE6){
	
		if(isIE){
			bath_2_layer_handlers_ie();
		} else {		
			bath_2_layer_handlers();
		}
			
			
		setTimeout("showLayer_bath_2(1);",700);
		setTimeout("showLayer_bath_2(2);",1300);
		setTimeout("showLayer_bath_2(3);",1800);
		setTimeout("showLayer_bath_2(4);",2300);
		setTimeout("showLayer_bath_2(5);",2800);
		setTimeout("showLayer_bath_2(6)",3300);
		setTimeout("showLayer_bath_2(7)",3800);
		setTimeout("showLayer_bath_2(8)",4300);
				
		setTimeout("hiddenLayer_bath_2(1);",1700);
		setTimeout("hiddenLayer_bath_2(2);",2300);
		setTimeout("hiddenLayer_bath_2(3);",2800);
		setTimeout("hiddenLayer_bath_2(4);",3300);
		setTimeout("hiddenLayer_bath_2(5);",3800);
		setTimeout("hiddenLayer_bath_2(6)",4300);
		setTimeout("hiddenLayer_bath_2(7)",4800);
		setTimeout("hiddenLayer_bath_2(8)",5300);
				
		
		setTimeout("startChahge_bath_2()",2300);
	}
});	



function startChahge_bath_2(){
	
	t1 = setTimeout("changeLayer_bath_2(1)",3300);
	t2 = setTimeout("changeLayer_bath_2(4)",4300);
	t3 = setTimeout("changeLayer_bath_2(8)",5300);
		
}

function changeLayer_bath_2(i){
	showLayer_bath_2(i);
	t4 = setTimeout("hideLayer_bath_2("+ (i)+ ")",5000);
}

function showLayer_bath_2(i){
	if(!isIE){
		$("#bath_2 .la_"+i+"_active").fadeIn(2000);
	} else {
		$("#bath_2 .la_"+i+"_active").show();
	}	
}

function hiddenLayer_bath_2(i){
	if(!isIE){
		$("#bath_2 .la_"+i+"_active").fadeOut(2000);
	}else{
		$("#bath_2 .la_"+i+"_active").hide();
	}
}

function hideLayer_bath_2(i){
	//alert(i);
	t = Math.floor(Math.random()*11);
	t2 = Math.floor(Math.random()*1500);
	if(t == 0) t++;
	if(t == 11) t--;
	if(t2 < 500) t2 = 500;
	if(!isIE){
		$("#bath_2 .la_"+i+"_active").fadeOut(2000, changeLayer_bath_2(t));
	}else{
		$("#bath_2 .la_"+i+"_active").hide(0, changeLayer_bath_2(t));
	}	
}

function clearTime_bath_2(){
	clearTimeout(t1_bath_2);
	clearTimeout(t2_bath_2);
	clearTimeout(t3_bath_2);
	clearTimeout(t4_bath_2);
	clearTimeout(t5_bath_2);
	clearTimeout(t6_bath_2);
	clearTimeout(t7_bath_2);
	clearTimeout(t8_bath_2);	
}

function bath_2_layer_handlers(){
	
	
	$("#bath_2 .la_1").bind({			 
		mouseenter: function(){
			$(".la_1_active").fadeIn(500);			
		},
		mouseleave: function(){
			$("#bath_2 .la_1_active").fadeOut(500);
		}
	});
	
	$("#bath_2 .la_2").bind({			 
		mouseenter: function(){
			$(".la_2_active").fadeIn(500);			
		},
		mouseleave: function(){
			$("#bath_2 .la_2_active").fadeOut(500);
		}
	});
	
	$("#bath_2 .la_3").bind({			 
		mouseenter: function(){
			$(".la_3_active").fadeIn(500);			
		},
		mouseleave: function(){
			$("#bath_2 .la_3_active").fadeOut(500);
		}
	});
	
	$("#bath_2 .la_4").bind({			 
		mouseenter: function(){
			$(".la_4_active").fadeIn(500);			
		},
		mouseleave: function(){
			$("#bath_2 .la_4_active").fadeOut(500);
		}
	});
	
	$("#bath_2 .la_5").bind({			 
		mouseenter: function(){
			$(".la_5_active").fadeIn(500);			
		},
		mouseleave: function(){
			$("#bath_2 .la_5_active").fadeOut(500);
		}
	});
	
	$("#bath_2 .la_6").bind({			 
		mouseenter: function(){
			$(".la_6_active").fadeIn(500);			
		},
		mouseleave: function(){
			$("#bath_2 .la_6_active").fadeOut(500);
		}
	});
	
	$("#bath_2 .la_7").bind({			 
		mouseenter: function(){
			$(".la_7_active").fadeIn(500);			
		},
		mouseleave: function(){
			$("#bath_2 .la_7_active").fadeOut(500);
		}
	});
	
	$("#bath_2 .la_8").bind({			 
		mouseenter: function(){
			$(".la_8_active").fadeIn(500);			
		},
		mouseleave: function(){
			$("#bath_2 .la_8_active").fadeOut(500);
		}
	});
	
	
}

function bath_2_layer_handlers_ie(){
	
	
	$("#bath_2 .la_1").bind({			 
		mouseenter: function(){
			$(".la_1_active").show();			
		},
		mouseleave: function(){
			$("#bath_2 .la_1_active").hide();
		}
	});
	
	$("#bath_2 .la_2").bind({			 
		mouseenter: function(){
			$(".la_2_active").show();			
		},
		mouseleave: function(){
			$("#bath_2 .la_2_active").hide();
		}
	});
	
	$("#bath_2 .la_3").bind({			 
		mouseenter: function(){
			$(".la_3_active").show();			
		},
		mouseleave: function(){
			$("#bath_2 .la_3_active").hide();
		}
	});
	
	$("#bath_2 .la_4").bind({			 
		mouseenter: function(){
			$(".la_4_active").show();			
		},
		mouseleave: function(){
			$("#bath_2 .la_4_active").hide();
		}
	});
	
	$("#bath_2 .la_5").bind({			 
		mouseenter: function(){
			$(".la_5_active").show();			
		},
		mouseleave: function(){
			$("#bath_2 .la_5_active").hide();
		}
	});
	
	$("#bath_2 .la_6").bind({			 
		mouseenter: function(){
			$(".la_6_active").show();			
		},
		mouseleave: function(){
			$("#bath_2 .la_6_active").hide();
		}
	});
	
	$("#bath_2 .la_7").bind({			 
		mouseenter: function(){
			$(".la_7_active").show();			
		},
		mouseleave: function(){
			$("#bath_2 .la_7_active").hide();
		}
	});
	
	$("#bath_2 .la_8").bind({			 
		mouseenter: function(){
			$(".la_8_active").show();			
		},
		mouseleave: function(){
			$("#bath_2 .la_8_active").hide();
		}
	});
	
	
}
