var trailimage=['',0,0];var offsetfrommouse=[50,-20]
var displayduration=1
var isIE=false;if(navigator.userAgent.indexOf("MSIE")!=-1&&navigator.userAgent.indexOf("Opera")==-1){isIE=true;}else{isIE=false;}
var defaultimageheight=50;var defaultimagewidth=50;var currSource='';title='no image yet';newHTML='<div id="trailimageid" style="position:absolute;visibility:visible;left:0px;top:0px;width:1px;height:1px;z-index:110;">';newHTML+='<div id="main_hover_container" style="padding:10px;margin:10px;border:1px solid black;background-color:white;width:'+trailimage[1]+'px">';newHTML+='<div id="swatch_title" style="text-align:center;font-weight:bold;width:100%;font-size:10px;">'+title+'</div>';newHTML+='<img id="hover_image_img" src="'+trailimage[0]+'" border="0" width="'+trailimage[1]+'px" height="'+trailimage[2]+'px" />';newHTML+='</div>';newHTML+='</div>';if(document.getElementById||document.all){document.write(newHTML);}
newHTML='';var called=0;function gettrailobj(){if(document.getElementById)
return document.getElementById("trailimageid").style
else if(document.all)
return document.all.trailimagid.style}
function gettrailobj_nostyle(){if(document.getElementById)
return document.getElementById("trailimageid")
else if(document.all)
return document.all.trailimagid}
function showtrail(imagename,title,width,height){var img=document.getElementById('hover_image_img');img.style.visibility='visible';img.style.width=width+'px';img.style.height=height+'px';var div_cont=document.getElementById('main_hover_container');div_cont.style.width=width+'px';i=imagename
t=title
w=width
h=height
show(i,t,w,h);}
function show(imagepath,title,width,height){trailimage=[imagepath,width,height];var obj=gettrailobj_nostyle();obj.style.visibility='visible';newHTML='';defaultimageheight=height+100;defaultimagewidth=width;divWidth=width;var img=document.getElementById('hover_image_img');var tit=document.getElementById('swatch_title');tit.innerHTML=title;img.src=imagepath;newHTML+='<div style="padding:10px;margin:10px;border:1px solid black;background-color:white;width:'+divWidth+'px">';newHTML+='<div id="swatch_title" style="text-align:center;font-weight:bold;width:100%;font-size:10px;">'+title+'</div>';newHTML+='<img id="im1" src="'+img.src+'" border="0" width="'+width+'px" height="'+height+'px" />';newHTML+='</div>';document.onmousemove=followmouse;}
function truebody(){return(!window.opera&&document.compatMode&&document.compatMode!="BackCompat")?document.documentElement:document.body}
function hidetrail(){gettrailobj().visibility="hidden"
gettrailobj().left='-1000px';var img=document.getElementById('hover_image_img');img.style.visibility='hidden';document.onmousemove=""}
function followmouse(e){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(window.innerHeight)
if(typeof e!="undefined"){if(docwidth-e.pageX<defaultimagewidth+2*offsetfrommouse[0]){xcoord=e.pageX-xcoord-defaultimagewidth;}else{xcoord+=e.pageX;}
if(docheight-e.pageY<defaultimageheight+2*offsetfrommouse[1]){ycoord+=e.pageY-Math.max(0,(2*offsetfrommouse[1]+defaultimageheight+e.pageY-docheight-truebody().scrollTop));}else{ycoord+=e.pageY;}}else if(typeof window.event!="undefined"){if(docwidth-event.clientX<defaultimagewidth+2*offsetfrommouse[0]){xcoord=event.clientX+truebody().scrollLeft-xcoord-defaultimagewidth-100;}else{xcoord+=truebody().scrollLeft+event.clientX}
if(docheight-event.clientY<(defaultimageheight+2*offsetfrommouse[1])){ycoord+=event.clientY+truebody().scrollTop-Math.max(0,(2*offsetfrommouse[1]+defaultimageheight+event.clientY-docheight));}else{ycoord+=truebody().scrollTop+event.clientY;}}
gettrailobj().left=xcoord+"px"
gettrailobj().top=ycoord+"px"
if(isIE){document.onmousemove='';}
debug('Top: '+ycoord+"px"+' Left: '+xcoord+"px");}
function debug(msg){}
hidetrail();
