// aimsCustom.js
/*
*  JavaScript template file for ArcIMS HTML Viewer
*		dependent on aimsXML.js, ArcIMSparam.js, aimsCommon.js, aimsMap.js,
*		aimsLayers.js, aimsDHTML.js
*		aimsClick.js, aimsNavigation.js,
*/

// global variables
	aimsCustomPresent=false;
	// change these to send XML response to custom function.
	// use numbers >= 1000 and match in useCustomFunction()
	// defaults are defined in aimsXML.js and use standard functions
	
	// xml response mode for selection
	selectXMLMode = 6;
	// xml response mode for identify
	identifyXMLMode = 7;
	// xml response mode for query
	queryXMLMode = 8;
	// xml response mode for find
	findXMLMode = 14;
	// xml response mode hyperlink
	hyperlinkXMLMode = 15;




// custom function for handling clicks 
// 		flow redirected here when
//		toolMode set to >=1000
function customMapTool(e) {
				if (toolMode == 1001) {
						// insert code here
						return false;
					
				}
				if (toolMode == 1002) {
						// insert code here

				}

}

// send  XML response to custom function
//		flow  redirected here when
//		XMLMode >=1000
function useCustomFunction(theReply) {
	if (XMLMode==1001) {
		// insert code here
	} else if (XMLMode==1002) {
		// insert code here
	} else {
		alert(msgList[55] + XMLMode + msgList[56]);
	}
	hideLayer("LoadData");
}

// add custom stuff to Map XML request. . . between clickpoints and copyright
function addReliefToMap1(){
	var customString = "";
		customString += '<LAYER type="image" name="Shaded Relief" visible="true" id="72">\n';
		customString += '<DATASET name="demshd90.tif" type="image" workspace="jai_ws-0" />\n';
		//customString += '<IMAGEPROPERTIES transcolor="0,0,0" />\n';
		customString += '</LAYER>\n';
		customString += '<LAYER type="featureclass" name="Water" visible="true" id="71">\n';
		customString += '<DATASET name="water" type="polygon" workspace="shp_ws-34" />\n';
		customString += '<SIMPLERENDERER>\n';
		customString += '<SIMPLEPOLYGONSYMBOL fillcolor="156,203,255" boundary="false" />\n';
		customString += '</SIMPLERENDERER>\n';
		customString += '</LAYER>\n';
	return customString;
}

// extract layers to download
function extractIt() {
	hideLayer("measureBox");
	alert(msgList[51]);
}


