var t1_bath_3  = null;
var t2_bath_3 = null;
var t3_bath_3 = null;
var t4_bath_3 = null;
var t5_bath_3 = null;
var t6_bath_3 = null;
var t7_bath_3 = null;
var t8_bath_3 = null;
var t9_bath_3 = null;

$(document).ready(function() {

	if(!isIE6){
	
		if(isIE){
			bath_3_layer_handlers_ie();
		} else {		
			bath_3_layer_handlers();
		}	

			
		
		setTimeout("showLayer_bath_3(1);",700);
		setTimeout("showLayer_bath_3(2);",1300);
		setTimeout("showLayer_bath_3(3);",1800);
		setTimeout("showLayer_bath_3(4);",2300);
		setTimeout("showLayer_bath_3(5);",2800);
		setTimeout("showLayer_bath_3(6)",3300);
		setTimeout("showLayer_bath_3(7)",3800);
		setTimeout("showLayer_bath_3(8)",4300);
		setTimeout("showLayer_bath_3(9)",4800);
				
		setTimeout("hiddenLayer_bath_3(1);",1700);
		setTimeout("hiddenLayer_bath_3(2);",2300);
		setTimeout("hiddenLayer_bath_3(3);",2800);
		setTimeout("hiddenLayer_bath_3(4);",3300);
		setTimeout("hiddenLayer_bath_3(5);",3800);
		setTimeout("hiddenLayer_bath_3(6)",4300);
		setTimeout("hiddenLayer_bath_3(7)",4800);
		setTimeout("hiddenLayer_bath_3(8)",5300);
		setTimeout("hiddenLayer_bath_3(9)",5800);
				
		
		setTimeout("startChahge_bath_3()",2300);
	}
});	

function startChahge_bath_3(){
	
	t1 = setTimeout("changeLayer_bath_3(1)",3300);
	t2 = setTimeout("changeLayer_bath_3(4)",4300);
	t3 = setTimeout("changeLayer_bath_3(7)",5300);
		
}

function changeLayer_bath_3(i){
	showLayer_bath_3(i);
	t4 = setTimeout("hideLayer_bath_3("+ (i)+ ")",5000);
}

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

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

function hideLayer_bath_3(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_3 .la_"+i+"_active").fadeOut(2000, changeLayer_bath_3(t));
	}else{
		$("#bath_3 .la_"+i+"_active").hide(0, changeLayer_bath_3(t));	
	}	
}

function clearTime_bath_3(){
	clearTimeout(t1_bath_3);
	clearTimeout(t2_bath_3);
	clearTimeout(t3_bath_3);
	clearTimeout(t4_bath_3);
	clearTimeout(t5_bath_3);
	clearTimeout(t6_bath_3);
	clearTimeout(t7_bath_3);
	clearTimeout(t8_bath_3);	
	clearTimeout(t9_bath_3);
}

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

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