/*
Copyright 2006 NAVITIME JAPAN CO.,LTD. All Rights Reserved.
Auther by myoshida@navitime.co.jp
Version1.2.2
*/
(function() {
var Sg = new Image(450,340);
var Jv = document;
var Gi = '+VzBW8wAgZi1lh3k+-/+T09Ty5b7XeU-/+Vv1XH1cwdAaWYg-';
var Xk = '+ACY-copy+ADsAIA-2007+ACA-NAVTEQ';
function $() {
var elements = new Array();
for (var i = 0; i < arguments.length; i++) {
var element = arguments[i];
if (typeof element == 'string')
element = Jv.getElementById(element);
if (arguments.length == 1)
return element;
elements.push(element);
}
return elements;
}
function Qs(e){
if(NTUserAgent.type==1){
return e.x;
}else if(NTUserAgent.type==4){
return e.offsetX;
}else if(NTUserAgent.type==3){
return e.offsetX - s(e.target,"left");
}else{
if(e.target.x!=null){
return e.layerX - e.target.x;
}else{
return e.layerX;
}
}
};
function Zl(e){
if(NTUserAgent.type==1){
return e.y;
}else if(NTUserAgent.type==4){
return e.offsetY;
}else if(NTUserAgent.type==3){
return e.offsetY - s(e.target,"top");
}else{
if(e.target.y!=null){
return e.layerY - e.target.y;
}else{
return e.layerY;
}
}
};
function Vn(e){
if(NTUserAgent.type==1){
return e.target.className;
}else if(NTUserAgent.type==3){
return e.target.className;
}else{
return e.target.className;
}
};
function Hf(a, b) {
window[a] = b;
}
function s(a,b,c){
var r = $(a).style[b];
if(r != "" && r.indexOf("px")!= -1 && r.indexOf("px") == r.length-2){
r=r.substr(0,r.indexOf("px"));
}
if(r != "" && r.indexOf("pt") != -1 && r.indexOf("pt") == r.length-2){
r=r.substr(0,r.indexOf("pt"));
}
return isNaN(r)?r:new Number(r);
}
function Dn(a,b,c,d){
var r = Jv.createElement("DIV");
if(!a || a==""){
do{
a = "div" + Math.floor(Math.random() * 1000000000);
}while($(a) != null);
}
r.id=a;
var s = r.style;
if(b!=null){s.position=b;}
if(c!=null){s.left = isNaN(c)?c:c+'px';}
if(d!=null){s.top = isNaN(d)?d:d+'px';}
return r;
}
function Xg(u,w,h){
var r = Jv.createElement("img");
if(u!=null && u!="")r.src = u;
if(w!=null){r.width = w; r.style.width = w + "px";}
if(h!=null){r.height = h; r.style.height = h + "px";}
return r;
}
function Cu(a){
if(!a) return;
var b = a.parentNode;
var l = b.childNodes.length;
for(var i=0; i<l; i++){
if(b.childNodes[i]==a){
b.removeChild(b.childNodes[i]);
break;
}
}
}
function Ul(a){
if(!a) return;
var l = a.childNodes.length;
for(var i=l; i>=0; i--){
var cl = 0;
try{
cl = a.childNodes[i].childNodes['length'];
if(cl> 0){
Ul(a.childNodes[i]);
}
a.removeChild(a.childNodes[i]);
}catch(e){
continue;
}
}
}
function CancelBubble(e){
if(NTUserAgent.type==1){
window.event.cancelBubble=true;
window.event.returnValue=false;
}else{
e.cancelBubble=true;
if(e.preventDefault){
e.preventDefault();
}
if(e.stopPropagation){
e.stopPropagation();
}
}
}
function EmptyFunction(){};
var eventHandler = function(a){
var i=this;
return function(e){
if(!e){
e=window.event;
}
if(e&&!e.target){
e.target=e.srcElement;
}
i[a](e);
}
};
var methodHandler = function(a){
var i=this;
return function(){
var args = new Array(arguments.length);
for(var b=0; b<arguments.length; b++){
args[b] = arguments[b];
}
i[a].apply(i,args);
}
};
var _timeoutCounter=0;
function Ry(a){
a.prototype.setTimeout=function(timeoutHandler,elapseTime){
var Ie="tempVar"+_timeoutCounter;
_timeoutCounter++;
eval(Ie+" = this;");
var oi=timeoutHandler.replace(/\\/g,"\\\\").replace(/\"/g,'\\"');
return window.setTimeout(Ie+'._setTimeoutDispatcher("'+oi+'");'+Ie+" = null;",elapseTime);
};
a.prototype._setTimeoutDispatcher=function(He){
eval(He);
};
}
function scrollbar(a){
if(Jv.body){
Jv.body.scroll=a?"auto":"no"
if(window.innerHeight){
var s = Jv.body.style;
s.height=a?"auto":window.innerHeight-32
s.width=a?"auto":window.innerWidth-32
s.overflow=a?"visible":"hidden"
}
}else if(Jv.height){
if(a && Jv._height){
Jv.height=Jv._height
delete Jv._height
Jv.width=Jv._width
delete Jv._width
window.onresize=window._resize
}
if(!a){
if(!Jv._height){
Jv._height=Jv.height
Jv._width=Jv.width
window._resize=window.onresize
window.onresize=new Function("if(window._resize)_resize();scrollbar(false)")
}
Jv.height=window.innerHeight
Jv.width=window.innerWidth
}
}
}
var E = [
function(a,b){(window["onMapLoad"] || EmptyFunction)(a,b);},
function(a,b){(window["onMapMove"] || EmptyFunction)(a,b);},
function(a,b){(window["onMapZoom"] || EmptyFunction)(a,b);},
function(a,b,c){(window["onMapContext"] || EmptyFunction)(a,b,c);}
];
Array.prototype.push = function(a){
this[this.length] = a;
};
function setAlpha(a,b){
var s = a.style;
s.MozOpacity = b/100;
s.opacity = b/100;
if(s.filter && s.filter.length>0){
if(s.filter.indexOf("progid:DXImageTransform.Microsoft.Alpha(") > -1){
s.filter.match(/(.*progid:DXImageTransform.Microsoft.Alpha\(opacity=)\d+(\).*)/);
s.filter = RegExp.$1 + b + RegExp.$2;
}else{
return;
}
}else{
s.filter='progid:DXImageTransform.Microsoft.alpha(opacity='+b+')';
}
}
function Hk(b,w,h,p,c){
var a;
if(NTUserAgent.type==1 && NTUserAgent.version<7){
a = Dn(null,p ? "relative" : "absolute", 0, 0);
var s = a.style;
if(w) s.width = w+"px";
if(h) s.height = h+"px";
s.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=scale,src="+b+")";
}else{
a = Xg(b,w,h);
a.style.position="absolute";
}
if(c) a.className = c;
return a;
}
function Im(u,x,y,w,h,p,c){
var a=Dn("",p ? "relative" : "absolute", 0, 0);
a.style.overflow = "hidden";
Xu(a,w,h);
var b=Hk(u,Sg.width, Sg.height, false, c);
a.appendChild(b);
Dj(b,-x, -y);
if(c) a.className = c;
return a;
}
function Dj(a,b,c){
var s = a.style;
s.left = isNaN(b)?b:b+'px';
s.top= isNaN(c)?c:c+'px';
}
function Xu(a,b,c){
var s = a.style;
s.width= isNaN(b)?b:b+'px';
s.height = isNaN(c)?c:c+'px';
}
function Ys(a){
var Jx = document.createElement(a.tagName);
for(var i in a.style){
try{Jx.style[i] = a.style[i];}catch(e){}
}
var l = a.childNodes.length;
for(var i=0; i<l; i++){
var copyObject = Ys(a.childNodes[i]);
Jx.appendChild(copyObject);
}
if(a.innerHTML) Jx.innerHTML = a.innerHTML;
return Jx;
}
var NTHashMap = function(){
this.Ra = new Array();
};
NTHashMap.prototype = {
put: function(a,b){
var i = 0;
for (; i < this.Ra.length; i++) {
if (this.Ra[i].key == a) break;
}
this.Ra[i] = {key:a, value:b};
},
get: function(a){
for (var i = 0; i < this.Ra.length; i++) {
if (this.Ra[i].key == a) return this.Ra[i].value;
}
return null;
},
remove: function(a){
var exists = false;
var i = 0;
for (; i < this.Ra.length; i++) {
if (this.Ra[i].key == a) {
exists = true;
break;
}
}
if (exists) this.Ra.splice(i, 1);
},
size: function(a){
return this.Ra.length;
},
containsKey:function(a){
for (var i = 0; i < this.Ra.length; i++) {
if (this.Ra[i].key == a) return true;
}
return false;
},
toArray: function(a){
return this.Ra;
},
toString: function(){
if(this.size()==0){
return "";
}
var ret="{";
for (var i = 0; i < this.Ra.length; i++) {
if(ret.length > 1) ret += ",";
var a = this.Ra[i];
if(a.value != null) ret += a.key + ":" + a.value;
}
return ret + "}";
}
}
/* Copyright (C) 2006 NAVITIME JAPAN CO.,LTD. All Rights Reserved. */
var NTLatLng = function(a,b) {
this.Latitude = parseDms(a);
this.Longitude = parseDms(b);
};
NTLatLng.parse = function(a){
return new this(a.split(",")[0], a.split(",")[1]);
};
NTLatLng.prototype.getLongitude = function(){
return this.Longitude;
};
NTLatLng.prototype.getLatitude = function(){
return this.Latitude;
};
NTLatLng.prototype.getDmsLongitude = function(){
return changeDms(this.Longitude);
}
NTLatLng.prototype.getDmsLatitude = function(){
return changeDms(this.Latitude);
}
function changeDms(milsec){
var m= milsec<0?"-":"";
milsec = Math.abs(milsec);
var degree=(milsec-milsec%3600000)/3600000;
var minute=((milsec-degree*3600000)-(milsec-degree*3600000)%60000)/60000;
var second=((milsec-degree*3600000-minute*60000)-((milsec-degree*3600000-minute*60000)%1000))/1000;
var milliSecond=milsec-degree*3600000-minute*60000-second*1000;
return m + degree + "." + minute + "." + second + "." + milliSecond;
}
function parseDms(a){
var b = new String(a);
if(b.match(/[^0-9\-]/i)) {
var dms = new Array(4);
var m="", r=0 ,ret=0;
for(var i=0; i<b.length; i++){
if(b.substring(i,i+1).match(/[^0-9]/i)){
if(b.substring(i,i+1).match(/\-/i)){
m = "-";
}else{
r++;
}
continue;
}
if(dms[r]==null) dms[r] = "";
dms[r] += b.substring(i,i+1);
}
ret += new Number(dms[0]!=null ? dms[0]*3600000:0);
ret += new Number(dms[1]!=null ? dms[1]*60000:0);
ret += new Number(dms[2]!=null ? dms[2]*1000:0);
ret += new Number(dms[3]!=null ? dms[3]:0);
return m + ret;
}else{
return a;
}
}
function As(a,b,c){
if(b!=null){
a=Gk(a,b)
}
if(c!=null){
a=Mz(a,c)
}
return a
}
function Ie(a,b,c){
while(a>c){
a-=c-b
}
while(a<b){
a+=c-b
}
return a
}
function Mz(a,b){
return Math.min(a,b)
}
function Gk(a,b){
return Math.max(a,b)
}
function Tw(a){
return a*Math.PI/180
}
NTLatLng.prototype.latRadians=function(){
return Tw(As(this.Latitude/3600000,-90,90))
};
NTLatLng.prototype.lngRadians=function(){
return Tw(Ie(this.Longitude/3600000,-180,180))
};
NTLatLng.prototype.distanceFrom=function(a){
var b=this.latRadians();
var c=a.latRadians();
var d=b-c;
var e=this.lngRadians()-a.lngRadians();
var f=2*Math.asin(Math.sqrt(Math.pow(Math.sin(d/2),2)+Math.cos(b)*Math.cos(c)*Math.pow(Math.sin(e/2),2)));
return f*6378137
};
NTLatLng.DEFAULT = new NTLatLng(128390426,502963993);
/* Copyright (C) 2006 NAVITIME JAPAN CO.,LTD. All Rights Reserved. */
var NTPoint = function(x, y) {};
NTPoint.prototype.alert=function(){
};
/* Copyright (C) 2006 NAVITIME JAPAN CO.,LTD. All Rights Reserved. */
var NTColor = function(a,b,c) {
this.r=a;
this.g=b;
this.b=c;
};
NTColor.prototype.getWebCode = function(){
var r = new Number(this.r);
var g = new Number(this.g);
var b = new Number(this.b);
return r.toString(16) + g.toString(16) + b.toString(16);
};
NTColor.DEFAULT = new NTColor(0,0,150);
/* Copyright (C) 2006 NAVITIME JAPAN CO.,LTD. All Rights Reserved. */
var NTSize = function(a, b) {
this.x = Math.round(a);
this.y = Math.round(b);
};
NTSize.parse = function(a){
return new this(a.offsetWidth, a.offsetHeight);
}
/* Copyright (C) 2006 NAVITIME JAPAN CO.,LTD. All Rights Reserved. */
var NTMapStatus = function(a,b,c,d,e) {
this._ll = a;
this._size = b;
this._angle = c;
this._scale = d;
this._zoom = e;
this._touchll = new NTSize(b.x/2,b.y/2);
this._route = new Array();
this._palette = "";
this._params = new NTHashMap();
};
NTMapStatus.prototype.setPos = function(a){
this._ll = a;
};
NTMapStatus.prototype.getPos = function(){
return this._ll;
};
NTMapStatus.prototype.setSize = function(a){
this._size = a;
};
NTMapStatus.prototype.getSize = function(){
return (this._size || new NTSize(-1,-1));
};
NTMapStatus.prototype.setAngle = function(a){
this._angle = a;
};
NTMapStatus.prototype.getAngle = function(){
return this._angle;
};
NTMapStatus.prototype.setScale = function(a){
this._scale = a;
};
NTMapStatus.prototype.getScale = function(){
return this._scale;
};
NTMapStatus.prototype.setZoom = function(a){
this._zoom = a;
};
NTMapStatus.prototype.getZoom = function(){
return this._zoom;
};
NTMapStatus.prototype.setTouchPos = function(a){
this._touchll = a;
};
NTMapStatus.prototype.getTouchPos = function(){
return this._touchll;
};
NTMapStatus.prototype.addRoute = function(a){
this._route[this._route.length] = a;
};
NTMapStatus.prototype.getRoute = function(){
return this._route;
};
NTMapStatus.prototype.removeRoute = function(a){
if(a==null) return;
var b = this._route;
var r = false;
for(var i=0; i<b.length; i++){
if(a == b[i]){
b[i] =null;
r = true;
}
}
var c = new Array();
for(var i=0; i<b.length; i++){
if(b[i]==null) continue;
c[c.length]=b[i];
}
this._route = c;
return r;
};
NTMapStatus.prototype.clearRoute = function(){
this._route = new Array();
};
NTMapStatus.prototype.setPalette = function(a){
this._palette = a;
};
NTMapStatus.prototype.getPalette = function(){
return this._palette;
};
NTMapStatus.prototype.addParam = function(a,b){
this._params.put(a,b);
};
NTMapStatus.prototype.removeParam = function(a){
this._params.remove(a);
};
NTMapStatus.prototype.getParam = function(){
return this._params.toArray();
};
NTMapStatus.DEFAULT = new NTMapStatus(new NTSize(400,400),0,3,5);
NTZoomToolbar.Mode = function() {
};
NTZoomToolbar.Mode.PC = "PC";
NTZoomToolbar.Mode.MOBILE = "MOBILE";
function NTZoomToolbar(){
this.Yi = new Array();
for (var i=arguments.length-1, j=0; i >0 ; i-=2, j++) {
this.Yi[j] = new Np(arguments[i-1],arguments[i]);
}
this.Be = Jv.body;
this.Sq = null;
this.Fr= eventHandler.apply(this, ["onMouseDown"]);
this.Ee= eventHandler.apply(this, ["onMouseMove"]);
this.In= eventHandler.apply(this, ["onMouseUp"]);
this.Gd= eventHandler.apply(this, ["onMouseOver"]);
this.Yf= eventHandler.apply(this, ["onMouseOut"]);
this.Bf= eventHandler.apply(this, ["onPlusClick"]);
this.Wr= eventHandler.apply(this, ["onMinusClick"]);
this.Pn= eventHandler.apply(this, ["onRailClick"]);
this.Ff= false;
this.changedFunc = null;
this.Bz = 9;
this.Df = 0;
this.Je = 10;
this.Jj= 20;
this.Qx = NTZoomToolbar.Mode.PC;
this.Ef = undefined;
this.Oz = undefined;
}
NTZoomToolbar.DEFAULT = new NTZoomToolbar(0,2,0,5,0,12,1,5,1,8,1,16,2,3,3,2,3,5,4,2,4,4,4,8);
NTZoomToolbar.prototype.addZoom = function(a,b){
this.Yi[this.Yi.length] = new Np(a,b);
};
NTZoomToolbar.prototype.setParent = function(a){
this.Be = a;
};
NTZoomToolbar.prototype.getZoomContainer=function() {
	return this.Yi;
};
NTZoomToolbar.prototype.onChange = function(a){
this.changedFunc = a;
};
NTZoomToolbar.prototype.setStatus = function(a){
this.Sq = a;
for(var i=0; i<this.Yi.length; i++){
var z = this.Yi[i];
if(a.getScale()==z.getScale() && a.getZoom()==z.getZoom()){
this.Df = i;
break;
}
}
if(this.Df != 0){
this.scrollTo(this.Df * this.Bz + 1);
}
};
NTZoomToolbar.prototype.setScaleByPoi = function(a,b){
if(a==null || a.poi==null || a.poi.length==0) return;
var Zt=0,Xx=0,Lx=0,Pv=0,Mi,Rx;
for(var i=0; i<a.poi.length; i++){
if(a.poi[i]==null){continue;}
if(a.center == null){
if(Zt == 0 || Zt < a.poi[i].getLongitude()){ Zt=a.poi[i].getLongitude();}
if(Xx == 0 || Xx > a.poi[i].getLongitude()){ Xx=a.poi[i].getLongitude();}
if(Lx == 0 || Lx < a.poi[i].getLatitude()){ Lx=a.poi[i].getLatitude();}
if(Pv == 0 || Pv > a.poi[i].getLatitude()){ Pv=a.poi[i].getLatitude();}
}else{
if(Zt == 0 || Zt < Math.abs(a.poi[i].getLongitude() - a.center.getLongitude())){
Zt = Math.abs(a.poi[i].getLongitude() - a.center.getLongitude());
}
if(Lx == 0 || Lx < Math.abs(a.poi[i].getLatitude() - a.center.getLatitude())){
Lx = Math.abs(a.poi[i].getLatitude() - a.center.getLatitude());
}
}
}
if(a.center == null){
Mi = Math.abs(Zt - Xx)*1.1;
Rx = Math.abs(Lx - Pv)*1.1;
}else{
Mi = Zt * 2 *1.1;
Rx = Lx * 2 *1.1;
}
var processed = false;
for(var i=0; i < this.Yi.length; i++){
var s = new NTMapStatus(this.Sq.getPos(),this.Sq.getSize(),0,this.Yi[i].getScale(),this.Yi[i].getZoom());
var pxOfLon = Math.ceil(NTGeoUtil.getLonFactor(s));
var pxOfLat = Math.ceil(NTGeoUtil.getLatFactor(s));
if(this.Sq.getSize().x * pxOfLon > Mi && this.Sq.getSize().y * pxOfLat > Rx){
this.scrollTo(i * this.Bz + 1, true);
processed = true;
break;
}
}
if (!processed && b != null && b) {
this.scrollTo(this.Yi.length * this.Bz, true);
}
if(a.center==null){
return new NTLatLng(Math.round(new Number(Pv) + new Number(Lx-Pv)/2) , Math.round(new Number(Xx) + new Number(Zt - Xx)/2));
}else{
return a.center;
}
};
NTZoomToolbar.prototype.onMouseDown = function(e){
this.Uw.onMouseDown(e);
this.Ff = true;
}
NTZoomToolbar.prototype.onMouseMove = function(e){
this.Uw.onMouseMove(e);
}
NTZoomToolbar.prototype.onMouseUp = function(e){
CancelBubble(e);
if(!this.Ff) return;
var a = this.Uw.onMouseUp(e);
this.scrollTo(s(this.Ga,"top")+1);
this.Ff = false;
}
NTZoomToolbar.prototype.onRailClick = function(e){
if(e.target.parentNode != this.Hx){
return false;
}
var Pp = Zl(e);
if(NTUserAgent.type==2) Pp -=104;
if(NTUserAgent.type==3) Pp -=100;
if(NTUserAgent.type==4) Pp += e.target.offsetTop;
this.scrollTo(Pp);
};
NTZoomToolbar.prototype.scrollTo = function(a,b){
if(b==null) b=false;
var idx = Math.floor((a-1) / this.Bz);
if(idx >= this.Yi.length){
return false;
}
var ztv = this.Yi[idx];
if(this.Ga) this.Ga.style.top = idx * this.Bz + 1 + "px";
if(this.changedFunc != null){
this.changedFunc(ztv.getScale(), ztv.getZoom(),b);
}
};
NTZoomToolbar.prototype.load = function(){
var style;
this.Rq = Dn("zoomToolbar","relative",this.Je+"px",this.Jj+"px");
style = this.Rq.style;
style.zIndex=901;
style.width = "26px";
style.padding = "2px";
this.Be.appendChild(this.Rq);
if (this.Ef) {
this.Ks = Im(Sg.src, this.Ef.left, this.Ef.top, this.Ef.width, this.Ef.height, 'relative', '');
}
else {
this.Ks = Im(Sg.src, 75, 75, 25, 25, 'relative', '');
}
style = this.Ks.style;
style.left = '3px';
style.top = '2px';
this.Rq.appendChild(this.Ks);
this.Hx = Im(Sg.src, 100, 50, 25, this.Yi.length * this.Bz, 'relative', '');
style = this.Hx.style;
style.left = '3px';
style.top = '0px';
if (this.Qx != NTZoomToolbar.Mode.MOBILE) {
this.Rq.appendChild(this.Hx);
}
if (this.Oz) {
this.jJ = Im(Sg.src, this.Oz.left, this.Oz.top, this.Oz.width, this.Oz.height, 'relative', '');
}
else {
this.jJ = Im(Sg.src, 75, 50, 25, 25, 'relative', '');
}
style = this.jJ.style;
style.left = '3px';
style.top = '0px';
this.Rq.appendChild(this.jJ);
this.Ga = Im(Sg.src, 75, 100, 25, 9, 'absolute', '');
style = this.Ga.style;
style.top = '1px';
this.Hx.appendChild(this.Ga);
var Ri = this.Ga.setCapture?this.Ga:window;
NTEvent.add(this.Ga,'mousedown',this.Fr);
NTEvent.add(Ri,'mousemove',this.Ee);
NTEvent.add(Ri,'mouseup',this.In);
NTEvent.add(this.Hx, 'click', this.Pn);
NTEvent.add(this.Hx, 'touchend', this.Pn);
NTEvent.add(this.Ks,'mouseover',this.Gd);
NTEvent.add(this.jJ,'mouseover',this.Gd);
NTEvent.add(this.Ga,'mouseover',this.Gd);
NTEvent.add(this.Hx,'mouseover',this.Gd);
NTEvent.add(this.Ks,'mouseout',this.Yf);
NTEvent.add(this.jJ,'mouseout',this.Yf);
NTEvent.add(this.Ga,'mouseout',this.Yf);
NTEvent.add(this.Hx,'mouseout',this.Yf);
NTEvent.add(this.Ks,'click',this.Bf);
NTEvent.add(this.jJ,'click',this.Wr);
NTEvent.add(this.Ks,'touchend',this.Bf);
NTEvent.add(this.jJ,'touchend',this.Wr);
this.Uw = new NTMover({src:this.Ga, move:this.Ga});
this.Uw.downTarget=this.Ga;
this.Uw.setAvailableArea(new NTSize(0,1), new NTSize(0,(s(this.Hx,"height")-s(this.Ga,"height"))));
if(this.Df != 0){
this.scrollTo(this.Df * this.Bz + 1);
}
};
NTZoomToolbar.prototype.onMouseOver = function(e){
if(NTUserAgent.type==1 && NTUserAgent.version==5) return false;
e.target.style.cursor = "pointer";
};
NTZoomToolbar.prototype.onMouseOut = function(e){
if(NTUserAgent.type==1 && NTUserAgent.version==5) return false;
e.target.style.cursor = "default";
};
NTZoomToolbar.prototype.onMinusClick = function(e){
if(s(this.Ga,"top") >= this.Yi.length * this.Bz + 1){
return false;
}
this.scrollTo(s(this.Ga,"top") + this.Bz, true);
};
NTZoomToolbar.prototype.onPlusClick = function(e){
if(s(this.Ga,"top") <= 1){
return false;
}
this.scrollTo(s(this.Ga,"top") - this.Bz, true);
};
NTZoomToolbar.prototype.changeZoom = function(n) {
var a = Math.abs(n);
if(n > 0) {
if(s(this.Ga,"top") <= 1){
return false;
}
while ((s(this.Ga,"top") - this.Bz * a) < 1) {
a--;
}
this.scrollTo(s(this.Ga,"top") - this.Bz * a, true);
}
if (n < 0) {
if(s(this.Ga,"top") >= this.Yi.length * this.Bz + 1){
return false;
}
while ((s(this.Ga,"top") + this.Bz * a) >= this.Yi.length * this.Bz + 1) {
a--;
}
this.scrollTo(s(this.Ga,"top") + this.Bz * a, true);
}
}
NTZoomToolbar.prototype.getContent = function(){
return this.Rq;
};
NTZoomToolbar.prototype.setZoomImage = function(a,b) {
this.Ef = a;
this.Oz = b;
};
NTZoomToolbar.prototype.setPosition = function(a, b){
this.Je = a;
this.Jj = b;
};
NTZoomToolbar.prototype.setMode = function(a) {
this.Qx = a;
};
function Np(a,b){
this.scale = a;
this.zoom = b;
}
Np.prototype.getScale = function(){
return this.scale;
};
Np.prototype.getZoom = function(){
return this.zoom;
};
function NTScaler(a,b,c){
this.Do = b;
var top = this.Do ? s(a, "height") - 37: s(a,"height")-45;
var bottom = (c != null && c.bottom) ? c.bottom : null;
if (bottom == null) {
this._sc = Dn('NTScale',"absolute","10px",top+"px");
} else {
this._sc = Dn('NTScale',"absolute","10px");
}
var stl;
stl = this._sc.style;
stl.zIndex = 910;
stl.font = "0px Arial";
stl.backgroundColor = "#FFF";
stl.height =!this.Do ? "30px" : "18px";
if (bottom != null) {
stl.bottom = bottom + "px";
}
setAlpha(this._sc,60);
a.appendChild(this._sc);
if (!this.Do) {
if (bottom == null) {
this._barMile = Dn('NTScaleBarMile',"absolute","12px", top+5+"px");
} else {
this._barMile = Dn('NTScaleBarMile',"absolute","12px");
}
stl = this._barMile.style;
stl.zIndex = 911;
stl.border = "1px #000 solid";
stl.width = "0px";
stl.height = "6px";
stl.backgroundColor = "#FFF";
stl.fontSize = "0px";
if (bottom != null) {
stl.bottom = (bottom + 17) + "px";
}
a.appendChild(this._barMile);
if (bottom == null) {
this._textMile = Dn('NTScaleTextMile',"absolute","0px",top+2+"px");
} else {
this._textMile = Dn('NTScaleTextMile',"absolute","0px");
}
stl = this._textMile.style;
stl.zIndex = 912;
stl.color = "#555";
stl.font = "bold 10px Arial";
if (bottom != null) {
stl.bottom = (bottom + 15) + "px";
}
a.appendChild(this._textMile);
}
if (bottom == null) {
if (this.Do) {
top -= 10;
}
this._barMeter = Dn('NTScaleBarMeter',"absolute","12px", top+17+"px");
} else {
this._barMeter = Dn('NTScaleBarMeter',"absolute","12px");
}
stl = this._barMeter.style;
stl.zIndex = 911;
stl.border = "1px #000 solid";
stl.width = "0px";
stl.height = "6px";
stl.backgroundColor = "#FFF";
stl.fontSize = "0px";
if (bottom != null) {
stl.bottom = (bottom + 5) + "px";
}
a.appendChild(this._barMeter);
if (bottom == null) {
this._textMeter = Dn('NTScaleTextMeter',"absolute","0px",top+14+"px");
} else {
this._textMeter = Dn('NTScaleTextMeter',"absolute","0px");
}
stl = this._textMeter.style;
stl.zIndex = 912;
stl.color = "#555";
stl.font = "bold 10px Arial";
if (bottom != null) {
stl.bottom = (bottom + 3) + "px";
}
a.appendChild(this._textMeter);
}
NTScaler.prototype.getRange = function(a){
return Math.floor(NTGeoUtil.getLonFactor(a) * 5);
}
NTScaler.prototype.set = function(a){
var b = a.getPos();
var c = new NTLatLng(new Number(b.getLatitude()), new Number(b.getLongitude()) + this.getRange(a));
var d = b.distanceFrom(c);
var e = d*12.5;
var meter=this.of(e/1000,"Km",e,"m",1);
if (!this.Do) {
var mile=this.of(e/1609.344,"mi.",e/0.3048,"ft.",10);
this._barMile.style.width = mile.length + "px";
this._textMile.style.left = mile.length + 17 + "px";
this._textMile.innerHTML = mile.display;
}
this._barMeter.style.width = meter.length + "px";
this._textMeter.style.left = meter.length + 17 + "px";
this._textMeter.innerHTML = meter.display;
var m;
if (!this.Do) {
m = Math.max(meter.length,mile.length);
} else {
m = meter.length;
}
var n;
if (!this.Do) {
n =Math.max(this._textMile.offsetWidth,this._textMeter.offsetWidth);
} else {
n = this._textMeter.offsetWidth;
}
this._sc.style.width = m + 17 + n + "px";
};
function Vj(a){
var b=a;
if(b>1){
var c=0;
while(b>=10){
b=b/10;
c=c+1
}
if(b>=5){
b=5
}else if(b>=2){
b=2
}else{
b=1
}
while(c>0){
b=b*10;
c=c-1
}
}
return b
};
NTScaler.prototype.of=function(a,b,c,d,x){
var e=a*x;
var f=b;
var m=true;
if(e<1){
e=c;
f=d;
m=false;
}
var g=Vj(e);
var h=Math.round(125*g/(2*e));
return{
length:h,display:g+" "+f
}
};
var NTPopup = function(a,b){
this.closeClickHandler = eventHandler.apply(this, ["onCloseClick"]);
this.aG = a;
this.Ao = new Array();
this.Wg = new NTPopupFactor();
this.spaceX = 8;
this.spaceY = 24;
this.nP = false;
this.nI = 0;
this.Bc = 0;
this.Fm = 0;
this.Yx = "#FFF";
this.Gz = "#949494";
if(b){
if(b.max){
this.Bc = b.max.x;
this.Fm = b.max.y;
}
if(b.bgcolor) this.Yx = b.bgcolor;
if(b.bordercolor) this.Gz = b.bordercolor;
}
};
NTPopup.prototype = {
createDocument: function(a){
this.Be = a;
this.qS = Dn("","relative",0,0);
var s = this.qS.style;
s.cursor = "default";
s.visibility = "hidden";
this.Wg.top = Qg(25, 0, 220-(25-this.spaceX)*2, 25, 1, 0, 0, 0, this.Yx,true, this.Gz );
this.Wg.middle = Qg(0, 0, 240+20, 50-20, 0, 1, 1, 0, this.Yx,true, this.Gz );
this.Wg.bottom = Qg(25, 0, 220-(25-this.spaceX)*2, 25, 0, 0, 0, 1, this.Yx,true, this.Gz );
this.Wg.tail = Hg(Sg.src,50,0,100,50,0,-1,false,"static");
this.Wg.tail.style.visibility = "hidden";
this.Wg.topleft = Hg(Sg.src,0,0,25,25,0,0,false,"object");
this.Wg.topright = Hg(Sg.src,25,0,25,25,0,0,false,"object");
this.Wg.bottomleft = Hg(Sg.src,0,25,25,25,0,0,false,"object");
this.Wg.bottomright = Hg(Sg.src,25,25,25,25,0,0,false,"object");
this.Wg.shadow = Hg(Sg.src,150,0,300,150,0,0,false,"static");
this.Wg.shadow.style.visibility = "hidden";
this.Wg.close = Hg(Sg.src,0,50,15,15,0,0,false,"object");
this.Wg.close.style.cursor = "pointer";
NTEvent.add(this.Wg.close, 'click', this.closeClickHandler);
NTEvent.add(this.Wg.close, 'touchend', this.closeClickHandler);
var bg = this.Wg.getFactor();
for(var i=0; i< bg.length; i++){
this.qS.appendChild(bg[i]);
}
this.qS.style.position = "absolute";
this.Be.appendChild(this.qS);
this.Be.appendChild(this.Wg.tail);
this.Be.appendChild(this.Wg.shadow);
for(var o=0; o<this.nI; o++){
this.Be.appendChild(this.Ao[o].body);
}
this.setDepth();
this.resize();
return this.getDocument();
},
getDocument: function(){
return {base: this.qS, shadow: this.Wg.shadow, tail: this.Wg.tail};
},
getPos: function(){
return this.aG;
},
setPos: function(a){
this.aG = a;
},
addContent: function(a,b){
b.className = "object";
var style = b.style;
style.display = "block";
style.visibility = "hidden";
style.position = "absolute";
style.cursor = "default";
var Af = {title:a, body:b};
this.Ao.push(Af);
this.nI++;
},
getContent: function(){
return this.Ao;
},
setClassName: function(tagName,cName,o){
var inputs = o.getElementsByTagName(tagName);
if(inputs){
for(var i in inputs){
inputs[i].className=cName;
}
}
},
replaceContent: function(a){
for(var o=0; o<this.nI; o++){
this.Ao[o].body.style.display="none";
this.Ao[o].body.style.visibility="hidden";
var len = this.Ao[o].body.childNodes.length;
for(var i=len - 1; i>=0; i--){
this.Ao[o].body.removeChild(this.Ao[o].body.childNodes[i]);
}
}
this.Ao = new Array();
this.nI = 0;
this.setClassName('input','innerPopup',a.body);
this.setClassName('button','innerPopup',a.body);
this.addContent(a.title, a.body);
for(var o=0; o<this.nI; o++){
this.Be.appendChild(this.Ao[o].body);
}
this.setDepth();
this.resize();
},
resize: function(a,b){
var Rg;
if(!a && !b){
if(this.nI == 0) return;
var Bc=130, Fm=50;
for(var i=0; i<this.nI; i++){
Sa = this.Ao[i].body;
Rg = Sa.style;
Rg.position = "relative";
if(Sa.offsetWidth > Bc){
if(this.Bc > 0 && Sa.offsetWidth > this.Bc){
Bc = this.Bc<130?130:this.Bc;
Rg.width = this.Bc + "px";
}else{
Bc = Sa.offsetWidth<150?150:Sa.offsetWidth;
Rg.width = Bc+"px";
}
}else{
Rg.width = Bc+"px";
}
if(Sa.offsetHeight > Fm){
if(this.Fm>0 && Sa.offsetHeight > this.Fm){
Fm = this.Fm;
Rg.height = this.Fm - this.spaceY + "px";
Rg.overflow = "auto";
}else{
Fm = Sa.offsetHeight;
Rg.height = Fm+"px";
}
}
Rg.position = "absolute";
}
a = Bc;
b = Fm;
}
Xu(this.Wg.middle, a+(this.spaceX*2)-2, b-(25-this.spaceY/2));
Xu(this.Wg.top, a-(25-this.spaceX)*2, 24);
Xu(this.Wg.bottom, a-(25-this.spaceX)*2,24);
Dj(this.Wg.topright, a + this.spaceX -(25 - this.spaceX), 0);
Dj(this.Wg.bottomleft, 0, b+(this.spaceY/2));
Dj(this.Wg.bottomright, a + this.spaceX -(25 - this.spaceX), b+(this.spaceY/2));
Dj(this.Wg.tail, (a-100)/2+this.spaceX,-1);
Dj(this.Wg.shadow, Bc/2 - 50, this.qS.offsetHeight - this.Wg.shadow.offsetHeight);
Dj(this.Wg.close, Bc+this.spaceX-this.Wg.close.offsetWidth, 5);
Rg = this.qS.style;
Rg.width = a + this.spaceX * 2 + "px";
Rg.height = this.Wg.top.offsetHeight + this.Wg.middle.offsetHeight + this.Wg.bottom.offsetHeight + "px";
Rg.overflow = "hidden";
},
setDepth: function(a){
this.qS.style.zIndex = (a||460);
this.Wg.tail.style.zIndex = (a||460)+20;
this.Wg.shadow.style.zIndex = (a||400)-200;
for(var o=0; o<this.nI; o++){
this.Ao[o].body.style.zIndex = (a||400)+60;
}
},
open: function(){
this.qS.style.visibility = "visible";
this.Wg.tail.style.visibility = "visible";
this.Wg.shadow.style.visibility = "visible";
this.nP = true;
if(this.nI>0) this.Ao[0].body.style.visibility = "visible";
},
close: function(){
this.qS.style.visibility = "hidden";
this.Wg.tail.style.visibility = "hidden";
this.Wg.shadow.style.visibility = "hidden";
this.nP = false;
for(var i=0; i<this.nI; i++){
this.Ao[i].body.style.visibility = "hidden";
}
},
foreground: function(){
this.qS.style.zIndex |= 100;
var bg = this.Wg.getFactor();
for(var i=0; i< bg.length; i++){
bg[i].style.zIndex |= 100;
}
for(var i=0; i<this.nI; i++){
this.Ao[i].body.style.zIndex|=100;
}
},
back: function(){
this.qS.style.zIndex &=~ 100;
var bg = this.Wg.getFactor();
for(var i=0; i< bg.length; i++){
bg[i].style.zIndex &=~ 100;
}
for(var i=0; i<this.nI; i++){
this.Ao[i].body.style.zIndex &=~ 100;
}
},
remove: function(){
if(this.Wg.tail) Cu(this.Wg.tail);
if(this.Wg.shadow) Cu(this.Wg.shadow);
this.aG = null;
this.Ao = null;
this.nI = 0;
this.Bc = null;
this.Fm = null;
this.Yx = null;
this.Gz = null;
this.nP = null;
this.Wg.remove();
this.Wg = null;
if(this.qS) Cu(this.qS);
this.qS = null;
},
onCloseClick: function(){
this.close();
},
hide: function(){
if(this.nP){
this.qS.style.visibility = "hidden";
this.Wg.tail.style.visibility = "hidden";
this.Wg.shadow.style.visibility = "hidden";
for(var i=0; i<this.nI; i++){
this.Ao[i].body.style.visibility = "hidden";
}
}
},
visible: function(){
if(this.nP){
this.qS.style.visibility = "visible";
this.Wg.tail.style.visibility = "visible";
this.Wg.shadow.style.visibility = "visible";
for(var i=0; i<this.nI; i++){
this.Ao[i].body.style.visibility = "visible";
}
}
},
isAvalable: function(){
return (this.qS != null);
},
decorate: function(Bt){
if(Bt.border){
this.Wg.top.style.borderColor = Bt.border;
this.Wg.middle.style.borderColor = Bt.border;
this.Wg.bottom.style.borderColor = Bt.border;
}
if(Bt.color){
this.Wg.top.style.backgroundColor = Bt.color;
this.Wg.middle.style.backgroundColor = Bt.color;
this.Wg.bottom.style.backgroundColor = Bt.color;
}
if(Bt.max){
this.Bc = Bt.max.x;
this.Fm = Bt.max.y;
}
},
moveTo: function(a){
Dj(this.qS, a.x - this.qS.offsetWidth/2 - s(this.Be, "left"), a.y - this.qS.offsetHeight - this.Wg.tail.offsetHeight - s(this.Be,"top")+1);
Dj(this.Wg.tail, a.x - 50 - s(this.Be, "left"), a.y - this.Wg.tail.offsetHeight - s(this.Be, "top"));
Dj(this.Wg.shadow, a.x - 50 - s(this.Be, "left"), a.y - this.Wg.shadow.offsetHeight - s(this.Be, "top"));
for(var i=0; i<this.nI; i++){
Dj(this.Ao[i].body, a.x - this.qS.offsetWidth/2 - s(this.Be,"left") + this.spaceX, a.y - this.qS.offsetHeight - this.Wg.tail.offsetHeight - s(this.Be,"top") + this.spaceY);
}
}
};
function Hg(u,fD,Ny,w,h,x,y,p,c){
var t = Im(u, fD, Ny, w, h, p, c);
var stl = t.style;
if(x) stl.left = x + "px";
if(y) stl.top = y + "px";
return t;
};
function Qg(x,y,w,h,nV,Ir,rW,gS,c,Nu,Wk){
var t = Dn("", Nu ? "relative" : "absolute", x ,y);
var stl = t.style;
stl.fontSize = "0";
if(nV && nV>0){
stl.borderTop = nV + "px " + Wk + " solid";
h -= 1;
}
if(Ir && Ir>0){
stl.borderLeft = Ir + "px " + Wk + " solid";
w -= 1;
}
if(rW && rW>0){
stl.borderRight = rW + "px " + Wk + " solid";
w -= 1;
}
if(gS && gS>0){
stl.borderBottom = gS + "px " + Wk + " solid";
h -=1 ;
}
Xu(t,w,h);
stl.backgroundColor = c;
t.className = "object";
return t;
};
var NTPopupFactor = function(){
this.topleft =Dn('',"absolute", 0, 0);
this.topright =Dn('',"absolute", 0, 0);
this.bottomleft =Dn('',"absolute", 0, 0);
this.bottomright =Dn('',"absolute", 0, 0);
this.top =Dn('',"relative", 0, 0);
this.middle =Dn('',"relative", 0, 0);
this.bottom =Dn('',"relative", 0, 0);
this.tail =Dn('',"absolute", 0, 0);
this.shadow =Dn('',"absolute", 0, 0);
this.close =Dn('',"absolute", 0, 0);
};
NTPopupFactor.prototype.getFactor = function(){
return [this.top, this.middle, this.bottom,this.topleft, this.topright, this.bottomleft, this.bottomright, this.close];
};
NTPopupFactor.prototype.remove = function(){
this.topleft = null;
this.topright = null;
this.bottomleft = null;
this.bottomright = null;
this.top = null;
this.middle = null;
this.bottom = null;
this.tail = null;
this.shadow = null;
this.close = null;
};
var NTEvent = function(){};
NTEvent.observers = [];
NTEvent.add = function(element, name, observer, useCapture){
var element = $(element);
useCapture = useCapture || false;
if (name == 'keypress' && (navigator.appVersion.match(/Konqueror|Safari|KHTML/) || element.attachEvent)){
name = 'keydown';
}
var hundler = function(e){
if(!e){
e=window.event;
}
if(e&&!e.target){
e.target=e.srcElement;
}
observer.call(element,e);
};
this._observeAndCache(element, name, hundler, useCapture);
};
NTEvent._observeAndCache = function(element, name, observer, useCapture) {
if (!this.observers){
this.observers = [];
}
if (element.addEventListener) {
this.observers.push([element, name, observer, useCapture]);
element.addEventListener(name, observer, useCapture);
} else if (element.attachEvent) {
this.observers.push([element, name, observer, useCapture]);
element.attachEvent('on' + name, observer);
}
};
NTEvent.unloadCache = function() {
if (!NTEvent.observers){
return;
}
for (var i = 0; i < NTEvent.observers.length; i++){
NTEvent.stopObserving.apply(this, NTEvent.observers[i]);
NTEvent.observers[i][0] = null;
}
NTEvent.observers = false;
};
NTEvent.remove = function(element, name){
if (!NTEvent.observers){
return;
}
var newObservers = [];
for (var i = 0; i < NTEvent.observers.length; i++){
if(NTEvent.observers[i][0] == element && (!name || (name && NTEvent.observers[i][1] == name))){
NTEvent.stopObserving.apply(this, NTEvent.observers[i]);
NTEvent.observers[i][0] = null;
}else{
newObservers[newObservers.length] = NTEvent.observers[i];
}
}
NTEvent.observers = newObservers;
};
NTEvent.stopObserving = function(element, name, observer, useCapture) {
var element = $(element);
useCapture = useCapture || false;
if (name == 'keypress' && (navigator.appVersion.match(/Konqueror|Safari|KHTML/) || element.detachEvent)){
name = 'keydown';
}
if (element.removeEventListener) {
element.removeEventListener(name, observer, useCapture);
} else if (element.detachEvent) {
element.detachEvent('on' + name, observer);
}
}
NTEvent.add(window, 'unload', NTEvent.unloadCache);
var NTUserAgent = function(){}
NTUserAgent.type="";
NTUserAgent.version="";
NTUserAgent.os="";
NTUserAgent.subtype="";
NTUserAgent.minorVersion="";
(function(){
var type=0;
var version=0;
var subtype=null;
var os=null;
var ua=navigator.userAgent.toLowerCase();
if(ua.indexOf("opera")!=-1){
type=4;
version=9;
if(ua.indexOf("opera/7")!=-1||ua.indexOf("opera 7")!=-1){
version=7;
}else if(ua.indexOf("opera/8")!=-1||ua.indexOf("opera 8")!=-1){
version=8;
}else if(ua.indexOf("opera/9")!=-1||ua.indexOf("opera 9")!=-1){
version=9;
var uaStr = new String(ua);
NTUserAgent.minorVersion = uaStr.substring(ua.indexOf("opera") + "opera".length + 3,ua.indexOf("opera") + "opera".length + 5);
if(NTUserAgent.minorVersion.substring(1) == " "){
NTUserAgent.minorVersion = NTUserAgent.minorVersion.substring(0,1) + "0";
}
}
}else if(ua.indexOf("msie")!=-1&&document.all){
type=1;
version=6;
if(ua.indexOf("msie 5")!=-1){
version=5;
}
}else if(ua.indexOf("safari")!=-1){
type=3;
}else if(ua.indexOf("mozilla")!=-1){
type=2;
if(ua.indexOf("firefox")!=-1){
subtype=1;
version=1.5;
if(ua.indexOf("firefox/1.0")!=-1){
version=1.0;
}
}else if(ua.indexOf("netscape")!=-1){
subtype=2;
}else if(ua.indexOf("seamonkey")!=-1){
subtype=4;
}else{
subtype=3;
version=1.8;
if(ua.indexOf("rv:1.7")!=-1){
version=1.7;
}
}
}
if(ua.indexOf("x11;")!=-1){
os=1;
}else if(ua.indexOf("macintosh")!=-1){
os=2;
}
NTUserAgent.type=type;
NTUserAgent.version=version;
NTUserAgent.os=os;
NTUserAgent.subtype=subtype;
})();
var NTMapCtrl = function(a){
this.src = a;
this.moveX = s(a, "left");
this.moveY = s(a, "top");
this.reachX = 0;
this.reachY = 0;
this.timeoutId = "";
this.endFunction;
};
NTMapCtrl.prototype.autoScrollTo=function(x,y,func){
if(x!=null) this.reachX = Math.round(x);
if(y!=null) this.reachY = Math.round(y);
if(func!=null){
this.endFunction = func;
}
var speed = (NTUserAgent.type==4 || NTUserAgent.type==2)?2:3;
var x1 = new Number(s(this.src,"left"));
var x2 = new Number(this.reachX)-x1;
var x3 = Math.abs(x2/speed)<1? (x2>0)?1:-1 : x2/speed;
var y1 = new Number(s(this.src, "top"));
var y2 = new Number(this.reachY)-y1;
var y3 = Math.abs(y2/speed)<1? (y2>0)?1:-1 : y2/speed;
if(Math.abs(x2) <= 1){
//this.src.style.left = this.reachX + "px";
}else{
//this.src.style.left = Math.round(x1 + x3)+ "px";
}
if(Math.abs(y2) <= 1){
//this.src.style.top = this.reachY + "px";
}else{
//this.src.style.top = Math.ceil(y1 + y3) + "px";
}
//if(s(this.src,"left")==this.reachX && s(this.src,"top")==this.reachY){
//alert("test");
clearTimeout(this.timeoutId);
if(this.endFunction) this.endFunction();
return false;
//}
//this.timeoutId = this.setTimeout("this.autoScrollTo()",10);
};
NTMapCtrl.prototype.autoMove = function(){
};
var NTMapScaleCtrl = function(a){
this.src = a;
this.startPos = new NTSize(s(a, "left"), s(a, "top"));
this.startSiz = new NTSize(a.offsetWidth, a.offsetHeight);
var stl = a.style;
stl.width = this.startSiz.x + "px";
stl.height = this.startSiz.y + "px";
this.endPos = null;
this.endSiz = null;
this.alpha = 100;
this.timeoutId = "";
this.endFunction;
};
NTMapScaleCtrl.prototype = {
autoChangeScale: function(a,c,z,func){
var speed = NTUserAgent.type==1?5:3;
if(a != null && c != null && z != null){
var gH = new NTSize(NTGeoUtil.getLonFactor(a) , NTGeoUtil.getLatFactor(a));
a.setScale(c);
a.setZoom(z);
var Yk = new NTSize(NTGeoUtil.getLonFactor(a) , NTGeoUtil.getLatFactor(a));
var Lj = gH.x/Yk.x;
var Gt = gH.y/Yk.y;
if(Lj > 5 || Lj < 0.2){
if(this.endFunction) this.endFunction();
return;
}
this.endSiz = new NTSize(Math.floor(this.startSiz.x * Lj),Math.floor(this.startSiz.y * Gt));
this.endPos = new NTSize(this.startPos.x - (Math.floor(this.startSiz.x * Lj)-this.startSiz.x)/2 , this.startPos.y - (Math.floor(this.startSiz.y * Gt)-this.startSiz.y)/2);
}
if(func!=null){
this.endFunction = func;
}
var x1 = new Number(s(this.src, "left"));
var x2 = new Number(this.endPos.x)-x1;
var x3 = Math.abs(x2/speed)<1? (x2>0)?1:-1 : x2 / speed;
var y1 = new Number(s(this.src, "top"));
var y2 = new Number(this.endPos.y)-y1;
var y3 = Math.abs(y2/speed)<1? (y2>0)?1:-1 : y2/speed;
var w1 = new Number(s(this.src, "width"));
var w2 = new Number(this.endSiz.x) - this.src.offsetWidth;
var w3 = Math.abs(w2/speed)<1? (w2>0)?1:-1 : w2/speed;
var h1 = new Number(s(this.src, "height"));
var h2 = new Number(this.endSiz.y) - this.src.offsetHeight;
var h3 = Math.abs(h2/speed)<1? (h2>0)?1:-1 : h2/speed;
var stl = this.src.style;
if(Math.abs(x2) <= 1){
stl.left = this.endPos.x + "px";
}else{
stl.left = Math.round(x1 + x3)+ "px";
}
if(Math.abs(y2) <= 1){
stl.top = this.endPos.y + "px";
}else{
stl.top = Math.ceil(y1 + y3) + "px";
}
if(Math.abs(w2) <= 1){
stl.width = this.endSiz.x + "px";
}else{
stl.width = Math.round(w1 + w3)+ "px";
}
if(Math.abs(h2) <= 1){
stl.height = this.endSiz.y + "px";
}else{
stl.height = Math.ceil(h1 + h3) + "px";
}
this.alpha -= 3;
setAlpha(this.src, this.alpha);
if(s(this.src, "left")==this.endPos.x && s(this.src, "top")==this.endPos.y){
this.stop();
return;
}
this.timeoutId = this.setTimeout("this.autoChangeScale()",10);
},
autoChangeScaleToPoint: function(a,c,z,func){
var speed = NTUserAgent.type==1?5:3;
if(a != null && c != null && z != null){
var gH = new NTSize(NTGeoUtil.getLonFactor(a) , NTGeoUtil.getLatFactor(a));
a.setScale(c);
a.setZoom(z);
var Yk = new NTSize(NTGeoUtil.getLonFactor(a) , NTGeoUtil.getLatFactor(a));
var Lj = gH.x/Yk.x;
var Gt = gH.y/Yk.y;
if(Lj > 5 || Lj < 0.2){
if(this.endFunction) this.endFunction();
return;
}
var p = NTGeoUtil.LonLat2Pixel(a.getPos(),a);
var rX = a.getTouchPos().x/p.x;
var rY = a.getTouchPos().y/p.y;
this.endSiz = new NTSize(Math.floor(this.startSiz.x * Lj),Math.floor(this.startSiz.y * Gt));
this.endPos = new NTSize(this.startPos.x - (Math.floor(this.startSiz.x * Lj)-this.startSiz.x)/2*rX , this.startPos.y - (Math.floor(this.startSiz.y * Gt)-this.startSiz.y)/2*rY);
this.status = a;
}
if(func!=null){
this.endFunction = func;
}
var x1 = new Number(s(this.src, "left"));
var x2 = new Number(this.endPos.x)-x1;
var x3 = Math.abs(x2/speed)<1? (x2>0)?1:-1 : x2 / speed;
var y1 = new Number(s(this.src, "top"));
var y2 = new Number(this.endPos.y)-y1;
var y3 = Math.abs(y2/speed)<1? (y2>0)?1:-1 : y2/speed;
var w1 = new Number(s(this.src, "width"));
var w2 = new Number(this.endSiz.x) - this.src.offsetWidth;
var w3 = Math.abs(w2/speed)<1? (w2>0)?1:-1 : w2/speed;
var h1 = new Number(s(this.src, "height"));
var h2 = new Number(this.endSiz.y) - this.src.offsetHeight;
var h3 = Math.abs(h2/speed)<1? (h2>0)?1:-1 : h2/speed;
var stl = this.src.style;
if(Math.abs(x2) <= 1){
stl.left = this.endPos.x + "px";
}else{
stl.left = Math.round(x1 + x3)+ "px";
}
if(Math.abs(y2) <= 1){
stl.top = this.endPos.y + "px";
}else{
stl.top = Math.ceil(y1 + y3) + "px";
}
if(Math.abs(w2) <= 1){
stl.width = this.endSiz.x + "px";
}else{
stl.width = Math.round(w1 + w3)+ "px";
}
if(Math.abs(h2) <= 1){
stl.height = this.endSiz.y + "px";
}else{
stl.height = Math.ceil(h1 + h3) + "px";
}
this.alpha -= 3;
setAlpha(this.src, this.alpha);
if(s(this.src, "left")==this.endPos.x && s(this.src, "top")==this.endPos.y){
this.stop();
this.status.setTouchPos(new NTSize(this.status.getSize().x/2,this.status.getSize().y/2));
return;
}
this.timeoutId = this.setTimeout("this.autoChangeScaleToPoint()",10);
},
iswork: function(){
return (this.timeoutId!="");
},
stop: function(){
clearTimeout(this.timeoutId);
this.timeoutId = "";
if(this.endFunction) this.endFunction();
}
}
var NTResizer = function(a){
this.src = a;
this.reachW = 0;
this.reachH = 0;
this.timeoutId = "";
this.endFunction;
};
NTResizer.prototype.autoResize=function(initw,inith,endw,endh,func){
var stl = this.src.style;
if(initw) stl.width = initw + "px";
if(inith) stl.height = inith + "px";
if(endw) this.reachW = Math.round(endw);
if(endw) this.reachH = Math.round(endh);
if(func!=null){
this.endFunction = func;
}
var x1 = new Number(s(this.src,"width"));
var x2 = new Number(this.reachW)-x1;
var x3 = Math.abs(x2/5)<1? (x2>0)?1:-1 : x2/5;
var y1 = new Number(s(this.src,"height"));
var y2 = new Number(this.reachH)-y1;
var y3 = Math.abs(y2/5)<1? (y2>0)?1:-1 : y2/5;
if(Math.abs(x2) <= 1){
stl.width = this.reachW + "px";
}else{
stl.width = Math.round(x1 + x3)+ "px";
}
if(Math.abs(y2) <= 1){
stl.height = this.reachH + "px";
}else{
stl.height = Math.ceil(y1 + y3) + "px";
}
if(s(this.src,"width")==this.reachW && s(this.src,"height")==this.reachH){
clearTimeout(this.timeoutId);
if(this.endFunction) this.endFunction();
return false;
}
this.timeoutId = this.setTimeout("this.autoResize()",10);
};
/* Copyright (C) 2006 NAVITIME JAPAN CO.,LTD. All Rights Reserved. */
var NTMapIcon = function(a,b,c,d) {
this.aG=a;
this.Ey = b;
this.Oy = d;
this.Ak = c;
this.Zn;
this.Tp;
this.Ni;
this.Cj = new Array();
this.pN = 7;
this.Initialize();
};
NTMapIcon.prototype = {
Initialize: function(){
this.Zn = Hk(this.Ey.src, this.Ey.width,this.Ey.height);
this.Zn.className = (this.Ak !=null && this.Ak != "") ? "object" : "static";
this.Zn.style.visibility = "hidden";
if(this.Oy){
this.Tp = Hk(this.Oy.src, this.Oy.width,this.Oy.height);
this.Tp.className = "static";
this.Tp.style.visibility = "hidden";
}
},
addDocument: function(a,b){
this._parent = a;
this._zindex = b;
this.Zn.style.zIndex=this._zindex;
this._parent.appendChild(this.Zn);
this.Up = document.createElement("div");
this.Up.className="object";
this.Up.style.position = "absolute";
this.Up.style.width = this.Zn.offsetWidth+"px";
this.Up.style.height = this.Zn.offsetHeight+"px";
this.Up.style.zIndex = 440;
this._parent.appendChild(this.Up);
for(var e = 0; e < this.Cj.length; e++){
NTEvent.add(this.Up, this.Cj[e].type, this.Cj[e].func);
}
if(this.Tp){
this.Tp.style.zIndex=this._zindex-200;
this._parent.appendChild(this.Tp);
}
},
addEvent: function(a,b){
this.Cj.push({type:a, func:b});
},
removeEvent: function(){
},
getEvent: function(a){
if(a!=null){
for(e in this.Cj){
if(e.type == a) return e.func;
}
return function(){};
}
return this.Cj;
},
getId: function(){return this.Ak;},
getImage: function(){return this.Zn;},
getCather: function(){return this.Up;},
getShadow: function(){return this.Tp;},
getPos: function(){return this.aG;},
remove: function(){
var len = this._parent.childNodes.length;
for(var i=0; i<len; i++){
if(this._parent.childNodes[i]==this.Zn){
this._parent.removeChild(this._parent.childNodes[i]);
}
if(this.Tp != null && this._parent.childNodes[i]==this.Tp){
this._parent.removeChild(this._parent.childNodes[i]);
}
}
if (this.Up) {
this._parent.removeChild(this.Up);
}
this.Zn = null;
this.Tp = null;
},
rebuild: function(){
this.Initialize();
this.addDocument(this._parent,this._zindex);
},
hide: function(){
if(!this.Zn) return;
this.Zn.style.visibility = "hidden";
if(this.Tp) this.Tp.style.visibility = "hidden";
},
visible: function(){
if(!this.Zn) return;
this.Zn.style.visibility = "visible";
if(this.Tp) this.Tp.style.visibility = "visible";
},
setGroup: function(a){
this.Ni = a;
},
getGroup: function(){
return this.Ni;
},
setIconPosition: function(a){
this.pN = a;
},
getIconPosition: function(){
return this.pN;
}
}
/* Copyright (C) 2006 NAVITIME JAPAN CO.,LTD. All Rights Reserved. */
var NTImage = function(a,b,c) {
this.src=a;
this.width=b;
this.height=c;
};
NTImage.prototype.getImage = function(){
return Xg(this.src,this.width,this.height);
}
/* Copyright (C) 2006 NAVITIME JAPAN CO.,LTD. All Rights Reserved. */
var NTGeoUtil = function() {};
NTGeoUtil.JP = function(a){
if(a.getLongitude() > 441230691 && a.getLatitude() > 86737111 && a.getLongitude() < 525430675 && a.getLatitude() < 165297104){
return true;
}
return false;
}
NTGeoUtil.getLonFactor = function(a){
var b = new Array(200000,33333.3,2727.27,818.181,163.636);
return b[a.getScale()]/a.getZoom();
};
NTGeoUtil.getLatFactor = function(a){
if(NTGeoUtil.JP(a.getPos())){
var b = new Array(160000,26666.6,2222.22,666.666,133.333);
return b[a.getScale()]/a.getZoom();
}
var wmesh = 0;
wmesh = this.getWorldMesh(a.getPos().getLatitude());
return this.getCurvature(a.getScale(),wmesh)/a.getZoom();
};
NTGeoUtil.pixel2LonLat = function(size,status){
var moveX,x1,x2,x2_1,x2_2;
var moveY,y1,y2,y2_1,y2_2;
if(status.getAngle() == 0){
moveX = size.x;
}else{
if(status.getAngle() < 90){
x1 = size.y; x2 = -size.x;
}else if(status.getAngle() < 180){
x1 = -size.x; x2 = -size.y;
}else if(status.getAngle() < 270){
x1 = -size.y; x2 = size.x;
}else{
x1 = size.x; x2 = size.y;
}
r = (status.getAngle() % 90) * (3.14/180);
x2_1 = x1 * Math.tan(r);
x2_2 = x2 - x2_1;
moveX = -Math.round(x2_2 * Math.cos(r) );
}
var lon = Math.round(moveX * this.getLonFactor(status));
if(status.getAngle() == 0){
moveY = size.y;
}else{
if(status.getAngle() < 90){
y1 = size.y; y2 = -size.x;
}else if(status.getAngle() < 180){
y1 = -size.x; y2 = -size.y;
}else if(status.getAngle() < 270){
y1 = -size.y; y2 = size.x;
}else{
y1 = size.x; y2 = size.y;
}
r = (status.getAngle() % 90) * (3.14/180);
y2_1 = y1 * Math.tan(r);
y2_2 = y2 - y2_1;
moveY = Math.round(y1 / Math.cos(r) + (y2_2 * Math.sin(r)) );
}
var lat = Math.round(moveY * this.getLatFactor(status));
return new NTLatLng(new Number(status.getPos().getLatitude()) - new Number(lat), new Number(status.getPos().getLongitude()) + new Number(lon));
};
NTGeoUtil.LonLat2Pixel = function(a,b){
var s = b.getSize();
var p = b.getPos();
var xx = this.pixel2LonLat(new NTSize(s.x,s.y/2),b).getLongitude()-p.getLongitude();
var yx = a.getLongitude() - p.getLongitude();
var zx = Math.round((yx/xx) * s.x + (s.x/2));
var xy = p.getLatitude() - this.pixel2LonLat(new NTSize(s.x/2,s.y),b).getLatitude();
var yy = p.getLatitude() - a.getLatitude();
var zy = Math.round((yy/xy) * s.y + (s.y/2));
return new NTSize(zx,zy);
};
NTGeoUtil.getWorldMesh = function(a){
/*
for(var i=169; i<=270; i++){
if((81600000 + (i-168) * 2400000) > a){
return i;
}
}
return -1;
*/
return Math.round((a/3600000) * 3/2) + 134;
};
NTGeoUtil.CURVATURE = [0,0,0,0,0,0,0,0,1220,1220,1220,1220,1159,1098,1035,961,895,833,775,720,659,610,565,542,520,499,482,466,451,438,426,412,399,389,377,366,357,349,342,336,329,323,317,311,305,299,293,287,281,275,265,261,257,254,250,248,245,242,239,235,232,229,226,222,218,216,214,211,209,206,205,204,201,200,199,198,195,194,193,192,189,187,185,184,182,181,178,176,173,171,168,167,166,165,163,162,161,160,159,157,156,155,153,153,153,153,153,153,151,151,151,151,151,151,151,149,149,149,149,149,149,149,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,147,148,148,148,148,148,148,149,149,149,149,149,149,150,150,150,150,150,150,151,151,151,151,151,151,153,153,153,153,153,153,155,156,157,159,160,161,162,163,165,166,167,168,171,173,176,178,181,182,184,185,187,189,192,193,194,195,198,199,200,201,204,205,206,209,211,214,216,218,222,226,229,232,235,239,242,245,248,250,254,257,261,265,275,281,287,293,299,305,311,317,323,329,336,342,349,357,366,377,389,399,412,426,438,451,466,482,499,520,542,565,610,659,720,775,833,895,961,1035,1098,1159,1220,1220,1220,1220];
NTGeoUtil.getCurvature = function(a,b){
var c = Math.floor(this.CURVATURE[b]/4);
c = a<2?Math.floor(c/3):c;
switch(a){
case 0:
return 2400000/c;
case 1:
return 400000/c;
case 2:
return 100000/c;
case 3:
return 30000/c;
case 4:
return 6000/c;
default:
return 0;
}
};
/* Copyright (C) 2006 NAVITIME JAPAN CO.,LTD. All Rights Reserved. */
var NTScale = function() {
};
NTScale.getScale = function(a){
};
/* Copyright (C) 2006 NAVITIME JAPAN CO.,LTD. All Rights Reserved. */
var NTUrl = function() {};
NTUrl.qS = "http://www.navitime.co.jp/mapimage.jsp";
NTUrl.create = function(a,b){
var c=this.qS;
if(b!=null&&b.length>0){
c=b;
}
c += "?MapCenterX=" + a.getPos().getLongitude() +
"&MapCenterY=" + a.getPos().getLatitude() +
"&MapWidth=" + a.getSize().x +
"&MapHeight=" + a.getSize().y +
"&MapScale=" + a.getScale() +
"&MapZoom=" + a.getZoom() +
"&MapAngle=" + a.getAngle() +
"&DrawTarget=0&DrawDirection=0&DrawScale=0" +
"&Palette=" + a.getPalette();
for (var i = 0; i < a.getParam().length; i++) {
var o = a.getParam()[i];
if(o.value == null) continue;
c += "&" + o.key + "=" + o.value;
}
var route = a.getRoute();
var rid = 0;
var iconid = 0;
var cache = new Array();
if(route != null){
for(var i=0; i<route.length; i++){
if(!route[i].isAvailable) continue;
var oi=NTUrlUtil.isExist(cache,route[i].orv);
var di=NTUrlUtil.isExist(cache,route[i].dnv);
if(oi!=-1){
route[i].setOrvId(oi)
cache[oi].icon = NTRouteIcon.OTHER;
}else{
if(route[i].sImg == null){
cache[cache.length] = new NTRouteIcon(cache.length,route[i].orv,NTRouteIcon.START,route[i].orvtf,"");
}else{
cache[cache.length] = new NTRouteIcon(cache.length,route[i].orv,NTRouteIcon.USER_DEF,route[i].orvtf,route[i].sImg);
}
route[i].setOrvId(cache.length-1);
}
if(di!=-1){
route[i].setDnvId(di);
cache[di].icon = NTRouteIcon.OTHER;
}else{
if(route[i].gImg == null){
cache[cache.length] = new NTRouteIcon(cache.length,route[i].dnv,NTRouteIcon.END,route[i].dnvtf,"");
}else{
cache[cache.length] = new NTRouteIcon(cache.length,route[i].dnv,NTRouteIcon.USER_DEF,route[i].dnvtf,route[i].gImg);
}
route[i].setDnvId(cache.length-1);
}
}
for(var i=0; i<cache.length; i++){
c += NTUrlUtil.getIconUrl(cache[i]);
}
for(var i=0; i<route.length; i++){
if(!route[i].isAvailable) continue;
c += NTUrlUtil.getRouteUrl(route[i],i);
}
for(var i=0; i<route.length; i++){
if(route[i].tollroad == null || route[i].tollroad.length == 0) continue;
if(route[i].tollroad == 8 || route[i].tollroad == 16 || route[i].tollroad == 32){
c += "&Tollroad=" + route[i].tollroad;
break;
}else{
c += "&Tollroad=" + 0;
break;
}
}
c+= "&rnd=" + Math.ceil(Math.random(10000)*10000);
}
return c;
};
var NTUrlUtil = function(){};
NTUrlUtil.isExist=function(a,b){
for(var c=0; c<a.length; c++){
if(a[c].pos.getLongitude() == b.getLongitude() && a[c].pos.getLatitude() == b.getLatitude()){
return c;
}
}
return -1;
};
NTUrlUtil.getIconUrl=function(a){
var r = "&Icon"+a.id + "=" + a.icon + "," + a.pos.getLongitude() + "," + a.pos.getLatitude() + ",," + a.iconUrl + ",1,0,4,";
r += a.toll==null?"-1":a.toll;
return r;
};
NTUrlUtil.getRouteUrl=function(a,b){
var r = "&Route"+ b + "=" + a.oid + ",,," + a.did + ",,,,,,," + a.method + ",," + a.color.r + "," + a.color.g + "," + a.color.b;
return r;
};
var NTRouteIcon = function(a,b,c,d,e){
this.id=a;
this.pos=b;
this.icon=c;
this.toll=d;
this.iconUrl=e;
};
NTRouteIcon.START = "10001";
NTRouteIcon.END = "10002";
NTRouteIcon.OTHER = "10003";
NTRouteIcon.USER_DEF = "0";
/* Copyright (C) 2006 NAVITIME JAPAN CO.,LTD. All Rights Reserved. */
var NTMover = function(target) {
this.srcElement = target.src;
this.moveElement= target.move;
this.downTarget;
this.mouseDownPos;
this.defaultPos = new NTSize(s(target.move,"left"),s(target.move, "top"));
this.isMouseDown=false;
this.differencialX;
this.differencialY;
this.movedX;
this.movedY;
this.dummy = Dn('',"absolute",0,0);
this.minPos = null;
this.maxPos = null;
};
NTMover.prototype.setAvailableArea = function(a,b){
this.minPos = a;
this.maxPos = b;
};
NTMover.prototype.onMouseDown = function(e){
if(e.button!=0 && e.button!=1){
CancelBubble(e);
return false;
}
if(this.srcElement.setCapture) this.srcElement.setCapture();
this.differencialX = e.clientX - Qs(e);
this.differencialY = e.clientY - Zl(e);
this.defaultPos = new NTSize(s(this.moveElement, "left"),s(this.moveElement, "top"));
this.mouseDownPos = new NTSize(Qs(e), Zl(e));
this.isMouseDown = true;
this.movedX = 0;
this.movedY = 0;
CancelBubble(e);
};
NTMover.prototype.onMouseMove = function(e){
var stl = this.moveElement.style;
if(this.isMouseDown){
if(NTUserAgent.type!=1 && NTUserAgent.version!=5){
stl.cursor = "move";
}
var x,y;
x=e.clientX + this.defaultPos.x - this.mouseDownPos.x - this.differencialX;
y=e.clientY + this.defaultPos.y - this.mouseDownPos.y - this.differencialY;
if(this.minPos !=null){
if(this.minPos.x >= x){
stl.left = this.minPos.x + "px";
this.movedX = this.minPos.x-this.defaultPos.x;
}else if(this.maxPos.x < x){
stl.left = this.maxPos.x + "px";
this.movedX = this.maxPos.x-this.defaultPos.x;
}else{
stl.left = x + "px";
this.movedX = x-this.defaultPos.x;
}
}else{
stl.left = x + "px";
this.movedX = x-this.defaultPos.x;
}
if(this.maxPos != null){
if(this.minPos.y > y){
stl.top = this.minPos.y + "px";
this.movedY = this.minPos.y-this.defaultPos.y;
}else if(this.maxPos.y < y){
stl.top = this.maxPos.y + "px";
this.movedY = this.maxPos.y-this.defaultPos.y;
}else{
stl.top = y + "px";
this.movedY = y-this.defaultPos.y;
}
}else{
stl.top = y + "px";
this.movedY = y-this.defaultPos.y;
}
}else{
CancelBubble(e);
}
};
NTMover.prototype.onMouseUp = function(e){
if(e.button!=0&&e.button!=1||this.isMouseDown==false){
CancelBubble(e);
return false;
}
this.mouseDownPos = null;
this.isMouseDown = false;
if(this.dummy.setCapture) this.dummy.setCapture();
if(this.movedX == 0 && this.movedY == 0){
return false;
}
if(NTUserAgent.type!=1 && NTUserAgent.version!=5){
this.srcElement.style.cursor = "pointer";
}
this.defaultPos = new NTSize(s(this.srcElement, "left"),s(this.srcElement, "top"));
return new NTSize(-this.movedX,-this.movedY);
};
/* Copyright (C) 2006 NAVITIME JAPAN CO.,LTD. All Rights Reserved. */
var NTRoute = function(a,b,c,d,e,f,g){
this.orv = a;
this.dnv = b;
this.color = (c==null) ? NTColor.DEFAULT : c;
this.method = d;
this.orvtf = e;
this.dnvtf = f;
this.tollroad = g;
this.oid;
this.did;
this.isAvailable = true;
this.sImg = null;
this.gImg = null;
};
NTRoute.prototype.setColor = function(a){
this.color = a;
};
NTRoute.prototype.setImage = function(a,b){
this.sImg = a;
this.gImg = b;
};
NTRoute.prototype.setOrvId = function(a){
this.oid=a;
};
NTRoute.prototype.setDnvId = function(a){
this.did=a;
};
NTRoute.prototype.remove = function(){
this.isAvailable = false;
}
EscapeUTF7=function(str){
var B="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),
E=function(s){
var c=s.charCodeAt(0);
return B[c>>10]+B[c>>4&63]+B[(c&15)<<2|(c=s.charCodeAt(1))>>14]+(0<=c?B[c>>8&63]+B[c>>2&63]+B[(c&3)<<4|(c=s.charCodeAt(2))>>12]+(0<=c?B[c>>6&63]+B[c&63]:""):"")
},
re=new RegExp;re.compile("[^+]{1,3}","g");
return (str+"g").replace(/[^*+.-9A-Z_a-z-]+[*+.-9A-Z_a-z-]|[+]/g,function(s){
if("+"==s)return "+-";
var l=s.length-1,w=s.charAt(l);
return "+"+s.substring(0,l).replace(re,E)+("+"==w?"-+-":"*"==w||"."==w||"_"==w?w:"-"+w)
}).slice(0,-1)
};
UnescapeUTF7=function(str){
var i=0,B={};
while(i<64)B["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(i)]=i++;
return str.replace(RegExp("[+][+/-9A-Za-z]*-?","g"),function(s){
if("+-"==s)return "+";
var b=B[s.charAt(1)],c,i=1,t="";
while(0<=b){
if((c=i&7)<6)c=c<3?b<<10|B[s.charAt(++i)]<<4|(b=B[s.charAt(++i)])>>2:(b&3)<<14|B[s.charAt(++i)]<<8|B[s.charAt(++i)]<<2|(b=B[s.charAt(++i)])>>4;
else{c=(b&15)<<12|B[s.charAt(++i)]<<6|B[s.charAt(++i)];b=B[s.charAt(++i)]}
if(c)t+=String.fromCharCode(c)
}
return t
})
};
var NTMap = function(a,b) {
this.Vk = false;
this.wT = false;
this.Zw = $(a);
this.Ak = a;
var s;
this.Sq = new NTMapStatus(NTLatLng.parse(this.Zw.innerHTML),NTSize.parse(this.Zw),0,3,3);
this.Zw.innerHTML="";
s = this.Zw.style
s.textAlign="left";
s.overflow="hidden";
s.position="relative";
this.Rj = Dn("MovingContainer","relative", "0px", "0px");
s = this.Rj.style;
s.position = "absolute";
s.zIndex = 12;
this.Rj.className = "container";
this.Zw.appendChild(this.Rj);
this.Tg = Dn("IconContainer","absolute","0px","0px");
this.Tg.style.zIndex = 100;
this.Tg.className = "container";
this.Rj.appendChild(this.Tg);
this.Qk = new Array();
this.Lz = 0;
this.He = 6;
this.Lb = (b && b.load=="manual")?false:true;
this.Jd = (b && b.mouse!=null)?b.mouse:2;
Sg.src = (b.image||"item1.2.png");
if(b && b.url) this.Ja = b.url;
this.Xq = false;
this.mF = false;
this.Mu = null;
this.Op = new Array();
this.iN = new Array();
if(b && b.popup!="multi"){
this.Wn = new NTPopup(this.Sq.getPos());
this.Wn.createDocument(this.Rj);
this.iN[0] = this.Wn;
}
this.Jc= eventHandler.apply(this, ["Zv"]);
this.Jk= eventHandler.apply(this, ["Iw"]);
this.Gd= eventHandler.apply(this, ["Gm"]);
this.Yf= eventHandler.apply(this, ["Ht"]);
this.sA= eventHandler.apply(this, ["Ia"]);
this.Fr= eventHandler.apply(this, ["Mw"]);
this.Ee= eventHandler.apply(this, ["aR"]);
this.In= eventHandler.apply(this, ["Xn"]);
this.Al= eventHandler.apply(this, ["Qz"]);
this.zG= eventHandler.apply(this, ["Og"]);
this.Ii= methodHandler.apply(this, ["Se"]);
this.Ah= methodHandler.apply(this, ["setZoom"]);
this.Hs= eventHandler.apply(this, ["De"]);
this.Xe= eventHandler.apply(this, ["Ba"]);
this.Rp= eventHandler.apply(this, ["Zy"]);
NTEvent.add(window, 'load', this.Jc);
NTEvent.add(window, 'unload', this.Jk);
this.Wm = b.copyrightInfo ? b.copyrightInfo : null;
this.Ku= new NTMap.Ti();
if (b.palette) {
this.setPalette(b.palette);
}
if (b.zoom) {
var zoom = b.zoom.split(",");
this.setZoom(new Number(zoom[0]), new Number(zoom[1]));
}
if (b.param) {
for (var p in b.param) {
this.addParam(p, b.param[p]);
}
}
this.Zo = (b.beforeOnLoad != undefined && b.beforeOnLoad == true);
if (this.Zo) {
this.Ue = new NTMover({src:this.Zw, move:this.Rj});
this.Ue.downTarget = this.Zw;
}
if(this.Lb && this.Zo){
this.Vk = true;
this.Sq.setSize(NTSize.parse(this.Zw));
Xu(this.Tg, this.Sq.getSize().x, this.Sq.getSize().y);
this.reload();
}
};
NTMap.prototype.getStatus=function() {
	return this.Sq;
};
NTMap.Ti=function() {
this.delta = 0;
this.zoomable = true;
this.zoomTool = null;
};
NTMap.Ti.prototype={
cancel:function() {
this.zoomable = false;
},
set:function(a) {
this.zoomTool = a;
},
add:function(a) {
this.delta += a;
this.zoomable = true;
this.setTimeout("this.changeZoom()", 200);
},
changeZoom:function(){
if (this.delta == 0) {
return;
}
if (this.zoomable && this.zoomTool != null) {
this.zoomable = false;
this.zoomTool.changeZoom(this.delta);
this.delta = 0;
this.zoomable = true;
}
}
};
NTMap.prototype.getId = function() {
return this.Ak;
};
NTMap.prototype.getMapPlate = function() {
return this.Rj;
};
NTMap.prototype.Zv = function(){
this.Sq.setSize(NTSize.parse(this.Zw));
Xu(this.Tg, this.Sq.getSize().x, this.Sq.getSize().y);
if(this.center!=null){
Dj(this.center, Math.round(this.Sq.getSize().x/2-this.center.offsetWidth/2), Math.round(this.Sq.getSize().y/2-this.center.offsetHeight/2));
this.center.style.visibility = "visible";
}
if(this.Hp!=null){
this.Hp.style.visibility = "visible";
}
var Ri = this.Zw.setCapture?this.Zw:window;
if (!this.Zo) {
this.Ue = new NTMover({src:this.Zw, move:this.Rj});
this.Ue.downTarget = this.Zw;
}
if(this.Jd >= 2){
NTEvent.add(this.Zw, 'dblclick',this.sA);
}else if(this.Jd == 1){
NTEvent.add(this.Zw, 'click',this.sA);
NTEvent.add(this.Zw, 'touchend',this.sA);
}
if(this.Jd >= 2){
NTEvent.add(this.Zw,'mousedown',this.Fr);
NTEvent.add(Ri,'mousemove',this.Ee);
NTEvent.add(Ri,'mouseup',this.In);
}
if(this.Jd >= 1){
NTEvent.add(this.Zw, 'DOMMouseScroll', this.Hs);
NTEvent.add(this.Zw, 'mousewheel', this.Hs);
NTEvent.add(Jv,'keypress',this.Xe);
NTEvent.add(this.Zw, 'mouseover', this.Gd);
NTEvent.add(this.Zw, 'mouseout',this.Yf);
}
NTEvent.add(window,'mouseout',this.Al);
NTEvent.add(this.Zw,'contextmenu', this.Rp);
this.Vk=true;
var cpid = (this.Wm != null && this.Wm.id) ? this.Wm.id : 'cp';
var Gw = Dn(cpid,'absolute');
this.Zw.appendChild(Gw);
var Su = Gw.style;
Su.fontSize = '10px';
Su.color = '#000';
Su.padding = '1px';
if (this.Wm == null) {
Gw.innerHTML = UnescapeUTF7(NTGeoUtil.JP(this.Sq.getPos())?Gi:Xk);
Su.left = "5px";
Su.top = this.Sq.getSize().y - Gw.offsetHeight -3+"px";
}
else {
if (this.Wm.text) {
Gw.innerHTML = this.Wm.text;
}
else {
Gw.innerHTML = UnescapeUTF7(NTGeoUtil.JP(this.Sq.getPos())?Gi:Xk);
}
if (!this.Wm.right && !this.Wm.left) {
Su.left = "5px";
}
if (!this.Wm.top && !this.Wm.bottom) {
Su.top = this.Sq.getSize().y - Gw.offsetHeight -3+"px";
}
if (this.Wm.left) {
Su.left = this.Wm.left + "px";
}
if (this.Wm.right) {
Su.right = this.Wm.right + "px";
}
if (this.Wm.top) {
Su.top = this.Wm.top + "px";
}
if (this.Wm.bottom) {
Su.bottom = this.Wm.bottom + "px";
}
if (this.Wm.height) {
Su.height = this.Wm.height + "px";
}
if (this.Wm.width) {
Su.width = this.Wm.width + "px";
}
if (this.Wm.textAlign) {
Su.textAlign = this.Wm.textAlign;
}
}
Su.zIndex = 902;
if(this.Lb && !this.Zo){
this.reload();
}else{
this.Gb=true;
}
};
NTMap.prototype.Iw = function(e){
this.clearMap();
this.Qk = null;
this.Op = null;
this.iN = null;
Sg = null;
Ul(this.Zw);
};
NTMap.prototype.Zy = function(e){
if (Vn(e) == 'object' && e.target != this.center) {
return;
}
var size = this.Ea(e);
var a = size.x;
var c = size.y;
a -=this.Sq.getSize().x/2;
c -=this.Sq.getSize().y/2;
var f =new NTSize(a,c);
var pos = e.target == this.center ? this.getPos() : NTGeoUtil.pixel2LonLat(f,this.Sq);
size = e.target == this.center ? new NTSize(this.Zw.offsetWidth / 2, this.Zw.offsetHeight / 2) : size;
E[3](pos,size,this);
CancelBubble(e);
return false;
};
NTMap.prototype.Gm = function(e){
if(NTUserAgent.type==1 && NTUserAgent.version==5) return false;
this.Rj.style.cursor = "pointer";
};
NTMap.prototype.Ht = function(e){
if (this.Me) {
var a = this.Ea(e);
if(NTUserAgent.type==2||NTUserAgent.type==3){
var posX = e.pageX;
var posY = e.pageY;
for (var p=this.Zw; p; p=p.offsetParent) {
posX -= p.offsetLeft;
posY -= p.offsetTop;
}
a = new NTSize(posX, posY);
}
var x = a.x;
var y = a.y;
if (x <= 5 || y <= 5 || x >= this.Sq.getSize().x - 5 || y >= this.Sq.getSize().y - 5) {
this.closeContext();
}
}
if(NTUserAgent.type==1 && NTUserAgent.version==5) return false;
this.Rj.style.cursor = "default";
};
NTMap.prototype.Ia = function(e){
if(!this.Gb) return false;
var kH = e.target;
while(kH.parentNode!=null){
if(kH.className=="object") return;
kH = kH.parentNode;
}
if(NTUserAgent.type!=1 && NTUserAgent.version!=5){
this.Rj.style.cursor = "wait";
}
var size = this.Ea(e);
var a = size.x;
var c = size.y;
a -=this.Sq.getSize().x/2;
c -=this.Sq.getSize().y/2;
CancelBubble(e);
var f=new NTSize(a,c);
E[1](NTGeoUtil.pixel2LonLat(f,this.Sq),this);
this.moveTo(NTGeoUtil.pixel2LonLat(f,this.Sq));
};
NTMap.prototype.Mw = function(e){
var contextMenu = false;
for (var ele=e.target; ele; ele=ele.parentNode) {
if (ele == this.Me) {
contextMenu = true;
}
}
if (!contextMenu) {
this.closeContext();
}
if(!this.Gb) return false;
if(e.target.className=="object"){
return;
}else if(e.target.className=="innerPopup"){
return;
}
this.Ue.onMouseDown(e);
};
NTMap.prototype.aR = function(e){
if(!this.Gb) return false;
if(e.target.className=="object"){
return;
}else if(e.target.className=="innerPopup"){
return;
}
this.Ue.onMouseMove(e);
};
NTMap.prototype.Xn = function(e){
if(!this.Gb) return false;
if(e.target.className=="object"){
return;
}else if(e.target.className=="innerPopup"){
return;
}
var a = this.Ue.onMouseUp(e);
if(a){
this.Sq.setPos(NTGeoUtil.pixel2LonLat(a,this.Sq));
E[1](this.Sq.getPos(),this);
this.reload();
}
CancelBubble(e);
};
NTMap.prototype.Ea = function(e){
var a = Qs(e);
var c = Zl(e);
if(Vn(e) == "static"){
if(NTUserAgent.type==2){
a += e.target.x;
c += e.target.y;
var p=e.target;
while(true){
if(p.className.indexOf("container")!=-1) break;
a += s(p,"left");
c += s(p,"top");
p = p.parentNode;
}
a += s(this.Rj, "left");
c += s(this.Rj, "top");
}
if(NTUserAgent.type==4){
var p=e.target;
while(true){
if(p.className.indexOf("container")!=-1) break;
a += s(p,"left");
c += s(p,"top");
p = p.parentNode;
}
a += s(this.Rj, "left");
c += s(this.Rj, "top");
}
}else{
if(NTUserAgent.type==2 || NTUserAgent.type==3){
if(e.target == this.Tg){
a += s(this.Rj, "left");
}else{
a -= s(this.Rj, "left");
}
}
if(NTUserAgent.type==2 || NTUserAgent.type==3){
if(e.target == this.Tg){
c += s(this.Rj, "top");
}else{
c -= s(this.Rj, "top");
}
}
}
return new NTSize(a,c);
};
NTMap.prototype.De = function(e){
if(this.Mu==null || !this.Gb){
CancelBubble(e);
return;
}
var delta = 0;
if (e.wheelDelta) {
delta = e.wheelDelta/120;
if (NTUserAgent.type==4 && (NTUserAgent.version<9 || (NTUserAgent.version == 9 && new Number(NTUserAgent.minorVersion) < 20))) delta = -delta;
} else if (e.detail) {
delta = -e.detail/3;
}
this.Ku.cancel();
this.Ku.add(delta);
CancelBubble(e);
};

NTMap.prototype.exeZoom = function(v){
	this.Ku.cancel();
	this.Ku.add(v);
}

NTMap.prototype.Ba = function(e){
this.closeContext();
if(e.target.tagName == "INPUT" || e.target.tagName == "TEXTAREA") return;
if(e.target != Jv)
var lon = this.Sq.getPos().getLongitude();
var lat = this.Sq.getPos().getLatitude();
if(e.keyCode==37){
E[1](NTGeoUtil.pixel2LonLat(new NTSize(-this.Sq.getSize().x/2,0), this.Sq),this);
this.moveTo(NTGeoUtil.pixel2LonLat(new NTSize(-this.Sq.getSize().x/2,0), this.Sq));
CancelBubble(e);
}
if(e.keyCode==38){
E[1](NTGeoUtil.pixel2LonLat(new NTSize(0,-this.Sq.getSize().y/2), this.Sq),this);
this.moveTo(NTGeoUtil.pixel2LonLat(new NTSize(0,-this.Sq.getSize().y/2), this.Sq));
CancelBubble(e);
}
if(e.keyCode==39){
E[1](NTGeoUtil.pixel2LonLat(new NTSize(this.Sq.getSize().x/2,0), this.Sq),this)
this.moveTo(NTGeoUtil.pixel2LonLat(new NTSize(this.Sq.getSize().x/2,0), this.Sq));
CancelBubble(e);
}
if(e.keyCode==40){
E[1](NTGeoUtil.pixel2LonLat(new NTSize(0,this.Sq.getSize().y/2), this.Sq),this);
this.moveTo(NTGeoUtil.pixel2LonLat(new NTSize(0,this.Sq.getSize().y/2), this.Sq));
CancelBubble(e);
}
if(e.keyCode==187 || e.keyCode==107 || e.charCode == 43){
if(!this.Mu) return;
this.Mu.onMinusClick();
CancelBubble(e);
}
if(e.keyCode==189 || e.keyCode==109 || e.charCode == 45 || e.charCode == 61){
if(!this.Mu) return;
this.Mu.onPlusClick();
CancelBubble(e);
}
};
NTMap.prototype.Og = function(e){
/* kamitsubo
if (this.Ue.isMouseDown) {
return;
}
*/
if(this.center!=null){
Dj(this.center, Math.round(this.Sq.getSize().x/2-this.center.offsetWidth/2), Math.round(this.Sq.getSize().y/2-this.center.offsetHeight/2));
this.center.style.visibility = "visible";
}
var i=this.Lz % this.He;
if(!this.mF){
Dj(this.Qk[i], -s(this.Rj, "left") , -s(this.Rj,"top"));
this.Qk[i].style.visibility = "visible";
this.buildIcon();
this.Qa();
}
if(NTUserAgent.type!=1 && NTUserAgent.version!=5){
this.Rj.style.cursor = "pointer";
}
for(var x=0,y=i,z=this.He+50; x<this.He; x++,y++,z--){
if(y >= this.He){
y=0;
}
if(this.Qk[y]==null || y==i){
continue;
}
this.Qk[y].style.zIndex = z;
}
if(this.Xq){
this.clearMap();
this.Xq = false;
}
for(var i=0; i<this.Op.length; i++){
this.Op[i].visible();
}
for(var i=0; i<this.iN.length; i++){
this.iN[i].visible();
}
E[0](this.Sq.getPos(),this);
if(this.Os!=null) this.Os.set(this.Sq);
this.wT = true;
if(!this.mF){
this.Gb = true;
}
};
NTMap.prototype.Qz=function(e){
if(!e.relatedTarget){
this.Xn(e);
}
};
NTMap.prototype.moveTo = function(a){
if(arguments.length==0 && a==null) return false;
if(!this.Vk){
this.Sq.setPos(a);
}
if(!this.Gb) return false;
this.Gb = false;
var b = NTGeoUtil.LonLat2Pixel(a,this.Sq);
var mx = s(this.Rj, "left") - (b.x-this.Sq.getSize().x/2);
var my = s(this.Rj, "top") - (b.y-this.Sq.getSize().y/2);
if(Math.abs(s(this.Rj, "left") - mx) > 5000 || Math.abs(s(this.Rj, "top") - my) > 5000){
this.Sq.setPos(a);
this.Xq = true;
this.reload();
}else{
this.mF = true;
this.Sq.setPos(a);
this.makeMapImage();
var m = new NTMapCtrl(this.Rj);
m.autoScrollTo(mx,my,this.Ii);
}
};
NTMap.prototype.Se = function(a){
this.reload();
this.mF = false;
var i=this.Lz % this.He;
Dj(this.Qk[i], -s(this.Rj, "left"), -s(this.Rj, "top"));
this.buildIcon();
this.Qa()
if(this.wT){
this.Qk[i].style.visibility = "visible";
this.Gb = true;
}
};
NTMap.prototype.reload = function(){
this.Sq.setSize(NTSize.parse(this.Zw));
if(!this.Vk && !this.Gb) return false;
return this.makeMapImage()? true: false;
};
NTMap.prototype.makeMapImage = function(){
this.Gb = false;
this.wT = false;
this.Lz = ++this.Lz % this.He;
var stl, i=this.Lz;
if(this.Qk[i]==null){
this.Qk[i] = Xg("", this.Sq.getSize().x, this.Sq.getSize().y);
stl = this.Qk[i].style;
stl.position = "absolute";
NTEvent.add(this.Qk[i],'load',this.zG);
this.Rj.appendChild(this.Qk[i]);
}else{
stl = this.Qk[i].style;
stl.width = this.Sq.getSize().x + "px";
stl.height = this.Sq.getSize().y + "px";
setAlpha(this.Qk[i],100);
}
stl.visibility = "hidden";
stl.zIndex=this.He+50;
this.Qk[i].src = NTUrl.create(this.Sq,(this.Ja||null));
return this.Qk[i];
};
NTMap.prototype.clearMap = function(a){
for(var i=0; i<this.Qk.length; i++){
if(this.Qk[i]==null || i == this.Lz % this.He || (a!=null && this.Qk[i]==a)) continue;
this.Qk[i].style.visibility = "hidden";
}
};
NTMap.prototype.setZoom = function(a,b,c){
if(this.Sq.getScale()==a && this.Sq.getZoom()==b){
return false;
}
if(c && this.Lb && this.Vk && this.wT){
for(var i=0; i<this.Op.length; i++){
this.Op[i].hide();
}
for(var i=0; i<this.iN.length; i++){
this.iN[i].hide();
}
if(this.Dh && this.Dh.iswork()){
this.clearMap();
this.Dh.stop();
}else{
var Wt = this.Qk[this.Lz];
this.clearMap(Wt);
this.Dh = new NTMapScaleCtrl(Wt);
//this.Dh.autoChangeScale(this.Sq,a,b,function(){ntmap.reload();});
this.Dh.autoChangeScaleToPoint(this.Sq,a,b,function(){map.reload();}); // takemoto 2010/10/29
}
}
this.Sq.setScale(a);
this.Sq.setZoom(b);
if(this.Mu)
this.Mu.setStatus(this.Sq);
this.Xq = true;
if(this.Lb){
if(this.reload()){
E[0](this.Sq.getPos(),this);
E[2](this.getZoom(),this);
}
}
};
NTMap.prototype.getZoom = function(){
return {scale: this.Sq.getScale(), zoom: this.Sq.getZoom()};
};
NTMap.prototype.setPalette = function(a){
this.Sq.setPalette(a);
this.Xq = true;
if(this.Lb && this.Vk){
this.reload();
}
};
NTMap.prototype.addParam = function(a,b){
this.Sq.addParam(a,b);
};
NTMap.prototype.removeParam = function(a){
this.Sq.removeParam(a);
};
NTMap.prototype.getPos = function(){
return this.Sq.getPos();
};
NTMap.prototype.addRoute = function(){
for(var a=0; a<arguments.length; a++){
this.Sq.addRoute(arguments[a]);
}
if(this.Lb){
this.reload();
}
};
NTMap.prototype.removeRoute = function(){
var r = false;
if(arguments.length > 0){
for(var i=0; i<arguments.length; i++){
r=this.Sq.removeRoute(arguments[i]);
}
}else{
if(this.Sq.getRoute().length>0){
this.Sq.clearRoute();
r=true;
}
}
if(r && this.Lb){
this.reload();
}
};
NTMap.prototype.getRouteList = function(){
if(!this.Sq.getRoute().length) return null;
return this.Sq.getRoute();
};
NTMap.prototype.addCenter = function(a,b,c){
if (typeof a == 'string'){
}else if(typeof a == 'object'){
b=a.width;
c=a.height;
a=a.src;
}else{
return false;
}
this.center = Hk(a,b,c,true,"object");
NTEvent.add(this.center, "contextmenu", this.Rp);
this.Zw.appendChild(this.center);
this.center.style.zIndex=900;
this.center.style.visibility = "hidden";
};
NTMap.prototype.addBackground = function(a){
if(a==null) return;
this.Hp = Dn("bgi","absolute",0,0);
Xu(this.Hp, this.Sq.getSize().x, this.Sq.getSize().y);
this.Hp.style.backgroundImage = "url(" + a.src + ")";
this.Zw.appendChild(this.Hp);
this.Hp.style.zIndex=10;
this.Hp.style.visibility = "hidden";
};
NTMap.prototype.addIcon = function(){
var Jl = arguments;
for(var i = 0; i<Jl.length; i++){
Jl[i].addDocument(this.Rj,301);
this.Op.push(Jl[i]);
}
if(this.wT){
this.buildIcon();
this.Qa();
}
};
NTMap.prototype.getIcon = function(a){
var Gy = new Array();
for(var i=0; i<this.Op.length; i++){
if(a && a!=this.Op[i].getGroup()){
continue;
}
Gy.push(this.Op[i]);
}
return Gy;
};
NTMap.prototype.clearIcon = function(a){
var Gy = new Array();
for(var i=0; i<this.Op.length; i++){
if(a && a!=this.Op[i].getGroup()){
Gy.push(this.Op[i]);
continue;
}
this.Op[i].remove();
}
this.Op = Gy;
};
NTMap.prototype.buildIcon = function(){
for(var i=0; i<this.Op.length; i++){
var a=this.Op[i];
if(a.getImage()==null) continue;
var Zn = a.getImage();
if(a==null || a.getPos()==null) continue;
var p = NTGeoUtil.LonLat2Pixel(a.getPos(),this.Sq);
var iconXDiff = 0;
var iconYDiff = 0;
var position = a.getIconPosition();
if(position == 1 || position == 4 || position == 7){
iconXDiff = Zn.offsetWidth/2;
}
else if(position == 2 || position == 5 || position == 8){
iconXDiff = Zn.offsetWidth;
}
if(position == 3 || position == 4 || position == 5){
iconYDiff = Zn.offsetHeight/2;
}
else if(position == 6 || position == 7 || position == 8){
iconYDiff = Zn.offsetHeight;
}
Dj(Zn, p.x - iconXDiff - s(this.Rj, "left"), p.y - iconYDiff - s(this.Rj, "top"));
Dj(a.getCather(), p.x - iconXDiff - s(this.Rj, "left"), p.y - iconYDiff - s(this.Rj, "top"));
var is = a.getShadow();
if(is!=null){
Dj(is, s(Zn,"left"), new Number(s(Zn,"top")) + Zn.offsetHeight-is.offsetHeight);
is.style.visibility = "visible";
}
Zn.style.visibility = "visible";
}
};
NTMap.prototype.openContext = function(a,b){
this.closeContext();
a.style.position = 'absolute';
a.style.top = b.top + "px";
a.style.left= b.left+ "px";
a.style.visibility = 'visible';
this.Me = a;
this.Zw.appendChild(a);
};
NTMap.prototype.closeContext = function() {
if (this.Me) {
this.Me.style.visibility = 'hidden';
Ul(this.Me);
Cu(this.Me);
this.Me = undefined;
}
};
NTMap.prototype.addMsg = function(a){
if(this.Wn){
return false;
}
var d = a.createDocument(this.Rj);
this.iN.push(a);
a.moveTo(NTGeoUtil.LonLat2Pixel(a.getPos(),this.Sq));
return true;
};
NTMap.prototype.closeMsg=function(a) {
if (!this.Wn) {
return false;
}
this.Wn.close();
}
NTMap.prototype.openMsg = function(aG,a){
if(!this.Wn || !aG){
return;
}
this.Wn.decorate({color:a.bgcolor, border: a.bordercolor, max:a.max});
this.Wn.setPos(aG);
this.Wn.replaceContent({title:"", body:a.content});
this.iN[0]=this.Wn;
this.Wn.moveTo(NTGeoUtil.LonLat2Pixel(aG,this.Sq));
this.Wn.open();
return this.Wn;
};
NTMap.prototype.Qa = function(){
for(var i=0; i<this.iN.length; i++){
if(this.iN[i]==null || this.iN[i].getPos()==null) continue;
var p = NTGeoUtil.LonLat2Pixel(this.iN[i].getPos(),this.Sq);
this.iN[i].moveTo(p);
}
};
NTMap.prototype.loadToolbar = function(a){
if(!a) a = NTZoomToolbar.DEFAULT;
a.setParent(this.Zw);
a.setStatus(this.Sq);
a.onChange(this.Ah);
a.load();
this.Mu = a;
this.Ku.set(a);
};
NTMap.prototype.loadScalebar = function(a){
this.Os = new NTScaler(this.Zw,NTGeoUtil.JP(this.Sq.getPos()),a);
};
NTMap.prototype.setProperty = function(a,b){
if(a=="autoload"){
this.Lb = b;
}
if(a=="url"){
this.Ja = b;
}
if(a=="image"){
Sg = new Image();
Sg.src = b;
}
};
NTMap.prototype.moveMapPlate = function(a,b){
style = this.Rj.style;
if(a) style.left = this.Rj.offsetLeft + a + "px";
if(b) style.top = this.Rj.offsetTop + b + "px";
};
NTMap.prototype.changeCenterPosition = function(a,b) {
this.Sq.setPos(NTGeoUtil.pixel2LonLat(new NTSize(a,b),this.Sq));
}
Hf('NTMap', NTMap);
Hf('NTSize', NTSize);
Hf('NTIcon', NTMapIcon);
Hf('NTImage', NTImage);
Hf('NTGeoUtil', NTGeoUtil);
Hf('NTColor',NTColor);
Hf('NTLatLng', NTLatLng);
Hf('NTRoute', NTRoute);
Hf('NTPopup', NTPopup);
Hf('NTZoomToolbar', NTZoomToolbar);
Hf('NTResizer', NTResizer);
Hf('eventHandler',Object.eventHandler);
Hf('NTEvent', NTEvent);
Ry(NTMapCtrl);
Ry(NTMapScaleCtrl);
Ry(NTResizer);
Ry(NTMap.Ti);
})();

