/*
Simple Image Trail script- By JavaScriptKit.com
Visit http://www.javascriptkit.com for this script and more
This notice must stay intact
*/

var offsetfrommouse=[15,15]; //image x,y offsets from cursor position in pixels. Enter 0,0 for no offset
var offsetfrommouse1=[200,150]; //image x,y offsets from cursor position in pixels. Enter 0,0 for no offset
var displayduration=0; //duration in seconds image should remain visible. 0 for always.
var currentimageheight = 270;   // maximum image size.

if (document.getElementById || document.all){
        document.write('<div id="trailimageid">');
        document.write('</div>');
}

function gettrailobj(){
if (document.getElementById)
return document.getElementById("trailimageid").style
else if (document.all)
return document.all.trailimagid.style
}

function gettrailobjnostyle(){
if (document.getElementById)
return document.getElementById("trailimageid")
else if (document.all)
return document.all.trailimagid
}

function truebody(){
return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}
var playerMouseOffset = 0;



function showtrail(imagename,type,title,description,ratingaverage,ratingnumber,showthumb,height,downloads,format,width,height,catid,loopable,mouseOffset,subcat1,subcat2,subcat3,keywords,category,copyright,audiocat){
        if (typeof catid == 'undefined' ) {
                catid = 0;
        }
        if (typeof loopable == 'undefined' ) {
                loopable = 0;
        }
        if (typeof mouseOffset == 'undefined' ) {
                mouseOffset = 0;
        }
        playerMouseOffset = mouseOffset;
	if (typeof subcat1 == 'undefined' ) {
                subcat1 = 0;
        }
        if (typeof subcat2 == 'undefined' ) {
                subcat2 = 0;
        }
        if (typeof subcat3 == 'undefined' ) {
                subcat3 = 0;
        }
        if (typeof keywords == 'undefined' ) {
                keywords = '';
        }
        if (typeof category == 'undefined' ) {
                category = '';
        }
        if (typeof copyright == 'undefined' ) {
                copyright = '';
        }

        if (typeof themePath == 'undefined' ) {
                themePath = '';
        }

        if (height > 0){
                currentimageheight = height;
        }
        playerMouseOffset = mouseOffset;
        document.onmousemove=followmouse;

        cameraHTML = '';

        if (ratingnumber == 0){
                ratingaverage = 0;
        }

        for(x = 1; x <= 5; x++){

                if (ratingaverage >= 1){
                        cameraHTML = cameraHTML + '<img src="' + themePath + '/images/camera_1.gif">';
                } else if (ratingaverage >= 0.5){
                        cameraHTML = cameraHTML + '<img src="' + themePath + '/images/camera_05.gif">';
                } else {
                        cameraHTML = cameraHTML + '<img src="' + themePath + '/images/camera_0.gif">';
                }

                ratingaverage = ratingaverage - 1;

        }

        cameraHTML = cameraHTML + ' (' + ratingnumber + ' Review';
        if ( ratingnumber != 1 ) cameraHTML += 's';
        cameraHTML = cameraHTML + ')';
	
	if(ratingnumber == 'info') {
		// change the display based on what was passed to us
			var newHTML = '<table border="0" width="500" cellpadding="3" cellspacing="3" bgcolor="#666666"><tr><td width="50%" valign="top">';

      		newHTML = newHTML + '<table class="thin" width="222">';
        	newHTML = newHTML + '<tr><td width="100%">';
          newHTML = newHTML + '<p align="center">';

        	if (showthumb > 0){
                	if(type=='photo')
		        	newHTML = newHTML + '<div align="center" style="padding: 0px 0px 0px 0px;"><img src="' + imagename + '" border="0"></div>';
                	if(type=='video' || type=='ae') {
				temp = '<div align="center" style="padding: 0px 0px 0px 0px; background-color: black;">'
                        + '<a class=player href="' + imagename + '" style="display:block;width:266px;height:' + height + 'px;"></a>'
                        + '</div>'; }
		if(type=='audio') {
				temp = '<div align="center" style="padding: 0px 0px 0px 0px; background-color: white;width:266px;height:177px;" class="player">'
                        + '</div>';
}


                   		newHTML += temp;

				  newHTML = newHTML + '</td></tr>';
        	newHTML = newHTML + '</table>';
  				newHTML = newHTML + '</td><td width="50%" height="100%" align="left" valign="top">';
  				newHTML = newHTML + '<font color="#F0F0F0">';
  				newHTML = newHTML + '<b>DESCRIPTION:</b><br>';
  				if (description != ''){
  				newHTML = newHTML + '' +description+ '';
  				} else {
          newHTML = newHTML + 'You have not added a description for this file.  Please click the EDIT icon to add one.';
          }
  				newHTML = newHTML + '<br><br>';
  			  newHTML = newHTML + '<b>KEYWORDS:</b><br>';
  				if (keywords != ''){
  				newHTML = newHTML + '' +keywords+ '';
  				} else {
          newHTML = newHTML + 'You have not added any keywords for this file.  Please click the EDIT icon to add some keywords.';
          }
  				newHTML = newHTML + '<br><br>';
  						  newHTML = newHTML + '<b>CATEGORIES:</b><br>';
  				if (format != ''){
  				newHTML = newHTML + 'Main: ' +category+ '';
  				} else {
          newHTML = newHTML + 'IMPORTANT:  The primary category missing!  Click EDIT to repair.';
          }
  				newHTML = newHTML + '<br>';
 		 
  				if (subcat1 != '' || subcat2 != '' || subcat3 !=''){
  				newHTML = newHTML + 'Sub Category 1: ' +subcat1+ '<br>';
  				if (subcat2 != ''){
          newHTML = newHTML + 'Sub Category 2: ' +subcat2+ '<br>';
          } 
          if (subcat3 != ''){
  				newHTML = newHTML + 'Sub Category 3: ' +subcat3+ '';
  				 } 
  				newHTML = newHTML + '';
  				
  				} else {
          newHTML = newHTML + 'You have not added any sub-categories for this file. Please click the edit icon to add some sub-categories.';
          }
  				newHTML = newHTML + '<br><br>';
  				newHTML = newHTML + '</font>';
  				newHTML = newHTML + '</td></tr></table>';
  				
  				
  				
  				
  				
                	}
			
  				
  				}
  				
  				
  	else if(ratingnumber == 'notes') {
		// change the display based on what was passed to us
			var newHTML = '<table border="0" width="200" cellpadding="3" cellspacing="3" bgcolor="#666666"><tr><td width="100%" valign="top">';

      		newHTML = newHTML + '<table class="thin" width="222">';
        	newHTML = newHTML + '<tr><td width="100%">';
          newHTML = newHTML + '<p align="left"><b>REVIEWER NOTES:</b><br>' + description + '</p>';



				  newHTML = newHTML + '</td></tr>';
        	newHTML = newHTML + '</table>';
  				newHTML = newHTML + '</td>';
  				newHTML = newHTML + '</tr></table>';
  				
  				
  				
  				
  				
                	}
			
  				
  							
  				
	
	
	else if(copyright != '' || category != '') {
		if(type == 'video' || type == 'ae') {
	                if(width <= 0) {
       	                	width = 266;
       	         	}
                	if(height > 0) {
                        	var factor = width / 266;
                        	if(factor != 0) {
                                	var new_height = height / factor;
                                	if(new_height > 100) {
                                        	height = new_height;
                                	}
                                	else {
                                        	height = 150;
                                	}
                        	}
                        	else {
                                	width = 266;
                                	height = 150;
                        	}
                	}
                	else {
                        	height = 150;
                	}
                	width = 266;
        	}
		if (height > 0){
                	currentimageheight = height;
        	}
		var newHTML = '<table border="0" width="240" cellpadding="3" cellspacing="3" bgcolor="#666666">';
  		newHTML = newHTML + '<tr><td width="100%" valign="top">';
      		newHTML = newHTML + '<table class="thin" width="222">';
        	newHTML = newHTML + '<tr><td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">';
              	newHTML = newHTML + '<tr><td width="100%"><p align="center">';

        	if (showthumb > 0){
                	if(type=='photo')
		        	newHTML = newHTML + '<div align="center" style="padding: 0px 0px 0px 0px;"><img src="' + imagename + '" border="0"></div>';
                	if(type=='video') {
				temp = '<div align="center" style="padding: 0px 0px 0px 0px; background-color: black;">'
                        + '<a class=player href="' + imagename + '" style="display:block;width:266px;height:' + height + 'px;"></a>'
                        + '</div>';


                   		newHTML += temp;

				newHTML = newHTML + '</td></tr><tr><td width="100%" bgcolor="#FFFFFF">';
                  		newHTML = newHTML + '<table border="0" width="100%" cellpadding="2"><tr>';
	                      	newHTML = newHTML + '<td width="100%"><font face="Tahoma" size="1">'+title+'</font>';
	                      	newHTML = newHTML + '<br><font face="Tahoma" size="1">&#169;' +copyright+ '</font></td></tr>';
        		      	newHTML = newHTML + '</table></td></tr>';
            			newHTML = newHTML + '</table></td></tr></table></td></tr>';
  				newHTML = newHTML + '<tr><td width="100%" valign="top"><font face="Tahoma" color="#ffffff" size="1">Station:'+format+'</font></td>';
  				newHTML = newHTML + '</tr></table>';
                	}
			if(type=='audio') {
				temp = '<div align="center" style="padding: 0px 0px 0px 0px; background-color: white;width:266px;height:177px;" class="player">'
                        + '</div>';



                   		newHTML += temp;

    				newHTML = newHTML + '</td></tr><tr><td width="100%" bgcolor="#FFFFFF">';
                  		newHTML = newHTML + '<table border="0" width="100%" cellpadding="2"><tr>';
                      		newHTML = newHTML + '<td width="100%"><font face="Tahoma" size="1">'+title+'</font>';
                     		newHTML = newHTML + '<br><font face="Tahoma" size="1">&#169;' +copyright+ '</font></td></tr>';
                  		newHTML = newHTML + '</table></td></tr>';
            			newHTML = newHTML + '</table></td></tr></table></td></tr>';
  				newHTML = newHTML + '<tr><td width="100%" valign="top"><font face="Tahoma" size="1">Stock Audio<br></font></td>';
  				newHTML = newHTML + '</tr></table>';

                	}
        	}
	}
	else {
        	newHTML = '<table bgcolor="white" width="222" cellpadding="0" cellspacing="0" border="0" style="border:0px solid #000000;"><tr><td width="0%">';
		if (showthumb > 0){
                	if(type=='photo')
                	newHTML = newHTML + '<div align="center" style="padding: 0px 0px 0px 0px;"><img src="' + imagename + '" border="0"></div>';
                	if(type=='video' || type=='ae') {
				 temp = '<div align="center" style="padding: 0px 0px 0px 0px; background-color: black;">'
                        + '<a class=player href="' + imagename + '" style="display:block;width:266px;height:' + height + 'px;"></a>'
                        + '</div>';

                   		newHTML += temp;

				newHTML = newHTML + '</td><td width="100%" valign="top" style="font-family:Verdana; font-size:12px;">';
        			newHTML = newHTML + '<div style="padding: 0px; background-color: #000000;">';


                	}

                	if(type=='audio') {
				 temp = '<div align="center" style="padding: 0px 0px 0px 0px; background-color: white;width:266px;height:177px;" class="player">'
                        + '</div>';

                   		newHTML += temp;
        			newHTML = newHTML + '<div style="padding: 0px; background-color: #000000;">';

                	}
        	}
        	newHTML = newHTML + '</div></td></tr></table>';
	}

        gettrailobjnostyle().innerHTML = newHTML;

        if(type=='audio') {
		
		$f("div.player", "flowplayer.commercial-3.1.5.swf", {
           		key: '$a281055cb163f683c7f',

    // first entry in the playlist works as splash and second entry is the audio file
    playlist: ['http://www.revostock.com/themes/indiefootage/images/' + catid + 'medium.jpg', imagename],

    			// fullscreen button not needed here
    			plugins: {
        			controls: null
    			},
    			clip: {
        			autoPlay: true
    			}
		});
	}
	else {
		flowplayer("a.player", "flowplayer.commercial-3.1.5.swf", {
           		key: '$a281055cb163f683c7f',

        		clip: {
            			autoPlay: true,
            			autoBuffering: true,
            			onBeforeFinish: function() {
                			// returning false prevents the default
                			// behavior associated with this event --->
                			// it will loop instead of stop at finish
                			return false;
            			}
          		},
        		logo: {
            			opacity: 0
        		},

        		canvas: {backgroundColor: "#48494b"},

			plugins: {
 				controls: null
			}
        	});
	}



        gettrailobj().visibility="visible";

}


