// Global variables
	xMousePos = 0; // Horizontal position of the mouse on the screen
	yMousePos = 0; // Vertical position of the mouse on the screen
	xMousePosMax = 0; // Width of the page
	yMousePosMax = 0; // Height of the page

	imgWidth = 0; // width of loaded img
	imgHeight = 0; // height of loaded img
	imgLoaded = 0; // state: 1=loaded, 0=not

	divWidth = 0; // width of preview div
	divHeight = 0; // height of preview div

	ie = 0; // set 1 if client browser is ie

var tval, tout;

// check browser
if (document.layers) { // Netscape
	document.captureEvents(Event.MOUSEMOVE);
	document.onmousemove = captureMousePosition;
} else if (document.all) { // Internet Explorer
	ie = 1;
	document.onmousemove = captureMousePosition;
} else if (document.getElementById) { // Netcsape 6
	document.onmousemove = captureMousePosition;
}

// function to capture position
function captureMousePosition(e) {
	if (document.layers) {
		xMousePos = e.pageX - window.pageXOffset;
		yMousePos = e.pageY - window.pageYOffset;
		xMousePosMax = window.innerWidth+window.pageXOffset;
		yMousePosMax = window.innerHeight+window.pageYOffset;
	} else if (document.all) {
		xMousePos = window.event.x-document.body.scrollLeft;
		yMousePos = window.event.y-document.body.scrollTop;
		xMousePosMax = document.body.clientWidth;
		yMousePosMax = document.body.clientHeight;
	} else if (document.getElementById) {
		xMousePos = e.clientX;
		yMousePos = e.clientY;
		xMousePosMax = window.innerWidth;
		yMousePosMax = window.innerHeight;
	}
}


