/*
Simple Image Trail script- By JavaScriptKit.com
Visit http://www.javascriptkit.com for this script and more
This notice must stay intact
*/

var offsetfrommouse=[0,0]; //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 = 100;	// maximum image size.

var currentimagewidth = 100;	// maximum image size.
var timer;

function gettrailobj(){
if (document.getElementById)
return document.getElementById("preview_div").style
}

function gettrailobjnostyle(){
if (document.getElementById)
return document.getElementById("preview_div")
}


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,height,nleft1,ntop1){
	i = imagename
	t = title
	s = showthumb
	h = height
	gettrailobj().left="+" + (500 + nleft1) + "px"
	s1 = nleft1
	s2 = ntop1
	timer = setTimeout("show('"+i+"',t,s,h,s1,s2);",100);
}
function show(imagename,title,showthumb,height,nleft2,ntop2){
    var docwidth=document.all? truebody().scrollLeft+truebody().clientWidth : pageXOffset+window.innerWidth - offsetfrommouse[0]
	var docheight=document.all? Math.min(truebody().scrollHeight, truebody().clientHeight) : Math.min(window.innerHeight)

if( (navigator.userAgent.indexOf("Firefox")!=-1 || (navigator.userAgent.indexOf("Opera")==-1 && navigator.appVersion.indexOf("MSIE")!=-1)) && (docwidth>50 && docheight>50)) {

//		document.onmousemove=followmouse;

		newHTML = '<div class="border_preview"><div id="loader_container"><div id="loader"><div align="center"><img border="0" src="loading6.gif" ></div></div></div>';
		if (showthumb > 0){
                             newHTML = newHTML + '<div class="preview_temp_load"><img onload="javascript:remove_loading();" src="' + imagename + '" border="0"   onclick="hidetrail();" style="width:' + showthumb + 'px; height: ' + height + 'px"></div>';
		}

		newHTML = newHTML + '</div>';
		if(navigator.userAgent.indexOf("Firefox")==-1){
			newHTML = newHTML+'<iframe src="about:blank" scrolling="no" frameborder="0" height="0" width="0"></iframe>';
		}
		gettrailobjnostyle().innerHTML = newHTML;
		gettrailobj().display="block";
		gettrailobj().left=nleft2+"px"
	        gettrailobj().top=ntop2+"px"
	}
}


