// RMOWCustom.js
/*
*  JavaScript template file for ArcIMS HTML Viewer
*		dependent on aimsXML.js, ArcIMSparam.js, aimsCommon.js, aimsMap.js, and aimsLayers.js
*		To be interactive, dependent also on aimsDHTML.js, aimsClick.js, and aimsNavigation.js
*/

var BufferedFeatureIDs = new Array();
var BufferedListSelect = false;


// TW refresh map with highlighted selection from the buffered features 07/10/01
function showBufferedHighlight(BFID) {
	//alert(bufferTargetLayerIndex + "\n\n" + bufferTargetLayer);
	var theString = '<ARCXML version="1.1">\n<REQUEST>\n<GET_FEATURES outputmode="xml" geometry="false" envelope="true"';
	theString += ' featurelimit="' + maxFeaturesReturned + '" beginrecord="' + queryStartRecord + '">\n';
	theString += '<LAYER id="' + LayerID[bufferTargetLayerIndex] + '" />';

	theString += '<QUERY subfields="' + selectFields + '" where="#ID#=' + BufferedFeatureIDs[BFID] + '" />';
	theString += '</GET_FEATURES>';
	theString += '</REQUEST>';
	theString += '</ARCXML>';
	//alert("BufferQueryXML()\nQuery XML Request:\n" + theString);
	CreateCustomQuery=false;
	BufferedListSelect=true;
	sendToServer(imsQueryURL,theString,8);
	//return theString;		
}

// TW create a new function to zoom to the extents of a (street) query
function ZoomtoListSelect(theReply){
	//alert(theReply);
	endpos=1;
	var theXYs = getEnvelopeXYs(theReply, endpos)
	//alert (theXYs[0] + "\n" + theXYs[1] + "\n" + theXYs[2] + "\n" + theXYs[3]);
	
	MinLeft = (theXYs[0] - 250);
	MinBottom = (theXYs[1] - 250);
	MaxRight = (theXYs[2] + 250);
	MaxTop = (theXYs[3] + 250);
	//aimsSelectPresent=false;
	//aimsBufferPresent=false;
	zoomToEnvelope(MinLeft,MinBottom,MaxRight,MaxTop);
}
