<!--
var IE = document.all?true:false

// If NS -- that is, !IE -- then set up for mouse capture
if (!IE) document.captureEvents(Event.MOUSEMOVE)

// Set-up to use getMouseXY function onMouseMove
document.onmousemove = getMouseXY;

// Temporary variables to hold mouse x-y pos.s
var tempX = 0;
var tempY = 0;

var sourceImage;
var targetImage;

// Main function to retrieve mouse x-y pos.s

function registerSourceImage(image) {
	sourceImage = image;
	//alert("Source width: " + image.width + " assigned: " + sourceImage.width);
}

function registerTargetImage(image) {
	targetImage = image;
	//alert("Target width: " + image.width + " assigned: " + targetImage.width);
}

function findPos(obj) {
	try{
	var output = new Object();	
    var mytop=0, myleft=0;	
    while( obj) {		
        mytop+= obj.offsetTop;		
        myleft+= obj.offsetLeft;		
        obj= obj.offsetParent;	
    }	
    output.left = myleft;	
    output.top = mytop;	
	}catch(e) {  }
    return output;
}

function getMouseXY(e) {
	try{
	var pos = findPos(sourceImage);
	var img_x = pos.left;
	var img_y = pos.top;

	if (IE) 
	{ // grab the x-y pos.s if browser is IE
		tempX = event.clientX + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft) - img_x;
		tempY = event.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) - img_y;
		//alert(tempX);
	} else {  // grab the x-y pos.s if browser is NS
		tempX = e.pageX - img_x;
		tempY =  e.pageY - img_y;
		//alert(tempX);
	} 
	//alert("X:"+ tempX + " Y: " + tempY);
	// catch possible negative values in NS4
	if (tempX < 0){tempX = 0}
	if (tempY < 0){tempY = 0}
	// show the position values in the form named Show in the text fields named MouseX and MouseY
	//alert(tempY);
	//taking the image's height & width
	var mainImgWidth = document.getElementById("adimgch").width;
	var mainImgHeight = document.getElementById("adimgch").height;
	var hiresImgWidth = document.getElementById("hiresImg").width;
	var hiresImgHeight = document.getElementById("hiresImg").height;  

	var hiresTop = (hiresImgHeight/mainImgHeight * tempY) * (-1) + 175;
	document.getElementById('hiresImg').style.top = hiresTop + "px";
	
	var hiresLeft = (hiresImgWidth/mainImgWidth * tempX) * (-1) + 175;
	document.getElementById('hiresImg').style.left = hiresLeft + "px";
	}catch(e) {  }
  return true;
}
//-->