/*
 * Tooltip script 
 * powered by jQuery (http://www.jquery.com)
 * 
 * written by Alen Grakalic (http://cssglobe.com)
 * 
 * for more info visit http://cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using-jquery
 *
 */
 


this.tooltip = function(){	
	/* CONFIG */		
		xOffset = 10;
		yOffset = 20;		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result		
	/* END CONFIG */

	
	$("#logos img,#screens img").hover(function(e){											  
		$(this).click(function()
		{
			$("#website").val(this.t);
			$("#refer").submit();

		});
		
		this.t=this.title;
		text= "<b>Website:</b>"+this.t+"<br>";
		text += "<b>Details:</b>"+$(this).attr('details');
		$("body").append("<p id='tooltip'></p>");
		if(this.src)
		{
		text = "<img id=icon style='padding:2px;float:right' width=50 height=50 src="+this.src+" />" +text;
		}

		$("#tooltip").html(text);
		$("#tooltip").corner();
		if(e.pageX +400 > $(window).width())
		left = e.pageX - 200;
		else
		left =(e.pageX + yOffset);
		$("#tooltip")
			.css('min-height','100px')
			.css('width','300px')
			.css('padding','15px')
			.css("top",(e.pageY - xOffset) + "px")
			.css("left", left+ "px")
			.fadeIn("fast");
              $("#tooltip img").corner();
		
    },
	function(){
		this.title = this.t;		
		$("#tooltip").remove();
    });	
	$("#logos img,#names a").mousemove(function(e){
	if(e.pageX +400 > $(window).width())
		left = e.pageX - 200;
		else
		left =(e.pageX + yOffset);

		$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",left + "px");
	});			
};





