	this.imagePreview = function()
		{
			// CONFIG
			// these 2 variable determine popup's distance from the cursor
			// you might want to adjust to get the right result

			xOffset = 220;
			yOffset = 30;

			// END CONFIG

			$("a.preview").hover(function(e)
				{
					var thumbInit = this.href;
					var thumb = thumbInit.split("=");
					var realthumb = "./downloads/thumb_"+thumb[1];
					this.t = this.title;
					this.title = "";
					var c = (this.t != "") ? "<br/>" + this.t : "";
//					$("body").append("<p id = 'preview'><img src = '"+this.href+"' alt = 'Image preview' />"+ c +"</p>");
					$("body").append("<p id = 'preview' class = 'shadow'><img src = '"+realthumb+"' alt = 'Image preview' />"+ c +"</p>");
					$("#preview")
					.css("top",(e.pageX - xOffset)+"px")
					.css("left",(e.pageY + yOffset)+"px")
					.fadeIn("normal");
    			},
			function()
				{
					this.title = this.t;
					$("#preview").remove();
    			});

			$("a.preview").mousemove(function(e)
				{
					$("#preview")
					.css("top",(e.pageY - xOffset)+"px")
					.css("left",(e.pageX + yOffset)+"px");
				});
		};


	$(document).ready(function()
		{
			imagePreview();

		});
