this.tooltip = function(){
		
	xOffset = 30;
	yOffset = 20;		

	$j(".tooltip").hover(function(e)
	{

		this.t = this.title;
		this.title = "";

		$j("body").append("<p id='tooltip'>"+ this.t +"</p>");
		$j("#tooltip")
		.css("top",(e.pageY - xOffset) + "px")
		.css("left",(e.pageX + yOffset) + "px")
		.fadeIn("fast");		

	},

	function()
	{
	this.title = this.t;
	$j("#tooltip").remove();
	});

	$j(".tooltip").mousemove(function(e){
	$j("#tooltip")
	.css("top",(e.pageY - xOffset) + "px")
	.css("left",(e.pageX + yOffset) + "px");
	});

};

$j(document).ready(function(){
tooltip();
});

this.imagePreview = function(){	
	/* CONFIG */
		
		xOffsetPrew = -20;
		yOffsetPrew = -200;
		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result
		
	/* END CONFIG */
	$j(".preview").hover(function(e){

		this.t = this.title;
		this.title = "";	
		var c = (this.t != "") ? "<br/>" + this.t : "";
		$j("body").append("<p id='preview'><img src='"+ this.t +"' alt='' /></p>");						
		$j("#preview")
			.css("top",(e.pageY - xOffsetPrew) + "px")
			.css("left",(e.pageX + yOffsetPrew) + "px")
			.fadeIn("fast");						
    },
	function(){
		this.title = this.t;	
		$j("#preview").remove();
    });	
	$j(".preview").mousemove(function(e){
		$j("#preview")
			.css("top",(e.pageY - xOffsetPrew) + "px")
			.css("left",(e.pageX + yOffsetPrew) + "px");
	});			
};


// starting the script on page load
$j(document).ready(function(){
	imagePreview();
});
