var offsetfrommouse=[15,15]; //image x,y offsets from cursor position in pixels. Enter 0,0 for no offset



var displayduration=1; //duration in seconds image should remain visible. 0 for always.



var currentimageheight = 450;        // maximum image size.



var t_id = 0;



var currentimagewidth = 430;        // maximum image size.



var timer;







var pos=0;



var dir=2;



var len=0;







function getSize() {



        var myWidth = 0, myHeight = 0;



        if( typeof( window.innerWidth ) == 'number' ) {



                myWidth = window.innerWidth; myHeight = window.innerHeight;



        } else if( document.documentElement && ( document.documentElement.clientWidth ||document.documentElement.clientHeight ) ) {



                myWidth = document.documentElement.clientWidth; myHeight = document.documentElement.clientHeight;



        } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {



                myWidth = document.body.clientWidth; myHeight = document.body.clientHeight;



        }



        return [myWidth,myHeight];



}



function getScrollXY() {



        var scrOfX = 0, scrOfY = 0;



        if( typeof( window.pageYOffset ) == 'number' ) {



                scrOfY = window.pageYOffset; scrOfX = window.pageXOffset;



        } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {



                scrOfY = document.body.scrollTop; scrOfX = document.body.scrollLeft;



        } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {



                scrOfY = document.documentElement.scrollTop; scrOfX = document.documentElement.scrollLeft;



        }



        return[scrOfX,scrOfY];



}







function gettrailobj(){



if (document.getElementById)



return document.getElementById("preview_div").style



else if (document.all)



return document.all.trailimagid.style



}







function gettrailobjnostyle(){



if (document.getElementById)



return document.getElementById("preview_div")



else if (document.all)



return document.all.trailimagid



}











function truebody(){



return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body



}











function hidetrail(){



        gettrailobj().display= "none";



        document.onmousemove=""



        gettrailobj().left="-500px"



        clearTimeout(timer);



}







function showtrail(imagename,title,showthumb){



        i = imagename



        t = title



        s = showthumb



        timer = setTimeout("show('"+i+"',t,s);",200);



}



function show(imagename,title,showthumb){



        document.onmousemove=followmouse;

        t_id = setInterval(animate,20);



        newHTML = '<div class="border_preview"><div id="loader_container"><img src="images/ajax-loader.gif" border="0" alt=""></div>';

        if (showthumb > 0){

    newHTML = newHTML + '<div align="center" style="padding: 10px;"><img onload="javascript:remove_loading();" src="' + imagename + '" border="0"></div>';



        newHTML = newHTML + '</div>';

        framewidth = currentimagewidth+20;

        //if ((navigator.userAgent.indexOf("Firefox")==-1) && (navigator.userAgent.indexOf("Opera")==-1) ) {        newHTML = newHTML+'';}

        if ((navigator.userAgent.indexOf("Firefox")==-1) && (navigator.userAgent.indexOf("Opera")==-1) ) {        newHTML = newHTML+'';}



        var obj_id = gettrailobjnostyle()

        obj_id.innerHTML = newHTML;



        gettrailobj().display="block";



}







function followmouse(e){







        var xcoord=offsetfrommouse[0]



        var ycoord=offsetfrommouse[1]







        var windowWidth = getSize()[0];



        var windowHeight = getSize()[1];



        var windowScrollX = getScrollXY()[0];



        var windowScrollY = getScrollXY()[1];







        var browserSpecOffset = 0;







        ycoord = windowScrollY+(windowHeight-currentimageheight) / 2;







        if ((typeof e != "undefined") && (navigator.userAgent.indexOf("Opera")==-1)) {



                xcoord += e.pageX;



                browserSpecOffset = 50;



        }







        if ((typeof window.event != "undefined") && (navigator.userAgent.indexOf("Opera")==-1)){



                xcoord += event.clientX;



                browserSpecOffset = 30;



        }







        if (navigator.userAgent.indexOf("Opera")!=-1) {



                xcoord += window.event.clientX;



                browserSpecOffset = 50;



        }







        if (xcoord+currentimagewidth+browserSpecOffset>windowWidth) {



                e = e || window.event;



                if (e.pageX || e.pageY) {



                        xcoord = e.pageX-currentimagewidth-30;



            } else {



                        xcoord = e.clientX-currentimagewidth-30;



        }



                //xcoord += currentimagewidth-windowWidth;



        }



        if (xcoord<0) {



                xcoord += browserSpecOffset+offsetfrommouse[0];



        }







        gettrailobj().left = xcoord+"px";



        gettrailobj().top = ycoord+"px";



}



}







function animate()



{



        var elem = document.getElementById('progress');



        if(elem != null) {



                if (pos==0) len += dir;



                if (len>32 || pos>79) pos += dir;



                if (pos>79) len -= dir;



                if (pos>79 && len==0) pos=0;



                elem.style.left = pos;



                elem.style.width = len;



        }







}







function remove_loading() {



        this.clearInterval(t_id);



        var targelem = document.getElementById('loader_container');



        targelem.style.display='none';



        targelem.style.visibility='hidden';



        //var t_id = setInterval(animate,60);



}







function hosting()

        {

window.open("http://servers4flash.com/free-hosting/", "_blank", "");

        }


