function changeAOI(AOIf){ if(AOIf.AOI.value==-1){ submitAOI(AOIf); } else { //if(confirm("Are you sure you want to change AOIs?")){ AOIf.submit(); //} } AOIf.AOI.selectedIndex = 0; } function getFlashMovie(movieName) { var isIE = navigator.appName.indexOf("Microsoft") != -1; return (isIE) ? window[movieName] : document[movieName]; } function formSend(stf) { AOIName = document.getElementById("AOIName").value; if((AOIName=='')||(AOIName==null)){ alert("Please enter an AOI name before upload."); document.getElementById("AOIName").focus(); } else { uploadMovie = getFlashMovie("dot"); if(uploadMovie) { uploadMovie.sendTextToFlash(stf); } } return false; } function getTextFromFlash(str) { alert(str); return str + " received"; } function setFocusFromFlash(objectName) { if(objectName=="cancelAOI"){ document.getElementById("cancelAOI").value = "Done"; } document.getElementById(objectName).focus(); return objectName + " received"; } function manageAOIs(mgForm, aoiValue) { document.getElementById('aoiExtents').style.display = "block"; document.getElementById('uploadFlash').style.display = "none"; document.getElementById('uploadFlashBrowse').style.display = "none"; document.getElementById('submitNewAOI').style.display = "inline"; if(!isNaN(aoiValue)) { mgForm.AOIName.readOnly = ""; mgForm.AOIName.value = ""; mgForm.AOIName.focus(); lon0_latlon = ""; lat1_latlon = ""; lon1_latlon = ""; lat0_latlon = ""; setLatLonOptions(); latLonWidgetVisibility(); if(aoiValue==-2) { // Upload shapefile AOI document.getElementById('aoiExtents').style.display = "none"; document.getElementById('uploadFlash').style.display = "block"; document.getElementById('uploadFlashBrowse').style.display = "block"; document.getElementById('submitNewAOI').style.display = "none"; //document.getElementById('uploadFlash').style.top = "-42px"; var so = new SWFObject("upload2.swf", "dot", "430", "150", "6.0.0", "#ffffff", true, "high"); so.addParam("wmode", "transparent"); so.addVariable("uType", "SHP"); //so.addParam("SeamlessTabbing", "true"); so.write("uploadFlash"); } } else { mgForm.AOIName.value = aoiValue; mgForm.AOIName.readOnly = "readonly"; aoiValue = "__"+aoiValue.replace(/[ \/&#\.,\?;\+\-]/g, "_"); lon0_latlon = lonlat[aoiValue][0]; lat1_latlon = lonlat[aoiValue][1]; lon1_latlon = lonlat[aoiValue][2]; lat0_latlon = lonlat[aoiValue][3]; setOpt1("lon0"); setOpt2("lon0"); setOpt3("lon0"); setOpt1("lat1"); setOpt2("lat1"); setOpt3("lat1"); setOpt1("lon1"); setOpt2("lon1"); setOpt3("lon1"); setOpt1("lat0"); setOpt2("lat0"); setOpt3("lat0"); //mgForm.lon0.value = lonlat[aoiValue][0]; //mgForm.lat1.value = lonlat[aoiValue][1]; //mgForm.lon1.value = lonlat[aoiValue][2]; //mgForm.lat0.value = lonlat[aoiValue][3]; } } function submitAOI(){ createAOI = parent.document.getElementById('validateData'); createAOI.style.display = "block"; createAOI.style.left = "280px"; createAOI.style.top = "150px"; createAOI.style.width = "520px"; createAOI.style.backgroundColor = "#ffffff"; createAOI.style.border = "2px solid black"; createAOI.style.paddingTop = "6px"; createAOI.innerHTML = 'Manage AOIs
Select AOI
AOI parameters
AOI Name:


Enter extents for area of interest in the lat/lon format below, or click the right arrow to change input formats.
LATITUDE TOP
LONGITUDE LEFT
AOILONGITUDE RIGHT
LATITUDE BOTTOM

(Use arrow to change coordinate input display format.)
'; document.getElementById('mgAOIselect').innerHTML = aoiMgSelect; document.getElementById('divlat0').innerHTML = '
'; document.getElementById('divlat1').innerHTML = '
'; document.getElementById('divlon0').innerHTML = '
'; document.getElementById('divlon1').innerHTML = '
'; initLatLonWidget("lat0"); initLatLonWidget("lat1"); initLatLonWidget("lon0"); initLatLonWidget("lon1"); // Display current format ddm = document.getElementById("ddmAOI"); ddm.innerHTML = "DECIMAL "+ddms[degreeDisplayMode-1]; latLonWidgetVisibility(); saveVal = 0.0; manageAOIs(document.getElementById('manageAOIForm'),AOI); } String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g, ''); } function createNewAOI(){ // Check that ... setLatLonOptions(); AOIName = document.getElementById('AOIName').value; if(!AOIName) { alert("AOI name required!"); document.getElementById('AOIName').focus(); return; } // Validate long/lat values //long0 = Number(document.getElementById('lon0').value); //long1 = Number(document.getElementById('lon1').value); long0 = Number(lon0_latlon); long1 = Number(lon1_latlon); if(!long0) { alert("Left longitude required."); return; } if(!long1) { alert("Right longitude required."); return; } if(isNaN(long0) || (long0longMax)) { alert("Invalid longitude: "+long0); return; } if(isNaN(long1) || (long1longMax)) { alert("Invalid longitude: "+long1); return; } if(long0>=long1) { alert("Right longitude must be greater than left longitude."); return; } //if(((long0>lonUMACMax) && (long1>lonUMACMax)) || // ((long0latiMax)) { alert("Invalid latitude: "+lati0); return; } if(isNaN(lati1) || (lati1latiMax)) { alert("Invalid latitude: "+lati1); return; } if(lati0<=lati1) { alert("Top latitude must be greater than bottom latitude."); return; } //if(((lati0>latUMACMax) && (lati1>latUMACMax)) || // ((lati0