function point( x, y ){	this.x = x; 	this.y = y;}function face( x, y, name, title ){	this.x = x;	this.y = y;	this.name = name;	this.title = title;}function getTargetElement( inEvent ){	var targ;		if (inEvent.target) targ = inEvent.target; // Moz	else if (inEvent.srcElement) targ = inEvent.srcElement; // IE		if (targ.nodeType == 3) // Safari		targ = targ.parentNode;				return targ;}function getElementOrigin( inElement ){	var x_off = 0; 	var y_off = 0;		var el = inElement;		while ( el )	{		x_off = x_off + el.offsetLeft;		y_off = y_off + el.offsetTop;		el = el.offsetParent;	}		return new point( x_off, y_off );}function getTargetElementOffset( inEvent, targElem ){	var xPos = 0;	var yPos = 0;		if (!inEvent) var inEvent = window.event;		if (inEvent.pageX || inEvent.pageY)	{		xPos = inEvent.pageX;		yPos = inEvent.pageY;	}	else if (inEvent.clientX || inEvent.clientY)	{		xPos = inEvent.clientX + document.body.scrollLeft;		yPos = inEvent.clientY + document.body.scrollTop;	}			if ( targElem )	{		var origin = getElementOrigin( targElem );				xPos = xPos - origin.x;		yPos = yPos - origin.y;	}		return new point( xPos, yPos );}function findFaceForPos( faces, x, y ){	var result;		for ( var i = 0; i < faces.length; ++i )	{		if ( x >= (faces[i].x - 10) && x < (faces[i].x + 10)			 && y >= (faces[i].y - 10) && y < (faces[i].y + 10) )		{			result = faces[i];			break;		}	}		return result;}function getElementByIdCrossBrowser( id ){	var el;		if ( document.getElementById )	{		el = document.getElementById(id);	}	else if ( document.all )	{		el = document.all[id];	}		return el;}function setDivText( divID, msg ){				if ( document.getElementById )	{		var parent = document.getElementById( divID );		var child = parent.firstChild;				if ( child.nodeValue != msg )		{			// this forces KHTML-derived browsers to reflow			if ( child.cloneNode && parent.replaceChild )			{				var new_child = child.cloneNode( false );				new_child.nodeValue = msg;				parent.replaceChild( new_child, child );			}			else			{				child.nodeValue = msg;			}		}	}	else if ( document.all )	{		document.all[divID].innerHTML = msg;	}}function scrollZoomerTo( zoomableViewID, x, y ){	try	{		x_pos = parseInt( x );		y_pos = parseInt( y );				var el = getElementByIdCrossBrowser(zoomableViewID );			if ( el && el.style )		{			el.style.left = -x + "px";			el.style.top = -y + "px";		}	}	catch( error )	{		if ( document.location.search && document.location.search.indexOf("debug=true") >=0  )		{			// debugging			alert("Got an exception in scrollZoomerTo");		}	}}function scrollZoomerToMouse(inEvent, faces, zoomableViewID, descViewID, titleViewID){	try	{		var name = "";		var targetElement;			var el = getTargetElement(inEvent);				var hit = getTargetElementOffset( inEvent, el );		if ( hit )		{			var x_pos = hit.x;			var y_pos = hit.y;						face = findFaceForPos( faces, x_pos, y_pos )						if ( face )			{				setDivText( descViewID, face.name );				setDivText( titleViewID, face.title );			}			else			{				if ( document.location.search && document.location.search.indexOf("debug=true") >=0  )				{					// debugging					setDivText( descViewID, "X: " + x_pos + ", Y: " + y_pos );					setDivText( titleViewID, document.location.search );				}				else				{					setDivText( descViewID, "" );					setDivText( titleViewID, "" );				}											}						// remember that we want the top of the scroll area to			// be up and left of the actual mouse pos, to center 			// the mouse			x_pos = 4 * x_pos - 50;			y_pos = 4 * y_pos - 50;						scrollZoomerTo( zoomableViewID, x_pos, y_pos ); 		}		else		{			if ( document.location.search && document.location.search.indexOf("debug=true") >=0  )			{				setDivText( descViewID, "Nothing hit!" );					}		}	}	catch( error )	{		if ( document.location.search && document.location.search.indexOf("debug=true") >=0  )		{			// debugging			alert("Got an exception in scrollZoomerToMouse");		}	}}
