/*
Simple Image Trail script- By JavaScriptKit.com
Visit http://www.javascriptkit.com for this script and more
This notice must stay intact
*/

var offsetfrommouse=[10,10]; //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
}

function showtrail(imagename,title,description,showthumb,width,height,leftpos,toppos,beautyname){
	gettrailobj().width=width;

	if (height > 0){
		currentimageheight = height;
	}
	
	gettrailobj().left= leftpos + 'px';
	gettrailobj().top= toppos + 'px';

	newHTML = '<DIV style="border: 2px solid #888;"><div style=" background-color: #AAA; border: 1px solid #888;">';
	newHTML = newHTML + '<div style="padding: 5px;"><span style="font-weight: bold;">' + title + '</span><div></div>';
	newHTML = newHTML + description + '</div>';


	if (showthumb > 0){
		newHTML = newHTML + '<div align="center"><img src="' + imagename + '" border="0"></div>';
	}
		newHTML = newHTML + '</div></DIV>';


	gettrailobjnostyle().innerHTML = newHTML;

	gettrailobj().visibility="visible";

}


function hidetrail(){
	gettrailobj().visibility="hidden"
	gettrailobj().left="-500px"
}

function showAddOn(whichLayer, whichCheck, action)
{

	if (document.getElementById)
	{
		// this is the way the standards work
		if (action == 'show') { document.getElementById(whichLayer).style.display='block'; }
		if (action == 'hide') { 
			document.getElementById(whichLayer).style.display='none';
			if (whichCheck) { document.AddToCart[whichCheck].checked=false; }
		}
	}
	else if (document.all)
	{
		// this is the way old msie versions work
		if (action == 'show') { document.all[whichLayer].style.display='block'; }
		if (action == 'hide') { 
			document.all[whichLayer].style.display='none';
			if (whichCheck) { document.AddToCart[whichCheck].checked=false; }
		}
	}
	else if (document.layers)
	{
		// this is the way nn4 works
		if (action == 'show') { document.layers[whichLayer].style.display='block'; }
		if (action == 'hide') { 
			document.layers[whichLayer].style.display='none';
			if (whichCheck) { document.AddToCart[whichCheck].checked=false; }
		}
	}
}