function showtrailhelp(title, helpnotes, vidimage,rate){

        mouseOffset = 0;
        playerMouseOffset = mouseOffset;
        document.onmousemove=followmouse2;



		// change the display based on what was passed to us
	


   var newHTML = '<div style="width:231px;left: -400px; top: 230px; height:auto; float:left;">';
newHTML = newHTML + '<div style="width:31px; float:left; padding-top:35px; height:175px;"><img src="images/left_image.gif" alt="" width="31" height="49" /></div>';
newHTML = newHTML + '<div style="width:200px; height:250px; float:left;">';
newHTML = newHTML + '<div style="float:left; width:12px; height:40px;"><img src="images/top_lc.gif" alt="" width="12" height="40" /></div>';
newHTML = newHTML + '<div style="float:left; width:176px; height:40px; background:url(images/top_bg.gif) repeat-x;"><h1>' +  title +' </h1></div>';
newHTML = newHTML + '<div style="float:left; width:12px; height:40px;"><img src="images/top_rc.gif" alt="" width="12" height="40" /></div>';
newHTML = newHTML + '<div style="width:200px; height:auto; background:#FFFFFF; float:left;">';
     newHTML = newHTML + '<div  class="normal_text" style="float:left; width:94px; height:auto; margin:8px 5px 4px 6px;">' + helpnotes + '</div>';
	 newHTML = newHTML + '<div  class="Link_text"style="width:89px; height:auto; float:left; margin:8px 6px 5px 0px;"><img src="' + vidimage + '" alt="" width="84" height="117" align="right" style="padding-bottom:10px;" /></div>';
    newHTML = newHTML + '<div style="width:200px; height:auto; float:left;">';
	newHTML = newHTML + '<div style="float:left; width:6px; height:32px;"><img src="images/footer_lc.gif" width="6" height="32" /></div>';
    newHTML = newHTML + '<div  class="normal_text"style="float:left; width:188px; height:21px; background:#FFFFFF; border-top:1px solid #e2e0e1; padding-top:10px;">';
	if(rate >0)
	{
	for(star=0;star<=rate; star++)
		{
			newHTML = newHTML + '<img src="images/star.jpg" alt="" width="12" height="11" />';
		}
		if(rate%1 !=0)
		{
			newHTML = newHTML + '<img src="images/h_star.jpg" alt="" width="8" height="10" /> ';
		}
	}

	newHTML = newHTML +  rate+' Average Rating</div>';
    newHTML = newHTML + '<div style="float:left; width:6px; height:32px;"><img src="images/footer_rc.gif" width="6" height="32" /></div>';
    newHTML = newHTML + '</div>';
newHTML = newHTML + '</div>';
newHTML = newHTML + '</div>';
    //newHTML = newHTML + '<tr>';
     // newHTML = newHTML + '<td width="100%" height="19"><img border="0" src="images/bubblebottom.png" width="287" height="19"></td>';
   // newHTML = newHTML + '</tr>';
  //newHTML = newHTML + '</table>';
//newHTML = newHTML + '</div>';


	

        gettrailobjnostyle().innerHTML = newHTML;

        gettrailobj().visibility="visible";

}

