/*
 * 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
 *
 */
var inner_html = "";
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 */

	jQuery("td.preview_pictures").hover(function(e){
		this.t = this.title;
		inner_html = jQuery("#img_preview_full").html();
		jQuery("#img_preview_full").html("<p id='preview_goes'></p>");								 
		jQuery("#preview_goes")
			.css("position","absolute")
			.css("overflow","hidden")
			.css("z-index","999")
			.css("width","561px")
			.css("height","250px")
			.css("background-color","white")
			.css("border","1px solid #ccc")
			.css("padding","5px")
			.css("text-align","center");
	  },
	      function(){
		      this.title = this.t;
		      jQuery("#img_preview_full").html(inner_html);
	  });	

	jQuery("a.preview").hover(function(e){
		this.t = this.title;
		this.title = "";	
		var c = (this.t != "") ? "<br/>" + this.t : "";
		jQuery("#preview_goes").html("<img id='img_goes' src='"+ this.href +"' alt='Image preview' />");								 
		jQuery("#img_goes")
			.css("display","none")
			.fadeIn('400');	
    }, function(){});				
};


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