/*
Simple Image Trail script- By JavaScriptKit.com
Visit http://www.javascriptkit.com for this script and more
This notice must stay intact
*/

var w=1
var h=1

if (document.getElementById || document.all)
document.write('<div id="trailimageid_video" style="position:absolute;visibility:hidden;left:0px;top:-1000px;width:1px;height:1px;border:1px solid #888888;background:#DDDDDD;z-index:1000;"><div id="flashflv"></div></div>')

function gettrailobj_video()
{
        if (document.getElementById) return document.getElementById("trailimageid_video").style
        else if (document.all) return document.all.trailimagid_video.style
}

function truebody_video()
{
        return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function hidetrail_video()
{
        document.onmousemove=""
        //document.getElementById('flashflv').innerHTML = '';
        gettrailobj_video().visibility="hidden"
        gettrailobj_video().left=-1000
        gettrailobj_video().top=0
}


function showtrail_video(width,height,file,express)
{
        if(navigator.userAgent.toLowerCase().indexOf('opera') == -1)
        {
                newHTML = '';
                w_video=width
                h_video=height

                // followmouse()

                gettrailobj_video().visibility="visible"
                gettrailobj_video().width=w_video+"px"
                gettrailobj_video().height=h_video+"px"

                flashdiv = document.getElementById('flashflv');
                var so = new SWFObject(file, 'flvplayer', '320', height, '8', '#FFFFFF' );
                so.useExpressInstall(express);
                so.addParam('menu', 'false');
                so.write(flashdiv);

                document.onmousemove=followmouse_video
        }
}


function followmouse_video(e_video)
{

        if(navigator.userAgent.toLowerCase().indexOf('opera') == -1)
        {

                var xcoord_video=20
                var ycoord_video=20

                if (typeof e_video != "undefined")
                {
                        xcoord_video+=e_video.pageX
                        ycoord_video+=e_video.pageY
                }
                else if (typeof window.event !="undefined")
                {
                        xcoord_video+=truebody_video().scrollLeft+event.clientX
                        ycoord_video+=truebody_video().scrollTop+event.clientY
                }

                var docwidth_video=document.all? truebody_video().scrollLeft+truebody_video().clientWidth : pageXOffset+window.innerWidth-15
                var docheight_video=document.all? Math.max(truebody_video().scrollHeight, truebody_video().clientHeight) : Math.max(document.body.offsetHeight, window.innerHeight)

                if (xcoord_video+w_video+3>docwidth_video)
                xcoord_video=xcoord_video-w_video-(20*2)

                if (ycoord_video-truebody_video().scrollTop+h>truebody_video().clientHeight)
                ycoord_video=ycoord_video-h_video-20;

                gettrailobj_video().left=xcoord_video+"px"
                gettrailobj_video().top=ycoord_video+"px"

        }

}
