function MM_preloadImages(){var D=document;if(D.images){if(!D.MM_p){D.MM_p=new Array()}var C,B=D.MM_p.length,A=MM_preloadImages.arguments;for(C=0;C<A.length;C++){if(A[C].indexOf("##")!=0){D.MM_p[B]=new Image;D.MM_p[B++].src=A[C]}}}}function MM_swapImage(){var D,C=0,A,B=MM_swapImage.arguments;document.MM_sr=new Array;for(D=0;D<(B.length-2);D+=3){if((A=MM_findObj(B[D]))!=null){document.MM_sr[C++]=A;if(A.oSrc){A.oSrc=A.src}origDir=baseDir(A.src);if(A.src){A.src=origDir+B[D+2]}}}}function MM_findObj(E,D){var C,B,A;if(!D){D=document}if((C=E.indexOf("?"))>0&&parent.frames.length){D=parent.frames[E.substring(C+1)].document;E=E.substring(0,C)}if(!(A=D[E])&&D.all){A=D.all[E]}for(B=0;!A&&B<D.forms.length;B++){A=D.forms[B][E]}for(B=0;!A&&D.layers&&B<D.layers.length;B++){A=MM_findObj(E,D.layers[B].document)}if(!A&&D.getElementById){A=D.getElementById(E)}return A}function MM_jumpMenu(targ,selObj,restore){if(selObj.selectedIndex!=0){eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");if(restore){selObj.selectedIndex=0}}}function baseDir(A){if(A==null){return""}else{if(A.lastIndexOf("/")!=-1){pos=A.lastIndexOf("/");basedir=A.substring(0,pos+1);return basedir}else{return""}}}var mapContainerDiv;var mapDiv;var mapImg;var mapToolForm;var rubberBandDiv;var minX;var minY;var maxX;var maxY;var startX;var startY;var xswitch=0;var yswitch=0;var bMeasureStarted=false;var popupExists=false;function mouseDown(B){if((browser.ns&&B.which!=1)||(browser.ie&&event.button!=1)){return true}var A=(browser.ns)?B.pageX:event.clientX;var F=(browser.ns)?B.pageY:event.clientY;if(browser.ie){A=A+findPageOffsetX();F=F+findPageOffsetY()}switch(mapClickOption){case"zoomin":startRubber(A,F);break;case"theRadius":mapToolForm.radius.value=document.forms[0].theRadius.value;for(var C=0;C<document.forms[0].theUnits.length;C++){if(document.forms[0].theUnits[C].checked){mapToolForm.units.value=document.forms[0].theUnits[C].value;break}}var D=parseInt(A)-findPosX(mapImg);var E=parseInt(F)-findPosY(mapImg);doSubmitPopup(D,E);break;case"zoomout":case"recenter":var D=parseInt(A)-findPosX(mapImg);var E=parseInt(F)-findPosY(mapImg);doSubmit(D,E);break;case"info":var D=parseInt(A)-findPosX(mapImg);var E=parseInt(F)-findPosY(mapImg);doSubmitPopup(D,E);break;case"pan":startPan(A,F);break;case"measure":if(bMeasureStarted){stopMeasure(A,F)}else{startMeasure(A,F)}break;case"print":showPrintForm(B);break;default:}if(document.layers){document.captureEvents(Event.MOUSEMOVE)}if(mapClickOption!="measure"){document.onmousemove=mouseMove;document.onmouseup=mouseUp}return false}function mouseMove(B){var A=(browser.ns)?B.pageX:event.clientX;var C=(browser.ns)?B.pageY:event.clientY;if(browser.ie){A=A+findPageOffsetX();C=C+findPageOffsetY()}if(!isOnMap(A,C)){return false}switch(mapClickOption){case"zoomin":moveRubber(A,C);return false;case"pan":movePan(A,C);return false;case"measure":moveRubber(A,C);break;default:}}function mouseUp(B){var A=(browser.ns)?B.pageX:event.clientX;var C=(browser.ns)?B.pageY:event.clientX;if(browser.ie){A=A+findPageOffsetX();C=C+findPageOffsetY()}switch(mapClickOption){case"zoomin":stopRubber(A,C);break;case"pan":break;case"info":stopRubber(A,C);break;case"measure":stopRubber(A,C);break;default:}document.onmousemove=null;document.onmouseup=null}function startMeasure(B,G){var E=B-6;var D=G-6;startX=B;startY=G;if(document.all){var F=measureStartDiv;var C=measureStopDiv;var A=measureDisplayDiv;F.style.pixelLeft=E;F.style.pixelTop=D;F.style.visibility="visible";C.style.visibility="hidden";A.style.visibility="hidden"}else{if(document.getElementById){var F=measureStartDiv;var C=measureStopDiv;var A=measureDisplayDiv;F.style.left=E+"px";F.style.top=D+"px";F.style.visibility="visible";C.style.visibility="hidden";A.style.visibility="hidden"}}bMeasureStarted=true}function startRubber(A,C){minX=A;minY=C;maxX=A;maxY=C;startX=A;startY=C;if(document.all){var B=rubberBandDiv;B.style.width=0;B.style.height=0;B.style.pixelLeft=A;B.style.pixelTop=C;B.style.visibility="visible"}else{if(document.getElementById){var B=rubberBandDiv;B.style.width=0;B.style.height=0;B.style.left=A+"px";B.style.top=C+"px";B.style.visibility="visible"}}}function startPan(A,B){mapObject=new MapObject();mapObject.mousedownX=A;mapObject.mousedownY=B}function moveRubber(F,E){var A=rubberBandDiv;var G=parseInt(F)-findPosX(mapImg);var C=parseInt(E)-findPosY(mapImg);if(G<mapwidth&&C<mapheight){if(document.all){if(F<startX){if(xswitch=0){xswitch=1;maxX=minX}minX=F;A.style.pixelLeft=F}else{if(xswitch=1){xswitch=0}maxX=F}if(E<startY){if(yswitch=0){yswitch=1;maxY=minY}minY=E;A.style.pixelTop=E}else{if(yswitch=1){yswitch=0}maxY=E}}else{if(document.getElementById){if(F<startX){if(xswitch=0){xswitch=1;maxX=minX}minX=F;A.style.left=F+"px"}else{xswitch=0;maxX=F}if(E<startY){if(yswitch=0){yswitch=1;maxY=minY}minY=E;A.style.top=E+"px"}else{yswitch=0;maxY=E}}}var D=maxX-minX;var B=maxY-minY;var I=D/B;var H=4/3;if(I>H){A.style.width=D;A.style.height=(1/H)*D}else{if(I<H){A.style.width=H*B;A.style.height=B}else{A.style.width=D;A.style.height=B}}}}function movePan(A,D){var C=A-mapObject.mousedownX;var B=D-mapObject.mousedownY;mapDiv.style.left=C;mapDiv.style.top=B}function stopRubber(A,C){if(document.layers){document.releaseEvents(Event.MOUSEMOVE)}var B=rubberBandDiv;rbX1=parseInt(B.style.left)-findPosX(mapImg);rbY1=parseInt(B.style.top)-findPosY(mapImg);rbX2=rbX1+parseInt(B.style.width);rbY2=rbY1+parseInt(B.style.height);mapToolForm.x1.value=rbX1;mapToolForm.y1.value=rbY1;mapToolForm.x2.value=rbX2;mapToolForm.y2.value=rbY2;doSubmit(rbX1,rbY1,rbX2,rbY2)}function clearMeasure(){if(document.all){var C=measureStartDiv;var B=measureStopDiv;var A=measureDisplayDiv;C.style.visibility="hidden";B.style.visibility="hidden";A.style.visibility="hidden"}else{if(document.getElementById){var C=measureStartDiv;var B=measureStopDiv;var A=measureDisplayDiv;C.style.visibility="hidden";B.style.visibility="hidden";A.style.visibility="hidden"}}}function stopMeasure(L,I){bMeasureStarted=false;var K=Math.abs((startY-I)*(startY-I))+Math.abs((startX-L)*(startX-L));var G=Math.sqrt(K);var F=(G/mapwidth)*document.mapdata.Zoom.value;var B='<div style="font-size:8px; float: right;">[<a class="menuLink" onclick="clearMeasure()" href="#">X</a>]</div><strong>Distance:<br />';if(F>=1){F=Math.round(Math.round(F*100000)/10000)/10;B+=F+" mi</strong>"}else{feet=Math.round(F*5280);B+=feet+" ft</strong>"}var J=L-6;var H=I-6;var E=L+6;var D=I+6;if(document.all){var A=measureStopDiv;var C=measureDisplayDiv;A.style.pixelLeft=J;A.style.pixelTop=H;C.style.pixelLeft=E;C.style.pixelTop=D;A.style.visibility="visible";C.innerHTML=B;C.style.visibility="visible"}else{if(document.getElementById){var A=measureStopDiv;var C=measureDisplayDiv;A.style.left=J+"px";A.style.top=H+"px";C.style.left=E+"px";C.style.top=D+"px";A.style.visibility="visible";C.innerHTML=B;C.style.visibility="visible"}}}function doSearch(){document.forms[0].searchType.value="4";doSubmitPopup2()}function doSubmit(){var B=doSubmit.arguments.length;switch(B){case 4:mapToolForm.x2.value=doSubmit.arguments[2];mapToolForm.y2.value=doSubmit.arguments[3];case 2:mapToolForm.x1.value=doSubmit.arguments[0];mapToolForm.y1.value=doSubmit.arguments[1];if(useajax){var A=new AjaxRequest("http://localhost/ortho_new/ajax/BuildMap.cfm");A.addFormElements("maptoolform");if(ajaxdebug){A.setEchoDebugInfo()}A.sendRequest()}else{if(!isNaN(mapToolForm.x1.value)){submitForm()}}break;default:alert("Invalid argument list "+B)}}function zoomToState(){mapToolForm.zoomToEntireState.value="1";submitForm()}function downloadData(A){win=window.open("download.cfm?id="+A,"download","menubar=yes,scrollbars=yes,height=500,width=500,resizable=yes,top=5px,left=5px");if(win==null){popupBlockerDetected()}else{if(window.focus){win.focus()}}}function popupBlockerDetected(){}function doSubmitPopup(){if(doSubmitPopup.arguments.length>1){mapToolForm.x1.value=doSubmitPopup.arguments[0];mapToolForm.y1.value=doSubmitPopup.arguments[1]}win=window.open("","search","menubar=yes,scrollbars=yes,height=500,width=500,resizable=yes,top=5px,left=5px");if(win==null){popupBlockerDetected()}else{if(window.focus){win.focus()}mapToolForm.target="search";mapToolForm.action=baseurl+"info_popup.cfm";submitForm()}}function doSubmitPopup2(){win=window.open("","search","menubar=yes,scrollbars=yes,height=500,width=500,resizable=yes,top=5px,left=5px");if(window.focus){win.focus()}document.forms[0].target="search";document.forms[0].action=baseurl+"info_popup.cfm";submitForm()}var doHelp=function(){var A=window.open("help","helpWindow","menubar=yes,scrollbars=yes,height=600,width=800,resizable=yes,top=5px,left=5px");if(A){if(A.focus){A.focus()}}else{popupBlockerDetected()}};function isOnMap(B,F){var E=findPosX(mapContainerDiv);var A=findPosY(mapContainerDiv);var C=E+parseInt(mapImg.style.width);var D=A+parseInt(mapImg.style.width);if(B<E){return false}if(B>C){return false}if(F<A){return false}if(F>D){return false}return true}function setMapClickOpt(A){mapClickOption=A;mapToolForm.tool.value=A;tool=A;switch(A){case ("zoomout"):case ("pan"):case ("info"):case ("recenter"):case ("measure"):case ("theRadius"):case ("Search"):case ("clear"):case ("download"):case ("print"):case ("helpBlack"):setCursor(mapDiv,"pointer");break;default:mapClickOption="zoomin";mapToolForm.tool.value="zoomin";setCursor(mapDiv,"crosshair")}setActiveToolBtn(mapClickOption)}function setCursor(B,A){if(B!=null){B.style.cursor=A}}function setActiveToolBtn(B){var C=new Array(10);C[0]="zoomin";C[1]="zoomout";C[2]="pan";C[3]="info";C[4]="recenter";C[5]="measure";C[6]="Search";C[7]="download";C[8]="helpBlack";C[9]="print";C[10]="clear";var A=0;for(A=0;A<C.length;A++){if(C[A]==B){MM_swapImage(C[A],"",C[A]+"Select.gif",1)}else{MM_swapImage(C[A],"",C[A]+".gif",1)}document.MM_sr=new Array}}function findPosX(A){var B=0;if(A.offsetParent){while(A.offsetParent){B+=A.offsetLeft;A=A.offsetParent}}else{if(A.x){B+=A.x}}return B}function findPosY(B){var A=0;if(B.offsetParent){while(B.offsetParent){A+=B.offsetTop;B=B.offsetParent}}else{if(B.y){A+=B.y}}return A}function findPageOffsetX(){if(document.all||document.getElementById){return document.body.scrollLeft}else{if(document.layers){return pageXOffset}}}function findPageOffsetY(){if(document.all||document.getElementById){return document.body.scrollTop}else{if(document.layers){return pageYOffset}}}function BrowserCheck(){var A=navigator.appName;if((navigator.userAgent.indexOf("Opera 6")!=-1)||(navigator.userAgent.indexOf("Opera/6")!=-1)){this.b="op"}if(A=="Netscape"){this.b="ns"}else{if(A=="Microsoft Internet Explorer"){this.b="ie"}else{this.b=A}}this.version=navigator.appVersion;this.v=parseInt(this.version);this.ns=(this.b=="ns"&&this.v>=4);this.ns4=(this.b=="ns"&&this.v==4);this.ns5=(this.b=="ns"&&this.v==5);this.ie=(this.b=="ie"&&this.v>=4);this.ie4=(this.version.indexOf("MSIE 4")>0);this.ie5=(this.version.indexOf("MSIE 5")>0);this.min=(this.ns||this.ie)}function MapObject(){}var browser=new BrowserCheck();function initMapScript(){if(document.getElementById){mapContainerDiv=document.getElementById("mapcontainer");mapDiv=document.getElementById("mapdiv");mapImg=document.getElementById("mapimg");mapToolForm=document.getElementById("maptoolform");rubberBandDiv=document.getElementById("rubberband");measureDisplayDiv=document.getElementById("measuredisplay");measureStartDiv=document.getElementById("measureStart");measureStopDiv=document.getElementById("measureStop")}else{if(document.all){mapContainerDiv=document.all.mapcontainer;mapDiv=document.all.mapdiv;mapImg=document.all.mapimg;mapToolForm=document.all.maptoolform;rubberBandDiv=document.all.rubberband;measureDisplayDiv=document.all.measuredisplay;measureStartDiv=document.all.measureStart;measureStopDiv=document.all.measureStop}}if(mapDiv!=null){mapDiv.style.left=0;mapDiv.style.top=0;mapDiv.onmousedown=mouseDown;setMapClickOpt(tool)}};