/*
 * Image 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.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 */
	$("a.preview").hover(function(e){
		var param = this.title.split("#");

		this.t2 = this.title;
		this.t = param[0];
		this.title = "";	
		var c = (this.t != "") ? "" + this.t : "";
		//$("body").append("<p id='preview'><img src='"+ $(this).children("img").attr("id") +"' alt='Image preview' />"+ c +"</p>");	
		$("body").append("<table id='preview' border='0' cellspacing='0' cellpadding='0' class='tbl' style='width:230px; position:absolute; display:none;'><tr><td class='where_bt'><img src='"+ $(this).children("img").attr("id") +"' alt='Проститутки Киева' class='girl_pic' width='"+param[1]+"' height='"+param[2]+"'></td></tr><tr><td class='where_bt'>"+ c +"<font class='font_11_black'>Перед тем как начать общение с девушкой, пожалуйста, не забудьте сообщить ей, что нашли ее телефон на сайте <strong>РелаксПортал.биз</strong>. Желаем приятного времяпровождения.</font></td></tr></table>");
		 
		$("#preview")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");						
    },
	function(){
		this.title = this.t2;	
		$("#preview").remove();
    });	
	$("a.preview").mousemove(function(e){
		$("#preview")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});	
};


// starting the script on page load
$(document).ready(function(){
	imagePreview();
});