var cursor = {x:0, y:0};var isNN = document.layers ? true : false;var isIE = document.all ? true : false;if ( isNN )
document.captureEvents(Event.MOUSEMOVE);document.onmousemove = getPosition;function showPreview(url, img) {
var prevWin = document.getElementById("iPreview");if( prevWin.style.visibility == "visible" )
return;prevWin.src=url;if( isIE ) {
prevWin.style.pixelTop = cursor.y - ( prevWin.style.pixelHeight / 2 );prevWin.style.pixelLeft = cursor.x + 20;}
else {
prevWin.style.top = ( cursor.y - ( prevWin.clientHeight / 2 ) ) + 'px' ;prevWin.style.left = ( cursor.x + 20 ) + 'px';}
prevWin.style.visibility = "visible";}
function getPosition(e) {
e = e || window.event;if (e.pageX || e.pageY) {
cursor.x = e.pageX;cursor.y = e.pageY;}
else {
var de = document.documentElement;var b = document.body;cursor.x = e.clientX + (de.scrollLeft || b.scrollLeft) - (de.clientLeft || 0);cursor.y = e.clientY + (de.scrollTop || b.scrollTop) - (de.clientTop || 0);}
return cursor;}
