// Copyright 2005 Google
function rj(oe,Sg,Ki)
{
this.type=oe;
this.version=Sg;
this.os=Ki
}
;
var A=new rj(0,0,null);
var Kb=navigator.userAgent.toLowerCase();
if(Kb.indexOf("opera")!=-1)
{
A.type=4
}
else if(Kb.indexOf("msie")!=-1&&document.all)
{
A.type=1;
if(Kb.indexOf("msie 5"))
{
A.version=5
}
}
else if(Kb.indexOf("safari")!=-1)
{
A.type=3;
if(Kb.indexOf("safari/125")!=-1)
{
A.version=1
}
}
else if(Kb.indexOf("mozilla")!=-1)
{
A.type=2
}
if(Kb.indexOf("x11;
")!=-1)
{
A.os=1
}
;
var U=Number.MAX_VALUE;
var _timeoutCounter=0;
Object.prototype.setTimeout=function(He,Zi)
{
var Ie="tempVar"+_timeoutCounter;
_timeoutCounter++;
eval(Ie+" = this;
");
var oi=He.replace(/\\/g,"\\\\").replace(/\"/g,'\\"');
return window.setTimeout(Ie+'._setTimeoutDispatcher("'+oi+'");
'+Ie+" = null;
",Zi)
}
;
Object.prototype._setTimeoutDispatcher=function(He)
{
eval(He)
}
;
Object.prototype.eventHandler=function(Vg)
{
var i=this;
i=i;
return function(b)
{
if(!b)
{
b=window.event
}
if(b&&!b.target)
{
b.target=b.srcElement
}
i[Vg](b)
}
}
;
function Jb(Qa)
{
return Qa.replace(/&/g,"&
").replace(/</g,"<
").replace(/>/g,">
")
}
function db(Qa)
{
return Jb(Qa).replace(/\"/g,""
").replace(/\'/g,"'
")
}
function Ma(Qa)
{
return Qa.replace(/</g,"<
").replace(/>/g,">
")
}
function Rd(Qa)
{
return Qa.replace(/\\/g,"\\\\").replace(/\'/g,'\\"')
}
Array.prototype.clear=function()
{
while(this.length>0)this.pop()
}
;
document.getElementsByClassName=function(w)
{
var Ac=document.all;
if(!Ac)Ac=document.getElementsByTagName("*");
var Pe=new Array();
for(var a=0;
a<Ac.length;
a++)
{
if(Ac[a].className==w)
{
Pe[Pe.length]=Ac[a]
}
}
return Pe
}
;
function ga(c,Ef)
{
try
{
c.style.cursor=Ef
}
catch(b)
{
if(Ef=="pointer")
{
ga(c,"hand")
}
}
}
function n()
{
}
n.count=0;
n.createElement=function(J,xc)
{
if(typeof arguments.callee.hasFilters=="undefined")
{
var ri=document.createElement("div");
arguments.callee.hasFilters=typeof ri.style.filter!="undefined"
}
var f;
if(arguments.callee.hasFilters)
{
f=document.createElement("div");
f.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+J+(xc?'",sizingMethod=crop)':'")')
}
else
{
f=document.createElement("img");
f.src=J
}
return f
}
;
n.create=function(J,h,l,O,top,Ua,xc,Ha)
{
return Wb.create(J,h,l,O,top,Ua,xc,Ha,n.createElement)
}
;
function Wb()
{
}
Wb.create=function(J,h,l,O,top,Ua,xc,Ha,kg)
{
var f;
if(!kg)
{
f=document.createElement("IMG");
if(J)f.src=J
}
else
{
f=kg(J,xc)
}
if(h&&l)
{
f.style.width=ha(h);
f.style.height=ha(l);
f.width=h;
f.height=l
}
if(top||(O||(top==0||O==0)))
{
f.style.position="absolute";
f.style.left=ha(O);
f.style.top=ha(top)
}
if(Ua||Ua==0)
{
f.style.zIndex=Ua
}
if(A.type==1)
{
f.unselectable="on";
f.onselectstart=Be
}
else
{
f.className="noselect"
}
f.oncontextmenu=Be;
if(Ha)
{
ic(f,Ha)
}
return f
}
;
function P(qa,w,Mb)
{
if(A.type==3&&w=="dblclick")
{
qa["on"+w]=Mb;
return
}
if(qa.addEventListener)
{
qa.addEventListener(w,Mb,false)
}
else if(qa.attachEvent)
{
qa.attachEvent("on"+w,Mb)
}
else
{
qa["on"+w]=Mb
}
}
function nf(qa,w,Mb)
{
if(qa.removeEventListener)
{
qa.removeEventListener(w,Mb,false)
}
else if(qa.detachEvent)
{
qa.detachEvent("on"+w,Mb)
}
else
{
qa["on"+w]=null
}
}
function ja(b)
{
if(A.type==1)
{
window.event.cancelBubble=true
}
else
{
b.cancelBubble=true;
b.preventDefault();
b.stopPropagation()
}
}
function ai(Lb,oj)
{
var Ra=window.document.createElement("a");
Ra.href="javascript:void(0)";
Ra.onclick=oj;
Ra.appendChild(window.document.createTextNode(Lb));
return Ra
}
if(!Array.prototype.push)
{
Array.prototype.push=function(Of)
{
this[this.length]=Of
}
}
function Of(H)
{
return document.getElementById(H)
}
function ha(x)
{
return x+"px"
}
function ic(c,Ha)
{
if(c.className)
{
c.className+=" "+Ha
}
else
{
c.className=Ha
}
}
function gd(g)
{
var I=
{
"x":0,"y":0
}
;
while(g)
{
I.x+=g.offsetLeft;
I.y+=g.offsetTop;
g=g.offsetParent
}
return I
}
function vh(g,eh)
{
var I=
{
"x":0,"y":0
}
;
while(g&&g!=eh)
{
I.x+=g.offsetLeft;
I.y+=g.offsetTop;
g=g.offsetParent
}
return I
}
function Nc(la)
{
this.size=0;
if(la)
{
for(var a=la.length-1;
a>=0;
a--)this.add(la[a])
}
}
Nc.prototype.add=function(Bb)
{
if(!this.contains(Bb))
{
this[":"+Bb]=1;
this.size++
}
}
;
Nc.prototype.remove=function(Bb)
{
if(this.contains(Bb))
{
delete this[":"+Bb];
this.size--
}
}
;
Nc.prototype.contains=function(Bb)
{
return this[":"+Bb]==1
}
;
function Be()
{
return false
}
;
var o="/mapfiles/";
var sd=new Array("q","ll","spn","z","t","sll","sspn","vp","f","output","xsl","deb");
function ua()
{
this.args=new Object();
this.reset()
}
ua.prototype.setValue=function(w,F)
{
this.args[w]=F
}
;
ua.prototype.setAllMapValues=function(r)
{
this.setValue("ll",this.getLatLngArg(r.getCenterLatLng()));
this.setValue("spn",this.getSpanArg(r.getSpanLatLng()));
this.setValue("z",r.zoomLevel);
this.setValue("t",r.spec.getURLArg())
}
;
ua.prototype.getLatLngArg=function(k)
{
return Ed(k.y)+","+Ed(k.x)
}
;
ua.prototype.getSpanArg=function(Aa)
{
return Ed(Aa.height)+","+Ed(Aa.width)
}
;
ua.prototype.reset=function()
{
for(var a=0;
a<sd.length;
a++)
{
this.args[sd[a]]=null
}
}
;
ua.prototype.getURL=function(Le)
{
var ld=new Array();
for(var a=0;
a<sd.length;
a++)
{
var w=sd[a];
if(this.args[w])
{
ld.push(w+"="+encodeURIComponent(this.args[w]))
}
}
if(window._sf&&window._sf.length>0)
{
ld.push(window._sf)
}
var Db="/maps";
if(ld.length>0)Db+="?"+ld.join("&");
if(Le)return"http://maps.google.com"+Db;
return Db
}
;
ua.getXSLTURL=function(H)
{
var z=new ua();
z.setValue("xsl",H);
return z.getURL()
}
;
function Ed(wb)
{
if(wb.toFixed)
{
return wb.toFixed(6).toString()
}
else
{
return wb.toString()
}
}
;
var sb=new Object();
function La(H,ya)
{
this.id=H;
this.ticketClass=ya
}
La.create=function(ya)
{
if(!ya)ya="_dtc";
if(!sb[ya])sb[ya]=1;
else sb[ya]++;
return new La(sb[ya],ya)
}
;
La.invalidateAll=function()
{
for(var a in sb)
{
try
{
sb[a]++
}
catch(b)
{
}
}
}
;
La.invalidate=function(Ha)
{
sb[Ha]++
}
;
La.prototype.isValid=function()
{
return sb[this.ticketClass]==this.id
}
;
function cg()
{
}
cg.create=function()
{
if(typeof ActiveXObject!="undefined")
{
return new ActiveXObject("Microsoft.XMLHTTP")
}
else if(typeof XMLHttpRequest!="undefined")
{
return new XMLHttpRequest()
}
else
{
;
return null
}
}
;
function ka(Ae)
{
this.stylesheet=Ae
}
ka.cache_=new Object();
ka.isSupported=function(ub)
{
return typeof ub.transformNode!="undefined"||typeof XSLTProcessor!="undefined"&&(XSLTProcessor.prototype&&XSLTProcessor.prototype.importStylesheet)
}
;
ka.create=function(Ae)
{
return new ka(Ae)
}
;
ka.getCached=function(Db)
{
return ka.cache_[Db]
}
;
ka.cache=function(Db,Qg)
{
ka.cache_[Db]=Qg
}
;
ka.prototype.transformToHTML=function(ub,Wa)
{
if(typeof ub.transformNode!="undefined")
{
Wa.innerHTML=ub.transformNode(this.stylesheet)
}
else if(typeof XSLTProcessor!="undefined")
{
var Ff=new XSLTProcessor();
Ff.importStylesheet(this.stylesheet);
var ij=Ff.transformToFragment(ub,window.document);
Wa.innerHTML="";
Wa.appendChild(ij)
}
else
{
}
}
;
ka.asynchronousTransform=function(ub,Wa,Gc,hb,ya)
{
var zc=ka.getCached(Gc);
if(zc)
{
zc.transformToHTML(ub,Wa);
if(hb)
{
hb()
}
return
}
var df=La.create(ya);
var pc=cg.create();
Sd('<a href="'+db(Gc)+'">'+Jb(Gc)+"</a>",0);
pc.open("GET",Gc,true);
pc.onreadystatechange=function()
{
if(pc.readyState==4)
{
if(df.isValid())
{
try
{
var Hd=pc.responseXML;
var zc=ka.create(Hd);
ka.cache(Gc,zc);
zc.transformToHTML(ub,Wa);
if(hb)
{
hb()
}
}
catch(b)
{
}
}
}
}
;
pc.send(null)
}
;
function Od(Ee,Wa,Fh,hb,ya,Nf)
{
if(ka.isSupported(Ee.xml))
{
ka.asynchronousTransform(Ee.xml,Wa,Fh,hb,ya)
}
else if(Nf)
{
Nf.call(Ee,Wa);
if(hb)
{
hb()
}
}
else
{
}
}
function ci(c)
{
while(c.hasChildNodes())
{
c.removeChild(c.lastChild)
}
}
function uf(str)
{
try
{
if(typeof ActiveXObject!="undefined"&&typeof GetObject!="undefined")
{
var Hd=new ActiveXObject("Microsoft.XMLDOM");
Hd.loadXML(str);
return Hd
}
else if(typeof DOMParser!="undefined")
{
return(new DOMParser()).parseFromString(str,"text/xml")
}
else
{
return Ag(str)
}
}
catch(b)
{
}
try
{
return Ag(str)
}
catch(b)
{
;
return document.createElement("div")
}
}
function Af(Qa)
{
var cd=Qa.split(/&/);
if(cd.length==1)
{
return Qa
}
var I="";
for(var a=0;
a<cd.length;
++a)
{
var Md=cd[a].split(/;
/);
if(Md.length!=2)
{
I+=cd[a];
continue
}
var lb;
switch(Md[0])
{
case "lt":lb="<";
break;
case "gt":lb=">";
break;
case "amp":lb="&";
break;
case "quot":lb='"';
break;
case "apos":lb="'";
break;
case "nbsp":lb=String.fromCharCode(160);
break;
default:var Aa=window.document.createElement("span");
Aa.innerHTML="&"+Md[0]+";
";
lb=Aa.innerHTML
}
I+=lb+Md[1]
}
return I
}
function Ag(M)
{
var Ri=/\/$/;
var Ch=/^(\S*)/;
var Lh=/(\S+)\s?=\s?('([^\']*)'|"([^\"]*)")/g;
var Qe=y.createDocument();
var qe=Qe;
var Kc=[];
var Ib=qe;
Kc.push(Ib);
var x=M.split(/</);
for(var a=1;
a<x.length;
++a)
{
var zg=x[a].split(/>/);
var fc=zg[0];
var Lb=Af(zg[1]);
if(fc.charAt(0)=="/")
{
Kc.pop();
Ib=Kc[Kc.length-1]
}
else if(fc.charAt(0)=="?")
{
}
else if(fc.charAt(0)=="!")
{
}
else
{
var Og=fc.match(Ri);
var Qi=Ch.exec(fc)[1];
var g=Qe.createElement(Qi);
var nd;
while(nd=Lh.exec(fc))
{
var fi=Af(nd[3]||nd[4]);
g.setAttribute(nd[1],fi)
}
if(Og)
{
Ib.appendChild(g)
}
else
{
Ib.appendChild(g);
Ib=g;
Kc.push(g)
}
}
if(Lb&&Ib!=qe)
{
Ib.appendChild(Qe.createTextNode(Lb))
}
}
return qe
}
function bg(g)
{
var I="";
if(g.nodeName=="#text")
{
I+=Jb(g.nodeValue)
}
else
{
I+="<"+g.nodeName;
if(g.hasAttributes())
{
for(var a=0;
a<g.attributes.length;
++a)
{
I+=" "+g.attributes[a].nodeName+'="'+db(g.attributes[a].nodeValue)+'"'
}
}
if(g.childNodes.length==0)
{
I+="/>"
}
else
{
I+=">";
for(var a=0;
a<g.childNodes.length;
++a)
{
I+=bg(g.childNodes[a])
}
I+="</"+g.nodeName+">"
}
}
return I
}
function Wg(g)
{
var I="";
if(g.nodeName=="#text")
{
I+=Jb(g.nodeValue)
}
else
{
for(var a=0;
a<g.childNodes.length;
++a)
{
I+=bg(g.childNodes[a])
}
}
return I
}
function ia(g)
{
if(!g)
{
return""
}
if(typeof g.text!="undefined")
{
return g.text
}
if(g.nodeType==3||g.nodeType==4)
{
return g.nodeValue
}
var F="";
if(g.nodeType==1)
{
for(var Zc=g.firstChild;
Zc!=null;
Zc=Zc.nextSibling)
{
F+=ia(Zc)
}
}
return F
}
function y(oe,w,F)
{
this.nodeType=oe;
this.nodeName=w;
this.nodeValue=F;
this.attributes=[];
this.childNodes=[];
this.firstChild=null;
this.lastChild=null;
this.nextSibling=null;
this.previousSibling=null;
this.parentNode=null
}
y.ELEMENT_NODE=1;
y.ATTRIBUTE_NODE=2;
y.TEXT_NODE=3;
y.CDATA_SECTION_NODE=4;
y.ENTITY_REFERENCE_NODE=5;
y.ENTITY_NODE=6;
y.PROCESSING_INSTRUCTION_NODE=7;
y.COMMENT_NODE=8;
y.DOCUMENT_NODE=9;
y.DOCUMENT_TYPE_NODE=10;
y.DOCUMENT_FRAGMENT_NODE=11;
y.NOTATION_NODE=12;
y.prototype.appendChild=function(g)
{
if(this.childNodes.length==0)
{
this.firstChild=g
}
g.previousSibling=this.lastChild;
g.nextSibling=null;
if(this.lastChild)
{
this.lastChild.nextSibling=g
}
g.parentNode=this;
this.lastChild=g;
this.childNodes.push(g)
}
;
y.prototype.hasAttributes=function()
{
return this.attributes.length>0
}
;
y.prototype.setAttribute=function(w,F)
{
for(var a=0;
a<this.attributes.length;
++a)
{
if(this.attributes[a].nodeName==w)
{
this.attributes[a].nodeValue=F;
return
}
}
this.attributes.push(new y(y.ATTRIBUTE_NODE,w,F))
}
;
y.prototype.getAttribute=function(w)
{
for(var a=0;
a<this.attributes.length;
++a)
{
if(this.attributes[a].nodeName==w)
{
return this.attributes[a].nodeValue
}
}
return null
}
;
y.prototype.createElement=(y.createElement=function(w)
{
return new y(y.ELEMENT_NODE,w,null)
}
);
y.prototype.createTextNode=(y.createTextNode=function(F)
{
return new y(y.TEXT_NODE,"#text",F)
}
);
y.prototype.createDocument=(y.createDocument=function()
{
return new y(y.DOCUMENT_NODE,"#document",null)
}
);
y.prototype.getElementsByTagName=function(w,Sc)
{
if(!Sc)
{
Sc=[]
}
if(this.nodeName==w)
{
Sc.push(this)
}
for(var a=0;
a<this.childNodes.length;
++a)
{
this.childNodes[a].getElementsByTagName(w,Sc)
}
return Sc
}
;
function Sd(gj,va)
{
}
Object.prototype.trace=function(gj,va,vj)
{
}
;
function L()
{
}
L.start=function()
{
}
;
L.end=function()
{
}
;
L.addTime=function(gf)
{
}
;
function q(x,m)
{
this.x=x;
this.y=m
}
q.prototype.toString=function()
{
return"("+this.x+", "+this.y+")"
}
;
q.prototype.equals=function(X)
{
if(!X)return false;
return this.x==X.x&&this.y==X.y
}
;
q.prototype.distanceFrom=function(X)
{
var Fa=this.x-X.x;
var Ja=this.y-X.y;
return Math.sqrt(Fa*Fa+Ja*Ja)
}
;
q.prototype.approxEquals=function(X)
{
if(!X)return false;
return Vc(this.x,X.x)&&Vc(this.y,X.y)
}
;
function aa(h,l)
{
this.width=h;
this.height=l
}
aa.prototype.toString=function()
{
return"("+this.width+", "+this.height+")"
}
;
aa.prototype.equals=function(X)
{
if(!X)return false;
return this.width==X.width&&this.height==X.height
}
;
aa.prototype.approxEquals=function(X)
{
if(!X)return false;
return Vc(this.width,X.width)&&Vc(this.height,X.height)
}
;
function Vc(rh,Ai)
{
return Math.round(rh*1000000)==Math.round(Ai*1000000)
}
function Z(cj,Sh,Gd,id)
{
this.minX=cj;
this.minY=Sh;
this.maxX=Gd;
this.maxY=id
}
Z.prototype.toString=function()
{
return"Bounds("+this.minX+","+this.minY+","+this.maxX+","+this.maxY+")"
}
;
Z.prototype.containsSegment=function(Qd,qd)
{
if(this.minX>Qd.x&&this.minX>qd.x)return false;
if(this.maxX<Qd.x&&this.maxX<qd.x)return false;
if(this.minY>Qd.y&&this.minY>qd.y)return false;
if(this.maxY<Qd.y&&this.maxY<qd.y)return false;
return true
}
;
Z.prototype.containsBounds=function(Ud)
{
return this.minX<Ud.minX&&(this.maxX>Ud.maxX&&(this.minY<Ud.minY&&this.maxY>Ud.maxY))
}
;
function tc(Xg)
{
this.ticks=Xg;
this.tick=0
}
tc.prototype.reset=function()
{
this.tick=0
}
;
tc.prototype.next=function()
{
this.tick++;
var jb=Math.PI*(this.tick/this.ticks-0.5);
return(Math.sin(jb)+1)/2
}
;
tc.prototype.more=function()
{
return this.tick<this.ticks
}
;
function Wh(F,la)
{
if(!la)la=new Array();
while(F>=32)
{
la.push(String.fromCharCode((32|F&31)+63));
F>>=5
}
la.push(String.fromCharCode(F+63));
return la
}
function hc(F,la)
{
return Wh(F<0?~(F<<1):F<<1,la)
}
function gc(li,ee,Re,je)
{
this.numLevels=Re;
this.zoomFactor=je;
this.decodePolyline(li);
this.decodeLevels(ee);
this.minTolerance=1.0E-5
}
gc.prototype.decodePolyline=function(sc)
{
L.start("Polyline","decodePolyline");
var Oi=sc.length;
var Nb=0;
var la=new Array();
var gb=0;
var tb=0;
while(Nb<Oi)
{
var Sb;
var Lc=0;
var Ta=0;
do
{
Sb=sc.charCodeAt(Nb++)-63;
Ta|=(Sb&31)<<Lc;
Lc+=5
}
while(Sb>=32);
var Vi=Ta&1?~(Ta>>1):Ta>>1;
gb+=Vi;
la.push(gb);
Lc=0;
Ta=0;
do
{
Sb=sc.charCodeAt(Nb++)-63;
Ta|=(Sb&31)<<Lc;
Lc+=5
}
while(Sb>=32);
var ki=Ta&1?~(Ta>>1):Ta>>1;
tb+=ki;
la.push(tb)
}
this.points=la;
this.numPoints=this.points.length>>1;
L.end("Polyline","decodePolyline")
}
;
gc.prototype.decodeLevels=function(sc)
{
L.start("Polyline","decodeLevels");
var zd=new Array(this.numLevels);
for(var Ze=0;
Ze<this.numLevels;
++Ze)zd[Ze]=new Array();
var a=0;
for(var ba=0;
ba<this.numPoints;
++ba)
{
var Tb=sc.charCodeAt(a++)-63;
while(Tb>=0)
{
var jc=zd[Tb--];
while(jc.length<ba)
{
jc.push(ba)
}
}
}
for(var Tb=0;
Tb<this.numLevels;
++Tb)
{
var jc=zd[Tb];
for(var ba=jc.length;
ba<this.numPoints;
++ba)
{
jc.push(this.numPoints)
}
}
this.nextPointIndexAtLevel=zd;
L.end("Polyline","decodeLevels")
}
;
gc.prototype.getPoint=function(Nb,k)
{
if(k==null)k=new q();
Nb<<=1;
k.y=this.points[Nb]*1.0E-5;
k.x=this.points[Nb+1]*1.0E-5;
return k
}
;
gc.prototype.getVectors=function(D,N,v)
{
L.start("Polyline","getVectors");
if(v==null)v=new Array();
this.getVectorsHelper(D,0,this.numPoints-1,this.numLevels-1,N,v);
L.end("Polyline","getVectors");
return v
}
;
gc.prototype.getVectorsHelper=function(D,fj,Rb,va,Cg,v)
{
var Rc=7.62939453125E-6;
for(var a=va;
a>0;
--a)
{
Rc*=this.zoomFactor
}
var rc=new Z();
rc.minX=Math.floor((D.minX-Rc)*100000);
rc.minY=Math.floor((D.minY-Rc)*100000);
rc.maxX=Math.ceil((D.maxX+Rc)*100000);
rc.maxY=Math.ceil((D.maxY+Rc)*100000);
var yc=fj;
var Ic;
var wa=new q();
wa.y=this.points[yc<<1];
wa.x=this.points[(yc<<1)+1];
var za=new q();
while((Ic=this.nextPointIndexAtLevel[va][yc])<=Rb)
{
za.y=this.points[Ic<<1];
za.x=this.points[(Ic<<1)+1];
if(rc.containsSegment(wa,za))
{
if(va>Cg)
{
this.getVectorsHelper(D,yc,Ic,va-1,Cg,v)
}
else
{
v.push(wa.y*1.0E-5);
v.push(wa.x*1.0E-5);
v.push(za.y*1.0E-5);
v.push(za.x*1.0E-5)
}
}
var Ge=wa;
wa=za;
za=Ge;
yc=Ic
}
}
;
var tj=o+"markerTransparent.png";
function d(W,ta,h,l,fh,mf,Hh)
{
if(!W)return;
this.container=W;
this.disablePopups=fh;
this.disableDragging=mf;
this.mapTypes=Hh;
if(!this.mapTypes)this.mapTypes=new Array(this.spec);
this.zoomLevel=0;
this.topLeftTile=null;
this.currentPanOffset=new aa(0,0);
this.centerBitmap=new q(0,0);
this.tilePaddingOffset=new aa(0,0);
this.tableSize=new aa(0,0);
this.overlays=new Array();
this.locations=new Array();
this.panDistance=new aa(0,0);
this.panKeys=new Nc();
this.setSpecification(ta);
this.container.style.overflow="hidden";
if(this.container.style.position!="absolute")this.container.style.position="relative";
this.container.style.backgroundColor=this.spec.backgroundColor;
if(!h||!l)
{
h=this.container.offsetWidth;
l=this.container.offsetHeight
}
this.viewSize=new aa(h,l);
P(window,"blur",this.eventHandler("onWindowBlur"));
this.div=this.createMapDiv();
this.container.appendChild(this.div);
if(!this.disablePopups)
{
this.infoWindow=new t("14em",this.eventHandler("onInfoCloseClick"),this.div,50,20)
}
this.directionsDiv=document.createElement("div");
this.directionsDiv.directionsBounds=new Z(-U,-U,U,U);
this.div.appendChild(this.directionsDiv);
this.dragObject=new ab(this.div,0,0);
this.dragObject.ondrag=this.eventHandler("onDrag");
this.dragObject.ondragstart=this.eventHandler("onDragStart");
this.dragObject.ondragend=this.eventHandler("onDragEnd");
P(this.div,"dblclick",this.eventHandler("onDoubleClick"));
this.dragObject.onclick=this.eventHandler("onClick");
if(mf)
{
this.dragObject.disable()
}
this.initializeMap();
this.onzoom=null;
this.onpan=null;
this.onmousedown=null;
this.onspecificationchange=null;
this.oninfowindowclose=null;
this.onresize=null;
this.stateListeners=null;
this.useRawVml=false
}
d.prototype.createMapDiv=function()
{
var j=document.createElement("div");
j.style.position="absolute";
j.style.top="0px";
j.style.left="0px";
j.style.zIndex=0;
j.style.backgroundColor=this.spec.backgroundColor;
return j
}
;
d.prototype.loadTileImages=function()
{
while(this.tileImages.length>this.tableSize.width)
{
var Qf=this.tileImages.pop();
for(var a=0;
a<Qf.length;
a++)
{
this.div.removeChild(Qf[a])
}
}
for(var a=this.tileImages.length;
a<this.tableSize.width;
a++)
{
this.tileImages.push(new Array())
}
for(var a=0;
a<this.tileImages.length;
a++)
{
while(this.tileImages[a].length>this.tableSize.height)
{
var f=this.tileImages[a].pop();
this.div.removeChild(f)
}
for(var K=this.tileImages[a].length;
K<this.tableSize.height;
K++)
{
var f=Wb.create(null,this.spec.tileSize,this.spec.tileSize,null,null,0,null,null);
f.style.position="absolute";
this.tileImages[a].push(f);
this.div.appendChild(f);
this.configureImage(f,a,K)
}
}
}
;
d.prototype.deleteTiles=function()
{
if(this.tileImages)
{
for(var a=0;
a<this.tileImages.length;
a++)
{
if(this.tileImages[a])
{
for(var K=0;
K<this.tileImages[a].length;
K++)
{
this.div.removeChild(this.tileImages[a][K])
}
}
}
}
this.tileImages=null
}
;
d.prototype.initializeMap=function()
{
this.deleteTiles();
this.tileImages=new Array();
this.calculateTileMeasurements();
this.loadTileImages()
}
;
d.prototype.getSpanLatLng=function(e)
{
if(!e)e=new aa(0,0);
var Ga=this.spec.getLatLng(this.centerBitmap.x-this.viewSize.width/2,this.centerBitmap.y-this.viewSize.height/2,this.zoomLevel);
var Ca=this.spec.getLatLng(this.centerBitmap.x+this.viewSize.width/2,this.centerBitmap.y+this.viewSize.height/2,this.zoomLevel);
e.width=Math.abs(Ca.x-Ga.x);
e.height=Math.abs(Ca.y-Ga.y);
return e
}
;
d.prototype.getCenterLatLng=function(e)
{
if(!e)e=new q(0,0);
if(this.centerLatLng)
{
e.x=this.centerLatLng.x;
e.y=this.centerLatLng.y;
return e
}
if(this.lastLatLng)
{
var ca=this.spec.getBitmapCoordinate(this.lastLatLng.y,this.lastLatLng.x,this.zoomLevel);
if(ca.equals(this.centerBitmap))
{
e.x=this.lastLatLng.x;
e.y=this.lastLatLng.y;
return e
}
}
var k=this.spec.getLatLng(this.centerBitmap.x,this.centerBitmap.y,this.zoomLevel);
e.x=k.x;
e.y=k.y;
return e
}
;
d.prototype.getBoundsBitmap=function(e)
{
if(!e)e=new Z(0,0,0,0);
e.minX=this.centerBitmap.x-this.viewSize.width/2;
e.minY=this.centerBitmap.y-this.viewSize.height/2;
e.maxX=this.centerBitmap.x+this.viewSize.width/2;
e.maxY=this.centerBitmap.y+this.viewSize.height/2;
return e
}
;
d.prototype.getBoundsLatLng=function(e)
{
e=this.getBoundsBitmap(e);
var Ga=this.spec.getLatLng(e.minX,e.minY,this.zoomLevel);
var Ca=this.spec.getLatLng(e.maxX,e.maxY,this.zoomLevel);
e.minX=Ga.x;
e.minY=Ca.y;
e.maxX=Ca.x;
e.maxY=Ga.y;
return e
}
;
d.prototype.calculateTileMeasurements=function()
{
var wi=Math.ceil(this.viewSize.width/this.spec.tileSize)+2;
var Uh=Math.ceil(this.viewSize.height/this.spec.tileSize)+2;
this.tableSize.width=wi;
this.tableSize.height=Uh;
var Qb=Math.floor((this.tableSize.width*this.spec.tileSize-this.viewSize.width)/2);
var Ab=Math.floor((this.tableSize.height*this.spec.tileSize-this.viewSize.height)/2);
this.tilePaddingOffset.width=Qb;
this.tilePaddingOffset.height=Ab
}
;
d.prototype.configureImage=function(f,x,m)
{
var Ah=(this.currentPanOffset.width+x)*this.spec.tileSize;
var kj=(this.currentPanOffset.height+m)*this.spec.tileSize;
var O=-this.tilePaddingOffset.width+Ah;
var top=-this.tilePaddingOffset.height+kj;
if(f.tileLeft!=O||f.tileTop!=top)
{
f.style.left=O+"px";
f.style.top=top+"px";
f.tileLeft=O;
f.tileTop=top
}
if(!this.topLeftTile)
{
f.src=this.spec.emptyTileURL
}
else
{
var J=this.spec.getTileURL(this.topLeftTile.x+x,this.topLeftTile.y+m,this.zoomLevel);
if(f.src!=J)
{
f.src=this.spec.emptyTileURL;
f.src=J
}
}
}
;
d.prototype.onDrag=function()
{
if(!this.topLeftTile)return;
this.onMove();
this.rotateTiles()
}
;
var Ug=new aa(0,0);
d.prototype.onMove=function()
{
this.centerLatLng=null;
var Ka=this.getCurrentOffset(Ug);
var x=this.topLeftTile.x*this.spec.tileSize+Math.floor(this.viewSize.width/2)+this.tilePaddingOffset.width-Ka.width;
var m=this.topLeftTile.y*this.spec.tileSize+Math.floor(this.viewSize.height/2)+this.tilePaddingOffset.height-Ka.height;
this.centerBitmap.x=x;
this.centerBitmap.y=m;
this.drawDirections(this.directions,this.directionsDiv);
if(this.onpan)this.onpan(x,m)
}
;
var pj=new aa(0,0);
d.prototype.rotateTiles=function()
{
var Ka=this.getCurrentOffset(pj);
if(Math.abs(this.dragObject.left)>10000000||Math.abs(this.dragObject.top)>10000000)
{
this.cancelPan();
this.centerAtBitmap(this.centerBitmap);
return
}
while(Ka.width<-this.tilePaddingOffset.width/2)
{
this.rotateRight();
this.getCurrentOffset(Ka)
}
while(Ka.width>this.tilePaddingOffset.width/2)
{
this.rotateLeft();
this.getCurrentOffset(Ka)
}
while(Ka.height<-this.tilePaddingOffset.height/2)
{
this.rotateDown();
this.getCurrentOffset(Ka)
}
while(Ka.height>this.tilePaddingOffset.height/2)
{
this.rotateUp();
this.getCurrentOffset(Ka)
}
}
;
d.prototype.rotateLeft=function()
{
this.currentPanOffset.width--;
this.topLeftTile.x--;
var eb=this.tileImages.pop();
if(eb)
{
this.tileImages.unshift(eb);
for(var a=0;
a<eb.length;
a++)
{
this.configureImage(eb[a],0,a)
}
}
}
;
d.prototype.rotateRight=function()
{
this.currentPanOffset.width++;
this.topLeftTile.x++;
var eb=this.tileImages.shift();
this.tileImages.push(eb);
var x=this.tileImages.length-1;
for(var a=0;
a<eb.length;
a++)
{
this.configureImage(eb[a],x,a)
}
}
;
d.prototype.rotateUp=function()
{
this.currentPanOffset.height--;
this.topLeftTile.y--;
for(var a=0;
a<this.tileImages.length;
a++)
{
var f=this.tileImages[a].pop();
this.tileImages[a].unshift(f);
this.configureImage(f,a,0)
}
}
;
d.prototype.rotateDown=function()
{
this.currentPanOffset.height++;
this.topLeftTile.y++;
var m=this.tileImages[0].length-1;
for(var a=0;
a<this.tileImages.length;
a++)
{
var f=this.tileImages[a].shift();
this.tileImages[a].push(f);
this.configureImage(f,a,m)
}
}
;
d.prototype.onDragStart=function(b)
{
if(this.onmousedown)this.onmousedown(b)
}
;
d.prototype.onDragEnd=function(b)
{
this.onStateChanged()
}
;
d.prototype.onDoubleClick=function(b)
{
if(this.disableDragging)
{
return
}
var k=this.getRelativeClickPoint(b,this.container);
var Uc=Math.floor(this.viewSize.width/2)-k.x;
var wc=Math.floor(this.viewSize.height/2)-k.y;
this.pan(Uc,wc)
}
;
d.prototype.onClick=function(b)
{
this.closeInfoWindow()
}
;
d.prototype.getRelativeClickPoint=function(b,yf,e)
{
if(!e)
{
e=new q()
}
if(typeof b.offsetX!="undefined")
{
var qa=b.target||b.srcElement;
var xg=vh(qa,yf);
e.x=b.offsetX+xg.x;
e.y=b.offsetY+xg.y
}
else if(typeof b.pageX!="undefined")
{
var Kd=gd(yf);
e.x=b.pageX-Kd.x;
e.y=b.pageY-Kd.y
}
else
{
}
return e
}
;
d.prototype.reconfigureAllImages=function()
{
if(this.tileImages.length==0)
{
return
}
var Ad=new Array();
for(var a=0;
a<this.tileImages.length;
a++)
{
for(var K=0;
K<this.tileImages[a].length;
K++)
{
f=this.tileImages[a][K];
f.coordX=a;
f.coordY=K;
var Dg=Math.min(a,this.tileImages.length-a-1);
var Lf=Math.min(K,this.tileImages[a].length-K-1);
if(Dg==0||Lf==0)
{
f.priority=0
}
else
{
f.priority=Dg+Lf
}
Ad.push(f)
}
}
Ad.sort(function(Dh,aj)
{
return aj.priority-Dh.priority
}
);
for(var a=0;
a<Ad.length;
a++)
{
var f=Ad[a];
if(A.type==1)this.div.removeChild(f);
this.configureImage(f,f.coordX,f.coordY);
if(A.type==1)this.div.appendChild(f)
}
}
;
d.prototype.pan=function(Fa,Ja)
{
if(!this.topLeftTile)
{
return
}
var mb=Math.sqrt(Fa*Fa+Ja*Ja);
var yi=Math.max(10,Math.floor(mb/20));
this.panSiner=new tc(yi);
this.panSiner.reset();
this.panDistance.width=Fa;
this.panDistance.height=Ja;
this.panStart=new q(this.dragObject.left,this.dragObject.top);
this.doPan()
}
;
d.prototype.doPan=function()
{
var jb=this.panSiner.next();
this.dragObject.moveTo(this.panStart.x+this.panDistance.width*jb,this.panStart.y+this.panDistance.height*jb);
this.onMove();
if(this.panSiner.more())
{
this.panTimeout=this.setTimeout("this.doPan()",10);
this.rotateTiles()
}
else
{
this.panTimeout=null;
this.onStateChanged()
}
}
;
d.prototype.cancelPan=function()
{
if(this.panTimeout)
{
clearTimeout(this.panTimeout)
}
}
;
d.prototype.recenterOrPanToLatLng=function(k)
{
if(!this.topLeftTile)
{
return
}
this.centerLatLng=new q(k.x,k.y);
this.lastLatLng=this.centerLatLng;
var k=this.spec.getBitmapCoordinate(this.centerLatLng.y,this.centerLatLng.x,this.zoomLevel);
this.recenterOrPanToBitmap(k)
}
;
d.prototype.recenterOrPanToBitmap=function(k)
{
if(!this.topLeftTile)return;
var Uc=this.centerBitmap.x-k.x;
var wc=this.centerBitmap.y-k.y;
if(Uc==0&&wc==0)return;
if(Math.abs(Uc)<this.viewSize.width&&Math.abs(wc)<this.viewSize.height)
{
this.pan(Uc,wc);
return
}
this.centerAtBitmap(k);
this.onStateChanged()
}
;
d.prototype.centerAndZoom=function(fd,N)
{
var xf=false;
if(N!=this.zoomLevel)
{
var Fe=this.zoomLevel;
this.zoomLevel=N;
xf=true
}
this.centerAtLatLng(fd);
if(xf&&this.onzoom)this.onzoom(Fe,this.zoomLevel);
this.onStateChanged()
}
;
d.prototype.centerAtLatLng=function(k)
{
this.centerLatLng=new q(k.x,k.y);
this.lastLatLng=this.centerLatLng;
var k=this.spec.getBitmapCoordinate(this.centerLatLng.y,this.centerLatLng.x,this.zoomLevel);
this.centerAtBitmap(k)
}
;
d.prototype.centerAtBitmap=function(k)
{
this.centerBitmap.x=k.x;
this.centerBitmap.y=k.y;
var O=k.x-Math.floor(this.viewSize.width/2)-this.tilePaddingOffset.width;
var top=k.y-Math.floor(this.viewSize.height/2)-this.tilePaddingOffset.height;
var lc=Math.floor(O/this.spec.tileSize);
var Cc=Math.floor(top/this.spec.tileSize);
var Qb=lc*this.spec.tileSize-O;
var Ab=Cc*this.spec.tileSize-top;
if(Qb<-this.tilePaddingOffset.width/2)
{
lc++;
Qb+=this.spec.tileSize
}
else if(Qb>this.tilePaddingOffset.width/2)
{
lc--;
Qb-=this.spec.tileSize
}
if(Ab<-this.tilePaddingOffset.height/2)
{
Cc++;
Ab+=this.spec.tileSize
}
else if(Ab>this.tilePaddingOffset.height/2)
{
Cc--;
Ab-=this.spec.tileSize
}
if(!this.topLeftTile)
{
this.topLeftTile=new q(lc,Cc)
}
else
{
this.topLeftTile.x=lc;
this.topLeftTile.y=Cc
}
this.currentPanOffset.width=0;
this.currentPanOffset.height=0;
this.reconfigureAllImages();
this.repositionOverlays();
this.dragObject.moveTo(Qb,Ab);
this.onStateChanged()
}
;
d.prototype.addStateListener=function(di)
{
if(!this.stateListeners)this.stateListeners=new Array();
this.stateListeners.push(di)
}
;
d.prototype.onStateChanged=function()
{
if(!this.topLeftTile)return;
if(this.stateListeners)
{
for(var a=0;
a<this.stateListeners.length;
a++)
{
this.stateListeners[a].onMapStateChanged(this)
}
}
}
;
d.prototype.onResize=function(b)
{
if(this.viewSize.width!=this.container.offsetWidth||this.viewSize.height!=this.container.offsetHeight)
{
this.viewSize.width=this.container.offsetWidth;
this.viewSize.height=this.container.offsetHeight;
this.calculateTileMeasurements();
this.loadTileImages();
this.centerAtBitmap(this.centerBitmap);
if(this.onresize)
{
this.onresize()
}
}
}
;
d.prototype.getCurrentOffset=function(e)
{
if(!e)e=new aa(0,0);
e.width=this.dragObject.left+this.currentPanOffset.width*this.spec.tileSize;
e.height=this.dragObject.top+this.currentPanOffset.height*this.spec.tileSize;
return e
}
;
d.prototype.switchSpecification=function(Pa)
{
if(this.spec==Pa)return;
var be=this.spec;
var E=this.getCenterLatLng();
this.setSpecification(Pa);
this.div.style.backgroundColor=this.spec.backgroundColor;
if(be.tileSize!=Pa.tileSize)
{
this.topLeftTile=null;
this.initializeMap()
}
this.centerAtLatLng(E);
if(this.onspecificationchange)this.onspecificationchange(be,Pa)
}
;
d.prototype.setSpecification=function(Pa)
{
this.spec=Pa;
if(!Pa.emptyTilePreload)
{
var Vb=document.createElement("IMG");
Vb.style.position="absolute";
Vb.style.visibility="hidden";
Vb.style.top=ha(-200);
Vb.style.left=ha(-200);
document.body.appendChild(Vb);
Pa.emptyTilePreload=Vb
}
this.spec.emptyTilePreload.src=this.spec.emptyTileURL
}
;
d.prototype.zoomTo=function(va)
{
if(!this.topLeftTile)return;
if(va>=this.spec.numZoomLevels)
{
va=this.spec.numZoomLevels-1
}
else if(va<0)
{
va=0
}
var Fe=this.zoomLevel;
if(va!=Fe)
{
var E=this.getCenterLatLng();
this.centerAndZoom(E,va)
}
}
;
d.prototype.toggleTileBorders=function()
{
if(this.tileImages)
{
for(var a=0;
a<this.tileImages.length;
a++)
{
if(this.tileImages[a])
{
for(var K=0;
K<this.tileImages[a].length;
K++)
{
var f=this.tileImages[a][K];
if(f.hasBorder)
{
f.style.border="0";
f.hasBorder=false
}
else
{
f.style.border="1px solid black";
f.hasBorder=true
}
}
}
}
}
}
;
d.prototype.addOverlay=function(ra)
{
this.overlays.push(ra);
this.locations.clear();
for(var a=0;
a<this.overlays.length;
a++)
{
var ra=this.overlays[a];
if(ra.locations)
{
for(var K=0;
K<ra.locations.length;
K++)
{
var p=ra.locations[K];
if(p.icon.iconClass.name!="noicon")
{
this.locations.push(p)
}
}
}
}
this.locations.sort(d.orderLocations);
for(var a=0;
a<this.locations.length;
a++)
{
var p=this.locations[a];
if(!p.marker)
{
p.marker=this.createLocalMarker(p);
this.setMarkerPosition(p.marker,p.icon.iconClass,p.point)
}
p.marker.icon.style.zIndex=10+a;
p.marker.transparentIcon.style.zIndex=30+a
}
if(this.locations.length==1)
{
this.clearInfoWindowArgs(p.xml);
this.showInfoWindow(this.locations[0])
}
}
;
function rb(da,bc,kb,r,nc)
{
this.icon=da;
this.transparentIcon=bc;
this.shadow=kb;
this.layer=[da,bc,kb];
this.map=r;
this.mouseTarget=nc
}
rb.prototype.addLayer=function(f)
{
this.layer.push(f)
}
;
rb.prototype.setPosition=function(x,m)
{
for(var a=0;
a<this.layer.length;
++a)
{
this.layer[a].style.left=ha(x);
this.layer[a].style.top=ha(m)
}
}
;
rb.prototype.appendTo=function(j)
{
for(var a=0;
a<this.layer.length;
++a)
{
j.appendChild(this.layer[a])
}
}
;
rb.prototype.removeFrom=function(j)
{
for(var a=0;
a<this.layer.length;
++a)
{
j.removeChild(this.layer[a])
}
}
;
rb.prototype.hide=function()
{
for(var a=0;
a<this.layer.length;
++a)
{
this.layer[a].style.display="none"
}
}
;
rb.prototype.show=function()
{
for(var a=0;
a<this.layer.length;
++a)
{
this.layer[a].style.display=""
}
}
;
rb.prototype.isVisible=function()
{
return this.layer[0].style.display!="none"
}
;
d.prototype.createLocalMarker=function(p)
{
var S=this.createLocationMarker(p.icon.image,p.icon.iconClass);
if(A.type==3)
{
var i=this;
S.mouseTarget.location=p;
S.mouseTarget.onmousedown=function(b)
{
return i.onIconMouseDown(this.location,b)
}
}
else
{
var i=this;
S.mouseTarget.onmousedown=function(b)
{
return i.onIconMouseDown(p,b)
}
}
return S
}
;
var wf=0;
d.prototype.createLocationMarker=function(Pf,s)
{
var da=n.create(Pf,s.width,s.height,0,0,10,false,"noprint");
var bc=n.create(tj,s.width,s.height,0,0,30,false,"noprint");
var kb=n.create(s.shadowURL,s.shadowWidth,s.height,0,0,3,false,"noprint");
var Zg=A.type==2?"ff":"ie";
var Mg=Wb.create(Pf.replace(/\.png$/,Zg+".gif"),s.width,s.height,0,0,10,false,"noscreen");
var lh=s.shadowURL.replace(/[^\/]*$/,"dithshadow.gif");
var Kh=Wb.create(lh,s.shadowWidth,s.height,0,0,3,false,"noscreen");
var r=null;
var nc=bc;
if(A.type==2)
{
var eg="map"+wf;
wf++;
r=document.createElement("map");
r.setAttribute("name",eg);
var C=document.createElement("area");
C.setAttribute("shape","poly");
C.setAttribute("alt","");
C.setAttribute("coords",s.imageMap);
C.setAttribute("href","javascript:void(0)");
nc=C;
r.appendChild(C);
this.div.appendChild(r);
bc.setAttribute("usemap","#"+eg)
}
else
{
ga(nc,"pointer")
}
var ad=new rb(da,bc,kb,r,nc);
ad.addLayer(Mg);
if(A.type!=2)
{
ad.addLayer(Kh)
}
ad.appendTo(this.div);
return ad
}
;
d.prototype.clearOverlays=function()
{
this.lastPageCenter=this.getCenterLatLng();
this.lastPageZoom=this.zoomLevel;
for(var a=0;
a<this.locations.length;
a++)
{
var p=this.locations[a];
p.marker.removeFrom(this.div);
if(p.marker.map)this.div.removeChild(p.marker.map);
p.marker=null
}
this.closeInfoWindow();
this.overlays.clear();
this.locations.clear();
this.directions=null;
this.drawDirections(null,this.directionsDiv)
}
;
d.prototype.getDivCoordinate=function(x,m,e)
{
if(!e)e=new q(0,0);
var Wi=x-this.topLeftTile.x*this.spec.tileSize-this.tilePaddingOffset.width+this.currentPanOffset.width*this.spec.tileSize;
var zh=m-this.topLeftTile.y*this.spec.tileSize-this.tilePaddingOffset.height+this.currentPanOffset.height*this.spec.tileSize;
e.x=Wi;
e.y=zh;
return e
}
;
d.orderLocations=function(Tf,of)
{
if(Tf.point.y>of.point.y)return-1;
if(Tf.point.y<of.point.y)return 1;
return 0
}
;
d.prototype.repositionOverlays=function()
{
for(var a=0;
a<this.locations.length;
a++)
{
var ib=this.locations[a];
this.setMarkerPosition(ib.marker,ib.icon.iconClass,ib.point)
}
this.drawDirections(this.directions,this.directionsDiv,true);
if(!this.disablePopups)
{
this.repositionInfoWindow();
if(A.type!=1&&this.infoWindow.hasMask())this.addMarkersToInfoWindowMask()
}
}
;
d.prototype.setMarkerPosition=function(S,s,Eg)
{
var kc=this.spec.getBitmapCoordinate(Eg.y,Eg.x,this.zoomLevel);
var Tc=this.getDivCoordinate(kc.x,kc.y);
var x=Tc.x-s.pointCoord.x;
var m=Tc.y-s.pointCoord.y;
S.setPosition(x,m)
}
;
d.prototype.loadVPage=function(G,ug,Qh)
{
this.clearOverlays();
var E=ug?ug:G.center;
var V=Qh;
if(V==null&&G.viewSpan)
{
V=this.spec.getLowestZoomLevel(G.viewSpan,this.viewSize.width,this.viewSize.height)
}
this.lastPageZoom=V;
this.lastPageCenter=E;
if(E)
{
if(!this.topLeftTile||V!=null&&V!=this.zoomLevel)
{
if(V==null)V=4;
this.centerAndZoom(E,V)
}
else
{
this.recenterOrPanToLatLng(E)
}
}
for(var a=0;
a<G.overlays.length;
a++)
{
this.addOverlay(G.overlays[a])
}
this.directions=G.directions;
this.drawDirections(this.directions,this.directionsDiv);
this.onStateChanged()
}
;
d.prototype.registerKeyHandlers=function(J)
{
P(J,"keydown",this.eventHandler("onKeyPress"));
P(J,"keyup",this.eventHandler("onKeyUp"))
}
;
d.prototype.onKeyPress=function(b)
{
if(this.ignoreKeyEvent(b))
{
return true
}
switch(b.keyCode)
{
case 38:case 40:case 37:case 39:this.panKeys.add(b.keyCode);
this.startContinuousPan();
return false;
case 34:this.pan(0,-Math.floor(this.viewSize.height*0.75));
return false;
case 33:this.pan(0,Math.floor(this.viewSize.height*0.75));
return false;
case 36:this.pan(Math.floor(this.viewSize.width*0.75),0);
return false;
case 35:this.pan(-Math.floor(this.viewSize.width*0.75),0);
return false;
case 187:case 107:this.zoomTo(this.zoomLevel-1);
return false;
case 189:case 109:this.zoomTo(this.zoomLevel+1);
return false
}
switch(b.which)
{
case 61:case 43:this.zoomTo(this.zoomLevel-1);
return false;
case 45:case 95:this.zoomTo(this.zoomLevel+1);
return false
}
return true
}
;
d.prototype.onKeyUp=function(b)
{
switch(b.keyCode)
{
case 38:case 40:case 37:case 39:this.panKeys.remove(b.keyCode);
return false
}
}
;
d.prototype.ignoreKeyEvent=function(b)
{
if(b.ctrlKey||(b.altKey||b.metaKey))
{
return true
}
if(b.target&&(b.target.nodeName=="INPUT"&&b.target.getAttribute("type").toLowerCase()=="text"||b.target.nodeName=="TEXTAREA"))
{
return true
}
return false
}
;
d.prototype.startContinuousPan=function()
{
if(!this.topLeftTile)
{
return
}
this.cancelPan();
if(!this.continuousPanTimeout)
{
this.panSiner=new tc(100);
this.continuousPanTimeout=this.setTimeout("this.doContinuousPan()",5)
}
}
;
d.prototype.doContinuousPan=function()
{
if(this.panKeys.size>0)
{
var xe=(this.panKeys.contains(37)?1:0)+(this.panKeys.contains(39)?-1:0);
var cf=(this.panKeys.contains(38)?1:0)+(this.panKeys.contains(40)?-1:0);
var jb=1;
if(this.panSiner.more())
{
jb=this.panSiner.next()
}
var wb=xe>0?Math.floor:Math.ceil;
var Fa=wb(7*jb*xe+5*xe);
wb=cf>0?Math.floor:Math.ceil;
var Ja=wb(7*jb*cf+5*cf);
this.dragObject.moveTo(this.dragObject.left+Fa,this.dragObject.top+Ja);
this.onMove();
this.rotateTiles();
this.continuousPanTimeout=this.setTimeout("this.doContinuousPan()",10)
}
else
{
this.continuousPanTimeout=null;
this.onStateChanged()
}
}
;
d.prototype.onWindowBlur=function(b)
{
if(this.panKeys.size>0)
{
this.panKeys=new Nc()
}
}
;
d.prototype.onIconMouseDown=function(p,b)
{
ja(b);
if(this.onmousedown)this.onmousedown();
this.clearInfoWindowArgs(p.xml);
this.showInfoWindow(p)
}
;
d.prototype.clearInfoWindowArgs=function(M)
{
M.setAttribute("arg0","");
M.setAttribute("arg1","");
M.setAttribute("arg2","")
}
;
d.prototype.infoWindowNavigate=function(Ph,If,Fg,Rf)
{
if(!this.openLocation||this.disablePopups)return;
if(If)this.openLocation.xml.setAttribute("arg0",If);
if(Fg)this.openLocation.xml.setAttribute("arg1",Fg);
if(Rf)this.openLocation.xml.setAttribute("arg2",Rf);
this.onInfoWindowLoad=Ph;
this.showInfoWindow(this.openLocation)
}
;
d.prototype.showInfoWindow=function(p)
{
if(this.disablePopups)return;
if(!p.infoStyle)return;
this.openLocation=p;
var ca=this.spec.getBitmapCoordinate(p.point.y,p.point.x,this.zoomLevel);
var Ia=this.getDivCoordinate(ca.x,ca.y);
this.infoWindow.point=p.point;
this.infoWindow.iconClass=p.icon.iconClass;
var i=this;
var bh=function()
{
i.showSizedInfoWindow(Ia.x,Ia.y,p.icon.iconClass)
}
;
Od(p,this.infoWindow.offscreenArea,p.infoStyle,bh,null,p.toHTML)
}
;
d.prototype.addMarkersToInfoWindowMask=function()
{
if(this.disablePopups||(!this.infoWindow.isVisible()||!this.infoWindow.point))return;
this.infoWindow.clearMaskMap();
var Sa=new q(this.infoWindow.getOffsetLeft(),this.infoWindow.getOffsetTop());
var yb=new q(Sa.x+this.infoWindow.getTotalWidth(),Sa.y+this.infoWindow.getTotalHeight());
for(var a=0;
a<this.locations.length;
a++)
{
var S=this.locations[a].marker;
if(S.icon.offsetTop>yb.y)break;
this.addMarkerToInfoWindowMask(Sa,yb,S)
}
if(this.directionsMarkersAreVisible())
{
this.addMarkerToInfoWindowMask(Sa,yb,this.directionsStart);
this.addMarkerToInfoWindowMask(Sa,yb,this.directionsEnd)
}
}
;
d.prototype.addMarkerToInfoWindowMask=function(Sa,yb,S)
{
var da=S.icon;
if(da.offsetLeft+da.width>=Sa.x&&(da.offsetLeft<=yb.x&&(da.offsetTop+da.height>=Sa.y&&da.offsetTop<=yb.y)))
{
var Ve=Q.get("local").translateImageMapArray(da.offsetLeft-Sa.x,da.offsetTop-Sa.y);
this.infoWindow.addAreaToMaskMap(Ve,S.mouseTarget.onmousedown)
}
}
;
d.prototype.showSizedInfoWindow=function(x,m,s,Cd)
{
La.invalidate("infoWindowOffscreen");
var df=La.create("infoWindowOffscreen");
this.infoWindow.prepareOffscreen();
var r=this;
var Gi=function()
{
if(df.isValid())
{
r.infoWindow.flipOffscreenArea();
r.infoWindow.sizeToContent(Cd);
r.infoWindow.positionAt(x,m,s);
if(A.type!=1&&r.infoWindow.hasMask())
{
r.addMarkersToInfoWindowMask()
}
r.infoWindow.show();
r.panToInfoWindow();
if(r.onInfoWindowLoad)
{
r.onInfoWindowLoad();
r.onInfoWindowLoad=null
}
}
}
;
window.setTimeout(Gi,0)
}
;
d.prototype.showMapBlowup=function(k,s)
{
if(this.disablePopups)return;
var ca=this.spec.getBitmapCoordinate(k.y,k.x,this.zoomLevel);
var Ia=this.getDivCoordinate(ca.x,ca.y);
this.infoWindow.point=k;
this.infoWindow.iconClass=s?s:Q.get("noicon");
var W=document.createElement("div");
W.style.border="1px solid silver";
W.style.width="200px";
W.style.height="200px";
var Nd=new d(W,this.spec,200,200,true,true,this.mapTypes);
Nd.directions=this.directions;
Nd.centerAndZoom(k,1);
this.infoWindow.clearOffscreenArea();
this.infoWindow.offscreenArea.appendChild(W);
if(this.mapTypes.length>1)
{
var xb=document.createElement("div");
xb.style.marginTop="5px";
xb.style.fontSize="small";
Nd.createSpecToggleLinks(xb);
this.infoWindow.offscreenArea.appendChild(xb)
}
this.showSizedInfoWindow(Ia.x,Ia.y,this.infoWindow.iconClass,203);
return Nd
}
;
d.prototype.createSpecToggleLinks=function(xb)
{
var kf=new Array();
for(var a=0;
a<this.mapTypes.length;
a++)
{
var ta=this.mapTypes[a];
var Ra=this.createSpecChangeLink(ta);
kf.push(Ra);
xb.appendChild(Ra);
if(a<this.mapTypes.length-1)
{
xb.appendChild(document.createTextNode(" - "))
}
}
var i=this;
this.onspecificationchange=function(be,Pa)
{
for(var a=0;
a<i.mapTypes.length;
a++)
{
var ta=i.mapTypes[a];
var Ra=kf[a];
if(Pa==ta)
{
Ra.className="selected"
}
else
{
Ra.className=null
}
}
if(A.type==1)
{
i.setTimeout("this.reconfigureAllImages()",0)
}
}
;
this.onspecificationchange(null,this.spec)
}
;
d.prototype.createSpecChangeLink=function(ta)
{
var i=this;
var Th=function()
{
i.switchSpecification(ta)
}
;
return ai(ta.getLinkText(),Th)
}
;
d.prototype.onInfoCloseClick=function(b)
{
this.closeInfoWindow()
}
;
d.prototype.closeInfoWindow=function()
{
if(!this.disablePopups)
{
this.infoWindow.hide();
if(this.oninfowindowclose)this.oninfowindowclose()
}
}
;
d.prototype.panToInfoWindow=function()
{
if(this.disablePopups)
{
return
}
var ca=this.spec.getBitmapCoordinate(this.infoWindow.point.y,this.infoWindow.point.x,this.zoomLevel);
var Ia=this.getDivCoordinate(ca.x,ca.y);
var xa=new q(this.centerBitmap.x,this.centerBitmap.y);
var O=this.infoWindow.left+(ca.x-Ia.x);
var top=this.infoWindow.top+(ca.y-Ia.y);
var Lg=Math.floor(this.viewSize.width/2);
var Yd=Math.floor(this.viewSize.height/2);
xa.y=Math.min(xa.y,top+Yd-25);
xa.y=Math.max(xa.y,ca.y-Yd+25);
var Bc=25;
var yg=ca.y-this.infoWindow.getTotalHeightAboveGround()-(xa.y-Yd);
if(yg<55)Bc=Bc+50;
else if(yg<295)Bc=Bc+35;
xa.x=Math.min(xa.x,O+Lg-Bc);
xa.x=Math.max(xa.x,O+this.infoWindow.getTotalWidth()-Lg+25);
this.centerLatLng=null;
this.recenterOrPanToBitmap(xa)
}
;
d.prototype.repositionInfoWindow=function()
{
if(this.disablePopups||(!this.infoWindow.isVisible()||!this.infoWindow.point))return;
var k=this.infoWindow.point;
var ca=this.spec.getBitmapCoordinate(k.y,k.x,this.zoomLevel);
var Ia=this.getDivCoordinate(ca.x,ca.y);
this.infoWindow.positionAt(Ia.x,Ia.y,this.infoWindow.iconClass)
}
;
var Bi=new q(0,0);
var Xe=new q(0,0);
d.prototype.getVMLPathString=function(B)
{
L.start("Map","getVMLPathString");
var u=new Array();
u.push("m");
u.push(B.polyline.points[0]);
u.push(B.polyline.points[1]);
u.push("l");
u=u.concat(B.polyline.points);
for(var a=0;
a<B.segments.length;
a++)
{
var ba=B.segments[a].pointIndex<<1;
var Ld=ba+4;
var Gf=u[Ld];
var Bg=u[Ld+1];
u[Ld]=Gf+" "+Bg+" e m";
u[Ld+1]=Gf+" "+Bg+" l"
}
u.push("e");
var str=u.join(" ");
L.end("Map","getVMLPathString");
return str
}
;
d.prototype.createRawVML=function(af,j,c)
{
L.start("Map","createRawVML");
var Ea;
if(!c)
{
c=document.createElement("v:shape");
Ea=document.createElement("v:stroke");
c.appendChild(Ea);
c.path=af
}
else
{
j.removeChild(c);
Ea=c.firstChild
}
var Ob=this.centerBitmap;
var Pc=this.getDivCoordinate(Ob.x,Ob.y,Xe);
c.unselectable="on";
c.strokecolor="blue";
c.strokeweight=5;
c.fill=false;
c.filled=false;
var h=100;
var l=100;
c.style.position="absolute";
c.style.width=h+"px";
c.style.height=l+"px";
c.style.left=Pc.x+"px";
c.style.top=Pc.y-l+"px";
c.style.rotation="-90";
var fd=this.getCenterLatLng();
var ve=fd.y*100000+" "+fd.x*100000;
c.coordorigin=ve;
var Hf=this.spec.getPixelsPerDegree(this.zoomLevel);
c.coordsize=100000*l/Hf.y+" "+100000*h/Hf.x;
Ea.joinstyle="round";
Ea.endcap="round";
Ea.opacity=0.45;
L.end("Map","createRawVML");
j.appendChild(c);
return c
}
;
d.prototype.getBitmapVectors=function(vb,v,D)
{
if(!v)v=new Array();
if(!D)D=new Z();
D.minX=U;
D.minY=U;
D.maxX=-U;
D.maxY=-U;
for(var a=0;
a<vb.length;
)
{
var gb=vb[a++];
var tb=vb[a++];
var pa=this.spec.getBitmapCoordinate(gb,tb,this.zoomLevel,Bi);
pa.x=Math.round(pa.x);
pa.y=Math.round(pa.y);
v.push(pa.x);
v.push(pa.y);
if(pa.x<D.minX)D.minX=pa.x;
if(pa.y<D.minY)D.minY=pa.y;
if(pa.x>D.maxX)D.maxX=pa.x;
if(pa.y>D.maxY)D.maxY=pa.y
}
return v
}
;
d.prototype.getVectorPath=function(v,D)
{
var u=new Array();
var Ec;
var Dc;
for(var a=0;
a<v.length;
)
{
var zb=v[a++];
var Eb=v[a++];
var ac=v[a++];
var Ub=v[a++];
if(Eb!=Ec||zb!=Dc)
{
u.push("m");
u.push(zb);
u.push(Eb);
u.push("l")
}
u.push(ac);
u.push(Ub);
Ec=Ub;
Dc=ac
}
u.push("e");
return u.join(" ")
}
;
d.prototype.getEncodedImageSource=function(v,D)
{
var u=new Array();
var Dc;
var Ec;
for(var a=0;
a<v.length;
)
{
var zb=v[a++];
var Eb=v[a++];
var ac=v[a++];
var Ub=v[a++];
if(zb==ac&&Eb==Ub)
{
continue
}
if(zb!=Dc||Eb!=Ec)
{
if(u.length>0)
{
hc(9999,u)
}
hc(zb-D.minX,u);
hc(Eb-D.minY,u)
}
hc(ac-zb,u);
hc(Ub-Eb,u);
Ec=Ub;
Dc=ac
}
hc(9999,u);
return u.join("")
}
;
d.prototype.createVectorSegments=function(Pb,Xb,Za,oa)
{
L.start("Map","createVectorSegments");
var vb=Pb.getVectors(Xb,Za);
var v=new Array();
var na=new Z();
this.getBitmapVectors(vb,v,na);
if(!oa)
{
oa=new Z()
}
var Na=new Z(Math.max(oa.minX,na.minX),Math.max(oa.minY,na.minY),Math.min(oa.maxX,na.maxX),Math.min(oa.maxY,na.maxY));
var c;
if(v.length>0)
{
var Ob=this.centerBitmap;
var Pc=this.getDivCoordinate(Ob.x,Ob.y,Xe);
c=document.createElement("v:shape");
c.unselectable="on";
c.strokecolor="blue";
c.strokeweight=5;
c.fill=false;
c.filled=false;
var h=1;
var l=1;
c.style.position="absolute";
c.style.width=h+"px";
c.style.height=l+"px";
c.style.left=Pc.x+"px";
c.style.top=Pc.y+"px";
var ve=Ob.x+" "+Ob.y;
c.coordorigin=ve;
c.coordsize=h+" "+l;
c.path=this.getVectorPath(v,Na);
var Ea=document.createElement("v:stroke");
Ea.joinstyle="round";
Ea.endcap="round";
Ea.opacity=0.45;
c.appendChild(Ea)
}
else
{
c=document.createElement("div")
}
c.sourceBounds=oa;
L.end("Map","createVectorSegments");
return c
}
;
d.prototype.createImageSegments=function(Pb,Xb,Za,oa)
{
L.start("Map","createImageSegments");
var u;
var Na;
do
{
var vb=Pb.getVectors(Xb,Za);
var v=new Array();
var na=new Z();
this.getBitmapVectors(vb,v,na);
na.minX-=10;
na.minY-=10;
na.maxX+=10;
na.maxY+=10;
if(!oa)
{
oa=new Z()
}
Na=new Z(Math.max(oa.minX,na.minX),Math.max(oa.minY,na.minY),Math.min(oa.maxX,na.maxX),Math.min(oa.maxY,na.maxY));
u=this.getEncodedImageSource(v,Na);
++Za
}
while(u.length>900);
var c;
if(u.length>0)
{
var Zf=this.getDivCoordinate(Na.minX,Na.minY,Xe);
var h=Math.ceil(Na.maxX-Na.minX);
var l=Math.ceil(Na.maxY-Na.minY);
var J="http://www.google.com/maplinedraw?width="+h+"&height="+l+"&path="+u;
Sd('<a href="'+db(J)+'">'+Jb(J)+"</a>",0);
if(A.type!=1)
{
h=null;
l=null
}
var Ha=A.type==2?"noprint":null;
c=n.create(J,h,l,Zf.x,Zf.y,0,false,Ha)
}
else
{
c=document.createElement("div")
}
c.sourceBounds=oa;
L.end("Map","createImageSegments");
return c
}
;
d.prototype.drawDirections=function(B,R,ti)
{
if(!B&&!R.directions)return;
var Yg=this.getBoundsBitmap();
var ma=R.directionsBounds;
if(!ti)
{
if(B==R.directions)
{
if(ma.containsBounds(Yg))
{
return
}
}
}
if(R.directions!=B)
{
while(R.hasChildNodes())
{
R.removeChild(R.lastChild)
}
R.directions=B;
if(this.useRawVml&&(B&&(A.type==1&&(!this.forceImageSegments&&B.polyline.points.length<16000))))
{
var af=this.getVMLPathString(B);
R.path=af
}
else
{
R.path=null
}
}
if(B)
{
L.start("Map","drawDirections");
var c=null;
var Cf=900;
var h=Math.min(this.viewSize.width,Cf);
var l=Math.min(this.viewSize.height,Cf);
if(A.type==1&&!this.forceImageSegments)
{
h=5000;
l=5000
}
ma.minX=this.centerBitmap.x-h;
ma.minY=this.centerBitmap.y-l;
ma.maxX=this.centerBitmap.x+h;
ma.maxY=this.centerBitmap.y+l;
var Ga=this.spec.getLatLng(ma.minX,ma.minY,this.zoomLevel);
var Ca=this.spec.getLatLng(ma.maxX,ma.maxY,this.zoomLevel);
var Xb=new Z(Ga.x,Ca.y,Ca.x,Ga.y);
if(R.path)
{
c=null;
if(R.hasChildNodes())
{
c=R.firstChild
}
c=this.createRawVML(R.path,R,c)
}
else
{
while(R.hasChildNodes())
{
R.removeChild(R.lastChild)
}
var Za=0;
var Aa=new aa(B.polyline.minTolerance,B.polyline.minTolerance);
while(Za<B.polyline.numLevels)
{
Aa.width*=B.polyline.zoomFactor;
Aa.height*=B.polyline.zoomFactor;
if(this.zoomLevel<this.spec.getLowestZoomLevel(Aa,2,2))
{
break
}
++Za
}
if(A.type==1&&!this.forceImageSegments)
{
c=this.createVectorSegments(B.polyline,Xb,Za,ma)
}
else
{
c=this.createImageSegments(B.polyline,Xb,Za,ma)
}
R.appendChild(c)
}
c.style.zIndex=2;
this.drawDirectionsMarkers();
this.setDirectionIndicatorPos();
L.end("Map","drawDirections")
}
else
{
ma.minX=-U;
ma.minY=-U;
ma.maxX=U;
ma.maxY=U;
this.hideDirectionsMarkers()
}
}
;
var mi=o+"dd-start.png";
var Nh=o+"dd-end.png";
d.prototype.drawDirectionsMarkers=function()
{
if(!this.directionsStart||!this.directionsEnd)
{
this.directionsStart=this.createLocationMarker(mi,Q.get("local"));
this.directionsEnd=this.createLocationMarker(Nh,Q.get("local"));
var i=this;
this.directionsStart.mouseTarget.onmousedown=function(b)
{
ja(b);
i.showDirectionsStart()
}
;
this.directionsEnd.mouseTarget.onmousedown=function(b)
{
ja(b);
i.showDirectionsEnd()
}
}
this.setMarkerPosition(this.directionsStart,Q.get("local"),this.directions.polyline.getPoint(0));
var Rb=(this.directions.polyline.points.length>>1)-1;
this.setMarkerPosition(this.directionsEnd,Q.get("local"),this.directions.polyline.getPoint(Rb));
this.directionsStart.show();
this.directionsEnd.show();
var ge=0;
var De=0;
if(this.directions.polyline.getPoint(0).y<this.directions.polyline.getPoint(Rb).y)
{
ge=1
}
else
{
De=1
}
this.directionsStart.icon.style.zIndex=10+ge;
this.directionsStart.transparentIcon.style.zIndex=30+ge;
this.directionsEnd.icon.style.zIndex=10+De;
this.directionsEnd.transparentIcon.style.zIndex=30+De
}
;
d.prototype.showDirectionsStart=function()
{
if(!this.directions)return;
this.showMapBlowup(this.directions.polyline.getPoint(0),Q.get("local"))
}
;
d.prototype.showDirectionsEnd=function()
{
if(!this.directions)return;
var Rb=(this.directions.polyline.points.length>>1)-1;
this.showMapBlowup(this.directions.polyline.getPoint(Rb),Q.get("local"))
}
;
d.prototype.showDirectionsStep=function(ec)
{
if(!this.directions)return;
var k=this.directions.polyline.getPoint(ec.pointIndex);
var Gb=this.showMapBlowup(k);
if(ec.pointIndex!=0)
{
var Oa=Gb.getDirIndicatorAngle(ec.pointIndex);
var sj=Gb.getDirIndicatorPath(Oa);
var S=n.create(sj,24,24,0,0,2,false);
Gb.directionMarker=S;
Gb.directionMarkerAngle=Oa;
Gb.directionMarkerPoint=k;
Gb.setDirectionIndicatorPos();
Gb.div.appendChild(S)
}
}
;
d.prototype.setDirectionIndicatorPos=function()
{
var S=this.directionMarker;
if(!S)return;
var Oa=this.directionMarkerAngle;
var k=this.directionMarkerPoint;
var mc=12*Math.cos(Oa);
var Fc=12*Math.sin(Oa);
mc=Math.floor(-12-mc);
Fc=Math.floor(-12-Fc);
var kc=this.spec.getBitmapCoordinate(k.y,k.x,this.zoomLevel);
var Tc=this.getDivCoordinate(kc.x,kc.y);
S.style.left=ha(Tc.x+mc);
S.style.top=ha(Tc.y+Fc)
}
;
d.prototype.getDirIndicatorAngle=function(ba)
{
var Oa=0;
if(ba>1)
{
var wa=this.directions.polyline.getPoint(ba-2);
var za=this.directions.polyline.getPoint(ba);
wa=this.spec.getBitmapCoordinate(wa.y,wa.x,this.zoomLevel);
za=this.spec.getBitmapCoordinate(za.y,za.x,this.zoomLevel);
Oa=Math.atan2(za.y-wa.y,za.x-wa.x)
}
return Oa
}
;
var lj=o+"dir_";
d.prototype.getDirIndicatorPath=function(Oa)
{
var uc=Math.round(Oa*60/Math.PI)*3+90;
while(uc>=120)uc-=120;
while(uc<0)uc+=120;
var J=lj+uc+".png";
return J
}
;
d.prototype.hideDirectionsMarkers=function()
{
if(this.directionsStart&&this.directionsEnd)
{
this.directionsStart.hide();
this.directionsEnd.hide()
}
}
;
d.prototype.directionsMarkersAreVisible=function()
{
return this.directionsStart&&(this.directionsEnd&&(this.directionsStart.isVisible()&&this.directionsEnd.isVisible()))
}
;
d.prototype.createMapControl=function()
{
var ea=document.createElement("div");
this.createPanningControls(ea);
this.createZoomControls(ea);
this.createZoomSlider(ea);
return ea
}
;
var Ci=o+"zoom-plus.png";
var vi=o+"zoom-minus.png";
var zi=o+"sliderbar.png";
var ei=o+"slider.png";
d.prototype.createZoomControls=function(ea)
{
var i=this;
var Bd=n.create(Ci,17,17,20,70,1,false);
ga(Bd,"pointer");
P(Bd,"click",function(b)
{
i.zoomTo(i.zoomLevel-1);
ja(b)
}
);
Bd.title=_mZoomIn;
ea.appendChild(Bd);
var Dd=n.create(vi,17,17,20,260,1,false);
ga(Dd,"pointer");
P(Dd,"click",function(b)
{
i.zoomTo(i.zoomLevel+1);
ja(b)
}
);
Dd.title=_mZoomOut;
ea.appendChild(Dd)
}
;
var Mh=o+"center.png";
var Li=o+"east.png";
var ui=o+"west.png";
var Ng=o+"north.png";
var Ii=o+"south.png";
var ej=o+"panshadow.png";
d.prototype.createPanningControls=function(ea)
{
var i=this;
var kb=n.create(ej,59,64,0,0,0,false);
ea.appendChild(kb);
var dd=n.create(Ng,17,17,20,0,1,false);
ga(dd,"pointer");
P(dd,"click",function(b)
{
i.pan(0,Math.floor(i.viewSize.height*0.5));
ja(b)
}
);
dd.title=_mPanNorth;
ea.appendChild(dd);
var hd=n.create(Li,17,17,40,20,1,false);
ga(hd,"pointer");
P(hd,"click",function(b)
{
i.pan(-Math.floor(i.viewSize.width*0.5),0);
ja(b)
}
);
hd.title=_mPanEast;
ea.appendChild(hd);
var Vd=n.create(Ii,17,17,20,40,1,false);
ga(Vd,"pointer");
P(Vd,"click",function(b)
{
i.pan(0,-Math.floor(i.viewSize.height*0.5));
ja(b)
}
);
Vd.title=_mPanSouth;
ea.appendChild(Vd);
var yd=n.create(ui,17,17,0,20,1,false);
ga(yd,"pointer");
P(yd,"click",function(b)
{
i.pan(Math.floor(i.viewSize.width*0.5),0);
ja(b)
}
);
yd.title=_mPanWest;
ea.appendChild(yd);
var E=n.create(Mh,17,17,20,20,1,false);
ga(E,"pointer");
P(E,"click",function(b)
{
if(i.lastPageCenter)
{
if(i.lastPageZoom!=i.zoomLevel)
{
i.centerAndZoom(i.lastPageCenter,i.lastPageZoom)
}
else
{
i.recenterOrPanToLatLng(i.lastPageCenter)
}
}
else if(i.lastLatLng)
{
i.recenterOrPanToLatLng(this.map.lastLatLng)
}
ja(b)
}
);
E.title=_mLastResult;
ea.appendChild(E)
}
;
var Eh=o+"slidershadow.png";
d.prototype.createZoomSlider=function(ea)
{
var kb=n.create(Eh,19,215,20,64,0,false);
ea.appendChild(kb);
var Xa=document.createElement("div");
Xa.style.position="absolute";
Xa.style.left="21px";
Xa.style.top="90px";
Xa.style.width="15px";
Xa.style.height="167px";
var Wd=n.create(zi,15,167,0,0,1,false);
Xa.appendChild(Wd);
var Mc=-1*Math.floor(3.5)+1;
var Oe=n.create(ei,22,14,Mc,this.getRelativeZoomSliderPos(),2,false);
Oe.title=_mZoomDrag;
Xa.appendChild(Oe);
ea.appendChild(Xa);
var D=new Z(Mc,1,Mc+22,166);
var me=new ab(Oe,Mc,this.getRelativeZoomSliderPos(),D);
this.onzoom=function()
{
me.moveTo(Mc,i.getRelativeZoomSliderPos())
}
;
var i=this;
me.ondragend=function()
{
var Yi=me.top+Math.floor(5.5);
i.zoomTo(i.getZoomFromRelativeCoord(Yi))
}
;
ga(Wd,"pointer");
Wd.title=_mZoomSet;
P(Wd,"click",function(b)
{
var m;
if(window.event)
{
m=window.event.offsetY
}
else
{
var Kd=gd(Xa);
m=b.pageY-Kd.y-2
}
ja(b);
i.zoomTo(i.getZoomFromRelativeCoord(m))
}
)
}
;
d.prototype.getRelativeZoomSliderPos=function()
{
return 1+this.zoomLevel*11
}
;
d.prototype.getZoomFromRelativeCoord=function(m)
{
var V=Math.floor((m-1)/11);
return Math.max(0,Math.min(this.spec.numZoomLevels-1,V))
}
;
d.prototype.showCopyright=function()
{
var Ne=this.createCopyright(_mGoogleCopy);
Ne.style.left="3px";
Ne.style.bottom="3px";
this.container.appendChild(Ne);
var fe=this.createCopyright(_mDataCopy);
fe.style.right="3px";
fe.style.bottom="3px";
this.container.appendChild(fe)
}
;
d.prototype.createCopyright=function(Y)
{
var j=document.createElement("div");
j.style.position="absolute";
ga(j,"default");
j.unselectable="on";
j.onselectstart=Be;
j.innerHTML=Y;
j.style.fontSize="11px";
j.style.fontFamily="Arial, sans serif";
ic(j,"noselect");
return j
}
;
function dc(r)
{
this.anchorLevel=null;
this.anchor=new q(0,0);
this.spec=null;
this.span=new aa(U,U);
this.points=null;
this.map=r;
this.map.addStateListener(this);
this.map.onresize=this.eventHandler("onMapResize")
}
var _bPoint=new q(0,0);
dc.prototype.onMapStateChanged=function()
{
if(this.anchorLevel!=this.map.zoomLevel||this.spec!=this.map.spec)
{
this.reset();
this.addPoint(0,0,true);
return
}
var E=this.map.getCenterLatLng(_bPoint);
var vd=Math.round((E.x-this.anchor.x)/this.span.width);
var Td=Math.round((E.y-this.anchor.y)/this.span.height);
this.addPoint(vd,Td,true)
}
;
dc.prototype.onMapResize=function()
{
this.reset();
this.addPoint(0,0,false)
}
;
dc.prototype.reset=function()
{
this.map.getCenterLatLng(this.anchor);
this.map.getSpanLatLng(this.span);
this.spec=this.map.spec;
this.anchorLevel=this.map.zoomLevel;
this.points=new Object()
}
;
dc.prototype.addPoint=function(vd,Td,Yh)
{
var str=vd+","+Td;
if(this.points[str])return;
this.points[str]=1;
if(Yh)
{
var z=new ua();
z.setAllMapValues(this.map);
var Ce=_bPoint;
Ce.x=this.anchor.x+vd*this.span.width;
Ce.y=this.anchor.y+Td*this.span.height;
z.setValue("vp",z.getLatLngArg(Ce));
var fa=z.getURL();
Sd('<a href="'+db(fa)+'">'+Jb(fa)+"</a>",0);
if(!this.sender)
{
this.sender=document.createElement("img");
this.sender.style.position="absolute";
this.sender.style.visibility="hidden";
this.sender.style.top=ha(-10);
this.sender.style.left=ha(-10);
this.sender.style.width=ha(1);
this.sender.style.height=ha(1);
document.body.appendChild(this.sender)
}
this.sender.src=fa
}
}
;
function ab(J,O,top,W)
{
this.src=J;
this.container=W;
this.ondragstart=null;
this.ondrag=null;
this.ondragend=null;
this.onmove=null;
this.onclick=null;
this.disabled=false;
this.dragPoint=new q(0,0);
this.clickStartPos=new q(0,0);
this.src.style.position="absolute";
this.moveTo(O,top);
this.mouseDownHandler=this.eventHandler("onMouseDown");
this.mouseMoveHandler=this.eventHandler("onMouseMove");
this.mouseUpHandler=this.eventHandler("onMouseUp");
if(A.type==2)
{
P(window,"mouseout",this.eventHandler("onWindowMouseOut"))
}
this.eventSrc=this.src.setCapture?this.src:window;
P(this.src,"mousedown",this.mouseDownHandler)
}
ab.prototype.moveTo=function(O,top)
{
if(this.left!=O||this.top!=top)
{
this.left=O;
this.top=top;
this.src.style.left=this.left+"px";
this.src.style.top=this.top+"px";
if(this.onmove)
{
this.onmove()
}
}
}
;
ab.prototype.onMouseDown=function(b)
{
if(b.cancelDrag)
{
return
}
var Xi=b.button==0||b.button==1;
if(this.disabled||!Xi)
{
ja(b);
return false
}
this.dragPoint.x=b.screenX;
this.dragPoint.y=b.screenY;
P(this.eventSrc,"mousemove",this.mouseMoveHandler);
P(this.eventSrc,"mouseup",this.mouseUpHandler);
if(this.src.setCapture)
{
this.src.setCapture()
}
this.clickStartTime=(new Date()).getTime();
this.clickStartPos.x=b.screenX;
this.clickStartPos.y=b.screenY;
if(this.ondragstart)
{
this.ondragstart(b)
}
this.originalCursor=this.src.style.cursor;
ga(this.src,"move");
ja(b)
}
;
ab.prototype.onMouseMove=function(b)
{
if(A.os==1)
{
if(b==null)
{
return
}
if(this.dragDisabled)
{
this.savedMove=new Object();
this.savedMove.screenX=b.screenX;
this.savedMove.screenY=b.screenY;
return
}
this.setTimeout("this.dragDisabled = false;
this.onMouseMove(this.savedMove)",30);
this.dragDisabled=true;
this.savedMove=null
}
var jf=1;
if(A.type==3&&A.version==1)
{
jf=-1
}
var x=this.left+(b.screenX-this.dragPoint.x);
var m=this.top+(b.screenY-this.dragPoint.y)*jf;
var Fa=0;
var Ja=0;
if(this.container)
{
var bd=x;
if(x<this.container.minX)
{
bd=this.container.minX
}
else
{
var Gd=this.container.maxX-this.src.offsetWidth;
if(x>Gd)
{
bd=Gd
}
}
Fa=bd-x;
x=bd;
var rd=m;
if(m<this.container.minY)
{
rd=this.container.minY
}
else
{
var id=this.container.maxY-this.src.offsetHeight;
if(m>id)rd=id
}
Ja=rd-m;
m=rd
}
this.moveTo(x,m);
this.dragPoint.x=b.screenX+Fa;
this.dragPoint.y=b.screenY+Ja;
if(this.ondrag)
{
this.ondrag(b)
}
}
;
ab.prototype.onMouseUp=function(b)
{
nf(this.eventSrc,"mousemove",this.mouseMoveHandler);
nf(this.eventSrc,"mouseup",this.mouseUpHandler);
ga(this.src,this.originalCursor);
if(document.releaseCapture)
{
document.releaseCapture()
}
if(this.ondragend)
{
this.ondragend(b)
}
if(this.onclick)
{
var ii=(new Date()).getTime();
if(ii-this.clickStartTime<=500&&(Math.abs(this.clickStartPos.x-b.screenX)<=2&&Math.abs(this.clickStartPos.y-b.screenY)<=2))
{
this.onclick(b)
}
}
}
;
ab.prototype.onWindowMouseOut=function(b)
{
if(!b.relatedTarget)
{
this.onMouseUp(b)
}
}
;
ab.prototype.disable=function()
{
this.disabled=true
}
;
ab.prototype.enable=function()
{
this.disabled=false
}
;
var Te="centerlat";
var Ue="centerlng";
function qc(qb,bb,Xc,ud,E,bi,dh,Mi,kh,C,td,B,Fb,M)
{
this.query=qb;
this.title=bb;
this.error=Xc;
this.spelling=ud;
this.center=E;
this.viewSpan=bi;
this.searchCenter=dh;
this.searchSpan=Mi;
this.ads=kh;
this.area=C;
this.overlays=td;
this.directions=B;
this.debug=Fb;
this.xml=M
}
function vc(Pd,Vh,M)
{
this.locations=Pd;
this.panelStyle=Vh;
this.xml=M
}
function kd(H,k,da,Jh,M)
{
this.id=H;
this.point=k;
this.icon=da;
this.infoStyle=Jh;
this.xml=M
}
function bf(f,s)
{
this.image=f;
this.iconClass=s
}
function oc(Pb,pd,M)
{
this.polyline=Pb;
this.segments=pd;
this.xml=M
}
function se(H,ef,ba)
{
this.id=H;
this.description=ef;
this.pointIndex=ba
}
function Q(w,h,l,wh,dj,oh,pi,Ih,ie)
{
this.name=w;
this.width=h;
this.height=l;
this.pointCoord=wh;
this.infoTipCoord=dj;
this.shadowTipCoord=oh;
this.shadowURL=pi;
this.shadowWidth=Ih;
this.imageMapArray=ie;
if(this.imageMapArray)
{
this.imageMap=this.imageMapArray.join(",")
}
else
{
this.imageMap=null
}
}
Q