/*
Copyright 2006 NAVITIME JAPAN CO.,LTD. All Rights Reserved.
Auther by myoshida@navitime.co.jp
Version1.2.2
*/
(function() {
var Wn = new Image(450,340);
var Kk = document;
var Eh = '+VzBW8wAgZi1lh3k+-/+T09Ty5b7XeU-/+Vv1XH1cwdAaWYg-';
var If = '+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 = Kk.getElementById(element);
if (arguments.length == 1)
return element;
elements.push(element);
}
return elements;
}
function Lv(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 Hb(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 Es(e){
if(NTUserAgent.type==1){
return e.target.className;
}else if(NTUserAgent.type==3){
return e.target.className;
}else{
return e.target.className;
}
};
function Rl(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 No(a,b,c,d){
var r = Kk.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 Gg(u,w,h){
var r = Kk.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 Jw(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 Km(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){
Km(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(){};
Object.prototype.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);
}
};
Object.prototype.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 Vf(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(Kk.body){
Kk.body.scroll=a?"auto":"no"
if(window.innerHeight){
var s = Kk.body.style;
s.height=a?"auto":window.innerHeight-32
s.width=a?"auto":window.innerWidth-32
s.overflow=a?"visible":"hidden"
}
}else if(Kk.height){
if(a && Kk._height){
Kk.height=Kk._height
delete Kk._height
Kk.width=Kk._width
delete Kk._width
window.onresize=window._resize
}
if(!a){
if(!Kk._height){
Kk._height=Kk.height
Kk._width=Kk.width
window._resize=window.onresize
window.onresize=new Function("if(window._resize)_resize();scrollbar(false)")
}
Kk.height=window.innerHeight
Kk.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);}
];
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 Tn(b,w,h,p,c){
var a;
if(NTUserAgent.type==1 && NTUserAgent.version<7){
if (b.substring(b.length - 3, b.length) == 'png') {
a = No(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 = Gg(b,w,h);
a.style.position="absolute";
}
}else{
a = Gg(b,w,h);
a.style.position="absolute";
}
if(c) a.className = c;
return a;
}
function Jt(u,x,y,w,h,p,c){
var a=No("",p ? "relative" : "absolute", 0, 0);
a.style.overflow = "hidden";
Ym(a,w,h);
var b=Tn(u,Wn.width, Wn.height, false, c);
a.appendChild(b);
Tx(b,-x, -y);
if(c) a.className = c;
return a;
}
function Tx(a,b,c){
var s = a.style;
s.left = isNaN(b)?b:b+'px';
s.top= isNaN(c)?c:c+'px';
}
function Ym(a,b,c){
var s = a.style;
s.width= isNaN(b)?b:b+'px';
s.height = isNaN(c)?c:c+'px';
}
function Xo(a){
var Ty = document.createElement(a.tagName);
for(var i in a.style){
try{Ty.style[i] = a.style[i];}catch(e){}
}
var l = a.childNodes.length;
for(var i=0; i<l; i++){
var copyObject = Xo(a.childNodes[i]);
Ty.appendChild(copyObject);
}
if(a.innerHTML) Ty.innerHTML = a.innerHTML;
return Ty;
}
var NTHashMap = function(){
this.Zx = new Object();
for(var i in this.Zx){
this.Zx[i] = null;
}
this.Dj = 0;
};
NTHashMap.prototype = {
put: function(a,b){
this.Zx[a] = b;
this.Dj++;
},
get: function(a){
for(var i in this.Zx){
if(i == a) return this.Zx[i];
}
return null;
},
remove: function(a){
this.Dj--;
this.Zx[a] = null;
},
size: function(a){
return this.Dj;
},
toArray: function(a){
if(this.size()==0){
return [];
}
return this.Zx;
},
toString: function(){
if(this.size()==0){
return "";
}
var ret="{";
for(var i in this.Zx){
if(this.Zx[i]!=null) ret+= (ret.length==1?"":",") + i + ":" + this.Zx[i];
}
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 Rp(a,b,c){
if(b!=null){
a=Gv(a,b)
}
if(c!=null){
a=Gt(a,c)
}
return a
}
function Nn(a,b,c){
while(a>c){
a-=c-b
}
while(a<b){
a+=c-b
}
return a
}
function Gt(a,b){
return Math.min(a,b)
}
function Gv(a,b){
return Math.max(a,b)
}
function Ci(a){
return a*Math.PI/180
}
NTLatLng.prototype.latRadians=function(){
return Ci(Rp(this.Latitude/3600000,-90,90))
};
NTLatLng.prototype.lngRadians=function(){
return Ci(Nn(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._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.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.Qi = new Array();
for (var i=arguments.length-1, j=0; i >0 ; i-=2, j++) {
this.Qi[j] = new Wk(arguments[i-1],arguments[i]);
}
this.Sw = Kk.body;
this.Ui = null;
this.Ae= this.eventHandler("onMouseDown");
this.Nt= this.eventHandler("onMouseMove");
this.Vs= this.eventHandler("onMouseUp");
this.Su= this.eventHandler("onMouseOver");
this.Hi= this.eventHandler("onMouseOut");
this.Bg= this.eventHandler("onPlusClick");
this.Kr= this.eventHandler("onMinusClick");
this.Kq= this.eventHandler("onRailClick");
this.Xl= false;
this.changedFunc = null;
this.Sa = 9;
this.Sl = 0;
this.Xs = 10;
this.Rb= 20;
this.Tz = NTZoomToolbar.Mode.PC;
this.Zb = undefined;
this.Vn = 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.Qi[this.Qi.length] = new Wk(a,b);
};
NTZoomToolbar.prototype.setParent = function(a){
this.Sw = a;
};
NTZoomToolbar.prototype.onChange = function(a){
this.changedFunc = a;
};
NTZoomToolbar.prototype.setStatus = function(a){
this.Ui = a;
for(var i=0; i<this.Qi.length; i++){
var z = this.Qi[i];
if(a.getScale()==z.getScale() && a.getZoom()==z.getZoom()){
this.Sl = i;
break;
}
}
if(this.Sl != 0){
this.scrollTo(this.Sl * this.Sa + 1);
}
};
NTZoomToolbar.prototype.setScaleByPoi = function(a){
if(a==null || a.poi==null || a.poi.length==0) return;
var Fc=0,In=0,Ia=0,Cl=0,Eb,Os;
for(var i=0; i<a.poi.length; i++){
if(a.poi[i]==null){continue;}
if(a.center == null){
if(Fc == 0 || Fc < a.poi[i].getLongitude()){ Fc=a.poi[i].getLongitude();}
if(In == 0 || In > a.poi[i].getLongitude()){ In=a.poi[i].getLongitude();}
if(Ia == 0 || Ia < a.poi[i].getLatitude()){ Ia=a.poi[i].getLatitude();}
if(Cl == 0 || Cl > a.poi[i].getLatitude()){ Cl=a.poi[i].getLatitude();}
}else{
if(Fc == 0 || Fc < Math.abs(a.poi[i].getLongitude() - a.center.getLongitude())){
Fc = Math.abs(a.poi[i].getLongitude() - a.center.getLongitude());
}
if(Ia == 0 || Ia < Math.abs(a.poi[i].getLatitude() - a.center.getLatitude())){
Ia = Math.abs(a.poi[i].getLatitude() - a.center.getLatitude());
}
}
}
if(a.center == null){
Eb = Math.abs(Fc - In)*1.1;
Os = Math.abs(Ia - Cl)*1.1;
}else{
Eb = Fc * 2 *1.1;
Os = Ia * 2 *1.1;
}
for(var i=0; i < this.Qi.length; i++){
var s = new NTMapStatus(this.Ui.getPos(),this.Ui.getSize(),0,this.Qi[i].getScale(),this.Qi[i].getZoom());
var pxOfLon = Math.ceil(NTGeoUtil.getLonFactor(s));
var pxOfLat = Math.ceil(NTGeoUtil.getLatFactor(s));
if(this.Ui.getSize().x * pxOfLon > Eb && this.Ui.getSize().y * pxOfLat > Os){
this.scrollTo(i * this.Sa + 1, true);
break;
}
}
if(a.center==null){
return new NTLatLng(Math.round(new Number(Cl) + new Number(Ia-Cl)/2) , Math.round(new Number(In) + new Number(Fc - In)/2));
}else{
return a.center;
}
};
NTZoomToolbar.prototype.onMouseDown = function(e){
this.Qs.onMouseDown(e);
this.Xl = true;
}
NTZoomToolbar.prototype.onMouseMove = function(e){
this.Qs.onMouseMove(e);
}
NTZoomToolbar.prototype.onMouseUp = function(e){
CancelBubble(e);
if(!this.Xl) return;
var a = this.Qs.onMouseUp(e);
this.scrollTo(s(this.Pp,"top")+1);
this.Xl = false;
}
NTZoomToolbar.prototype.onRailClick = function(e){
if(e.target.parentNode != this.Xc){
return false;
}
var Wv = Hb(e);
if(NTUserAgent.type==2) Wv -=104;
if(NTUserAgent.type==4) Wv += e.target.offsetTop;
this.scrollTo(Wv);
};
NTZoomToolbar.prototype.scrollTo = function(a,b){
if(b==null) b=false;
var idx = Math.floor((a-1) / this.Sa);
if(idx >= this.Qi.length){
return false;
}
var ztv = this.Qi[idx];
if(this.Pp) this.Pp.style.top = idx * this.Sa + 1 + "px";
if(this.changedFunc != null){
this.changedFunc(ztv.getScale(), ztv.getZoom(),b);
}
};
NTZoomToolbar.prototype.load = function(){
var style;
this.Zv = No("zoomToolbar","relative",this.Xs+"px",this.Rb+"px");
style = this.Zv.style;
style.zIndex=901;
style.width = "26px";
style.padding = "2px";
this.Sw.appendChild(this.Zv);
if (this.Zb) {
this.Kf = Jt(Wn.src, this.Zb.left, this.Zb.top, this.Zb.width, this.Zb.height, 'relative', '');
}
else {
this.Kf = Jt(Wn.src, 75, 75, 25, 25, 'relative', '');
}
style = this.Kf.style;
style.left = '3px';
style.top = '2px';
this.Zv.appendChild(this.Kf);
this.Xc = Jt(Wn.src, 100, 50, 25, this.Qi.length * this.Sa, 'relative', '');
style = this.Xc.style;
style.left = '3px';
style.top = '0px';
if (this.Tz != NTZoomToolbar.Mode.MOBILE) {
this.Zv.appendChild(this.Xc);
}
if (this.Vn) {
this.Rf = Jt(Wn.src, this.Vn.left, this.Vn.top, this.Vn.width, this.Vn.height, 'relative', '');
}
else {
this.Rf = Jt(Wn.src, 75, 50, 25, 25, 'relative', '');
}
style = this.Rf.style;
style.left = '3px';
style.top = '0px';
this.Zv.appendChild(this.Rf);
this.Pp = Jt(Wn.src, 75, 100, 25, 9, 'absolute', '');
style = this.Pp.style;
style.top = '1px';
this.Xc.appendChild(this.Pp);
var Cc = this.Pp.setCapture?this.Pp:window;
NTEvent.add(this.Pp,'mousedown',this.Ae);
NTEvent.add(Cc,'mousemove',this.Nt);
NTEvent.add(Cc,'mouseup',this.Vs);
NTEvent.add(this.Xc, 'click', this.Kq);
NTEvent.add(this.Kf,'mouseover',this.Su);
NTEvent.add(this.Rf,'mouseover',this.Su);
NTEvent.add(this.Pp,'mouseover',this.Su);
NTEvent.add(this.Xc,'mouseover',this.Su);
NTEvent.add(this.Kf,'mouseout',this.Hi);
NTEvent.add(this.Rf,'mouseout',this.Hi);
NTEvent.add(this.Pp,'mouseout',this.Hi);
NTEvent.add(this.Xc,'mouseout',this.Hi);
NTEvent.add(this.Kf,'click',this.Bg);
NTEvent.add(this.Rf,'click',this.Kr);
this.Qs = new NTMover(this.Pp);
this.Qs.downTarget=this.Pp;
this.Qs.setAvailableArea(new NTSize(0,1), new NTSize(0,(s(this.Xc,"height")-s(this.Pp,"height"))));
if(this.Sl != 0){
this.scrollTo(this.Sl * this.Sa + 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.Pp,"top") >= this.Qi.length * this.Sa + 1){
return false;
}
this.scrollTo(s(this.Pp,"top") + this.Sa, true);
};
NTZoomToolbar.prototype.onPlusClick = function(e){
if(s(this.Pp,"top") <= 1){
return false;
}
this.scrollTo(s(this.Pp,"top") - this.Sa, true);
};
NTZoomToolbar.prototype.getContent = function(){
return this.Zv;
};
NTZoomToolbar.prototype.setZoomImage = function(a,b) {
this.Zb = a;
this.Vn = b;
};
NTZoomToolbar.prototype.setPosition = function(a, b){
this.Xs = a;
this.Rb = b;
};
NTZoomToolbar.prototype.setMode = function(a) {
this.Tz = a;
};
function Wk(a,b){
this.scale = a;
this.zoom = b;
}
Wk.prototype.getScale = function(){
return this.scale;
};
Wk.prototype.getZoom = function(){
return this.zoom;
};
function NTScaler(a,b){
var top = s(a,"height")-37;
var bottom = (b != null && b.bottom) ? b.bottom : null;
if (bottom == null) {
this._sc = No('NTScale',"absolute","10px",top+"px");
} else {
this._sc = No('NTScale',"absolute","10px");
}
var stl;
stl = this._sc.style;
stl.zIndex = 910;
stl.font = "0px Arial";
stl.backgroundColor = "#FFF";
stl.height ="18px";
if (bottom != null) {
stl.bottom = bottom + "px";
}
setAlpha(this._sc,60);
a.appendChild(this._sc);
if (bottom == null) {
this._bar = No('NTScaleBar',"absolute","12px", top+5+"px");
} else {
this._bar = No('NTScaleBar',"absolute","12px");
}
stl = this._bar.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._bar);
if (bottom == null) {
this._text = No('NTScaleText',"absolute","0px",top+2+"px");
} else {
this._text = No('NTScaleText',"absolute","0px");
}
stl = this._text.style;
stl.zIndex = 912;
stl.color = "#555";
stl.font = "bold 10px Arial";
if (bottom != null) {
stl.bottom = (bottom + 3) + "px";
}
a.appendChild(this._text);
}
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 h=this.of(e/1000,"km",e,"m");
this._bar.style.width = h.length + "px";
this._text.style.left = h.length + 17 + "px";
this._text.innerHTML = h.display;
this._sc.style.width = h.length + 17 + this._text.offsetWidth+ "px";
};
function Ex(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){
var e=a;
var f=b;
if(a<1){
e=c;
f=d;
}
var g=Ex(e);
var h=Math.round(125*g/(2*e));
return{
length:h,display:g+" "+f
}
};
var NTPopup = function(a,b){
this.closeClickHandler = this.eventHandler("onCloseClick");
this.Vg = a;
this.Mp = new Array();
this.Ox = new NTPopupFactor();
this.spaceX = 8;
this.spaceY = 24;
this.Ms = false;
this.Ai = 0;
this.Xd = 0;
this.Di = 0;
this.Hq = "#FFF";
this.jD = "#949494";
if(b){
if(b.max){
this.Xd = b.max.x;
this.Di = b.max.y;
}
if(b.bgcolor) this.Hq = b.bgcolor;
if(b.bordercolor) this.jD = b.bordercolor;
}
};
NTPopup.prototype = {
createDocument: function(a){
this.Sw = a;
this.Nr = No("","relative",0,0);
var s = this.Nr.style;
s.cursor = "default";
s.visibility = "hidden";
this.Ox.top = Ru(25, 0, 220-(25-this.spaceX)*2, 25, 1, 0, 0, 0, this.Hq,true, this.jD );
this.Ox.middle = Ru(0, 0, 240+20, 50-20, 0, 1, 1, 0, this.Hq,true, this.jD );
this.Ox.bottom = Ru(25, 0, 220-(25-this.spaceX)*2, 25, 0, 0, 0, 1, this.Hq,true, this.jD );
this.Ox.tail = Ne(Wn.src,50,0,100,50,0,-1,false,"static");
this.Ox.tail.style.visibility = "hidden";
this.Ox.topleft = Ne(Wn.src,0,0,25,25,0,0,false,"object");
this.Ox.topright = Ne(Wn.src,25,0,25,25,0,0,false,"object");
this.Ox.bottomleft = Ne(Wn.src,0,25,25,25,0,0,false,"object");
this.Ox.bottomright = Ne(Wn.src,25,25,25,25,0,0,false,"object");
this.Ox.shadow = Ne(Wn.src,150,0,300,150,0,0,false,"static");
this.Ox.shadow.style.visibility = "hidden";
this.Ox.close = Ne(Wn.src,0,50,15,15,0,0,false,"object");
this.Ox.close.style.cursor = "pointer";
NTEvent.add(this.Ox.close, 'click', this.closeClickHandler);
var bg = this.Ox.getFactor();
for(var i=0; i< bg.length; i++){
this.Nr.appendChild(bg[i]);
}
this.Nr.style.position = "absolute";
this.Sw.appendChild(this.Nr);
this.Sw.appendChild(this.Ox.tail);
this.Sw.appendChild(this.Ox.shadow);
for(var o=0; o<this.Ai; o++){
this.Sw.appendChild(this.Mp[o].body);
}
this.setDepth();
this.resize();
return this.getDocument();
},
getDocument: function(){
return {base: this.Nr, shadow: this.Ox.shadow, tail: this.Ox.tail};
},
getPos: function(){
return this.Vg;
},
setPos: function(a){
this.Vg = a;
},
addContent: function(a,b){
b.className = "object";
var style = b.style;
style.display = "block";
style.visibility = "hidden";
style.position = "absolute";
var Yl = {title:a, body:b};
this.Mp.push(Yl);
this.Ai++;
},
getContent: function(){
return this.Mp;
},
replaceContent: function(a){
for(var o=0; o<this.Ai; o++){
this.Mp[o].body.style.display="none";
this.Mp[o].body.style.visibility="hidden";
}
this.Mp = new Array();
this.Ai = 0;
this.addContent(a.title, a.body);
for(var o=0; o<this.Ai; o++){
this.Sw.appendChild(this.Mp[o].body);
}
this.setDepth();
this.resize();
},
resize: function(a,b){
var Cv;
if(!a && !b){
if(this.Ai == 0) return;
var Xd=130, Di=50;
for(var i=0; i<this.Ai; i++){
Kc = this.Mp[i].body;
Cv = Kc.style;
Cv.position = "relative";
if(Kc.offsetWidth > Xd){
if(this.Xd > 0 && Kc.offsetWidth > this.Xd){
Xd = this.Xd<130?130:this.Xd;
Cv.width = this.Xd + "px";
}else{
Xd = Kc.offsetWidth<150?150:Kc.offsetWidth;
Cv.width = Xd+"px";
}
}else{
Cv.width = Xd+"px";
}
if(Kc.offsetHeight > Di){
if(this.Di>0 && Kc.offsetHeight > this.Di){
Di = this.Di;
Cv.height = this.Di - this.spaceY + "px";
Cv.overflow = "auto";
}else{
Di = Kc.offsetHeight;
Cv.height = Di+"px";
}
}
Cv.position = "absolute";
}
a = Xd;
b = Di;
}
Ym(this.Ox.middle, a+(this.spaceX*2)-2, b-(25-this.spaceY/2));
Ym(this.Ox.top, a-(25-this.spaceX)*2, 24);
Ym(this.Ox.bottom, a-(25-this.spaceX)*2,24);
Tx(this.Ox.topright, a + this.spaceX -(25 - this.spaceX), 0);
Tx(this.Ox.bottomleft, 0, b+(this.spaceY/2));
Tx(this.Ox.bottomright, a + this.spaceX -(25 - this.spaceX), b+(this.spaceY/2));
Tx(this.Ox.tail, (a-100)/2+this.spaceX,-1);
Tx(this.Ox.shadow, Xd/2 - 50, this.Nr.offsetHeight - this.Ox.shadow.offsetHeight);
Tx(this.Ox.close, Xd+this.spaceX-this.Ox.close.offsetWidth, 5);
Cv = this.Nr.style;
Cv.width = a + this.spaceX * 2 + "px";
Cv.height = this.Ox.top.offsetHeight + this.Ox.middle.offsetHeight + this.Ox.bottom.offsetHeight + "px";
Cv.overflow = "hidden";
},
setDepth: function(a){
this.Nr.style.zIndex = (a||400);
this.Ox.tail.style.zIndex = (a||400)+20;
this.Ox.shadow.style.zIndex = (a||400)-200;
for(var o=0; o<this.Ai; o++){
this.Mp[o].body.style.zIndex = (a||400)+60;
}
},
open: function(){
this.Nr.style.visibility = "visible";
this.Ox.tail.style.visibility = "visible";
this.Ox.shadow.style.visibility = "visible";
this.Ms = true;
if(this.Ai>0) this.Mp[0].body.style.visibility = "visible";
},
close: function(){
this.Nr.style.visibility = "hidden";
this.Ox.tail.style.visibility = "hidden";
this.Ox.shadow.style.visibility = "hidden";
this.Ms = false;
for(var i=0; i<this.Ai; i++){
this.Mp[i].body.style.visibility = "hidden";
}
},
foreground: function(){
this.Nr.style.zIndex |= 100;
var bg = this.Ox.getFactor();
for(var i=0; i< bg.length; i++){
bg[i].style.zIndex |= 100;
}
for(var i=0; i<this.Ai; i++){
this.Mp[i].body.style.zIndex|=100;
}
},
back: function(){
this.Nr.style.zIndex &=~ 100;
var bg = this.Ox.getFactor();
for(var i=0; i< bg.length; i++){
bg[i].style.zIndex &=~ 100;
}
for(var i=0; i<this.Ai; i++){
this.Mp[i].body.style.zIndex &=~ 100;
}
},
remove: function(){
if(this.Ox.tail) Jw(this.Ox.tail);
if(this.Ox.shadow) Jw(this.Ox.shadow);
this.Vg = null;
this.Mp = null;
this.Ai = 0;
this.Xd = null;
this.Di = null;
this.Hq = null;
this.jD = null;
this.Ms = null;
this.Ox.remove();
this.Ox = null;
if(this.Nr) Jw(this.Nr);
this.Nr = null;
},
onCloseClick: function(){
this.close();
},
hide: function(){
if(this.Ms){
this.Nr.style.visibility = "hidden";
this.Ox.tail.style.visibility = "hidden";
this.Ox.shadow.style.visibility = "hidden";
for(var i=0; i<this.Ai; i++){
this.Mp[i].body.style.visibility = "hidden";
}
}
},
visible: function(){
if(this.Ms){
this.Nr.style.visibility = "visible";
this.Ox.tail.style.visibility = "visible";
this.Ox.shadow.style.visibility = "visible";
for(var i=0; i<this.Ai; i++){
this.Mp[i].body.style.visibility = "visible";
}
}
},
isAvalable: function(){
return (this.Nr != null);
},
decorate: function(Hm){
if(Hm.border){
this.Ox.top.style.borderColor = Hm.border;
this.Ox.middle.style.borderColor = Hm.border;
this.Ox.bottom.style.borderColor = Hm.border;
}
if(Hm.color){
this.Ox.top.style.backgroundColor = Hm.color;
this.Ox.middle.style.backgroundColor = Hm.color;
this.Ox.bottom.style.backgroundColor = Hm.color;
}
if(Hm.max){
this.Xd = Hm.max.x;
this.Di = Hm.max.y;
}
},
moveTo: function(a){
Tx(this.Nr, a.x - this.Nr.offsetWidth/2 - s(this.Sw, "left"), a.y - this.Nr.offsetHeight - this.Ox.tail.offsetHeight - s(this.Sw,"top")+1);
Tx(this.Ox.tail, a.x - 50 - s(this.Sw, "left"), a.y - this.Ox.tail.offsetHeight - s(this.Sw, "top"));
Tx(this.Ox.shadow, a.x - 50 - s(this.Sw, "left"), a.y - this.Ox.shadow.offsetHeight - s(this.Sw, "top"));
for(var i=0; i<this.Ai; i++){
Tx(this.Mp[i].body, a.x - this.Nr.offsetWidth/2 - s(this.Sw,"left") + this.spaceX, a.y - this.Nr.offsetHeight - this.Ox.tail.offsetHeight - s(this.Sw,"top") + this.spaceY);
}
}
};
function Ne(u,Uv,Qp,w,h,x,y,p,c){
var t = Jt(u, Uv, Qp, w, h, p, c);
var stl = t.style;
if(x) stl.left = x + "px";
if(y) stl.top = y + "px";
return t;
};
function Ru(x,y,w,h,Mn,Bc,Ni,Ix,c,Il,Bw){
var t = No("", Il ? "relative" : "absolute", x ,y);
var stl = t.style;
stl.fontSize = "0";
if(Mn && Mn>0){
stl.borderTop = Mn + "px " + Bw + " solid";
h -= 1;
}
if(Bc && Bc>0){
stl.borderLeft = Bc + "px " + Bw + " solid";
w -= 1;
}
if(Ni && Ni>0){
stl.borderRight = Ni + "px " + Bw + " solid";
w -= 1;
}
if(Ix && Ix>0){
stl.borderBottom = Ix + "px " + Bw + " solid";
h -=1 ;
}
Ym(t,w,h);
stl.backgroundColor = c;
t.className = "object";
return t;
};
var NTPopupFactor = function(){
this.topleft =No('',"absolute", 0, 0);
this.topright =No('',"absolute", 0, 0);
this.bottomleft =No('',"absolute", 0, 0);
this.bottomright =No('',"absolute", 0, 0);
this.top =No('',"relative", 0, 0);
this.middle =No('',"relative", 0, 0);
this.bottom =No('',"relative", 0, 0);
this.tail =No('',"absolute", 0, 0);
this.shadow =No('',"absolute", 0, 0);
this.close =No('',"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="";
(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("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)?3:5;
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){
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 Ob = new NTSize(NTGeoUtil.getLonFactor(a) , NTGeoUtil.getLatFactor(a));
a.setScale(c);
a.setZoom(z);
var Vo = new NTSize(NTGeoUtil.getLonFactor(a) , NTGeoUtil.getLatFactor(a));
var Pl = Ob.x/Vo.x;
var Xr = Ob.y/Vo.y;
if(Pl > 5 || Pl < 0.2){
if(this.endFunction) this.endFunction();
return;
}
this.endSiz = new NTSize(Math.floor(this.startSiz.x * Pl),Math.floor(this.startSiz.y * Xr));
this.endPos = new NTSize(this.startPos.x - (Math.floor(this.startSiz.x * Pl)-this.startSiz.x)/2 , this.startPos.y - (Math.floor(this.startSiz.y * Xr)-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);
},
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.Vg=a;
this.Ro = b;
this.Yz = d;
this.Pn = c;
this.Ud;
this.Nu;
this.Lg;
this.Zj = new Array();
this.qH = 7;
this.Initialize();
};
NTMapIcon.prototype = {
Initialize: function(){
this.Ud = Tn(this.Ro.src, this.Ro.width,this.Ro.height);
this.Ud.className = (this.Pn !=null && this.Pn != "") ? "object" : "static";
this.Ud.style.visibility = "hidden";
if(this.Yz){
this.Nu = Tn(this.Yz.src, this.Yz.width,this.Yz.height);
this.Nu.className = "static";
this.Nu.style.visibility = "hidden";
}
},
addDocument: function(a,b){
this._parent = a;
this._zindex = b;
this.Ud.style.zIndex=this._zindex;
this._parent.appendChild(this.Ud);
this.Uh = document.createElement("div");
this.Uh.className="object";
this.Uh.style.position = "absolute";
this.Uh.style.width = this.Ud.offsetWidth+"px";
this.Uh.style.height = this.Ud.offsetHeight+"px";
this.Uh.style.zIndex = 440;
this._parent.appendChild(this.Uh);
for(var e = 0; e < this.Zj.length; e++){
NTEvent.add(this.Uh, this.Zj[e].type, this.Zj[e].func);
}
if(this.Nu){
this.Nu.style.zIndex=this._zindex-200;
this._parent.appendChild(this.Nu);
}
},
addEvent: function(a,b){
this.Zj.push({type:a, func:b});
},
removeEvent: function(){
},
getEvent: function(a){
if(a!=null){
for(e in this.Zj){
if(e.type == a) return e.func;
}
return function(){};
}
return this.Zj;
},
getId: function(){return this.Pn;},
getImage: function(){return this.Ud;},
getCather: function(){return this.Uh;},
getShadow: function(){return this.Nu;},
getPos: function(){return this.Vg;},
remove: function(){
var len = this._parent.childNodes.length;
for(var i=0; i<len; i++){
if(this._parent.childNodes[i]==this.Ud){
this._parent.removeChild(this._parent.childNodes[i]);
}
if(this.Nu != null && this._parent.childNodes[i]==this.Nu){
this._parent.removeChild(this._parent.childNodes[i]);
}
}
this.Ud = null;
this.Nu = null;
},
rebuild: function(){
this.Initialize();
this.addDocument(this._parent,this._zindex);
},
hide: function(){
if(!this.Ud) return;
this.Ud.style.visibility = "hidden";
if(this.Nu) this.Nu.style.visibility = "hidden";
},
visible: function(){
if(!this.Ud) return;
this.Ud.style.visibility = "visible";
if(this.Nu) this.Nu.style.visibility = "visible";
},
setGroup: function(a){
this.Lg = a;
},
getGroup: function(){
return this.Lg;
},
setIconPosition: function(a){
this.qH = a;
},
getIconPosition: function(){
return this.qH;
}
}
/* 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 Gg(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,2727,818,163);
return b[a.getScale()]/a.getZoom();
};
NTGeoUtil.getLatFactor = function(a){
if(NTGeoUtil.JP(a.getPos())){
var b = new Array(160000,26667,2223,667,134);
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.Nr = "http://www.navitime.co.jp/mapimage.jsp";
NTUrl.create = function(a,b){
var c=this.Nr;
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 in a.getParam()){
if(a.getParam()[i]==null) continue;
c += "&"+i + "=" + a.getParam()[i];
}
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;
this.downTarget;
this.mouseDownPos;
this.defaultPos = new NTSize(s(target,"left"),s(target, "top"));
this.isMouseDown=false;
this.differencialX;
this.differencialY;
this.movedX;
this.movedY;
this.dummy = No('',"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 - Lv(e);
this.differencialY = e.clientY - Hb(e);
this.defaultPos = new NTSize(s(this.srcElement, "left"),s(this.srcElement, "top"));
this.mouseDownPos = new NTSize(Lv(e), Hb(e));
this.isMouseDown = true;
this.movedX = 0;
this.movedY = 0;
CancelBubble(e);
};
NTMover.prototype.onMouseMove = function(e){
var stl = this.srcElement.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.Ko = false;
this.Kp = false;
this.Hr = $(a);
this.Pn = a;
var s;
this.Ui = new NTMapStatus(NTLatLng.parse(this.Hr.innerHTML),NTSize.parse(this.Hr),0,3,3);
this.Hr.innerHTML="";
s = this.Hr.style
s.textAlign="left";
s.overflow="hidden";
s.position="relative";
this.Vw = No("MovingContainer","relative", "0px", "0px");
s = this.Vw.style;
s.position = "absolute";
s.zIndex = 12;
this.Vw.className = "container";
this.Hr.appendChild(this.Vw);
this.My = No("IconContainer","absolute","0px","0px");
this.My.style.zIndex = 100;
this.My.className = "container";
this.Vw.appendChild(this.My);
this.Li = new Array();
this.Vk = 0;
this.Bi = 6;
this.Yh = (b && b.load=="manual")?false:true;
this.Nl = (b && b.mouse!=null)?b.mouse:2;
Wn.src = (b.image||"item1.2.png");
if(b && b.url) this.Lw = b.url;
this.Ma = false;
this.Mh = false;
this.Mb = null;
this.Bd = new Array();
this.Zn = new Array();
if(b && b.popup!="multi"){
this.Yp = new NTPopup(this.Ui.getPos());
this.Yp.createDocument(this.Vw);
this.Zn[0] = this.Yp;
}
this.cB= this.eventHandler("Ol");
this.Rs= this.eventHandler("Sq");
this.Su= this.eventHandler("Df");
this.Hi= this.eventHandler("Of");
this.Tp= this.eventHandler("Br");
this.Ae= this.eventHandler("Ho");
this.Nt= this.eventHandler("iB");
this.Vs= this.eventHandler("Ke");
this.Db= this.eventHandler("Wg");
this.Ay= this.eventHandler("bD");
this.Bv= this.methodHandler("We");
this.Tb= this.methodHandler("setZoom");
this.Uk= this.eventHandler("La");
this.Fw= this.eventHandler("Gl");
this.It= this.eventHandler("Hj");
NTEvent.add(window, 'load', this.cB);
NTEvent.add(window, 'unload', this.Rs);
this.Ed = b.copyrightInfo ? b.copyrightInfo : null;
};
NTMap.prototype.getId = function() {
return this.Pn;
};
NTMap.prototype.Ol = function(){
this.Ui.setSize(NTSize.parse(this.Hr));
Ym(this.My, this.Ui.getSize().x, this.Ui.getSize().y);
if(this.center!=null){
Tx(this.center, Math.round(this.Ui.getSize().x/2-this.center.offsetWidth/2), Math.round(this.Ui.getSize().y/2-this.center.offsetHeight/2));
this.center.style.visibility = "visible";
}
if(this.Jo!=null){
this.Jo.style.visibility = "visible";
}
var Cc = this.Vw.setCapture?this.Vw:window;
this.Oh = new NTMover(this.Vw);
this.Oh.downTarget=this.Vw;
if(this.Nl >= 2){
NTEvent.add(this.Vw, 'dblclick',this.Tp);
}else if(this.Nl == 1){
NTEvent.add(this.Vw, 'click',this.Tp);
}
if(this.Nl >= 2){
NTEvent.add(this.Vw,'mousedown',this.Ae);
NTEvent.add(Cc,'mousemove',this.Nt);
NTEvent.add(Cc,'mouseup',this.Vs);
}
if(this.Nl >= 1){
NTEvent.add(this.Vw, 'DOMMouseScroll', this.Uk);
NTEvent.add(this.Vw, 'mousewheel', this.Uk);
NTEvent.add(Kk,'keypress',this.Fw);
NTEvent.add(this.Vw, 'mouseover', this.Su); 
NTEvent.add(this.Vw, 'mouseout',this.Hi); 
}
NTEvent.add(window,'mouseout',this.Db);
NTEvent.add(this.Vw, 'contextmenu', this.It);
this.Ko=true;
var cpid = (this.Ed != null && this.Ed.id) ? this.Ed.id : 'cp';
var mY = No(cpid,'absolute');
this.Hr.appendChild(mY);
var Zk = mY.style;
Zk.fontSize = '10px';
Zk.color = '#000';
Zk.padding = '1px';
if (this.Ed == null) {
mY.innerHTML = UnescapeUTF7(NTGeoUtil.JP(this.Ui.getPos())?Eh:If);
Zk.left = "5px";
Zk.top = this.Ui.getSize().y - mY.offsetHeight -3+"px";
}
else {
if (this.Ed.text) {
mY.innerHTML = this.Ed.text;
}
else {
mY.innerHTML = UnescapeUTF7(NTGeoUtil.JP(this.Ui.getPos())?Eh:If);
}
if (!this.Ed.right && !this.Ed.left) {
Zk.left = "5px";
}
if (!this.Ed.top && !this.Ed.bottom) {
Zk.top = this.Ui.getSize().y - mY.offsetHeight -3+"px";
}
if (this.Ed.left) {
Zk.left = this.Ed.left + "px";
}
if (this.Ed.right) {
Zk.right = this.Ed.right + "px";
}
if (this.Ed.top) {
Zk.top = this.Ed.top + "px";
}
if (this.Ed.bottom) {
Zk.bottom = this.Ed.bottom + "px";
}
if (this.Ed.height) {
Zk.height = this.Ed.height + "px";
}
if (this.Ed.width) {
Zk.width = this.Ed.width + "px";
}
if (this.Ed.textAlign) {
Zk.textAlign = this.Ed.textAlign;
}
}
Zk.zIndex = 902;
if(this.Yh){
this.reload();
}else{
this.Lt=true;
}
};
NTMap.prototype.Sq = function(e){
this.clearMap();
this.Li = null;
this.Bd = null;
this.Zn = null;
Wn = null;
Km(this.Hr);
};
NTMap.prototype.Hj = function(e){
CancelBubble(e);
return false;
};
NTMap.prototype.Df = function(e){
if(NTUserAgent.type==1 && NTUserAgent.version==5) return false;
this.Vw.style.cursor = "pointer";
};
NTMap.prototype.Of = function(e){
if(NTUserAgent.type==1 && NTUserAgent.version==5) return false;
this.Vw.style.cursor = "default";
};
NTMap.prototype.Br = function(e){
if(!this.Lt) return false;
var Cj = e.target;
while(Cj.parentNode!=null){
if(Cj.className=="object") return;
Cj = Cj.parentNode;
}
if(NTUserAgent.type!=1 && NTUserAgent.version!=5){
this.Vw.style.cursor = "wait";
}
var a = Lv(e);
var c = Hb(e);
if(Es(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.Vw, "left");
c += s(this.Vw, "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.Vw, "left");
c += s(this.Vw, "top");
}
}else{
if(NTUserAgent.type==2 || NTUserAgent.type==3){
if(e.target == this.My){
a += s(this.Vw, "left");
}else{
a -= s(this.Vw, "left");
}
}
if(NTUserAgent.type==2 || NTUserAgent.type==3){
if(e.target == this.My){
c += s(this.Vw, "top");
}else{
c -= s(this.Vw, "top");
}
}
}
a -=this.Ui.getSize().x/2;
c -=this.Ui.getSize().y/2;
CancelBubble(e);
var f=new NTSize(a,c);
E[1](NTGeoUtil.pixel2LonLat(f,this.Ui),this);
this.moveTo(NTGeoUtil.pixel2LonLat(f,this.Ui));
};
NTMap.prototype.Ho = function(e){
if(!this.Lt) return false;
if(e.target.className=="object"){
CancelBubble(e);
return;
}
this.Oh.onMouseDown(e);
};
NTMap.prototype.iB = function(e){
if(!this.Lt) return false;
if(e.target.className=="object"){
CancelBubble(e);
return;
}
this.Oh.onMouseMove(e);
};
NTMap.prototype.Ke = function(e){
if(!this.Lt) return false;
if(e.target.className=="object"){
CancelBubble(e);
return;
}
var a = this.Oh.onMouseUp(e);
if(a){
this.Ui.setPos(NTGeoUtil.pixel2LonLat(a,this.Ui));
E[1](this.Ui.getPos(),this);
this.reload();
}
CancelBubble(e);
};
NTMap.prototype.La = function(e){
if(this.Mb==null || !this.Lt){
CancelBubble(e);
return;
}
var delta = 0;
if (e.wheelDelta) {
delta = e.wheelDelta/120;
if (NTUserAgent.type==4) delta = -delta;
} else if (e.detail) {
delta = -e.detail/3;
}
if(delta == 1){
this.Mb.onPlusClick();
}
if(delta == -1){
this.Mb.onMinusClick();
}
CancelBubble(e);
};
NTMap.prototype.Gl = function(e){
if(e.target.tagName == "INPUT" || e.target.tagName == "TEXTAREA") return;
if(e.target != Kk)
var lon = this.Ui.getPos().getLongitude();
var lat = this.Ui.getPos().getLatitude();
if(e.keyCode==37){
E[1](NTGeoUtil.pixel2LonLat(new NTSize(-this.Ui.getSize().x/2,0), this.Ui),this);
this.moveTo(NTGeoUtil.pixel2LonLat(new NTSize(-this.Ui.getSize().x/2,0), this.Ui));
CancelBubble(e);
}
if(e.keyCode==38){
E[1](NTGeoUtil.pixel2LonLat(new NTSize(0,-this.Ui.getSize().y/2), this.Ui),this);
this.moveTo(NTGeoUtil.pixel2LonLat(new NTSize(0,-this.Ui.getSize().y/2), this.Ui));
CancelBubble(e);
}
if(e.keyCode==39){
E[1](NTGeoUtil.pixel2LonLat(new NTSize(this.Ui.getSize().x/2,0), this.Ui),this)
this.moveTo(NTGeoUtil.pixel2LonLat(new NTSize(this.Ui.getSize().x/2,0), this.Ui));
CancelBubble(e);
}
if(e.keyCode==40){
E[1](NTGeoUtil.pixel2LonLat(new NTSize(0,this.Ui.getSize().y/2), this.Ui),this);
this.moveTo(NTGeoUtil.pixel2LonLat(new NTSize(0,this.Ui.getSize().y/2), this.Ui));
CancelBubble(e);
}
if(e.keyCode==187 || e.keyCode==107 || e.charCode == 43){
if(!this.Mb) return;
this.Mb.onMinusClick();
CancelBubble(e);
}
if(e.keyCode==189 || e.keyCode==109 || e.charCode == 45 || e.charCode == 61){
if(!this.Mb) return;
this.Mb.onPlusClick();
CancelBubble(e);
}
};
NTMap.prototype.bD = function(e){
if(this.center!=null){
Tx(this.center, Math.round(this.Ui.getSize().x/2-this.center.offsetWidth/2), Math.round(this.Ui.getSize().y/2-this.center.offsetHeight/2));
this.center.style.visibility = "visible";
}
var i=this.Vk % this.Bi;
if(!this.Mh){
Tx(this.Li[i], -s(this.Vw, "left") , -s(this.Vw,"top"));
this.Li[i].style.visibility = "visible";
this.buildIcon();
this.Am();
}
if(NTUserAgent.type!=1 && NTUserAgent.version!=5){
this.Vw.style.cursor = "pointer";
}
for(var x=0,y=i,z=this.Bi+50; x<this.Bi; x++,y++,z--){
if(y >= this.Bi){
y=0;
}
if(this.Li[y]==null || y==i){
continue;
}
this.Li[y].style.zIndex = z;
}
if(this.Ma){
this.clearMap();
this.Ma = false;
}
for(var i=0; i<this.Bd.length; i++){
this.Bd[i].visible();
}
for(var i=0; i<this.Zn.length; i++){
this.Zn[i].visible();
}
E[0](this.Ui.getPos(),this);
if(this.Fy!=null) this.Fy.set(this.Ui);
this.Kp = true;
if(!this.Mh){
this.Lt = true;
}
};
NTMap.prototype.Wg=function(e){
if(!e.relatedTarget){
this.Ke(e);
}
};
NTMap.prototype.moveTo = function(a){
if(arguments.length==0 && a==null) return false;
if(!this.Ko){
this.Ui.setPos(a);
}
if(!this.Lt) return false;
this.Lt = false;
var b = NTGeoUtil.LonLat2Pixel(a,this.Ui);
var mx = s(this.Vw, "left") - (b.x-this.Ui.getSize().x/2);
var my = s(this.Vw, "top") - (b.y-this.Ui.getSize().y/2);
if(Math.abs(s(this.Vw, "left") - mx) > 5000 || Math.abs(s(this.Vw, "top") - my) > 5000){
this.Ui.setPos(a);
this.Ma = true;
this.reload();
}else{
this.Mh = true;
this.Ui.setPos(a);
this.makeMapImage();
var m = new NTMapCtrl(this.Vw);
m.autoScrollTo(mx,my,this.Bv);
}
};
NTMap.prototype.We = function(a){
this.Mh = false;
var i=this.Vk % this.Bi;
Tx(this.Li[i], -s(this.Vw, "left"), -s(this.Vw, "top"));
this.buildIcon();
this.Am();
if(this.Kp){
this.Li[i].style.visibility = "visible";
this.Lt = true;
}
};
NTMap.prototype.reload = function(){
this.Ui.setSize(NTSize.parse(this.Hr));
if(!this.Ko && !this.Lt) return false;
return this.makeMapImage()? true: false;
};
NTMap.prototype.makeMapImage = function(){
this.Lt = false;
this.Kp = false;
this.Vk = ++this.Vk % this.Bi;
var stl, i=this.Vk;
if(this.Li[i]==null){
this.Li[i] = Gg("", this.Ui.getSize().x, this.Ui.getSize().y);
stl = this.Li[i].style;
stl.position = "absolute";
NTEvent.add(this.Li[i],'load',this.Ay);
this.Vw.appendChild(this.Li[i]);
}else{
stl = this.Li[i].style;
stl.width = this.Ui.getSize().x + "px";
stl.height = this.Ui.getSize().y + "px";
setAlpha(this.Li[i],100);
}
stl.visibility = "hidden";
stl.zIndex=this.Bi+50;
this.Li[i].src = NTUrl.create(this.Ui,(this.Lw||null));
return this.Li[i];
};
NTMap.prototype.clearMap = function(a){
for(var i=0; i<this.Li.length; i++){
if(this.Li[i]==null || i == this.Vk % this.Bi || (a!=null && this.Li[i]==a)) continue;
this.Li[i].style.visibility = "hidden";
}
};
NTMap.prototype.setZoom = function(a,b,c){
if(this.Ui.getScale()==a && this.Ui.getZoom()==b){
return false;
}
if(c && this.Yh && this.Ko && this.Kp){
for(var i=0; i<this.Bd.length; i++){
this.Bd[i].hide();
}
for(var i=0; i<this.Zn.length; i++){
this.Zn[i].hide();
}
if(this.Ep && this.Ep.iswork()){
this.clearMap();
this.Ep.stop();
}else{
var Ws = this.Li[this.Vk];
this.clearMap(Ws);
this.Ep = new NTMapScaleCtrl(Ws);
this.Ep.autoChangeScale(this.Ui,a,b,function(){
});
}
}
this.Ui.setScale(a);
this.Ui.setZoom(b);
if(this.Mb)
this.Mb.setStatus(this.Ui);
this.Ma = true;
if(this.Yh){
if(this.reload()){
E[0](this.Ui.getPos(),this);
E[2](this.getZoom(),this);
}
}
};
NTMap.prototype.getZoom = function(){
return {scale: this.Ui.getScale(), zoom: this.Ui.getZoom()};
};
NTMap.prototype.setPalette = function(a){
this.Ui.setPalette(a);
this.Ma = true;
if(this.Yh){
this.reload();
}
};
NTMap.prototype.addParam = function(a,b){
this.Ui.addParam(a,b);
};
NTMap.prototype.removeParam = function(a){
this.Ui.removeParam(a);
};
NTMap.prototype.getPos = function(){
return this.Ui.getPos();
};
NTMap.prototype.addRoute = function(){
for(var a=0; a<arguments.length; a++){
this.Ui.addRoute(arguments[a]);
}
if(this.Yh){
this.reload();
}
};
NTMap.prototype.removeRoute = function(){
var r = false;
if(arguments.length > 0){
for(var i=0; i<arguments.length; i++){
r=this.Ui.removeRoute(arguments[i]);
}
}else{
if(this.Ui.getRoute().length>0){
this.Ui.clearRoute();
r=true;
}
}
if(r && this.Yh){
this.reload();
}
};
NTMap.prototype.getRouteList = function(){
if(!this.Ui.getRoute().length) return null;
return this.Ui.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 = Tn(a,b,c,true,"object");
this.Hr.appendChild(this.center);
this.center.style.zIndex=900;
this.center.style.visibility = "hidden";
};
NTMap.prototype.addBackground = function(a){
if(a==null) return;
this.Jo = No("bgi","absolute",0,0);
Ym(this.Jo, this.Ui.getSize().x, this.Ui.getSize().y);
this.Jo.style.backgroundImage = "url(" + a.src + ")";
this.Hr.appendChild(this.Jo);
this.Jo.style.zIndex=10;
this.Jo.style.visibility = "hidden";
};
NTMap.prototype.addIcon = function(){
var Sb = arguments;
for(var i = 0; i<Sb.length; i++){
Sb[i].addDocument(this.Vw,301);
this.Bd.push(Sb[i]);
}
if(this.Kp){
this.buildIcon();
this.Am();
}
};
NTMap.prototype.getIcon = function(a){
var Zq = new Array();
for(var i=0; i<this.Bd.length; i++){
if(a && a!=this.Bd[i].getGroup()){
continue;
}
Zq.push(this.Bd[i]);
}
return Zq;
};
NTMap.prototype.clearIcon = function(a){
var Zq = new Array();
for(var i=0; i<this.Bd.length; i++){
if(a && a!=this.Bd[i].getGroup()){
Zq.push(this.Bd[i]);
continue;
}
this.Bd[i].remove();
}
this.Bd = Zq;
};
NTMap.prototype.buildIcon = function(){
for(var i=0; i<this.Bd.length; i++){
var a=this.Bd[i];
if(a.getImage()==null) continue;
var Ud = a.getImage();
if(a==null || a.getPos()==null) continue;
var p = NTGeoUtil.LonLat2Pixel(a.getPos(),this.Ui);
var iconXDiff = 0;
var iconYDiff = 0;
var position = a.getIconPosition();
if(position == 1 || position == 4 || position == 7){
iconXDiff = Ud.offsetWidth/2;
}
else if(position == 2 || position == 5 || position == 8){
iconXDiff = Ud.offsetWidth;
}
if(position == 3 || position == 4 || position == 5){
iconYDiff = Ud.offsetHeight/2;
}
else if(position == 6 || position == 7 || position == 8){
iconYDiff = Ud.offsetHeight;
}
Tx(Ud, p.x - iconXDiff - s(this.Vw, "left"), p.y - iconYDiff - s(this.Vw, "top"));
Tx(a.getCather(), p.x - iconXDiff - s(this.Vw, "left"), p.y - iconYDiff - s(this.Vw, "top"));
var is = a.getShadow();
if(is!=null){
Tx(is, s(Ud,"left"), new Number(s(Ud,"top")) + Ud.offsetHeight-is.offsetHeight);
is.style.visibility = "visible";
}
Ud.style.visibility = "visible";
}
};
NTMap.prototype.addMsg = function(a){
if(this.Yp){
return false;
}
var d = a.createDocument(this.Vw);
this.Zn.push(a);
a.moveTo(NTGeoUtil.LonLat2Pixel(a.getPos(),this.Ui));
return true;
};
NTMap.prototype.openMsg = function(Vg,a){
if(!this.Yp || !Vg){
return;
}
this.Yp.decorate({color:a.bgcolor, border: a.bordercolor, max:a.max});
this.Yp.setPos(Vg);
this.Yp.replaceContent({title:"", body:a.content});
this.Zn[0]=this.Yp;
this.Yp.moveTo(NTGeoUtil.LonLat2Pixel(Vg,this.Ui));
this.Yp.open();
return this.Yp;
};
NTMap.prototype.Am = function(){
for(var i=0; i<this.Zn.length; i++){
if(this.Zn[i]==null || this.Zn[i].getPos()==null) continue;
var p = NTGeoUtil.LonLat2Pixel(this.Zn[i].getPos(),this.Ui);
this.Zn[i].moveTo(p);
}
};
NTMap.prototype.loadToolbar = function(a){
if(!a) a = NTZoomToolbar.DEFAULT;
a.setParent(this.Hr);
a.setStatus(this.Ui);
a.onChange(this.Tb);
a.load();
this.Mb = a;
};
NTMap.prototype.loadScalebar = function(a){
this.Fy = new NTScaler(this.Hr,a);
};
NTMap.prototype.setProperty = function(a,b){
if(a=="autoload"){
this.Yh = b;
}
if(a=="url"){
this.Lw = b;
}
if(a=="image"){
Wn = new Image();
Wn.src = b;
}
};
NTMap.prototype.moveMapPlate = function(a,b){
style = this.Vw.style;
if(a) style.left = this.Vw.offsetLeft + a + "px";
if(b) style.top = this.Vw.offsetTop + b + "px";
};
NTMap.prototype.changeCenterPosition = function(a,b) {
this.Ui.setPos(NTGeoUtil.pixel2LonLat(new NTSize(a,b),this.Ui));
}
Rl('NTMap', NTMap);
Rl('NTSize', NTSize);
Rl('NTIcon', NTMapIcon);
Rl('NTImage', NTImage);
Rl('NTColor',NTColor);
Rl('NTLatLng', NTLatLng);
Rl('NTRoute', NTRoute);
Rl('NTPopup', NTPopup);
Rl('NTZoomToolbar', NTZoomToolbar);
Rl('NTResizer', NTResizer);
Rl('eventHandler',Object.eventHandler);
Rl('NTEvent', NTEvent);
Vf(NTMapCtrl);
Vf(NTMapScaleCtrl);
Vf(NTResizer);
})();
