var updateDelayed = false;

/*======================================================================
   Moves magnifier to appropriate polygon based on which page is loaded.
====================================================================== */
function updateMagnifierPosition(){
	if (self != top){
		var thisHREF = document.location.href;
		var thisPolygon = thisHREF.substring(thisHREF.lastIndexOf("_") + 1,thisHREF.lastIndexOf("."));
		X = eval("top.PRIMARY.coords." + thisPolygon + "X");
		Y = eval("top.PRIMARY.coords." + thisPolygon + "Y");

		if (top.PRIMARY.GetCookies(0)=="loaded"){
			// If the app is not attempting to move the magnifier to it's current location...
			if (X != top.PRIMARY.OUTER_CONTENT.MAP.mag.x){
				// if a move is in progress, stuff the variables.
				// alert ("QA: glideActive:" + top.PRIMARY.OUTER_CONTENT.MAP.mag.glideActive + ", top.PRIMARY.currentState.queueNext:" + top.PRIMARY.currentState.queueNext + ", top.PRIMARY.currentState.playNext:" + top.PRIMARY.currentState.playNext)
				if(top.PRIMARY.OUTER_CONTENT.MAP.mag.glideActive ||
					top.PRIMARY.currentState.queueNext != top.PRIMARY.currentState.playNext){
					var current = top.PRIMARY.currentState.queueNext
					top.PRIMARY.queue[current] = new top.PRIMARY.point(X,Y)
					top.PRIMARY.currentState.queueNext++
				} else {
					top.PRIMARY.OUTER_CONTENT.MAP.mag.glideTo('slow','slow',X,Y,4,20,'top.PRIMARY.playQueue()')
					top.PRIMARY.OUTER_CONTENT.MAP.magview.glideTo('slow','slow',((-(3.095))*X),((-(3.054))*Y),4,20)
					top.PRIMARY.OUTER_CONTENT.MAP.click.glideTo('slow','slow',((-(2.1))*X),((-(2.05))*Y),4,20)
				}
			}
		}else{
			var current = top.PRIMARY.currentState.queueNext
			top.PRIMARY.queue[current] = new top.PRIMARY.point(X,Y)
			top.PRIMARY.currentState.queueNext++
		}
	}
}