var t1_bath_1  = null;
var t2_bath_1 = null;
var t3_bath_1 = null;
var t4_bath_1 = null;
var t5_bath_1 = null;
var t6_bath_1 = null;
var t7_bath_1 = null;
var t8_bath_1 = null;
var t9_bath_1 = null;
var t10_bath_1 = null; 

$(document).ready(function() {

	
	
	if(!isIE6){
				
		if(isIE){
			bath_1_layer_handlers_ie();
		} else {		
			bath_1_layer_handlers();
		}	

		
		for(i = 1; i <= 1; i++ ){			
			//setTimeout("changeLayer("+i+")",500)						
		}	

		if(!isIE){
		
			setTimeout("showLayer_bath_1(1);",700);
			setTimeout("showLayer_bath_1(2);",1300);
			setTimeout("showLayer_bath_1(3);",1800);
			setTimeout("showLayer_bath_1(4);",2300);
			setTimeout("showLayer_bath_1(5);",2800);
			setTimeout("showLayer_bath_1(6)",3300);
			setTimeout("showLayer_bath_1(7)",3800);
			setTimeout("showLayer_bath_1(8)",4300);
			setTimeout("showLayer_bath_1(9)",4800);
			setTimeout("showLayer_bath_1(10)",5300);
			
			setTimeout("hiddenLayer_bath_1(1);",1700);
			setTimeout("hiddenLayer_bath_1(2);",2300);
			setTimeout("hiddenLayer_bath_1(3);",2800);
			setTimeout("hiddenLayer_bath_1(4);",3300);
			setTimeout("hiddenLayer_bath_1(5);",3800);
			setTimeout("hiddenLayer_bath_1(6)",4300);
			setTimeout("hiddenLayer_bath_1(7)",4800);
			setTimeout("hiddenLayer_bath_1(8)",5300);
			setTimeout("hiddenLayer_bath_1(9)",5800);
			setTimeout("hiddenLayer_bath_1(10)",6300);
			
			setTimeout("startChahge_bath_1()",2300);
		
		} else {
			
			setTimeout("startChahge_bath_1()",1000);
		}	
	}	
		
});	


function startChahge_bath_1(){
	
	t1 = setTimeout("changeLayer_bath_1(1)",3300);
	t2 = setTimeout("changeLayer_bath_1(5)",4300);
	t3 = setTimeout("changeLayer_bath_1(9)",5300);
		
}

function changeLayer_bath_1(i){
	showLayer_bath_1(i);
	t4 = setTimeout("hideLayer_bath_1("+ (i)+ ")",5000);
}

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

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

function hideLayer_bath_1(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_1 .la_"+i+"_active").fadeOut(2000, changeLayer_bath_1(t));
	} else {
		$("#bath_1 .la_"+i+"_active").hide(0, changeLayer_bath_1(t));	
	}	
}

function clearTime_bath_1(){
	clearTimeout(t1_bath_1);
	clearTimeout(t2_bath_1);
	clearTimeout(t3_bath_1);
	clearTimeout(t4_bath_1);
	clearTimeout(t5_bath_1);
	clearTimeout(t6_bath_1);
	clearTimeout(t7_bath_1);
	clearTimeout(t8_bath_1);
	clearTimeout(t9_bath_1);
	clearTimeout(t10_bath_1);
}