function showtrailhelp2(title, helpnotes){

        mouseOffset = -100;
        playerMouseOffset = mouseOffset;
        document.onmousemove=followmouse2;



		// change the display based on what was passed to us
	


   var newHTML = '<div style="width:290px;left: -400px; top: 250px; height:auto; float:left;">';
newHTML = newHTML + '<div style="width:31px; float:left; padding-top:45px; height:25px;"><img src="images/left_image.gif" alt="" width="31" height="29" /></div>';
newHTML = newHTML + '<div style="width:170px; height:50px; float:left;">';
newHTML = newHTML + '<div style="float:left; width:12px; height:40px;"><img src="images/top_lc.gif" alt="" width="12" height="40" /></div>';
newHTML = newHTML + '<div style="float:left; width:146px; height:40px; background:url(images/top_bg.gif) repeat-x;"><h1>' +  title +' </h1></div>';
newHTML = newHTML + '<div style="float:left; width:12px; height:40px;"><img src="images/top_rc.gif" alt="" width="12" height="40" /></div>';
newHTML = newHTML + '<div style="width:170px; height:auto; background:#FFFFFF; float:left;">';
     newHTML = newHTML + '<div  class="normal_text" style="float:left; width:150px; height:auto; margin:8px 5px 4px 6px;">' + helpnotes + '<br><br><br></div>';


    newHTML = newHTML + '</div>';
newHTML = newHTML + '</div>';
newHTML = newHTML + '</div>';
    //newHTML = newHTML + '<tr>';
     // newHTML = newHTML + '<td width="100%" height="19"><img border="0" src="images/bubblebottom.png" width="287" height="19"></td>';
   // newHTML = newHTML + '</tr>';
  //newHTML = newHTML + '</table>';
//newHTML = newHTML + '</div>';


	

        gettrailobjnostyle().innerHTML = newHTML;

        gettrailobj().visibility="visible";

}

