// JavaScript Document
// Copyright � 2007-2008 Stefan NICOLAE
// This script is the intelectual property of Stefan NICOLAE a.k.a. shakabut
// You cand use it anyway you want as long as you leave this copyright intact
// and you send me an e-mail. You'll probably find the latest version on my site: http://www.shakabut.com
// 
// This script uses jQuery (you'll find the latest version on http://www.jquery.com)

// THIS SCRIPT IS NOT FOR COMMERCIAL USE.

$JQ(document).ready(function() {		
	try{
		//$JQ('[title!=""]').addClass('red');
		$JQ('<div id="tooltipDiv"></div>').prependTo('body');
		$JQ('div#tooltipDiv').fadeTo(100, 0.9);
		$JQ('[title!=""]').hover(function() {
			var htmltext=$JQ(this).attr("title");
			var isImage;
			$JQ('div#tooltipDiv').html(htmltext); 
			$JQ(this).attr("title","");
			$JQ(this).attr("alt","");
			$JQ(this).children().attr("alt","");
			$JQ(this).css("cursor","pointer");		
			$JQ('div#tooltipDiv').css("display","block");
			isImage = $JQ(this).hasClass("myEdgeImage");
			//alert(isImage);
			$JQ().mousemove(function(e){
				if (isImage)
				{
					$JQ('div#tooltipDiv').css("left" , e.pageX+15 );
					$JQ('div#tooltipDiv').css("top" , e.pageY-120 );
				}
				else
				{
					$JQ('div#tooltipDiv').css("left" , e.pageX+15 );
					$JQ('div#tooltipDiv').css("top" , e.pageY+10 );
				}
			}); 
		}
		, function() {	
			$JQ(this).attr("title",$JQ('div#tooltipDiv').html());
			$JQ('div#tooltipDiv').css("display","none");
			//$JQ('div#tooltipDiv').hide("fast");
		});
	}catch(e){
		throw new Error("tooltiip_JQ.js error: " + e);
	}
});

