jQuery(document).ready(function(){
  
  jQuery("#carus img").bind("mouseover",liover);
  jQuery("#carus img").bind("mouseout",liout);
  
  var currentImg;
  
  function liover(){
 
  	currentImg=jQuery(this).attr("id");
  	if(jQuery("#tool").hasClass("active") && jQuery("#tool").hasClass(currentImg+"_toolTip")){
				jQuery("#tool").removeClass("active");
  	}else{
  		  jQuery("#tool").attr("class","").hide();
				var current_ul = jQuery(this).parents("li").children("ul");
				var pos = jQuery(this).parents("li").offset();
				jQuery.each(jQuery.browser, function(i) {
				   if(jQuery.browser.version == '7.0'){
					  pos.top=pos.top
				   } else{
					  pos.top=pos.top - 15
				   }
				    if(screen.width == 1280){
					  pos.left=pos.left
				   } else if (screen.width == 1152){
					  pos.left=pos.left + 15
				   } else if (screen.width == 1024){
				   	  pos.left=pos.left + 25
				   } else if (screen.width == 800){
				   	  pos.left=pos.left + 30
				   } else if  (screen.width == 1440){
					    pos.left=pos.left - 15
					} else {
						 pos.left=pos.left - 25
					}
				 });
				jQuery("#tool").html(current_ul.html()).css({top: pos.top, left: pos.left-60}).show("fast").addClass(currentImg+"_toolTip");   		
  	}
 	
  }
  
  function liout(){
  	  currentImg = "";
  	  setTimeout(function(){
  	  		 if (!jQuery("#tool").hasClass("active")){
	 	  	 			 jQuery("#tool").hide();
  	  		 }
  		},100)
  }
  
	
	jQuery("#tool").hover(function(){
			jQuery(this).addClass("active");
	}, function() {
 	  setTimeout(function(){
 	  			var nameClass = currentImg+"_toolTip";
 	  			if (!jQuery("#tool").hasClass(nameClass)){
 	  							jQuery("#tool").removeClass("active").hide("fast");
 	  			}
		 }
		,100);
	});		
  
});