function showtrailhelp3(title, helpnotes){

        mouseOffset = 120;
        playerMouseOffset = mouseOffset;
        document.onmousemove=followmouse3;



		// change the display based on what was passed to us
	


   var newHTML = '<div style="width:290px;left: -300px; top: 250px; height:auto; float:left;">';

newHTML = newHTML + '<div style="width:170px; height:50px; float:left;">';
newHTML = newHTML + '<div style="float:left; width:12px; height:40px;"><img src="images/top_lc.gif" alt="" width="12" height="40" /></div>';
newHTML = newHTML + '<div style="float:left; width:146px; height:40px; background:url(images/top_bg.gif) repeat-x;"><h1>' +  title +' </h1></div>';
newHTML = newHTML + '<div style="float:left; width:12px; height:40px;"><img src="images/top_rc.gif" alt="" width="12" height="40" /></div>';
newHTML = newHTML + '<div style="width:170px; height:auto; background:#FFFFFF; float:left;">';
     newHTML = newHTML + '<div  class="normal_text" style="float:left; width:150px; height:auto; margin:8px 5px 4px 6px;">' + helpnotes + '<br><br><br></div>';


    newHTML = newHTML + '</div>';
newHTML = newHTML + '</div>';
newHTML = newHTML + '<div style="width:31px; float:left; padding-top:45px; height:25px;"><img src="images/right_image.gif" alt="" width="31" height="29" /></div>';
newHTML = newHTML + '</div>';
    //newHTML = newHTML + '<tr>';
     // newHTML = newHTML + '<td width="100%" height="19"><img border="0" src="images/bubblebottom.png" width="287" height="19"></td>';
   // newHTML = newHTML + '</tr>';
  //newHTML = newHTML + '</table>';
//newHTML = newHTML + '</div>';


	

        gettrailobjnostyle().innerHTML = newHTML;

        gettrailobj().visibility="visible";

}

