// from http://cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using-jquery
// Alen Grakalic
// 8 May, 2008

this.imagePreview = function(){	
	/* CONFIG */
		
		xOffset = 10;
		yOffset = 30;
		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result
		
	/* END CONFIG */
	$("td.thumb a").hover(function(e){
	  var address = this.href.replace('http://www.quenkids.cz/item.php?id=', '');
	  var abc = $('#pict'+address).val();
	  var imgAddress = "http://www.quenkids.cz/uploaded/" + address + "/" + abc;
		this.t = this.title;
		this.title = "";	
		var c = (this.t != "") ? "<br>" + this.t : "";
		c = '';
		$("body").append("<p id='preview'><img src='"+ imgAddress +"'>"+ c +"</p>");								 
		$("#preview")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");						
    },
	function(){
		this.title = this.t;	
		$("#preview").remove();
    });	
	$("td.thumb a").mousemove(function(e){
		$("#preview")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};
