/*
Simple Image Trail script- By JavaScriptKit.com
Visit http://www.javascriptkit.com for this script and more
This notice must stay intact
*/
var offsetfrommouse=[5,5];
var displayduration=0; //duration in seconds. 0 for always.
var currentimageheight = 250;	// maximum image size.
if (document.getElementById || document.all){
	document.write('<div id="showtrail">');
	document.write('</div>');
}

function gettrailobj(){
if (document.getElementById && document.getElementById("showtrail"))
return document.getElementById("showtrail").style
else if (document.all)
return document.all.showtrail.style
}

function gettrailobjnostyle(){
if (document.getElementById && document.getElementById("showtrail"))
return document.getElementById("showtrail")
else if (document.all)
return document.all.showtrail
}

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

function showtrail(imagename,type,title,width,height){
	document.onmousemove=followmouse;
	var newHTML = '<table border="0" width="250" cellpadding="2" cellspacing="2">';
	newHTML = newHTML + '<tr><td width="100%" valign="top">';
		newHTML = newHTML + '<table width="250">';
	newHTML = newHTML + '<tr><td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">';
	newHTML = newHTML + '<tr><td width="100%">';
	if(type=='image'){
		newHTML = newHTML + '<div align="center" style="padding:5px;background:#fff;border:solid 1px #000">';
		newHTML = newHTML + '<img src="' + imagename + '" border="0"">';
		newHTML = newHTML + '</div>';
	}
	if(type=='flashvid') {
		var browser=navigator.appName;
		var b_version=navigator.appVersion;
		var version=parseFloat(b_version);
		if ((browser=="Microsoft Internet Explorer") && (version>=4)){
			addon1 = "";
			addon2 = "";
		} else {
			addon1 = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+width+'" height="'+height+'">';
			addon2 = '</object>';
		}
		tmp = 	'<div style="border:solid 5px #fff;width:'+width+'px;height:'+height+'">'+addon1+'<embed'
		+'		src="' + imagename + '"'
		+'		width="'+width+'"'
		+'		height="'+height+'"'
		+'		allowscriptaccess="sameDomain"'
		+'		allowfullscreen="false"'
		+'		flashvars=autostart=true&repeat=true&height='+height+'&width='+width+'&file='+imagename+'&searchbar=false&showicons=false&shownavigation=false&showdigits=false&usefullscreen=false"'
		+'		/>'+addon2+'</div>';
		newHTML = newHTML + '<div align="center" style="border:solid 1px #000">';
		newHTML = newHTML += tmp;
		newHTML = newHTML + '</div>';
	}
	gettrailobjnostyle().innerHTML = newHTML;
	gettrailobj().visibility="visible";
}

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

function followmouse(e){
	var xcoord=offsetfrommouse[0]
	var ycoord=offsetfrommouse[1]
	if (typeof e != "undefined"){
		xcoord+=e.pageX
		ycoord+=e.pageY
	} else if (typeof window.event != "undefined"){
		xcoord+=truebody().scrollLeft+event.clientX
		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)
	gettrailobj().left=xcoord-150+"px"
	gettrailobj().top=ycoord+5+"px"
}

