if(!window.Node){var Node={ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12}}if(!window.addEventListener){window.addEventListener=function(d,a,b){attachEvent("on"+d,function(){a(event)})}}if(!document.loadXML&&window.DOMParser&&window.XMLSerializer&&window.Node&&Node.prototype&&Node.prototype.__defineGetter__){Document.prototype.loadXML=function(a){var b=(new DOMParser()).parseFromString(a,"text/xml");while(this.hasChildNodes()){this.removeChild(this.lastChild)}for(var d=0;d<b.childNodes.length;d++){if(b.childNodes[d].nodeType==1){this.appendChild(this.importNode(b.childNodes[d],true))}}};Document.prototype.__defineGetter__("xml",function(){return(new XMLSerializer()).serializeToString(this)})}var RO=function(){this.browser=navigator.appName.toLowerCase();this.tlx=0;this.tly=0;this.brx=0;this.bry=0;this.gKey="ABQIAAAAA_pFWGO4zhbxdKDyafughxT07C0ctTrRT4aCH_Gb5GG7AcrfFhSxsQ4-I3sdqn-4kw32oDjYJwBzHQ";this.bShowCoords=false;this.width=100;this.height=100;this.width1K=this.width;this.height1K=this.height;this.bActiveXInstalled=false;this.bActiveXCapable=false;this.forceHTMLControl=false;this.forceECWPControl=false;this.mode="html";this.autoStartImage=false;this.tlyLatitude=90;this.tlxLongitude=-180;this.bryLatitude=-90;this.brxLongitude=180;this.tlyEasting=90;this.tlxNorthing=-180;this.bryEasting=-90;this.brxNorthing=180;this.bColor=false;this.bCustomImageArray=false;this.mouseLatitude=0;this.mouseLongitude=0;this.mouseDown=false;this.server="http://localhost";this.serverECWP="ecwp://localhost";this.bJpip=false;this.wTLX=90;this.wTLY=-180;this.wBRX=-90;this.wBRY=180;this.bGeodeticExtentsUpdated=false;this.bNorthingExtentsUpdated=false;this.mapContainer=null;this.mapContainerId="";this.aPrefixes={};this.imageArray=this.getImages();this.paramsHTML="fadein=true;multilevel=true;";this.totalImageSize=0;this.bLatLong=true;this.map=null;this.aMarker=[];this.uid="ECWView1";this.progressBar="";this.services=new Array();this.gpsServer="http://iws.erdas.com/gps_location.aspx";this.tGPSTimer=null;this.gpsRequestInterval=2000;this.bWMSLayersLoaded=false;this.wmsName="myWms";this.wmshasQuery=false;this.bQuery=false;this.wmsUrl="http://www2.demis.nl/WMS/wms.asp?WMS=WorldMap&";this.tMapTimer=null;this.bWMS=false;this.wmsImageFormat="image/png";this.wmsSRS="EPSG:4326";this.aStyleColors=new NCSColorList();this.VE=false;this.sVectorLayer="vectorLayer";this.aLocs={};this.dMapWorldTLX="";this.dMapWorldTLY="";this.dMapWorldBRX="";this.dMapWorldBRY="";this.bHist=false;this.tHistogramTimer=null;this.histWindow="";this.rx="";this.turnOffLoadingCounter=Array();this.controlHTML=true};RO._XmlDomActiveX=null;RO._GetXmlDomActiveX=function(){if(RO._XmlDomActiveX){return RO._XmlDomActiveX}var b=["MSXML3","Microsoft","MSXML2","MSXML"];var e;for(var d=0;d<b.length;d++){try{var a=b[d]+".XmlDom";e=new ActiveXObject(a);RO._XmlDomActiveX=a;return RO._XmlDomActiveX}catch(f){}}throw new Error("Could not find an installed XML parser")};RO.Xml=function(){if(document.implementation&&document.implementation.createDocument){this.rootXml=document.implementation.createDocument("","",null)}else{if(window.ActiveXObject){this.rootXml=new ActiveXObject(RO._GetXmlDomActiveX());this.rootXml.setProperty("SelectionLanguage","XPath");this.rootXml.validateOnParse=false;this.rootXml.resolveExternals=false;this.rootXml.async=false}else{location.replace("upgrade_browser.htm");alert("This application requires a recent browser that can support<br>XML to run correctly.<br>Please upgrade your browser before using this application.")}}};RO.Xml.prototype.loadXmlText=function(a,b){if(arguments.length<2){b=true}this.rootXml.loadXML(a);if(b){this.stripWhiteSpace()}};RO.Xml.prototype.loadXmlUrl=function(a,b){if(arguments.length<2){b=true}this.rootXml.load(a);if(b){this.stripWhiteSpace()}};RO.Xml.prototype.stripWhiteSpace=function(){var a=/\S/;var d=this.rootXml;for(var b=0;b<d.childNodes.length;b++){if((d.childNodes[b].nodeType==3)&&(!a.test(d.childNodes[b].nodeValue))){d.removeChild(d.childNodes[b]);b--}}};RO.prototype.clone=function(d){var b=d;if(d&&(typeof(d)=="object")){b=new Object();for(var a in d){b[a]=this.clone(d[a])}}return b};RO.prototype.getENPoint=function(a,e,f,b){var h=document[this.uid];var g=new Array();if(arguments.length<3){var f=this.datum()}if(arguments.length<4){var b=this.getLayerProjection()}if((f!="")&&(b!="")&&(b.toLowerCase()!="geodetic")){if(this.bHtml){g=this.convertCoord(f,"GEODETIC",a,e,f,b)}else{var j=this.map.GetParameter("GDTConvertToEN("+f+" "+b+" "+a+" "+e+")");var d=j.split(",");if(d.length>=2){g[0]=parseFloat(d[0]);g[1]=parseFloat(d[1])}}}return g};RO.prototype.getGeodeticExtents=function(){this.tlyLatitude=this.map.GetCoordLatitude(this.wTLX,this.wTLY);this.tlxLongitude=this.map.GetCoordLongitude(this.wTLX,this.wTLY);this.bryLatitude=this.map.GetCoordLatitude(this.wBRX,this.wBRY);this.brxLongitude=this.map.GetCoordLongitude(this.wBRX,this.wBRY);this.bGeodeticExtentsUpdated=true};RO.prototype.getNorthingExtents=function(){this.tlyEasting=this.map.GetCoordEasting(this.wTLX,this.wTLY);this.tlxNorthing=this.map.GetCoordNorthing(this.wTLX,this.wTLY);this.bryEasting=this.map.GetCoordEasting(this.wBRX,this.wBRY);this.brxNorthing=this.map.GetCoordLongitude(this.wBRX,this.wBRY);this.bNorthingExtentsUpdated=true};RO.prototype.getTopLeftEasting=function(){if(!this.bGeodeticExtentsUpdated){this.bNorthingExtentsUpdated()}return this.tlyEasting};RO.prototype.getTopLeftNorthing=function(){if(!this.bNorthingExtentsUpdated){this.getNorthingExtents()}return this.tlyNorthing};RO.prototype.getTopRightEasting=function(){if(!this.bNorthingExtentsUpdated){this.getNorthingExtents()}return this.tryEasting};RO.prototype.getTopRightNorthing=function(){if(!this.bNorthingExtentsUpdated){this.getNorthingExtents()}return this.trxNorthing};RO.prototype.getBottomLeftEasting=function(){if(!this.bNorthingExtentsUpdated){this.getNorthingExtents()}return this.blyEasting};RO.prototype.getBottomLeftNorthing=function(){if(!this.bNorthingExtentsUpdated){this.getNorthingExtents()}return this.blxNorthing};RO.prototype.getBottomRightEasting=function(){if(!this.bNorthingExtentsUpdated){this.getNorthingExtents()}return this.bryEasting};RO.prototype.getBottomRightNorthing=function(){if(!this.bNorthingExtentsUpdated){this.getNorthingExtents()}return this.brxNorthing};RO.prototype.getTopLeftLatitude=function(){if(!this.bGeodeticExtentsUpdated){this.getGeodeticExtents()}return this.tlyLatitude};RO.prototype.getTopLeftLongitude=function(){if(!this.bGeodeticExtentsUpdated){this.getGeodeticExtents()}return this.tlxLongitude};RO.prototype.getTopRightLatitude=function(){if(!this.bGeodeticExtentsUpdated){this.getGeodeticExtents()}return this.tryLatitude};RO.prototype.getTopRightLongitude=function(){if(!this.bGeodeticExtentsUpdated){this.getGeodeticExtents()}return this.trxLongitude};RO.prototype.getBottomLeftLatitude=function(){if(!this.bGeodeticExtentsUpdated){this.getGeodeticExtents()}return this.blyLatitude};RO.prototype.getBottomLeftLongitude=function(){if(!this.bGeodeticExtentsUpdated){this.getGeodeticExtents()}return this.blxLongitude};RO.prototype.getBottomRightLatitude=function(){if(!this.bGeodeticExtentsUpdated){this.getGeodeticExtents()}return this.bryLatitude};RO.prototype.getBottomRightLongitude=function(){if(!this.bGeodeticExtentsUpdated){this.getGeodeticExtents()}return this.brxLongitude};RO.prototype.getMouseLatitude=function(){var d=null;if(this.dMouseWorldX!=null&&this.dMouseWorldY!=null){var b=this.datum();var a=this.projection();var e=this.convertCoord(b,a,this.dMouseWorldX,this.dMouseWorldY,b,"geodetic");if(e&&e.length>=2){d=e[1]}}return d};RO.prototype.getMouseLongitude=function(){var a=null;if(this.dMouseWorldX!=null&&this.dMouseWorldY!=null){var d=this.datum();var b=this.projection();var e=this.convertCoord(d,b,this.dMouseWorldX,this.dMouseWorldY,d,"geodetic");if(e&&e.length>=2){a=e[0]}}return a};RO.prototype.getENPoint=function(g,e,b,a){var d=new Array();if(arguments.length<3){var b=this.getLayerDatum()}if(arguments.length<4){var a=this.getLayerProjection()}if((b!="")&&(a!="")&&(a.toLowerCase()!="geodetic")){if(this.mode=="html"){d=this.map.convertCoord(b,"GEODETIC",g,e,b,a)}else{var h=this.map.GetParameter("GDTConvertToEN("+b+" "+a+" "+g+" "+e+")");var f=h.split(",");if(f.length>=2){d[0]=parseFloat(f[0]);d[1]=parseFloat(f[1])}}}return d};RO.prototype.coordTrans=function(h,b,e,f){var g=this.map._GetCoordEN(h,b);var a=g.split("|");var d={x:a[0],y:a[1]};return d};RO.prototype.getScaleFromExtents=function(d,f,q,a){var l=d+(q-d)/2;var k=f+(a-f)/2;if(this.isGeodetic()){var m=Math.PI*k/180;var r=Math.PI*l/180;var b=6378137;var g=2*b*(Math.acos(Math.sin(m)*Math.sin(m)-Math.cos(m)*Math.cos(m)));var e=Math.abs(q-d)*g/360}else{var e=Math.abs(q-d)}var n=this.width;var o=e/n;var j=this.getScreenXDPI();var h=(0.0254/j);var p=o/h;return p};RO.prototype.getExtentsFromScale=function(b,j,f){var n=new Array(4);var k=this.getScreenXDPI();var g=(0.0254/k);if(f>0){var d=6378137;var m=Math.PI*j/180;var p=Math.PI*b/180;var h=2*d*(Math.acos(Math.sin(m)*Math.sin(m)-Math.cos(m)*Math.cos(m)));var o=g*f*this.width;var l=o*360/h;var e=(this.getBottomRightLongitude()-this.getTopLeftLongitude())/(this.getTopLeftLatitude()-this.getBottomRightLatitude());var a=l/e;n[0]=b-l/2;n[1]=j+a/2;n[2]=b+l/2;n[3]=j-a/2}return n};RO.prototype.formatScale=function(b){var e=Math.floor(b);var d=""+e;var e="";var a=d.indexOf(".");if(a==-1){a=d.length}else{e=d.substring(a,d.length)}while(a>3){e=d.substring(a-3,a)+e;e=","+e;a-=3}e=d.substring(0,a)+e;return e};RO.prototype.getScreenXDPI=function(){var a=96;if(this.isIE){a=screen.deviceXDPI}else{var b=document.getElementById("ScreenDPICalculator");if(b){a=b.offsetWidth}}return a};RO.prototype.getScreenYDPI=function(){var a=96;if(this.isIE){a=screen.deviceYDPI}else{var b=document.getElementById("ScreenDPICalculator");if(b){a=b.offsetHeight}}return a};RO.prototype.isGeodetic=function(){var d=false;var b=this.map;var e=b.GetLayerName(0);var a=b.GetLayerProjection(e);if(a.indexOf("GEODETIC")>=0){d=true}return d};RO.prototype.getImages=function(){var a=new Array();a[1]=new Array("ecwp://"+document.location.host+"/sampleiws/images/geodetic/usademo.ecw","test image 2");a[0]=new Array("ecwp://"+document.location.host+"/sampleiws/images/geodetic/usademo.ecw","test image 2");a[2]=new Array("ecwp://"+document.location.host+"/sampleiws/images/geodetic/usademo.ecw","test image");a[3]=new Array("ecwp://"+document.location.host+"/sampleiws/images/geodetic/usademo.ecw","coc2");return a};RO.Image=function(e,g,f,b,h,d){this.name=e;this.url=g;this.tlx=f;this.tly=b;this.brx=h;this.bry=d;this.width=32;this.height=32;this.img="images2/star_yellow_view.png";var a=new Array();a=this.getCenter();this.x=a[0];this.y=a[1]};RO.Image.prototype.getCenter=function(){var b=(this.tlx-this.brx)/2;var e=(this.tly-this.bry)/2;var f=this.tlx-b;var d=this.tly-e;var a=new Array();a[0]=f;a[1]=d;return a};RO.prototype.addCallBacks=function(){var d=this.getControlArgs();var a=d.length;var b=3;while(b<a){this.map.SetCallbackName(d[b].toString(),d[b+1].toString());b=(b+2)}};RO.prototype.getUid=function(b){var a=(b&&b!="")?b:"default";if(!this.aPrefixes[a]){this.aPrefixes[a]=1}else{this.aPrefixes[a]+=1}return(a+"Uid"+this.aPrefixes[a])};RO.prototype.getStaticImageTopLayer=function(){if(!this.map){this.map=document[this.uid]}var a=this.map.GetLayerFileName(this.getTopLayerName());return a};RO.prototype.getLayerFileName=function(b){var a=this.map.GetLayerFileName(b);return a};RO.prototype.getTopLayerName=function(){var d=(this.map.GetNumberLayers()-1);var a="";for(var e=d;e>=0;e--){var b=this.map.GetLayerName(e);if(a==""){if(this.map.GetLayerType(b)=="ECW"){a=b}}}return a};RO.prototype.returnLayerStaticImageUrl=function(a,d){var b=document.getElementById(a);b.innerHTML=(this.getThumbUrl(this.getStaticImageTopLayer(),d))};RO.prototype.getThumbUrl=function(f,d){f=f.toString();var b=f.indexOf("://");var e="";var a="";var g="";if(b>0){b=f.indexOf("/",7);e=f.substring(0,b)+"/";e=e.replace("ecwp","http");g=f.substring(b,f.length)}a=e+"/imageX/ImageX.dll?image?layers="+g+"&sizex="+d+"&sizey="+d+"&type=jpg";return a};RO.prototype.reloadWithProtocol=function(a){deleteCookie("NCSPluginInstallMethod");var d=window.location.href;var b=d.indexOf("?");if(b>0){d=d.slice(0,b)}window.location.href=d+"?protocol="+a};RO.prototype.getModeMessage=function(){var d=this.getMode();var a=new Object();a.message="";var b="Mode: OTD. Click to use high-speed ECWP streaming";var e="This page isn't available using high-performance ECWP streaming imagery protocol";var f="Mode: ECWP.  Click to use Optimized Tile Delivery";if(this.bActiveXInstalled){}if(d=="html"){if(this.bActiveXCapable&&!this.bActiveXInstalled){a.message='<a id="ECWPButton" class="ovalbuttonB" onclick="aboutThisPage(\'ecwpinstall.htm\', true);"><span>'+b+"</span></a>"}else{if(this.bActiveXInstalled&&this.bActiveXCapable&&!this.forceHTMLControl){a.message='<a class="ovalbuttonB" id="ECWPButton" href="#" onclick="iwsMap.reloadWithProtocol(\'ECWP\');"><span>'+b+"</span></a>"}else{if((this.bActiveXInstalled&&this.forceHTMLControl)||(this.forceHTMLControl)){a.message=e}else{if(this.bActiveXCapable){a.message='<a onclick="aboutThisPage(\'ecwpinstall.htm\', true);" id="ECWPButton" class="ovalbuttonB" ><span>'+b+"</span></a>"}}}}}else{if(d=="ecwp"){if(this.forceHTMLControl){a.message=e}else{if(this.forceECWP){a.message="You are using ECWP"}else{a.message=a.message='<a href="#"  id="ECWPButton" class="ovalbutton" onclick="iwsMap.reloadWithProtocol(\'HTML\');"><span>'+f+"</span></a>"}}}}return a};RO.prototype.setHTMLControl=function(){deleteCookie("NCSPluginInstallMethod");setCookie("NCSPluginInstallMethod","HTML");this.forceHTMLControl=true;this.forceECWPControl=false};RO.prototype.getECWPUrls=function(){var d=this.map.GetNumberLayers();var f="";for(var e=0;e<d;e++){var a=this.map.GetLayerName(e);var b=this.map.GetLayerType(a);if(b.toUpperCase()=="ECW"){f+="<li>"+this.map.GetLayerParameter(a,"URL")+"</li><br>"}}return f};RO.prototype.setECWPControl=function(){deleteCookie("NCSPluginInstallMethod");setCookie("NCSPluginInstallMethod","NATIVE");this.forceHTMLControl=false;this.forceECWPControl=true};RO.prototype.getMode=function(){var a=this.mode;if(!a){a=getQuerystringValue();this.mode=a}return this.mode};RO.prototype.setProjection=function(a){if(a){if(a.toUpperCase().indexOf("EPSG:")<0){a="EPSG:"+a}this.map.SetTargetCoordSys(a)}};RO.prototype.createMapControl=function(){this.map=document[this.uid];if(this.autoStartImage){var a=this.addStartUpImage()}if((this.bHist)&&(a)){this.useHistograms()}};RO.prototype.addStartUpImage=function(){this.map=document[this.uid];var a=false;if(this.imageArray.length>0){if(this.addRasterLayerExclusive(this.imageArray[0][0])){if(this.bWMS){this.addWMSService()}a=true}}else{alert("no images to load")}return a};RO.prototype.deleteSingleLayer=function(a){var b=a.toUpperCase();if(!this.map){this.map=document[this.uid]}if((b.indexOf("ECWP://")>=0)||(b.indexOf("HTTP://")>=0)){a=this.getLayerNameFromUrl(b)}if(this.map.GetLayerIndex(a)>=0){this.map.DeleteLayer(a)}else{}};RO.prototype.deleteRasterLayers=function(a){this.map=document[this.uid];if(a){this.map=document[a]}var e=this.map.GetNumberLayers();for(var f=0;f<e;f++){var d=this.map.GetLayerName(f);var b=this.map.GetLayerType(d);if((b=="ECW")||(b=="ecw")){this.map.DeleteLayer(d)}}return true};RO.prototype.getLayerNameFromUrl=function(g){var e=this.map.GetNumberLayers();var a="";g=g.toLowerCase();for(var f=0;f<e;f++){var d=this.map.GetLayerName(f);var b=this.map.GetLayerParameter(d,"URL");if((b.toLowerCase()==g)){a=d}}return a};RO.prototype.deleteAllControlLayers=function(a){this.map=document[this.uid];if(a){this.map=document[a]}this.map.DeleteAllLayers()};RO.prototype.addRasterLayerExclusive=function(f,a){this.deleteRasterLayers(a);if(!a){this.totalImageSize=0}var d=false;if(this.addImage(f)){this.map.width="100%";var b=this;var e=setTimeout(function(){b.SetMaxExtentsAll.call(b)},250);d=true}return d};RO.prototype.SetMaxExtentsAll=function(){this.map.SetExtentsAll();return true};RO.prototype.addMassive=function(){var a="ecwp://imagery.oregonexplorer.info/ecwimages/2005orthoimagery.ecw";this.addRasterLayerExclusive(a)};RO.prototype.addImage=function(f,d,b){if(!this.map){this.map=document[this.uid]}var a=false;var e="";if((!d)||(d=="")){e=this.getUid("raster")}else{e=d}if(this.map.AddLayer("ECW",f,e,this.paramsHTML)<0){alert("Message: "+this.map.GetLastErrorText())}else{a=true}this.setTotalImageSize(e);this.map.SetBackGroundColor("#FFFFFF");this.setStatusBar(e);return a};RO.prototype.getLayerECWP=function(){var a=this.map.GetLayerParameter(this.map.GetLayerName(0),"URL");return a};RO.prototype.setGeoLinkMode=function(a){document.ECWView2.Attach(document.ECWView1.GetAttachPoint());document.ECWView2.SetGeolinkMode(a)};RO.prototype.setStatusBar=function(){var a=this.getLayerProjection();var b=this.getLayerEPSG();var f=this.getLayerDatum();document.getElementById("statusProjection").innerHTML=a;document.getElementById("statusDatum").innerHTML=f;document.getElementById("statusEPSG").innerHTML=b;if(b!=""){document.getElementById("kml").innerHTML=this.getKMLLink()}else{document.getElementById("kml").innerHTML=""}var d=document.getElementById("statusRes");if(d){d.innerHTML=this.getImageResolution()}document.getElementById("statusSize").innerHTML=this.getImageSizeGB();var e=this.getModeMessage();document.getElementById("viewMode").innerHTML=e.message};RO.prototype.getImageResolution=function(){if(document.ECWView2){return}var b="";var d=this.getBottomLayerName();var e=this.map.GetLayerCellUnits(d);if((e==1)||(e==3)){var a="Feet";if(e==1){a="Meter"}var f=this.map.GetLayerCellSizeX(d);b="<b>Resolution:</b> 1 pixel = "+this.roundNumber(f,2)+" of a "+a}else{b=""}return b};RO.prototype.getImageSize=function(a){var b=this.map.GetLayerImageSizeY(a);var e=this.map.GetLayerImageSizeX(a);var d=this.map.GetLayerParameter(a,"numbands");var f=b*e*d;return f};RO.prototype.setTotalImageSize=function(a){this.totalImageSize=(this.totalImageSize+this.getImageSize(a))};RO.prototype.getImageSizeGB=function(){var b="GB";var d=Math.round(this.totalImageSize/1073741824*100000)/100000;if(d<1){var b="MB";var d=Math.round(this.totalImageSize/1048576*100000)/100000}var a=this.roundNumber(d,2)+" "+b;return a};RO.prototype.roundNumber=function(d,a){var b=Math.round(d*Math.pow(10,a))/Math.pow(10,a);return b};RO.prototype.getKMLLink=function(){var j=this.getBottomLayerName();var g=this.getVirtualUrl(this.getLayerFileName(j));var h=this.map.GetLayerImageTopLeftWorldCoordinateX(j);var a=this.map.GetLayerImageTopLeftWorldCoordinateY(j);var l=this.map.GetLayerImageBottomRightWorldCoordinateX(j);var o=this.map.GetLayerImageBottomRightWorldCoordinateY(j);var b=this.getLayerEPSG();b=b.toLowerCase();if(b.indexOf("4326")>=0){}else{if(b!=""){this.getGeodeticExtents();h=this.tlxLongitude;a=this.tlyLatitude;l=this.brxLongitude;o=this.bryLatitude}}var d=(h-l)/2;var k=(a-o)/2;var f=h-d;var e=a-k;var m=this.getCenterPoint2();var n='<a href="kml/kml.aspx?MAXBBOX='+a+","+o+","+h+","+l+"&lon="+f+"&lat="+e+"&image_name="+this.getImageName(g)+"&layers="+g+'"><img src="images2/google.png" alt="view in Google Earth" border="0" /> </a>';return n};RO.prototype.getImageName=function(d){var b=d.lastIndexOf("/");if(b>0){var a=d.lastIndexOf(".");d=d.substring((b+1),(a))}return d};RO.prototype.getVirtualUrl=function(d){d=d.toLowerCase();if((d.indexOf("ecwp://")>0)||d.indexOf("http://")){var a=d.indexOf("/",8);var b=d.length;d=d.substring(a,b)}return d};RO.prototype.getLayerDatum=function(){var a=this.map.GetLayerDatum(this.map.GetLayerName(0));return a};RO.prototype.getLayerProjection=function(){var a=this.map.GetLayerProjection(this.getBottomLayerName());return a};RO.prototype.getBottomLayerName=function(){return this.map.GetLayerName(0)};RO.prototype.getLayerEPSG=function(){var a=this.map.GetLayerParameter(this.getBottomLayerName(),"epsg");return a};RO.prototype.brightSlide=function(a){sLayerName=this.map.GetLayerName(0);this.map.SetLayerParameter(sLayerName,"brightness="+a+";")};RO.prototype.resetBrightness=function(){sLayerName=this.map.GetLayerName(0);this.map.SetLayerParameter(sLayerName,"brightness=1.0;")};RO.prototype.contrastSlide=function(a){sLayerName=this.map.GetLayerName(0);this.map.SetLayerParameter(sLayerName,"contrast="+a+";")};RO.prototype.resetContrast=function(){sLayerName=this.map.GetLayerName(0);this.map.SetLayerParameter(sLayerName,"contrast=1.0;")};RO.prototype.useHistograms=function(){var a=this.getBottomLayerName();this.map.SetLayerParameter(a,"CalcHistograms=true");var b=window.radopen("histogram.htm",null);b.setSize(170,400);b.set_behaviors(Telerik.Web.UI.WindowBehaviors.Move);b.set_title("Histograms");b.moveTo("20px","400px");this.histWindow=b};RO.prototype.ECWHistogramFireTimer=function(){clearTimeout(this.tHistogramTimer);var a=this;this.tHistogramTimer=setTimeout(function(){a.updateHistograms.call(a)},2000)};RO.prototype.updateHistograms=function(){var b=this.getBottomLayerName();var a=this.map.GetLayerParameter(b,"numbands");if(a==1){this.ECWUpdateHistogram("BLACK","Histogram0","histogramDisplayRed","<b>Black&White</b>")}else{this.ECWUpdateHistogram("RED","Histogram0","histogramDisplayRed","<b>Red</b>");this.ECWUpdateHistogram("GREEN","Histogram1","histogramDisplayGreen","<b>Green</b>");this.ECWUpdateHistogram("BLUE","Histogram2","histogramDisplayBlue","<b>Blue</b>")}};RO.prototype.ECWUpdateHistogram=function(e,a,g,d){var b=this.getBottomLayerName();var f=this.map.GetLayerParameter(b,a);if((!f)||(f=="")||(f=="0")){}else{objectColor=document.getElementById(g);var j=f.split(",");var h=0;for(var k=0;k<j.length;k++){h=Math.max(h,j[k])}this.ECWGenerateHistogram(objectColor,e,j,h,128,64,d,"#FFFFFF")}};RO.prototype.ECWGenerateHistogram=function(f,d,b,e,a,k,l,j){var g=1;var m=l;var n=0;var o="";if(d=="RED"){o="images2/HistoRed.png"}else{if(d=="GREEN"){o="images2/HistoGreen.png"}else{if(d=="BLUE"){o="images2/HistoBlue.png"}else{o="images2/HistoGrey.png"}}}if(e<0){for(h=0;h<b.length;h++){e=Math.max(e,b[h])}}for(h=0;h<b.length;h++){b[h]=b[h]/e*k}n=Math.round(b.length/a);m+="<table cellpadding=0 cellspacing=0 bgcolor="+j+"><tr><td align=left><font size=0>";m+="</font></td></tr><tr valign=Bottom><td>&nbsp;</td>";for(var h=0;h<b.length;h+=n){m+="<td align=center width=";m+=g;m+='><img src="'+o+'" height=';m+=b[h];m+=" width=";m+=g;m+=" border=0 hspace=0></td>"}m+="<td>&nbsp;</td></tr></table><br>";if(this.histWindow){this.histWindow.get_contentFrame().contentWindow.CalledFn(m)}};function showInVirtualEarth(a,d){var b=window.open("virtualearth.htm?lon="+a+"&lat="+d,"window2","height=500, width=600,");b.focus()}RO.prototype.getGoogleMap=function(){if(this.map){alert("hello")}var d=new GLatLng(this.wTLX,this.wTLY);var a=new GLatLng(this.wBRX,this.wBRY);var e=d.lat();var b=new GLatLngBounds(d,a);alert(best_zoom(b))};RO.prototype.best_zoom=function(){var d=this.width;var g=this.height;var f=Math.abs(this.wBRY-this.wTLY);var j=Math.abs(this.wBRX-this.wTLX);if(f==0&&j==0){return 4}var e=Math.PI*(this.wBRY+this.wTLY)/360;var b=1.07288e-05;var h=Math.ceil(Math.log(f/(b*g))/Math.LN2);var a=Math.ceil(Math.log(j/(b*d*Math.cos(e)))/Math.LN2);return(a>h)?a:h};RO.prototype.getNewDiv=function(){var d="testdiv";var a=document.getElementById("placeHolder");var b=document.createElement("div");b.setAttribute("id",d);b.style.background="#00C";b.style.border="4px solid #000";return d};RO.prototype.getExtentsFromCenter=function(a,f){var b=0.0025;var d=a;var k=f;var h=b*(this.height/this.width);h=this.roundNumber(h,6);var e=d+b;var j=d-b;var g=k-h;var l=k+h;var m=new Object;m.tempBrx=e.toString();m.tempTlx=j.toString();m.tempBry=g.toString();m.tempTly=l.toString();return m};RO.prototype.setExtentsCenterIWS=function(n,o){var b;var a;if((o)&&o!=""){b=n;a=o}else{var p=n.split(",");b=parseFloat(p[0]);a=parseFloat(p[1])}var g=0.001;var k=b;var q=a;var j=g*(this.height/this.width);var h=k+g;var e=k-g;var s=q-j;var l=q+j;var m,r,d,f;if(this.getLayerProjection().toLowerCase()=="geodetic"){m=e;r=l;d=h;f=s}else{aT=this.getENPoint(e,l);aB=this.getENPoint(h,s);m=aT[0];r=aT[1];d=aB[0];f=aB[1]}m=parseFloat(m);r=parseFloat(r);d=parseFloat(d);f=parseFloat(f);this.map.SetExtents(m,r,d,f)};RO.prototype.getSearchBox=function(){var d=this.getNewDiv();var a=document.getElementById("placeHolder");var b=document.createElement("form");a.appendChild(b)};RO.prototype.getCustomGISQuery=function(d){var a="http://cherokee.binarybus.com/app/search_prop.asp?cmd=PID&pid="+d;var e="mode=0;action=GET;worldTLX="+this.tlx+";worldTLY="+this.tly+";worldBRX="+this.brx+";worldBRY="+this.bry+";url="+a+";body=;";var f=this.map.SetLayerParameter(this.wmsName,e)};RO.prototype.customResponse=function(b){var d=new RegexHelper().Replace(b,'(<table.*?>|colspan="4"|height="20"|</table>|<img .*?>|<a.*?</a>)',"","gi");var a=new RegexHelper().Matches(d,"(<tr.*?>.*?</tr>)","gi");displayParcel(a)};RO.prototype.getGoogleAddress=function(f,e){var b=f;var g=this.googleGeoCode();var d=g.Geo;var a=new Array();d.getLocations(b,function(h){if(h.Status.code==G_GEO_SUCCESS){if(h.Placemark.length>1){clearGoogleOptions();showGoogleOptions("<div>Did you mean:</div>");for(var k=0;k<h.Placemark.length;k++){var l=h.Placemark[k].Point.coordinates;showGoogleOptions("<br>"+(k+1)+": <a href='javascript:iwsMap.setExtentsCenterIWS("+l[0]+","+l[1]+")'>"+h.Placemark[k].address+"</a>")}}else{var l=h.Placemark[0].Point.coordinates.toString();e.addPointMarker(l,f);e.setExtentsCenterIWS(l,"",f)}}else{var j="Code "+h.Status.code;if(a[h.Status.code]){j=a[h.Status.code]}alert('Could not find "'+b+'" '+j)}})};RO.prototype.showStreetView=function(){};RO.prototype.getCenterPoint=function(){var d="RasterLayer";var a=(this.wTLX-this.wBRX)/2;var b=(this.wTLY-this.wBRY)/2;var e=this.wTLX-a;var f=this.wTLY-b;return this.getPoint(e,f)};RO.prototype.getCenterPoint2=function(){var d="RasterLayer";var a=(this.tlx-this.brx)/2;var b=(this.tly-this.bry)/2;var e=this.tlx-a;var f=this.tly-b;return this.getPoint(e,f)};RO.prototype.getPoint=function(a,b){var d=Object();d.x=a;d.y=b;return d};RO.prototype.googlePoint=function(){iwsMap.map.SetPointerMode(2);iwsMap.addGISLayer(this.wmsName)};RO.prototype.getGoogleMapStaticUrl=function(){var a=this.roundPoint(this.getCenterPoint());var b="http://maps.google.com/staticmap?center="+a.y+","+a.x+"&zoom=12&size=400x400&key="+this.gKey;return b};RO.prototype.roundPoint=function(a){var b=6;a.x=this.roundNumber((a.x),b);a.y=this.roundNumber((a.y),b);return a};RO.prototype.roundNumber=function(d,a){var b=Math.round(d*Math.pow(10,a))/Math.pow(10,a);return b};RO.prototype.addGISLayer=function(a){if(this.map.GetLayerIndex(a)==-1){if(this.map.AddLayer("GISOverlay","",a,"")==-1){alert("Error adding "+a+" layer to view : "+this.map.GetLastErrorText());return}}this.map.SetLayerVisible(a,true);this.map.SetLayerTransparency(a,"#ffffff",0);if(!this.bWMSLayersLoaded){this.getWMSLayers()}};RO.prototype.checkGISonTop=function(){var b=this.map.GetLayerIndex(this.wmsName);var a=this.map.GetNumberLayers();if(b!=(a-1)){this.map.MoveLayer(b,(a-1))}};RO.prototype.responseMap=function(a,e,d,f,h,j,k,g,b){if(b=="NCS_OVERLAY_SUCCESS"){clearTimeout(this.tMapTimer);if(iwsMap.bWMS){this.setWMSStatus(true,false)}else{}return}if(a==this.wmsName){this.wmsResponse(b)}if(a=="GPSLayer"){this.gpsResponse(b)}};RO.prototype.getWMSquery=function(){var g="";if(this.bWMSLayersLoaded){g="";g=this.getWMSLayerList();if(g==""){alert("No layers have been selected");return}}var f;var k;var n;var e;var o;var m;var b;var a;o=f=this.tlx;m=e=this.tly;b=n=this.brx;a=k=this.bry;var h=this.getTopLeftLongitude()-this.getBottomRightLongitude();var l=this.getTopLeftLatitude()-this.getBottomRightLatitude();if(!h||!l){return}h=parseInt((this.getTopLeftLongitude()-this.mouseLongitude)/h*this.width1K);l=parseInt((this.getTopLeftLatitude()-this.mouseLatitude)/l*this.height1K);if(h<0||h>this.width1K||l<0||l>this.height1K){return}var j="mode=0;action=GET;worldTLX="+this.tlx+";worldTLY="+this.tly+";worldBRX="+this.brx+";worldBRY="+this.bry+";url="+this.wmsUrl+"&VERSION=1.1.1&REQUEST=GetFeatureInfo&FORMAT=text/html&WIDTH="+this.width1K+"&HEIGHT="+this.height1K+"&SRS=EPSG:"+this.getLayerEPSG()+"&SERVICE=WMS&BBOX="+f+","+k+","+n+","+e+"&QUERY_LAYERS="+this.replaceComma(g)+"&LAYERS="+g+"&X="+h+"&Y="+l+"&INFO_FORMAT=application/vnd.ogc.gml;body=;";var d=this.map.SetLayerParameter(this.wmsName,j)};RO.prototype.queryFormat=function(b){var a=new RegexHelper().Matches(b,"[<iwfs:](.*)>(.*)</iwfs.*>","gi");displayFeature(a)};RO.prototype.wmsResponse=function(h){this.rx=new RO.Xml();this.rx.loadXmlText(h);var b=this.rx.rootXml.getElementsByTagName("WMT_MS_Capabilities")[0];if(b){b=b.getElementsByTagName("Capability")[0];var d=0;var l=0;var j=0;if(b){d=b.getElementsByTagName("Layer")[0];l=b.getElementsByTagName("GetFeatureInfo")[0];j=b.getElementsByTagName("GetMap")[0]}}else{if(h.indexOf("FeatureCollection")>0){this.queryFormat(h)}else{this.customResponse(h)}return}if(l){this.wmshasQuery=true}if(j){var n=j.getElementsByTagName("Format");var k=new Object();for(var a=0;a<n.length;a++){if(n[a].childNodes.length<1){continue}var g=n[a].childNodes[0];k[g.nodeValue.toLowerCase()]=true}var m=["image/png","image/gif","image/jpg"];for(var e=0;e<m.length;e++){if(k[m[e]]){this.wmsImageFormat=m[e];break}}}if(d){this.WMScreateLayerList(d)}};RO.prototype.getWMSMap=function(){if(this.bWMSLayersLoaded!=true){return}if(this.dMapWorldTLX!=this.tlx||this.dMapWorldTLY!=this.tly||this.dMapWorldBRX!=this.brx||this.dMapWorldBRY!=this.bry){this.getWMSMapLayer()}};RO.prototype.getWMSMapLayer=function(){var d=this.getWMSLayerList();if((d=="")||(!d)){return}this.setWMSStatus(true,true);var q=this.tlx;var k=this.tly;var f=this.brx;var e=this.bry;var s=this.getTopLeftLatitude();var j=this.getTopLeftLongitude();var z=this.getBottomRightLatitude();var l=this.getBottomRightLongitude();var A=j;var g=s;var r=l;var B=z;var a=j;var b=z;var n=l;var o=s;var u=q;var h=k;var m=f;var p=e;if(this.getLayerProjection().toLowerCase()=="geodetic"){u=a=A;h=o=g;m=n=r;p=b=B}else{u=a=this.tlx;h=o=this.tly;m=n=this.brx;p=b=this.bry}this.dMapWorldTLX=this.tlx;this.dMapWorldTLY=this.tly;this.dMapWorldBRX=this.brx;this.dMapWorldBRY=this.bry;var v=this;this.tMapTimer=setTimeout(function(){v.getWMSMap.call(v)},5000);var t="mode=0;action=GET;worldTLX="+u+";worldTLY="+h+";worldBRX="+m+";worldBRY="+p+";url="+this.wmsUrl+"VERSION=1.1.1&REQUEST=GetMap&STYLES=&FORMAT="+this.wmsImageFormat+"&WIDTH="+this.width1K+"&HEIGHT="+this.height1K+"&SRS=EPSG:"+this.getLayerEPSG()+"&SERVICE=WMS&BBOX="+a+","+b+","+n+","+o+"&LAYERS="+this.replaceComma(d)+";body=;";this.setGISTransparencyColor();var w=this.map.SetLayerParameter(this.wmsName,t)};RO.prototype.replaceComma=function(b){var a=b.replace(/\,$/,"");return a};RO.prototype.getWMSLayerList=function(){var b=document.forms.aspnetForm;if(!b){b=document.aspnetForm}var a=b.elements;var d="";for(i=0;i<a.length;i++){if(a[i].type=="checkbox"){if((a[i].checked)){d+=a[i].id+","}}}return d};RO.prototype.WMScreateLayerList=function(n,d,a){var p=document.getElementById("wmsForm");var z="";var P=false;var J=false;var I=new Array();var K=new Array();var B=null;if(d){B=this.clone(d)}else{P=true;var B=new Object();B.dLatLonBoundingBoxMinX=0;B.dLatLonBoundingBoxMinY=0;B.dLatLonBoundingBoxMaxX=0;B.dLatLonBoundingBoxMaxY=0;B.aEPSGCodes=new Object();B.dScaleMin=0;B.dScaleMax=0}var s="";var F="";var o="";for(var A=0;A<n.childNodes.length;A++){var O=n.childNodes[A];if(O.nodeType!=Node.ELEMENT_NODE){continue}var E=O.nodeName.toLowerCase();var Q=O.childNodes.length;switch(E){case"name":if(O.childNodes.length!=1){continue}var w=O.childNodes[0];if(w.nodeType!=Node.TEXT_NODE){continue}s=w.nodeValue;break;case"title":if(O.childNodes.length!=1){continue}var w=O.childNodes[0];if(w.nodeType!=Node.TEXT_NODE){continue}F=w.nodeValue;break;case"layer":I[I.length]=O;K[K.length]=s;break;case"latlonboundingbox":var H=O.getAttribute("minx");var G=O.getAttribute("miny");var v=O.getAttribute("maxx");var N=O.getAttribute("maxy");if(H){B.dLatLonBoundingBoxMinX=parseFloat(H)}if(G){B.dLatLonBoundingBoxMinY=parseFloat(G)}if(v){B.dLatLonBoundingBoxMaxX=parseFloat(v)}if(N){B.dLatLonBoundingBoxMaxY=parseFloat(N)}break;case"boundingbox":f=O.getAttribute("SRS");var H=O.getAttribute("minx");var G=O.getAttribute("miny");var v=O.getAttribute("maxx");var N=O.getAttribute("maxy");if(H&&G&&v&&N&&f&&(f.indexOf("EPSG:")>-1)){var m=f.substring(5,f.length);nEPSG=parseInt(m);if(!isNaN(nEPSG)){if(!B.aEPSGCodes["#"+nEPSG]){B.aEPSGCodes["#"+nEPSG]=new Object()}var t=B.aEPSGCodes["#"+nEPSG];t.dBoundingBoxMinX=parseFloat(H);t.dBoundingBoxMinY=parseFloat(G);t.dBoundingBoxMaxX=parseFloat(v);t.dBoundingBoxMaxY=parseFloat(N)}}break;case"srs":if(O.childNodes.length!=1){continue}var w=O.childNodes[0];if(w.nodeType!=Node.TEXT_NODE){continue}var r=w.nodeValue;var l=r.split(" ");for(var g=0;g<l.length;g++){var f=l[g];if(f&&(f.indexOf("EPSG:")>-1)){if(P&&(f=="EPSG:4326")||(this.wmsSRS!="")){this.wmsSRS=f}var m=f.substring(5,f.length);nEPSG=parseInt(m);if(!B.aEPSGCodes["#"+nEPSG]){B.aEPSGCodes["#"+nEPSG]=new Object()}}}break;default:break}}var u=false;var C=false;if(this.wmshasQuery){var M=n.getAttribute("queryable");if(M){C=((M=="1")?true:false)}else{C=true}}var k=null;if(s!=""){var e=null;e=document.createElement("DIV");var D=s+"_container";e.id=D;var L=I.length;var h="topLevel";if((a=="")||(L>0)){e.setAttribute("title","projection:  "+nEPSG);k=e;p.appendChild(e)}else{h="";e.className="bottomLevel";e.setAttribute("title","projection:  "+nEPSG);var k=document.getElementById(a+"_container");k.appendChild(e)}var b;b=document.createElement("INPUT");b.type="checkbox";b.name=(s);b.id=(s);b.value=nEPSG;b.onclick=function(){iwsMap.getWMSMapLayer()};e.appendChild(b);var q;q=document.createElement("SPAN");q.innerHTML=s;q.className=h;e.appendChild(q);if(!this.bWMSLayersLoaded){this.bWMSLayersLoaded=true;this.setWMSStatus(false,false)}}for(var A=0;A<I.length;A++){this.WMScreateLayerList(I[A],B,s);if((A==(I.length-1))){createShowHide(D)}}};RO.prototype.addWMSServiceCustom=function(b,a){this.bWMS=true;this.wmsUrl=b;this.wmsName=a;this.addGISLayer(this.wmsName)};RO.prototype.addTransColor=function(a){this.aStyleColors[a]=0};RO.prototype.setGISTransparencyColor=function(){for(c in this.aStyleColors){this.map.SetLayerTransparency(this.wmsName,c,this.aStyleColors[c])}};RO.prototype.addWMSService=function(){this.bWMS=true;this.addGISLayer(this.wmsName)};RO.prototype.setWMSStatus=function(d,a){var b="";if(a){var e="Map loading";if(!d){e="Map layers loading"}b='<img src="images2/loading5.gif" alt="loading"> '+e}document.getElementById("wmsStatus").innerHTML=b};RO.prototype.getWMSLayers=function(){if(this.bWMSLayersLoaded){return}this.setWMSStatus(false,true);var b="mode=0;action=GET;";b+="worldTLX="+this.wTLX+";worldTLY="+this.wTLY+";worldBRX="+this.wBRX+";worldBRY="+this.wBRY+";url="+this.wmsUrl+"request=getcapabilities&VERSION=1.1.1&SERVICE=WMS;body=;";var a=this.map.SetLayerParameter(this.wmsName,b)};RO.prototype.onMouseMove=function(e,f,a,d,b){if(isNaN(f)||isNaN(a)||isNaN(d)||isNaN(b)){return}};RO.prototype.showExtents=function(){var a='"'+this.getStaticImageTopLayer()+'", "","'+this.wTLX+'","'+this.wTLY+'","'+this.wBRX+'","'+this.wBRY+'"';document.getElementById("show_Extents").innerHTML=a};RO.prototype.onMouseDown=function(e,f,a,d,b){if(isNaN(f)||isNaN(a)||isNaN(d)||isNaN(b)){return}this.width=this.width1K=this.map.GetViewWidth();this.height=this.height1K=this.map.GetViewHeight();if(this.width1K>1023){this.height1K=Math.floor(this.height1K*(1023/this.width1K));this.width1K=1023}if(this.height1K>1023){this.width1K=Math.floor(this.width1K*(1023/this.height1K));this.height1K=1023}this.mouseLatitude=this.map.GetCoordLatitude(d,b);this.mouseLongitude=this.map.GetCoordLongitude(d,b);document.getElementById("yPoint").innerHTML="<strong>Y:</strong> "+b;document.getElementById("xPoint").innerHTML="<strong>X:</strong> "+d;if(this.wmshasQuery&&this.bQuery){this.getWMSquery()}if(this.VE==true){this.showInVirtualEarth(this.mouseLongitude,this.mouseLatitude)}this.showImageTip();if(this.bColor){showColor(this.map.GetLayerRGB(this.getTopLayerName(),d,b))}};RO.prototype.showImageTip=function(f,a,d,b){var e=getToolTip();if(e){e.set_text("This is the new tool tip text to display");e.show()}};RO.prototype.onMouseUp=function(e,f,a,d,b){if(isNaN(f)||isNaN(a)||isNaN(d)||isNaN(b)){return}clearTimeout(this.tMapTimer);this.mouseDown=false;if(this.bHist){this.updateHistograms()}};RO.prototype.layerInExtents=function(b){var f=true;if(b.tlx||b.tlx||b.brx||b.brx){var j=0.5*(b.bry-b.tly);var d=0.5*(b.tlx-b.brx);var a=b.tly-j;var g=b.tlx+d;var h=b.bry+j;var e=b.brx-d;if(!((((a<=this.wTLY())&&(h>=this.wTLY()))||((a>=this.wTLY())&&(a<=this.wBRX())))&&(((g>=this.wTRX())&&(e<=this.wTRX()))||((g<=this.wTRX())&&(g>=this.wBRX()))))){f=false}}return f};RO.prototype.extentsChange=function(a,f,d,b){this.tlx=a;this.tly=f;this.brx=d;this.bry=b;this.wTLX=this.map.GetTopLeftWorldCoordinateX();this.wTLY=this.map.GetTopLeftWorldCoordinateY();this.wBRX=this.map.GetBottomRightWorldCoordinateX();this.wBRY=this.map.GetBottomRightWorldCoordinateY();this.bGeodeticExtentsUpdated=false;this.bNorthingExtentsUpdated=false;this.width=this.width1K=this.map.GetViewWidth();this.height=this.height1K=this.map.GetViewHeight();if((this.width<=0)||(this.height<=0)){return}if(this.width1K>1023){this.height1K=Math.floor(this.height1K*(1023/this.width1K));this.width1K=1023}if(this.height1K>1023){this.width1K=Math.floor(this.width1K*(1023/this.height1K));this.height1K=1023}document.getElementById("scale").innerHTML=this.formatScale(this.getScaleFromExtents(a,f,d,b));if(this.bWMS){if((this.tMapTimer)&&(this.bWMSLayersLoaded==true)){clearTimeout(this.tMapTimer)}if(this.bWMSLayersLoaded==true){var e=this;this.tMapTimer=setTimeout(function(){e.getWMSMap.call(e)},500)}}if(this.aMarker.length>0){this.updateMarker(a,f,d,b)}if(this.bHist){this.ECWHistogramFireTimer()}};RO.prototype.getCookie=function(a){var e=document.cookie.split(";");var f="";var d="";var g="";var b=false;for(i=0;i<e.length;i++){f=e[i].split("=");d=f[0].replace(/^\s+|\s+$/g,"");if(d==a){b=true;if(f.length>1){g=unescape(f[1].replace(/^\s+|\s+$/g,""))}return g;break}f=null;d=""}if(!b){return null}};RO.prototype.setCookie=function(f,b,e,h,a,g){var j=new Date();j.setTime(j.getTime());if(e){e=e*1000*60*60*24}var d=new Date(j.getTime()+(e));document.cookie=f+"="+escape(b)+((e)?";expires="+d.toGMTString():"")+((h)?";path="+h:"")+((a)?";domain="+a:"")+((g)?";secure":"")};RO.prototype.updateProgress=function(a){ECWProgressBar.setProgress(a)};RO.prototype.showInVirtualEarth=function(a,b){var d="virtualearth.htm?lon="+a+"&lat="+b;showVE(d,"veWindow","Birds Eye View")};RO.prototype.googleGeoCode=function(){var a=new Object();a.reasons=[];a.Geo=new GClientGeocoder();a.reasons[G_GEO_SUCCESS]="Success";a.reasons[G_GEO_MISSING_ADDRESS]="Missing Address: The address was either missing or had no value.";a.reasons[G_GEO_UNKNOWN_ADDRESS]="Unknown Address:  No corresponding geographic location could be found for the specified address.";a.reasons[G_GEO_UNAVAILABLE_ADDRESS]="Unavailable Address:  The geocode for the given address cannot be returned due to legal or contractual reasons.";a.reasons[G_GEO_BAD_KEY]="Bad Key: The API key is either invalid or does not match the domain for which it was given";a.reasons[G_GEO_TOO_MANY_QUERIES]="Too Many Queries: The daily geocoding quota for this site has been exceeded.";a.reasons[G_GEO_SERVER_ERROR]="Server error: The geocoding request could not be successfully processed.";return a};RO.prototype.startUp=function(){this.createMapControl()};RO.prototype.addTimeImages=function(){var a=this.timeData();var b=a.length;for(var d=0;d<b;d++){if(this.addImage(a[d][0],this.genCheckBoxName(d,true))){}}};RO.prototype.genCheckBoxName=function(b,a){sName="check"+b;if(!a){sName+="_label"}return sName};RO.prototype.checkThisBox=function(a){oCheck.checked=true;oLabel=document.getElementById(this.genCheckBoxName(a,false));oLabel.className="CheckboxChecked"};RO.prototype.getTimeImages=function(){var a=new Array();a[0]=new Array("ecwp://iws.erdas.com/images/demo/dli_rs/images/031231pgr.ecw","Jan 2004");a[1]=new Array("ecwp://iws.erdas.com/images/demo/dli_rs/images/040204pgr.ecw","Feb 2004");a[2]=new Array("ecwp://iws.erdas.com/images/demo/dli_rs/images/040303pgr.ecw","Mar 2004");a[3]=new Array("ecwp://iws.erdas.com/images/demo/dli_rs/images/040407pgr.ecw","April 2004");a[4]=new Array("ecwp://iws.erdas.com/images/demo/dli_rs/images/040505pgr.ecw","May 2004");a[5]=new Array("ecwp://iws.erdas.com/images/demo/dli_rs/images/040602pgr.ecw","June 2004");a[6]=new Array("ecwp://iws.erdas.com/images/demo/dli_rs/images/040630pgr.ecw","July 2004");a[7]=new Array("ecwp://iws.erdas.com/images/demo/dli_rs/images/040804pgr.ecw","August 2004");a[8]=new Array("ecwp://iws.erdas.com/images/demo/dli_rs/images/040901pgr.ecw","September 2004");a[9]=new Array("ecwp://iws.erdas.com/images/demo/dli_rs/images/040929pgr.ecw","October 2004");a[10]=new Array("ecwp://iws.erdas.com/images/demo/dli_rs/images/041020pgr.ecw","November 2004");return a};RO.prototype.createTimeDataList=function(){var a=this.getTimeImages();var b=a.length;var d=document.getElementById("wmsForm");for(var e=0;e<b;e++){this.createLoadingImageBox(d,a[e][0],e,a[e][1])}};RO.prototype.makeInvisible=function(d){var b=this.map.GetNumberLayers();for(var a=0;a<b;a++){var e=this.map.GetLayerName(a);if(d!=e){this.map.SetLayerTransparency(d,"#",0)}else{}}};RO.prototype.checkTimeLayer=function(a){var b=a.value;if(a.checked){a.checked=false;this.deleteSingleLayer(b)}else{a.checked=true;this.addImage(b)}};RO.prototype.turnOffLoading=function(a){var b=(a[0]);b.style.visibility="hidden"};RO.prototype.imageSort=function(d,b){var a=$("#imageList").sortable("serialize")};RO.prototype.sendToBottom=function(b){var d=this.getLayerNameFromUrl(b);if(this.map.GetNumberLayers()>1){var a=this.map.GetLayerIndex(d);this.map.MoveLayer(a,0)}};RO.prototype.createLoadingImageBox=function(l,j,f,g,k){this.addImage(j,k);this.sendToBottom(j);var d=document.getElementById("wmsForm");var b=document.createElement("div");b.id=f;b.onclick=function(){moveToImage(f)};d.appendChild(b);var h=document.createElement("span");h.id=f+"span";var e=document.createElement("img");e.src="images2/loading5.gif";h.appendChild(e);b.appendChild(h);b.appendChild(document.createTextNode(g));var a=this;this.turnOffLoadingCounter[f]=setTimeout(function(){a.turnOffLoading.call(this,[e])},4200)};RO.prototype.setTimeExtents=function(){this.map.SetExtents(138.312616,-24.23402,142.416938,-26.925379)};RO.prototype.resetTimeTransparency=function(d){var b=1;for(var a=1;a<12;a++){if(a>d){b=1}else{if(a<d){b=0}}this.map.SetLayerTransparency("rasterUid"+a,"#",b)}};RO.prototype.makeLayerVisibleWithTransp=function(f,g){var d="rasterUid"+f;if(g==0){g=1}this.map.SetLayerTransparency(d,"#",g);var e=(f-1);if(e>0){for(var b=1;b<=e;b++){var a="rasterUid"+b;this.map.SetLayerTransparency(a,"#",0)}}};RO.prototype.setGISTransparency=function(a){var b=this.wmsName;var d=this.map.GetLayerIndex(b);if(d>-1){this.updateTransparency(b,a)}else{alert("GIS layer not found....")}};RO.prototype.setTransparencyImage=function(a){var b=this.getTopImageLayer();this.updateTransparency(a,b)};RO.prototype.updateTransparency=function(a,d){var e=parseFloat(a);if(e>1){e=1}if(e<0){e=0}this.map.SetLayerTransparency(d,"#",e);var b=setTimeout(testthis,5000)};function testthis(){var b=document.ECWView1;var a=b.GetLayerTransparency("mywms","#")}RO.prototype.makeLayerVisibleByName=function(a){var e="rasterUid"+a;var b=this.map.GetNumberLayers();for(var d=0;d<a;d++){this.fadeImage(e,"rasterUid"+d)}};RO.prototype.createCheckBox=function(j,g,a,f,h){j.appendChild(document.createElement("br"));var e;e=document.createElement("INPUT");e.type="checkbox";var b="";if((h==null)||(h=="")){b=this.genCheckBoxName(a,true)}else{b=h}e.name=(h);e.id=(h);e.value=g;addEvent(e,"click",checkThis);j.appendChild(e);if(this.browser=="microsoft internet explorer"){var d;d=document.createElement("LABEL");d.setAttribute("for",h);d.className="CheckboxUnchecked";d.setAttribute("id",h+"_label");d.setAttribute("name",h+"_label");d.setAttribute("unselectable","on");d.setAttribute("innerHTML",("&nbsp;"));addEvent(d,"click",checkThis);j.appendChild(d)}j.appendChild(document.createTextNode(f))};RO.prototype.addPointsOfInterest=function(e){var f=e.length;var b=Math.abs((this.wTLX-this.wBRX)/100);var g="http://iws2.erdas.com/images2/unit1.gif";for(var d=0;d<f;d++){var a=this.getUid("marker");this.map.AddLayer("GISOverlay","",a,"");this.updateViewUnitLayer(a,g,b,"",e[d].x,e[d].y)}};RO.symbol=function(a,b,g,d,e,f){this.x=parseFloat(a);this.y=parseFloat(b);this.url=g;this.alt=d;this.fun=f;this.img="images2/pin_yellow.gif";this.width=32;this.height=32;this.id=e;this.name=e};RO.prototype.addMarker=function(a){if(a!=null){var b=this.aMarker.length;this.aMarker[b]=a}};RO.prototype.addPointMarker=function(h,f){var a=h.split(",");var g=parseFloat(a[0]);var b=parseFloat(a[1]);var d=this.getENPoint(g,b);g=d[0];b=d[1];if(g!=""){var e=this.aMarker.length;this.aMarker[e]=new RO.symbol(g,b,"",f,this.getUid("marker"))}this.writeMarker()};RO.prototype.writeMarker=function(){var a=this.aMarker.length;var d="";for(var b=0;b<a;b++){var d="";d+='<DIV onmouseover="setToolTip(this);" style="position:absolute; top:0; left:0;  background-color:transparent;" zIndex="50" id="Frame'+this.aMarker[b].name+'">';d+='<a class="info"><img id="'+this.aMarker[b].name+'" src="'+this.aMarker[b].img+'" title="'+this.aMarker[b].alt+'" width="'+this.aMarker[b].width+'" height="'+this.aMarker[b].height+'" style="POSITION:absolute;border:0;z-index:99;" /></a>';d+="</DIV>";$("#variousHTML").html(d)}};RO.prototype.updateMarker=function(m,n,r,f){var k=this.width/(r-m);var p=this.height/(f-n);var t=this.aMarker.length;var b=0;var a=0;var q=findPosition(this.map);b=q[0];a=q[1];b=b-144;a=a-135;this.bGeodeticExtentsUpdated=false;for(i=0;i<t;i++){var g=this.aMarker[i].name;var o=this.aMarker[i].width;var j=this.aMarker[i].height;var h=this.aMarker[i].sAlt;IconX=((this.aMarker[i].x-m)*k)-(o/2);IconY=((this.aMarker[i].y-n)*p)-(j/2);if(IconX<0||IconX+o-1>this.width||IconY<0||IconY+j-1>this.height){var s=document.getElementById(g);if(s){s.style.visibility="hidden"}return}else{var s=document.getElementById(g);if(s){var l=b+Math.floor(IconX)+"px";var e=a+Math.floor(IconY)+"px";s.style.left=l;s.style.top=e;s.style.visibility="visible"}}}};RO.prototype.startGPS=function(){var a="ecwp://iws2.erdas.com/images/usa/1metercalif.ecw";this.addImage(a);this.map.AddLayer("GISOverlay","","GPSLayer","");this.map.AddLayer("GISOverlay","","UnitLayer1","");this.map.AddLayer("GISOverlay","","UnitLayer2","");this.map.AddLayer("GISOverlay","","UnitLayer3","");this.map.SetExtents(477055,3639165,481938,3634796);this.getGPSLocation()};RO.prototype.getGPSLocation=function(){var a=new Date();sURL=this.gpsServer+"?"+a.getTime();var f=0;var b=0;var d=1;var e=1;sParams="mode=1;";sBody="";sParams=sParams+"body="+sBody+";";sParams=sParams+"action=GET;";sParams=sParams+"worldTLX="+f+";";sParams=sParams+"worldTLY="+b+";";sParams=sParams+"worldBRX="+d+";";sParams=sParams+"worldBRY="+e+";";sParams=sParams+"url="+sURL;xx=xx+1;this.map.SetLayerParameter("GPSLayer",sParams)};var xx=0;RO.prototype.gpsResponse=function(d){for(i=d.indexOf("GPS:");i>=0;i=d.indexOf("GPS:",i+1)){sGPS=d.substr(i+4).split("\r\n")[0].split(",");this.updateUnitLayer(parseInt(sGPS[0]),parseFloat(sGPS[1]),parseFloat(sGPS[2]),parseFloat(sGPS[3]),parseFloat(sGPS[4]),parseFloat(sGPS[5]))}var b=this;var a=new Date();clearTimeout(this.tGPSTimer);this.tGPSTimer=setTimeout(function(){b.getGPSLocation.call(b)},this.gpsRequestInterval)};RO.prototype.updateUnitLayer=function(f,b,a,g,j,h){var e=Math.abs((this.wTLX-this.wBRX)/100);sLayer="UnitLayer"+f;var d="http://iws2.erdas.com/images2/unit"+f+".gif";this.updateViewUnitLayer(sLayer,d,e,f,b,a);sLayer="UnitLayer";e=15};RO.prototype.updateViewUnitLayer=function(n,h,f,g,b,a){var l=b-f;var m=a+f;var j=b+f;var k=a-f;sBody="";var d="mode=0;";d=d+"body="+sBody+";";d=d+"action=GET;";d=d+"worldTLX="+l+";";d=d+"worldTLY="+m+";";d=d+"worldBRX="+j+";";d=d+"worldBRY="+k+";";d=d+"url="+h;var e=this.map.SetLayerParameter(n,d);xx=xx+1;if(this.mode!="html"){this.map.SetLayerTransparency(n,"#",0);this.map.SetLayerTransparency(n,"#",1);this.map.SetLayerTransparency(n,"#ffffff",0)}else{this.gpsRequestInterval=5000}};RO.prototype.addLocationHandle=function(e,d,a,f){var g=this.map.AddLayer("GISOverlay","",f,"");alert(g);var h="http://iws2.erdas.com/images2/unit1.gif";var b=new Object(this.aLocs[this.aLocs.length]);b.title=a;b.lat=e;b.lng=d;b.index=f;b.layerName=f;b.url=h;b.dSize=Math.abs((this.wTLX-this.wBRX)/100);this.addCallOut(b)};RO.prototype.addCallOut=function(d){var a=d.lat-d.dSize;var b=d.lon+d.dSize;var e=d.lat+d.dSize;var f=d.lon-d.dSize;sBody="";var h="mode=0;";h=h+"body="+sBody+";";h=h+"action=GET;";h=h+"worldTLX="+a+";";h=h+"worldTLY="+b+";";h=h+"worldBRX="+e+";";h=h+"worldBRY="+f+";";h=h+"url="+d.url;var g=this.map.SetLayerParameter(d.layerName,h)};RO.prototype.getTopVisibleLayer=function(){var b="";var a="";var d=this.map.GetNumberLayers();for(var e=0;e<d;e++){a=this.map.GetLayerName(e);if(this.map.GetLayerTransparency(b,"#")>1){b=a}}return a};RO.prototype.getTopImageLayer=function(){var b="";var a="";var d=this.map.GetNumberLayers();var f=d;var e=true;while((f>=0)&&(e)){a=this.map.GetLayerName(f);if(this.map.GetLayerType(a)=="ECW"){e=false}else{a=""}f--}return a};RO.prototype.go99=function(){var v=this.getTopVisibleLayer();var B=this.map.GetNumberLayers();var p=this.map.GetLayerName(B);var g=this.getTopVisibleLayer();this.map.SetLayerParameter(g,"CalcHistograms=true");var a=this.map.GetLayerParameter(g,"Histogram0");var D=this.map.GetLayerParameter(g,"Histogram1");var j=this.map.GetLayerParameter(g,"Histogram2");if(a==null||a==""||a=="0"){return}if(D==null||D==""||D=="0"){return}if(j==null||j==""||j=="0"){return}var q=a.split(",");var E=D.split(",");var l=j.split(",");var m=0;for(var k=0;k<256;k++){m+=parseInt(q[k],10)}var t=parseInt(0.005*m);var n=0;var s=0;var z=0;var e,f,u=0;var w=0;for(var k=255;k>=0;k--){w+=parseInt(q[k],10);if(w>t){n=k;break}}w=0;for(var k=255;k>=0;k--){w+=parseInt(E[k],10);if(w>t){s=k;break}}w=0;for(var k=255;k>=0;k--){w+=parseInt(l[k],10);if(w>t){z=k;break}}w=0;for(var k=0;k<256;k++){w+=parseInt(q[k],10);if(w>t){e=k;break}}w=0;for(var k=0;k<256;k++){w+=parseInt(E[k],10);if(w>t){f=k;break}}w=0;for(var k=0;k<256;k++){w+=parseInt(l[k],10);if(w>t){u=k;break}}var A,F,d;var k=0;var G=n-e;var o=s-f;var h=z-u;var C=0;A="lut0=";for(var k=0;k<256;k++){if(k>=e&&k<=n){C=0+(((k-e)/G)*255)}else{if(k>n){C=255}else{C=0}}C=parseInt(C,10);A+=C;if(k<255){A+=","}}A+=";";F="lut1=";C=0;for(var k=0;k<256;k++){if(k>=f&&k<=s){C=0+(((k-f)/o)*255)}else{if(k>s){C=255}else{C=0}}C=parseInt(C,10);F+=C;if(k<255){F+=","}}F+=";";d="lut2=";for(var k=0;k<256;k++){if(k>=u&&k<=z){C=0+(((k-u)/h)*255)}else{if(k>z){C=255}else{C=0}}C=parseInt(C,10);d+=C;if(k<255){d+=","}}d+=";";var r=this.map.SetLayerParameter(g,A+F+d)};RO.prototype.Point=function(a,b){this.x=a;this.y=b};RO.prototype.getVectorStringOld=function(d){var a="";var e=d.length;for(var b=0;b<1;b++){a+="filledpolygon1="+d[b][0].y+","+d[b][0].x+"|"+d[b][1].y+", "+d[b][1].x+"|"+d[b][2].y+","+d[b][2].x+"|"+d[b][3].y+","+d[b][3].x}return a};RO.prototype.GetPageSizePixelsX=function(){var d=$(":input#PrinterDPIPopdown").val();var b=d.split("|");var a=b[0];var e=$(":input#PrinterDPIPopdown").val();var f=e.split("|");return Math.round((parseFloat(f[0])*0.9)*a)};RO.prototype.GetPageSizePixelsY=function(){var e=$(":input #PrinterDPIPopdown").val();var b=e.split("|");var a=b[1];var d=$(":input#PrintPageSizePopdown").val();var f=d.split("|");return Math.round((parseFloat(f[1])*0.9)*a)};RO.prototype.GetPageSizeInchesX=function(){var a=$(":input#PrintPageSizePopdown").val();var b=a.split("|");return(parseFloat(b[0])*0.9)};RO.prototype.GetPageSizeInchesY=function(){var a=$(":input#PrintPageSizePopdown").val();var b=a.split("|");return(parseFloat(b[1])*0.9)};RO.prototype.GetPageAspect=function(){var a=$(":input#PrintPageSizePopdown").val();var b=a.split("|");return(parseFloat(b[0])/parseFloat(b[1]))};RO.prototype.GetQuality=function(){var a=$(":input#PrinterQuality").val();return parseInt(a)};RO.prototype.printImage=function(){var u=false;var h=10,v=10,A=100;var t=(u==true?"00FF00":"FFFFFF");switch(this.GetQuality()){case 0:A=100;h=4,v=4;break;case 1:A=300;h=6,v=6;break;case 2:A=500;h=10,v=10;break}var z=this.map.GetLayerFileName(this.getBottomLayerName());var n=this.GetPageSizeInchesX();var o=this.GetPageSizeInchesY();var a=this.wTLX;var d=this.wTLY;var p=this.wBRX;var r=this.wBRY;var w=this.width;var s=this.height;var k=(w/s);if(k>1){v=Math.round(v/k)}else{h=Math.round(h*k)}var f=Math.min((n/h),(o/v));var e=(p-a)/(h*1);var g=(r-d)/(v*1);var q="<h1>Your Air Photo</h1>";var b=this.getTopImageLayer;if(navigator.userAgent.indexOf("Safari")>=0){var l="./printSafari.htm?nTilesX="+h+"&nTilesY="+v+"&sLayerFileName="+MakeRelativePath(z);l+="&dViewTLX="+a+"&dViewTLY="+d+"&nTileSize="+A+"&fTileSizeInches="+f;l+="&dTileWidth="+e+"&dTileHeight="+g;var m=window.open(l,"doPrintWindow","menubar=1,scrollbars=1")}else{var j=window.open("","doPrintWindow","menubar=1,scrollbars=1");if(navigator.userAgent.indexOf("Firefox")==-1){j.document.writeln('<html><head></head><body leftmargin="0" rightmargin="0" topmargin="0" bottommargin="0">');j.document.writeln(q);j.document.writeln('<table name="ImageTable" border='+(u==true?1:0)+' bordercolor="red" cellpadding=0 cellspacing=0 >');for(y=0;y<v;y++){j.document.writeln("<tr border=0 cellpadding=0 cellspacing=0>");for(x=0;x<h;x++){dTileTLX=a+x*e;dTileTLY=d+y*g;dTileBRX=dTileTLX+e;dTileBRY=dTileTLY+g;j.document.writeln('<td cellpadding=0 cellspacing=0 border=0><img src="'+getRootDomain(z)+"/ecwp/ImageX.dll?image?ecw="+MakeRelativePath(z)+"&worldtlx="+dTileTLX+"&worldtly="+dTileTLY+"&worldbrx="+dTileBRX+"&worldbry="+dTileBRY+"&sizex="+A+"&sizey="+A+"&fill="+t+'" style="WIDTH:'+f+"in; HEIGHT:"+f+'in"></td>')}j.document.writeln("</tr>")}j.document.writeln("</table>")}else{j.document.writeln("<html><head><STYLE type='text/css'>img{WIDTH:"+f+"in;");j.document.write("HEIGHT:"+f+"in;position: absolute;}</STYLE>");j.document.write('</head><body leftmargin="0" rightmargin="0" topmargin="0" bottommargin="0"><div>');j.document.writeln(q);for(y=0;y<v;y++){for(x=0;x<h;x++){dTileTLX=a+x*e;dTileTLY=d+y*g;dTileBRX=dTileTLX+e;dTileBRY=dTileTLY+g;styleTop=y*f;styleLeft=x*f;j.document.writeln('<img src="'+getRootDomain(z)+"/ecwp/ImageX.dll?image?ecw="+MakeRelativePath(z)+"&worldtlx="+dTileTLX+"&worldtly="+dTileTLY+"&worldbrx="+dTileBRX+"&worldbry="+dTileBRY+"&sizex="+A+"&sizey="+A+"&fill="+t+'" style="top:'+styleTop+"in; left:"+styleLeft+'in">')}}}if(u){j.document.writeln("<br><b>Quality</b>="+this.GetQuality()+"<br><b>TileSize</b>="+A+"<br><b>nTilesX</b>="+h+"<br><b>nTilesY</b>="+v)}j.document.writeln("<b>Scale:</b> 1: "+this.getScaleFromExtents(this.tlx,this.tly,this.brx,this.bry));j.document.writeln("</body></html>");j.document.writeln(" ");j.document.close()}};function MakeRelativePath(d){var b=-1;for(i=0;i<3;i++){b=d.indexOf("/",b+1)}var a=d.substr(b,d.length-b);return a}function getRootDomain(d){var b=-1;for(i=0;i<3;i++){b=d.indexOf("/",b+1)}var a=d.substr(0,b);a=a.replace("ecwp","http");return a}RO.prototype.getVectorStringOld=function(d){var a="";var b=this.getUid("filledpolygon");a+=b+"="+d[0].y+","+d[0].x+"|"+d[1].y+", "+d[1].x+"|"+d[2].y+","+d[2].x+"|"+d[3].y+","+d[3].x;return a};RO.prototype.addVectorRectByImage=function(h){var d=this.map.GetLayerName(0);this.map.SetLayerTransparency(d,"#",0.25);var g=h.length;for(var f=0;f<g;f++){var b=this.getUid("sVector");var a=this.map.addLayer("simplevector","",b,";");if(a){var e=this.getPointsFromImage(h[f],(f+1));this.map.SetLayerParameter(b,e)}}};RO.prototype.plotPoint=function(){var a=this.getUid("sVector");var b=this.map.addLayer("simplevector","",a,";");if(b){this.map.SetLayerParameter(a,"filledellipse1=29,-1|-7,27")}};RO.prototype.getPointsFromImage=function(a,d){var b="filledellipse"+d+"="+a.tlx+","+a.tly+"|"+a.brx+","+a.bry;return b};RO.prototype.addVectorRect=function(f){var g=f.length;if(g==4){}var e=this.getUid("sVector");var h=this.map.addLayer("simplevector","",e,";");var d=this.map.GetLayerName(0);this.map.SetLayerTransparency(d,"#",0.25);var a=1;var b="filledpolygon"+a+"="+f[0].y+","+f[0].x+"|"+f[1].y+", "+f[1].x+"|"+f[2].y+","+f[2].x+"|"+f[3].y+","+f[3].x;this.map.SetLayerParameter(e,b);this.map.SetLayerParameter(e,"color=#e0e1e1")};RO.prototype.getCanvas=function(){var a=null;if(this.mode=="html"){a=document.getElementById("NCSJSViewCanvas"+this.uid)}return a};function globalOnUpdateProcess(a){iwsMap.updateProgress(a)}function globalOnReceieved(a,e,d,f,h,j,k,g,b){iwsMap.responseMap(a,e,d,f,h,j,k,g,b)}function globalExtentChange(a,b,d,e){if(a!=0||a!=NaN){iwsMap.extentsChange(a,b,d,e)}}function globalMouseDown(e,f,a,d,b){iwsMap.onMouseDown(e,f,a,d,b)}function globalMouseMove(e,f,a,d,b){iwsMap.onMouseMove(e,f,a,d,b)}function globalMouseUp(e,f,a,d,b){iwsMap.onMouseUp(e,f,a,d,b)}function findPosition(d){var a=findPosX(d);var b=findPosY(d);return[a,b]}function findPosX(b){var a=0;if(b.offsetParent){while(1){a+=b.offsetLeft;if(!b.offsetParent){break}b=b.offsetParent}}else{if(b.x){a+=b.x}}return a}function findPosY(b){var a=0;if(b.offsetParent){while(1){a+=b.offsetTop;if(!b.offsetParent){break}b=b.offsetParent}}else{if(b.y){a+=b.y}}return a}function ErrorObject(a){this.message=a}function RegexHelper(){this.Matches=function(f,g,k){var b;try{if(arguments.length==3){b=new RegExp(g,k)}else{b=new RegExp(g,"gi")}}catch(h){throw new ErrorObject(h.message)}var d=new Array();var e=b.exec(f);while(e!=null){var j=new Match();j.Value=e[0];for(var a=0;a<e.length;a++){j.Groups[a-1]=e[a]}d[d.length]=j;e=b.exec(f)}return d};this.Replace=function(d,b,f,a){var h;var e=d;try{if(arguments.length==3){h=new RegExp(b,"gi")}else{h=new RegExp(b,a)}}catch(g){throw new ErrorObject(g.message)}while(h.test(e)){e=e.replace(h,f)}return e}}function Match(){this.Value=null;this.Groups=new Array()}function addEvent(b,f,a,d){if(b.addEventListener){b.addEventListener(f,a,d);return true}else{if(b.attachEvent){var e=b.attachEvent("on"+f,a);return e}else{alert("Handler could not be removed")}}}function parseDecimal(e,a,f){if(e!=undefined){e=e.toString();e=e.replace(/[^\d\.]/g,"");while(e.indexOf(".")!=e.lastIndexOf(".")){e=e.replace(/\./,"")}if(typeof a=="undefined"||a==""){return parseFloat(e)}else{var b=Math.pow(10,a);if(typeof f=="undefined"||(f)==false){return parseFloat(Math.round(e*b)/b)}else{return parseFloat(Math.floor(e*b)/b)}}}};
