function isNumeric(sText){var blk="0123456789.-";var uj=false; var aul;if(sText.length>0){uj=true;for(i=0;i<sText.length&&uj==true;i++){aul=sText.charAt(i);if(blk.indexOf(aul)==-1){uj=false}}}return uj}function getImg(width,height,src,click){var txt;if(rApp.isIE6){txt="<img "+(click?"onclick='"+click+"' ":"")+"src='./images/transparent.gif' style='width:"+width+";height:"+height+";filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\"./"+src+"\",sizingMethod=\"scale\");' />"}else{txt="<img "+(click?"onclick='"+click+"' ":"")+"src='"+src+"' style='width:"+width+";height:"+height+"' />"}return txt}function RScaleBar(map,minPx,maxPx){rXadd(this);this.uid=RUid.newUid("scalebar");this.rMap=map;this.rMap.addScaleBar(this);this.dMinPx=minPx;this.dMaxPx=maxPx;this.dMaxSnapFactor=10000000;this.dSnapValues=new Array();this.dSnapValues[0]=1;this.dSnapValues[1]=2;this.dSnapValues[2]=5;this.tUpdateTimer=null}function RScaleBar_GetMetersFromDeltaX(tlx,tly,brx,bry,units){var distance=0;switch(units){case 1:{distance=Math.abs(brx-tlx);break}case 2:{distance=this.distanceMeasurement(tlx,bry,brx,bry);break}case 3:{distance=(Math.abs(brx-tlx))/3.2808399;break}default:{break}}return distance}RScaleBar.prototype.getMetersFromDeltaX=RScaleBar_GetMetersFromDeltaX;function RScaleBar_GetMetricDistanceValues(deltaX,cellX){var bll=this.dMinPx*cellX;var blm=this.dMaxPx*cellX;var uk=false;var obj=new Object();var ady=1;while(!uk&&ady<this.dMaxSnapFactor){for(var index=0;index<this.dSnapValues.length&&!uk;index++){var jt=this.dSnapValues[index]*ady;if(jt>=bll&&jt<=blm){uk=true;obj.width=(parseInt(jt/cellX)-2);if(jt>=1000){obj.distance=jt/1000;obj.units="km"}else{obj.distance=jt;obj.units="m"}}}ady*=10}if(!uk){obj.width=-1;obj.distance="";obj.units=""}obj.width-=4;return obj}RScaleBar.prototype.getMetricDistanceValues=RScaleBar_GetMetricDistanceValues;function RScaleBar_DistanceMeasurement(dLat1,dLon1,dLat2,dLon2){var gg=0.0;var hz=0.0;var adz=0.0;var ul=0.0;var aum=0.0;var da=0.0;var ju=0.0;var um,aea,un;var an=0.0;var aeb,aec,ia,nu,dY,uo,jv,gh,up,gi;var aun=0.00000000005;var i=0;var uq=0.0033528106812;var bln=6378137.0;var blo=100;var ur=Math.PI/180;dLat1*=ur;dLon1*=ur;dLat2*=ur;dLon2*=ur;ju=1-uq;if((dLat1+dLat2==0.0)&&(Math.abs(dLon1-dLon2)==Math.PI)){dLat1+=0.00001;}if(dLat1==dLat2&&(dLon1==dLon2||Math.abs(((dLon1-dLon2)>=0?(dLon1-dLon2):((dLon1-dLon2)*-1))-2*Math.PI)<aun)){da=0.0;return da}gg=ju*Math.tan(dLat1);hz=ju*Math.tan(dLat2);adz=1.0/Math.sqrt(1.0+gg*gg);aum=adz*gg;ul=1.0/Math.sqrt(1.0+hz*hz);um=adz*ul;aea=um*hz;un=aea*gg;an=dLon2-dLon1;da=an+1;while((Math.abs(da-an)>aun)&&(i<blo)){i++;aeb=Math.sin(an);aec=Math.cos(an);gg=ul*aeb;hz=aea-aum*ul*aec;ia=Math.sqrt(gg*gg+hz*hz);nu=um*aec+un;dY=Math.atan2(ia,nu);uo=um*aeb/ia;jv=1-uo*uo;gh=un+un;if(jv>0.0){gh=nu-gh/jv}up=gh*gh*2.0-1.0;gi=((-3.0*jv+4.0)*uq+4.0)*jv*uq/16.0;da=an;an=((up*nu*gi+gh)*ia*gi+dY)*uo;an=(1.0-gi)*an*uq+dLon2-dLon1}an=Math.sqrt((1/(ju*ju)-1)*jv+1);an++;an=(an-2.0)/an;gi=1.0-an;gi=(an*an/4.0+1.0)/gi;da=(0.375*an*an-1.0)*an;an=up*nu;da=((((ia*ia*4.0-3.0)*(1.0-2*up)*gh*da/6.0-an)*da/4.0+gh)*ia*da+dY)*gi*bln*ju;return da}RScaleBar.prototype.distanceMeasurement=RScaleBar_DistanceMeasurement;function RScaleBar_GetImperialDistanceValues(deltaX,cellX){var aed=this.dMinPx*cellX;var aee=this.dMaxPx*cellX;var gj=false;var obj=new Object();var ib=1;var co=0;while(!gj&&ib<this.dMaxSnapFactor&&co<5000){for(var index=0;index<this.dSnapValues.length&&!gj;index++){co=this.dSnapValues[index]*ib;if(co>=aed&&co<=aee){if(co<5000){gj=true;obj.width=(parseInt(co/cellX)-2);obj.distance=co;obj.units="ft"}}}ib*=10}if(gj){return obj}cellX/=5280;aed=this.dMinPx*cellX;aee=this.dMaxPx*cellX;ib=1;while(!gj&&ib<this.dMaxSnapFactor){for(var index=0;index<this.dSnapValues.length&&!gj;index++){co=this.dSnapValues[index]*ib;if(co>=aed&&co<=aee){gj=true;obj.width=(parseInt(co/cellX)-2);obj.distance=co;obj.units="mi"}}ib*=10}if(!gj){obj.width=-1;obj.distance="";obj.units=""}return obj}RScaleBar.prototype.getImperialDistanceValues=RScaleBar_GetImperialDistanceValues;function RScaleBar_UpdateScale(tlx,tly,brx,bry){this.tlx=tlx;this.tly=tly;this.brx=brx;this.bry=bry;if(this.tUpdateTimer==null){this.tUpdateTimer=setTimeout(this.myself+".updateScaleIEDHTML()",50);}}RScaleBar.prototype.updateScale=RScaleBar_UpdateScale;function RScaleBar_UpdateScaleGISOverlay(){clearTimeout(this.tUpdateTimer);this.tUpdateTimer=null;if(this.lastBrx!=this.brx||this.lastBry!=this.bry){this.lastBrx=this.brx;this.lastBry=this.bry;var map=document[this.rMap.uid];var url=IIFConfig.GISOVERLAY_SCALE_URL;url+="&mapext="+this.tlx+"+"+this.tly+"+"+this.brx+"+"+this.bry;url+="&mode=scalebar&mapsize="+map.GetViewWidth()+"+"+map.GetViewHeight();if(Math.abs(this.lastBrx-this.tlx)>1600){url+="&map_scalebar_units=miles"}if(map.GetLayerIndex(this.scaleBarGISOverlayUid)>=0){map.DeleteLayer(this.scaleBarGISOverlayUid);}var sParams="";sParams="mode=WINABSOLUTE;";sParams+="body=;";sParams+="action=GET;";sParams+="worldTLX=120;";sParams+="worldTLY=-1;";sParams+="worldBRX=-1;";sParams+="worldBRY=-30;";sParams+="url="+url+";";map.AddLayer("GISOverlay","",this.scaleBarGISOverlayUid,sParams);}this.tUpdateTimer=setTimeout(this.myself+".updateScaleGISOverlay()",1000);}RScaleBar.prototype.updateScaleGISOverlay=RScaleBar_UpdateScaleGISOverlay;function RScaleBar_UpdateScaleIEDHTML(){clearTimeout(this.tUpdateTimer);this.tUpdateTimer=null;var map=document[this.rMap.uid];var deltaX=0;var blp=map.GetLayerCellUnits(this.rMap.getTopEcw());var aef=this.getMetersFromDeltaX(this.tlx,this.tly,this.brx,this.bry,blp);var blq=aef/map.GetViewWidth();var auo=aef*3.2808399;var blr=auo/map.GetViewWidth();var cp=this.getMetricDistanceValues(aef,blq);var db=this.getImperialDistanceValues(auo,blr);var scaleBarContainer=document.getElementById(this.scaleBarContainerUid);if(cp.width<0||db.width<0){scaleBarContainer.style.visibility="hidden"}else{if(!this.stretchCell)this.stretchCell=document.getElementById(this.scaleBarStretchCellUid);if(!this.rightBarCell)this.rightBarCell=document.getElementById(this.scaleBarRightCellUid);if(!this.centerDiv)this.centerDiv=document.getElementById(this.scaleBarCenterDivUid);if(!this.topTextDiv)this.topTextDiv=document.getElementById(this.scaleBarTopTextDivUid);if(!this.bottomTextDiv)this.bottomTextDiv=document.getElementById(this.scaleBarBottomTextDivUid);scaleBarContainer.style.visibility="visible";if(cp.width>db.width){this.stretchCell.style.width=cp.width+"px";this.centerDiv.style.top="0px";this.centerDiv.style.left=db.width+"px";this.topTextDiv.innerHTML=db.distance+db.units;this.bottomTextDiv.innerHTML=cp.distance+cp.units;if(this.ie6){this.centerDiv.style.background="none";this.centerDiv.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\"./images/scaleBar_topMeasure.png\",sizingMethod=\"scale\");";this.rightBarCell.style.background="none";this.rightBarCell.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\"./images/scaleBar_rightBottomEnd.png\",sizingMethod=\"scale\");"}else{this.centerDiv.style.background="URL(./images/scaleBar_topMeasure.png) no-repeat";this.rightBarCell.style.background="URL(./images/scaleBar_rightBottomEnd.png) no-repeat"}}else if(db.width>cp.width){this.stretchCell.style.width=db.width+"px";this.centerDiv.style.top="0px";this.centerDiv.style.left=cp.width+"px";this.topTextDiv.innerHTML=db.distance+db.units;this.bottomTextDiv.innerHTML=cp.distance+cp.units;if(this.ie6){this.centerDiv.style.background="none";this.centerDiv.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\"./images/scaleBar_bottomMeasure.png\",sizingMethod=\"scale\");";this.rightBarCell.style.background="none";this.rightBarCell.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\"./images/scaleBar_rightTopEnd.png\",sizingMethod=\"scale\");"}else{this.centerDiv.style.background="URL(./images/scaleBar_bottomMeasure.png) no-repeat";this.rightBarCell.style.background="URL(./images/scaleBar_rightTopEnd.png) no-repeat"}}else{this.stretchCell.style.width=cp.width+"px";this.topTextDiv.innerHTML=db.distance+db.units;this.bottomTextDiv.innerHTML=cp.distance+cp.units;if(this.ie6){this.rightBarCell.style.background="none";this.rightBarCell.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\"./images/scalebar_rightEqual.png\",sizingMethod=\"scale\");"}else{this.rightBarCell.style.background="URL(./images/scalebar_rightEqual.png) no-repeat"}}}}RScaleBar.prototype.updateScaleIEDHTML=RScaleBar_UpdateScaleIEDHTML;function RScaleBar_Init(){var bls=navigator.userAgent.toLowerCase();var blt=parseInt(navigator.appVersion);this.ie6=((blt==4)&&(bls.indexOf("msie 6.")!=-1));this.scaleBarContainerUid=RUid.newUid("scaleBarContainerUid");this.scaleBarStartTextCellUid=RUid.newUid("scaleBarStartTextCellUid");this.scaleBarGradientContainerCellUid=RUid.newUid("scaleBarGradientContainerCell");this.scaleBarImageTableUid=RUid.newUid("scaleBarImageTable");this.scaleBarRightCellUid=RUid.newUid("scaleBarRightCell");this.scaleBarStretchCellUid=RUid.newUid("scaleBarLeftStretchCell");this.scaleBarRightStretchCellUid=RUid.newUid("scaleBarRightStretchCell");this.scaleBarLeftCellUid=RUid.newUid("scaleBarLeftCell");this.scaleBarCenterDivUid=RUid.newUid("scaleBarCenterDiv");this.scaleBarTopTextDivUid=RUid.newUid("scaleBarTopTextDiv");this.scaleBarBottomTextDivUid=RUid.newUid("scaleBarBottomTextDivUid");var txt="<div style='position:relative;bottom:50px;left:20px;height:34px;visibility:hidden;' id='"+this.scaleBarContainerUid+"'>";txt+="<table cellpadding='0' cellspacing='0'><tr height='34'>";if(this.ie6){txt+="<td width='6' id='"+this.scaleBarLeftCellUid+"' style='filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\"./images/scalebar_left.png\",sizingMethod=\"scale\");background-image:none;background-repeat: no-repeat;'></td>";txt+="<td id='"+this.scaleBarStretchCellUid+"' style='filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\"./images/scalebar_stretch.png\",sizingMethod=\"scale\");background-image:none;background-repeat: repeat-x;'>"}else{txt+="<td width='6' id='"+this.scaleBarLeftCellUid+"' style='background-image:URL(./images/scalebar_left.png);background-repeat: no-repeat;'></td>";txt+="<td id='"+this.scaleBarStretchCellUid+"' style='background-image:URL(./images/scalebar_stretch.png);background-repeat: repeat-x;'>"}txt+="<div id='"+this.scaleBarCenterDivUid+"' style='width:6px;height:34px;position:relative;'></div>";txt+="<div id='"+this.scaleBarTopTextDivUid+"' style='position:absolute;left:6px;top:0px;font-family:verdana;font-size:11px;font-weight:bold;color:white;'></div>";txt+="<div id='"+this.scaleBarBottomTextDivUid+"' style='position:absolute;left:6px;bottom:0px;font-family:verdana;font-size:11px;font-weight:bold;color:white;'></div></td>";if(this.ie6){txt+="<td width='6' id='"+this.scaleBarRightCellUid+"' style='filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\"./images/scalebar_rightEqual.png\",sizingMethod=\"scale\");background-image:none;background-repeat: no-repeat;'></td>"}else{txt+="<td width='6' id='"+this.scaleBarRightCellUid+"' style='background-image:URL(./images/scalebar_rightEqual.png);background-repeat: no-repeat;'></td>"}txt+="</tr></table></div>";return txt;}RScaleBar.prototype.init=RScaleBar_Init;function RMetadataFilterSearch(ecwService){rXadd(this);this.uid=RUid.newUid("metadatafiltersearch");this.contentTableUid=RUid.newUid("metadatafilterContentTable");this.upperResetButtonUid=RUid.newUid("metadatafilterupperreset");this.extentFieldUid=RUid.newUid("metadatafilterextentfield");this.keywordFieldUid=RUid.newUid("metadatafilterkeywordfield");this.dateFromFieldUid=RUid.newUid("metadatafilterdatefromfield");this.dateToFieldUid=RUid.newUid("metadatafilterdatetofield");this.resolutionFieldUid=RUid.newUid("metadatafilterresolutionfield");this.resolutionFieldLtGtUid=RUid.newUid("metadatafilterresolutionfield");this.resolutionFieldUnitsUid=RUid.newUid("metadatafilterresolutionfield");this.sensorFieldUid=RUid.newUid("metadatafiltersensorfield");this.accuracyFieldUid=RUid.newUid("metadatafilteraccuracyfield");this.accuracyFieldUnitsUid=RUid.newUid("metadatafilteraccuracyfield");this.platformFieldUid=RUid.newUid("metadatafilterplatformfield");this.dateFromTD=RUid.newUid("datefrom");this.dateToTD=RUid.newUid("dateto");this.formUid="RMetadataFilterForm";this.aLabels=new Array();this.aFields=new Array();this.oECWService=ecwService;this.bContentVisible=true;this.oCatalogRequester=new RXMLHTTPObject();this.bInitDone=false;this.aSensorID=new Array();this.aSensorName=new Array();this.aSensorID[0]=this.aSensorName[0]="";this.aPlatformID=new Array();this.aPlatformName=new Array();this.aPlatformID[0]=this.aPlatformName[0]="";this.bRunOnce=true;this.oCalendar=new RCalendar();aHideSelects[aHideSelects.length]=this.extentFieldUid;aHideSelects[aHideSelects.length]=this.resolutionFieldLtGtUid;aHideSelects[aHideSelects.length]=this.resolutionFieldUnitsUid;aHideSelects[aHideSelects.length]=this.platformFieldUid;aHideSelects[aHideSelects.length]=this.sensorFieldUid;aHideSelects[aHideSelects.length]=this.accuracyFieldUnitsUid;this.layerViewMode="ALL";}function RMetadataFilterSearch_ToggleShowHideFilter(button){var aeg=document.getElementById(this.contentTableUid);var aeh=document.getElementById(this.upperResetButtonUid);if(aeg&&aeh){if(this.bContentVisible){aeg.style.display="none";aeh.style.display="block";button.value="Show Filter"}else{aeg.style.display="block";aeh.style.display="none";button.value="Hide Filter";rApp.expandPane(this.oECWService.attachWin);}this.bContentVisible=!this.bContentVisible}var aei=document.getElementById(this.sensorFieldUid);if(aei){if(this.aSensorID.length!=aei.options.length){for(var index=0;index<this.aSensorID.length;index++){aei.options[index]=new Option(this.aSensorName[index],this.aSensorID[index]);}}}}RMetadataFilterSearch.prototype.toggleShowHideFilter=RMetadataFilterSearch_ToggleShowHideFilter;function RMetadataFilterSearch_OpenCalendar(callbackId,attachId,clicked){if(!rApp.isIE6){var blu=document.getElementById(this.oCalendar.uid);if(!blu){this.oCalendar.oCallbackId=callbackId;this.oCalendar.show(clicked.offsetLeft,clicked.offsetTop,document.getElementById(attachId));}}else{var top=rApp.height-rApp.overviewHeight-187;var left=rApp.width-250;var aup=open(IIFConfig.CALENDAR_URL,"Calendar","toolbar=no,menubar=no,resizable=no,scrollbars=no,status=no,location=no,width=190,height=185,top="+top+",left="+left);aup.callbackid=callbackId;if(window.focus){aup.focus();}}}RMetadataFilterSearch.prototype.openCalendar=RMetadataFilterSearch_OpenCalendar;function RMetadataFilterSearch_ToggleLayerViewMode(selectObj){if(selectObj){this.layerViewMode=selectObj[selectObj.selectedIndex].value;this.attachWin.build();}}RMetadataFilterSearch.prototype.toggleLayerViewMode=RMetadataFilterSearch_ToggleLayerViewMode;function RMetadataFilterSearch_BuildStatic(){var txt="<div id='CalendarAttach' style='width:"+(rApp.isIE?"275":"270")+";margin:5px;padding-top:5px;padding-left:5px;padding-right:5px; border: solid 1px black;text-align:center;'><form name='"+this.formUid+"' id='"+this.formUid+"'>";txt+="<table cellpadding='0' cellspacing='0' style='padding-bottom:5px;'><tr>";txt+="<td style='width:"+(rApp.isIE?"115":"110")+";font-size:12pt;font-weight:bold;'>Search</td>";txt+="<td style='width:160;text-align:right;'><table cellpadding='0' cellspacing='0'><tr><td style='width:45px;padding-right:5px;'><input type='button' style='display:none;' id='"+this.upperResetButtonUid+"' value='Reset' onclick='"+this.myself+".resetFilter();'></td>";txt+="<td><input type='button' style='width:82px;' value='Hide Filter' onclick='"+this.myself+".toggleShowHideFilter(this);'></td></tr></table></td>";txt+="</tr></table>";txt+="<table cellpadding='0' cellspacing='0' id='"+this.contentTableUid+"' style='display:block;'><tr>";txt+="<td class='metadatafilterlabel"+rApp.cStyle+"'>Extents:</td>";txt+="<td class='metadatafilterfield"+rApp.cStyle+"'><select id='"+this.extentFieldUid+"' class='metadatafilterfield"+rApp.cStyle+"' onchange='"+this.myself+".toggleLayerViewMode(this);'>";txt+="<option value='ALL'>All</option>";txt+="<option value='IN_VIEW'>In View</option>";txt+="</select></td></tr>";txt+="<tr><td class='metadatafilterlabel"+rApp.cStyle+"'>Keyword Search:</td>";txt+="<td class='metadatafilterfield"+rApp.cStyle+"' ><input type='text' id='"+this.keywordFieldUid+"' class='metadatafilterfield"+rApp.cStyle+"' onkeyup='"+this.myself+".filterOnEnter(event)'></td>";txt+="<tr><td class='metadatafilterlabel"+rApp.cStyle+"'>Acquisition date from:</td>";txt+="<td class='metadatafilterfield"+rApp.cStyle+"'><table cellpadding='0' cellspacing='0'><tr><td id='"+this.dateFromTD+"'><input type='text' id='"+this.dateFromFieldUid+"' style='width:90;'></td><td style='padding-left:4px;'><img style='position:relative;cursor:pointer;' src='./images/CalendarIcon.gif' onclick='"+this.myself+".openCalendar(\""+this.dateFromFieldUid+"\", \""+this.dateFromTD+"\", this)' style='cursor:pointer;'></td></tr></table></td></tr>";txt+="<tr><td class='metadatafilterlabel"+rApp.cStyle+"'>Acquisition date to:</td>";txt+="<td class='metadatafilterfield"+rApp.cStyle+"'><table cellpadding='0' cellspacing='0'><tr><td id='"+this.dateToTD+"'><input type='text' id='"+this.dateToFieldUid+"' style='width:90;'></td><td style='padding-left:4px;'><img style='position:relative;cursor:pointer;' src='./images/CalendarIcon.gif' onclick='"+this.myself+".openCalendar(\""+this.dateToFieldUid+"\", \""+this.dateToTD+"\", this)' style='cursor:pointer;'></td></tr></table></td></tr>";txt+="<tr><td class='metadatafilterlabel"+rApp.cStyle+"'>Native Resolution:</td>";txt+="<td class='metadatafilterfield"+rApp.cStyle+"' >";txt+="<select id='"+this.resolutionFieldLtGtUid+"' style='width:35px;font-size:8pt;'><option value='le'>&le;</option><option value='ge'>&ge;</option></select><input id='"+this.resolutionFieldUid+"' type='text' style='width:55px;font-size:8pt;height:19px;'><select id='"+this.resolutionFieldUnitsUid+"' style='width:60;font-size:8pt;'><option>feet</option><option>inches</option><option>meters<option>centimeters</option></select></td></tr>";txt+="<tr><td class='metadatafilterlabel"+rApp.cStyle+"'>Platform:</td>";txt+="<td class='metadatafilterfield"+rApp.cStyle+"'><select id='"+this.platformFieldUid+"' class='metadatafilterfield"+rApp.cStyle+"'>";for(var index=0;index<this.aPlatformID.length;index++){txt+="<option value='"+this.aPlatformID[index]+"'>"+this.aPlatformName[index]+"</option>"}txt+="</select></td></tr>";txt+="<tr><td class='metadatafilterlabel"+rApp.cStyle+"'>Sensor Type:</td>";txt+="<td class='metadatafilterfield"+rApp.cStyle+"'><select id='"+this.sensorFieldUid+"' class='metadatafilterfield"+rApp.cStyle+"'>";for(var index=0;index<this.aSensorID.length;index++){txt+="<option value='"+this.aSensorID[index]+"'>"+this.aSensorName[index]+"</option>"}txt+="</select></td></tr>";txt+="<tr><td class='metadatafilterlabel"+rApp.cStyle+"'>Positional Accuracy:</td>";txt+="<td class='metadatafilterfield"+rApp.cStyle+"' ><input id='"+this.accuracyFieldUid+"' type='text' style='width:90px;font-size:8pt;height:19px;'>";txt+="<select id='"+this.accuracyFieldUnitsUid+"' style='width:60;font-size:8pt;'><option>feet</option><option>inches</option><option>meters<option>centimeters</option></select></td></tr>";txt+="<tr><td colspan='2' align='center' style='padding:5px;'><span style='padding:5px;'><input type='button' value='Reset' onclick='"+this.myself+".resetFilter();'></span><span style='padding:5px;'><input type='button' value='Search' onclick='"+this.myself+".applyFilter();'></span></td>";txt+="</tr></table></form></div>";this.bInitDone=true;return txt}RMetadataFilterSearch.prototype.buildStatic=RMetadataFilterSearch_BuildStatic;function RMetadataFilterSearch_FilterOnEnter(event){var keycode;var evt=null;if(window.event){evt=window.event;keycode=evt.keyCode}else if(event){evt=event;keycode=evt.which}else{return true}if(keycode==13){this.applyFilter();}}RMetadataFilterSearch.prototype.filterOnEnter=RMetadataFilterSearch_FilterOnEnter;function RMetadataFilterSearch_AddSensor(id,name){var aej=false;for(var index=0;index<this.aSensorID.length&&!aej;index++){if(this.aSensorName[index].text==name&&this.aSensorID[index].value==id){aej=true}}if(!aej){this.aSensorName[this.aSensorName.length]=name;this.aSensorID[this.aSensorID.length]=id;if(this.bInitDone){var aek=document.getElementById(this.sensorFieldUid);if(aek){aek.options[aek.options.length]=new Option(name,id);}}}}RMetadataFilterSearch.prototype.addSensor=RMetadataFilterSearch_AddSensor;function RMetadataFilterSearch_AddPlatform(id,name){var ael=false;for(var index=0;index<this.aPlatformID.length&&!ael;index++){if(this.aPlatformName[index].text==name&&this.aPlatformID[index].value==id){ael=true}}if(!ael){this.aPlatformName[this.aPlatformName.length]=name;this.aPlatformID[this.aPlatformID.length]=id;if(this.bInitDone){var aem=document.getElementById(this.platformFieldUid);if(aem){aem.options[aem.options.length]=new Option(name,id);}}}}RMetadataFilterSearch.prototype.addPlatform=RMetadataFilterSearch_AddPlatform;function RMetadataFilterSearch_ResetFilter(){var aen=document.getElementById(this.extentFieldUid);var keywordNode=document.getElementById(this.keywordFieldUid);var auq=document.getElementById(this.dateFromFieldUid);var aur=document.getElementById(this.dateToFieldUid);var aus=document.getElementById(this.resolutionFieldUid);var aut=document.getElementById(this.resolutionFieldLtGtUid);var auu=document.getElementById(this.resolutionFieldUnitsUid);var auv=document.getElementById(this.sensorFieldUid);var auw=document.getElementById(this.platformFieldUid);var aux=document.getElementById(this.accuracyFieldUid);var auy=document.getElementById(this.accuracyFieldUnitsUid);if(aen&&keywordNode&&auq&&aur&&aus&&aut&&auu&&auv&&auw&&aux&&auy){aen.selectedIndex=0;keywordNode.value="";auq.value="";aur.value="";aus.value="";auu.selectedIndex=0;aut.selectedIndex=0;auv.selectedIndex=0;auw.selectedIndex=0;aux.value="";auy.selectedIndex=0;this.toggleLayerViewMode(aen);this.oCatalogRequester.sendRequest(IIFConfig.IMAGE_CATALOG_ALL_IMAGES,"","POST",true,"",parseResetImageResponseFromCatalog);}}RMetadataFilterSearch.prototype.resetFilter=RMetadataFilterSearch_ResetFilter;function RMetadataFilterSearch_ApplyFilter(){var aeo=document.getElementById(this.extentFieldUid);var keywordNode=document.getElementById(this.keywordFieldUid);var auz=document.getElementById(this.dateFromFieldUid);var ava=document.getElementById(this.dateToFieldUid);var aep=document.getElementById(this.resolutionFieldUid);var avb=document.getElementById(this.resolutionFieldLtGtUid);var avc=document.getElementById(this.resolutionFieldUnitsUid);var aeq=document.getElementById(this.sensorFieldUid);var aer=document.getElementById(this.platformFieldUid);var aes=document.getElementById(this.accuracyFieldUid);var avd=document.getElementById(this.accuracyFieldUnitsUid);if(aeo&&keywordNode&&auz&&ava&&aep&&avb&&avc&&aeq&&aer&&aes&&avd){var data="";if(aeo.options[aeo.selectedIndex].value=="IN_VIEW"){var rMap=rApp.rChannels[rApp.nCurrentChannel].rMaps[0];var map=document[rMap.uid];var tlx,tly,brx,bry;if(rMap.rCoordSys.sProjection.toUpperCase()!="GEODETIC"||rMap.rCoordSys.sDatum.toUpperCase()!="WGS84"){var ave=rMap.getGeoPoint(map.GetTopLeftWorldCoordinateX(),map.GetTopLeftWorldCoordinateY(),rMap.rCoordSys.sDatum,rMap.rCoordSys.sProjection);var avf=rMap.getGeoPoint(map.GetBottomRightWorldCoordinateX(),map.GetBottomRightWorldCoordinateY(),rMap.rCoordSys.sDatum,rMap.rCoordSys.sProjection);tlx=ave[0];tly=ave[1];brx=avf[0];bry=avf[1]}else{tlx=map.GetTopLeftWorldCoordinateX();tly=map.GetTopLeftWorldCoordinateY();brx=map.GetBottomRightWorldCoordinateX();bry=map.GetBottomRightWorldCoordinateY();}var us=this.validateLLExtents(tlx,tly,brx,bry);data+="&tlx="+us[0];data+="&tly="+us[1];data+="&brx="+us[2];data+="&bry="+us[3]}else{data+="&tlx=&tly=&brx=&bry="}data+="&keyword="+trim(keywordNode.value);data+="&dateFrom="+this.formatDate(trim(auz.value));data+="&dateTo="+this.formatDate(trim(ava.value));data+="&nativeResolution="+(trim(aep.value)==""?"":this.convertToMeters(trim(aep.value),avc.selectedIndex));data+="&NativeResolutionLtGt="+(avb.selectedIndex==0?"LT":"GT");data+="&sensorType="+aeq.options[aeq.selectedIndex].value;data+="&platform="+aer.options[aer.selectedIndex].value;data+="&positionalAccuracy="+(trim(aes.value)==""?"":this.convertToMeters(trim(aes.value),avd.selectedIndex));this.oCatalogRequester.sendRequest(IIFConfig.IMAGE_CATALOG_FILTER_IMAGES,data,"POST",true,"",parseResetImageResponseFromCatalog);document.getElementById("BOTTOM_OF_LAYERS").scrollIntoView();}}RMetadataFilterSearch.prototype.applyFilter=RMetadataFilterSearch_ApplyFilter;function RMetadataFilterSearch_FormatDate(date){var avg=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];var ut=date.split("-");if(ut.length==3){var aet=false;var nv=0;for(var index=0;index<avg.length&&!aet;index++){if(avg[index]==ut[1]){aet=true;nv=index+1;if(nv<10){nv="0"+nv}}}if(aet){return ut[2]+"-"+nv+"-"+ut[0]}}return""}RMetadataFilterSearch.prototype.formatDate=RMetadataFilterSearch_FormatDate;function RMetadataFilterSearch_ValidateLLExtents(tlx,tly,brx,bry){var bc=new Array(4);if(tlx&&tly&&brx&&bry){bc[0]=(tlx<-180?-180:tlx);bc[0]=(bc[0]>180?180:bc[0]);bc[1]=(tly<-90?-90:tly);bc[1]=(bc[1]>90?90:bc[1]);bc[2]=(brx<-180?-180:brx);bc[2]=(bc[2]>180?180:bc[2]);bc[3]=(bry<-90?-90:bry);bc[3]=(bc[3]>90?90:bc[3]);}return bc}RMetadataFilterSearch.prototype.validateLLExtents=RMetadataFilterSearch_ValidateLLExtents;function RMetadataFilterSearch_ConvertToMeters(value,unitsIndex){var nw=-1;switch(unitsIndex){case 0:{nw=parseFloat(value)*0.3048;break}case 1:{nw=(parseFloat(value)/12)*0.3048;break}case 2:{nw=value;break}case 3:{nw=parseFloat(value)/100;break}}return nw}RMetadataFilterSearch.prototype.convertToMeters=RMetadataFilterSearch_ConvertToMeters;function RMetadataFilterSearch_FilterResponse(responseText){}RMetadataFilterSearch.prototype.filterResponse=RMetadataFilterSearch_FilterResponse;function ROverviewMap(oCatalog,url,width,height){rXadd(this);this.uid=RUid.newUid("overview");this.imgUid=RUid.newUid("overviewImg");this.indicatorUid=RUid.newUid("overviewIndicator");this.tBuildTimer=null;this.oCatalog=oCatalog;this.bHaveInitial=false;this.sUrlBase=url;this.sUrl="";this.dWidth=width;this.dHeight=height;this.dAspectRatio=width/height;this.bActive=false;this.bVisible=true;this.dCurrentTLX=0;this.dCurrentTLY=0;this.dCurrentBRX=0;this.dCurrentBRY=0;this.dTLX=0;this.dTLY=0;this.dBRX=0;this.dBRY=0;this.tUpdateImage=null;this.tErrorTimer=null;this.bError=false;this.bMouseDown=false;this.lastX=0;this.lastY=0}function ROverviewMap_Init(){var txt="<table cellpadding='0' cellspacing='0' id='overviewParent' style='position:relative;top:0px;left:0px' width='100%'><tr><td style='padding:0px;'><table cellpadding='0' cellspacing='0'><tr><td id='overviewCell' style='padding:0px;'>";txt+="<div id='OverviewFrame' style='padding:0px;LEFT:0px;WIDTH:100%;POSITION:relative;HEIGHT:100%;visbility:"+(this.bError?"hidden":"visible")+";'><img src='"+"./images/Transparent.gif"+"'";txt+="border='0' id='"+this.imgUid+"' onerror='"+this.myself+".imageLoadError(true)' onload='"+this.myself+".imageOnLoad()' onmousedown='"+this.myself+".imgMouseDown(event);'>";txt+="<div id='LoadingMessage' style='position:absolute;top:50px;left:120px;display:none;color:#aaaaaa'>Loading...</div><div id='OverviewBox' style='LEFT:0px;WIDTH:10px;POSITION:absolute;HEIGHT:10px;z-index:1;'>";txt+="<table width='100%' height='100%' border='2' cellpadding='0' cellspacing='0' style='BORDER-RIGHT:red 2px solid;BORDER-TOP:red 2px solid;BORDER-LEFT:red 2px solid;BORDER-BOTTOM:red 2px solid'>";txt+="<tr><td onmousedown='"+this.myself+".overviewMouseDown(event);'></td></tr></table></div></div></td></tr></table></td></tr></table>";return txt}ROverviewMap.prototype.init=ROverviewMap_Init;function ROverviewMap_ImgMouseDown(e){var x,y;if(typeof(e.offsetX)!="undefined"){x=e.offsetX;y=e.offsetY}else{x=e.layerX;y=e.layerY}overviewMap.overviewPan(x,y);}ROverviewMap.prototype.imgMouseDown=ROverviewMap_ImgMouseDown;function ROverviewMap_OverviewMouseDown(e){this.lastX=e.screenX;this.lastY=e.screenY;this.bMouseDown=true;this.docMouseMove=document.onmousemove;this.docMouseUp=document.onmouseup;document.onmousemove=function(e){e=e?e:(window.event?window.event:"");var dc=document.getElementById("OverviewBox");if(overviewMap.bMouseDown&&dc){dc.style.left=(parseFloat(dc.style.left)-(overviewMap.lastX-e.screenX));dc.style.top=(parseFloat(dc.style.top)-(overviewMap.lastY-e.screenY));overviewMap.lastX=e.screenX;overviewMap.lastY=e.screenY}};document.onmouseup=function(e){e=e?e:(window.event?window.event:"");overviewMap.bMouseDown=false;document.onmousemove=overviewMap.docMouseMove;document.onmouseup=overviewMap.docMouseUp;var dc=document.getElementById("OverviewBox");if(dc){var width=parseFloat(dc.style.width);var height=parseFloat(dc.style.height);var left=parseFloat(dc.style.left);var top=parseFloat(dc.style.top);overviewMap.overviewPan(left+(width/2),top+(height/2));}}}ROverviewMap.prototype.overviewMouseDown=ROverviewMap_OverviewMouseDown;function ROverviewMap_OverviewMouseMove(e){var nx=document.getElementById("OverviewBox");if(this.bMouseDown&&nx){nx.style.left=(parseFloat(nx.style.left)-(this.lastX-e.screenX));nx.style.top=(parseFloat(nx.style.top)-(this.lastY-e.screenY));this.lastX=e.screenX;this.lastY=e.screenY;}}ROverviewMap.prototype.overviewMouseMove=ROverviewMap_OverviewMouseMove;function ROverviewMap_OverviewMouseOut(e){this.bMouseDown=false;document.onmousemove=this.docMouseMove}ROverviewMap.prototype.overviewMouseOut=ROverviewMap_OverviewMouseOut;function ROverviewMap_GetUrl(initial){var rMap=this.oCatalog.maps[0];var map=document[rMap.uid];var dTLX,dTLY,dBRX,dBRY;if(initial){dTLX=IIFConfig.STARTING_EXTENTS[0];dTLY=IIFConfig.STARTING_EXTENTS[1];dBRX=IIFConfig.STARTING_EXTENTS[2];dBRY=IIFConfig.STARTING_EXTENTS[3]}else{dTLX=this.dCurrentTLX;dTLY=this.dCurrentTLY;dBRX=this.dCurrentBRX;dBRY=this.dCurrentBRY}var aeu=Math.abs(dBRX-dTLX)*IIFConfig.OVERVIEW_PADDING;var aev=Math.abs(dTLY-dBRY)*IIFConfig.OVERVIEW_PADDING;var blv=aeu/aev;dTLX-=aeu;dTLY+=aev;dBRX+=aeu;dBRY-=aev;var blw=dBRX-dTLX;var blx=dTLY-dBRY;if(blv<this.dAspectRatio){var avh=dTLX+(blw/2);var avi=(blx*this.dAspectRatio)/2;dTLX=avh-avi;dBRX=avh+avi}this.dTLX=dTLX;this.dTLY=dTLY;this.dBRX=dBRX;this.dBRY=dBRY;this.sUrl=this.sUrlBase+"&WIDTH="+this.dWidth+"&HEIGHT="+this.dHeight+"&BBOX="+dTLX+","+dBRY+","+dBRX+","+dTLY}ROverviewMap.prototype.getUrl=ROverviewMap_GetUrl;function ROverviewMap_UpdateImage(){clearTimeout(this.tErrorTimer);this.tUpdateImage=null;this.bHaveInitial=true;var aew=document.getElementById(this.imgUid);var avj=document.getElementById("OverviewBox");var avk=document.getElementById("LoadingMessage");if(aew&&avj&&avk){this.getUrl(false);aew.src=this.sUrl;aew.style.display="none";avj.style.display="none";avk.style.display="block";this.tErrorTimer=setTimeout(this.myself+".imageLoadError()",IIFConfig.OVERVIEW_ERRORTIMEOUT);}}ROverviewMap.prototype.updateImage=ROverviewMap_UpdateImage;function ROverviewMap_ImageOnLoad(){clearTimeout(this.tErrorTimer);this.tErrorTimer=null;var aex=document.getElementById("OverviewBox");var avl=document.getElementById(this.imgUid);var bly=document.getElementById("LoadingMessage");if(aex&&avl){bly.style.display="none";aex.style.display="block";avl.style.display="block";aex.style.visibility="visible";this.refreshOverview();}}ROverviewMap.prototype.imageOnLoad=ROverviewMap_ImageOnLoad;function ROverviewMap_ImageLoadError(retry){if(this.tErrorTimer!=null){clearTimeout(this.tErrorTimer);this.tErrorTimer=null;var aey=document.getElementById("OverviewBox");var avm=document.getElementById(this.imgUid);var avn=document.getElementById("LoadingMessage");if(aey&&avm&&avn){aey.style.display="none";aey.style.visibility="hidden";avm.style.display="none";avn.style.display="none"}if(retry){this.getUrl();this.tErrorTimer=setTimeout(this.myself+".updateImage()",2000);}}}ROverviewMap.prototype.imageLoadError=ROverviewMap_ImageLoadError;function ROverviewMap_OverviewPan(x,y){var rMap=this.oCatalog.maps[0];var map=document[rMap.uid];var blz=document.getElementById("OverviewFrame");var avo=blz.getElementsByTagName("img")[0];var dTLX=this.dTLX;var dTLY=this.dTLY;var dBRX=this.dBRX;var dBRY=this.dBRY;var nWidth=avo.offsetWidth;var nHeight=avo.offsetHeight;var dX=dTLX+(dBRX-dTLX)*x/nWidth;var dY=dTLY+(dBRY-dTLY)*y/nHeight;if(rMap.rCoordSys.sDatum.toUpperCase()=="WGS84"&&rMap.rCoordSys.sProjection.toUpperCase()=="GEODETIC"){dTLX=map.GetTopLeftWorldCoordinateX();dTLY=map.GetTopLeftWorldCoordinateY();dBRX=map.GetBottomRightWorldCoordinateX();dBRY=map.GetBottomRightWorldCoordinateY();rMap.setExtents(dX-(dBRX-dTLX)*0.5,dY-(dBRY-dTLY)*0.5,dX+(dBRX-dTLX)*0.5,dY+(dBRY-dTLY)*0.5);}else{var ny=rMap.getGeoPoint(map.GetTopLeftWorldCoordinateX(),map.GetTopLeftWorldCoordinateY(),rMap.rCoordSys.sDatum,rMap.rCoordSys.sProjection);var nz=rMap.getGeoPoint(map.GetBottomRightWorldCoordinateX(),map.GetBottomRightWorldCoordinateY(),rMap.rCoordSys.sDatum,rMap.rCoordSys.sProjection);dTLX=parseFloat(ny[0]);dTLY=parseFloat(ny[1]);dBRX=parseFloat(nz[0]);dBRY=parseFloat(nz[1]);ny=rMap.getENPoint(dX-(dBRX-dTLX)*0.5,dY-(dBRY-dTLY)*0.5,rMap.rCoordSys.sDatum,rMap.rCoordSys.sProjection);nz=rMap.getENPoint(dX+(dBRX-dTLX)*0.5,dY+(dBRY-dTLY)*0.5,rMap.rCoordSys.sDatum,rMap.rCoordSys.sProjection);rMap.setExtents(ny[0],ny[1],nz[0],nz[1]);}}ROverviewMap.prototype.overviewPan=ROverviewMap_OverviewPan;function ROverviewMap_Build(){}ROverviewMap.prototype.build=ROverviewMap_Build;function ROverviewMap_RefreshOverview(){var rMap=this.oCatalog.maps[0];var map=document[rMap.uid];var dTLX,dTLY,dBRX,dBRY;if(rMap.rCoordSys.sDatum==""||rMap.rCoordSys.sProjection==""){return}if(rMap.rCoordSys.sDatum.toUpperCase()=="WGS84"&&rMap.rCoordSys.sProjection.toUpperCase()=="GEODETIC"){dTLX=map.GetTopLeftWorldCoordinateX();dTLY=map.GetTopLeftWorldCoordinateY();dBRX=map.GetBottomRightWorldCoordinateX();dBRY=map.GetBottomRightWorldCoordinateY();}else{var avp=rMap.getGeoPoint(map.GetTopLeftWorldCoordinateX(),map.GetTopLeftWorldCoordinateY(),rMap.rCoordSys.sDatum,rMap.rCoordSys.sProjection);var avq=rMap.getGeoPoint(map.GetBottomRightWorldCoordinateX(),map.GetBottomRightWorldCoordinateY(),rMap.rCoordSys.sDatum,rMap.rCoordSys.sProjection);dTLX=parseFloat(avp[0]);dTLY=parseFloat(avp[1]);dBRX=parseFloat(avq[0]);dBRY=parseFloat(avq[1]);}if(this.bNoImage){this.updateImage();this.bNoImage=false}this.updateOverview(dTLX,dTLY,dBRX,dBRY);}ROverviewMap.prototype.refreshOverview=ROverviewMap_RefreshOverview;function ROverviewMap_UpdateOverview(dWorldTLX,dWorldTLY,dWorldBRX,dWorldBRY){if(!this.oDiv){this.oDiv=document.getElementById("OverviewBox");}if(!this.rMap){this.rMap=this.oCatalog.maps[0]}if(!this.oImg){this.oImg=this.oDiv.parentNode.getElementsByTagName("img")[0]}this.dCurrentTLX=dWorldTLX;this.dCurrentTLY=dWorldTLY;this.dCurrentBRX=dWorldBRX;this.dCurrentBRY=dWorldBRY;var nWidth=this.oImg.offsetWidth;var nHeight=this.oImg.offsetHeight;var oa=Math.min(nWidth-1,Math.max(0,nWidth*(dWorldTLX-this.dTLX)/(this.dBRX-this.dTLX)));var bma=Math.min(nWidth-1,Math.max(0,nWidth*(dWorldBRX-this.dTLX)/(this.dBRX-this.dTLX)));var ob=Math.min(nHeight,Math.max(0,nHeight*(dWorldTLY-this.dTLY)/(this.dBRY-this.dTLY)));var bmb=Math.min(nHeight,Math.max(0,nHeight*(dWorldBRY-this.dTLY)/(this.dBRY-this.dTLY)));var aez=bma-oa+1;var afa=bmb-ob+1;if(oa>=0&&ob>=0&&aez>=0&&afa>=0){this.oDiv.style.left=oa+"px";this.oDiv.style.top=ob+"px";this.oDiv.style.width=aez+"px";this.oDiv.style.height=afa+"px"}if(this.bActive){if(oa<=0||ob<=0||oa>=(nWidth-aez)||ob>=(nHeight-afa)){if(this.bHaveInitial){clearTimeout(this.tUpdateImage);this.tUpdateImage=setTimeout(this.myself+".updateImage()",200);}}}}ROverviewMap.prototype.updateOverview=ROverviewMap_UpdateOverview;function RArcxmlAccess_Search(){if(this.service.currentSearch>-1){var rSearch=this.service.searches[this.service.currentSearch];rSearch.decodeForm();var catalog=this.service.catalog;if(catalog.maps.length)this.searchMap(catalog.maps[0],rSearch);}}RArcxmlAccess.prototype.search=RArcxmlAccess_Search;function IEESubmissionForm(){}function IEESubmissionForm_BuildFixed(){var html="<div style='display:none;'><form id='ieeSubmission' name='ieeSubmission' action='"+IIFConfig.IEE_SUBMISSION+"' method='post' target='ieesubmission'>";html+="<input type='hidden' name='extents' id='extents' value='' /><input type='hidden' name='imagelist' id='imagelist' value='' /></form></div>";return html}IEESubmissionForm.prototype.buildFixed=IEESubmissionForm_BuildFixed;function IEEPaneContent(rToolbarImageViewer){this.oToolbar=rToolbarImageViewer;this.tlxFieldUid=RUid.newUid("field");this.tlyFieldUid=RUid.newUid("field");this.brxFieldUid=RUid.newUid("field");this.bryFieldUid=RUid.newUid("field");rXadd(this);}function IEEPaneContent_Init(){return""}IEEPaneContent.prototype.init=IEEPaneContent_Init;function IEEPaneContent_Build(){var txt="";txt+="<div style='margin-left:10px;margin-right:10px;margin-bottom:10px;'>";txt+="<div class='ieePaneText'>BEFORE YOU DOWNLOAD</div>";txt+="<p class='ieePaneText'>Pick an area to extract</p>";txt+="<div><table cellpadding='0' cellspacing='8'><tr><td style='background-color:#454545;'>"+this.oToolbar.buildExternal("mapCreateExtractionClipRegion")+"</td><td class='ieePaneText'>Define Extract Area</td></tr></table></div>";txt+="<div><table cellpadding='0' cellspacing='8'><tr><td style='background-color:#454545;'>"+this.oToolbar.buildExternal("mapExtract")+"</td><td class='ieePaneText'>Extract Defined Area</td></tr></table>";txt+="</div>";txt+="<div style='background-image:url(\"./images/horizontalDash.gif\");background-repeat: repeat-x;width:256px;height:1px;margin-left:15px;margin-top:20px;margin-bottom:0px;'>&nbsp;</div>";txt+="<p class='ieePaneText'>Or</p>";txt+="<div><table cellpadding='0' cellspacing='8'><tr><td style='background-color:#454545;'>"+this.oToolbar.buildExternal("mapExtractView")+"</td><td class='ieePaneText'>Extract Current View</td></tr></table></div>";txt+="<p class='ieePaneParagraphText'>Extractions are limited to "+IIFConfig.MAX_SIZE_PER_DAY+" per day. If you want to keep the native image resolution, define a small extraction region. Otherwise, the system may ask you to specify a larger pixel size (i.e. a lower resolution) or a reduced image quality.</p>";txt+="</div>";return txt}IEEPaneContent.prototype.build=IEEPaneContent_Build;function RHelpCloud(){this.uid=RUid.newUid("helpCloud");rXadd(this);this.sContent=""}function RHelpCloud_Build(){var txt="";txt+="<div id='"+this.uid+"' style='position:relative;z-index:99;top:10px;left:270px;width:15px;height16px;background:#454545;cursor:pointer;'>"+getImg(15,16,"./images/help_button.png",(this.myself+".activate()"))+"</div>";return txt}RHelpCloud.prototype.build=RHelpCloud_Build;function RHelpCloud_Activate(){var bmc=document.getElementById("HelpCloudPopup");if(bmc){closePopup();}else{if(rApp.isIE6){for(var index=0;index<aHideSelects.length;index++){var oc=document.getElementById(aHideSelects[index]);if(oc){oc.style.display="none"}}}document.onclick=null;var oc=document.getElementById(this.uid);if(oc){var dt=document.createElement("div");dt.setAttribute("id","HelpCloudPopup");dt.style.cursor="auto";dt.style.position="absolute";dt.style.top="15px";dt.style.left="-260px";dt.style.width="280px";dt.style.overflow="visible";dt.zIndex="99";dt.innerHTML=this.getCloudContent();oc.appendChild(dt);this.helpCloudState=true}var bue=setTimeout("setOnClickClose('HelpCloudPopup')",100);}}RHelpCloud.prototype.activate=RHelpCloud_Activate;function RHelpCloud_GetCloudContent(){var txt="";txt+="<div style='height:69px;width:279px;"+this.getBackground("./images/helpCloudTop.png","no-repeat")+"'>&nbsp;</div>";txt+="<div class='helpCloudContent' style='width:279;"+this.getBackground("./images/helpCloudMiddle.png","repeat-y")+"'>";txt+="<table cellpadding='0' cellspacing='0'><tr><td style='width:10px;'>&nbsp;</td>";txt+="<td style='width:253px;vertical-align:top;' class='helpCloudContent'>"+this.sContent+"</td>";txt+="</tr></table></div>";txt+="<div style='height:29px;width:279px;"+this.getBackground("./images/helpCloudBottom.png","no-repeat")+"'>&nbsp;</div>";return txt}RHelpCloud.prototype.getCloudContent=RHelpCloud_GetCloudContent;function RHelpCloud_GetBackground(image,repeat){var txt="";if(rApp.isIE6){txt="background:none;background-repeat: "+repeat+";filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\""+image+"\",sizingMethod=\"scale\");"}else{txt="background:url(\""+image+"\") "+repeat+";"}return txt}RHelpCloud.prototype.getBackground=RHelpCloud_GetBackground;function RGeoAddressAccess(service){this.name="Google Geocoded Address";this.orderLayers=RAccess_OrderLayers;this.hasMetadata=true;this.hasLegend=false;this.hasQuery=false;this.hasSearch=false;this.canReorder=true;this.hasPrint=true;this.rXml=new RXml();this.aResultGeoMap=new Array();this.aResultAccuracyMap=new Array();}rAccess["googleGeoAddress"]=RGeoAddressAccess;function RGeoAddressAccess_LoadMap(rMap){}RGeoAddressAccess.prototype.loadMap=RGeoAddressAccess_LoadMap;function RGeoAddressAccess_LoadLayers(rMap){}RGeoAddressAccess.prototype.loadLayers=RGeoAddressAccess_LoadLayers;function RGeoAddressAccess_QueryLayers(rMap){}RGeoAddressAccess.prototype.queryLayers=RGeoAddressAccess_QueryLayers;function RGeoAddressAccess_Search(){if(this.service.currentSearch>-1){var rSearch=this.service.searches[this.service.currentSearch];rSearch.decodeForm();var catalog=this.service.catalog;if(catalog.maps.length){this.searchMap(catalog.maps[0],rSearch);}}}RGeoAddressAccess.prototype.search=RGeoAddressAccess_Search;function RGeoAddressAccess_SearchMap(rMap,rSearch,nSearchOffset){if(!this.service.loaded||!rMap.loaded){return}this.service.busy(true);this.service.nLayersLoadState=eLayersLoadState.LOADED;if(arguments.length<3){if(this.tMapTimer)clearTimeout(this.tMapTimer);this.tMapTimer=setTimeout(""+this.myself+".searchMap("+rMap.myself+","+rSearch.myself+",0)",this.nTimeout);return}rSearch.decodeForm();if(rSearch.resultsField){rSearch.deleteResults();rSearch.addResult(rSearch.sLoadingResults);}if(nSearchOffset==0){this.sSearchText=""}if(((rSearch.fields.length-rSearch.nNumHiddenFields)==1)&&(rSearch.bSubmitOnLoad==false)){if(nSearchOffset==0){for(var i=0;i<rSearch.fields.length;i++){if(rSearch.fields[i].style=="string"){this.sSearchText=rSearch.fields[i].value;break}}}if(this.sSearchText==""){if(this.tMapTimer)clearTimeout(this.tMapTimer);if(rSearch.resultsField){rSearch.deleteResults();rSearch.addResult(rSearch.sNoResults);}return}}rSearch.nSearchOffset=nSearchOffset;var data="";for(var i=0;i<rSearch.fields.length;i++){if(rSearch.fields[i].key=="address"){data=rSearch.fields[i].value}}var urlParams="?address="+data+"&output=xml";var url='mode=0;action=GET;body=;';url+='worldTLX='+rMap.tlx+';worldTLY='+rMap.tly+';worldBRX='+rMap.brx+';worldBRY='+rMap.bry+';';url+='url='+IIFConfig.SOAP_SERVICE+urlParams+';';var map=document[rMap.uid];var result=map.SetLayerParameter(this.service.uid,url);this.isSearching=true;rApp.status(this.msg="Performing "+rSearch.name+" search...");}RGeoAddressAccess.prototype.searchMap=RGeoAddressAccess_SearchMap;function RGeoAddressAccess_ResponseMap(rMap,layerName,url,body,action,tlx,tly,brx,bry,response){if(response=="NCS_OVERLAY_SUCCESS"){this.service.busy(false);return}var map=document[rMap.uid];var bmd=new RegExp('&amp;','gi');var sResponse=response.replace(bmd,'&');var bme=new RegExp(' & ','gi');var sResponse=sResponse.replace(bme,' and ');var gk=sResponse.indexOf("<FIELD ");while(gk>-1){var od=sResponse.substring(gk,sResponse.length);var ic=od.indexOf(">");if(ic<0)gk=-1;else{var uu=od.indexOf("value=\"");if(uu<0)uu=od.indexOf("VALUE=\"");if(uu<0)gk=-1;else{var ie=(uu+6);var ig=-1;var ih=od.substring(ie+1,ic);var avr=ih.indexOf("=");if(avr>=0){ic=ie+1+avr;ih=od.substring(ie+1,ic);}ic+=gk;var oe=ih.indexOf("\"");while(oe>-1){ig=oe;ih=ih.substring(ig+1,ih.length);oe=ih.indexOf("\"");if(oe>-1)oe+=(ig+1);}if(ig>-1){ie+=gk;ig+=(ie+1);var bmf=sResponse.substring(ie+1,ig);var bmg=sResponse.substring(0,ie+1);var bmh=bmf.replace(/\"/g,"'");var bmi=sResponse.substring(ig,sResponse.length);sResponse=bmg+bmh+bmi}}}var bmj=sResponse.substring(ic+1,sResponse.length);var avs=bmj.indexOf("<FIELD ");if(avs>-1)gk=avs+ic+1;else gk=-1}this.rXml.loadXmlText(sResponse);var valid=false;if(this.service.currentSearch>-1){this.service.searchResponse(rMap);valid=true}if(!valid){this.service.busy(false);rApp.popupAlert(this.service.name+" ("+this.interfaceName+") Error.","The map server reported an error.",sResponse);}}RGeoAddressAccess.prototype.responseMap=RGeoAddressAccess_ResponseMap;function RGeoAddressAccess_SearchResponse(rMap){var buf="";var rSearch=this.service.searches[this.service.currentSearch];var jw=this.rXml.rootXml.getElementsByTagName("Response")[0];var valid=true;var afb=8;if(rSearch.resultsField&&jw){rSearch.deleteResults();}if(jw&&(this.service.currentSearch>-1)){var avt=jw.getElementsByTagName("Status")[0];if(avt){var uv=avt.getElementsByTagName("code")[0];if(uv){if(uv.firstChild&&uv.firstChild.nodeValue){if(uv.firstChild.nodeValue!="200"){rSearch.addResult(rSearch.sNoResults);valid=false}}}}if(valid){var of=jw.getElementsByTagName("Placemark");if(of){for(var index=0;index<of.length;index++){var jx=new Array();var uw=of[index].getElementsByTagName("address")[0];var ii=of[index].getElementsByTagName("coordinates")[0];var avu=of[index].getElementsByTagName("AddressDetails")[0];if(avu){afb=avu.getAttribute("Accuracy");}if(ii){if(uw&&uw.firstChild&&uw.firstChild.nodeValue&&ii.firstChild&&ii.firstChild.nodeValue){jx[jx.length]=uw.firstChild.nodeValue;this.aResultGeoMap[index]=ii.firstChild.nodeValue;this.aResultAccuracyMap[index]=afb;rSearch.addResult(jx,index);}else if(ii.firstChild&&ii.firstChild.nodeValue&&jw.getElementsByTagName("name")[0].firstChild.nodeValue){jx[jx.length]=jw.getElementsByTagName("name")[0].firstChild.nodeValue;this.aResultGeoMap[index]=ii.firstChild.nodeValue;this.aResultAccuracyMap[index]=afb;rSearch.addResult(jx,index);}}}}}}var avv=document.getElementById(rSearch.fields[0].uid);if(avv){avv.focus();}}RGeoAddressAccess.prototype.searchResponse=RGeoAddressAccess_SearchResponse;function RGeoAddressAccess_OnSelectSearchResult(){var catalog=this.service.catalog;var rMap=catalog.maps[0];var map=document[catalog.maps[0].uid];var og=-1;var bug=0.11;var rSearch=this.service.searches[this.service.currentSearch];var buh=rSearch.dMinZoomWidth;var bui=rSearch.dMinZoomHeight;rSearch.decodeForm();if(rSearch.resultsField){og=parseInt(rSearch.resultsField.value);if(isNaN(og)||(og<0)){return}var bmk=this.aResultGeoMap[og];var bml=this.aResultAccuracyMap[og];var avw=bmk.split(",");this.zoomToPoint(avw[0],avw[1],"4326",bml);}}RGeoAddressAccess.prototype.onSelectSearchResult=RGeoAddressAccess_OnSelectSearchResult;function RGeoAddressAccess_ZoomToPoint(x,y,srs,accuracy){var catalog=this.service.catalog;var rMap=catalog.maps[0];var map=document[catalog.maps[0].uid];var avx=false;var bmm=map.GetViewWidth();var bmn=map.GetViewHeight();var afc=rMap.getTopEcw();var avy=map.GetLayerCellSizeX(afc);var avz=map.GetLayerCellSizeY(afc);var buj=map.GetLayerCellUnits(afc);var gl=parseFloat(x);var gm=parseFloat(y);var sDatum="";var sProjection="";var afd=accuracy?accuracy:8;if(arguments.length<3){sDatum=rMap.rCoordSys.sDatum;sProjection=rMap.rCoordSys.sProjection}else{var ux=GDTEPSGMappings.getDatumProjection(srs);if(ux==null){return}sDatum=ux.sDatum;sProjection=ux.sProjection}if(rMap.rCoordSys.sProjection.toUpperCase()!=ux.sProjection.toUpperCase()){var oh=rMap.getGeoPoint(gl,gm,sDatum,sProjection);if(rMap.rCoordSys.sProjection.toUpperCase()!="GEODETIC"){oh=rMap.getENPoint(oh[0],oh[1],rMap.rCoordSys.sDatum,rMap.rCoordSys.sProjection);}gl=parseFloat(oh[0]);gm=parseFloat(oh[1]);}for(var index=map.GetNumberLayers()-1;index>=0&&!avx;index--){var sLayerName=map.GetLayerName(index);var awa=map.GetLayerType(sLayerName);if(awa.toUpperCase()=="ECW"||awa.toUpperCase()=="JP2"){var url=map.GetLayerParameter(sLayerName,"URL");var bmo=map.GetLayerImageTopLeftWorldCoordinateX(sLayerName);var bmp=map.GetLayerImageTopLeftWorldCoordinateY(sLayerName);var bmq=map.GetLayerImageBottomRightWorldCoordinateX(sLayerName);var bmr=map.GetLayerImageBottomRightWorldCoordinateY(sLayerName);if((bmq>gl&&bmr<gm)&&(bmo<gl&&bmp>gm)){avy=map.GetLayerCellSizeX(sLayerName);avz=map.GetLayerCellSizeY(sLayerName);avx=true}}}dMinDeltaX=(avy*bmm)/2;dMinDeltaY=(Math.abs(avz*bmn))/2;dTopLeftXPadded=gl-dMinDeltaX;dTopLeftYPadded=gm+dMinDeltaY;dBottomRightXPadded=gl+dMinDeltaX;dBottomRightYPadded=gm-dMinDeltaY;if(afd<8&&afd>0){var obj=rMap.getDeltaXYFromDistance(IIFConfig.ADDRESS_SEARCH_SCALE_FACTORS[afd],"MILES");if(obj.X>(dBottomRightXPadded-dTopLeftXPadded)){dMinDeltaX=obj.X/2;dMinDeltaY=obj.Y/2}}map.SetExtents(gl-dMinDeltaX,gm+dMinDeltaY,gl+dMinDeltaX,gm-dMinDeltaY);}RGeoAddressAccess.prototype.zoomToPoint=RGeoAddressAccess_ZoomToPoint;function RCalendar(){rXadd(this);this.oCallbackId=null;this.oAttach=null;this.sMonths=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];this.sDaysPerMonth=[31,28,31,30,31,30,31,31,30,31,30,31];var date=new Date();this.dMonth=date.getMonth();this.dYear=date.getFullYear();this.uid=RUid.newUid("RCalendar");this.dWidth=208}RCalendar.prototype.getStartDay=function(){var date=new Date();date.setDate(1);date.setMonth(this.dMonth);date.setYear(this.dYear);return date.getDay();};RCalendar.prototype.fillDays=function(){var bd=this.getStartDay();var ao=0;var overflow=false;var ey=this.sDaysPerMonth[this.dMonth];var afe=document.getElementById("RCalendarNow");var ak;ey=(this.dMonth==1&&(this.dYear%4)==0)?ey+1:ey;afe.innerHTML=this.sMonths[this.dMonth]+", "+this.dYear;for(var ag=0;ag<bd;ag++){ak=document.getElementById("calendarDay"+ao+"-"+ag);ak.innerHTML="";ak.style.cursor="auto";ak.setAttribute("onclick","");}for(var ag=1;ag<=ey;ag++){ak=document.getElementById("calendarDay"+ao+"-"+bd);ak.innerHTML=ag;ak.onclick=new Function("evt",this.myself+".selectedDate("+ag+");");ak.style.cursor="pointer";bd++;if(bd>=7){bd=0;ao++;if(ao>=5){ao=0;overflow=true}}}if(!overflow){while(bd<7){ak=document.getElementById("calendarDay"+ao+"-"+bd);ak.innerHTML="";ak.setAttribute("onclick","");ak.style.cursor="auto";bd++}}};RCalendar.prototype.selectedDate=function(ag){try{if(ag<10){ag="0"+ag}document.getElementById(this.oCallbackId).value=ag+"-"+this.sMonths[this.dMonth]+"-"+this.dYear}catch(ex){}finally{this.closeCalendar();}};RCalendar.prototype.closeCalendar=function(){if(this.oAttach!=null){var aq=document.getElementById(this.uid);if(aq){if(this.oAttach){if(this.oAttach.removeChild){this.oAttach.removeChild(aq);}}}this.oAttach=null}};RCalendar.prototype.show=function(x,y,attach){var ij=document.createElement("div");ij.id=this.uid;ij.innerHTML=this.init();ij.style.position="absolute";ij.style.top=y;ij.style.left=x-this.dWidth;ij.style.width=this.dWidth;this.oAttach=attach;if(attach){if(attach.appendChild){attach.appendChild(ij);}}this.fillDays();};RCalendar.prototype.init=function(){var html="";html+="<table cellpadding='0' cellspacing='0'><tr><td style='width:"+(rApp.isIE?"193px":"198px")+";'>";html+="<div class='mainCalendar' id='RCalendar"+this.uid+"'><table cellpadding='1' cellspacing='1' class='mainTable'>";html+="<tr><td unselectable='on' onselectstart='return false;' style='-moz-user-select:none' onclick='"+this.myself+".backYear();' class='navCell'>&lt;&lt;</td><td unselectable='on' onselectstart='return false;' style='-moz-user-select:none' onclick='"+this.myself+".backMonth();' class='navCell'>&lt;</td><td unselectable='on' onselectstart='return false;' style='-moz-user-select:none' id='RCalendarNow' class='nowCell' colspan='3'>";html+=this.sMonths[this.dMonth]+", "+this.dYear+"</td><td unselectable='on' onselectstart='return false;' style='-moz-user-select:none' onclick='"+this.myself+".forwardMonth();' class='navCell'>&gt;</td><td unselectable='on' onselectstart='return false;' style='-moz-user-select:none' onclick='"+this.myself+".forwardYear();' class='navCell'>&gt;&gt;</td></tr>";html+="<tr><td unselectable='on' onselectstart='return false;' style='-moz-user-select:none' class='labelCell'>S</td><td unselectable='on' onselectstart='return false;' style='-moz-user-select:none' class='labelCell'>M</td><td unselectable='on' onselectstart='return false;' style='-moz-user-select:none' class='labelCell'>T</td>";html+="<td unselectable='on' onselectstart='return false;' style='-moz-user-select:none' class='labelCell'>W</td><td unselectable='on' onselectstart='return false;' style='-moz-user-select:none' class='labelCell'>Th</td><td unselectable='on' onselectstart='return false;' style='-moz-user-select:none' class='labelCell'>F</td><td unselectable='on' onselectstart='return false;' style='-moz-user-select:none' class='labelCell'>Sa</td></tr>";for(var ao=0;ao<5;ao++){html+="<tr>";for(var ag=0;ag<7;ag++){html+="<td unselectable='on' onselectstart='return false;' style='-moz-user-select:none' id='calendarDay"+ao+"-"+ag+"' class='dayCell'></td>"}html+="</tr>"}html+="</table></div></td>";html+="<td>"+getImg(8,185,"./images/calendarRightShadow.png",null)+"</td></tr>";html+="<tr><td colspan='2'>"+getImg((rApp.isIE?"201px":"206px"),8,"./images/calendarBottomShadow.png",null)+"</td></tr></table>";return html};RCalendar.prototype.backMonth=function(){this.dMonth--;if(this.dMonth<0){this.dMonth=11;this.dYear--}this.fillDays();};RCalendar.prototype.backYear=function(){this.dYear=this.dYear==1900?this.dYear:this.dYear-1;this.fillDays();};RCalendar.prototype.forwardMonth=function(){this.dMonth++;if(this.dMonth>11){this.dMonth=0;this.dYear++}this.fillDays();};RCalendar.prototype.forwardYear=function(){this.dYear=this.dYear==2100?this.dYear:this.dYear+1;this.fillDays();};function RIE6ListBoxOption(value,text){this.value=value;this.text=text}function RIE6ListBox(){this.options=new Array();this.sChildIds=new Array();this.selectedIndex=-1;this.bMouseDown=false;this.sFireFor=null;this.onChange=null;this.dOldSelectedIndex=-1;this.bHoldTimer=false;rXadd(this);}RIE6ListBox.prototype.build=function(){var txt="";txt+="<div class='RIE6ListBoxOuterBorderDiv' onmouseup='"+this.myself+".onMouseUp()' onmousedown='"+this.myself+".onMouseDown()' onclick='null' ondblclick='null'><div class='RIE6ListBoxMiddleBorderDiv'><div class='RIE6ListBoxInnerBorderDiv'>";for(var index=0;index<this.options.length;index++){txt+="<div unselectable='on' id='"+this.sChildIds[index]+"' class='RIE6ListBoxItem' ";txt+=(this.selectedIndex==index?"style='background:#0A246A;color:#ffffff;' ":"");txt+="onmouseover='"+this.myself+".onMouseOver(this.id)' onmouseout='"+this.myself+".onMouseOut(this.id)'>"+this.options[index].text+"</div>"}txt+="</div></div></div>";return txt};RIE6ListBox.prototype.addOption=function(value,text){this.options[this.options.length]=new RIE6ListBoxOption(value,text);this.sChildIds[this.sChildIds.length]="ListBoxItem"+this.sChildIds.length};RIE6ListBox.prototype.onMouseDown=function(){this.dOldSelectedIndex=this.selectedIndex;this.bMouseDown=true;this.onMouseOver(this.sFireFor);};RIE6ListBox.prototype.onMouseUp=function(){if(this.bMouseDown==true){if(this.dOldSelectedIndex!=this.selectedIndex&&!this.bHoldTimer){eval(this.onChange);this.bHoldTimer=true;var buk=setTimeout(this.myself+".cancelHoldTimer()",200);}}this.bMouseDown=false};RIE6ListBox.prototype.cancelHoldTimer=function(){this.bHoldTimer=false};RIE6ListBox.prototype.onMouseOver=function(id){if(this.bMouseDown){for(var index=0;index<this.sChildIds.length;index++){var aq=document.getElementById(this.sChildIds[index]);if(aq){if(this.sChildIds[index]==id){aq.style.color="#ffffff";aq.style.background="#0A246A";this.selectedIndex=index}else{aq.style.color="#000000";aq.style.background="#ffffff"}}}}else{this.sFireFor=id}};RIE6ListBox.prototype.onMouseOut=function(id){this.sFireFor=null};RIE6ListBox.prototype.clear=function(){this.options=new Array();this.sChildIds=new Array();}