/* 
Copyright 2006 NAVITIME JAPAN CO.,LTD. All Rights Reserved.
Auther by myoshida@navitime.co.jp
Version1.2.2
*/
(function() {
var Dh = new Image(450,340);
var My = document;
var Hr = '+VzBW8wAgZi1lh3k+-/+T09Ty5b7XeU-/+Vv1XH1cwdAaWYg-';
var Ts = '+ACY-copy+ADsAIA-2007+ACA-GPSStar';
function $() {
var elements = new Array();
for (var i = 0; i < arguments.length; i++) {
var element = arguments[i];
if (typeof element == 'string')
element = My.getElementById(element);
if (arguments.length == 1)
return element;
elements.push(element);
}
return elements;
}
function Gz(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 Ck(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 Qh(e){
if(NTUserAgent.type==1){
return e.target.className;
}else if(NTUserAgent.type==3){
return e.target.className;
}else{
return e.target.className;
}
};
function Fk(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 Ji(a,b,c,d){
var r = My.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 Jv(u,w,h){
var r = My.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 Im(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 Hh(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){
Hh(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 Bw(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(My.body){
My.body.scroll=a?"auto":"no"
if(window.innerHeight){
var s = My.body.style;
s.height=a?"auto":window.innerHeight-32
s.width=a?"auto":window.innerWidth-32
s.overflow=a?"visible":"hidden"
}
}else if(My.height){
if(a && My._height){
My.height=My._height
delete My._height
My.width=My._width
delete My._width
window.onresize=window._resize
}
if(!a){
if(!My._height){
My._height=My.height
My._width=My.width
window._resize=window.onresize
window.onresize=new Function("if(window._resize)_resize();scrollbar(false)")
}
My.height=window.innerHeight
My.width=window.innerWidth
}
}
}
var E = [
function(a){(window["onMapLoad"] || EmptyFunction)(a);},
function(a){(window["onMapMove"] || EmptyFunction)(a);},
];
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 Bs(b,w,h,p,c){
var a;
if(NTUserAgent.type==1 && NTUserAgent.version<7){
a = Ji(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 = Jv(b,w,h);
a.style.position="absolute";
}
if(c) a.className = c;
return a;
}
function Sl(u,x,y,w,h,p,c){
var a=Ji("",p ? "relative" : "absolute", 0, 0);
a.style.overflow = "hidden";
Cc(a,w,h);
var b=Bs(u,Dh.width, Dh.height, false, c);
a.appendChild(b);
Fv(b,-x, -y);
if(c) a.className = c;
return a;
}
function Fv(a,b,c){
var s = a.style;
s.left = isNaN(b)?b:b+'px';
s.top= isNaN(c)?c:c+'px';
}
function Cc(a,b,c){
var s = a.style;
s.width= isNaN(b)?b:b+'px';
s.height = isNaN(c)?c:c+'px';
}
function Iv(a){
var Uf = document.createElement(a.tagName);
for(var i in a.style){
try{Uf.style[i] = a.style[i];}catch(e){}
}
var l = a.childNodes.length;
for(var i=0; i<l; i++){
var copyObject = Iv(a.childNodes[i]);
Uf.appendChild(copyObject);
}
if(a.innerHTML) Uf.innerHTML = a.innerHTML;
return Uf;
}
var NTHashMap = function(){
this.Qt = new Object();
for(var i in this.Qt){
this.Qt[i] = null;
}
this.hQ = 0;
};
NTHashMap.prototype = {
put: function(a,b){
this.Qt[a] = b;
this.hQ++;
},
get: function(a){
for(var i in this.Qt){
if(i == a) return this.Qt[i];
}
return null;
},
remove: function(a){
this.hQ--;
this.Qt[a] = null;
},
size: function(a){
return this.hQ;
},
toArray: function(a){
if(this.size()==0){
return [];
}
return this.Qt;
},
toString: function(){
if(this.size()==0){
return "";
}
var ret="{";
for(var i in this.Qt){
if(this.Qt[i]!=null) ret+= (ret.length==1?"":",") + i + ":" + this.Qt[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 Zr(a,b,c){
if(b!=null){
a=Eb(a,b)
}
if(c!=null){
a=Kt(a,c)
}
return a
}
function Nm(a,b,c){
while(a>c){
a-=c-b
}
while(a<b){
a+=c-b
}
return a
}
function Kt(a,b){
return Math.min(a,b)
}
function Eb(a,b){
return Math.max(a,b)
}
function Od(a){
return a*Math.PI/180
}
NTLatLng.prototype.latRadians=function(){
return Od(Zr(this.Latitude/3600000,-90,90))
};
NTLatLng.prototype.lngRadians=function(){
return Od(Nm(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(){
alert("aaa")
};
/* 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);
function NTZoomToolbar(){
this.Al = new Array();
for (var i=arguments.length-1, j=0; i >0 ; i-=2, j++) {
this.Al[j] = new Qq(arguments[i-1],arguments[i]);
}
this.Iy = My.body;
this.Zn = null;
this.Ip= this.eventHandler("onMouseDown");
this.Su= this.eventHandler("onMouseMove");
this.Wb= this.eventHandler("onMouseUp");
this.Ia= this.eventHandler("onMouseOver");
this.Yo= this.eventHandler("onMouseOut");
this.Zz= this.eventHandler("onPlusClick");
this.yI= this.eventHandler("onMinusClick");
this.Ao= this.eventHandler("onRailClick");
this.Ey= false;
this.changedFunc = null;
this.Ri = 9;
this.Qr = 0;
}
NTZoomToolbar.DEFAULT = new NTZoomToolbar(1,5,1,8,1,14,1,24,2,3,2,5,3,5,3,7,3,9,3,12,4,2,4,3,4,6,4,10);
NTZoomToolbar.prototype.addZoom = function(a,b){
this.Al[this.Al.length] = new Qq(a,b);
};
NTZoomToolbar.prototype.setParent = function(a){
this.Iy = a;
};
NTZoomToolbar.prototype.onChange = function(a){
this.changedFunc = a;
};
NTZoomToolbar.prototype.setStatus = function(a){
this.Zn = a;
for(var i=0; i<this.Al.length; i++){
var z = this.Al[i];
if(a.getScale()==z.getScale() && a.getZoom()==z.getZoom()){
this.Qr = i;
break;
}
}
if(this.Qr != 0){
this.scrollTo(this.Qr * this.Ri + 1);
}
};
NTZoomToolbar.prototype.setScaleByPoi = function(a){
if(a==null || a.poi==null || a.poi.length==0) return;
var Hs=0,Us=0,It=0,Ww=0,Nn,Gf;
for(var i=0; i<a.poi.length; i++){
if(a.poi[i]==null){continue;}
if(a.center == null){
if(Hs == 0 || Hs < a.poi[i].getLongitude()){ Hs=a.poi[i].getLongitude();}
if(Us == 0 || Us > a.poi[i].getLongitude()){ Us=a.poi[i].getLongitude();}
if(It == 0 || It < a.poi[i].getLatitude()){ It=a.poi[i].getLatitude();}
if(Ww == 0 || Ww > a.poi[i].getLatitude()){ Ww=a.poi[i].getLatitude();}
}else{
if(Hs == 0 || Hs < Math.abs(a.poi[i].getLongitude() - a.center.getLongitude())){
Hs = Math.abs(a.poi[i].getLongitude() - a.center.getLongitude());
}
if(It == 0 || It < Math.abs(a.poi[i].getLatitude() - a.center.getLatitude())){
It = Math.abs(a.poi[i].getLatitude() - a.center.getLatitude());
}
}
}
if(a.center == null){
Nn = Math.abs(Hs - Us)*1.1;
Gf = Math.abs(It - Ww)*1.1;
}else{
Nn = Hs * 2 *1.1;
Gf = It * 2 *1.1;
}
for(var i=0; i < this.Al.length; i++){
var s = new NTMapStatus(this.Zn.getPos(),this.Zn.getSize(),0,this.Al[i].getScale(),this.Al[i].getZoom());
var pxOfLon = Math.ceil(NTGeoUtil.getLonFactor(s));
var pxOfLat = Math.ceil(NTGeoUtil.getLatFactor(s));
if(this.Zn.getSize().x * pxOfLon > Nn && this.Zn.getSize().y * pxOfLat > Gf){
this.scrollTo(i * this.Ri + 1, true);
break;
}
}
if(a.center==null){
return new NTLatLng(Math.round(new Number(Ww) + new Number(It-Ww)/2) , Math.round(new Number(Us) + new Number(Hs - Us)/2));
}else{
return a.center;
}
};
NTZoomToolbar.prototype.onMouseDown = function(e){
this.Ne.onMouseDown(e);
this.Ey = true;
}
NTZoomToolbar.prototype.onMouseMove = function(e){
this.Ne.onMouseMove(e);
}
NTZoomToolbar.prototype.onMouseUp = function(e){
CancelBubble(e);
if(!this.Ey) return;
var a = this.Ne.onMouseUp(e);
this.scrollTo(s(this.Vq,"top")+1);
this.Ey = false;
}
NTZoomToolbar.prototype.onRailClick = function(e){
if(e.target.parentNode != this.Fa){
return false;
}
var Zm = Ck(e);
if(NTUserAgent.type==2) Zm -=104;
if(NTUserAgent.type==4) Zm += e.target.offsetTop;
this.scrollTo(Zm);
};
NTZoomToolbar.prototype.scrollTo = function(a,b){
if(b==null) b=false;
var idx = Math.floor((a-1) / this.Ri);
if(idx >= this.Al.length){
return false;
}
var ztv = this.Al[idx];
if(this.Vq) this.Vq.style.top = idx * this.Ri + 1 + "px";
if(this.changedFunc != null){
this.changedFunc(ztv.getScale(), ztv.getZoom(),b);
}
};
NTZoomToolbar.prototype.load = function(){//Toolbar(icon設定)
var style;
this.Rl = Ji("zoomToolbar","relative","10px","20px");
style = this.Rl.style;
style.zIndex=901;
style.width = "26px";
style.padding = "2px";
this.Iy.appendChild(this.Rl);
this.Qz = Sl(Dh.src, 75, 75, 25, 25, 'relative', '');//Sl(u,x,y,w,h,p,c) Toolbar(+)
style = this.Qz.style;
style.left = '3px';
style.top = '2px';
this.Rl.appendChild(this.Qz);
this.Fa = Sl(Dh.src, 100, 50, 25, this.Al.length * this.Ri + 5, 'relative', ''); //Toolbar(選單)
style = this.Fa.style;
style.left = '3px';
style.top = '0px';
this.Rl.appendChild(this.Fa);
this.Tq = Sl(Dh.src, 75, 50, 25, 25, 'relative', '');//Toolbar(-)
style = this.Tq.style;
style.left = '3px';
style.top = '0px';
this.Rl.appendChild(this.Tq);
this.Vq = Sl(Dh.src, 75, 100, 25, 18, 'absolute', '');//Toolbar(選擇)
style = this.Vq.style;
style.top = '1px';
this.Fa.appendChild(this.Vq);
var Aj = this.Vq.setCapture?this.Vq:window;
NTEvent.add(this.Vq,'mousedown',this.Ip);
NTEvent.add(Aj,'mousemove',this.Su);
NTEvent.add(Aj,'mouseup',this.Wb);
NTEvent.add(this.Fa, 'click', this.Ao);
NTEvent.add(this.Qz,'mouseover',this.Ia);
NTEvent.add(this.Tq,'mouseover',this.Ia);
NTEvent.add(this.Vq,'mouseover',this.Ia);
NTEvent.add(this.Fa,'mouseover',this.Ia);
NTEvent.add(this.Qz,'mouseout',this.Yo);
NTEvent.add(this.Tq,'mouseout',this.Yo);
NTEvent.add(this.Vq,'mouseout',this.Yo);
NTEvent.add(this.Fa,'mouseout',this.Yo);
NTEvent.add(this.Qz,'click',this.Zz);
NTEvent.add(this.Tq,'click',this.yI);
this.Ne = new NTMover(this.Vq);
this.Ne.downTarget=this.Vq;
this.Ne.setAvailableArea(new NTSize(0,1), new NTSize(0,(s(this.Fa,"height")-s(this.Vq,"height"))));
if(this.Qr != 0){
this.scrollTo(this.Qr * this.Ri + 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.Vq,"top") >= this.Al.length * this.Ri + 5 ){
return false;
}
this.scrollTo(s(this.Vq,"top") + this.Ri, true);
};
NTZoomToolbar.prototype.onPlusClick = function(e){
if(s(this.Vq,"top") <= 1){
return false;
}
this.scrollTo(s(this.Vq,"top") - this.Ri, true);
};
NTZoomToolbar.prototype.getContent = function(){
return this.Rl;
};
function Qq(a,b){
this.scale = a;
this.zoom = b;
}
Qq.prototype.getScale = function(){
return this.scale;
};
Qq.prototype.getZoom = function(){
return this.zoom;
};
function NTScaler(a){
var top = s(a,"height")-37;
var stl;
this._sc = Ji('NTScale',"absolute","10px",top+"px");
stl = this._sc.style;
stl.zIndex = 910;
stl.font = "0px Arial";
stl.backgroundColor = "#FFF";
stl.height ="18px";
setAlpha(this._sc,60);
a.appendChild(this._sc);
this._bar = Ji('NTScaleBar',"absolute","12px", top+5+"px");
stl = this._bar.style;
stl.zIndex = 911;
stl.border = "1px #000 solid";
stl.width = "0px";
stl.height = "6px";
stl.backgroundColor = "#FFF";
stl.fontSize = "0px";
a.appendChild(this._bar);
this._text = Ji('NTScaleText',"absolute","0px",top+2+"px");
stl = this._text.style;
stl.zIndex = 912;
stl.color = "#555";
stl.font = "bold 10px Arial";
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 Pm(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=Pm(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.Qo = a;
this.Kp = new Array();
this.Xw = new NTPopupFactor();
this.spaceX = 8;
this.spaceY = 24;
this.Dx = false;
this.Aw = 0;
this.Gb = 0;
this.Uo = 0;
this.Cs = "#FFF";
this.Cy = "#949494";
if(b){
if(b.max){
this.Gb = b.max.x;
this.Uo = b.max.y;
}
if(b.bgcolor) this.Cs = b.bgcolor;
if(b.bordercolor) this.Cy = b.bordercolor;
}
};
NTPopup.prototype = {
createDocument: function(a){
this.Iy = a;
this.Sw = Ji("","relative",0,0);
var s = this.Sw.style;
s.cursor = "default";
s.visibility = "hidden";
this.Xw.top = wW(25, 0, 220-(25-this.spaceX)*2, 25, 1, 0, 0, 0, this.Cs,true, this.Cy );
this.Xw.middle = wW(0, 0, 240+20, 50-20, 0, 1, 1, 0, this.Cs,true, this.Cy );
this.Xw.bottom = wW(25, 0, 220-(25-this.spaceX)*2, 25, 0, 0, 0, 1, this.Cs,true, this.Cy );
this.Xw.tail = Rm(Dh.src,50,0,100,50,0,-1,false,"static");
this.Xw.tail.style.visibility = "hidden";
this.Xw.topleft = Rm(Dh.src,0,0,25,25,0,0,false,"object");
this.Xw.topright = Rm(Dh.src,25,0,25,25,0,0,false,"object");
this.Xw.bottomleft = Rm(Dh.src,0,25,25,25,0,0,false,"object");
this.Xw.bottomright = Rm(Dh.src,25,25,25,25,0,0,false,"object");
this.Xw.shadow = Rm(Dh.src,150,0,300,150,0,0,false,"static");
this.Xw.shadow.style.visibility = "hidden";
this.Xw.close = Rm(Dh.src,0,50,15,15,0,0,false,"object");
this.Xw.close.style.cursor = "pointer";
NTEvent.add(this.Xw.close, 'click', this.closeClickHandler);
var bg = this.Xw.getFactor();
for(var i=0; i< bg.length; i++){
this.Sw.appendChild(bg[i]);
}
this.Sw.style.position = "absolute";
this.Iy.appendChild(this.Sw);
this.Iy.appendChild(this.Xw.tail);
this.Iy.appendChild(this.Xw.shadow);
for(var o=0; o<this.Aw; o++){
this.Iy.appendChild(this.Kp[o].body);
}
this.setDepth();
this.resize();
return this.getDocument();
},
getDocument: function(){
return {base: this.Sw, shadow: this.Xw.shadow, tail: this.Xw.tail};
},
getPos: function(){
return this.Qo;
},
setPos: function(a){
this.Qo = a;
},
addContent: function(a,b){
b.className = "object";
var style = b.style;
style.display = "block";
style.visibility = "hidden";
style.position = "absolute";
var Sr = {title:a, body:b};
this.Kp.push(Sr);
this.Aw++;
},
getContent: function(){
return this.Kp;
},
replaceContent: function(a){
for(var o=0; o<this.Aw; o++){
this.Kp[o].body.style.display="none";
this.Kp[o].body.style.visibility="hidden";
}
this.Kp = new Array();
this.Aw = 0;
this.addContent(a.title, a.body);
for(var o=0; o<this.Aw; o++){
this.Iy.appendChild(this.Kp[o].body);
}
this.setDepth();
this.resize();
},
resize: function(a,b){
var Vt;
if(!a && !b){
if(this.Aw == 0) return;
var Gb=130, Uo=50;
for(var i=0; i<this.Aw; i++){
lS = this.Kp[i].body;
Vt = lS.style;
Vt.position = "relative";
if(lS.offsetWidth > Gb){
if(this.Gb > 0 && lS.offsetWidth > this.Gb){
Gb = this.Gb<130?130:this.Gb;
Vt.width = this.Gb + "px";
}else{
Gb = lS.offsetWidth<150?150:lS.offsetWidth;
Vt.width = Gb+"px";
}
}else{
Vt.width = Gb+"px";
}
if(lS.offsetHeight > Uo){
if(this.Uo>0 && lS.offsetHeight > this.Uo){
Uo = this.Uo;
Vt.height = this.Uo - this.spaceY + "px";
Vt.overflow = "auto";
}else{
Uo = lS.offsetHeight;
Vt.height = Uo+"px";
}
}
Vt.position = "absolute";
}
a = Gb;
b = Uo;
}
Cc(this.Xw.middle, a+(this.spaceX*2)-2, b-(25-this.spaceY/2));
Cc(this.Xw.top, a-(25-this.spaceX)*2, 24);
Cc(this.Xw.bottom, a-(25-this.spaceX)*2,24);
Fv(this.Xw.topright, a + this.spaceX -(25 - this.spaceX), 0);
Fv(this.Xw.bottomleft, 0, b+(this.spaceY/2));
Fv(this.Xw.bottomright, a + this.spaceX -(25 - this.spaceX), b+(this.spaceY/2));
Fv(this.Xw.tail, (a-100)/2+this.spaceX,-1);
Fv(this.Xw.shadow, Gb/2 - 50, this.Sw.offsetHeight - this.Xw.shadow.offsetHeight);
Fv(this.Xw.close, Gb+this.spaceX-this.Xw.close.offsetWidth, 5);
Vt = this.Sw.style;
Vt.width = a + this.spaceX * 2 + "px";
Vt.height = this.Xw.top.offsetHeight + this.Xw.middle.offsetHeight + this.Xw.bottom.offsetHeight + "px";
Vt.overflow = "hidden";
},
setDepth: function(a){
this.Sw.style.zIndex = (a||400);
this.Xw.tail.style.zIndex = (a||400)+20;
this.Xw.shadow.style.zIndex = (a||400)-200;
for(var o=0; o<this.Aw; o++){
this.Kp[o].body.style.zIndex = (a||400)+60;
}
},
open: function(){
this.Sw.style.visibility = "visible";
this.Xw.tail.style.visibility = "visible";
this.Xw.shadow.style.visibility = "visible";
this.Dx = true;
if(this.Aw>0) this.Kp[0].body.style.visibility = "visible";
},
close: function(){
this.Sw.style.visibility = "hidden";
this.Xw.tail.style.visibility = "hidden";
this.Xw.shadow.style.visibility = "hidden";
this.Dx = false;
for(var i=0; i<this.Aw; i++){
this.Kp[i].body.style.visibility = "hidden";
}
},
foreground: function(){
this.Sw.style.zIndex |= 100;
var bg = this.Xw.getFactor();
for(var i=0; i< bg.length; i++){
bg[i].style.zIndex |= 100;
}
for(var i=0; i<this.Aw; i++){
this.Kp[i].body.style.zIndex|=100;
}
},
back: function(){
this.Sw.style.zIndex &=~ 100;
var bg = this.Xw.getFactor();
for(var i=0; i< bg.length; i++){
bg[i].style.zIndex &=~ 100;
}
for(var i=0; i<this.Aw; i++){
this.Kp[i].body.style.zIndex &=~ 100;
}
},
remove: function(){
if(this.Xw.tail) Im(this.Xw.tail);
if(this.Xw.shadow) Im(this.Xw.shadow);
this.Qo = null;
this.Kp = null;
this.Aw = 0;
this.Gb = null;
this.Uo = null;
this.Cs = null;
this.Cy = null;
this.Dx = null;
this.Xw.remove();
this.Xw = null;
if(this.Sw) Im(this.Sw);
this.Sw = null;
},
onCloseClick: function(){
this.close();
},
hide: function(){
if(this.Dx){
this.Sw.style.visibility = "hidden";
this.Xw.tail.style.visibility = "hidden";
this.Xw.shadow.style.visibility = "hidden";
for(var i=0; i<this.Aw; i++){
this.Kp[i].body.style.visibility = "hidden";
}
}
},
visible: function(){
if(this.Dx){
this.Sw.style.visibility = "visible";
this.Xw.tail.style.visibility = "visible";
this.Xw.shadow.style.visibility = "visible";
for(var i=0; i<this.Aw; i++){
this.Kp[i].body.style.visibility = "visible";
}
}
},
isAvalable: function(){
return (this.Sw != null);
},
decorate: function(Pj){
if(Pj.border){
this.Xw.top.style.borderColor = Pj.border;
this.Xw.middle.style.borderColor = Pj.border;
this.Xw.bottom.style.borderColor = Pj.border;
}
if(Pj.color){
this.Xw.top.style.backgroundColor = Pj.color;
this.Xw.middle.style.backgroundColor = Pj.color;
this.Xw.bottom.style.backgroundColor = Pj.color;
}
if(Pj.max){
this.Gb = Pj.max.x;
this.Uo = Pj.max.y;
}
},
moveTo: function(a){
Fv(this.Sw, a.x - this.Sw.offsetWidth/2 - s(this.Iy, "left"), a.y - this.Sw.offsetHeight - this.Xw.tail.offsetHeight - s(this.Iy,"top")+1);
Fv(this.Xw.tail, a.x - 50 - s(this.Iy, "left"), a.y - this.Xw.tail.offsetHeight - s(this.Iy, "top"));
Fv(this.Xw.shadow, a.x - 50 - s(this.Iy, "left"), a.y - this.Xw.shadow.offsetHeight - s(this.Iy, "top"));
for(var i=0; i<this.Aw; i++){
Fv(this.Kp[i].body, a.x - this.Sw.offsetWidth/2 - s(this.Iy,"left") + this.spaceX, a.y - this.Sw.offsetHeight - this.Xw.tail.offsetHeight - s(this.Iy,"top") + this.spaceY);
}
}
};
function Rm(u,Dz,Is,w,h,x,y,p,c){
var t = Sl(u, Dz, Is, w, h, p, c);
var stl = t.style;
if(x) stl.left = x + "px";
if(y) stl.top = y + "px";
return t;
};
function wW(x,y,w,h,Op,rQ,Du,Uq,c,Ep,Tg){
var t = Ji("", Ep ? "relative" : "absolute", x ,y);
var stl = t.style;
stl.fontSize = "0";
if(Op && Op>0){
stl.borderTop = Op + "px " + Tg + " solid";
h -= 1;
}
if(rQ && rQ>0){
stl.borderLeft = rQ + "px " + Tg + " solid";
w -= 1;
}
if(Du && Du>0){
stl.borderRight = Du + "px " + Tg + " solid";
w -= 1;
}
if(Uq && Uq>0){
stl.borderBottom = Uq + "px " + Tg + " solid";
h -=1 ;
}
Cc(t,w,h);
stl.backgroundColor = c;
t.className = "object";
return t;
};
var NTPopupFactor = function(){
this.topleft =Ji('',"absolute", 0, 0);
this.topright =Ji('',"absolute", 0, 0);
this.bottomleft =Ji('',"absolute", 0, 0);
this.bottomright =Ji('',"absolute", 0, 0);
this.top =Ji('',"relative", 0, 0);
this.middle =Ji('',"relative", 0, 0);
this.bottom =Ji('',"relative", 0, 0);
this.tail =Ji('',"absolute", 0, 0);
this.shadow =Ji('',"absolute", 0, 0);
this.close =Ji('',"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 Av = new NTSize(NTGeoUtil.getLonFactor(a) , NTGeoUtil.getLatFactor(a));
a.setScale(c);
a.setZoom(z);
var Eq = new NTSize(NTGeoUtil.getLonFactor(a) , NTGeoUtil.getLatFactor(a));
var rZ = Av.x/Eq.x;
var Uw = Av.y/Eq.y;
if(rZ > 5 || rZ < 0.2){
if(this.endFunction) this.endFunction();
return;
}
this.endSiz = new NTSize(Math.floor(this.startSiz.x * rZ),Math.floor(this.startSiz.y * Uw));
this.endPos = new NTSize(this.startPos.x - (Math.floor(this.startSiz.x * rZ)-this.startSiz.x)/2 , this.startPos.y - (Math.floor(this.startSiz.y * Uw)-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.Qo=a;
this.Ar = b;
this.mZ = d;
this.Fq = c;
this.Ab;
this.Ca;
this.Uz;
this.Th = new Array();
this.Initialize();
};
NTMapIcon.prototype = {
Initialize: function(){
this.Ab = Bs(this.Ar.src, this.Ar.width,this.Ar.height);
this.Ab.className = (this.Fq !=null && this.Fq != "") ? "object" : "static";
this.Ab.style.visibility = "hidden";
if(this.mZ){
this.Ca = Bs(this.mZ.src, this.mZ.width,this.mZ.height);
this.Ca.className = "static";
this.Ca.style.visibility = "hidden";
}
},
addDocument: function(a,b){
this._parent = a;
this._zindex = b;
this.Ab.style.zIndex=this._zindex;
this._parent.appendChild(this.Ab);
this.Nh = document.createElement("div");
this.Nh.className="object";
this.Nh.style.position = "absolute";
this.Nh.style.width = this.Ab.offsetWidth+"px";
this.Nh.style.height = this.Ab.offsetHeight+"px";
this.Nh.style.zIndex = 440;
this._parent.appendChild(this.Nh);
for(var e = 0; e < this.Th.length; e++){
NTEvent.add(this.Nh, this.Th[e].type, this.Th[e].func);
}
if(this.Ca){
this.Ca.style.zIndex=this._zindex-200;
this._parent.appendChild(this.Ca);
}
},
addEvent: function(a,b){
this.Th.push({type:a, func:b});
},
removeEvent: function(){
},
getEvent: function(a){
if(a!=null){
for(e in this.Th){
if(e.type == a) return e.func;
}
return function(){};
}
return this.Th;
},
getId: function(){return this.Fq;},
getImage: function(){return this.Ab;},
getCather: function(){return this.Nh;},
getShadow: function(){return this.Ca;},
getPos: function(){return this.Qo;},
remove: function(){
var len = this._parent.childNodes.length;
for(var i=0; i<len; i++){
if(this._parent.childNodes[i]==this.Ab){
this._parent.removeChild(this._parent.childNodes[i]);
}
if(this.Ca != null && this._parent.childNodes[i]==this.Ca){
this._parent.removeChild(this._parent.childNodes[i]);
}
}
this.Ab = null;
this.Ca = null;
},
rebuild: function(){
this.Initialize();
this.addDocument(this._parent,this._zindex);
},
hide: function(){
if(!this.Ab) return;
this.Ab.style.visibility = "hidden";
if(this.Ca) this.Ca.style.visibility = "hidden";
},
visible: function(){
if(!this.Ab) return;
this.Ab.style.visibility = "visible";
if(this.Ca) this.Ca.style.visibility = "visible";
},
setGroup: function(a){
this.Uz = a;
},
getGroup: function(){
return this.Uz;
}
}
/* 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 Jv(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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,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.Sw = "http://services.navitime.jp/pages/00001001/ImageRasterNV.jsp";
NTUrl.create = function(a,b){
var c=this.Sw;
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{
cache[cache.length] = new NTRouteIcon(cache.length,route[i].orv,NTRouteIcon.START,route[i].orvtf);
route[i].setOrvId(cache.length-1);
}
if(di!=-1){
route[i].setDnvId(di);
cache[di].icon = NTRouteIcon.OTHER;
}else{
cache[cache.length] = new NTRouteIcon(cache.length,route[i].dnv,NTRouteIcon.END,route[i].dnvtf);
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() + ",,,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){
this.id=a;
this.pos=b;
this.icon=c;
this.toll=d;
};
NTRouteIcon.START = "10001";
NTRouteIcon.END = "10002";
NTRouteIcon.OTHER = "10003";
/* 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 = Ji('',"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 - Gz(e);
this.differencialY = e.clientY - Ck(e);
this.defaultPos = new NTSize(s(this.srcElement, "left"),s(this.srcElement, "top"));
this.mouseDownPos = new NTSize(Gz(e), Ck(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;
};
NTRoute.prototype.setColor = function(a){
this.color = a;
};
NTRoute.prototype.setImage = function(a,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.Gq = false;
this.Pu = false;
this.Da = $(a);
var s;
this.Zn = new NTMapStatus(NTLatLng.parse(this.Da.innerHTML),NTSize.parse(this.Da),0,3,3);
this.Da.innerHTML="";
s = this.Da.style
s.textAlign="left";
s.overflow="hidden";
s.position="relative";
this.Ew = Ji("MovingContainer","relative", "0px", "0px");
s = this.Ew.style;
s.position = "absolute";
s.zIndex = 12;
this.Ew.className = "container";
this.Da.appendChild(this.Ew);
this.uS = Ji("IconContainer","absolute","0px","0px");
this.uS.style.zIndex = 100;
this.uS.className = "container";
this.Ew.appendChild(this.uS);
this.Dg = new Array();
this.Dv = 0;
this.Lq = 6;
this.Rs = (b && b.load=="manual")?false:true;
this.Yp = (b && b.mouse!=null)?b.mouse:2;
Dh.src = (b.image||"item1.2.png");
if(b && b.url) this.Mo = b.url;
this.Hx = false;
this.Ub = false;
this.sT = null;
this.Gp = new Array();
this.Bp = new Array();
if(b && b.popup!="multi"){
this.Tw = new NTPopup(this.Zn.getPos());
this.Tw.createDocument(this.Ew);
this.Bp[0] = this.Tw;
}
this.Ff= this.eventHandler("wA");
this.Gy= this.eventHandler("Lh");
this.Ia= this.eventHandler("fU");
this.Yo= this.eventHandler("Sq");
this.Ay= this.eventHandler("Rb");
this.Ip= this.eventHandler("Au");
this.Su= this.eventHandler("fF");
this.Wb= this.eventHandler("jP");
this.Cm= this.eventHandler("Mb");
this.kC= this.eventHandler("Ct");
this.pK= this.methodHandler("Wc");
this.Oj= this.methodHandler("setZoom");
this.Go= this.eventHandler("Rq");
this.Pc= this.eventHandler("Ki");
this.bG= this.eventHandler("Up");
NTEvent.add(window, 'load', this.Ff);
NTEvent.add(window, 'unload', this.Gy);
};
NTMap.prototype.wA = function(){
this.Zn.setSize(NTSize.parse(this.Da));
Cc(this.uS, this.Zn.getSize().x, this.Zn.getSize().y);
if(this.center!=null){
Fv(this.center, Math.round(this.Zn.getSize().x/2-this.center.offsetWidth/2), Math.round(this.Zn.getSize().y/2-this.center.offsetHeight/2));
this.center.style.visibility = "visible";
}
if(this.Lv!=null){
this.Lv.style.visibility = "visible";
}
var Aj = this.Ew.setCapture?this.Ew:window;
this.Jd = new NTMover(this.Ew);
this.Jd.downTarget=this.Ew;
if(this.Yp >= 2){
NTEvent.add(this.Ew, 'dblclick',this.Ay);
}else if(this.Yp == 1){
NTEvent.add(this.Ew, 'click',this.Ay);
}
if(this.Yp >= 2){
NTEvent.add(this.Ew,'mousedown',this.Ip);
NTEvent.add(Aj,'mousemove',this.Su);
NTEvent.add(Aj,'mouseup',this.Wb);
}
if(this.Yp >= 1){
NTEvent.add(this.Ew, 'DOMMouseScroll', this.Go);
NTEvent.add(this.Ew, 'mousewheel', this.Go);
NTEvent.add(My,'keypress',this.Pc);
NTEvent.add(this.Ew, 'mouseover', this.Ia); 
NTEvent.add(this.Ew, 'mouseout',this.Yo); 
}
NTEvent.add(window,'mouseout',this.Cm);
NTEvent.add(this.Ew, 'contextmenu', this.bG);
this.Gq=true;
var Jz = Ji('cp','absolute',0,0);
this.Da.appendChild(Jz);
var Sk = Jz.style;
Sk.fontSize = '10px';
Sk.color = '#000';
Sk.padding = '1px';
Jz.innerHTML = UnescapeUTF7(NTGeoUtil.JP(this.Zn.getPos())?Hr:Ts);
Sk.left = "5px";
Sk.top = this.Zn.getSize().y - Jz.offsetHeight -3+"px";
Sk.zIndex = 902;
if(this.Rs){
this.reload();
}else{
this.Ba=true;
}
};
NTMap.prototype.Lh = function(e){
this.clearMap();
this.Dg = null;
this.Gp = null;
this.Bp = null;
Dh = null;
Hh(this.Da);
};
NTMap.prototype.Up = function(e){
CancelBubble(e);
return false;
};
NTMap.prototype.fU = function(e){
if(NTUserAgent.type==1 && NTUserAgent.version==5) return false;
this.Ew.style.cursor = "pointer";
};
NTMap.prototype.Sq = function(e){
if(NTUserAgent.type==1 && NTUserAgent.version==5) return false;
this.Ew.style.cursor = "default";
};
NTMap.prototype.Rb = function(e){
if(!this.Ba) return false;
var Fw = e.target;
while(Fw.parentNode!=null){
if(Fw.className=="object") return;
Fw = Fw.parentNode;
}
if(NTUserAgent.type!=1 && NTUserAgent.version!=5){
this.Ew.style.cursor = "wait";
}
var a = Gz(e);
var c = Ck(e);
if(Qh(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.Ew, "left");
c += s(this.Ew, "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.Ew, "left");
c += s(this.Ew, "top");
}
}else{
if(NTUserAgent.type==2 || NTUserAgent.type==3){
if(e.target == this.uS){
a += s(this.Ew, "left");
}else{
a -= s(this.Ew, "left");
}
}
if(NTUserAgent.type==2 || NTUserAgent.type==3){
if(e.target == this.uS){
c += s(this.Ew, "top");
}else{
c -= s(this.Ew, "top");
}
}
}
a -=this.Zn.getSize().x/2;
c -=this.Zn.getSize().y/2;
CancelBubble(e);
var f=new NTSize(a,c);
E[1](NTGeoUtil.pixel2LonLat(f,this.Zn));
this.moveTo(NTGeoUtil.pixel2LonLat(f,this.Zn));
};
NTMap.prototype.Au = function(e){
if(!this.Ba) return false;
if(e.target.className=="object"){
CancelBubble(e);
return;
}
this.Jd.onMouseDown(e);
};
NTMap.prototype.fF = function(e){
if(!this.Ba) return false;
if(e.target.className=="object"){
CancelBubble(e);
return;
}
this.Jd.onMouseMove(e);
};
NTMap.prototype.jP = function(e){
if(!this.Ba) return false;
if(e.target.className=="object"){
CancelBubble(e);
return;
}
var a = this.Jd.onMouseUp(e);
if(a){
this.Zn.setPos(NTGeoUtil.pixel2LonLat(a,this.Zn));
E[1](this.Zn.getPos());
this.reload();
}
CancelBubble(e);
};
NTMap.prototype.Rq = function(e){
if(this.sT==null || !this.Ba){
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.sT.onPlusClick();
}
if(delta == -1){
this.sT.onMinusClick();
}
CancelBubble(e);
};
NTMap.prototype.Ki = function(e){
if(e.target.tagName == "INPUT" || e.target.tagName == "TEXTAREA") return;
if(e.target != My)
var lon = this.Zn.getPos().getLongitude();
var lat = this.Zn.getPos().getLatitude();
if(e.keyCode==37){
E[1](NTGeoUtil.pixel2LonLat(new NTSize(-this.Zn.getSize().x/2,0), this.Zn));
this.moveTo(NTGeoUtil.pixel2LonLat(new NTSize(-this.Zn.getSize().x/2,0), this.Zn));
CancelBubble(e);
}
if(e.keyCode==38){
E[1](NTGeoUtil.pixel2LonLat(new NTSize(0,-this.Zn.getSize().y/2), this.Zn));
this.moveTo(NTGeoUtil.pixel2LonLat(new NTSize(0,-this.Zn.getSize().y/2), this.Zn));
CancelBubble(e);
}
if(e.keyCode==39){
E[1](NTGeoUtil.pixel2LonLat(new NTSize(this.Zn.getSize().x/2,0), this.Zn))
this.moveTo(NTGeoUtil.pixel2LonLat(new NTSize(this.Zn.getSize().x/2,0), this.Zn));
CancelBubble(e);
}
if(e.keyCode==40){
E[1](NTGeoUtil.pixel2LonLat(new NTSize(0,this.Zn.getSize().y/2), this.Zn));
this.moveTo(NTGeoUtil.pixel2LonLat(new NTSize(0,this.Zn.getSize().y/2), this.Zn));
CancelBubble(e);
}
if(e.keyCode==187 || e.keyCode==107 || e.charCode == 43){
if(!this.sT) return;
this.sT.onMinusClick();
CancelBubble(e);
}
if(e.keyCode==189 || e.keyCode==109 || e.charCode == 45 || e.charCode == 61){
if(!this.sT) return;
this.sT.onPlusClick();
CancelBubble(e);
}
};
NTMap.prototype.Ct = function(e){
var i=this.Dv % this.Lq;
if(!this.Ub){
Fv(this.Dg[i], -s(this.Ew, "left") , -s(this.Ew,"top"));
this.Dg[i].style.visibility = "visible";
this.buildIcon();
this.Yv();
}
if(NTUserAgent.type!=1 && NTUserAgent.version!=5){
this.Ew.style.cursor = "pointer";
}
for(var x=0,y=i,z=this.Lq+50; x<this.Lq; x++,y++,z--){
if(y >= this.Lq){
y=0;
}
if(this.Dg[y]==null || y==i){
continue;
}
this.Dg[y].style.zIndex = z;
}
if(this.Hx){
this.clearMap();
this.Hx = false;
}
for(var i=0; i<this.Gp.length; i++){
this.Gp[i].visible();
}
for(var i=0; i<this.Bp.length; i++){
this.Bp[i].visible();
}
E[0](this.Zn.getPos());
if(this.Qi!=null) this.Qi.set(this.Zn);
this.Pu = true;
if(!this.Ub){
this.Ba = true;
}
};
NTMap.prototype.Mb=function(e){
if(!e.relatedTarget){
this.jP(e);
}
};
NTMap.prototype.moveTo = function(a){
if(arguments.length==0 && a==null) return false;
if(!this.Gq){
this.Zn.setPos(a);
}
if(!this.Ba) return false;
this.Ba = false;
var b = NTGeoUtil.LonLat2Pixel(a,this.Zn);
var mx = s(this.Ew, "left") - (b.x-this.Zn.getSize().x/2);
var my = s(this.Ew, "top") - (b.y-this.Zn.getSize().y/2);
if(Math.abs(s(this.Ew, "left") - mx) > 5000 || Math.abs(s(this.Ew, "top") - my) > 5000){
this.Zn.setPos(a);
this.Hx = true;
this.reload();
}else{
this.Ub = true;
this.Zn.setPos(a);
this.makeMapImage();
var m = new NTMapCtrl(this.Ew);
m.autoScrollTo(mx,my,this.pK);
}
};
NTMap.prototype.Wc = function(a){
this.Ub = false;
var i=this.Dv % this.Lq;
Fv(this.Dg[i], -s(this.Ew, "left"), -s(this.Ew, "top"));
this.buildIcon();
this.Yv();
if(this.Pu){
this.Dg[i].style.visibility = "visible";
this.Ba = true;
}
};
NTMap.prototype.reload = function(){
if(!this.Gq && !this.Ba) return false;
return this.makeMapImage()? true: false;
};
NTMap.prototype.makeMapImage = function(){
this.Ba = false;
this.Pu = false;
this.Dv = ++this.Dv % this.Lq;
var stl, i=this.Dv;
if(this.Dg[i]==null){
this.Dg[i] = Jv("", this.Zn.getSize().x, this.Zn.getSize().y);
stl = this.Dg[i].style;
stl.position = "absolute";
NTEvent.add(this.Dg[i],'load',this.kC);
this.Ew.appendChild(this.Dg[i]);
}else{
stl = this.Dg[i].style;
stl.width = this.Zn.getSize().x + "px";
stl.height = this.Zn.getSize().y + "px";
setAlpha(this.Dg[i],100);
}
stl.visibility = "hidden";
stl.zIndex=this.Lq+50;
this.Dg[i].src = NTUrl.create(this.Zn,(this.Mo||null));
return this.Dg[i];
};
NTMap.prototype.clearMap = function(a){
for(var i=0; i<this.Dg.length; i++){
if(this.Dg[i]==null || i == this.Dv % this.Lq || (a!=null && this.Dg[i]==a)) continue;
this.Dg[i].style.visibility = "hidden";
}
};
NTMap.prototype.setZoom = function(a,b,c){
if(this.Zn.getScale()==a && this.Zn.getZoom()==b){
return false;
}
if(c && this.Rs && this.Gq && this.Pu){
for(var i=0; i<this.Gp.length; i++){
this.Gp[i].hide();
}
for(var i=0; i<this.Bp.length; i++){
this.Bp[i].hide();
}
if(this.Ac && this.Ac.iswork()){
this.clearMap();
this.Ac.stop();
}else{
var Tr = this.Dg[this.Dv];
this.clearMap(Tr);
this.Ac = new NTMapScaleCtrl(Tr);
this.Ac.autoChangeScale(this.Zn,a,b,function(){
});
}
}
this.Zn.setScale(a);
this.Zn.setZoom(b);
if(this.sT)
this.sT.setStatus(this.Zn);
this.Hx = true;
if(this.Rs){
if(this.reload())
E[0](this.Zn.getPos());
}
};
NTMap.prototype.getZoom = function(){
return {scale: this.Zn.getScale(), zoom: this.Zn.getZoom()};
};
NTMap.prototype.setPalette = function(a){
this.Zn.setPalette(a);
this.Hx = true;
if(this.Rs){
this.reload();
}
};
NTMap.prototype.addParam = function(a,b){
this.Zn.addParam(a,b);
};
NTMap.prototype.removeParam = function(a){
this.Zn.removeParam(a);
};
NTMap.prototype.getPos = function(){
return this.Zn.getPos();
};
NTMap.prototype.addRoute = function(){
for(var a=0; a<arguments.length; a++){
this.Zn.addRoute(arguments[a]);
}
if(this.Rs){
this.reload();
}
};
NTMap.prototype.removeRoute = function(){
var r = false;
if(arguments.length > 0){
for(var i=0; i<arguments.length; i++){
r=this.Zn.removeRoute(arguments[i]);
}
}else{
if(this.Zn.getRoute().length>0){
this.Zn.clearRoute();
r=true;
}
}
if(r && this.Rs){
this.reload();
}
};
NTMap.prototype.getRouteList = function(){
if(!this.Zn.getRoute().length) return null;
return this.Zn.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 = Bs(a,b,c,true,"object");
this.Da.appendChild(this.center);
this.center.style.zIndex=900;
this.center.style.visibility = "hidden";
};
NTMap.prototype.addBackground = function(a){
if(a==null) return;
this.Lv = Ji("bgi","absolute",0,0);
Cc(this.Lv, this.Zn.getSize().x, this.Zn.getSize().y);
this.Lv.style.backgroundImage = "url(" + a.src + ")";
this.Da.appendChild(this.Lv);
this.Lv.style.zIndex=10;
this.Lv.style.visibility = "hidden";
};
NTMap.prototype.addIcon = function(){
var Dw = arguments;
for(var i = 0; i<Dw.length; i++){
Dw[i].addDocument(this.Ew,301);
this.Gp.push(Dw[i]);
}
if(this.Pu){
this.buildIcon();
this.Yv();
}
};
NTMap.prototype.getIcon = function(a){
var Yl = new Array();
for(var i=0; i<this.Gp.length; i++){
if(a && a!=this.Gp[i].getGroup()){
continue;
}
Yl.push(this.Gp[i]);
}
return Yl;
};
NTMap.prototype.clearIcon = function(a){
var Yl = new Array();
for(var i=0; i<this.Gp.length; i++){
if(a && a!=this.Gp[i].getGroup()){
Yl.push(this.Gp[i]);
continue;
}
this.Gp[i].remove();
}
this.Gp = Yl;
};
NTMap.prototype.buildIcon = function(){
for(var i=0; i<this.Gp.length; i++){
var a=this.Gp[i];
if(a.getImage()==null) continue;
var Ab = a.getImage();
if(a==null || a.getPos()==null) continue;
var p = NTGeoUtil.LonLat2Pixel(a.getPos(),this.Zn);
Fv(Ab, p.x - Ab.offsetWidth/2 - s(this.Ew, "left"), p.y - Ab.offsetHeight - s(this.Ew, "top"));
Fv(a.getCather(), p.x - Ab.offsetWidth/2 - s(this.Ew, "left"), p.y - Ab.offsetHeight - s(this.Ew, "top"));
var is = a.getShadow();
if(is!=null){
Fv(is, s(Ab,"left"), new Number(s(Ab,"top")) + Ab.offsetHeight-is.offsetHeight);
is.style.visibility = "visible";
}
Ab.style.visibility = "visible";
}
};
NTMap.prototype.addMsg = function(a){
if(this.Tw){
return false;
}
var d = a.createDocument(this.Ew);
this.Bp.push(a);
a.moveTo(NTGeoUtil.LonLat2Pixel(a.getPos(),this.Zn));
return true;
};
NTMap.prototype.openMsg = function(Qo,a){
if(!this.Tw || !Qo){
alert("return");
return;
}
this.Tw.decorate({color:a.bgcolor, border: a.bordercolor, max:a.max});
this.Tw.setPos(Qo);
this.Tw.replaceContent({title:"", body:a.content});
this.Bp[0]=this.Tw;
this.Tw.moveTo(NTGeoUtil.LonLat2Pixel(Qo,this.Zn));
this.Tw.open();
return this.Tw;
};
NTMap.prototype.Yv = function(){
for(var i=0; i<this.Bp.length; i++){
if(this.Bp[i]==null || this.Bp[i].getPos()==null) continue;
var p = NTGeoUtil.LonLat2Pixel(this.Bp[i].getPos(),this.Zn);
this.Bp[i].moveTo(p);
}
};
NTMap.prototype.loadToolbar = function(a){
if(!a) a = NTZoomToolbar.DEFAULT;
a.setParent(this.Da);
a.setStatus(this.Zn);
a.onChange(this.Oj);
a.load();
this.sT = a;
};
NTMap.prototype.loadScalebar = function(){
this.Qi = new NTScaler(this.Da);
};
NTMap.prototype.setProperty = function(a,b){
if(a=="autoload"){
this.Rs = b;
}
if(a=="url"){
this.Mo = b;
}
if(a=="image"){
Dh = new Image();
Dh.src = b;
}
};
Fk('NTMap', NTMap);
Fk('NTSize', NTSize);
Fk('NTIcon', NTMapIcon);
Fk('NTImage', NTImage);
Fk('NTColor',NTColor);
Fk('NTLatLng', NTLatLng);
Fk('NTRoute', NTRoute);
Fk('NTPopup', NTPopup);
Fk('NTZoomToolbar', NTZoomToolbar);
Fk('NTResizer', NTResizer);
Fk('eventHandler',Object.eventHandler);
Fk('NTEvent', NTEvent);
Bw(NTMapCtrl);
Bw(NTMapScaleCtrl);
Bw(NTResizer);
})();
