/*
 * Url preview 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.screenshotPreview = function(){
	/* CONFIG */

		xOffset = 10;
		yOffset = 30;

	/* END CONFIG */
	$j('a.screenshot').hover(
		function(e){
			this.t = this.title;
			this.title = "";
			var c = (this.t != "") ? "<br/>" + this.t : "";
			var auDivId = "#" + this.rel;
			$rel = eval('auDivId');

			$j($rel)
				.css("position","absolute")
				.css("top",(e.pageY - xOffset) + "px")
				.css("left",(e.pageX + yOffset) + "px")
				.css("visibility","visible")
				.css("display","block");

	    },function(e){
			this.title = this.t;
			var auDivId = "#" + this.rel;
			$rel = eval('auDivId');

			$j($rel)
				.css("visibility","hidden")
				.css("display","none");
		}
	);

	$j("a.screenshot").mousemove(
		function(e){
			var auDivId = "#" + this.rel;
			$rel = eval('auDivId');

			$j($rel)
				.css("top",(e.pageY - xOffset) + "px")
				.css("left",(e.pageX + yOffset) + "px");
		}
	);

  $j("a.screenshot").click(
		function(e){
			this.title = this.t;
			var auDivId = "#" + this.rel;
			$rel = eval('auDivId');

			$j($rel)
				.css("visibility","hidden")
				.css("display","none");
		}
	);
};


// starting the script on page load
$j(document).ready(function(){
	screenshotPreview();
});