function hidetrail(){
	var foo = gettrailobj();
	if(foo) {
		foo.visibility = "hidden";
	}
	//gettrailobj().visibility="hidden";
	foo = gettrailobjnostyle();
	if(foo) {
		foo.innerHTML = "";
	}
	//gettrailobjnostyle().innerHTML=""
	document.onmousemove=""
	foo = gettrailobj();
	if(foo) {
		foo.left="-500px";
	}
	//gettrailobj().left="-500px"

}
function followmouse(e){

        if (typeof playerMouseOffset == 'undefined' ) {
                playerMouseOffset = 0;
        }

        var xcoord=offsetfrommouse[0]
        var ycoord=offsetfrommouse[1]

        var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
        var docheight=document.all? Math.min(truebody().scrollHeight, truebody().clientHeight) : Math.min(document.body.offsetHeight, window.innerHeight)
        //if (document.all){
        //      gettrailobjnostyle().innerHTML = 'A = ' + truebody().scrollHeight + '<br>B = ' + truebody().clientHeight;
        //} else {
        //      gettrailobjnostyle().innerHTML = 'C = ' + document.body.offsetHeight + '<br>D = ' + window.innerHeight;
        //}

        if (typeof e != "undefined"){
                if (docwidth - e.pageX < 300){
                        xcoord = e.pageX - xcoord - 286; // Move to the left side of the cursor
                } else {
                        xcoord += e.pageX;
                }
                if (docheight - e.pageY < (currentimageheight + 110)){
                        ycoord += e.pageY - Math.max(0,(110 + currentimageheight + e.pageY - docheight - truebody().scrollTop));
                } else {
                        ycoord += e.pageY;
                }

        } else if (typeof window.event != "undefined"){
                if (docwidth - event.clientX < 300){
                        xcoord = event.clientX + truebody().scrollLeft - xcoord - 286; // Move to the left side of the cursor
                } else {
                        xcoord += truebody().scrollLeft+event.clientX
                }
                if (docheight - event.clientY < (currentimageheight + 110)){
                        ycoord += event.clientY + truebody().scrollTop - Math.max(0,(110 + currentimageheight + event.clientY - docheight));
                } else {
                        ycoord += truebody().scrollTop + event.clientY;
                }
        }

        var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
        var docheight=document.all? Math.max(truebody().scrollHeight, truebody().clientHeight) : Math.max(document.body.offsetHeight, window.innerHeight)
      ycoord -= playerMouseOffset;
ycoord=ycoord-180;
        gettrailobj().left=xcoord+"px"
        gettrailobj().top=ycoord+"px"

}

