
jQuery.noConflict();
var j = jQuery; 	

j(document).ready(function(){
	

	
	//Fix Errors - http://www.learningjquery.com/2009/01/quick-tip-prevent-animation-queue-buildup/
	
	function wait(millis){
		var date = new Date();
		var curDate = null;

		do { curDate = new Date(); }
		while(curDate-date < millis);
	};
	

//1 When mouse rolls over
	j("#pos1").mouseenter(function(){
		x1=document.getElementById("ul1").scrollHeight+"px";
		j("#pos1").stop(true, true).delay(500).animate({height:'131px'},5, function(){ j("#ul1 li.head a").addClass("active"); }).animate({height:x1},x1);
	});
	
	//When mouse is removed
	j("#pos1").mouseleave(function(){
		j("#pos1").stop(true, true).animate({height:'131px'},x1, function(){ j("#ul1 li.head a").removeClass("active"); });
	});
	
	
//2 When mouse rolls over
	j("#pos2").mouseenter(function(){
		x2=document.getElementById("ul2").scrollHeight+"px";
		j("#pos2").stop(true, true).delay(500).animate({height:'131px'},5, function(){ j("#ul2 li.head a").addClass("active"); }).animate({height:x2},x2);		
	});
	
	//When mouse is removed
	j("#pos2").mouseleave(function(){
		j("#pos2").stop(true, true).animate({height:'131px'},x2, function(){ j("#ul2 li.head a").removeClass("active"); });
	});
	
	
//3 When mouse rolls over
	j("#pos3").mouseenter(function(){
		x3=document.getElementById("ul3").scrollHeight+"px";
		j("#pos3").stop(true, true).delay(500).animate({height:'131px'},5, function(){ j("#ul3 li.head a").addClass("active"); }).animate({height:x3},x3);
	});
	
	//When mouse is removed
	j("#pos3").mouseleave(function(){
		j("#pos3").stop(true, true).animate({height:'131px'},x3, function(){ j("#ul3 li.head a").removeClass("active"); });
	});


//4 When mouse rolls over
	j("#pos4").mouseenter(function(){
		x4=document.getElementById("ul4").scrollHeight+"px";
		j("#pos4").stop(true, true).delay(500).animate({height:'131px'},5, function(){ j("#ul4 li.head a").addClass("active"); }).animate({height:x4},x4);
	});
	
	//When mouse is removed
	j("#pos4").mouseleave(function(){
		j("#pos4").stop(true, true).animate({height:'131px'},x4, function(){ j("#ul4 li.head a").removeClass("active"); });
	});


//5 When mouse rolls over
	j("#pos5").mouseenter(function(){
		x5=document.getElementById("ul5").scrollHeight+"px";
		j("#pos5").stop(true, true).delay(500).animate({height:'131px'},5, function(){ j("#ul5 li.head a").addClass("active"); }).animate({height:x5},x5);
	});
	
	//When mouse is removed
	j("#pos5").mouseleave(function(){
		j("#pos5").stop(true, true).animate({height:'131px'},x5, function(){ j("#ul5 li.head a").removeClass("active"); });
	});




//1 When mouse rolls over
	j("#pos1top").mouseover(function(){
		j("#ul1 li.head a").addClass("hover");
	});
	
	j("#pos1top").mouseleave(function(){
		j("#ul1 li.head a").removeClass("hover");
	});
	
	
	
	j("#pos2top").mouseover(function(){
		j("#ul2 li.head a").addClass("hover");
	});
	
	j("#pos2top").mouseleave(function(){
		j("#ul2 li.head a").removeClass("hover");
	});
	
	
	
	j("#pos3top").mouseover(function(){
		j("#ul3 li.head a").addClass("hover");
	});
	
	j("#pos3top").mouseleave(function(){
		j("#ul3 li.head a").removeClass("hover");
	});
	
	
	
	j("#pos4top").mouseover(function(){
		j("#ul4 li.head a").addClass("hover");
	});
	
	j("#pos4top").mouseleave(function(){
		j("#ul4 li.head a").removeClass("hover");
	});
	
	
	
	j("#pos5top").mouseover(function(){
		j("#ul5 li.head a").addClass("hover");
	});
	
	j("#pos5top").mouseleave(function(){
		j("#ul5 li.head a").removeClass("hover");
	});
		
	
	
});
