/*
* Url preview script 
* powered by jQuery (http://www.jquery.com)
* 
* written by Alen Grakalic (http://cssglobe.com)
* modified by Tomas Matejka (http://axima-brno.cz)
* 
* for more info visit http://cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using-jquery
*
*/

this.screenshotPreview = function() {

    xOffset = 20;
    yOffset = 10;

    $("img.preview").hover(function(e) {
        this.t = this.title;
        this.title = "";
        var c = (this.t != "") ? "<br/>" + this.t : "";
        var source = this.src.replace("CoinSmallImage", "CoinFullImage");
        $("body").append("<p id='preview'><img src='" + source + "' alt='' /></p>");
        $("#preview")
			.css("top", (e.pageY - yOffset) + "px")
			.css("left", (e.pageX + xOffset) + "px")
			.fadeIn("fast");
    },

	function() {
	    this.title = this.t;
	    $("#preview").remove();
	});

    $("img.preview").mousemove(function(e) {
        $("#preview")
			.css("top", (e.pageY - yOffset) + "px")
			.css("left", (e.pageX + xOffset) + "px");
    });
};

// starting the script on page load
$(document).ready(function() {
    screenshotPreview();
});
