// JavaScript Document
function handleError(theError)
{
	var errorCode = theError.substr(0, theError.indexOf(":"));

	if (errorCode == "ERR3001") {
		alert("ERROR3001");
	} else if (errorCode == "ERR3002") {
		var message ="An error occurred communicating with the ArcIMS Application Server.  The Service List could not be generated.";
		alert("ERROR! (ERR3002): " + message);
	} else if (errorCode == "ERR3003") {
		alert("ERROR3003");
	} else if (errorCode == "ERR3004") {
		alert("ERROR3004");
	} else if (errorCode == "ERR3005") {
		alert("ERROR3005");
	} else if (errorCode == "ERR3006") {
		var message = "One or more capabilities file(s) for this service could not be deleted.";
		alert("ERROR! (ERR3006): " + message);
	} else if (errorCode == "ERR3007") {
		var message = "The directory containing the capability files for this service could not be deleted.";
		alert("ERROR! (ERR3007): " + message);
	} else if (errorCode == "ERR3008") {
		alert("ERROR3008");
	} else if (errorCode == "ERR3009"|| errorCode == "ERR009") {
		var message = "The service could not be enabled for WMS.  There was a problem creating one or more capabilities file.";
		alert("ERROR! (ERR3009): " + message);
	} else if (errorCode == "WRN3001") {
		var message = "The map configuration file used as input to this service has no projection information.\nThe capabilities file was built with the following information:\n\n";
		var message = message + "1. The SRS values for the service and the layer are listed as EPSG:NONE.\n";
		var message = message + "2.  All layer LatLonBoundingBox values are set to -180, -90, 180, 90.";
		alert("Warning (WRN3001): " + message);
	} else if (errorCode == "WRN3002") {
		var message = "The map configuration file used as input to this service includes\na customized spatial reference string.\n\nThe capabilities file was built with the following information:\n\n";
		var message = message + "1.  The SRS value for the service and for each layer is listed as EPSG:4326.\n";
		var message = message + "2.  The SRS list of valid spatial references for the service does not include the\n customized spatial reference string from the map configuration file.";
		alert("Warning (WRN3002): " + message);
	} else {
		alert("An unknown error has occurred." + theError);
	}	
}

