var xid;
		function showMouseImage(id) {
			xid=id;
			document.getElementById("mouseTrail").innerHTML = document.getElementById(id).innerHTML;
			//document.getElementById("mouseTrail").style.display = '';
			if ($.browser.msie) {
				document.getElementById("mouseTrail").style.display = '';
			} else {
				$('#mouseTrail').fadeIn(300);	
			}
			document.getElementById("mouseTrail").style.width = '600px';
			document.onmousemove=followmouse;
		}
		
		function hideMouseImage() {
			document.getElementById("mouseTrail").innerHTML = '';
			document.getElementById("mouseTrail").style.width = '1px';
			document.getElementById("mouseTrail").style.display = 'none';
			document.onmousemove='';
		}
		
		function gettrailobj(){
			if (document.getElementById)
				return document.getElementById("mouseTrail").style
			else if (document.all)
				return document.all.trailimagid.style
		}
		
		function truebody(){
			return (!window.opera && document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
		}
		
		function hideTrail(){
			gettrailobj().visibility="hidden"
			document.onmousemove=""
		}

		function clientWidth() {
			return filterResults (
				window.innerWidth ? window.innerWidth : 0,
				document.documentElement ? document.documentElement.clientWidth : 0,
				document.body ? document.body.clientWidth : 0
			);
		}

		function scrollLeft() {
			return filterResults (
				window.pageXOffset ? window.pageXOffset : 0,
				document.documentElement ? document.documentElement.scrollLeft : 0,
				document.body ? document.body.scrollLeft : 0
			);
		}

		function filterResults(n_win, n_docel, n_body) {
			var n_result = n_win ? n_win : 0;
			if (n_docel && (!n_result || (n_result > n_docel)))
				n_result = n_docel;
			return n_body && (!n_result || (n_result > n_body)) ? n_body : n_result;
		}

		function clientHeight() {
			return filterResults (
				window.innerHeight ? window.innerHeight : 0,
				document.documentElement ? document.documentElement.clientHeight : 0,
				document.body ? document.body.clientHeight : 0
			);
		}

		function scrollTop() {
			return filterResults (
				window.pageYOffset ? window.pageYOffset : 0,
				document.documentElement ? document.documentElement.scrollTop : 0,
				document.body ? document.body.scrollTop : 0
			);
		}
		
		function followmouse(e){
			var imageWidth = 150;
			var imageHeight = 149;
			var xcoord= 10;
			var ycoord= 10;
			var divHeight = $("#"+xid).height();
			var divWidth = $("#"+xid).width();
			var winHeight = scrollTop()+clientHeight();
			var winWidth = scrollLeft()+clientWidth();
			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
			}

			if (xcoord > (winWidth/2)+100) {
				xcoord=xcoord-612;
			}

			if (ycoord+divHeight+3> winHeight && (!$.browser.msie) ) {
				gettrailobj().display=""
				gettrailobj().left=xcoord+"px"
				gettrailobj().top=winHeight-divHeight+"px"					
			} else {
				gettrailobj().display=""
				gettrailobj().left=xcoord+"px"
				gettrailobj().top=ycoord+"px"
			}

						

		}

				

