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

var offsetfrommouse=[-35,-110]; //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 = 15;	// maximum image size.

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

function gettrailobjLarge(){
	if (document.getElementById)
		return document.getElementById("trailimageidLarge").style
	else if (document.all)
		return document.all.trailimageidLarge.style
}

function gettrailobjnostyleLarge(){
	if (document.getElementById)
		return document.getElementById("trailimageidLarge")
	else if (document.all)
		return document.all.trailimageidLarge
}


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

function showtrail(imagename, height) {

	if (height > 0){
		currentimageheight = height;
	}

	document.onmousemove=followmouseLarge;
	newHTML = '<div style="padding: 5px;">';
	newHTML = newHTML + '<div align="center" style="padding: 2px 2px 2px 2px;color:rgb(102, 102, 102)"><img src="' + imagename + '" border="0" hspace="0" vspace="0"></div>';
	newHTML = newHTML + '</div>';

	gettrailobjnostyleLarge().innerHTML = newHTML;
	gettrailobjLarge().visibility="visible";
}

function showtrailLarge(imagename,author,section,container,showthumb,height){

	if (height > 0){
		currentimageheight = height;
	}

	document.onmousemove=followmouseLarge;

	cameraHTML = '';
	newHTML = '<div align="center"  style="padding:3px;text-align:center;color:rgb(102, 102, 102);width:145px;height:74px;overflow:hidden"  class="smallText">';

	if (arguments.length > 1) { 

//		newHTML = newHTML + '<span>' + author + '</span>';
	}

	if (showthumb > 0 || arguments.length == 1){
		newHTML = newHTML + '<div class="floatBoxLarge"><img class="floatBoxImg "  src="' + imagename + '" border="0">' + '<br>' + author + ', ' + section ;
	}

	if (arguments.length > 1) { 
		newHTML = newHTML + '</div>';
	}

	gettrailobjnostyleLarge().innerHTML = newHTML;

	gettrailobjLarge().visibility="visible";

}

function hidetrailLarge(){
	gettrailobjLarge().visibility="hidden"
	document.onmousemove=""
	gettrailobjLarge().left="-500px"

}

function followmouseLarge(e){

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

	var docwidth=document.all? truebodyLarge().scrollLeft+truebodyLarge().clientWidth : pageXOffset+window.innerWidth-15
	var docheight=document.all? Math.min(truebodyLarge().scrollHeight, truebodyLarge().clientHeight) : Math.min(window.innerHeight)


	if (typeof e != "undefined"){
		if (docwidth - e.pageX < 230){
			xcoord = e.pageX - xcoord - 250; // Move to the left side of the cursor
		} else {
			xcoord += e.pageX;
		}
		
		ycoord += e.pageY;
		

	} else if (typeof window.event != "undefined"){
		if (docwidth - event.clientX < 230){
			xcoord = event.clientX + truebodyLarge().scrollLeft - xcoord - 250; // Move to the left side of the cursor
		} else {
			xcoord += truebodyLarge().scrollLeft+event.clientX
		}
		
		ycoord += truebodyLarge().scrollTop + event.clientY;
		
	}

	var docwidth=document.all? truebodyLarge().scrollLeft+truebodyLarge().clientWidth : pageXOffset+window.innerWidth-15
	var docheight=document.all? Math.max(truebodyLarge().scrollHeight, truebodyLarge().clientHeight) : Math.max(document.body.offsetHeight, window.innerHeight)
		if(ycoord < 0) { ycoord = ycoord*-1; }
	gettrailobjLarge().left=xcoord+"px"
	gettrailobjLarge().top=ycoord+"px"

}