function followmouse2(e){
if (typeof playerMouseOffset == 'undefined' ) {
                playerMouseOffset = 0;
        }

        var xcoord=offsetfrommouse[0]
        var ycoord=offsetfrommouse[0]

        var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
var docheight=document.all? Math.max(truebody().scrollHeight, truebody().clientHeight) : Math.max(document.body.offsetHeight, window.innerHeight)
        //if (document.all){
        //      gettrailobjnostyle().innerHTML = 'A = ' + truebody().scrollHeight + '<br>B = ' + truebody().clientHeight;
        //} else {
        //      gettrailobjnostyle().innerHTML = 'C = ' + document.body.offsetHeight + '<br>D = ' + window.innerHeight;
        //}

        if (typeof e != "undefined"){
                if (docwidth - e.pageX < 300){
                        xcoord = e.pageX - xcoord - 0; // Move to the left side of the cursor
                } else {
                        xcoord += e.pageX;
                }
                if (docheight - e.pageY < (currentimageheight + 110)){
                        ycoord += e.pageY - Math.max(0,(110 + currentimageheight + e.pageY - docheight - truebody().scrollTop));
                } else {
                        ycoord += e.pageY;
                }

        } else if (typeof window.event != "undefined"){
                if (docwidth - event.clientX < 300){
                        xcoord = event.clientX + truebody().scrollLeft - xcoord - 0; // Move to the left side of the cursor
                } else {
                        xcoord += truebody().scrollLeft+event.clientX
                }
                if (docheight - event.clientY < (currentimageheight + 0)){
                        ycoord += event.clientY + truebody().scrollTop - Math.max(0,(0 + currentimageheight + event.clientY - docheight));
                } else {
                        ycoord += truebody().scrollTop + event.clientY;
                }
        }


        ycoord -= playerMouseOffset;
		ycoord=ycoord-200;
//alert(ycoord);
        gettrailobj().left=xcoord+"px"
        gettrailobj().top=ycoord+"px"

}
function followmouse3(e){
if (typeof playerMouseOffset == 'undefined' ) {
                playerMouseOffset = 0;
        }

        var xcoord=offsetfrommouse1[0]
        var ycoord=offsetfrommouse1[0]

        var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth-15
var docheight=document.all? Math.max(truebody().scrollHeight, truebody().clientHeight) : Math.max(document.body.offsetHeight, window.innerHeight)
        //if (document.all){
        //      gettrailobjnostyle().innerHTML = 'A = ' + truebody().scrollHeight + '<br>B = ' + truebody().clientHeight;
        //} else {
        //      gettrailobjnostyle().innerHTML = 'C = ' + document.body.offsetHeight + '<br>D = ' + window.innerHeight;
        //}

        if (typeof e != "undefined"){
                if (docwidth - e.pageX < 300){
                        xcoord = e.pageX - xcoord - 0; // Move to the left side of the cursor
                } else {
                        xcoord += e.pageX;
                }
                if (docheight - e.pageY < (currentimageheight + 110)){
                        ycoord += e.pageY - Math.max(0,(110 + currentimageheight + e.pageY - docheight - truebody().scrollTop));
                } else {
                        ycoord += e.pageY;
                }

        } else if (typeof window.event != "undefined"){
                if (docwidth - event.clientX < 300){
                        xcoord = event.clientX + truebody().scrollLeft - xcoord - 0; // Move to the left side of the cursor
                } else {
                        xcoord += truebody().scrollLeft+event.clientX
                }
                if (docheight - event.clientY < (currentimageheight + 0)){
                        ycoord += event.clientY + truebody().scrollTop - Math.max(0,(0 + currentimageheight + event.clientY - docheight));
                } else {
                        ycoord += truebody().scrollTop + event.clientY;
                }
        }


        ycoord -= playerMouseOffset;
		ycoord=ycoord-200;
//alert(ycoord);
        gettrailobj().left=xcoord+"px"
        gettrailobj().top=ycoord+"px"

}

// call hidetrail once just to init things
// this prevents the first video from showing in the upper left momentarily in IE
hidetrail();
