manage direction of tooltip image with jquery
<p>i wrote a image gallery and create thumbnail with  jquery.thumbs.
i want to when mouse over in image a tooltip with full size image show in side of thumbnail image.</p>

<p>for this i found below code from <a href="http://cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using-jquery" rel="nofollow">here</a> : </p>

<pre><code>$("a.screenshot").hover(function(e){
        this.t = this.title;
        this.title = "";    
        var c = (this.t != "") ? "&lt;br/&gt;" + this.t : "";
        $("body").append("&lt;p id='screenshot'&gt;&lt;img src='"+ this.rel +"' alt='url preview' /&gt;"+ c +"&lt;/p&gt;");                                

        if(e.offsetX &gt; e.pageX)
        {
            $("#screenshot")
            .css("top",(e.pageY - xOffset) + "px")
            .css("left",(e.pageX + yOffset) + "px")
            .fadeIn("fast");    
        }
        else
        {
            $("#screenshot")
            .css("top",(e.pageY) + "px")
            .css("left",(e.pageX )+ "px")
            .fadeIn("fast");
        }


    },
    function(){
        this.title = this.t;    
        $("#screenshot").remove();
    }); 
    $("a.screenshot").mousemove(function(e){
        if(e.offsetX &gt; e.pageX)
           $("#screenshot")
            .css("top",(e.pageY - xOffset) + "px")
            .css("left",(e.pageX + yOffset) + "px");
    });         
};
</code></pre>

<p>This code works well but I want when image size larger than the page size was large image on the right mouse button is displayed.</p>
