// Copyright 2005 Google
function ii(Bg,Vf,Eh)
{
this.type=Bg;
this.version=Vf;
this.os=Eh
}
;
var m=new ii(0,0,null);
var Eb=navigator.userAgent.toLowerCase();
if(Eb.indexOf("msie")!=-1&&document.all)
{
m.type=1;
if(Eb.indexOf("msie 5"))m.version=5
}
else if(Eb.indexOf("safari")!=-1)
{
m.type=3;
if(Eb.indexOf("safari/125")!=-1)m.version=1
}
else if(Eb.indexOf("mozilla")!=-1)
{
m.type=2
}
if(Eb.indexOf("x11;
")!=-1)
{
m.os=1
}
;
var _timeoutCounter=0;
Object.prototype.setTimeout=function(ae,Rh)
{
var be="tempVar"+_timeoutCounter;
_timeoutCounter++;
eval(be+" = this;
");
var jh=ae.replace(/\\/g,"\\\\").replace(/\"/g,'\\"');
return window.setTimeout(be+'._setTimeoutDispatcher("'+jh+'");
'+be+" = null;
",Rh)
}
;
Object.prototype._setTimeoutDispatcher=function(ae)
{
eval(ae)
}
;
Object.prototype.eventHandler=function(Xf)
{
var h=this;
h=h;
return function(b)
{
if(!b)b=window.event;
if(b&&!b.target)b.target=b.srcElement;
h[Xf](b)
}
}
;
String.prototype.xmlEscape=function()
{
return this.replace(/&/g,"&
").replace(/</g,"<
").replace(/>/g,">
")
}
;
String.prototype.jsEscape=function()
{
return this.replace(/\\/g,"\\\\").replace(/\'/g,'\\"').xmlEscape()
}
;
Array.prototype.clear=function()
{
while(this.length>0)this.pop()
}
;
document.getElementsByClassName=function(ja)
{
var ec=document.all;
if(!ec)ec=document.getElementsByTagName("*");
var he=new Array();
for(var a=0;
a<ec.length;
a++)
{
if(ec[a].className==ja)
{
he[he.length]=ec[a]
}
}
return he
}
;
function o()
{
}
o.createElement=function(C,ac)
{
var f;
if(m.type==1)
{
f=document.createElement("DIV");
f.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+C+(ac?'",sizingMethod=crop)':'")')
}
else
{
f=document.createElement("IMG");
f.src=C
}
return f
}
;
o.create=function(C,g,k,K,top,Ga,ac,xa)
{
return zb.create(C,g,k,K,top,Ga,ac,xa,o.createElement)
}
;
function zb()
{
}
zb.create=function(C,g,k,K,top,Ga,ac,xa,rf)
{
var f;
if(!rf)
{
f=document.createElement("IMG");
if(C)f.src=C
}
else
{
f=rf(C,ac)
}
if(g&&k)
{
f.style.width=yb(g);
f.style.height=yb(k);
f.width=g;
f.height=k
}
if(top||(K||(top==0||K==0)))
{
f.style.position="absolute";
f.style.left=yb(K);
f.style.top=yb(top)
}
if(Ga||Ga==0)
{
f.style.zIndex=Ga
}
if(m.type==1)
{
f.unselectable="on";
f.onselectstart=Td
}
else
{
f.className="noselect"
}
f.oncontextmenu=Td;
if(xa)
{
Nb(f,xa)
}
return f
}
;
function le(bf,ja,sf)
{
if(m.type==1)
{
bf.attachEvent("on"+ja,sf)
}
else
{
bf.addEventListener(ja,sf,false)
}
}
function aa(b)
{
if(m.type==1)
{
window.event.cancelBubble=true
}
else
{
b.cancelBubble=true;
b.preventDefault();
b.stopPropagation()
}
}
function Yg(Fb,gi)
{
var ld=window.document.createElement("a");
ld.href="javascript:void(0)";
ld.onclick=gi;
ld.appendChild(window.document.createTextNode(Fb));
return ld
}
if(!Array.prototype.push)
{
Array.prototype.push=function(Ve)
{
this[this.length]=Ve
}
}
function Ve(F)
{
return document.getElementById(F)
}
function yb(x)
{
return x+"px"
}
function Nb(c,xa)
{
if(c.className)
{
c.className+=" "+xa
}
else
{
c.className=xa
}
}
function qh(D)
{
var l=0;
while(D)
{
l+=D.offsetTop;
D=D.offsetParent
}
return l
}
function sc(ba)
{
this.size=0;
if(ba)
{
for(var a=ba.length-1;
a>=0;
a--)this.add(ba[a])
}
}
sc.prototype.add=function(kb)
{
if(!this.contains(kb))
{
this[":"+kb]=1;
this.size++
}
}
;
sc.prototype.remove=function(kb)
{
if(this.contains(kb))
{
delete this[":"+kb];
this.size--
}
}
;
sc.prototype.contains=function(kb)
{
return this[":"+kb]==1
}
;
function Td()
{
return false
}
;
var q="http://www.google.com/mapfiles/";
var De="http://maps.google.com";
var Rc=new Array("q","ll","spn","z","t","sll","sspn","vp","f","output","deb");
function Ja()
{
this.args=new Object();
this.reset()
}
Ja.prototype.setValue=function(ja,Q)
{
this.args[ja]=Q
}
;
Ja.prototype.setAllMapValues=function(p)
{
this.setValue("ll",this.getLatLngArg(p.getCenterLatLng()));
this.setValue("spn",this.getSpanArg(p.getSpanLatLng()));
this.setValue("z",p.zoomLevel);
this.setValue("t",this.getSpecArg(p.spec))
}
;
Ja.prototype.getLatLngArg=function(j)
{
return cd(j.y)+","+cd(j.x)
}
;
Ja.prototype.getSpanArg=function(Ma)
{
return cd(Ma.height)+","+cd(Ma.width)
}
;
Ja.prototype.getSpecArg=function(Ub)
{
return Ub==Cc?null:"i"
}
;
Ja.prototype.reset=function()
{
for(var a=0;
a<Rc.length;
a++)
{
this.args[Rc[a]]=null
}
if(window._df&&window._df.length>0)
{
this.setValue("deb",window._df)
}
}
;
Ja.prototype.getURL=function(Mh)
{
var Kd=new Array();
for(var a=0;
a<Rc.length;
a++)
{
var ja=Rc[a];
if(this.args[ja])
{
Kd.push(ja+"="+encodeURIComponent(this.args[ja]))
}
}
var lb="/maps";
if(Kd.length>0)lb+="?"+Kd.join("&");
if(Mh)return De+lb;
return lb
}
;
function cd(fb)
{
if(fb.toFixed)
{
return fb.toFixed(6).toString()
}
else
{
return fb.toString()
}
}
;
var db=new Object();
function qa(F,Ba)
{
this.id=F;
this.ticketClass=Ba
}
qa.create=function(Ba)
{
if(!Ba)Ba="_dtc";
if(!db[Ba])db[Ba]=1;
else db[Ba]++;
return new qa(db[Ba],Ba)
}
;
qa.invalidateAll=function()
{
for(var a in db)
{
try
{
db[a]++
}
catch(b)
{
}
}
}
;
qa.invalidate=function(xa)
{
db[xa]++
}
;
qa.prototype.isValid=function()
{
return db[this.ticketClass]==this.id
}
;
function Yd()
{
}
Yd.create=function()
{
if(m.type==1)
{
var Vd=m.version==5?"Microsoft.XMLHTTP":"Msxml2.XMLHTTP";
return new ActiveXObject(Vd)
}
else
{
return new XMLHttpRequest()
}
}
;
function Z(Vc)
{
if(m.type==1)
{
this.stylesheet=Vc
}
else if(m.type!=3)
{
this.processor=new XSLTProcessor();
this.processor.importStylesheet(Vc)
}
}
Z.cache_=new Object();
Z.create=function(Vc)
{
return new Z(Vc)
}
;
Z.getCached=function(lb)
{
return Z.cache_[lb]
}
;
Z.cache=function(lb,Tf)
{
Z.cache_[lb]=Tf
}
;
Z.prototype.transformToHTML=function(qc,vb)
{
if(this.stylesheet)
{
vb.innerHTML=qc.transformNode(this.stylesheet)
}
else
{
var ai=this.processor.transformToFragment(qc,window.document);
vb.innerHTML="";
vb.appendChild(ai)
}
}
;
Z.asynchronousTransform=function(qc,vb,kc,Nc,Ba)
{
if(m.type==3)return;
var cc=Z.getCached(kc);
if(cc)
{
cc.transformToHTML(qc,vb);
if(Nc)Nc();
return
}
var yc=qa.create(Ba);
var sa=Yd.create();
nd('<a href="'+kc.xmlEscape()+'">'+kc.xmlEscape()+"</a>",0);
sa.open("GET",kc,true);
sa.onreadystatechange=function()
{
if(sa.readyState==4)
{
if(yc.isValid())
{
try
{
var Db=sa.responseXML;
var cc=Z.create(Db);
Z.cache(kc,cc);
cc.transformToHTML(qc,vb);
if(Nc)Nc()
}
catch(b)
{
}
}
}
}
;
sa.send(null)
}
;
function ah(c)
{
while(c.hasChildNodes())
{
c.removeChild(c.lastChild)
}
}
function lg(str)
{
if(m.type==1)
{
var Vd=m.version==5?"Microsoft.XmlDom":"Msxml2.XmlDom";
var Db=new ActiveXObject(Vd);
Db.loadXML(str);
return Db
}
else
{
return(new DOMParser()).parseFromString(str,"text/xml")
}
}
;
function nd(Yh,ka)
{
}
Object.prototype.trace=function(Yh,ka,oi)
{
}
;
function I()
{
}
I.start=function()
{
}
;
I.end=function()
{
}
;
I.addTime=function(ve)
{
}
;
function n(x,l)
{
this.x=x;
this.y=l
}
n.prototype.toString=function()
{
return"("+this.x+", "+this.y+")"
}
;
n.prototype.equals=function(S)
{
if(!S)return false;
return this.x==S.x&&this.y==S.y
}
;
n.prototype.distanceFrom=function(S)
{
var va=this.x-S.x;
var za=this.y-S.y;
return Math.sqrt(va*va+za*za)
}
;
n.prototype.approxEquals=function(S)
{
if(!S)return false;
return zc(this.x,S.x)&&zc(this.y,S.y)
}
;
function M(g,k)
{
this.width=g;
this.height=k
}
M.prototype.toString=function()
{
return"("+this.width+", "+this.height+")"
}
;
M.prototype.equals=function(S)
{
if(!S)return false;
return this.width==S.width&&this.height==S.height
}
;
M.prototype.approxEquals=function(S)
{
if(!S)return false;
return zc(this.width,S.width)&&zc(this.height,S.height)
}
;
function zc(rg,wh)
{
return Math.round(rg*1000000)==Math.round(wh*1000000)
}
function U(Uh,Pg,ed,Jc)
{
this.minX=Uh;
this.minY=Pg;
this.maxX=ed;
this.maxY=Jc
}
U.prototype.toString=function()
{
return"Bounds("+this.minX+","+this.minY+","+this.maxX+","+this.maxY+")"
}
;
U.prototype.containsSegment=function(md,Pc)
{
if(this.minX>md.x&&this.minX>Pc.x)return false;
if(this.maxX<md.x&&this.maxX<Pc.x)return false;
if(this.minY>md.y&&this.minY>Pc.y)return false;
if(this.maxY<md.y&&this.maxY<Pc.y)return false;
return true
}
;
U.prototype.containsBounds=function(pd)
{
return this.minX<pd.minX&&(this.maxX>pd.maxX&&(this.minY<pd.minY&&this.maxY>pd.maxY))
}
;
function Wb(Yf)
{
this.ticks=Yf;
this.tick=0
}
Wb.prototype.reset=function()
{
this.tick=0
}
;
Wb.prototype.next=function()
{
this.tick++;
var Ta=Math.PI*(this.tick/this.ticks-0.5);
return(Math.sin(Ta)+1)/2
}
;
Wb.prototype.more=function()
{
return this.tick<this.ticks
}
;
function Tg(Q,ba)
{
if(!ba)ba=new Array();
while(Q>=32)
{
ba.push(String.fromCharCode((32|Q&31)+63));
Q>>=5
}
ba.push(String.fromCharCode(Q+63));
return ba
}
function Mb(Q,ba)
{
return Tg(Q<0?~(Q<<1):Q<<1,ba)
}
function Lb(gh,yd,ie,Dd)
{
this.numLevels=ie;
this.zoomFactor=Dd;
this.decodePolyline(gh);
this.decodeLevels(yd);
this.minTolerance=1.0E-5
}
Lb.prototype.decodePolyline=function(Vb)
{
I.start("Polyline","decodePolyline");
var Ih=Vb.length;
var pb=0;
var ba=new Array();
var Ka=0;
var Pa=0;
while(pb<Ih)
{
var ub;
var oc=0;
var Fa=0;
do
{
ub=Vb.charCodeAt(pb++)-63;
Fa|=(ub&31)<<oc;
oc+=5
}
while(ub>=32);
Ka=Ka+(Fa&1?~(Fa>>1):Fa>>1);
ba.push(Ka);
oc=0;
Fa=0;
do
{
ub=Vb.charCodeAt(pb++)-63;
Fa|=(ub&31)<<oc;
oc+=5
}
while(ub>=32);
Pa=Pa+(Fa&1?~(Fa>>1):Fa>>1);
ba.push(Pa)
}
this.points=ba;
this.numPoints=this.points.length>>1;
I.end("Polyline","decodePolyline")
}
;
Lb.prototype.decodeLevels=function(Vb)
{
I.start("Polyline","decodeLevels");
var Xc=new Array(this.numLevels);
for(var qe=0;
qe<this.numLevels;
++qe)Xc[qe]=new Array();
var a=0;
for(var V=0;
V<this.numPoints;
++V)
{
var wb=Vb.charCodeAt(a++)-63;
while(wb>=0)
{
var Ob=Xc[wb--];
while(Ob.length<V)
{
Ob.push(V)
}
}
}
for(var wb=0;
wb<this.numLevels;
++wb)
{
var Ob=Xc[wb];
for(var V=Ob.length;
V<this.numPoints;
++V)
{
Ob.push(this.numPoints)
}
}
this.nextPointIndexAtLevel=Xc;
I.end("Polyline","decodeLevels")
}
;
Lb.prototype.getPoint=function(pb,j)
{
if(j==null)j=new n();
pb<<=1;
j.y=this.points[pb]*1.0E-5;
j.x=this.points[pb+1]*1.0E-5;
return j
}
;
Lb.prototype.getVectors=function(A,J,v)
{
I.start("Polyline","getVectors");
if(v==null)v=new Array();
this.getVectorsHelper(A,0,this.numPoints-1,this.numLevels-1,J,v);
I.end("Polyline","getVectors");
return v
}
;
Lb.prototype.getVectorsHelper=function(A,Xh,tb,ka,Gf,v)
{
var vc=7.62939453125E-6;
for(var a=ka;
a>0;
--a)
{
vc*=this.zoomFactor
}
var _expandedBounds=new U();
_expandedBounds.minX=Math.floor((A.minX-vc)*100000);
_expandedBounds.minY=Math.floor((A.minY-vc)*100000);
_expandedBounds.maxX=Math.ceil((A.maxX+vc)*100000);
_expandedBounds.maxY=Math.ceil((A.maxY+vc)*100000);
var bc=Xh;
var mc;
var la=new n();
la.y=this.points[bc<<1];
la.x=this.points[(bc<<1)+1];
var na=new n();
while((mc=this.nextPointIndexAtLevel[ka][bc])<=tb)
{
na.y=this.points[mc<<1];
na.x=this.points[(mc<<1)+1];
if(_expandedBounds.containsSegment(la,na))
{
if(ka>Gf)
{
this.getVectorsHelper(A,bc,mc,ka-1,Gf,v)
}
else
{
v.push(la.y*1.0E-5);
v.push(la.x*1.0E-5);
v.push(na.y*1.0E-5);
v.push(na.x*1.0E-5)
}
}
var Zd=la;
la=na;
na=Zd;
bc=mc
}
}
;
var ki=q+"markerTransparent.png";
function d(R,Ub,g,k,eg,ze)
{
if(!R)return;
this.container=R;
this.disablePopups=eg;
this.disableDragging=ze;
this.zoomLevel=0;
this.topLeftTile=null;
this.currentPanOffset=new M(0,0);
this.centerBitmap=new n(0,0);
this.tilePaddingOffset=new M(0,0);
this.tableSize=new M(0,0);
this.overlays=new Array();
this.locations=new Array();
this.panDistance=new M(0,0);
this.panKeys=new sc();
this.setSpecification(Ub);
this.container.style.overflow="hidden";
if(this.container.style.position!="absolute")this.container.style.position="relative";
this.container.style.backgroundColor=this.spec.backgroundColor;
if(!g||!k)
{
g=this.container.offsetWidth;
k=this.container.offsetHeight
}
this.viewSize=new M(g,k);
if(m.type==1)
{
this.container.onresize=this.eventHandler("onResize");
window.onblur=this.eventHandler("onWindowBlur")
}
else
{
window.addEventListener("resize",this.eventHandler("onResize"),false);
window.addEventListener("blur",this.eventHandler("onWindowBlur"),false)
}
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 U(-Infinity,-Infinity,Infinity,Infinity);
this.div.appendChild(this.directionsDiv);
this.dragObject=new Na(this.div,0,0);
this.dragObject.ondrag=this.eventHandler("onDrag");
this.dragObject.ondragstart=this.eventHandler("onDragStart");
this.dragObject.ondragend=this.eventHandler("onDragEnd");
this.div.ondblclick=this.eventHandler("onDoubleClick");
this.dragObject.onclick=this.eventHandler("onClick");
if(ze)
{
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
}
d.prototype.createMapDiv=function()
{
var i=document.createElement("div");
i.style.position="absolute";
i.style.top="0px";
i.style.left="0px";
i.style.zIndex=0;
i.style.backgroundColor=this.spec.backgroundColor;
return i
}
;
d.prototype.loadTileImages=function()
{
while(this.tileImages.length>this.tableSize.width)
{
var Xe=this.tileImages.pop();
for(var a=0;
a<Xe.length;
a++)
{
this.div.removeChild(Xe[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 G=this.tileImages[a].length;
G<this.tableSize.height;
G++)
{
var f=zb.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,G)
}
}
}
;
d.prototype.deleteTiles=function()
{
if(this.tileImages)
{
for(var a=0;
a<this.tileImages.length;
a++)
{
if(this.tileImages[a])
{
for(var G=0;
G<this.tileImages[a].length;
G++)
{
this.div.removeChild(this.tileImages[a][G])
}
}
}
}
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 M(0,0);
var wa=this.spec.getLatLng(this.centerBitmap.x-this.viewSize.width/2,this.centerBitmap.y-this.viewSize.height/2,this.zoomLevel);
var ra=this.spec.getLatLng(this.centerBitmap.x+this.viewSize.width/2,this.centerBitmap.y+this.viewSize.height/2,this.zoomLevel);
e.width=Math.abs(ra.x-wa.x);
e.height=Math.abs(ra.y-wa.y);
return e
}
;
d.prototype.getCenterLatLng=function(e)
{
if(!e)e=new n(0,0);
if(this.centerLatLng)
{
e.x=this.centerLatLng.x;
e.y=this.centerLatLng.y;
return e
}
if(this.lastLatLng)
{
var W=this.spec.getBitmapCoordinate(this.lastLatLng.y,this.lastLatLng.x,this.zoomLevel);
if(W.equals(this.centerBitmap))
{
e.x=this.lastLatLng.x;
e.y=this.lastLatLng.y;
return e
}
}
var j=this.spec.getLatLng(this.centerBitmap.x,this.centerBitmap.y,this.zoomLevel);
e.x=j.x;
e.y=j.y;
return e
}
;
d.prototype.getBoundsBitmap=function(e)
{
if(!e)e=new U(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 wa=this.spec.getLatLng(e.minX,e.minY,this.zoomLevel);
var ra=this.spec.getLatLng(e.maxX,e.maxY,this.zoomLevel);
e.minX=wa.x;
e.minY=ra.y;
e.maxX=ra.x;
e.maxY=wa.y;
return e
}
;
d.prototype.calculateTileMeasurements=function()
{
var sh=Math.ceil(this.viewSize.width/this.spec.tileSize)+2;
var Rg=Math.ceil(this.viewSize.height/this.spec.tileSize)+2;
this.tableSize.width=sh;
this.tableSize.height=Rg;
var sb=Math.floor((this.tableSize.width*this.spec.tileSize-this.viewSize.width)/2);
var jb=Math.floor((this.tableSize.height*this.spec.tileSize-this.viewSize.height)/2);
this.tilePaddingOffset.width=sb;
this.tilePaddingOffset.height=jb
}
;
d.prototype.configureImage=function(f,x,l)
{
var Ag=(this.currentPanOffset.width+x)*this.spec.tileSize;
var ci=(this.currentPanOffset.height+l)*this.spec.tileSize;
var K=-this.tilePaddingOffset.width+Ag;
var top=-this.tilePaddingOffset.height+ci;
if(f.tileLeft!=K||f.tileTop!=top)
{
f.style.left=K+"px";
f.style.top=top+"px";
f.tileLeft=K;
f.tileTop=top
}
if(!this.topLeftTile)
{
f.src=this.spec.emptyTileURL
}
else
{
var C=this.spec.getTileURL(this.topLeftTile.x+x,this.topLeftTile.y+l,this.zoomLevel);
if(f.src!=C)
{
f.src=this.spec.emptyTileURL;
f.src=C;
f.style.display=""
}
}
}
;
d.prototype.onDrag=function()
{
if(!this.topLeftTile)return;
this.onMove();
this.rotateTiles()
}
;
var _moveOffset=new M(0,0);
d.prototype.onMove=function()
{
this.centerLatLng=null;
var Aa=this.getCurrentOffset(_moveOffset);
var x=this.topLeftTile.x*this.spec.tileSize+Math.floor(this.viewSize.width/2)+this.tilePaddingOffset.width-Aa.width;
var l=this.topLeftTile.y*this.spec.tileSize+Math.floor(this.viewSize.height/2)+this.tilePaddingOffset.height-Aa.height;
this.centerBitmap.x=x;
this.centerBitmap.y=l;
this.drawDirections(this.directions,this.directionsDiv);
if(this.onpan)this.onpan(x,l)
}
;
var _rotateOffset=new M(0,0);
d.prototype.rotateTiles=function()
{
var Aa=this.getCurrentOffset(_rotateOffset);
if(Math.abs(this.dragObject.left)>10000000||Math.abs(this.dragObject.top)>10000000)
{
this.cancelPan();
this.centerAtBitmap(this.centerBitmap);
return
}
while(Aa.width<-this.tilePaddingOffset.width/2)
{
this.rotateRight();
this.getCurrentOffset(Aa)
}
while(Aa.width>this.tilePaddingOffset.width/2)
{
this.rotateLeft();
this.getCurrentOffset(Aa)
}
while(Aa.height<-this.tilePaddingOffset.height/2)
{
this.rotateDown();
this.getCurrentOffset(Aa)
}
while(Aa.height>this.tilePaddingOffset.height/2)
{
this.rotateUp();
this.getCurrentOffset(Aa)
}
}
;
d.prototype.rotateLeft=function()
{
this.currentPanOffset.width--;
this.topLeftTile.x--;
var Qa=this.tileImages.pop();
if(Qa)
{
this.tileImages.unshift(Qa);
for(var a=0;
a<Qa.length;
a++)
{
this.configureImage(Qa[a],0,a)
}
}
}
;
d.prototype.rotateRight=function()
{
this.currentPanOffset.width++;
this.topLeftTile.x++;
var Qa=this.tileImages.shift();
this.tileImages.push(Qa);
var x=this.tileImages.length-1;
for(var a=0;
a<Qa.length;
a++)
{
this.configureImage(Qa[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 l=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,l)
}
}
;
d.prototype.getTotalOffset=function(c)
{
if(!c)return new M(0,0);
var kf=this.getTotalOffset(c.offsetParent);
return new M(kf.width+c.offsetLeft,kf.height+c.offsetTop)
}
;
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 j=this.getRelativeClickPoint(b,this.container);
var xc=Math.floor(this.viewSize.width/2)-j.x;
var Zb=Math.floor(this.viewSize.height/2)-j.y;
this.pan(xc,Zb)
}
;
d.prototype.onClick=function(b)
{
this.closeInfoWindow()
}
;
d.prototype.getRelativeClickPoint=function(b,wg,e)
{
if(!e)e=new n();
if(b.x||b.y)
{
e.x=b.x;
e.y=b.y
}
else
{
var hd=this.getTotalOffset(wg);
e.x=b.pageX-hd.width;
e.y=b.pageY-hd.height
}
return e
}
;
d.prototype.reconfigureAllImages=function()
{
if(this.tileImages.length==0)return;
var Yc=new Array();
for(var a=0;
a<this.tileImages.length;
a++)
{
for(var G=0;
G<this.tileImages[a].length;
G++)
{
f=this.tileImages[a][G];
f.coordX=a;
f.coordY=G;
var Hf=Math.min(a,this.tileImages.length-a-1);
var Te=Math.min(G,this.tileImages[a].length-G-1);
if(Hf==0||Te==0)
{
f.priority=0
}
else
{
f.priority=Hf+Te
}
Yc.push(f)
}
}
Yc.sort(function(Dg,Sh)
{
return Sh.priority-Dg.priority
}
);
for(var a=0;
a<Yc.length;
a++)
{
var f=Yc[a];
if(m.type==1)this.div.removeChild(f);
this.configureImage(f,f.coordX,f.coordY);
if(m.type==1)this.div.appendChild(f)
}
}
;
d.prototype.pan=function(va,za)
{
if(!this.topLeftTile)return;
var Va=Math.sqrt(va*va+za*za);
var uh=Math.max(10,Math.floor(Va/20));
this.panSiner=new Wb(uh);
this.panSiner.reset();
this.panDistance.width=va;
this.panDistance.height=za;
this.panStart=new n(this.dragObject.left,this.dragObject.top);
this.doPan()
}
;
d.prototype.doPan=function()
{
var Ta=this.panSiner.next();
this.dragObject.moveTo(this.panStart.x+this.panDistance.width*Ta,this.panStart.y+this.panDistance.height*Ta);
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(j)
{
if(!this.topLeftTile)return;
this.centerLatLng=new n(j.x,j.y);
this.lastLatLng=this.centerLatLng;
var j=this.spec.getBitmapCoordinate(this.centerLatLng.y,this.centerLatLng.x,this.zoomLevel);
this.recenterOrPanToBitmap(j)
}
;
d.prototype.recenterOrPanToBitmap=function(j)
{
if(!this.topLeftTile)return;
var xc=this.centerBitmap.x-j.x;
var Zb=this.centerBitmap.y-j.y;
if(xc==0&&Zb==0)return;
if(Math.abs(xc)<this.viewSize.width&&Math.abs(Zb)<this.viewSize.height)
{
this.pan(xc,Zb);
return
}
this.centerAtBitmap(j);
this.onStateChanged()
}
;
d.prototype.centerAndZoom=function(Hc,J)
{
var Je=false;
if(J!=this.zoomLevel)
{
var Xd=this.zoomLevel;
this.zoomLevel=J;
Je=true
}
this.centerAtLatLng(Hc);
if(Je&&this.onzoom)this.onzoom(Xd,this.zoomLevel);
this.onStateChanged()
}
;
d.prototype.centerAtLatLng=function(j)
{
this.centerLatLng=new n(j.x,j.y);
this.lastLatLng=this.centerLatLng;
var j=this.spec.getBitmapCoordinate(this.centerLatLng.y,this.centerLatLng.x,this.zoomLevel);
this.centerAtBitmap(j)
}
;
d.prototype.centerAtBitmap=function(j)
{
this.centerBitmap.x=j.x;
this.centerBitmap.y=j.y;
var K=j.x-Math.floor(this.viewSize.width/2)-this.tilePaddingOffset.width;
var top=j.y-Math.floor(this.viewSize.height/2)-this.tilePaddingOffset.height;
var Qb=Math.floor(K/this.spec.tileSize);
var gc=Math.floor(top/this.spec.tileSize);
var sb=Qb*this.spec.tileSize-K;
var jb=gc*this.spec.tileSize-top;
if(sb<-this.tilePaddingOffset.width/2)
{
Qb++;
sb+=this.spec.tileSize
}
else if(sb>this.tilePaddingOffset.width/2)
{
Qb--;
sb-=this.spec.tileSize
}
if(jb<-this.tilePaddingOffset.height/2)
{
gc++;
jb+=this.spec.tileSize
}
else if(jb>this.tilePaddingOffset.height/2)
{
gc--;
jb-=this.spec.tileSize
}
if(!this.topLeftTile)
{
this.topLeftTile=new n(Qb,gc)
}
else
{
this.topLeftTile.x=Qb;
this.topLeftTile.y=gc
}
this.currentPanOffset.width=0;
this.currentPanOffset.height=0;
this.reconfigureAllImages();
this.repositionOverlays();
this.dragObject.moveTo(sb,jb);
this.onStateChanged()
}
;
d.prototype.addStateListener=function(bh)
{
if(!this.stateListeners)this.stateListeners=new Array();
this.stateListeners.push(bh)
}
;
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 M(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(ab)
{
if(this.spec==ab)return;
var wd=this.spec;
var B=this.getCenterLatLng();
this.setSpecification(ab);
this.div.style.backgroundColor=this.spec.backgroundColor;
if(wd.tileSize!=ab.tileSize)
{
this.topLeftTile=null;
this.initializeMap()
}
this.centerAtLatLng(B);
if(this.onspecificationchange)this.onspecificationchange(wd,ab)
}
;
d.prototype.setSpecification=function(ab)
{
this.spec=ab;
var nh=new Image();
nh.src=this.spec.emptyTileURL
}
;
d.prototype.zoomTo=function(ka)
{
if(!this.topLeftTile)return;
if(ka>=this.spec.numZoomLevels)
{
ka=this.spec.numZoomLevels-1
}
else if(ka<0)
{
ka=0
}
var Xd=this.zoomLevel;
if(ka!=Xd)
{
var B=this.getCenterLatLng();
this.centerAndZoom(B,ka)
}
}
;
d.prototype.toggleTileBorders=function()
{
if(this.tileImages)
{
for(var a=0;
a<this.tileImages.length;
a++)
{
if(this.tileImages[a])
{
for(var G=0;
G<this.tileImages[a].length;
G++)
{
var f=this.tileImages[a][G];
if(f.hasBorder)
{
f.style.border="0";
f.hasBorder=false
}
else
{
f.style.border="1px solid black";
f.hasBorder=true
}
}
}
}
}
}
;
d.prototype.addOverlay=function(ia)
{
this.overlays.push(ia);
this.locations.clear();
for(var a=0;
a<this.overlays.length;
a++)
{
var ia=this.overlays[a];
if(ia.locations)
{
for(var G=0;
G<ia.locations.length;
G++)
{
var r=ia.locations[G];
if(r.icon.iconClass.name!="noicon")
{
this.locations.push(r)
}
}
}
}
this.locations.sort(d.orderLocations);
for(var a=0;
a<this.locations.length;
a++)
{
var r=this.locations[a];
if(!r.marker)
{
r.marker=this.createLocalMarker(r);
this.setMarkerPosition(r.marker,r.icon.iconClass,r.point)
}
r.marker.icon.style.zIndex=10+a;
r.marker.transparentIcon.style.zIndex=30+a
}
if(this.locations.length==1)
{
this.clearInfoWindowArgs(r.xml);
this.showInfoWindow(this.locations[0])
}
}
;
function cb(X,Ib,Ua,p,Sb)
{
this.icon=X;
this.transparentIcon=Ib;
this.shadow=Ua;
this.layer=[X,Ib,Ua];
this.map=p;
this.mouseTarget=Sb
}
cb.prototype.addLayer=function(f)
{
this.layer.push(f)
}
;
cb.prototype.setPosition=function(x,l)
{
for(var a=0;
a<this.layer.length;
++a)
{
this.layer[a].style.left=yb(x);
this.layer[a].style.top=yb(l)
}
}
;
cb.prototype.appendTo=function(i)
{
for(var a=0;
a<this.layer.length;
++a)
{
i.appendChild(this.layer[a])
}
}
;
cb.prototype.removeFrom=function(i)
{
for(var a=0;
a<this.layer.length;
++a)
{
i.removeChild(this.layer[a])
}
}
;
cb.prototype.hide=function()
{
for(var a=0;
a<this.layer.length;
++a)
{
this.layer[a].style.display="none"
}
}
;
cb.prototype.show=function()
{
for(var a=0;
a<this.layer.length;
++a)
{
this.layer[a].style.display=""
}
}
;
cb.prototype.isVisible=function()
{
return this.layer[0].style.display!="none"
}
;
d.prototype.createLocalMarker=function(r)
{
var pa=this.createLocationMarker(r.icon.image,r.icon.iconClass);
var h=this;
pa.mouseTarget.onmousedown=function(b)
{
return h.onIconMouseDown(r,b)
}
;
return pa
}
;
var _imageMapCounter=0;
d.prototype.createLocationMarker=function(We,s)
{
var X=o.create(We,s.width,s.height,0,0,10,false,"noprint");
var Ib=o.create(ki,s.width,s.height,0,0,30,false,"noprint");
var Ua=o.create(s.shadowURL,s.shadowWidth,s.height,0,0,3,false,"noprint");
var ag=m.type==2?"ff":"ie";
var Qf=zb.create(We.replace(/\.png$/,ag+".gif"),s.width,s.height,0,0,10,false,"noscreen");
var kg=s.shadowURL.replace(/[^\/]*$/,"dithshadow.gif");
var Ig=zb.create(kg,s.shadowWidth,s.height,0,0,3,false,"noscreen");
var p=null;
var Sb=Ib;
if(m.type==2)
{
var lf="map"+_imageMapCounter;
_imageMapCounter++;
p=document.createElement("map");
p.setAttribute("name",lf);
var z=document.createElement("area");
z.setAttribute("shape","poly");
z.setAttribute("alt","");
z.setAttribute("coords",s.imageMap);
z.setAttribute("href","javascript:void(0)");
Sb=z;
p.appendChild(z);
this.div.appendChild(p);
Ib.setAttribute("usemap","#"+lf)
}
else
{
Sb.style.cursor="pointer"
}
var Dc=new cb(X,Ib,Ua,p,Sb);
Dc.addLayer(Qf);
if(m.type!=2)
{
Dc.addLayer(Ig)
}
Dc.appendTo(this.div);
return Dc
}
;
d.prototype.clearOverlays=function()
{
this.lastPageCenter=this.getCenterLatLng();
this.lastPageZoom=this.zoomLevel;
for(var a=0;
a<this.locations.length;
a++)
{
var r=this.locations[a];
r.marker.removeFrom(this.div);
if(r.marker.map)this.div.removeChild(r.marker.map);
r.marker=null
}
this.closeInfoWindow();
this.overlays.clear();
this.locations.clear();
this.directions=null;
this.drawDirections(null,this.directionsDiv)
}
;
d.prototype.getDivCoordinate=function(x,l,e)
{
if(!e)e=new n(0,0);
var Oh=x-this.topLeftTile.x*this.spec.tileSize-this.tilePaddingOffset.width+this.currentPanOffset.width*this.spec.tileSize;
var zg=l-this.topLeftTile.y*this.spec.tileSize-this.tilePaddingOffset.height+this.currentPanOffset.height*this.spec.tileSize;
e.x=Oh;
e.y=zg;
return e
}
;
d.orderLocations=function(af,Ae)
{
if(af.point.y>Ae.point.y)return-1;
if(af.point.y<Ae.point.y)return 1;
return 0
}
;
d.prototype.repositionOverlays=function()
{
for(var a=0;
a<this.locations.length;
a++)
{
var Sa=this.locations[a];
this.setMarkerPosition(Sa.marker,Sa.icon.iconClass,Sa.point)
}
this.drawDirections(this.directions,this.directionsDiv,true);
if(!this.disablePopups)
{
this.repositionInfoWindow();
if(m.type!=1&&this.infoWindow.hasMask())this.addMarkersToInfoWindowMask()
}
}
;
d.prototype.setMarkerPosition=function(pa,s,If)
{
var Pb=this.spec.getBitmapCoordinate(If.y,If.x,this.zoomLevel);
var wc=this.getDivCoordinate(Pb.x,Pb.y);
var x=wc.x-s.pointCoord.x;
var l=wc.y-s.pointCoord.y;
pa.setPosition(x,l)
}
;
d.prototype.loadVPage=function(E,Bf,Ng)
{
this.clearOverlays();
var B=Bf?Bf:E.center;
var P=Ng;
if(P==null&&E.viewSpan)
{
P=this.spec.getLowestZoomLevel(E.viewSpan,this.viewSize.width,this.viewSize.height)
}
this.lastPageZoom=P;
this.lastPageCenter=B;
if(B)
{
if(!this.topLeftTile||P!=null&&P!=this.zoomLevel)
{
if(!P)P=4;
this.centerAndZoom(B,P)
}
else
{
this.recenterOrPanToLatLng(B)
}
}
for(var a=0;
a<E.overlays.length;
a++)
{
this.addOverlay(E.overlays[a])
}
this.directions=E.directions;
this.drawDirections(this.directions,this.directionsDiv);
this.onStateChanged()
}
;
d.prototype.registerKeyHandlers=function(C)
{
if(m.type==1)
{
C.onkeydown=this.eventHandler("onKeyPress");
C.onkeyup=this.eventHandler("onKeyUp")
}
else
{
C.addEventListener("keypress",this.eventHandler("onKeyPress"),false);
C.addEventListener("keyup",this.eventHandler("onKeyUp"),false)
}
}
;
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 Wb(100);
this.continuousPanTimeout=this.setTimeout("this.doContinuousPan()",5)
}
}
;
d.prototype.doContinuousPan=function()
{
if(this.panKeys.size>0)
{
var Qd=(this.panKeys.contains(37)?1:0)+(this.panKeys.contains(39)?-1:0);
var te=(this.panKeys.contains(38)?1:0)+(this.panKeys.contains(40)?-1:0);
var Ta=1;
if(this.panSiner.more())Ta=this.panSiner.next();
var fb=Qd>0?Math.floor:Math.ceil;
var va=fb(7*Ta*Qd+5*Qd);
fb=te>0?Math.floor:Math.ceil;
var za=fb(7*Ta*te+5*te);
this.dragObject.moveTo(this.dragObject.left+va,this.dragObject.top+za);
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 sc()
}
}
;
d.prototype.onIconMouseDown=function(r,b)
{
aa(b);
if(this.onmousedown)this.onmousedown();
this.clearInfoWindowArgs(r.xml);
this.showInfoWindow(r)
}
;
d.prototype.clearInfoWindowArgs=function(da)
{
da.setAttribute("arg0","");
da.setAttribute("arg1","");
da.setAttribute("arg2","")
}
;
d.prototype.infoWindowNavigate=function(Mg,Qe,Jf,Ye)
{
if(!this.openLocation||this.disablePopups)return;
if(Qe)this.openLocation.xml.setAttribute("arg0",Qe);
if(Jf)this.openLocation.xml.setAttribute("arg1",Jf);
if(Ye)this.openLocation.xml.setAttribute("arg2",Ye);
this.onInfoWindowLoad=Mg;
this.showInfoWindow(this.openLocation)
}
;
var _infoBitmapCoord=new n(0,0);
var _infoDivCoord=new n(0,0);
d.prototype.showInfoWindow=function(r)
{
if(this.disablePopups)return;
if(!r.infoStyle)return;
this.openLocation=r;
var W=this.spec.getBitmapCoordinate(r.point.y,r.point.x,this.zoomLevel,_infoBitmapCoord);
var ya=this.getDivCoordinate(W.x,W.y,_infoDivCoord);
this.infoWindow.point=r.point;
this.infoWindow.iconClass=r.icon.iconClass;
var h=this;
var Be=function()
{
h.showSizedInfoWindow(ya.x,ya.y,r.icon.iconClass)
}
;
if(m.type!=3)
{
Z.asynchronousTransform(r.xml,this.infoWindow.offscreenArea,r.infoStyle,Be)
}
else
{
r.toHTML(this.infoWindow.offscreenArea);
Be()
}
}
;
d.prototype.addMarkersToInfoWindowMask=function()
{
if(this.disablePopups||(!this.infoWindow.isVisible()||!this.infoWindow.point))return;
this.infoWindow.clearMaskMap();
var Da=new n(this.infoWindow.getOffsetLeft(),this.infoWindow.getOffsetTop());
var hb=new n(Da.x+this.infoWindow.getTotalWidth(),Da.y+this.infoWindow.getTotalHeight());
for(var a=0;
a<this.locations.length;
a++)
{
var pa=this.locations[a].marker;
if(pa.icon.offsetTop>hb.y)break;
this.addMarkerToInfoWindowMask(Da,hb,pa)
}
if(this.directionsMarkersAreVisible())
{
this.addMarkerToInfoWindowMask(Da,hb,this.directionsStart);
this.addMarkerToInfoWindowMask(Da,hb,this.directionsEnd)
}
}
;
d.prototype.addMarkerToInfoWindowMask=function(Da,hb,pa)
{
var X=pa.icon;
if(X.offsetLeft+X.width>=Da.x&&(X.offsetLeft<=hb.x&&(X.offsetTop+X.height>=Da.y&&X.offsetTop<=hb.y)))
{
var ne=N.get("local").translateImageMapArray(X.offsetLeft-Da.x,X.offsetTop-Da.y);
this.infoWindow.addAreaToMaskMap(ne,pa.mouseTarget.onmousedown)
}
}
;
d.prototype.showSizedInfoWindow=function(x,l,s,ad)
{
qa.invalidate("infoWindowOffscreen");
var yc=qa.create("infoWindowOffscreen");
this.infoWindow.prepareOffscreen();
var p=this;
var Bh=function()
{
if(yc.isValid())
{
p.infoWindow.flipOffscreenArea();
p.infoWindow.sizeToContent(ad);
p.infoWindow.positionAt(x,l,s);
if(m.type!=1&&p.infoWindow.hasMask())p.addMarkersToInfoWindowMask();
p.infoWindow.show();
p.panToInfoWindow();
if(p.onInfoWindowLoad)
{
p.onInfoWindowLoad();
p.onInfoWindowLoad=null
}
}
}
;
window.setTimeout(Bh,0)
}
;
d.prototype.showMapBlowup=function(j,s)
{
if(this.disablePopups)return;
var W=this.spec.getBitmapCoordinate(j.y,j.x,this.zoomLevel,_infoBitmapCoord);
var ya=this.getDivCoordinate(W.x,W.y,_infoDivCoord);
this.infoWindow.point=j;
this.infoWindow.iconClass=s?s:N.get("noicon");
var R=document.createElement("div");
R.style.border="1px solid silver";
R.style.width="200px";
R.style.height="200px";
var jd=new d(R,this.spec,200,200,true,true);
jd.directions=this.directions;
jd.centerAndZoom(j,1);
this.onspecificationchange=function(wd,ab)
{
jd.switchSpecification(ab)
}
;
this.infoWindow.clearOffscreenArea();
this.infoWindow.offscreenArea.appendChild(R);
this.showSizedInfoWindow(ya.x,ya.y,this.infoWindow.iconClass,203);
return jd
}
;
d.prototype.createSpecChangeLink=function(p,Fb,Ub)
{
var Qg=function()
{
p.switchSpecification(Ub)
}
;
return Yg(Fb,Qg)
}
;
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 W=this.spec.getBitmapCoordinate(this.infoWindow.point.y,this.infoWindow.point.x,this.zoomLevel,_infoBitmapCoord);
var ya=this.getDivCoordinate(W.x,W.y,_infoDivCoord);
var ma=new n(this.centerBitmap.x,this.centerBitmap.y);
var K=this.infoWindow.left+(W.x-ya.x);
var top=this.infoWindow.top+(W.y-ya.y);
var Pf=Math.floor(this.viewSize.width/2);
var td=Math.floor(this.viewSize.height/2);
ma.y=Math.min(ma.y,top+td-25);
ma.y=Math.max(ma.y,W.y-td+25);
var fc=25;
var Ef=W.y-this.infoWindow.getTotalHeightAboveGround()-(ma.y-td);
if(Ef<55)fc=fc+50;
else if(Ef<295)fc=fc+35;
ma.x=Math.min(ma.x,K+Pf-fc);
ma.x=Math.max(ma.x,K+this.infoWindow.getTotalWidth()-Pf+25);
this.centerLatLng=null;
this.recenterOrPanToBitmap(ma)
}
;
d.prototype.repositionInfoWindow=function()
{
if(this.disablePopups||(!this.infoWindow.isVisible()||!this.infoWindow.point))return;
var j=this.infoWindow.point;
var W=this.spec.getBitmapCoordinate(j.y,j.x,this.zoomLevel,_infoBitmapCoord);
var ya=this.getDivCoordinate(W.x,W.y,_infoDivCoord);
this.infoWindow.positionAt(ya.x,ya.y,this.infoWindow.iconClass)
}
;
var _csStartPoint=new n(0,0);
var _csStartDivPoint=new n(0,0);
var _csBitmapPoint=new n(0,0);
d.prototype.getVMLPathString=function(y)
{
I.start("Map","getVMLPathString");
var u=new Array();
u.push("m");
u.push(y.polyline.points[0]);
u.push(y.polyline.points[1]);
u.push("l");
u=u.concat(y.polyline.points);
for(var a=0;
a<y.segments.length;
a++)
{
var V=y.segments[a].pointIndex<<1;
var id=V+4;
var Oe=u[id];
var Ff=u[id+1];
u[id]=Oe+" "+Ff+" e m";
u[id+1]=Oe+" "+Ff+" l"
}
u.push("e");
var str=u.join(" ");
I.end("Map","getVMLPathString");
return str
}
;
d.prototype.createRawVML=function(re,i,c)
{
I.start("Map","createRawVML");
var ua;
var li=false;
if(!c)
{
c=document.createElement("v:shape");
ua=document.createElement("v:stroke");
c.appendChild(ua);
c.path=re;
li=true
}
else
{
i.removeChild(c);
ua=c.firstChild
}
var qb=this.centerBitmap;
var uc=this.getDivCoordinate(qb.x,qb.y,_csStartDivPoint);
c.unselectable="on";
c.strokecolor="blue";
c.strokeweight=5;
c.fill=false;
c.filled=false;
var g=100;
var k=100;
c.style.position="absolute";
c.style.width=g+"px";
c.style.height=k+"px";
c.style.left=uc.x+"px";
c.style.top=uc.y-k+"px";
c.style.rotation="-90";
var Hc=this.getCenterLatLng();
var Od=Hc.y*100000+" "+Hc.x*100000;
c.coordorigin=Od;
var Pe=this.spec.getPixelsPerDegree(this.zoomLevel);
c.coordsize=100000*k/Pe.y+" "+100000*g/Pe.x;
ua.joinstyle="round";
ua.endcap="round";
ua.opacity=0.45;
I.end("Map","createRawVML");
i.appendChild(c);
return c
}
;
d.prototype.getBitmapVectors=function(eb,v,A)
{
if(!v)v=new Array();
if(!A)A=new U();
A.minX=Infinity;
A.minY=Infinity;
A.maxX=-Infinity;
A.maxY=-Infinity;
for(var a=0;
a<eb.length;
)
{
var Ka=eb[a++];
var Pa=eb[a++];
var ha=this.spec.getBitmapCoordinate(Ka,Pa,this.zoomLevel,_csStartPoint);
ha.x=Math.round(ha.x);
ha.y=Math.round(ha.y);
v.push(ha.x);
v.push(ha.y);
if(ha.x<A.minX)A.minX=ha.x;
if(ha.y<A.minY)A.minY=ha.y;
if(ha.x>A.maxX)A.maxX=ha.x;
if(ha.y>A.maxY)A.maxY=ha.y
}
return v
}
;
d.prototype.getVectorPath=function(v,A)
{
var u=new Array();
var ic;
var hc;
for(var a=0;
a<v.length;
)
{
var ib=v[a++];
var mb=v[a++];
var Hb=v[a++];
var xb=v[a++];
if(mb!=ic||ib!=hc)
{
u.push("m");
u.push(ib);
u.push(mb);
u.push("l")
}
u.push(Hb);
u.push(xb);
ic=xb;
hc=Hb
}
u.push("e");
return u.join(" ")
}
;
d.prototype.getEncodedImageSource=function(v,A)
{
var u=new Array();
var hc;
var ic;
for(var a=0;
a<v.length;
)
{
var ib=v[a++];
var mb=v[a++];
var Hb=v[a++];
var xb=v[a++];
if(ib==Hb&&mb==xb)
{
continue
}
if(ib!=hc||mb!=ic)
{
if(u.length>0)
{
Mb(9999,u)
}
Mb(ib-A.minX,u);
Mb(mb-A.minY,u)
}
Mb(Hb-ib,u);
Mb(xb-mb,u);
ic=xb;
hc=Hb
}
Mb(9999,u);
return u.join("")
}
;
d.prototype.createVectorSegments=function(rb,Ab,La,fa)
{
I.start("Map","createVectorSegments");
var eb=rb.getVectors(Ab,La);
var v=new Array();
var ea=new U();
this.getBitmapVectors(eb,v,ea);
if(!fa)
{
fa=new U()
}
var Ca=new U(Math.max(fa.minX,ea.minX),Math.max(fa.minY,ea.minY),Math.min(fa.maxX,ea.maxX),Math.min(fa.maxY,ea.maxY));
var c;
if(v.length>0)
{
var qb=this.centerBitmap;
var uc=this.getDivCoordinate(qb.x,qb.y,_csStartDivPoint);
c=document.createElement("v:shape");
c.unselectable="on";
c.strokecolor="blue";
c.strokeweight=5;
c.fill=false;
c.filled=false;
var g=1;
var k=1;
c.style.position="absolute";
c.style.width=g+"px";
c.style.height=k+"px";
c.style.left=uc.x+"px";
c.style.top=uc.y+"px";
var Od=qb.x+" "+qb.y;
c.coordorigin=Od;
c.coordsize=g+" "+k;
c.path=this.getVectorPath(v,Ca);
var ua=document.createElement("v:stroke");
ua.joinstyle="round";
ua.endcap="round";
ua.opacity=0.45;
c.appendChild(ua)
}
else
{
c=document.createElement("div")
}
c.sourceBounds=fa;
I.end("Map","createVectorSegments");
return c
}
;
d.prototype.createImageSegments=function(rb,Ab,La,fa)
{
I.start("Map","createImageSegments");
var u;
var Ca;
do
{
var eb=rb.getVectors(Ab,La);
var v=new Array();
var ea=new U();
this.getBitmapVectors(eb,v,ea);
ea.minX-=10;
ea.minY-=10;
ea.maxX+=10;
ea.maxY+=10;
if(!fa)
{
fa=new U()
}
Ca=new U(Math.max(fa.minX,ea.minX),Math.max(fa.minY,ea.minY),Math.min(fa.maxX,ea.maxX),Math.min(fa.maxY,ea.maxY));
u=this.getEncodedImageSource(v,Ca);
++La
}
while(u.length>900);
var c;
if(u.length>0)
{
var hf=this.getDivCoordinate(Ca.minX,Ca.minY,_csStartDivPoint);
var g=Math.ceil(Ca.maxX-Ca.minX);
var k=Math.ceil(Ca.maxY-Ca.minY);
var C="http://www.google.com/maplinedraw?width="+g+"&height="+k+"&path="+u;
nd('<a href="'+C.xmlEscape()+'">'+C.xmlEscape()+"</a>",0);
if(m.type!=1)
{
g=null;
k=null
}
var xa=m.type==2?"noprint":null;
c=o.create(C,g,k,hf.x,hf.y,0,false,xa)
}
else
{
c=document.createElement("div")
}
c.sourceBounds=fa;
I.end("Map","createImageSegments");
return c
}
;
d.prototype.drawDirections=function(y,O,oh)
{
if(!y&&!O.directions)return;
var Zf=this.getBoundsBitmap();
var ca=O.directionsBounds;
if(!oh)
{
if(y==O.directions)
{
if(ca.containsBounds(Zf))
{
return
}
}
}
if(O.directions!=y)
{
while(O.hasChildNodes())
{
O.removeChild(O.lastChild)
}
O.directions=y;
if(y&&(m.type==1&&(!this.forceImageSegments&&y.polyline.points.length<16000)))
{
var re=this.getVMLPathString(y);
O.path=re
}
else
{
O.path=null
}
}
if(y)
{
I.start("Map","drawDirections");
var c=null;
var Me=900;
var g=Math.min(this.viewSize.width,Me);
var k=Math.min(this.viewSize.height,Me);
if(m.type==1&&!this.forceImageSegments)
{
g=5000;
k=5000
}
ca.minX=this.centerBitmap.x-g;
ca.minY=this.centerBitmap.y-k;
ca.maxX=this.centerBitmap.x+g;
ca.maxY=this.centerBitmap.y+k;
var wa=this.spec.getLatLng(ca.minX,ca.minY,this.zoomLevel);
var ra=this.spec.getLatLng(ca.maxX,ca.maxY,this.zoomLevel);
var Ab=new U(wa.x,ra.y,ra.x,wa.y);
if(O.path)
{
c=null;
if(O.hasChildNodes())
{
c=O.firstChild
}
c=this.createRawVML(O.path,O,c)
}
else
{
while(O.hasChildNodes())
{
O.removeChild(O.lastChild)
}
var La=0;
var Ma=new M(y.polyline.minTolerance,y.polyline.minTolerance);
while(La<y.polyline.numLevels)
{
Ma.width*=y.polyline.zoomFactor;
Ma.height*=y.polyline.zoomFactor;
if(this.zoomLevel<this.spec.getLowestZoomLevel(Ma,2,2))
{
break
}
++La
}
if(m.type==1&&!this.forceImageSegments)
{
c=this.createVectorSegments(y.polyline,Ab,La,ca)
}
else
{
c=this.createImageSegments(y.polyline,Ab,La,ca)
}
O.appendChild(c)
}
c.style.zIndex=2;
this.drawDirectionsMarkers();
I.end("Map","drawDirections")
}
else
{
ca.minX=-Infinity;
ca.minY=-Infinity;
ca.maxX=Infinity;
ca.maxY=Infinity;
this.hideDirectionsMarkers()
}
}
;
var hh=q+"dd-start.png";
var Kg=q+"dd-end.png";
d.prototype.drawDirectionsMarkers=function()
{
if(!this.directionsStart||!this.directionsEnd)
{
this.directionsStart=this.createLocationMarker(hh,N.get("local"));
this.directionsEnd=this.createLocationMarker(Kg,N.get("local"));
var h=this;
this.directionsStart.mouseTarget.onmousedown=function(b)
{
aa(b);
h.showDirectionsStart()
}
;
this.directionsEnd.mouseTarget.onmousedown=function(b)
{
aa(b);
h.showDirectionsEnd()
}
}
this.setMarkerPosition(this.directionsStart,N.get("local"),this.directions.polyline.getPoint(0));
var tb=(this.directions.polyline.points.length>>1)-1;
this.setMarkerPosition(this.directionsEnd,N.get("local"),this.directions.polyline.getPoint(tb));
this.directionsStart.show();
this.directionsEnd.show();
var Ad=0;
var Wd=0;
if(this.directions.polyline.getPoint(0).y<this.directions.polyline.getPoint(tb).y)
{
Ad=1
}
else
{
Wd=1
}
this.directionsStart.icon.style.zIndex=10+Ad;
this.directionsStart.transparentIcon.style.zIndex=30+Ad;
this.directionsEnd.icon.style.zIndex=10+Wd;
this.directionsEnd.transparentIcon.style.zIndex=30+Wd
}
;
d.prototype.showDirectionsStart=function()
{
if(!this.directions)return;
this.showMapBlowup(this.directions.polyline.getPoint(0),N.get("local"))
}
;
d.prototype.showDirectionsEnd=function()
{
if(!this.directions)return;
var tb=(this.directions.polyline.points.length>>1)-1;
this.showMapBlowup(this.directions.polyline.getPoint(tb),N.get("local"))
}
;
d.prototype.showDirectionsStep=function(Kb)
{
if(!this.directions)return;
var j=this.directions.polyline.getPoint(Kb.pointIndex);
var Bb=this.showMapBlowup(j);
if(Kb.pointIndex!=0)
{
var Za=Bb.getDirIndicatorAngle(Kb.pointIndex);
var ji=Bb.getDirIndicatorPath(Za);
var Rb=12*Math.cos(Za);
var jc=12*Math.sin(Za);
Rb=Math.floor(-12-Rb);
jc=Math.floor(-12-jc);
var Pb=Bb.spec.getBitmapCoordinate(j.y,j.x,Bb.zoomLevel);
var wc=Bb.getDivCoordinate(Pb.x,Pb.y);
var pa=o.create(ji,24,24,wc.x+Rb,wc.y+jc,2,false);
Bb.div.appendChild(pa)
}
}
;
d.prototype.getDirIndicatorAngle=function(V)
{
var Za=0;
if(V>1)
{
var la=this.directions.polyline.getPoint(V-2);
var na=this.directions.polyline.getPoint(V);
la=this.spec.getBitmapCoordinate(la.y,la.x,this.zoomLevel);
na=this.spec.getBitmapCoordinate(na.y,na.x,this.zoomLevel);
Za=Math.atan2(na.y-la.y,na.x-la.x)
}
return Za
}
;
var di=q+"dir_";
d.prototype.getDirIndicatorPath=function(Za)
{
var Xb=Math.round(Za*60/Math.PI)*3+90;
while(Xb>=120)Xb-=120;
while(Xb<0)Xb+=120;
var C=di+Xb+".png";
return C
}
;
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 Y=document.createElement("div");
this.createPanningControls(Y);
this.createZoomControls(Y);
this.createZoomSlider(Y);
return Y
}
;
var xh=q+"zoom-plus.png";
var rh=q+"zoom-minus.png";
var vh=q+"sliderbar.png";
var ch=q+"slider.png";
d.prototype.createZoomControls=function(Y)
{
var h=this;
var Zc=o.create(xh,17,17,20,70,1,false);
Zc.style.cursor="pointer";
Zc.onclick=function(b)
{
h.zoomTo(h.zoomLevel-1);
aa(b)
}
;
Zc.title="Zoom in";
Y.appendChild(Zc);
var bd=o.create(rh,17,17,20,260,1,false);
bd.style.cursor="pointer";
bd.onclick=function(b)
{
h.zoomTo(h.zoomLevel+1);
aa(b)
}
;
bd.title="Zoom out";
Y.appendChild(bd)
}
;
var Jg=q+"center.png";
var Fh=q+"east.png";
var ph=q+"west.png";
var Rf=q+"north.png";
var Ch=q+"south.png";
var Vh=q+"panshadow.png";
d.prototype.createPanningControls=function(Y)
{
var h=this;
var Ua=o.create(Vh,59,64,0,0,0,false);
Y.appendChild(Ua);
var Fc=o.create(Rf,17,17,20,0,1,false);
Fc.style.cursor="pointer";
Fc.onclick=function(b)
{
h.pan(0,Math.floor(h.viewSize.height*0.5));
aa(b)
}
;
Fc.title="Go up";
Y.appendChild(Fc);
var Ic=o.create(Fh,17,17,40,20,1,false);
Ic.style.cursor="pointer";
Ic.onclick=function(b)
{
h.pan(-Math.floor(h.viewSize.width*0.5),0);
aa(b)
}
;
Ic.title="Go right";
Y.appendChild(Ic);
var qd=o.create(Ch,17,17,20,40,1,false);
qd.style.cursor="pointer";
qd.onclick=function(b)
{
h.pan(0,-Math.floor(h.viewSize.height*0.5));
aa(b)
}
;
qd.title="Go down";
Y.appendChild(qd);
var Wc=o.create(ph,17,17,0,20,1,false);
Wc.style.cursor="pointer";
Wc.onclick=function(b)
{
h.pan(Math.floor(h.viewSize.width*0.5),0);
aa(b)
}
;
Wc.title="Go left";
Y.appendChild(Wc);
var B=o.create(Jg,17,17,20,20,1,false);
B.style.cursor="pointer";
B.onclick=function(b)
{
if(h.lastPageCenter)
{
if(h.lastPageZoom!=h.zoomLevel)
{
h.centerAndZoom(h.lastPageCenter,h.lastPageZoom)
}
else
{
h.recenterOrPanToLatLng(h.lastPageCenter)
}
}
else if(h.lastLatLng)
{
h.recenterOrPanToLatLng(this.map.lastLatLng)
}
aa(b)
}
;
B.title="Return to the last result";
Y.appendChild(B)
}
;
var Eg=q+"slidershadow.png";
d.prototype.createZoomSlider=function(Y)
{
var Ua=o.create(Eg,19,215,20,64,0,false);
Y.appendChild(Ua);
var Ia=document.createElement("div");
Ia.style.position="absolute";
Ia.style.left="21px";
Ia.style.top="90px";
Ia.style.width="15px";
Ia.style.height="167px";
var rd=o.create(vh,15,167,0,0,1,false);
Ia.appendChild(rd);
var rc=-1*Math.floor(3.5)+1;
var ge=o.create(ch,22,14,rc,this.getRelativeZoomSliderPos(),2,false);
ge.title="Drag to zoom";
Ia.appendChild(ge);
Y.appendChild(Ia);
var A=new U(rc,1,rc+22,166);
var Gd=new Na(ge,rc,this.getRelativeZoomSliderPos(),A);
this.onzoom=function()
{
Gd.moveTo(rc,h.getRelativeZoomSliderPos())
}
;
var h=this;
Gd.ondragend=function()
{
var Qh=Gd.top+Math.floor(5.5);
h.zoomTo(h.getZoomFromRelativeCoord(Qh))
}
;
rd.style.cursor="pointer";
rd.title="Click to set zoom level";
rd.onclick=function(b)
{
var l;
if(window.event)
{
l=window.event.offsetY
}
else
{
var hd=h.getTotalOffset(Ia);
l=b.pageY-hd.height-2
}
aa(b);
h.zoomTo(h.getZoomFromRelativeCoord(l))
}
}
;
d.prototype.getRelativeZoomSliderPos=function()
{
return 1+this.zoomLevel*11
}
;
d.prototype.getZoomFromRelativeCoord=function(l)
{
var P=Math.floor((l-1)/11);
return Math.max(0,Math.min(this.spec.numZoomLevels-1,P))
}
;
d.prototype.showCopyright=function()
{
var fe=this.createCopyright("©
2005 Google");
fe.style.left="3px";
fe.style.bottom="3px";
this.container.appendChild(fe);
var zd=this.createCopyright("Map data ©
2005 NAVTEQ™
, TeleAtlas");
zd.style.right="3px";
zd.style.bottom="3px";
this.container.appendChild(zd)
}
;
d.prototype.createCopyright=function(T)
{
var i=document.createElement("div");
i.style.position="absolute";
i.style.cursor="default";
i.unselectable="on";
i.onselectstart=Td;
i.innerHTML=T;
i.style.fontSize="11px";
i.style.fontFamily="Arial, sans serif";
Nb(i,"noselect");
return i
}
;
function pc(p)
{
this.anchorLevel=null;
this.anchor=new n(0,0);
this.spec=null;
this.span=new M(Infinity,Infinity);
this.points=null;
this.map=p;
this.map.addStateListener(this);
this.map.onresize=this.eventHandler("onMapResize")
}
var _bPoint=new n(0,0);
pc.prototype.onMapStateChanged=function()
{
if(this.anchorLevel!=this.map.zoomLevel||this.spec!=this.map.spec)
{
this.reset();
this.addPoint(0,0,true);
return
}
var B=this.map.getCenterLatLng(_bPoint);
var Uc=Math.round((B.x-this.anchor.x)/this.span.width);
var od=Math.round((B.y-this.anchor.y)/this.span.height);
this.addPoint(Uc,od,true)
}
;
pc.prototype.onMapResize=function()
{
this.reset();
this.addPoint(0,0,false)
}
;
pc.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()
}
;
pc.prototype.addPoint=function(Uc,od,Wg)
{
var str=Uc+","+od;
if(this.points[str])return;
this.points[str]=1;
if(Wg)
{
var w=new Ja();
w.setAllMapValues(this.map);
var Ud=_bPoint;
Ud.x=this.anchor.x+Uc*this.span.width;
Ud.y=this.anchor.y+od*this.span.height;
w.setValue("vp",w.getLatLngArg(Ud));
var ga=w.getURL();
nd('<a href="'+ga.xmlEscape()+'">'+ga.xmlEscape()+"</a>",0);
(new Image()).src=ga
}
}
;
function Na(C,K,top,R)
{
this.src=C;
this.container=R;
this.ondragstart=null;
this.ondrag=null;
this.ondragend=null;
this.onmove=null;
this.onclick=null;
this.disabled=false;
this.dragPoint=new n(0,0);
this.clickStartPos=new n(0,0);
this.src.style.position="absolute";
this.moveTo(K,top);
this.mouseDownHandler=this.eventHandler("onMouseDown");
this.mouseMoveHandler=this.eventHandler("onMouseMove");
this.mouseUpHandler=this.eventHandler("onMouseUp");
if(m.type==2)
{
window.addEventListener("mouseout",this.eventHandler("onWindowMouseOut"),false)
}
this.eventSrc=this.src.setCapture?this.src:window;
if(this.src.addEventListener)
{
this.src.addEventListener("mousedown",this.mouseDownHandler,false)
}
else
{
this.src.onmousedown=this.mouseDownHandler
}
}
Na.prototype.moveTo=function(K,top)
{
if(this.left!=K||this.top!=top)
{
this.left=K;
this.top=top;
this.src.style.left=this.left+"px";
this.src.style.top=this.top+"px";
if(this.onmove)this.onmove()
}
}
;
Na.prototype.onMouseDown=function(b)
{
if(b.cancelDrag)
{
return
}
var Ph=m.type==2?b.button==0:b.button==1;
if(this.disabled||!Ph)
{
aa(b);
return false
}
this.dragPoint.x=b.screenX;
this.dragPoint.y=b.screenY;
if(window.addEventListener)
{
this.eventSrc.addEventListener("mousemove",this.mouseMoveHandler,false);
this.eventSrc.addEventListener("mouseup",this.mouseUpHandler,false)
}
else
{
this.eventSrc.onmousemove=this.mouseMoveHandler;
this.eventSrc.onmouseup=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;
this.src.style.cursor="move";
aa(b)
}
;
Na.prototype.onMouseMove=function(b)
{
if(m.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 we=1;
if(m.type==3&&m.version==1)
{
we=-1
}
var x=this.left+(b.screenX-this.dragPoint.x);
var l=this.top+(b.screenY-this.dragPoint.y)*we;
var va=0;
var za=0;
if(this.container)
{
var Ec=x;
if(x<this.container.minX)
{
Ec=this.container.minX
}
else
{
var ed=this.container.maxX-this.src.offsetWidth;
if(x>ed)
{
Ec=ed
}
}
va=Ec-x;
x=Ec;
var Qc=l;
if(l<this.container.minY)
{
Qc=this.container.minY
}
else
{
var Jc=this.container.maxY-this.src.offsetHeight;
if(l>Jc)Qc=Jc
}
za=Qc-l;
l=Qc
}
this.moveTo(x,l);
this.dragPoint.x=b.screenX+va;
this.dragPoint.y=b.screenY+za;
if(this.ondrag)this.ondrag(b)
}
;
Na.prototype.onMouseUp=function(b)
{
if(this.eventSrc.removeEventListener)
{
this.eventSrc.removeEventListener("mousemove",this.mouseMoveHandler,false);
this.eventSrc.removeEventListener("mouseup",this.mouseUpHandler,false)
}
else
{
this.eventSrc.onmousemove=null;
this.eventSrc.onmouseup=null
}
this.src.style.cursor=this.originalCursor;
if(document.releaseCapture)document.releaseCapture();
if(this.ondragend)this.ondragend(b);
if(this.onclick)
{
var fh=(new Date()).getTime();
if(fh-this.clickStartTime<=500&&(Math.abs(this.clickStartPos.x-b.screenX)<=2&&Math.abs(this.clickStartPos.y-b.screenY)<=2))
{
this.onclick(b)
}
}
}
;
Na.prototype.onWindowMouseOut=function(b)
{
if(!b.relatedTarget)this.onMouseUp(b)
}
;
Na.prototype.disable=function()
{
this.disabled=true
}
;
Na.prototype.enable=function()
{
this.disabled=false
}
;
var ke="centerlat";
var me="centerlng";
function H(bb,Ya,Bc,Tc,B,Zg,dg,Gh,jg,z,Sc,y,nb,da)
{
this.query=bb;
this.title=Ya;
this.error=Bc;
this.spelling=Tc;
this.center=B;
this.viewSpan=Zg;
this.searchCenter=dg;
this.searchSpan=Gh;
this.ads=jg;
this.area=z;
this.overlays=Sc;
this.directions=y;
this.debug=nb;
this.xml=da
}
function Yb(kd,Sg,da)
{
this.locations=kd;
this.panelStyle=Sg;
this.xml=da
}
function Lc(F,j,X,Hg,da)
{
this.id=F;
this.point=j;
this.icon=X;
this.infoStyle=Hg;
this.xml=da
}
function se(f,s)
{
this.image=f;
this.iconClass=s
}
function Tb(rb,Oc,da)
{
this.polyline=rb;
this.segments=Oc;
this.xml=da
}
function Ld(F,ue,V)
{
this.id=F;
this.description=ue;
this.pointIndex=V
}
function N(ja,g,k,vg,Wh,og,kh,Gg,Cd)
{
this.name=ja;
this.width=g;
this.height=k;
this.pointCoord=vg;
this.infoTipCoord=Wh;
this.shadowTipCoord=og;
this.shadowURL=kh;
this.shadowWidth=Gg;
this.imageMapArray=Cd;
if(this.imageMapArray)
{
this.imageMap=this.imageMapArray.join(",")
}
else
{
this.imageMap=null
}
}
N.prototype.translateImageMapArray=function(x,l)
{
var Ra="";
for(var a=0;
a<this.imageMapArray.length;
a+=2)
{
Ra+=this.imageMapArray[a]+x+","+(this.imageMapArray[a+1]+l)+(a<this.imageMapArray.length-2?",":"")
}
return Ra
}
;
N.classes=new Object();
N.load=function(s)
{
N.classes[s.name]=s
}
;
N.get=function(ja)
{
return N.classes[ja]
}
;
H.loadFromXML=function(c)
{
I.start("Page","loadFromXML");
var bb=null;
var xf=c.getElementsByTagName("query");
if(xf.length>0)
{
bb=H.getNodeValue(xf[0])
}
var Ya=null;
var Ue=c.getElementsByTagName("title");
if(Ue.length>0)
{
Ya=H.getNodeValue(Ue[0])
}
var Bc=null;
var zf=c.getElementsByTagName("error");
if(zf.length>0)
{
Bc=zf[0]
}
var Tc=null;
var xe=c.getElementsByTagName("spelling");
if(xe.length>0)
{
Tc=xe[0]
}
var B=null;
var Nd=c.getElementsByTagName("center");
if(Nd.length>0)
{
B=new n(parseFloat(Nd[0].getAttribute("lng")),parseFloat(Nd[0].getAttribute("lat")))
}
var Ma=null;
var Bd=c.getElementsByTagName("span");
if(Bd.length>0)
{
Ma=new M(parseFloat(Bd[0].getAttribute("lng")),parseFloat(Bd[0].getAttribute("lat")))
}
var Kf=null;
var ee=c.getElementsByTagName("searchcenter");
if(ee.length>0)
{
Kf=new n(parseFloat(ee[0].getAttribute("lng")),parseFloat(ee[0].getAttribute("lat")))
}
var jf=null;
var Hd=c.getElementsByTagName("searchspan");
if(Hd.length>0)
{
jf=new M(parseFloat(Hd[0].getAttribute("lng")),parseFloat(Hd[0].getAttribute("lat")))
}
var Sc=new Array();
var gf=c.getElementsByTagName("overlay");
for(var a=0;
a<gf.length;
a++)
{
Sc.push(Yb.loadFromXML(gf[a]))
}
var y=null;
var Df=c.getElementsByTagName("directions");
if(Df.length>0)
{
y=Tb.loadFromXML(Df[0])
}
var nb=null;
var of=c.getElementsByTagName("debug");
if(of.length>0)
{
nb=H.getNodeValue(of[0])
}
I.end("Page","loadFromXML");
return new H(bb,Ya,Bc,Tc,B,Ma,Kf,jf,null,null,Sc,y,nb,c)
}
;
Yb.loadFromXML=function(c)
{
var kd=new Array();
var He=c.getElementsByTagName("location");
for(var a=0;
a<He.length;
a++)
{
kd.push(Lc.loadFromXML(He[a]))
}
return new Yb(kd,c.getAttribute("panelStyle"),c)
}
;
Yb.prototype.getLocationById=function(F)
{
for(var a=0;
a<this.locations.length;
a++)
{
if(this.locations[a].id==F)return this.locations[a]
}
return null
}
;
Lc.loadFromXML=function(c)
{
var yf=c.getElementsByTagName("point")[0];
var j=new n(parseFloat(yf.getAttribute("lng")),parseFloat(yf.getAttribute("lat")));
var fi=c.getElementsByTagName("icon")[0];
var X=se.loadFromXML(fi);
return new Lc(c.getAttribute("id"),j,X,c.getAttribute("infoStyle"),c)
}
;
se.loadFromXML=function(c)
{
var s=N.get(c.getAttribute("class"));
if(s)
{
return new se(c.getAttribute("image"),s)
}
else
{
return null
}
}
;
Tb.loadFromXML=function(c)
{
var dd=c.getElementsByTagName("polyline")[0];
var Og=H.getNodeValue(dd.getElementsByTagName("points")[0]);
var yd=H.getNodeValue(dd.getElementsByTagName("levels")[0]);
var ie=parseInt(dd.getAttribute("numLevels"));
var Dd=parseInt(dd.getAttribute("zoomFactor"));
var rb=new Lb(Og,yd,ie,Dd);
var Oc=new Array();
var mi=c.getElementsByTagName("segments")[0];
var Re=mi.getElementsByTagName("segment");
for(var a=0;
a<Re.length;
++a)
{
Oc.push(Ld.loadFromXML(Re[a]))
}
return new Tb(rb,Oc,c)
}
;
Tb.prototype.getSegmentById=function(F)
{
for(var a=0;
a<this.segments.length;
a++)
{
if(this.segments[a].id==F)return this.segments[a]
}
return null
}
;
Ld.loadFromXML=function(c)
{
var F=c.getAttribute("id");
var V=parseInt(c.getAttribute("pointIndex"));
var ue=H.getNodeValue(c);
return new Ld(F,ue,V)
}
;
H.getNodeValue=function(D)
{
if(m.type==1)return D.text;
var Q="";
if(D.nodeType==3||D.nodeType==4)return D.nodeValue;
if(D.nodeType==1)
{
for(var Ea=D.firstChild;
Ea!=null;
Ea=Ea.nextSibling)
{
Q+=H.getNodeValue(Ea)
}
}
return Q
}
;
var gg=q+"iws_nw.png";
var ei=q+"iws_n.png";
var yh=q+"iws_ne.png";
var qg=q+"iws_e.png";
var hg=q+"iws_c.png";
var lh=q+"iws_w.png";
var sg=q+"iws_sw.png";
var ff=q+"iws_s.png";
var mg=q+"iws_se.png";
var fg=q+"iws_tap.png";
var Jh=q+"iw_nw.png";
var mh=q+"iw_n.png";
var zh=q+"iw_ne.png";
var tg=q+"iw_e.png";
var yg=q+"iw_c.png";
var th=q+"iw_w.png";
var Lh=q+"iw_sw.png";
var cf=q+"iw_s.png";
var Uf=q+"iw_se.png";
var eh=q+"iw_tap.png";
function t(Dh,Kh,Cf,bg,Wf)
{
this.oncloseclick=Kh;
this.createWindow(bg);
this.createShadow(Wf);
if(m.type!=1)
{
this.createMask()
}
else
{
this.maskPng=null
}
this.createContentArea(Dh);
this.createCloseButton();
Cf.appendChild(this.windowDiv);
Cf.appendChild(this.shadowDiv);
this.setSize(208,69);
this.hide()
}
t.prototype.setContentSize=function(g,k)
{
this.setSize(g-(this.window.w.width-15)*2,k-(this.window.n.height-15)*2)
}
;
t.prototype.setSize=function(g,k)
{
if(g<0)g=0;
if(k<0)k=0;
this.width=g;
this.height=k;
this.setWindowSize(g,k);
this.setShadowSize(g,k);
if(this.hasMask())this.setMaskSize();
this.closeButton.style.left=this.getTotalWidth()-this.closeButton.width-10-1+"px";
this.closeButton.style.top="10px"
}
;
t.prototype.getWindowHeight=function()
{
return this.window.c.height+2*this.window.n.height
}
;
t.prototype.getTotalHeight=function()
{
return this.height+this.window.pointer.height+this.window.n.height
}
;
t.prototype.getTotalHeightAboveGround=function()
{
return this.getTotalHeight()+(this.iconClass.pointCoord.y-this.iconClass.infoTipCoord.y)
}
;
t.prototype.getTotalShadowHeight=function()
{
return Math.floor(this.height/4)+this.shadow.pointer.height+this.shadow.nw.height
}
;
t.prototype.getTotalWidth=function()
{
return this.width+this.window.w.width+this.window.e.width
}
;
t.prototype.getOffsetLeft=function()
{
return this.windowDiv.offsetLeft
}
;
t.prototype.getOffsetTop=function()
{
return this.windowDiv.offsetTop
}
;
t.prototype.setWindowSize=function(g,k)
{
this.window.n.style.width=g+"px";
this.window.e.style.height=k+"px";
this.window.c.style.width=g+"px";
this.window.c.style.height=k+"px";
this.window.w.style.height=k+"px";
var Ha=this.calculatePointerOffset(g);
this.window.s1.style.width=Ha+"px";
this.window.pointer.style.left=Ha+this.window.sw.width+"px";
this.window.s2.style.left=Ha+this.window.pointer.width+this.window.sw.width+"px";
this.window.s2.style.width=g-Ha-this.window.pointer.width+"px";
var Gb=g+this.window.w.width+"px";
this.window.ne.style.left=Gb;
this.window.e.style.left=Gb;
this.window.se.style.left=Gb;
var ta=k+this.window.n.height+"px";
this.window.sw.style.top=ta;
this.window.s1.style.top=ta;
this.window.pointer.style.top=ta;
this.window.s2.style.top=ta;
this.window.se.style.top=ta
}
;
t.prototype.setShadowSize=function(g,k)
{
g-=15;
var ob=Math.floor(k/4);
var Gb=g+this.shadow.nw.width;
var Ha=this.calculatePointerOffset(g)-41;
var ta=ob+this.shadow.n.height+"px";
var sd=ob+this.shadow.nw.height;
this.shadow.s1Div.style.width=Ha+"px";
this.shadow.pointer.style.left=Ha+this.shadow.sw.width+"px";
this.shadow.s2Div.style.left=Ha+this.shadow.pointer.width+this.shadow.sw.width+"px";
this.shadow.s2Div.style.width=g-Ha-this.shadow.pointer.width+"px";
this.shadow.sw.style.top=ta;
this.shadow.s1Div.style.top=ta;
this.shadow.pointer.style.top=ta;
this.shadow.s2Div.style.top=ta;
this.shadow.se.style.top=ta;
this.shadow.se.style.left=Gb+"px";
var Ze=this.shadow.nw.height;
var nf=Math.floor(k/2);
this.shadow.wDiv.style.height=ob+"px";
this.shadow.wDiv.style.left=Ze+"px";
this.shadow.wDiv.style.width=nf+"px";
this.shadow.w.style.left=ob-this.shadow.w.width+80+"px";
var mf=this.shadow.nw.height+g+70;
this.shadow.eDiv.style.height=ob+"px";
this.shadow.eDiv.style.left=mf+"px";
this.shadow.eDiv.style.width=k+"px";
this.shadow.e.style.left=ob-this.shadow.w.width+80+"px";
var Ge=Ze+nf;
this.shadow.cDiv.style.width=mf-Ge+"px";
this.shadow.cDiv.style.height=ob+"px";
this.shadow.cDiv.style.left=Ge+"px";
this.shadow.nw.style.left=sd+"px";
this.shadow.nDiv.style.width=g-30+"px";
this.shadow.nDiv.style.left=sd+this.shadow.nw.width+"px";
this.shadow.ne.style.left=Gb+sd-30+"px"
}
;
t.prototype.setMaskSize=function()
{
this.maskPng.style.width=this.getTotalWidth()+"px";
this.maskPng.style.height=this.getTotalHeight()+"px";
var Af=this.getTotalWidth();
var Kc=this.getWindowHeight();
var Vg=this.getTotalHeight();
var oe=this.window.pointer.offsetLeft;
var ig=oe+this.window.pointer.width;
var Sf=oe+53;
var xg=oe+4;
var Oa=",";
var p=this.getMaskMap();
var z=p.firstChild;
z.setAttribute("coords","0,0,0,"+Kc+Oa+Sf+Oa+Kc+Oa+xg+Oa+Vg+Oa+ig+Oa+Kc+Oa+Af+Oa+Kc+Oa+Af+",0")
}
;
t.prototype.hide=function()
{
if(this.windowDiv)this.windowDiv.style.display="none";
this.shadowDiv.style.display="none"
}
;
t.prototype.show=function()
{
this.windowDiv.style.display="";
this.shadowDiv.style.display="";
this.windowDiv.style.visibility="visible";
this.shadowDiv.style.visibility="visible";
this.contentArea.style.visibility="visible"
}
;
t.prototype.isVisible=function()
{
return this.windowDiv.style.display!="none"
}
;
t.prototype.sizeToContent=function(ad)
{
var g=ad?ad:this.contentArea.offsetWidth;
var k=this.contentArea.offsetHeight;
this.setContentSize(Math.max(g,183),k)
}
;
t.prototype.positionAt=function(x,l,s)
{
var Rb=this.calculatePointerOffset(this.width)+this.window.w.width+5;
var jc=this.height+this.window.n.height+this.window.s1.height;
this.left=x-Rb;
this.top=l-jc;
this.left+=s.infoTipCoo