/*
* Url 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.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(".jpg", "_big.jpg");
        $("body").append("<p id='screenshot'><img src='" + source + "' alt='' />" + c + "</p>");
        $("#screenshot")
			.css("top", (e.pageY - yOffset) + "px")
			.css("left", (e.pageX + xOffset) + "px")
			.fadeIn("fast");
    },

	function() {
	    this.title = this.t;
	    $("#screenshot").remove();
	});

    $("img.preview").mousemove(function(e) {
        $("#screenshot")
			.css("top", (e.pageY - yOffset) + "px")
			.css("left", (e.pageX + xOffset) + "px");
    });
};

// starting the script on page load
$(document).ready(function() {
    screenshotPreview();
});


/*
Share on facebook
*/
function fbs_click() {
    u = location.href;
    t = document.title;
    window.open('http://www.facebook.com/sharer.php?u=' + encodeURIComponent(u) + '&t=' + encodeURIComponent(t), 'sharer', 'toolbar=0,status=0,width=626,height=436');
    return false;
}
