
function ap(b) {
return b ? b : window.event;
}
function aC(b) {
b.cancelBubble = true;
}
function bhf(b) {
var gj = 0;
if (b.pageX) {
gj = b.pageX;
} else {
if (b.clientX) {
if (document.documentElement && document.documentElement.scrollLeft) {
gj = b.clientX + document.documentElement.scrollLeft;
} else {
if (document.body) {
gj = b.clientX + document.body.scrollLeft;
}
}
}
}
return gj;
}
function caf(b) {
var gk = 0;
if (b.pageY) {
gk = b.pageY;
} else {
if (b.clientY) {
if (document.documentElement && document.documentElement.scrollTop) {
gk = b.clientY + document.documentElement.scrollTop;
} else {
if (document.body) {
gk = b.clientY + document.body.scrollTop;
}
}
}
}
return gk;
}
function kp(b) {
if (b.wheelDelta) {
return b.wheelDelta;
} else {
if (b.detail) {
return -b.detail;
}
}
return 0;
}
function rD(b) {
if (!b) {
b = window.event;
}
var T = null;
if (b.srcElement) {
T = b.srcElement;
} else {
if (b.target) {
T = b.target;
}
}
if (T && T.nodeType) {
if (T.nodeType == 3) {
T = rk.parentNode;
}
}
return T;
}
function hZ(cU) {
var cn = cU;
var jg = 0;
while (cn) {
jg += cn.offsetLeft;
cn = cn.offsetParent;
}
if (navigator.userAgent.indexOf("Mac") != -1 && typeof (document.body.leftMargin) != "undefined") {
jg += document.body.leftMargin;
}
return jg;
}
function gh(cU) {
var cn = cU;
var iZ = 0;
while (cn) {
iZ += cn.offsetTop;
cn = cn.offsetParent;
}
if (navigator.userAgent.indexOf("Mac") != -1 && typeof (document.body.topMargin) != "undefined") {
iZ += document.body.topMargin;
}
return iZ;
}
function ak(d) {
return Math.floor(d);
}
function cx(d) {
return Math.ceil(d);
}
function dJ(d, f) {
return Math.max(d, f);
}
function dX(d, f) {
return Math.min(d, f);
}
function aZ(d) {
return Math.abs(d);
}
function aj(d) {
return Math.round(d);
}
function cw(az) {
return az * Math.PI / 180;
}
function gL(oG) {
return oG * 180 / Math.PI;
}
function lS(ah, X) {
if (!ah || !X || ah[0].length != X.length) {
return;
}
var p = ah.length;
var q = X[0].length;
var aU = new Array(p);
var bc = X.length;
for (var a = 0; a < p; a++) {
aU[a] = new Array(q);
for (var Y = 0; Y < q; Y++) {
aU[a][Y] = 0;
for (var gu = 0; gu < bc; gu++) {
aU[a][Y] += ah[a][gu] * X[gu][Y];
}
}
}
return aU;
}
function RegisterNamespaces() {
for (var a = 0; a < arguments.length; a++) {
var gv = arguments[a].split(".");
var gX = window;
for (var Y = 0; Y < gv.length; Y++) {
if (!gX[gv[Y]]) {
gX[gv[Y]] = new Object();
}
gX = gX[gv[Y]];
}
}
}
RegisterNamespaces("Msn.VE");
Msn.VE.MapControl = function (y, V) {
var eJ = 20971520;
var js = 163840;
var bH = 0;
var dV = true;
var cg = 6;
var mo = 15;
var mf = 15;
var bm = 6378137;
var fX = bm * 2 * Math.PI;
var fC = fX * 0.5;
var fG = 1;
var fh = 19;
var ri = "http://virtualearth.msn.com/i/spacer.gif";
var jR = -85;
var jW = 85;
var km = -180;
var lO = 180;
var M = 256;
var ej = new Object();
var oE = 0;
var om = 0;
var mj = 1;
var lP = 1;
var fZ = 2;
var nv = 3;
var fZ = 11;
var pX = 20;
var h = this;
var cY = "r";
var eq = "h";
var eT = "a";
var aS = "o";
var c = new Msn.VE.MapView();
var au = new Msn.VE.MapView();
var kP = 1;
var pw = null;
var hY = 15;
var iM = cY;
var d = 0, f = 0, q = 0, p = 0;
var K = new Array();
var cD = null;
var I = 0, H = 0;
var af = 0, ag = 0;
var bV = 0, bL = 0;
var ci = 0, ck = 0;
var aB = 0, cb = 0;
var cR = false;
var iH = false;
var iF = 0, iC = 0;
var bi = false;
var cG = 0;
var aQ = false;
var gB = 0;
var fA = 0, fB = 0;
var eI = null, fH = null;
var an = new Array();
var bk = new Array();
var j = document.createElement("div");
//var bY = document.createElement("input");
//bY.id = "wl_ve_mapInput";
var di = null;
var R = null;
var cE = null;
var dp = null;
var x = null;
var hu = null;
var dk = new Array();
var ga = false;
this.Init = function () {
ej[cY] = 15;
ej[eT] = 15;
ej[eq] = 15;
ej[aS] = 14;
dp = new py();
dp.Init();
jj();
j.className = "Map";
j.style.zIndex = mj;
y.appendChild(j);
//bY.className = "KeyboardInput";
//y.appendChild(bY);
if (!V.fixedView) {
bH = M;
}
if (V.buffer != undefined && V.buffer != null) {
bH = V.buffer;
}
if (V.latitude && V.longitude && V.zoomlevel && V.mapstyle) {
try {
var gA = new Msn.VE.MapView();
gA.SetMapStyle(lK(V.mapstyle), V.obliqueSceneId);
gA.SetZoomLevel(eval(V.zoomlevel));
gA.SetCenterLatLong(new Msn.VE.LatLong(eval(V.latitude), eval(V.longitude)));
av(gA);
}
catch (dw) {
kX();
}
} else {
kX();
}
};
this.GetDashboard = function () {
return eC;
};
this.Destroy = function () {
while (K.length > 0) {
var ad = K.pop();
ad.RemoveFromMap();
}
K = null;
while (an.length) {
an.pop().Destroy();
}
an = null;
ju();
if (di) {
di.Destroy();
di = null;
}
if (dp) {
dp.Destroy();
dp = null;
}
if (cE) {
cE.Destroy();
cE = null;
}
mR();
y = h = null;
};
function jj() {
d = hZ(y);
f = gh(y);
q = y.offsetWidth;
p = y.offsetHeight;
}
function pa(d, f, aT) {
if (!aT) {
aT = Msn.VE.DashboardSize.Normal;
}
if (aT == Msn.VE.DashboardSize.Tiny) {
aT = Msn.VE.DashboardSize.Small;
}
R = document.createElement("div");
y.appendChild(R);
if (!spPrint || OnAMap) {
R.className = "Dashboard Dashboard_" + aT;
} else {
R.className = "Dashboard_invisible";
}
R.style.top = f + "px";
R.style.left = d + "px";
}
function kX() {
var e = new Msn.VE.MapView();
e.SetCenterLatLong(new Msn.VE.LatLong(0, 0));
e.SetZoomLevel(1);
e.SetMapStyle(cY);
av(e);
}
function hn(A, L) {
var e = au.MakeCopy();
e.SetCenterLatLong(new Msn.VE.LatLong(A, L));
av(e);
}
function cc(Z, bS, il) {
var e = c.MakeCopy();
e.SetMapStyle(lK(Z), bS, il);
if (c.mapStyle != Z) {
if (Z == aS) {
e.SetZoomLevel(1);
hY = c.zoomLevel;
iM = c.mapStyle;
} else {
if (c.mapStyle == aS) {
e.SetZoomLevel(hY);
}
}
}
av(e);
}
function lK(Z) {
if (Z == eT || Z == eq || Z == aS) {
return Z;
} else {
return cY;
}
}
function qL() {
return c.latlong.latitude;
}
function oS() {
return c.latlong.longitude;
}
function lV(pm) {
c.latlong = x.PixelToLatLong(c.center, c.zoomLevel);
if (pm) {
au.Copy(c);
}
}
function ix(f) {
var l = new Msn.VE.Pixel(I + af + q / 2, H + ag + f);
var o = x.PixelToLatLong(l, c.zoomLevel);
if (!o) {
return null;
}
return o.latitude;
}
function hF(d) {
var l = new Msn.VE.Pixel(I + af + d, H + ag + p / 2);
var o = x.PixelToLatLong(l, c.zoomLevel);
if (!o) {
return null;
}
return o.longitude;
}
function hJ(A) {
var o = new Msn.VE.LatLong(A, c.center.longitude);
var l = x.LatLongToPixel(o, c.zoomLevel);
if (!l) {
return null;
}
return aj(l.y - H - ag);
}
function hK(L) {
var o = new Msn.VE.LatLong(c.center.latitude, L);
var l = x.LatLongToPixel(o, c.zoomLevel);
if (!l) {
return null;
}
return aj(l.x - I - af);
}
function cQ(o) {
var l = x.LatLongToPixel(o, c.zoomLevel);
l.x -= I + af;
l.y -= H + ag;
return l;
}
function du(l) {
var pj = new Msn.VE.Pixel(l.x + I + af, l.y + H + ag);
var o = x.PixelToLatLong(pj, c.zoomLevel);
return o;
}
function du1(l,m) {
var a = x.LatLongToPixel(c.latlong, m);
var pj = new Msn.VE.Pixel(l.x + aj(a.x- q / 2) + af, l.y + aj(a.y - p / 2) + ag);
var o = x.PixelToLatLong(pj, m);
return o;
}
function qB() {
return c.zoomLevel;
}
function oK() {
return c.mapStyle;
}
function mJ(A, m) {
if (!A) {
A = c.latlong.latitude;
}
if (!m) {
m = c.zoomLevel;
}
return Math.cos(cw(A)) * x.MetersPerPixel(m);
}
function qF(aK, aM) {
spResize = true;
if (!aK || !aM || aK <= 0 || aM <= 0) {
return;
}
q = aK;
p = aM;
y.style.width = q;
y.style.height = p;
pz(c);
if (di) {
di.Reposition();
}
aq("onresize");
}
function nw() {
return dV;
}
function ht(az) {
ga = az;
for (var a = 0; a < K.length; a++) {
K[a].Debug(az);
}
}
function nT(e, t) {
lT(e, t, 0, 0);
}
function lT(e, t, bB, by) {
bB = ll(bB, q, e.center.x - q / 2, e.zoomLevel, t.z1, t.x1, t.x2);
by = ll(by, p, e.center.y - p / 2, e.zoomLevel, t.z1, t.y1, t.y2);
if (!spResize) {
e.SetCenter(new Msn.VE.Pixel(e.center.x + bB, e.center.y + by));
}
}
function ll(cq, aT, fK, m, mp, nR, pI) {
var ds = M * nR * Math.pow(2, m - mp);
var aE = M * pI * Math.pow(2, m - mp);
if (aT > (aE - ds)) {
return ((aE - ds - aT) / 2) - fK + ds;
} else {
if (fK + cq < ds) {
return ds - fK;
} else {
if (fK + aT + cq > aE) {
return aE - fK - aT;
}
}
}
return cq;
}
function ni(e, gt, fi) {
this.view = e;
this.oblique = gt;
this.error = fi;
}
function fL(o, m, fi) {
var e = c.MakeCopy();
if (o != undefined) {
e.latlong = o;
}
if (m != undefined) {
e.zoomLevel = m;
}
if (fi == undefined) {
fi = "";
}
var gt = null;
return new ni(e, gt, fi);
}
function eu(aR, cX) {
var am = dk[aR];
if (!am) {
am = new Array();
dk[aR] = am;
}
for (var a = 0; a < am.length; a++) {
if (am[a] == cX) {
return true;
}
}
am.push(cX);
}
function ee(aR, cX) {
var am = dk[aR];
if (!am) {
return;
}
for (var a = 0; a < am.length; a++) {
if (am[a] == cX) {
am.splice(a, 1);
}
}
}
function aq(aR, hH) {
var am = dk[aR];
if (!am) {
return;
}
if (!hH) {
hH = fL();
}
for (var a = 0; a < am.length; a++) {
am[a](hH);
}
}
function mR() {
while (dk.length) {
var am = dk.pop();
while (am.length) {
am.pop();
}
am = null;
}
dk = null;
}
var ez = 0;
var eG = 0;
var ey = 0;
var en = 0;
function pR(F, gl, gH, fl, dH, aY, cM, eb) {
if (F == null || gl == null || gH == null || cM == null || eb == null) {
return null;
}
var mB = new Array();
for (var a = 0; a < cM.length; a++) {
mB.push(ih(cM[a], 0, cM[a].length - 1));
}
var eD = new nY();
eD.Init(F, gl, gH, fl, dH, aY, mB, eb);
bk.push(eD);
return eD;
}
function pe(F) {
for (var a = 0; a < bk.length; a++) {
var eD = bk[a];
if (eD.id == F) {
bk.splice(a, 1);
eD.Destroy();
return;
}
}
}
function ju() {
while (bk.length > 0) {
bk.pop().Destroy();
}
}
function mP() {
for (var a = 0; a < bk.length; a++) {
bk[a].StartLine();
bk[a].Show();
}
}
function kZ() {
for (var a = 0; a < bk.length; a++) {
bk[a].Hide();
}
}
function mV() {
for (var a = 0; a < bk.length; a++) {
bk[a].UpdateLine();
}
}
function ih(fJ, dQ, fq) {
var iX = fq - dQ + 1;
if (iX < 1) {
return null;
} else {
if (iX == 1) {
return fJ[dQ];
}
}
var dC = null;
var dl = null;
if (iX == 2) {
dC = fJ[dQ];
dl = fJ[fq];
} else {
var a = Math.round((dQ + fq) / 2);
dC = ih(fJ, dQ, a);
dl = ih(fJ, a + 1, fq);
}
if (dC != null && dl != null) {
var bu = dC.boundingRectangle;
var bs = dl.boundingRectangle;
var ez = bu[0].latitude > bs[0].latitude ? bu[0].latitude : bs[0].latitude;
var en = bu[0].longitude > bs[0].longitude ? bu[0].longitude : bs[0].longitude;
var eG = bu[1].latitude < bs[1].latitude ? bu[1].latitude : bs[1].latitude;
var ey = bu[1].longitude < bs[1].longitude ? bu[1].longitude : bs[1].longitude;
var ns = [new Msn.VE.LatLong(ez, en), new Msn.VE.LatLong(eG, ey)];
} else {
if (dC != null) {
return dC;
} else {
if (dl != null) {
return dl;
}
}
}
return null;
}
function nY() {
var nH = 6;
var qj = "#11DD11";
var rs = 4;
var i = null;
var ls = "";
var dd = true;
var my = "";
var kb = "";
var aY = 0;
var qf = 0;
var qp = 0;
var qD = 0;
var os = 0;
var dv = null;
var dB = null;
var cM = null;
var eb = null;
var dQ = 0;
var fq = 0;
var dx = null;
function ot(F, gl, gH, fl, dH, hM, nG, oM) {
if (!fl) {
fl = nH;
}
if (!dH) {
dH = qj;
}
if (!hM) {
hM = rr;
}
this.id = F;
ls = F;
my = fl + "pt";
kb = dH;
aY = hM;
dv = gl;
dB = gH;
eb = oM;
cM = nG;
qf = dv[0];
qp = dB[0];
qD = dv[dv.length - 1];
os = dB[dB.length - 1];
dx = c.MakeCopy();
ka();
}
function bZ() {
cI();
dv = dB = cM = i = dx = null;
}
function cI() {
if (i && i.parentNode == j) {
j.removeChild(i);
}
}
function aN() {
if (!dd) {
as();
return;
}
if (i) {
i.style.display = "block";
}
}
function as() {
if (i) {
i.style.display = "none";
}
}
function qA(ol) {
dd = ol;
if (!dd) {
as();
}
}
function ka() {
kG();
lz();
dx.Copy(c);
}
function ow() {
if (c.zoomLevel == dx.zoomLevel && aZ((c.center.x - dx.center.x) / q) < 0.25 && aZ((c.center.y - dx.center.y) / p) < 0.25) {
return;
}
kG();
lz();
dx = c.MakeCopy();
}
function kG() {
var jZ = p < 900 ? 900 : p;
var jn = q < 900 ? 900 : q;
ez = ix(-0.5 * jZ);
eG = ix(1.5 * jZ);
ey = hF(-0.5 * jn);
en = hF(1.5 * jn);
}
function lz() {
if (c.mapStyle == aS) {
if (i && i.parentNode == j) {
j.removeChild(i);
}
return;
}
var aW = new Array();
var go = eb.length - 1;
while (eb[go] < c.zoomLevel && go >= 0) {
go--;
}
jx(cM[go], aW);
oz(aW);
}
function jx(et, aW) {
if (oB(et.boundingRectangle[0], et.boundingRectangle[1])) {
return;
}
if (et.childRegions != null) {
for (var a = 0; a < et.childRegions.length; a++) {
jx(et.childRegions[a], aW);
}
} else {
var cH = et.indices;
var eL = new Msn.VE.LatLong(dv[cH[0]], dB[cH[0]]);
var eH;
var fv = false;
if (fR(eL.latitude, eL.longitude)) {
var fr = x.LatLongToPixel(eL, c.zoomLevel);
aW.push(fr.x - I);
aW.push(fr.y - H);
fv = true;
}
for (var fW = 1; fW < cH.length; fW++) {
eH = new Msn.VE.LatLong(dv[cH[fW]], dB[cH[fW]]);
if (fR(eH.latitude, eH.longitude)) {
if (!fv) {
var fr = x.LatLongToPixel(eL, c.zoomLevel);
aW.push(fr.x - I);
aW.push(fr.y - H);
}
fv = true;
var fs = x.LatLongToPixel(eH, c.zoomLevel);
aW.push(fs.x - I);
aW.push(fs.y - H);
} else {
if (fv) {
fv = false;
var fs = x.LatLongToPixel(eH, c.zoomLevel);
aW.push(fs.x - I);
aW.push(fs.y - H);
}
}
eL = eH;
}
}
}
function oz(aW) {
if (i && i.parentNode == j) {
j.removeChild(i);
}
i = document.createElement("v:polyline");
i.id = ls;
i.className = "Line";
i.points = aW.join(" ");
i.filled = "false";
i.style.zIndex = aY;
i.unselectable = "on";
if (dd) {
i.style.display = "block";
} else {
i.style.display = "none";
}
var dM = document.createElement("v:stroke");
dM.setAttribute("weight", my);
dM.setAttribute("joinstyle", "round");
dM.setAttribute("color", kb);
dM.setAttribute("endcap", "round");
var kV = "0.75";
if (c.mapStyle == "r") {
kV = "0.5";
}
dM.setAttribute("opacity", kV);
i.appendChild(dM);
j.appendChild(i);
}
function fR(cJ, da) {
return cJ >= eG && cJ <= ez && da >= ey && da <= en;
}
function oB(gz, fU) {
return ((gz.latitude > ez && fU.latitude > ez) || (gz.latitude < eG && fU.latitude < eG) || (gz.longitude > en && fU.longitude > en) || (gz.longitude < ey && fU.longitude < ey));
}
this.Init = ot;
this.Destroy = bZ;
this.RemoveFromMap = cI;
this.Show = aN;
this.Hide = as;
this.ChangeVisibility = qA;
this.StartLine = ka;
this.UpdateLine = ow;
}
function mF(A, L) {
eI = A;
fH = L;
jt(x.LatLongToPixel(new Msn.VE.LatLong(A, L), c.zoomLevel));
}
function pz(e) {
jt(e.center);
}
function jt(l) {
var aI = l.x - (I + af + q / 2);
var aJ = l.y - (H + ag + p / 2);
var bg = Math.sqrt(aI * aI + aJ * aJ);
if (!dV || aZ(aI) > 2 * q || aZ(aJ) > 2 * p || bg > 1.5 * Math.sqrt(q * q + p * p)) {
var e = au.MakeCopy();
e.SetCenter(l);
av(e);
return;
}
var dD = Math.atan2(aJ, aI);
var eo = cx(bg / mf);
var mI = aj(bg / eo);
aI = aj(Math.cos(dD) * mI);
aJ = aj(Math.sin(dD) * mI);
// hj(aI, aJ, eo);
}
function qh(F, cJ, da, q, p, is, iu, aY) {
var E = new pY();
E.Init(F, cJ, da, q, p, is, iu, aY);
an.push(E);
return E.pin;
}
function oH(F) {
for (var a = 0; a < an.length; a++) {
var jQ = an[a];
if (jQ.id == F) {
an.splice(a, 1);
jQ.RemoveFromMap();
return;
}
}
}
function mY() {
while (an.length > 0) {
an.pop().RemoveFromMap();
}
}
function qi() {
for (var a = 0; a < an.length; a++) {
an[a].Reposition();
}
}
function pY() {
var E = document.createElement("div");
E.vePushpin = this;
this.pin = E;
var C = 0, B = 0, O = 0, P = 0;
var bU = null;
var aK = 0;
var aM = 0;
var aL = cg + 1;
var bo = new Array(aL);
var bn = new Array(aL);
this.Init = function (F, cJ, da, q, p, is, iu, aY) {
this.id = F;
E.id = F;
E.className = is;
E.style.position = "absolute";
E.style.zIndex = aY;
E.innerHTML = iu;
// if (spPrint) {
if (!OnAMap) {
E.innerHTML = "<img style='padding-top:2px;z-index:99;' src='"+ mapserver +"i/pins/blue.gif'>";
} else {
// E.innerHTML="<img src=\"i/pins/numbers/Ngreen"+iu+".gif\" style='z-index:1;'>";
if (iu < 10) {
E.innerHTML="<div><img src=\""+ mapserver +"i/pins/numbers/Ngreen" + iu + ".gif\" style=\"position:absolute; top:8px; left:20px; z-index:2; \"></div>";
} else if (iu >= 10 && iu < 100) {
var tmp=String(iu);
E.innerHTML="<div><img src=\""+ mapserver +"i/pins/numbers/Ngreen" + tmp.substring(0,1) + ".gif\" style=\"position:absolute; top:8px; left:17px; z-index:2;\"></div><div><img src=\""+ mapserver +"i/pins/numbers/Ngreen" + tmp.substring(1,2)+".gif\" style=\"position:absolute; top:8px; left:23px; z-index:3;\"></div>";
} else if(iu >=100 && iu<1000){
var tmp=String(iu);
E.innerHTML="<div><img src=\""+ mapserver +"i/pins/numbers/Ngreen" + tmp.substring(0,1) + ".gif\" style=\"position:absolute; top:8px; left:14px; z-index:2;\"></div><div><img src=\""+ mapserver +"i/pins/numbers/Ngreen" + tmp.substring(1,2)+".gif\" style=\"position:absolute; top:8px; left:20px; z-index:3;\"></div><div><img src=\""+ mapserver +"i/pins/numbers/Ngreen" + tmp.substring(2,3)+".gif\" style=\"position:absolute; top:8px; left:26px; z-index:4;\"></div>";
}
}
// }
E.unselectable = "on";
bU = new Msn.VE.LatLong(cJ, da);
aK = q;
aM = p;
var l = x.LatLongToPixel(bU, c.zoomLevel);
if (l) {
C = aj(l.x - I);
B = aj(l.y - H);
O = C;
P = B;
cW();
es(0);
E.style.display = "block";
} else {
E.style.display = "none";
}
j.appendChild(E);
};
this.Destroy = function () {
cI();
E.vePushpin = null;
E = null;
this.pin = null;
while (bo.length > 0) {
bo.pop();
}
while (bn.length > 0) {
bn.pop();
}
};
this.GetLatitude = function () {
return bU.latitude;
};
this.GetLongitude = function () {
return bU.longitude;
};
function gV() {
var aL = cg;
for (var a = 0; a <= aL; a++) {
bo[a] = C - aK / 2;
bn[a] = B - aM / 2;
}
}
function cW() {
var aL = cg;
for (var a = 0; a <= aL; a++) {
var ah = a / aL;
var X = 1 - ah;
bo[a] = ak(X * C + ah * O - aK / 2) + "px";
bn[a] = ak(X * B + ah * P - aM / 2) + "px";
}
}
function es(a) {
E.style.left = bo[a];
E.style.top = bn[a];
}
function gI() {
var T = 0;
T = C;
C = O;
O = T;
T = B;
B = P;
P = T;
}
function bz() {
var l = x.LatLongToPixel(bU, c.zoomLevel);
if (l) {
C = aj(l.x - I);
B = aj(l.y - H);
gV();
es(0);
E.style.display = "block";
} else {
E.style.display = "none";
}
}
function mO(bM, bP, bf) {
C -= af;
B -= ag;
var l = x.LatLongToPixel(bU, bf);
if (l) {
O = aj(l.x - bM);
P = aj(l.y - bP);
cW();
E.style.display = "block";
} else {
E.style.display = "none";
}
}
function cI() {
if (E.parentNode == j) {
j.removeChild(E);
}
}
this.ClearSteps = gV;
this.PrecomputeSteps = cW;
this.SetFactor = es;
this.SwapStates = gI;
this.Reposition = bz;
this.PrepareForZoom = mO;
this.RemoveFromMap = cI;
}
var ij = 0;
var fY = 0;
var le = 0;
var ew = new Array();
ew[cY] = [325, 975];
ew[eT] = [350, 1050];
ew[eq] = [425, 1275];
ew[aS] = [450, 1350];
var bC = [0, 0, 0];
function fz(d, f, bc, s) {
var T = new nJ();
T.Init(d, f, bc, s, (d * M - I), (f * M - H));
return T;
}
function kF(ku) {
while (ku.length > 0) {
var ad = ku.pop();
ad.Destroy();
ad = null;
}
}
function or() {
var hB = 0;
for (var a = 0; a < bC.length; a++) {
hB += bC[a];
}
if (hB == 0) {
return bC;
}
var md = new Array(bC.length);
for (var a = 0; a < bC.length; a++) {
md[a] = bC[a] / hB;
}
return md;
}
function nr() {
for (var a = 0; a < bC.length; a++) {
bC[a] = 0;
}
}
function pu() {
return le / fY;
}
function nJ() {
var at = null;
var ay = null;
var bw = document.createElement("div");
var W = 0;
var ac = 0;
var eW = 0;
var Z = 0;
var aY = 0;
var aL = cg + 1;
var bo = new Array(aL);
var bn = new Array(aL);
var ei = new Array(aL);
var ep = new Array(aL);
var ho = false;
var C = 0, B = 0, cB = 0, cV = 0;
var O = 0, P = 0, ec = 0, ek = 0;
var hV = null;
this.Init = function (pT, pS, oJ, qn, d, f) {
W = pT;
ac = pS;
eW = oJ;
Z = qn;
bw.style.font = "7pt Verdana, sans-serif";
bw.style.color = "Red";
bw.style.backgroundColor = "White";
if (!x.IsValidTile(W, ac, eW)) {
return;
}
hN(d, f, M, M);
jo(d, f, M, M);
cW();
ay = new Image();
ay.onload = nf;
ay.onerror = Error;
hV = new Date();
ay.src = x.GetFilename(W, ac, eW);
};
this.Destroy = function () {
if (at) {
at.onmousedown = null;
}
cI();
while (bo.length > 0) {
bo.pop();
}
while (bn.length > 0) {
bn.pop();
}
while (ei.length > 0) {
ei.pop();
}
while (ep.length > 0) {
ep.pop();
}
bo = bn = ei = ep = null;
};
function hN(d, f, aK, aM) {
C = d;
B = f;
cB = aK;
cV = aM;
}
this.SetCurrentState = hN;
function jo(d, f, aK, aM) {
O = d;
P = f;
ec = aK;
ek = aM;
}
this.SetNextState = jo;
function gV() {
for (var a = 0; a <= cg; a++) {
bo[a] = C + "px";
bn[a] = B + "px";
ei[a] = cB + "px";
ep[a] = cV + "px";
}
}
this.ClearSteps = gV;
function cW() {
for (var a = 0; a <= cg; a++) {
var ah = a / cg;
var X = 1 - ah;
bo[a] = ak(X * C + ah * O) + "px";
bn[a] = ak(X * B + ah * P) + "px";
ei[a] = cx(X * cB + ah * ec) + "px";
ep[a] = cx(X * cV + ah * ek) + "px";
}
}
this.PrecomputeSteps = cW;
function es(a) {
if (at == null || (bi && !ho)) {
return;
}
var dg = at.style;
dg.left = bo[a];
dg.top = bn[a];
dg.width = ei[a];
dg.height = ep[a];
var gQ = bw.style;
if (ga && a == 0) {
dg.border = "1px dashed red";
gQ.left = bo[a];
gQ.top = bn[a];
}
if (at.parentNode != j) {
dg.position = "absolute";
dg.cursor = "pointer";
dg.zIndex = aY;
j.appendChild(at);
if (ga && bw.parentNode != j) {
var cj = at.src;
bw.innerHTML = cj.substring(cj.lastIndexOf("/") + 1, cj.lastIndexOf("."));
gQ.position = "absolute";
gQ.zIndex = (aY + 1);
j.appendChild(bw);
}
}
}
this.SetFactor = es;
function gI() {
var T = 0;
T = C;
C = O;
O = T;
T = B;
B = P;
P = T;
T = cB;
cB = ec;
ec = T;
T = cV;
cV = ek;
ek = T;
}
this.SwapStates = gI;
function cI() {
if (ay) {
ay.onload = null;
ay.onerror = null;
ay = null;
}
if (at) {
if (at.parentNode == j) {
j.removeChild(at);
}
at = null;
}
if (bw) {
if (bw.parentNode == j) {
j.removeChild(bw);
}
bw = null;
}
}
this.RemoveFromMap = cI;
function nf() {
if (eW != c.zoomLevel || ay == null) {
return;
}
var iT = new Date();
var eF = iT.getTime() - hV.getTime();
jU(eF);
ij += eF;
fY++;
if (ga) {
window.status = "last=" + eF + ", average=" + (ij / fY);
}
ay.onload = null;
ay.onerror = null;
at = ay;
at.onmousedown = function (b) {
return false;
};
ay = null;
if (!bi) {
es(cG);
}
}
function Error() {
if (eW != c.zoomLevel || ay == null) {
return;
}
var iT = new Date();
var eF = iT.getTime() - hV.getTime();
jU(eF);
ij += eF;
fY++;
le++;
ay.onload = null;
ay.onerror = null;
ay = null;
}
function jU(qx) {
for (var a = 0; a < ew[Z].length; a++) {
if (qx < ew[Z][a]) {
bC[a]++;
return;
}
}
bC[bC.length - 1]++;
}
function pg(cN, cy, dG, bM, bP, bf) {
hN(C - af, B - ag, cB, cV);
var iU = bf - dG;
var U = Math.pow(2, iU);
O = ak((cN + C) * U - bM);
P = ak((cy + B) * U - bP);
ec = cx((cN + C + cB) * U - bM) - O;
ek = cx((cy + B + cV) * U - bP) - P;
ho = true;
cW();
aY = fZ;
if (at != null) {
at.style.zIndex = aY;
}
}
this.PrepareBaseTile = pg;
function nD(cN, cy, dG, bM, bP, bf) {
var iU = dG - bf;
var U = Math.pow(2, iU);
O = ak((bM + C) * U - cN);
P = ak((bP + B) * U - cy);
ec = cx((bM + C + cB) * U - cN) - O;
ek = cx((bP + B + cV) * U - cy) - P;
var mn = cx(aB * 0.25);
var jK = cx(cb * 0.25);
ho = bf < dG && (W < bV + mn || W > ci - mn || ac < bL + jK || ac > ck - jK);
gI();
cW();
aY = lP;
}
this.PrepareSwapTile = nD;
function ht(az) {
if (at != null) {
at.style.border = az ? "1px dashed red" : "0px";
}
bw.style.display = az ? "block" : "none";
}
this.Debug = ht;
}
function mh() {
kF(K);
j.style.top = "0px";
j.style.left = "0px";
I = aj(c.center.x - q / 2);
H = aj(c.center.y - p / 2);
af = 0;
ag = 0;
bV = ak((I - bH) / M);
bL = ak((H - bH) / M);
ci = ak((I + q + bH) / M);
ck = ak((H + p + bH) / M);
aB = ci - bV + 1;
cb = ck - bL + 1;
// for (var f = bL; f <= ck; f++) {
// for (var d = bV; d <= ci; d++) {
// var ad = fz(d, f, c.zoomLevel, c.mapStyle);
for (var f = bL + 1; f <= bL + 2; f++) {
for (var d = bV + 1; d <= bV + 2; d++) {
var ad = fz(d, f, c.zoomLevel, c.mapStyle);
// var ad = fz(bv, bL, c.zoomLevel, c.mapStyle);
K.push(ad);
}
}
}
function pn() {
if (bi) {
return;
}
var jv = I + af;
var jq = H + ag;
var C = ak((jv - bH) / M);
var B = ak((jq - bH) / M);
var O = ak((jv + q + bH) / M);
var P = ak((jq + p + bH) / M);
while (bV < C) {
for (var f = cb - 1; f >= 0; f--) {
var ad = K.splice(f * aB, 1)[0];
ad.RemoveFromMap();
}
bV++;
aB--;
}
while (bV > C) {
bV--;
aB++;
for (var f = 0; f < cb; f++) {
var ad = fz(bV, bL + f, c.zoomLevel, c.mapStyle);
K.splice(f * aB, 0, ad);
}
}
while (bL < B) {
for (var d = 0; d < aB; d++) {
var ad = K.shift();
ad.RemoveFromMap();
}
bL++;
cb--;
}
while (bL > B) {
bL--;
cb++;
for (var d = aB - 1; d >= 0; d--) {
var ad = fz(bV + d, bL, c.zoomLevel, c.mapStyle);
K.unshift(ad);
}
}
while (ci > O) {
for (var f = cb - 1; f >= 0; f--) {
var ad = K.splice(f * aB + aB - 1, 1)[0];
ad.RemoveFromMap();
}
ci--;
aB--;
}
while (ci < O) {
ci++;
aB++;
for (var f = 0; f < cb; f++) {
var ad = fz(ci, bL + f, c.zoomLevel, c.mapStyle);
K.splice(f * aB + aB - 1, 0, ad);
}
}
while (ck > P) {
for (var d = 0; d < aB; d++) {
var ad = K.pop();
ad.RemoveFromMap();
}
ck--;
cb--;
}
while (ck < P) {
ck++;
cb++;
for (var d = 0; d < aB; d++) {
var ad = fz(bV + d, ck, c.zoomLevel, c.mapStyle);
K.push(ad);
}
}
}
function av(v) {
if (bi || aQ || cR) {
return;
}
var dZ = v.latlong;
if (v.GetViewType() == "latlongRect") {
dZ = v.latlongRect.Center();
}
x = dp;
if (v.mapStyle == "r") {
y.style.backgroundColor = "#e9e7d4";
} else {
y.style.backgroundColor = "black";
}
v.Resolve(x, q, p);
dZ = v.latlong;
au.Copy(v);
x.ValidateZoomLevel(v);
hu = x.GetBounds(v);
nT(v, hu);
v.Resolve(x, q, p);
if (v.Equals(c)) {
return;
}
var bB = v.GetX(c.zoomLevel) - c.center.x;
var by = v.GetY(c.zoomLevel) - c.center.y;
var bg = Math.sqrt(bB * bB + by * by);
var qV = (bg < q && bg < p) && (v.zoomLevel == c.zoomLevel) && dV && (v.mapStyle == c.mapStyle) && (v.sceneId == null || v.sceneId == c.sceneId);
if (qV) {
mF(dZ.latitude, dZ.longitude);
return;
}
kP = c.zoomLevel;
if (c.zoomLevel != v.zoomLevel) {
aq("onstartzoom");
bi = true;
}
var na = (bg < q && bg < p) && (v.zoomLevel == c.zoomLevel - 1 || v.zoomLevel == c.zoomLevel + 1) && dV && (v.mapStyle == c.mapStyle) && (v.sceneId == null || v.sceneId == c.sceneId);
if (na) {
var cN = I + af;
var cy = H + ag;
var dG = c.zoomLevel;
var bf = v.zoomLevel;
var bM = aj(v.center.x - q / 2);
var bP = aj(v.center.y - p / 2);
cD = K;
K = new Array();
for (var a = 0; a < cD.length; a++) {
cD[a].PrepareBaseTile(cN, cy, dG, bM, bP, bf);
}
for (var a = 0; a < an.length; a++) {
an[a].PrepareForZoom(bM, bP, bf);
}
kZ();
c.Destroy();
c = v;
mh();
for (var a = 0; a < K.length; a++) {
K[a].PrepareSwapTile(cN, cy, dG, bM, bP, bf);
}
cG = 1;
jH();
return;
}
cD = K;
K = new Array();
c.Destroy();
c = v;
kZ();
mh();
ma();
qi();
}
function jH() {
if (!bi) {
return;
}
for (var a = 0; a < cD.length; a++) {
cD[a].SetFactor(cG);
}
for (var a = 0; a < K.length; a++) {
K[a].SetFactor(cG);
}
for (var a = 0; a < an.length; a++) {
an[a].SetFactor(cG);
}
if (cG < cg) {
cG++;
window.setTimeout(jH, 1);
} else {
cG = 0;
ma();
}
}
function ma() {
kF(cD);
cD = null;
bi = false;
for (var a = 0; a < K.length; a++) {
K[a].SwapStates();
K[a].ClearSteps();
K[a].SetFactor(0);
}
for (var a = 0; a < an.length; a++) {
an[a].SwapStates();
an[a].ClearSteps();
an[a].SetFactor(0);
}
ru = null;
rj = null;
window.setTimeout(mP, 250);
if (pw != c.mapStyle) {
aq("onchangemapstyle");
}
if (kP != c.zoomLevel) {
aq("onendzoom");
}
aq("onchangeview");
try {
CollectGarbage();
}
catch (dw) {
}
}
function lG(oA, nZ, oU, ob) {
var e = au.MakeCopy();
e.sceneId = null;
e.SetLatLongRectangle(new Msn.VE.LatLongRectangle(new Msn.VE.LatLong(oA, nZ), new Msn.VE.LatLong(oU, ob)));
av(e);
}
function kQ(ct) {
if (!ct || ct.constructor != Array) {
return;
}
var ah = ct[0].latitude;
var X = ct[0].longitude;
var k = ah;
var az = X;
for (var a = 1; a < ct.length; a++) {
ah = dX(ah, ct[a].latitude);
X = dX(X, ct[a].longitude);
k = dJ(k, ct[a].latitude);
az = dJ(az, ct[a].longitude);
}
var jB = (k - ah) * 0.1;
var jX = (az - X) * 0.1;
ah -= jB;
X -= jX;
k += jB;
az += jX;
lG(jC(ah), lN(X), jC(k), lN(az));
}
function nt(A, L) {
var o = new Msn.VE.LatLong(A, L);
kQ(new Array(c.latlong, o));
}
function jC(A) {
return kn(A, jR, jW);
}
function lN(L) {
return kn(L, km, lO);
}
function kn(aL, lI, kl) {
if (aL < lI) {
return lI;
}
if (aL > kl) {
return kl;
}
return aL;
}
function rc() {
var d = null;
try {
d = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (dw) {
try {
d = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (dw) {
d = null;
}
}
if (!d && typeof XMLHttpRequest != "undefined") {
d = new XMLHttpRequest();
}
return d;
}
function qv(m) {
var e = au.MakeCopy();
e.SetZoomLevel(m);
av(e);
}
function gn() {
var e = au.MakeCopy();
e.SetZoomLevel(c.zoomLevel + 1);
av(e);
}
function gK() {
var e = au.MakeCopy();
e.SetZoomLevel(c.zoomLevel - 1);
av(e);
}
function qZ(A, L, m) {
var e = au.MakeCopy();
e.sceneId = null;
e.SetCenterLatLong(new Msn.VE.LatLong(A, L));
e.SetZoomLevel(m);
av(e);
}
function py() {
var t = [new Msn.VE.Bounds(1, 9, 0, 0, 2, 2), new Msn.VE.Bounds(10, 19, 156, 348, 321, 441), new Msn.VE.Bounds(10, 17, 28, 216, 141, 333), new Msn.VE.Bounds(10, 17, 108, 216, 361, 381), new Msn.VE.Bounds(10, 17, 56, 444, 72, 460), new Msn.VE.Bounds(10, 17, 480, 292, 520, 352)];
this.Init = function () {
};
this.Destroy = function () {
};
function fy(W, ac, m) {
var aE = 1 << m;
return W >= 0 && ac >= 0 && W < aE && ac < aE;
}
function hv(W, ac, cd) {
var jT = "";
var ao = 0;
for (var a = cd; a > 0; a--) {
ao = 0;
var eR = 1 << (a - 1);
if ((W & eR) != 0) {
ao++;
}
if ((ac & eR) != 0) {
ao += 2;
}
jT += ao + "";
}
return "http://" + c.mapStyle + ao + ".ortho.tiles.virtualearth.net/tiles/" + c.mapStyle + jT + (c.mapStyle == cY ? ".png" : ".jpeg") + "?g=" + ej[c.mapStyle];
}
function ce(m) {
return fX / ((1 << m) * M);
}
function du(l, m) {
var fj = ce(m);
var iN = l.x * fj - fC;
var jf = fC - l.y * fj;
var o = new Msn.VE.LatLong();
o.latitude = gL(Math.PI / 2 - 2 * Math.atan(Math.exp(-jf / bm)));
o.longitude = gL(iN / bm);
return o;
}
function cQ(o, m) {
var fx = Math.sin(cw(o.latitude));
var iN = bm * cw(o.longitude);
var jf = bm / 2 * Math.log((1 + fx) / (1 - fx));
var fj = ce(m);
var l = new Msn.VE.Pixel();
l.x = ((fC + iN) / fj);
l.y = ((fC - jf) / fj);
return l;
}
function dj(e) {
if (e == undefined) {
e = c;
}
var m = e.zoomLevel;
var d = e.center.x;
var f = e.center.y;
for (var a = 0; a < t.length; a++) {
var hx = m - t[a].z1;
var ab = M * Math.pow(2, hx);
var fc = t[a].x1 * ab;
var fo = t[a].x2 * ab;
var fb = t[a].y1 * ab;
var eN = t[a].y2 * ab;
if (d >= fc && d <= fo && f >= fb && f <= eN) {
if (m >= t[a].z1 && m <= t[a].z2) {
return t[a];
}
}
}
}
function hg(e) {
var d = e.center.x;
var f = e.center.y;
var fh = 0;
for (var a = 0; a < t.length; a++) {
var ab = M * Math.pow(2, e.zoomLevel - t[a].z1);
var fc = t[a].x1 * ab;
var fo = t[a].x2 * ab;
var fb = t[a].y1 * ab;
var eN = t[a].y2 * ab;
if (d >= fc && d <= fo && f >= fb && f <= eN) {
if (t[a].z2 >= e.zoomLevel) {
return;
} else {
if (t[a].z2 > fh) {
fh = t[a].z2;
}
}
}
}
e.SetZoomLevel(fh);
}
this.IsValidTile = fy;
this.GetFilename = hv;
this.MetersPerPixel = ce;
this.PixelToLatLong = du;
this.LatLongToPixel = cQ;
this.GetBounds = dj;
this.ValidateZoomLevel = hg;
}
function nu() {
var ax = document.createElement("div");
var ai = document.createElement("div");
var C = 0, B = 0, O = 0, P = 0;
this.Init = function () {
ax.className = "ZoomBox_bg";
ai.className = "ZoomBox_fg";
j.appendChild(ax);
j.appendChild(ai);
};
this.Destroy = function () {
j.removeChild(ax);
j.removeChild(ai);
};
function ld(d, f, aK, aM) {
kW(ax, d + 1, f + 1, aK, aM);
kW(ai, d, f, aK, aM);
}
function kW(cU, d, f, aK, aM) {
cU.style.left = d + "px";
cU.style.top = f + "px";
cU.style.width = aK + "px";
cU.style.height = aM + "px";
}
function aN() {
ax.style.display = "block";
ai.style.display = "block";
}
function as() {
ax.style.display = "none";
ai.style.display = "none";
}
}
this.SetCenter = hn;
this.SetMapStyle = cc;
this.GetCenterLatitude = qL;
this.GetCenterLongitude = oS;
this.GetLatitude = ix;
this.GetLongitude = hF;
this.GetY = hJ;
this.GetX = hK;
this.LatLongToPixel = cQ;
this.PixelToLatLong = du;
this.PixelToLatLongFromZoom = du1;
this.GetZoomLevel = qB;
this.GetMapStyle = oK;
this.GetMetersPerPixel = mJ;
this.Resize = qF;
this.PanToLatLong = mF;
this.AddPushpin = qh;
this.RemovePushpin = oH;
this.ClearPushpins = mY;
this.SetViewport = lG;
this.SetBestMapView = kQ;
this.IncludePointInViewport = nt;
this.SetZoom = qv;
this.ZoomIn = gn;
this.ZoomOut = gK;
this.SetCenterAndZoom = qZ;
this.AddLine = pR;
this.RemoveLine = pe;
this.ClearLines = ju;
this.AttachEvent = eu;
this.DetachEvent = ee;
this.IsAnimationEnabled = nw;
this.SetView = av;
this.Debug = ht;
this.GetResponseRangeCounts = or;
this.ResetResponseRangeCounts = nr;
this.GetFailureRate = pu;
};
Msn.VE.Bounds = function (fd, eY, C, B, O, P) {
this.z1 = fd;
this.z2 = eY;
this.x1 = C;
this.y1 = B;
this.x2 = O;
this.y2 = P;
};
Msn.VE.LatLong = function (A, L) {
this.latitude = A;
this.longitude = L;
this.ToString = function () {
return "(" + this.latitude + ", " + this.longitude + ")";
};
this.Copy = function (o) {
if (!o) {
return;
}
this.latitude = o.latitude;
this.longitude = o.longitude;
};
};
Msn.VE.LatLongRectangle = function (iz, hr) {
this.northwest = iz;
this.southeast = hr;
this.ToString = function () {
return "(" + (this.northwest ? this.northwest.ToString() : "null") + ", " + (this.southeast ? this.southeast.ToString() : "null") + ")";
};
this.Copy = function (bA) {
if (!bA) {
return;
}
if (!this.northwest) {
this.northwest = new Msn.VE.LatLong();
}
if (!this.southeast) {
this.southeast = new Msn.VE.LatLong();
}
this.northwest.Copy(bA.northwest);
this.southeast.Copy(bA.southeast);
};
this.Center = function () {
var eU = Math.sin(this.northwest.latitude * Math.PI / 180);
var eK = Math.sin(this.southeast.latitude * Math.PI / 180);
var rf = 0.25 * (Math.log((1 + eU) / (1 - eU)) + Math.log((1 + eK) / (1 - eK)));
var bU = new Msn.VE.LatLong();
bU.latitude = Math.atan(Math.exp(rf)) * 360 / Math.PI - 90;
bU.longitude = 0.5 * (this.northwest.longitude + this.southeast.longitude);
return bU;
};
this.Contains = function (o) {
return o.latitude <= iz.latitude && o.longitude >= iz.longitude && o.latitude >= hr.latitude && o.longitude <= hr.longitude;
};
};
Msn.VE.MapStyle = new function () {
this.Road = "r";
this.Aerial = "a";
this.Hybrid = "h";
this.Oblique = "o";
};
Msn.VE.MapView = function () {
this.zoomLevel = 0;
this.mapStyle = null;
this.center = new Msn.VE.Pixel();
this.latlong = new Msn.VE.LatLong();
this.pixelRect = new Msn.VE.PixelRectangle();
this.latlongRect = new Msn.VE.LatLongRectangle();
this.sceneId = null;
this.sceneOrientation = null;
var h = this;
var bE = "pixel";
this.Destroy = function () {
this.center = this.latlong = h = null;
};
this.GetViewType = function () {
return bE;
};
function qM() {
var ky = new Msn.VE.MapView();
ky.Copy(h);
return ky;
}
function np(e) {
h.zoomLevel = e.zoomLevel;
h.mapStyle = e.mapStyle;
h.center.Copy(e.center);
h.latlong.Copy(e.latlong);
h.pixelRect.Copy(e.pixelRect);
h.latlongRect.Copy(e.latlongRect);
h.sceneId = e.sceneId;
h.sceneOrientation = e.sceneOrientation;
bE = e.GetViewType();
}
function mU(e) {
return e != null && h.zoomLevel == e.zoomLevel && h.mapStyle == e.mapStyle && aZ(h.center.x - e.center.x) < 0.000001 && aZ(h.center.y - e.center.y) < 0.000001 && h.sceneId == e.sceneId && h.sceneOrientation == e.sceneOrientation;
}
function iQ() {
return "(" + h.latlong.ToString() + ", " + h.zoomLevel + ", " + h.mapStyle + ")";
}
function hn(l) {
if (!l) {
return;
}
h.center = l;
bE = "pixel";
}
function qy(o) {
if (!o) {
return;
}
h.latlong = o;
bE = "latlong";
}
function pG(mS) {
h.pixelRect = mS;
bE = "pixelRect";
}
function rd(nx) {
h.latlongRect = nx;
bE = "latlongRect";
}
function kt(m) {
if (m <= 0) {
return;
}
switch (bE) {
case "pixel":
var ab = Math.pow(2, m - h.zoomLevel);
h.center.x *= ab;
h.center.y *= ab;
break;
case "pixelRect":
var ab = Math.pow(2, m - h.zoomLevel);
h.pixelRect.topLeft.x *= ab;
h.pixelRect.topLeft.y *= ab;
h.pixelRect.bottomRight.x *= ab;
h.pixelRect.bottomRight.y *= ab;
break;
}
h.zoomLevel = m;
}
function cc(Z, bS, il) {
h.mapStyle = Z;
if (bE == "pixel") {
bE = "latlong";
}
if (Z != "o") {
h.sceneId = null;
h.sceneOrientation = null;
} else {
h.sceneId = bS;
h.sceneOrientation = il;
}
}
function hK(m) {
if (m) {
return h.center.x * Math.pow(2, m - h.zoomLevel);
}
return h.center.x;
}
function hJ(m) {
if (m) {
return h.center.y * Math.pow(2, m - h.zoomLevel);
}
return h.center.y;
}
function oX(m) {
if (m == undefined) {
return h.center;
}
return new Msn.VE.Pixel(h.GetX(m), h.GetY(m));
}
function rg(bd, q, p) {
switch (bE) {
case "pixel":
h.latlong = bd.PixelToLatLong(h.center, h.zoomLevel);
break;
case "latlong":
h.center = bd.LatLongToPixel(h.latlong, h.zoomLevel);
break;
case "pixelRect":
hR(bd, q, p);
break;
case "latlongRect":
h.zoomLevel = 12;
h.pixelRect.topLeft = bd.LatLongToPixel(h.latlongRect.northwest, h.zoomLevel);
h.pixelRect.bottomRight = bd.LatLongToPixel(h.latlongRect.southeast, h.zoomLevel);
hR(bd, q, p);
break;
}
bE = "pixel";
}
function hR(bd, q, p) {
var hS = 19;
var U = Math.pow(2, hS - h.zoomLevel);
var pf = dJ(1, aZ(h.pixelRect.topLeft.x - h.pixelRect.bottomRight.x) * U);
var qU = dJ(1, aZ(h.pixelRect.topLeft.y - h.pixelRect.bottomRight.y) * U);
var lZ = Math.log(2);
var qg = hS - Math.ceil(Math.log(pf / q) / lZ);
var pv = hS - Math.ceil(Math.log(qU / p) / lZ);
var bf = dX(qg, pv);
U = Math.pow(2, bf - h.zoomLevel);
h.center.x = 0.5 * (h.pixelRect.topLeft.x + h.pixelRect.bottomRight.x) * U;
h.center.y = 0.5 * (h.pixelRect.topLeft.y + h.pixelRect.bottomRight.y) * U;
h.zoomLevel = bf;
h.latlong = bd.PixelToLatLong(h.center, h.zoomLevel);
}
this.MakeCopy = qM;
this.Copy = np;
this.Equals = mU;
this.ToString = iQ;
this.SetCenter = hn;
this.SetCenterLatLong = qy;
this.SetPixelRectangle = pG;
this.SetLatLongRectangle = rd;
this.SetZoomLevel = kt;
this.SetMapStyle = cc;
this.GetX = hK;
this.GetY = hJ;
this.GetCenter = oX;
this.Resolve = rg;
this.SetZoomLevel = kt;
};
Msn.VE.Pixel = function (d, f) {
this.x = d;
this.y = f;
this.ToString = function () {
return "(" + this.x + ", " + this.y + ")";
};
this.Copy = function (l) {
if (!l) {
return;
}
this.x = l.x;
this.y = l.y;
};
};
Msn.VE.PixelRectangle = function (rh, pD) {
this.topLeft = rh;
this.bottomRight = pD;
this.ToString = function () {
return "(" + (this.topLeft ? this.topLeft.ToString() : "null") + ", " + (this.bottomRight ? this.bottomRight.ToString() : "null") + ")";
};
this.Copy = function (bA) {
if (!bA) {
return;
}
if (!this.topLeft) {
this.topLeft = new Msn.VE.Pixel();
}
if (!this.bottomRight) {
this.bottomRight = new Msn.VE.Pixel();
}
this.topLeft.Copy(bA.topLeft);
this.bottomRight.Copy(bA.bottomRight);
};
};