var loadBannerFile="images/loading2.gif";
var loadBannerPath="images";
var loadBannerWidth=120;
var loadBannerHeight=100;
var loadingSettings=new Array();
var isNav=(window.navigator.appName.toLowerCase().indexOf("netscape")>=0);
var isIE=(window.navigator.appName.toLowerCase().indexOf("microsoft")>=0);
var isOpera=(window.navigator.appName.toLowerCase().indexOf("opera")>=0);
var userAgent=navigator.userAgent;
var navType="IE";
var nav70=false;
if((isNav)||(isOpera)){
nav70=(userAgent.indexOf("Netscape/7.0")!=-1);
if(userAgent.indexOf("FireFox")!=-1){
navType="FireFox";
}else{
if(userAgent.indexOf("Opera")!=-1){
navType="Opera";
}else{
if(userAgent.indexOf("Safari")!=-1){
navType="Safari";
}else{
if(userAgent.indexOf("Netscape")!=-1){
navType="Netscape";
}else{
navType="Mozilla";
}
}
}
}
}
if(isIE){
document.writeln("<xml:namespace ns=\"urn:schemas-microsoft-com:vml\" prefix=\"v\"/>\n");
document.writeln("<style type=\"text/css\"> v\\:* { behavior: url(#default#VML);} </style>\n");
}
var doc=document;
var mouseX=0;
var mouseY=0;
var x1=0;
var y1=0;
var x2=0;
var y2=0;
var zleft=0;
var ztop=0;
var zright=0;
var zbottom=0;
var docFormID=0;
var leftButton=1;
var rightButton=2;
if(isNav){
leftButton=1;
rightButton=3;
}
var Maps=new Array();
var MapNames=new Array();
var Pages=new Array();
var PageNames=new Array();
Pages[0]="";
var map=null;
var lastmap=null;
var page=null;
var lastpage=null;
var pagemap=null;
var lastpagemap=null;
var mapCount=0;
var pageCount=0;
var dragbox=null;
var promptString="";
var savedCursor="pointer";
var eLeft=0;
var eTop=0;
var eWidth=0;
var eHeight=0;
var xMove=0;
var yMove=0;
var mapCount=0;
var jumpToFinish=false;
var coordString="";
var controlType="Map";
var Overviews=new Array();
var OverviewNames=new Array();
var ovCount=0;
var ov=null;
var Toolbars=new Array();
var ToolbarGroups=new Array();
var Tocs=new Array();
var mapWindow=null;
var ovWindow=null;
var tocWindow=null;
var toolWindow=null;
var pageWindow=null;
var left;
var bottom;
var right;
var top;
var xDistance;
var yDistance;
var xHalf;
var yHalf;
var sFactor=1;
function imageXToWorldX(_1){
return sFactor*_1+left;
}
function imageYToWorldY(_2){
return sFactor*_2+bottom;
}
function transformPoint(_3,_4){
var _5=new Array();
_5[0]=imageXToWorldX(_3).toFixed(10);
_5[1]=imageYToWorldY(_4).toFixed(10);
return _5;
}
function transformPointCoords(_6,_7,_8,_9){
var _a=new Array(2);
switch(true){
case ((_9=="meters")&&(_8=="meters")):
_a[0]=parseFloat(_6).toFixed(3);
_a[1]=parseFloat(_7).toFixed(3);
break;
case ((_9=="meters")&&(_8=="decimal_degrees")):
_6=parseFloat(_6);
_7=parseFloat(_7);
var _b=DDtoUTM(_6,_7);
_a[0]=_b[0].toFixed(3);
_a[1]=_b[1].toFixed(3);
_gProjectorZone=_b[2];
break;
case ((_9=="meters")&&(_8=="degminsec")):
var _c=_6.split(" ");
var _d=_7.split(" ");
var _e=DMStoDD(parseInt(_c[0]),parseInt(_c[1]),parseFloat(_c[2]));
var _f=DMStoDD(parseInt(_d[0]),parseInt(_d[1]),parseFloat(_d[2]));
var _b=DDtoUTM(_e,_f);
_a[0]=_b[0].toFixed(3);
_a[1]=_b[1].toFixed(3);
_gProjectorZone=_b[2];
break;
case ((_9=="decimal_degrees")&&(_8=="meters")):
_6=parseFloat(_6);
_7=parseFloat(_7);
zone=_gProjectorZone;
_a=UTMtoDD(_6,_7,zone);
_a[0]=_a[0].toFixed(7);
_a[1]=_a[1].toFixed(7);
break;
case ((_9=="decimal_degrees")&&(_8=="decimal_degrees")):
_a[0]=parseFloat(_6).toFixed(7);
_a[1]=parseFloat(_7).toFixed(7);
break;
case ((_9=="decimal_degrees")&&(_8=="degminsec")):
var _c=_6.split(" ");
var _d=_7.split(" ");
var _e=DMStoDD(parseInt(_c[0]),parseInt(_c[1]),parseFloat(_c[2]));
var _f=DMStoDD(parseInt(_d[0]),parseInt(_d[1]),parseFloat(_d[2]));
_a[0]=_e.toFixed(7);
_a[1]=_f.toFixed(7);
break;
case ((_9=="degminsec")&&(_8=="meters")):
_6=parseFloat(_6);
_7=parseFloat(_7);
zone=_gProjectorZone;
_a=UTMtoDD(_6,_7,zone);
newxdd=DDtoDMS(_a[0].toFixed(7));
newydd=DDtoDMS(_a[1].toFixed(7));
_a[0]=newxdd[0]+"&#176; "+newxdd[1]+"&#39; "+newxdd[2]+"&#34;";
_a[1]=newydd[0]+"&#176; "+newydd[1]+"&#39; "+newydd[2]+"&#34;";
break;
case ((_9=="degminsec")&&(_8=="decimal_degrees")):
var _10=DDtoDMS(_6);
var _11=DDtoDMS(_7);
_a[0]=_10[0]+"&#176; "+_10[1]+"&#39; "+_10[2]+"&#34;";
_a[1]=_11[0]+"&#176; "+_11[1]+"&#39; "+_11[2]+"&#34;";
break;
case ((_9=="degminsec")&&(_8=="dms")):
_a[0]=_6;
_a[1]=_7;
break;
default:
var _12=parseFloat(mapProperties.extent.minx)+((mapProperties.extent.maxx-mapProperties.extent.minx)/2);
var _13=parseFloat(mapProperties.extent.miny)+((mapProperties.extent.maxy-mapProperties.extent.miny)/2);
_a[0]=_12.toFixed(10);
_a[1]=_13.toFixed(10);
}
return _a;
}
function extentChanged(_14){
left=_14.minx;
bottom=_14.miny;
right=_14.maxx;
top=_14.maxy;
xDistance=Math.abs(right-left);
yDistance=Math.abs(top-bottom);
xHalf=xDistance/2;
yHalf=yDistance/2;
sFactor=xDistance/iWidth;
}
function createLayer(_15,_16,_17,_18,_19,_1a,_1b,_1c,_1d){
document.write("<div id=\""+_15+"\" style=\" position:absolute; overflow:hidden; left:"+_16+"px; top:"+_17+"px; width:"+_18+"px; height:"+_19+"px;"+";  visibility:"+(_1a?"visible;":"hidden;"));
if(_1d!=null){
document.write(_1d);
}
document.write("\"");
if((_1c!=null)&&(_1c!="")){
document.write(" class=\""+_1c+"\"");
}
document.writeln(">");
document.writeln(_1b);
document.writeln("</div>");
}
function calcDistance(x1,y1,x2,y2){
var p1=transformPoint(x1,y1);
var p2=transformPoint(x2,y2);
var _24=Math.abs(p2[0]-p1[0]);
var _25=Math.abs(p2[1]-p1[1]);
var _26;
if((_24==0)||(_25==0)){
_26=(_24==0)?_25:_24;
}else{
_26=Math.sqrt((_24*_24)+(_25*_25));
}
return _26;
}
function getLayer(_27){
var _28=document.getElementById(_27);
if(_28!=null){
return _28.style;
}else{
return (null);
}
}
function setLayerBackgroundColor(_29,_2a){
var _2b=getLayer(_29);
_2b.backgroundColor=_2a;
}
function setDivZOrder(_2c,_2d){
var _2e=getLayer(_2c);
_2e.zIndex=_2d;
}
function hideLayer(_2f){
if(_2f=="LoadingDiv_map"){
try{
eviewBlanket.hide();
}
catch(e){
}
}
var _30=getLayer(_2f);
if(_30!=null){
_30.visibility="hidden";
}
return false;
}
function showLayer(_31){
if(_31=="LoadingDiv_map"){
try{
eviewBlanket.show();
}
catch(e){
}
}
var _32=getLayer(_31);
if(_32!=null){
_32.visibility="visible";
}
return false;
}
function moveLayer(_33,x,y){
var _36=getLayer(_33);
if(_36!=null){
_36.left=x+"px";
_36.top=y+"px";
}
return false;
}
function replaceLayerContent(_37,_38){
var _39=document.getElementById(_37);
if(_39!=null){
_39.innerHTML=_38;
}
}
function isLayerVisible(_3a){
var _3b=getLayer(_3a);
if(_3b!=null){
if(_3b.visibility=="visible"){
return (true);
}
}
return (false);
}
function getXY(e){
if(isNav){
mouseX=e.pageX;
mouseY=e.pageY;
}else{
var _3d=document;
var _3e=_3d.body;
mouseX=event.clientX+_3e.scrollLeft;
mouseY=event.clientY+_3e.scrollTop;
}
var _3f=$("map");
point=transformPoint(mouseX-_3f.offsetLeft,_3f.clientHeight-(mouseY-_3f.offsetTop));
setXYPosition(point[0],point[1]);
return false;
}
function clipLayer(_40,_41,_42,_43,_44){
var _45=getLayer(_40);
if(_45!=null){
var _46=_43-_41;
var _47=_44-_42;
_45.height=_47;
_45.width=_46;
_45.top=_42+"px";
_45.left=_41+"px";
}
return false;
}
function panClipLayer(_48,_49,_4a,_4b,_4c){
var _4d=getLayer(_48);
if(_4d!=null){
_4d.clip="rect("+_4a+" "+_4b+" "+_4c+" "+_49+")";
}
return false;
}
function getWinWidth(){
var _4e=window.innerWidth;
if(_4e==null){
_4e=document.body.clientWidth;
}
return _4e;
}
function getWinHeight(){
var _4f=window.innerHeight;
if(_4f==null){
_4f=document.body.clientHeight;
}
return _4f;
}
function isLeftButton(e){
var _51=0;
var _52=false;
if(isNav){
_51=e.which;
}else{
_51=window.event.button;
}
if(_51==leftButton){
_52=true;
}
return _52;
}
function convertNSrgb(_53){
var h=_53;
if(h.indexOf("rgb")!=-1){
var re=/%20/gi;
var h2=h.replace(re,"");
endpos=h2.indexOf(")");
var h3=h2.substring(4,endpos);
var ha=h3.split(",");
var r=parseInt(ha[0]).toString(16);
if(r.length==1){
r="0"+r;
}
var g=parseInt(ha[1]).toString(16);
if(g.length==1){
g="0"+g;
}
var b=parseInt(ha[2]).toString(16);
if(b.length==1){
b="0"+b;
}
_53=r+g+b;
}
return _53;
}
function calcElementPosition(_5c){
var _5d=document.getElementById(_5c);
eLeft=0;
eTop=0;
var _5e,eTopBorder;
eWidth=parseInt(_5d.style.width);
eHeight=parseInt(_5d.style.height);
while(_5d!=null){
_5e=0;
eTopBorder=0;
eLeft+=_5d.offsetLeft;
eTop+=_5d.offsetTop;
if(_5d.style.borderWidth!=""){
_5e=parseInt(_5d.style.borderWidth);
eTopBorder=parseInt(_5d.style.borderWidth);
}else{
if(_5d.style.borderLeftWidth!=""){
_5e=parseInt(_5d.style.borderLeftWidth);
eTopBorder=parseInt(_5d.style.borderTopWidth);
}
}
if(isNaN(_5e)){
_5e=0;
}
if(isNaN(eTopBorder)){
eTopBorder=0;
}
eLeft+=_5e;
eTop+=eTopBorder;
_5d=_5d.offsetParent;
}
return new RectangleObject("dummy",eLeft,eTop,eWidth,eHeight);
}
function checkForFormElement(_5f,_60,_61){
var _62=false;
if(_5f.forms[_60].elements[_61]!=null){
_62=true;
}
return _62;
}
function resizeElement(_63,_64,_65){
var div=document.getElementById(_63);
if(div!=null){
if(_64!=null){
div.style.width=_64+"px";
}
if(_65!=null){
div.style.height=_65+"px";
}
}
}
function SimpleObject(id){
this.id=id;
}
function RectangleObject(id,_69,top,_6b,_6c){
Object.extend(this,new SimpleObject(id));
this.left=_69;
this.top=top;
this.width=_6b;
this.height=_6c;
}
function PageElementObject(id,_6e,top,_70,_71){
Object.extend(this,new RectangleObject(id,_6e,top,_70,_71));
this.left=_6e;
this.top=top;
this.width=_70;
this.height=_71;
this.divId="";
this.divObject=null;
this.document=document;
this.cursor="default";
this.createDivs=null;
this.show=function(){
showLayer(this.divId);
};
this.hide=function(){
hideLayer(this.divId);
};
}
function ControlObject(id,_73,_74,top,_76,_77){
Object.extend(this,new PageElementObject(id,_74,top,_76,_77));
this.controlType=_73;
this.controlName=id;
this.mode="";
this.pageLeft=0;
this.pageTop=0;
this.xMin=0;
this.yMin=0;
this.xMax=0;
this.yMax=0;
this.coords="";
this.clientAction="";
this.actionType="";
this.pageID="";
this.enableClientPostBack=false;
this.buddyControls="";
this.toolsSupportingClientPostback="";
this.setObjects=null;
this.resetDisplay=null;
this.setTool=null;
this.resize=function(_78,_79){
this.width=_78;
this.height=_79;
};
}
function LoadingObject(_7a,_7b,_7c,_7d){
Object.extend(this,new PageElementObject("LoadingObject_"+_7d,0,0,_7b,_7c));
this.imageUrl=_7a;
this.mapControl=_7d;
this.divId="LoadingDiv_"+this.mapControl.controlName;
this.imageId="LoadingImage_"+this.mapControl.controlName;
this.showLoading=new Array();
if(_7a==null){
if((loadBannerFile!=null)&&(loadBannerFile!="")&&(loadBannerPath!=null)&&(loadBannerPath!="")){
this.imageUrl=loadBannerPath+"/"+loadBannerFile;
}
}
this.calcPosition=function(){
var w=this.mapControl.width;
var h=this.mapControl.height;
this.left=parseInt((w-this.width)/2);
this.top=parseInt((h-this.height)/2);
var _80=document.getElementById(this.divId);
if(_80!=null){
_80.style.left=this.left+"px";
_80.style.top=this.top+"px";
}
};
this.createDivs=function(){
this.calcPosition();
var s="<div id=\""+this.divId+"\" style=\"position: absolute; left: "+this.left+"px; top: "+this.top+"px; background-color: Transparent; width: "+this.width+"px; height: "+this.height+"px; overflow:hidden; visibility: hidden;\">\n";
s+="\t<img id=\""+this.imageId+"\" alt=\"Loading. . .\"  title=\"Loading. . .\" src=\""+this.imageUrl+"\" hspace=\"0\" vspace=\"0\" border=\"0\">\n";
s+="</div>\n";
return s;
};
this.show=function(){
this.calcPosition();
showLayer(this.divId);
};
}
function DragBoxObject(_82,_83){
Object.extend(this,new PageElementObject("DragBox",0,0,0,0));
this.imageUrl=_82;
this.opacity=_83;
if(_83==null){
this.opacity=100;
}
this.divId="DragBoxDiv";
this.imageId="DragBoxImage";
this.imageObject=null;
this.createDivs=function(){
content="<img name=\""+this.imageId+"\" src="+this.imageUrl+" width=1 height=1>";
var _84="border-color:Black;border-width:3px;border-style:Solid;";
var zbo=this.opacity/100;
var _86=navigator.platform;
if((_86=="Win32")||((_86=="MacPPC")&&(!isIE))){
if(navigator.userAgent.indexOf("Opera")==-1){
_84+="background-color: White; opacity: "+zbo+"; -moz-opacity: "+zbo+"; filter: alpha(opacity="+this.opacity+");";
}
}
createLayer(this.divId,-1,-1,1,1,false,content,null,_84);
setDivZOrder(this.divId,99991);
this.divObject=document.getElementById(this.divId);
};
this.clip=function(_87){
if(_87==null){
_87=3;
}
var _88=parseInt(_87)-1;
if(_88<1){
_88=1;
}
var _89=x1;
var _8a=y1;
if(x1>x2){
zright=x1;
zleft=x2;
}else{
zleft=x1;
zright=x2;
}
if(y1>y2){
zbottom=y1;
ztop=y2;
}else{
ztop=y1;
zbottom=y2;
}
if((x1!=x2)&&(y1!=y2)){
this.update(zleft,ztop,zright,zbottom,null,_87);
}
return false;
};
this.hide=function(){
window.scrollTo(0,0);
hideLayer(this.divId);
};
this.update=function(_8b,top,_8d,_8e,_8f,_90){
var obj=getLayer(this.divId);
if(obj!=null){
if(_90==null){
if(page!=null){
_90=page.dragLineWidth;
}else{
_90=map.dragLineWidth;
}
}
var w=_8d-_8b;
var h=_8e-top;
if(isNav){
w-=(_90*2);
h-=(_90*2);
}
if(w<1){
w=1;
}
if(h<1){
h=1;
}
obj.left=_8b+"px";
obj.top=top+"px";
obj.width=w+"px";
obj.height=h+"px";
if(_8f!=null){
obj.borderColor=_8f;
}
obj.borderWidth=_90+"px";
obj.cursor="crosshair";
}
};
}
function getMapDiv(e){
map=getSelectedMapObject(e);
}
function ShowLoading(){
if(map!=null){
if(map.loadingObject!=null){
map.loadingObject.show();
}
}
if(page!=null){
if(page.loadingObject!=null){
page.loadingObject.show();
}
}
}
function HideLoading(){
if(map!=null){
if(map.loadingObject!=null){
map.loadingObject.hide();
}
}
if(page!=null){
if(page.loadingObject!=null){
page.loadingObject.hide();
}
}
}
function adjustMapCoords(){
zleft=mouseX-map.pageLeft;
ztop=mouseY-map.pageTop;
map.xMin=zleft;
map.yMin=ztop;
return null;
}


