// scoot.js
//	Javascript to handle PPLite LCON requests
//	Dunc March 2005

scootMinX = 0;
scootMaxX = 0;
scootMinY = 0;
scootMaxY = 0;
scootMpp = 0; 
scootCycle = 0;

function scootLoad ( minx, maxx, miny, maxy, mpp ) {

	/*
	var elem = document.getElementById ( "lconImage" );
	if ( !elem ) return;
	*/

	var elem = document.getElementById ( "lconDiv" );
	if ( !elem ) return;
	
	imgid = "lconImage_" + scootCycle;
	scootCycle++;

	// 	NB: The 'cyc=no' parameter is ESSENTIAL - the image will not update without a unique
	//	URL, and this dummy parameter is how this has been implemented. This is a problem with
	//	all browsers, even with special header/cache instructions.
	 
	var url = "scoot.php?opt=con";
	url += "&minx=" + minx + "&maxx=" + maxx + "&miny=" + miny + "&maxy=" + maxy;
	url += "&mpp=" + metresPerPixel + "&cyc=" + scootCycle;
	
	elem.innerHTML = "";
	elem.innerHTML = "<img id=" + imgid + "border=0px width=600px height=400px src=" + url + " />";
	
	scootMinX = minx;
	scootMaxX = maxx;
	scootMinY = miny;
	scootMaxY = maxy;
	scootMpp = metresPerPixel; 

	}
	
//	Called from the parent with no direct access to extents and mpp...
function scootReload () {

	scootLoad ( scootMinX, scootMaxX,  scootMinY, scootMaxY, scootMpp );

	}