function bath_1_layer_handlers(){
	
	$("#bath_1 .la_1").bind({			 
		  mouseenter: function(){
			$(".la_1_active").fadeIn(500);			
		  },
		  mouseleave: function(){
			$("#bath_1 .la_1_active").fadeOut(500);
		  }
		});
		
		$("#bath_1 .la_2").bind({			 
		  mouseenter: function(){
			$(".la_2_active").fadeIn(500);
		  },
		  mouseleave: function(){
			$("#bath_1 .la_2_active").fadeOut(500);
		  }
		});
		
		$("#bath_1 .la_3").bind({			 
		  mouseenter: function(){
			$(".la_3_active").fadeIn(500);
		  },
		  mouseleave: function(){
			$("#bath_1 .la_3_active").fadeOut(500);
		  }
		});

		
		$("#bath_1 .la_4").bind({			 
		  mouseenter: function(){
			$(".la_4_active").fadeIn(500);
		  },
		  mouseleave: function(){
			$("#bath_1 .la_4_active").fadeOut(500);
		  }
		});
		
		$("#bath_1 .la_5").bind({			 
			  mouseenter: function(){
				$(".la_5_active").fadeIn(500);
			  },
			  mouseleave: function(){
				$("#bath_1 .la_5_active").fadeOut(500);
			  }
			});

		$("#bath_1 .la_6").bind({			 
			  mouseenter: function(){
				$(".la_6_active").fadeIn(500);
			  },
			  mouseleave: function(){
				$("#bath_1 .la_6_active").fadeOut(500);
			  }
			});

		
		$("#bath_1 .la_7").bind({			 
			  mouseenter: function(){
				$(".la_7_active").fadeIn(500);
			  },
			  mouseleave: function(){
				$("#bath_1 .la_7_active").fadeOut(500);
			  }
			});

		$("#bath_1 .la_8").bind({			 
			  mouseenter: function(){
				$(".la_8_active").fadeIn(500);
			  },
			  mouseleave: function(){
				$("#bath_1 .la_8_active").fadeOut(500);
			  }
			});

		$("#bath_1 .la_9").bind({			 
			  mouseenter: function(){
				$(".la_9_active").fadeIn(500);
			  },
			  mouseleave: function(){
				$("#bath_1 .la_9_active").fadeOut(500);
			  }
			});

		$("#bath_1 .la_10").bind({			 
			  mouseenter: function(){
				$(".la_10_active").fadeIn(500);
			  },
			  mouseleave: function(){
				$("#bath_1 .la_10_active").fadeOut(500);
			  }
			});
	
}

function bath_1_layer_handlers_ie(){
	
	$("#bath_1 .la_1").bind({			 
		  mouseenter: function(){
			$(".la_1_active").show();			
		  },
		  mouseleave: function(){
			$("#bath_1 .la_1_active").hide();
		  }
		});
		
		$("#bath_1 .la_2").bind({			 
		  mouseenter: function(){
			$(".la_2_active").show();
		  },
		  mouseleave: function(){
			$("#bath_1 .la_2_active").hide();
		  }
		});
		
		$("#bath_1 .la_3").bind({			 
		  mouseenter: function(){
			$(".la_3_active").show();
		  },
		  mouseleave: function(){
			$("#bath_1 .la_3_active").hide();
		  }
		});

		
		$("#bath_1 .la_4").bind({			 
		  mouseenter: function(){
			$(".la_4_active").show();
		  },
		  mouseleave: function(){
			$("#bath_1 .la_4_active").hide();
		  }
		});
		
		$("#bath_1 .la_5").bind({			 
			  mouseenter: function(){
				$(".la_5_active").show();
			  },
			  mouseleave: function(){
				$("#bath_1 .la_5_active").hide();
			  }
			});

		$("#bath_1 .la_6").bind({			 
			  mouseenter: function(){
				$(".la_6_active").show();
			  },
			  mouseleave: function(){
				$("#bath_1 .la_6_active").hide();
			  }
			});

		
		$("#bath_1 .la_7").bind({			 
			  mouseenter: function(){
				$(".la_7_active").show();
			  },
			  mouseleave: function(){
				$("#bath_1 .la_7_active").hide();
			  }
			});

		$("#bath_1 .la_8").bind({			 
			  mouseenter: function(){
				$(".la_8_active").show();
			  },
			  mouseleave: function(){
				$("#bath_1 .la_8_active").hide();
			  }
			});

		$("#bath_1 .la_9").bind({			 
			  mouseenter: function(){
				$(".la_9_active").show();
			  },
			  mouseleave: function(){
				$("#bath_1 .la_9_active").hide();
			  }
			});

		$("#bath_1 .la_10").bind({			 
			  mouseenter: function(){
				$(".la_10_active").show();
			  },
			  mouseleave: function(){
				$("#bath_1 .la_10_active").hide();
			  }
			});
	
}

