function setCookie(_1,_2,_3,_4,_5,_6){
document.cookie=_1+"="+escape(_2)+((_3)?"; expires="+_3.toGMTString():"")+((_4)?"; path="+_4:"")+((_5)?"; domain="+_5:"")+((_6)?"; secure":"");
}
function getCookie(_7){
var dc=document.cookie;
var _9=_7+"=";
var _a=dc.indexOf("; "+_9);
if(_a==-1){
_a=dc.indexOf(_9);
if(_a!=0){
return null;
}
}else{
_a+=2;
}
var _b=document.cookie.indexOf(";",_a);
if(_b==-1){
_b=dc.length;
}
return unescape(dc.substring(_a+_9.length,_b));
}
function deleteCookie(_c,_d,_e){
if(getCookie(_c)){
document.cookie=_c+"="+((_d)?"; path="+_d:"")+((_e)?"; domain="+_e:"")+"; expires=Thu, 01-Jan-70 00:00:01 GMT";
}
}
function testGetDNS(){
cookieDomain=document.location.hostname;
}
function testGetCookie(){
var _f="varCook";
if(document.cookie.indexOf(_f)==-1){
return false;
}else{
cookieStart=document.cookie.indexOf(_f);
cookieValStart=(document.cookie.indexOf("=",cookieStart)+1);
cookieValEnd=document.cookie.indexOf(";",cookieStart);
if(cookieValEnd==-1){
cookieValEnd=document.cookie.length;
}
cookieValue=document.cookie.substring(cookieValStart,cookieValEnd);
}
if(cookieValue="True"){
return ("True");
}
}
function testSetCookie(_10,_11,_12,_13,_14,_15){
var _16=testGetDNS();
document.cookie=_10+"="+escape(_11)+((_12)?";expires="+_12.toGMTString()+1000*60*20:"")+((_13)?";path="+_13:"")+((_14)?";domain="+_16:"")+((_15)?";secure":"");
return true;
}
function CheckCookiesEnabled(){
testSetCookie("varCook","True","","/","","");
if(testGetCookie()=="True"){
return true;
}else{
return false;
}
}
var Drag={enable:true,obj:null,init:function(o,_18,_19,_1a,_1b,_1c,_1d,_1e,_1f,_20){
o.onmousedown=Drag.start;
o.hmode=_1d?false:true;
o.vmode=_1e?false:true;
o.root=_18&&_18!=null?_18:o;
if(o.hmode&&isNaN(parseInt(o.root.style.left))){
o.root.style.left="0px";
}
if(o.vmode&&isNaN(parseInt(o.root.style.top))){
o.root.style.top="0px";
}
if(!o.hmode&&isNaN(parseInt(o.root.style.right))){
o.root.style.right="0px";
}
if(!o.vmode&&isNaN(parseInt(o.root.style.bottom))){
o.root.style.bottom="0px";
}
o.minX=typeof _19!="undefined"?_19:null;
o.minY=typeof _1b!="undefined"?_1b:null;
o.maxX=typeof _1a!="undefined"?_1a:null;
o.maxY=typeof _1c!="undefined"?_1c:null;
o.xMapper=_1f?_1f:null;
o.yMapper=_20?_20:null;
o.root.onDragStart=new Function();
o.root.onDragEnd=new Function();
o.root.onDrag=new Function();
},start:function(e){
var o=Drag.obj=this;
e=Drag.fixE(e);
if(ie){
if(e.button!=1){
return;
}
}else{
if(e.button!=0){
return;
}
}
var y=parseInt(o.root.offsetTop);
var x=parseInt(o.root.offsetLeft);
o.root.onDragStart(e,x,y);
o.lastMouseX=e.clientX;
o.lastMouseY=e.clientY;
document.onmousemove=Drag.drag;
document.onmouseup=Drag.end;
return false;
},drag:function(e){
try{
e=Drag.fixE(e);
var o=Drag.obj;
var ey=e.clientY;
var ex=e.clientX;
var y=parseInt(o.root.offsetTop);
var x=parseInt(o.root.offsetLeft);
var nx,ny;
nx=x+(ex-o.lastMouseX);
ny=y+(ey-o.lastMouseY);
Drag.obj.root.style.left=nx+"px";
Drag.obj.root.style.top=ny+"px";
Drag.obj.lastMouseX=ex;
Drag.obj.lastMouseY=ey;
Drag.obj.root.onDrag(e,nx,ny);
return false;
}
catch(e){
}
},end:function(){
try{
document.onmousemove=null;
document.onmouseup=null;
Drag.obj.root.onDragEnd(parseInt(Drag.obj.root.style[Drag.obj.hmode?"left":"right"]),parseInt(Drag.obj.root.style[Drag.obj.vmode?"top":"bottom"]));
Drag.obj=null;
}
catch(e){
}
},fixE:function(evt){
var e=evt?evt:window.event;
return e;
}};
var Drag2={obj:null,init:function(o,_2f,_30,_31,_32,_33,_34,_35,_36,_37){
o.onmousedown=Drag2.start;
o.hmode=_34?false:true;
o.vmode=_35?false:true;
o.root=_2f&&_2f!=null?_2f:o;
if(o.hmode&&isNaN(parseInt(o.root.style.left))){
o.root.style.left="0px";
}
if(o.vmode&&isNaN(parseInt(o.root.style.top))){
o.root.style.top="0px";
}
if(!o.hmode&&isNaN(parseInt(o.root.style.right))){
o.root.style.right="0px";
}
if(!o.vmode&&isNaN(parseInt(o.root.style.bottom))){
o.root.style.bottom="0px";
}
o.minX=typeof _30!="undefined"?_30:null;
o.minY=typeof _32!="undefined"?_32:null;
o.maxX=typeof _31!="undefined"?_31:null;
o.maxY=typeof _33!="undefined"?_33:null;
o.xMapper=_36?_36:null;
o.yMapper=_37?_37:null;
o.root.onDragStart=new Function();
o.root.onDragEnd=new Function();
o.root.onDrag=new Function();
},start:function(e){
var o=Drag2.obj=this;
e=Drag2.fixE(e);
var y=parseInt(o.vmode?o.root.style.top:o.root.style.bottom);
var x=parseInt(o.hmode?o.root.style.left:o.root.style.right);
o.root.onDragStart(e,x,y);
o.lastMouseX=e.clientX;
o.lastMouseY=e.clientY;
if(o.hmode){
if(o.minX!=null){
o.minMouseX=e.clientX-x+o.minX;
}
if(o.maxX!=null){
o.maxMouseX=o.minMouseX+o.maxX-o.minX;
}
}else{
if(o.minX!=null){
o.maxMouseX=-o.minX+e.clientX+x;
}
if(o.maxX!=null){
o.minMouseX=-o.maxX+e.clientX+x;
}
}
if(o.vmode){
if(o.minY!=null){
o.minMouseY=e.clientY-y+o.minY;
}
if(o.maxY!=null){
o.maxMouseY=o.minMouseY+o.maxY-o.minY;
}
}else{
if(o.minY!=null){
o.maxMouseY=-o.minY+e.clientY+y;
}
if(o.maxY!=null){
o.minMouseY=-o.maxY+e.clientY+y;
}
}
document.onmousemove=Drag2.drag;
document.onmouseup=Drag2.end;
return false;
},drag:function(e){
e=Drag2.fixE(e);
var o=Drag2.obj;
var ey=e.clientY;
var ex=e.clientX;
var y=parseInt(o.vmode?o.root.style.top:o.root.style.bottom);
var x=parseInt(o.hmode?o.root.style.left:o.root.style.right);
var nx,ny;
if(o.minX!=null){
ex=o.hmode?Math.max(ex,o.minMouseX):Math.min(ex,o.maxMouseX);
}
if(o.maxX!=null){
ex=o.hmode?Math.min(ex,o.maxMouseX):Math.max(ex,o.minMouseX);
}
if(o.minY!=null){
ey=o.vmode?Math.max(ey,o.minMouseY):Math.min(ey,o.maxMouseY);
}
if(o.maxY!=null){
ey=o.vmode?Math.min(ey,o.maxMouseY):Math.max(ey,o.minMouseY);
}
nx=x+((ex-o.lastMouseX)*(o.hmode?1:-1));
ny=y+((ey-o.lastMouseY)*(o.vmode?1:-1));
if(o.xMapper){
nx=o.xMapper(y);
}else{
if(o.yMapper){
ny=o.yMapper(x);
}
}
Drag2.obj.root.style[o.hmode?"left":"right"]=nx+"px";
Drag2.obj.root.style[o.vmode?"top":"bottom"]=ny+"px";
Drag2.obj.lastMouseX=ex;
Drag2.obj.lastMouseY=ey;
Drag2.obj.root.onDrag(e,nx,ny);
return false;
},end:function(){
document.onmousemove=null;
document.onmouseup=null;
Drag2.obj.root.onDragEnd(parseInt(Drag2.obj.root.style[Drag2.obj.hmode?"left":"right"]),parseInt(Drag2.obj.root.style[Drag2.obj.vmode?"top":"bottom"]));
Drag2.obj=null;
},fixE:function(e){
if(typeof e=="undefined"){
e=window.event;
}
if(typeof e.layerX=="undefined"){
e.layerX=e.offsetX;
}
if(typeof e.layerY=="undefined"){
e.layerY=e.offsetY;
}
return e;
}};
function enable_select(){
if(!ie){
var _44=["input","textarea","select"];
_44=_44.join("|");
function disableselect(e){
if(_44.indexOf(e.target.tagName.toLowerCase())==-1){
return false;
}
}
function reEnable(){
return true;
}
if(typeof document.onselectstart!="undefined"){
document.onselectstart=new Function("return true");
}else{
document.onmousedown=reEnable;
document.onmouseup=reEnable;
}
}else{
document.body.onselectstart=function(){
return true;
};
}
}
function disable_select(){
if(!ie){
var _46=["input","textarea","select"];
_46=_46.join("|");
function disableselect(e){
if(_46.indexOf(e.target.tagName.toLowerCase())==-1){
return false;
}
}
function reEnable(){
return true;
}
if(typeof document.onselectstart!="undefined"){
document.onselectstart=new Function("return false");
}else{
document.onmousedown=disableselect;
document.onmouseup=reEnable;
}
}else{
document.body.onselectstart=function(){
return false;
};
}
}
var skin1={"Drager":["images/dicon.gif","19","18"],"toRight":["images/to_right2.gif","24","19"],"toLeft":["images/to_left2.gif","24","19"],"DragBackground":["#CCCCCC","color"]};
var skin2={"Drager":["images/skin2drager.gif","22","19"],"toRight":["images/to_right2.gif","24","19"],"toLeft":["images/to_left2.gif","24","19"],"DragBackground":["images/skin2bg.gif","gif"]};
var SliderX=Class.create();
SliderX.prototype={id:"",out_obj:null,action:"",is_ie:false,tx:0,ty:0,draw_htm:"",slider_width:150,slider_height:150,with_slide_but:true,init_left:0,max_val:100,min_val:0,current_val:0,interval:1,max_x:0,max_y:0,min_x:0,min_y:0,slider_tbl:null,slider_obj:null,skin:skin2,target_layer:"",drag_obj:null,draging:false,timeout:null,slider_cur_inst:null,getEvt:function(evt){
var e=evt?evt:window.event;
var src=((ie)?e.srcElement:e.target);
return [e,src];
},getOffset:function(obj,_4c){
var _4d=0;
while(obj!=null){
_4d+=obj["offset"+(_4c?"Left":"Top")];
obj=obj.offsetParent;
}
return _4d;
},initialize:function(_4e,_4f,_50,_51,_52,_53,_54){
this.transform_timeout=null;
this.img_plus=new Image(21,20);
this.img_plus.src="images/slider_img/z_b.gif";
this.img_minus=new Image(21,20);
this.img_minus.src="images/slider_img/z_t.gif";
this.parent=_4f;
this.margin_left=this.getOffset(this.parent.parent.container,true);
this.margin_top=this.getOffset(this.parent.parent.container,false);
this.target_layer=_4e;
this.is_ie=ie;
if(_51!=null){
this.max_val=_51;
}
if(_52!=null){
this.min_val=_52;
}
if(this.max_val<this.min_val){
var t_v=this.max_val;
this.max_val=this.min_val;
this.min_val=t_v;
}
this.slider_height=_50;
this.draw();
this.slider_tbl=$(this.target_layer.id+"_drag_container");
this.slider_obj=$(this.target_layer.id+"_drag_icon");
this.tx=this.getOffset(this.slider_tbl,true)-this.margin_left;
this.ty=this.getOffset(this.slider_tbl,false)-this.margin_top;
this.min_x=this.tx+2;
this.min_y=this.ty+8;
this.max_x=this.tx+2;
this.max_y=this.ty+parseInt(this.slider_tbl.offsetHeight)-parseInt(this.slider_obj.offsetHeight)-8;
Drag2.init(this.slider_obj,null,this.min_x,this.max_x,this.min_y,this.max_y);
this.slider_obj.onDragStart=this.onDragStartEvent.bind(this);
this.slider_obj.onDrag=this.onDragEvent.bind(this);
this.slider_obj.onDragEnd=this.onDragEndEvent.bind(this);
this.set_val(_54);
},onDragStartEvent:function(evt,ex,ey){
this.draging=true;
var e=this.getEvt(evt);
},onDragEvent:function(evt,ex,ey){
this.get_val();
},onDragEndEvent:function(ex,ey){
this.set_val(this.current_val);
this.parent.mapChangeZoomLevel(this.current_val);
},get_val:function(){
var l=this.getOffset(this.slider_obj,true)-this.margin_left;
var t=this.getOffset(this.slider_obj,false)-6-this.margin_top;
if(t>this.min_y){
var p1=((t-this.min_y)/(this.max_y-this.min_y));
}else{
var p1=0;
}
var p2=(this.max_val-this.min_val)*(p1);
var p3=this.min_val+p2;
if(p3%this.interval!=0){
this.current_val=p3+(this.interval-(p3%this.interval));
}else{
this.current_val=p3;
}
},afterSetVal:function(){
if((this.tmp_new_top+this.drag_icon_obj.offsetHeight)>(this.getOffset(this.parent.parent.container)+this.parent.parent.container.offsetHeight)){
this.drag_icon_obj.style.visibility="hidden";
}else{
this.drag_icon_obj.style.visibility="visible";
}
},set_val:function(val,_65){
var tv=parseInt(val);
if(tv<this.min_val){
tv=this.min_val;
}
if(tv>this.max_val){
tv=this.max_val;
}
var p1=(tv-this.min_val)/(this.max_val-this.min_val);
var p2=(this.max_y-this.min_y)*p1;
var p3=Math.floor(p2)+this.min_y;
this.tmp_new_top=p3;
this.current_val=tv;
this.transformLayer(this.getOffset(this.slider_obj,true),(this.tmp_new_top),this.slider_obj,10,10);
},reset_drager:function(){
this.margin_left=this.getOffset(this.parent.parent.container,true);
this.margin_top=this.getOffset(this.parent.parent.container,false);
$(this.target_layer.id+"_drag_icon").style.left=(this.getOffset($(this.target_layer.id+"_drag_container"),true)+2-this.margin_left)+"px";
$(this.target_layer.id+"_drag_icon").style.top=(this.getOffset($(this.target_layer.id+"_drag_container"),false)-this.margin_top)+"px";
this.set_val(this.current_val);
this.tx=this.getOffset(this.slider_tbl,true)-this.margin_left;
this.ty=this.getOffset(this.slider_tbl,false)-this.margin_top;
this.min_x=this.tx+2;
this.min_y=this.ty+8;
this.max_x=this.tx+2;
this.max_y=this.ty+parseInt(this.slider_tbl.offsetHeight)-parseInt(this.slider_obj.offsetHeight)-8;
this.slider_obj.minX=this.min_x;
this.slider_obj.minY=this.min_y;
this.slider_obj.maxX=this.max_x;
this.slider_obj.maxY=this.max_y;
},zoom_in:function(){
this.set_val(this.current_val+1);
this.parent.mapChangeZoomLevel(this.current_val);
},zoom_out:function(){
this.set_val(this.current_val-1);
this.parent.mapChangeZoomLevel(this.current_val);
},refreshPos:function(){
if(this.tout!=null){
clearTimeout(this.tout);
}
this.reset_drager();
},draw:function(){
if(typeof (this.target_layer)=="undefined"||this.target_layer==null){
return;
}
var str="";
var _6b=this.slider_height;
if(this.with_slide_but){
_6b=_6b+40;
}
str+="<table id=\""+this.target_layer.id+"_drag_table\" width=\"21\" height=\""+_6b+"\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
str+="  <tr>";
str+="    <td height=\"20px\"><img id=\""+this.target_layer.id+"_zoom_out\" src=\""+this.img_minus.src+"\" width=\"21\" height=\"20\"></td>";
str+="  </tr>";
str+="  <tr>";
str+="    <td height=\""+(_6b-40)+"px\" id=\""+this.target_layer.id+"_drag_container\" align=\"center\" valign=\"middle\" style=\"border: 1px #999999 solid; background-color:#FFFFFF; padding-top:5px;  padding-bottom:5px\">";
str+="\t<div style=\"background-color:#999999; width:25%; height:100%\">&nbsp;</div>";
str+="\t</td>";
str+="  </tr>";
str+="  <tr>";
str+="    <td height=\"20\"><img id=\""+this.target_layer.id+"_zoom_in\" src=\""+this.img_plus.src+"\" width=\"21\" height=\"20\"></td>";
str+="  </tr>";
str+="</table>";
this.draw_htm=str;
this.target_layer.innerHTML=str;
$(this.target_layer.id+"_zoom_out").onclick=this.zoom_out.bindAsEventListener(this);
$(this.target_layer.id+"_zoom_out").style.cursor="pointer";
$(this.target_layer.id+"_zoom_in").onclick=this.zoom_in.bindAsEventListener(this);
$(this.target_layer.id+"_zoom_in").style.cursor="pointer";
$(this.target_layer.id+"_drag_container").onclick=this.getClickAction.bindAsEventListener(this);
$(this.target_layer.id+"_drag_container").style.cursor="pointer";
this.drag_icon_obj=document.createElement("div");
this.drag_icon_obj.id=this.target_layer.id+"_drag_icon";
this.drag_icon_obj.style.position="absolute";
this.drag_icon_obj.style.cursor="pointer";
this.drag_icon_obj.style.overflow="hidden";
if(this.is_ie){
this.drag_icon_obj.style.width=(21-4)+"px";
}else{
this.drag_icon_obj.style.width=(21-6)+"px";
}
this.drag_icon_obj.style.height="10px";
this.drag_icon_obj.style.border="1px #999999 solid";
this.drag_icon_obj.style.zIndex="15000";
this.drag_icon_obj.style.backgroundColor="#FFD966";
this.drag_icon_obj.style.left=(this.getOffset($(this.target_layer.id+"_drag_container"),true)-this.margin_left+2)+"px";
this.drag_icon_obj.style.top="0px";
this.parent.parent.container.appendChild(this.drag_icon_obj);
},getClickAction:function(evt){
e=this.getEvt(evt);
var l=parseInt(e[0].clientX)-this.margin_left;
var t=parseInt(e[0].clientY)-6-this.margin_top;
if(t>this.min_y){
var p1=((t-this.min_y)/(this.max_y-this.min_y));
}else{
var p1=0;
}
var p2=(this.max_val-this.min_val)*(p1);
var p3=this.min_val+p2;
var _72=-100;
if(p3%this.interval!=0){
_72=p3+(this.interval-(p3%this.interval));
}else{
_72=p3;
}
this.set_val(_72,true);
this.parent.mapChangeZoomLevel(this.current_val);
},transformLayer:function(x,y,obj,_76,_77){
if(this.transform_timeout!=null){
clearTimeout(this.transform_timeout);
}
this.x1=obj.offsetLeft;
this.y1=obj.offsetTop;
this.x2=(this.x1+parseInt(obj.offsetWidth));
this.y2=(this.y1+parseInt(obj.offsetHeight));
stepDuration=Math.round(_76/_77);
tx1=this.x1;
ty1=this.y1;
x=(x)?x:tx1;
y=(y)?y:ty1;
difX=(x-tx1)/_77;
difY=(y-ty1)/_77;
tx1+=difX;
ty1+=difY;
if(!isNaN(tx1)&&!isNaN(ty1)&&tx1!="Infinity"&&ty1!="Infinity"&&tx1!="-Infinity"&&ty1!="-Infinity"){
obj.style.top=ty1+"px";
}
_76=(_76-stepDuration);
_77--;
if(_77>=0){
this.transform_timeout=setTimeout((function(){
this.transformLayer(x,y,obj,_76,_77);
}).bind(this),stepDuration);
}else{
if(this.transform_timeout!=null){
clearTimeout(this.transform_timeout);
}
this.afterSetVal(this.tmp_new_top);
}
return true;
}};

var CONST_ZOOM_P1 = eval({ "lg1_per_px":"0.0000000000", "la1_per_px":"0.0000000000", "glg1_per_px":"2.34375", "gla1_per_px":"3.3125", "la" : "848000", "ln" : "800000", "total_y_meter": "3000", "total_y_px" : "1280", "total_x_meter": "3750", "total_x_px" : "1600"});var CONST_ZOOM_P2 = new Array({"level":"0", "id":"11"},{"level":"1", "id":"10"},{"level":"2", "id":"9"},{"level":"3", "id":"8"},{"level":"4", "id":"7"},{"level":"5", "id":"6"});var CONST_ALL_ZOOM = [{"id":"3","level":"6", "lg1_per_px":"0.0000000000", "la1_per_px":"0.0000000000", "glg1_per_px":"18.75", "gla1_per_px":"26.5", "la" : "848000", "ln" : "800000" , "total_y_meter": "3000", "total_y_px" : "160", "total_x_meter": "3750", "total_x_px" : "200" },{"id":"2","level":"7", "lg1_per_px":"0.0000000000", "la1_per_px":"0.0000000000", "glg1_per_px":"37.5", "gla1_per_px":"53", "la" : "848000", "ln" : "800000" , "total_y_meter": "3000", "total_y_px" : "80", "total_x_meter": "3750", "total_x_px" : "100" },{"id":"1","level":"8", "lg1_per_px":"0.0000000000", "la1_per_px":"0.0000000000", "glg1_per_px":"75", "gla1_per_px":"106", "la" : "848000", "ln" : "800000" , "total_y_meter": "3000", "total_y_px" : "40", "total_x_meter": "3750", "total_x_px" : "50" },{"id":"4","level":"9", "lg1_per_px":"0.0000000000", "la1_per_px":"0.0000000000", "glg1_per_px":"150", "gla1_per_px":"212", "la" : "848000", "ln" : "800000" , "total_y_meter": "3000", "total_y_px" : "20", "total_x_meter": "3750", "total_x_px" : "25" },{"id":"5","level":"10", "lg1_per_px":"0.0000000000", "la1_per_px":"0.0000000000", "glg1_per_px":"300", "gla1_per_px":"424", "la" : "848000", "ln" : "800000" , "total_y_meter": "3000", "total_y_px" : "10", "total_x_meter": "3750", "total_x_px" : "12" },{"id":"6","level":"5", "lg1_per_px":"0.0000000000", "la1_per_px":"0.0000000000", "glg1_per_px":"9.375", "gla1_per_px":"13.25", "la" : "848000", "ln" : "800000" , "total_y_meter": "3000", "total_y_px" : "320", "total_x_meter": "3750", "total_x_px" : "400" },{"id":"7","level":"4", "lg1_per_px":"0.0000000000", "la1_per_px":"0.0000000000", "glg1_per_px":"4.6875", "gla1_per_px":"6.625", "la" : "848000", "ln" : "800000" , "total_y_meter": "3000", "total_y_px" : "640", "total_x_meter": "3750", "total_x_px" : "800" },{"id":"8","level":"3", "lg1_per_px":"0.0000000000", "la1_per_px":"0.0000000000", "glg1_per_px":"2.34375", "gla1_per_px":"3.3125", "la" : "848000", "ln" : "800000" , "total_y_meter": "3000", "total_y_px" : "1280", "total_x_meter": "3750", "total_x_px" : "1600" },{"id":"9","level":"2", "lg1_per_px":"0.0000000000", "la1_per_px":"0.0000000000", "glg1_per_px":"1.171875", "gla1_per_px":"1.66625", "la" : "848000", "ln" : "800000" , "total_y_meter": "3000", "total_y_px" : "2560", "total_x_meter": "3750", "total_x_px" : "3200" },{"id":"10","level":"1", "lg1_per_px":"0.0000000000", "la1_per_px":"0.0000000000", "glg1_per_px":"0.5859375", "gla1_per_px":"0.833125", "la" : "848000", "ln" : "800000" , "total_y_meter": "3000", "total_y_px" : "5120", "total_x_meter": "3750", "total_x_px" : "6400" },{"id":"11","level":"0", "lg1_per_px":"0.0000000000", "la1_per_px":"0.0000000000", "glg1_per_px":"0.29296875", "gla1_per_px":"0.4165625", "la" : "848000", "ln" : "800000" , "total_y_meter": "3000", "total_y_px" : "10240", "total_x_meter": "3750", "total_x_px" : "12800" }];var CONST_HOME_RENT_TAG=1;
var CONST_HOME_BUY_TAG=2;
var CONST_OFFICE_RENT_TAG=3;
var CONST_OFFICE_BUY_TAG=4;
var MapZoom=Class.create();
MapZoom.prototype={properties:null,initialize:function(p,_2){
if(p!=null){
this.parent=p;
}
if(_2!=null){
this.root=_2;
}else{
this.root="";
}
},setProperties:function(_3){
this.properties=((_3==null)?null:_3);
},getProperties:function(){
if(typeof (this.parent)=="undefined"){
return false;
}
url=this.root+"xml/zoom_properties.php?z="+this.parent.zoom;
this.ajax_request=new Ajax.Request(url,{method:"get",onComplete:this.getPropertiesRespone.bind(this)});
},getPropertiesRespone:function(_4){
var _5=_4.responseXML;
var _6=_5.getElementsByTagName("item");
if(_6.length>0){
this.properties=null;
eval(" this.properties = "+_6[0].firstChild.nodeValue);
}
}};
var MapLatLng=Class.create();
MapLatLng.prototype={latlng:null,initialize:function(_7){
if(_7!=null){
var r=this.setLatLng(_7);
}
},setLatLng:function(_9){
if(_9["lat"]!=null&&_9["lng"]!=null&&_9["gov_lat"]!=null&&_9["gov_lng"]!=null){
this.latlng=_9;
return true;
}else{
return false;
}
},getLatLng:function(){
return this.latlng;
}};
var MapLatLngBound=Class.create();
MapLatLngBound.prototype={latlng_bound:null,initialize:function(_a,_b){
var r=this.setLatLngVound(_a,_b);
},getLatLngBound:function(){
return this.latlng_bound;
},setLatLngBound:function(_d,_e){
latlng1=new MapLatLng(_d);
latlng2=new MapLatLng(_e);
if(latlng1.getLatLng()!=null&&latlng2.getLatLng()!=null){
this.latlng_bound=new Array();
this.latlng_bound.push(latlng1);
this.latlng_bound.push(latlng2);
return true;
}else{
return false;
}
}};
var Tile=Class.create();
Tile.prototype={image:null,coor:null,initialize:function(p,src,x,y,z,w,h){
this.parent=p;
this.x=x;
this.y=y;
this.z=z;
this.image=document.createElement("IMG");
this.image.id="tile_"+x+"_"+y+"_"+z+"_"+this.parent.map_id;
this.image.style.width=w+"px";
this.image.style.height=h+"px";
this.image.className="maptile";
this.image.style.position="absolute";
this.image.style.left="0px";
this.image.style.top="0px";
this.image.style.display="";
this.src=src;
switch(this.parent.tile_mode){
case 2:
this.image.src=this.src+"?x="+this.x+"&y="+this.y+"&z="+this.z+"&dop=1";
break;
default:
this.image.src=this.src+"?x="+this.x+"&y="+this.y+"&z="+this.z;
break;
}
},getTile:function(){
return this.image;
},resetProperties:function(src,x,y,z,w,h){
this.image.src="images/tilebg.gif";
this.x=x;
this.y=y;
this.z=z;
this.image.id="tile_"+x+"_"+y+"_"+z+"_"+this.parent.map_id;
this.image.style.width=w+"px";
this.image.style.height=h+"px";
this.src=src;
switch(this.parent.tile_mode){
case 2:
this.image.src=this.src+"?x="+this.x+"&y="+this.y+"&z="+this.z+"&dop=1";
break;
default:
this.image.src=this.src+"?x="+this.x+"&y="+this.y+"&z="+this.z;
break;
}
},setTile:function(_1c){
this.image=_1c;
},setLeftTop:function(_1d,top){
this.image.style.left=_1d+"px";
this.image.style.top=top+"px";
},updateSrc:function(){
this.image.id="tile_"+this.x+"_"+this.y+"_"+this.z+"_"+this.parent.map_id;
switch(this.parent.tile_mode){
case 2:
this.image.src=this.src+"?x="+this.x+"&y="+this.y+"&z="+this.z+"&dop=1";
break;
default:
this.image.src=this.src+"?x="+this.x+"&y="+this.y+"&z="+this.z;
break;
}
},updatePos:function(x,y,z){
this.x=x;
this.y=y;
this.z=z;
this.updateSrc();
}};
var MapTileContainer=Class.create();
MapTileContainer.prototype={drag:Drag,div:null,x1:0,x2:0,y1:0,y2:0,edge:null,margin:0,dragging:false,interrupt:false,transforming:false,trans_duration:5,trans_step:5,check_boundary_margin:20,check_boundary_margin_minus:-20,initialize:function(p){
this.parent=p;
this.transform_timeout=null;
this.div=window.document.createElement("div");
this.div.id="map_tile_"+this.parent.map_id;
this.reset_map_point_timeout=null;
this.reset_map_point_flag=true;
this.reset_map_point_cnt=0;
this.reset_map_point_lt=0;
this.reset_map_point_rb=0;
this.reset_map_point_timeout2=null;
this.reset_map_point_flag2=true;
this.reset_map_point_cnt2=0;
this.reset_map_point_lt2=0;
this.reset_map_point_rb2=0;
this.div.style.position="absolute";
this.div.style.backgroundColor="#FFFFFF";
this.left_val=(Math.floor(parseInt(this.parent.container.offsetWidth)/4)*-1);
this.top_val=(Math.ceil(parseInt(this.parent.container.offsetHeight)/4)*-1);
var ww=this.parent.tile_num_x*this.parent.tile_width;
var hh=this.parent.tile_num_y*this.parent.tile_height;
this.div.style.top=this.top_val+"px";
this.div.style.left=(this.left_val)+"px";
this.div.style.overflow="visible";
this.div.style.width=(ww)+"px";
this.div.style.height=(hh)+"px";
this.div.style.zIndex="900";
this.smooth_zoom_div=document.createElement("div");
this.smooth_zoom_div.id="smooth_zoom";
this.smooth_zoom_div.style.position="absolute";
this.smooth_zoom_div.style.top=this.top_val+"px";
this.smooth_zoom_div.style.left=this.left_val+"px";
this.smooth_zoom_div.style.width=ww+"px";
this.smooth_zoom_div.style.height=hh+"px";
this.smooth_zoom_div.style.zIndex="920";
this.smooth_zoom_div.style.display="none";
this.smooth_zoom_div2=document.createElement("div");
this.smooth_zoom_div2.style.position="absolute";
this.smooth_zoom_div2.style.zIndex="910";
this.smooth_zoom_div2.style.top="0px";
this.smooth_zoom_div2.style.left="0px";
this.smooth_zoom_div2.style.width=this.parent.container.offsetWidth+"px";
this.smooth_zoom_div2.style.height=this.parent.container.offsetHeight+"px";
this.smooth_zoom_div2.style.backgroundColor="#CCCCCC";
this.smooth_zoom_div2.style.display="none";
if(this.parent.draggable){
this.drag.init(this.div,null);
this.div.onDragStart=this.onDragStartEvent.bind(this);
this.div.onDrag=this.onDragEvent.bind(this);
this.div.onDragEnd=this.onDragEndEvent.bind(this);
}
this.div.ondblclick=this.onDblClickAction.bindAsEventListener(this);
this.dragging=true;
this.move_val=200;
this.edge=null;
this.margin=0;
this.min_ln=0;
this.max_ln=0;
this.min_la=0;
this.max_la=0;
this.map_point_collection=new Array();
this.map_point_crowd_index=null;
this.map_point_crowd_threshold=400;
this.displayed_map_point=new Array();
this.move_act_from_thumb=false;
this.transforming=false;
this.dbl_click_enable=true;
this.moved_tile=false;
},smoothZoomingDivUpdate:function(){
var ww=this.parent.tile_num_x*this.parent.tile_width;
var hh=this.parent.tile_num_y*this.parent.tile_height;
this.smooth_zoom_div.style.top=this.top_val+"px";
this.smooth_zoom_div.style.left=this.left_val+"px";
this.smooth_zoom_div.style.width=ww+"px";
this.smooth_zoom_div.style.height=hh+"px";
this.smooth_zoom_div2.style.top="0px";
this.smooth_zoom_div2.style.left="0px";
this.smooth_zoom_div2.style.width=this.parent.container.offsetWidth+"px";
this.smooth_zoom_div2.style.height=this.parent.container.offsetHeight+"px";
},cleanTile:function(){
var _27=this.div.getElementsByTagName("IMG");
var _28=[];
for(var i=0;i<_27.length;i++){
if(_27[i].id.indexOf("tile_")!=-1){
_28.push(_27[i]);
}
}
try{
for(var i=0;i<_28.length;i++){
this.div.removeChild(_28[i]);
}
}
catch(e){
}
},initTile:function(){
var _2a=this.parent.tile_height;
var _2b=this.parent.tile_width;
var _2c=0;
var _2d=0;
for(var x=0;x<this.parent.tiles.length;x++){
_2c=0;
for(var y=0;y<this.parent.tiles[x].length;y++){
t=_2c*_2a+1;
l=_2d*_2b+1;
this.parent.tiles[x][y].setLeftTop(l,t);
this.div.appendChild(this.parent.tiles[x][y].image);
_2c++;
}
_2d++;
}
},reloadTile:function(){
var _30=this.parent.tile_height;
var _31=this.parent.tile_width;
var _32=0;
var _33=0;
for(var x=0;x<this.parent.tiles.length;x++){
_32=0;
for(var y=0;y<this.parent.tiles[x].length;y++){
t=_32*_30+1;
l=_33*_31+1;
this.parent.tiles[x][y].setLeftTop(l,t);
_32++;
}
_33++;
}
},randArrayOrder:function(a,b){
return (Math.round(Math.random())-0.5);
},setXY:function(){
this.x1=this.div.offsetLeft;
this.y1=this.div.offsetTop;
this.x2=(this.x1+parseInt(this.div.offsetWidth));
this.y2=(this.y1+parseInt(this.div.offsetHeight));
},setLT:function(){
var _38=this.parent.getOffset(this.parent.container,true);
var _39=this.parent.getOffset(this.parent.container,false);
this.l=(parseInt(this.parent.getOffset(this.parent.tiles[0][0].image,true))-_38);
this.l2=parseInt(this.parent.getOffset(this.parent.tiles[0][0].image,true))+(this.parent.tiles.length*this.parent.tile_width)-(_38+this.parent.container.offsetWidth);
this.t=(parseInt(this.parent.getOffset(this.parent.tiles[0][0].image,false))-_39);
this.t2=parseInt(this.parent.getOffset(this.parent.tiles[0][0].image,false))+(this.parent.tiles[0].length*this.parent.tile_height)-(_39+this.parent.container.offsetHeight);
},setLeftTopLT:function(){
this.parent.left_top_l=parseInt($("tile_"+this.parent.left_top_x+"_"+this.parent.left_top_y+"_"+this.parent.zoom+"_"+this.parent.map_id).offsetLeft);
this.parent.left_top_t=parseInt($("tile_"+this.parent.left_top_x+"_"+this.parent.left_top_y+"_"+this.parent.zoom+"_"+this.parent.map_id).offsetTop);
},checkBoundary:function(){
this.setLT();
this.moved_tile=false;
while(this.l>this.check_boundary_margin_minus){
this.setLeftTopLT();
this.parent.moveLeft();
this.setLT();
this.moved_tile=true;
}
while(this.l2<this.check_boundary_margin){
this.setLeftTopLT();
this.parent.moveRight();
this.setLT();
this.moved_tile=true;
}
while(this.t>this.check_boundary_margin_minus){
this.setLeftTopLT();
this.parent.moveTop();
this.setLT();
this.moved_tile=true;
}
while(this.t2<this.check_boundary_margin){
this.setLeftTopLT();
this.parent.moveBottom();
this.setLT();
this.moved_tile=true;
}
},onDragStartEvent:function(e,nx,ny){
var evt=this.parent.getEvt(e);
this.current_grad_tile=evt[1];
this.last_current_grad_tile_cursor=this.current_grad_tile.style.cursor;
if(ie){
this.div.style.cursor="url("+grab2.src+")";
this.current_grad_tile.style.cursor="url("+grab2.src+")";
}else{
this.div.style.cursor="grabbing";
this.div.style.cursor="-moz-grabbing";
this.current_grad_tile.style.cursor="grabbing";
this.current_grad_tile.style.cursor="-moz-grabbing";
}
this.setXY();
this.setLT();
this.move_val=200;
this.edge=null;
this.margin=0;
this.start_point_id=this.parent.tiles[0][0].image.id;
this.start_drag_x=this.parent.getOffset(this.parent.tiles[0][0].image,true);
this.start_drag_y=this.parent.getOffset(this.parent.tiles[0][0].image,false);
if((this.current_grad_tile.getAttribute("isdraggable")!=null&&this.current_grad_tile.getAttribute("isdraggable")=="0")||(this.current_grad_tile.isdraggable!=null&&this.current_grad_tile.isdraggable=="0")){
try{
this.drag.end();
if(typeof (drag_end_listener)=="function"){
drag_end_listener();
}
}
catch(e){
}
}else{
if(typeof (drag_start_listener)=="function"){
drag_start_listener();
}
}
},onDragEvent:function(e,nx,ny){
this.checkBoundary();
if(this.moved_tile){
if(ie){
this.current_grad_tile.style.cursor="url("+grab2.src+")";
}else{
this.current_grad_tile.style.cursor="grabbing";
this.current_grad_tile.style.cursor="-moz-grabbing";
}
}
if(this.current_grad_tile.getAttribute("isdraggable")==null||this.current_grad_tile.getAttribute("isdraggable")!="0"){
try{
if(typeof (drag_listener)=="function"){
drag_listener();
}
}
catch(e){
}
}
},onDragEndEvent:function(nx,ny){
if(ie){
this.div.style.cursor="url("+grab1.src+")";
}else{
this.div.style.cursor="grab";
this.div.style.cursor="-moz-grab";
}
this.current_grad_tile.style.cursor=this.last_current_grad_tile_cursor;
if(this.parent.tile_mode==1){
this.parent.hit_counter++;
}else{
this.parent.hit_counter_dop++;
}
this.checkBoundary();
this.move_val=200;
this.edge=null;
this.margin=0;
this.parent.centerThumbnail();
if(this.parent.map_widget_controller!=null){
var w=this.parent.map_widget_controller.widgetSearch("property_browser");
if(w&&w.w.status){
var c1=this.parent.getLeftTopCoor();
var c2=this.parent.getRightBottomCoor();
if(typeof (w.w.model_obj.windowOnDrag)=="function"){
w.w.model_obj.windowOnDrag(c1,c2);
}
}
}
this.resetMapPointPosition();
if(typeof (drag_end_listener)=="function"){
drag_end_listener();
}
if(this.parent.on_drag_external_listener.length>0){
for(var i=0;i<this.parent.on_drag_external_listener.length;i++){
this.parent.on_drag_external_listener[i]();
}
}
},preTransformDblclick:function(){
this.transforming=true;
},afterTransformDblclick3:function(){
this.checkBoundary();
this.resetMapPointPosition();
if(this.parent.map_widget_controller!=null){
var _47=this.parent.map_widget_controller.widgetSearch("property_browser");
if(_47&&_47.w.status){
var c1=this.parent.getLeftTopCoor();
var c2=this.parent.getRightBottomCoor();
if(typeof (_47.w.model_obj.windowOnMove)=="function"){
_47.w.model_obj.windowOnMove(c1,c2);
}
}
}
if(this.parent.map_thumbnail_widget!=null){
var _4a=this.parent.getCenterCoor2();
this.parent.center_ln=_4a[0];
this.parent.center_la=_4a[1];
this.parent.map_thumbnail_widget.thumb.center_ln=this.parent.center_ln;
this.parent.map_thumbnail_widget.thumb.center_la=this.parent.center_la;
var _4b=this.parent.map_thumbnail_widget.thumb.calCenterClnCla();
this.parent.map_thumbnail_widget.thumb.centerMap(_4b[0],_4b[1],true);
this.parent.map_thumbnail_widget.thumb.map_tile_container.checkBoundary();
}
if(typeof (drag_end_listener)=="function"){
drag_end_listener();
}
},afterTransformDblclick2:function(){
this.checkBoundary();
this.resetMapPointPosition();
},afterTransformDblclick:function(_4c){
this.checkBoundary();
this.resetMapPointPosition();
if(this.parent.map_thumbnail_widget!=null){
var _4d=this.parent.getCenterCoor2();
this.parent.map_thumbnail_widget.thumb.center_ln=_4d[0];
this.parent.map_thumbnail_widget.thumb.center_la=_4d[1];
var _4e=this.parent.map_thumbnail_widget.thumb.calCenterClnCla();
if(_4c!=null||_4c==false){
this.parent.map_thumbnail_widget.thumb.centerMap(_4e[0],_4e[1],false);
}else{
this.parent.map_thumbnail_widget.thumb.centerMap(_4e[0],_4e[1],true);
}
this.parent.map_thumbnail_widget.thumb.map_tile_container.checkBoundary();
}
this.move_act_from_thumb=false;
this.transforming=false;
},afterTransformDblclickZoom:function(_4f){
this.parent.zoom--;
if(this.parent.zoom>this.max_zoom){
this.parent.zoom=this.max_zoom;
}
this.parent.changeZoomLevel(this.parent.zoom,false);
if(this.parent.map_control!=null&&typeof (this.parent.map_control.setZoomLevel)=="function"){
this.parent.map_control.setZoomLevel(this.parent.zoom);
}
this.checkBoundary();
this.resetMapPointPosition();
if(this.parent.map_thumbnail_widget!=null){
var _50=this.parent.getCenterCoor2();
this.parent.center_ln=_50[0];
this.parent.center_la=_50[1];
this.parent.map_thumbnail_widget.thumb.center_ln=_50[0];
this.parent.map_thumbnail_widget.thumb.center_la=_50[1];
var _51=this.parent.map_thumbnail_widget.thumb.calCenterClnCla();
if(_4f!=null||_4f==false){
this.parent.map_thumbnail_widget.thumb.centerMap(_51[0],_51[1],false);
}else{
this.parent.map_thumbnail_widget.thumb.centerMap(_51[0],_51[1],true);
}
this.parent.map_thumbnail_widget.thumb.map_tile_container.checkBoundary();
}
this.move_act_from_thumb=false;
this.transforming=false;
},onDblClickProcess2:function(obj,cx,cy,_55){
this.current_dbc_obj=obj;
this.current_dbc_obj_x=cx-parseInt(this.parent.getOffset(this.current_dbc_obj,true))-2;
this.current_dbc_obj_y=cy-parseInt(this.parent.getOffset(this.current_dbc_obj,false))-2;
left_final=this.div.offsetLeft-(cx-this.parent.container_center_left);
top_final=this.div.offsetTop-(cy-this.parent.container_center_top);
var _56=this.parent.getOffset(this.parent.container.parentNode,false);
if(document.body.scrollTop>_56){
top_final=this.div.offsetTop-(cy-this.parent.container_center_top)+(document.body.scrollTop-_56);
}
if(_55){
if(this.transforming){
while(!this.transforming){
this.interrupt=true;
}
this.interrupt=false;
}
this.transformLayer(left_final,top_final,this.div,this.trans_duration,this.trans_step,this.afterTransformDblclick.bind(this),this.preTransformDblclick.bind(this));
}else{
this.preTransformDblclick();
this.div.style.left=left_final+"px";
this.div.style.top=top_final+"px";
this.afterTransformDblclick();
}
var _57=this.current_dbc_obj.id.split("_");
},onDblClickProcess:function(obj,cx,cy,_5b){
this.current_dbc_obj=obj;
this.current_dbc_obj_x=cx-parseInt(this.parent.getOffset(this.current_dbc_obj,true))-2;
this.current_dbc_obj_y=cy-parseInt(this.parent.getOffset(this.current_dbc_obj,false))-2;
left_final=this.div.offsetLeft-(cx-this.parent.container_center_left);
top_final=this.div.offsetTop-(cy-this.parent.container_center_top);
var _5c=this.parent.getOffset(this.parent.container.parentNode,false);
if(document.body.scrollTop>_5c){
top_final=this.div.offsetTop-(cy-this.parent.container_center_top)+(document.body.scrollTop-_5c);
}
if(_5b){
if(this.transforming){
while(!this.transforming){
this.interrupt=true;
}
this.interrupt=false;
}
this.transformLayer(left_final,top_final,this.div,this.trans_duration,this.trans_step,this.afterTransformDblclickZoom.bind(this),this.preTransformDblclick.bind(this));
}else{
this.preTransformDblclick();
this.div.style.left=left_final+"px";
this.div.style.top=top_final+"px";
this.afterTransformDblclickZoom();
}
var _5d=this.current_dbc_obj.id.split("_");
var _5e=((((parseInt(_5d[2]))*this.parent.tile_height)+this.current_dbc_obj_y)/this.parent.zoom_properties.properties["total_y_px"])*this.parent.zoom_properties.properties["total_y_meter"];
_5e=Math.floor(this.parent.zoom_properties.properties["la"])-_5e;
var _5f=_5e;
var _60=((((parseInt(_5d[1]))*this.parent.tile_width)+this.current_dbc_obj_x)/this.parent.zoom_properties.properties["total_x_px"])*this.parent.zoom_properties.properties["total_x_meter"];
_60=_60+Math.floor(this.parent.zoom_properties.properties["ln"]);
var _61=_60;
this.parent.center_ln=_61;
this.parent.center_la=_5f;
this.parent.center_coor=new MapLatLng({"lat":0,"lng":0,"gov_lat":_5f,"gov_lng":_61});
},onDblClickAction:function(evt){
if(!this.dbl_click_enable){
return false;
}
e=this.parent.getEvt(evt);
if(e[1].id.indexOf("tile_")==-1){
return false;
}
cx=e[0].clientX+document.body.scrollLeft;
cy=e[0].clientY+document.body.scrollTop;
this.onDblClickProcess(e[1],cx,cy,true);
},transformLayer:function(x,y,obj,_66,_67,_68,_69){
if(this.transform_timeout!=null){
clearTimeout(this.transform_timeout);
}
if(this.interrupt){
this.interrupt=false;
this.transforming=false;
return false;
}
this.transforming=true;
if(_69!=null){
_69();
}
this.x1=this.div.offsetLeft;
this.y1=this.div.offsetTop;
this.x2=(this.x1+parseInt(this.div.offsetWidth));
this.y2=(this.y1+parseInt(this.div.offsetHeight));
stepDuration=Math.round(_66/_67);
tx1=this.x1;
ty1=this.y1;
x=(x)?x:tx1;
y=(y)?y:ty1;
difX=(x-tx1)/_67;
difY=(y-ty1)/_67;
tx1+=difX;
ty1+=difY;
if(!isNaN(tx1)&&!isNaN(ty1)&&tx1!="Infinity"&&ty1!="Infinity"&&tx1!="-Infinity"&&ty1!="-Infinity"){
obj.style.left=tx1+"px";
obj.style.top=ty1+"px";
}
_66=(_66-stepDuration);
_67--;
if(_67>=0){
this.transform_timeout=setTimeout((function(){
this.transformLayer(x,y,obj,_66,_67,_68,null);
}).bind(this),stepDuration);
}else{
if(this.transform_timeout!=null){
clearTimeout(this.transform_timeout);
this.transform_timeout=null;
}
this.transforming=false;
if(_68!=null){
_68();
}
return true;
}
return true;
},addPointCollection:function(arr){
for(var i=0;i<arr.length;i++){
this.addPoint(arr[i]);
}
},addPoint:function(_6c){
if(typeof (_6c)!="undefined"&&typeof (_6c.div)!="undefined"){
this.map_point_collection.push(_6c);
_6c.div.style.left="-5000px";
_6c.div.style.top="-5000px";
this.div.appendChild(_6c.div);
_6c.setPosition();
}
},searchPoint:function(_6d){
for(var i=0;i<this.map_point_collection.length;i++){
if(_6d==this.map_point_collection[i]){
return true;
}
}
return false;
},removePoint:function(_6f){
try{
var _70=-1;
var _71=false;
for(var i=0;i<this.map_point_collection.length;i++){
if(_6f==this.map_point_collection[i]){
while(this.map_point_collection[i].div.childNodes>0){
this.map_point_collection[i].div.removeChild(this.map_point_collection[i].div.childNodes[0]);
}
this.div.removeChild(this.map_point_collection[i].div);
if(this.map_point_collection[i].div_shadow!=null){
this.div.removeChild(this.map_point_collection[i].div_shadow);
}
_70=i;
_71=true;
}
}
if(_71){
this.map_point_collection.splice(_70,1);
}
}
catch(e){
}
},removeMapPointGroup:function(_73){
var _74=new Array();
for(var i=0;i<this.map_point_collection.length;i++){
if(typeof (this.map_point_collection[i].group)!="undefined"&&this.map_point_collection[i].group==_73){
try{
while(this.map_point_collection[i].div.childNodes>0){
this.map_point_collection[i].div.removeChild(this.map_point_collection[i].div.childNodes[0]);
}
if(this.map_point_collection[i].div_shadow!=null){
this.div.removeChild(this.map_point_collection[i].div_shadow);
}
if(this.map_point_collection[i].div_topping_shad!=null){
this.div.removeChild(this.map_point_collection[i].div_topping_shad);
}
this.div.removeChild(this.map_point_collection[i].div);
}
catch(e){
}
}else{
_74.push(this.map_point_collection[i]);
}
}
this.map_point_collection=null;
this.map_point_collection=_74;
_74=null;
},removeAllPoint:function(){
for(var i=0;i<this.map_point_collection.length;i++){
try{
this.div.removeChild(this.map_point_collection[i].div);
if(this.map_point_collection[i].div_shadow!=null){
this.div.removeChild(this.map_point_collection[i].div_shadow);
}
}
catch(e){
}
}
this.map_point_collection=new Array();
},resetMapPointPosition:function(){
if(this.map_point_collection.length>500){
if(this.reset_map_point_timeout!=null){
clearTimeout(this.reset_map_point_timeout);
}
if(this.reset_map_point_timeout2!=null){
clearTimeout(this.reset_map_point_timeout2);
}
this.reset_map_point_cnt=this.map_point_collection.length+1;
this.resetMapPointPositionXAction();
this.reset_map_point_lt=this.parent.getLeftTopCoor();
this.reset_map_point_rb=this.parent.getRightBottomCoor();
this.reset_map_point_cnt=-1;
this.resetMapPointPositionX();
}else{
if(this.reset_map_point_timeout!=null){
clearTimeout(this.reset_map_point_timeout);
}
if(this.reset_map_point_timeout2!=null){
clearTimeout(this.reset_map_point_timeout2);
}
var _77=this.parent.getLeftTopCoor();
var _78=this.parent.getRightBottomCoor();
var cnt=0;
for(var i=0;i<this.map_point_collection.length;i++){
if(this.map_point_collection[i].no_reset){
continue;
}
if(!this.map_point_collection[i].no_reset&&this.map_point_collection[i].div.style.display=="none"){
var ln=this.map_point_collection[i].ln;
var la=this.map_point_collection[i].la;
if(ln>_77[0]&&ln<_78[0]&&la<_77[1]&&la>_78[1]){
this.map_point_collection[i].setPosition(true);
}
}else{
}
}
}
},resetMapPointPosition2:function(){
for(var i=0;i<this.map_point_collection.length;i++){
if(this.map_point_collection[i].no_reset){
continue;
}
this.map_point_collection[i].setPosition();
}
},resetMapPointPositionXAction:function(){
if(this.reset_map_point_cnt<this.map_point_collection.length){
var _7e=true;
while(this.reset_map_point_cnt%50!=0||this.reset_map_point_cnt==0){
if(!this.map_point_collection[this.reset_map_point_cnt].no_reset&&this.map_point_collection[this.reset_map_point_cnt].div.style.display=="none"){
if(this.map_point_collection[this.reset_map_point_cnt].ln>this.reset_map_point_lt[0]&&this.map_point_collection[this.reset_map_point_cnt].ln<this.reset_map_point_rb[0]&&this.map_point_collection[this.reset_map_point_cnt].la<this.reset_map_point_lt[1]&&this.map_point_collection[this.reset_map_point_cnt].la>this.reset_map_point_rb[1]){
this.map_point_collection[this.reset_map_point_cnt].setPosition();
}else{
}
}else{
}
this.reset_map_point_cnt++;
if(this.reset_map_point_cnt>=this.map_point_collection.length){
break;
}
}
this.reset_map_point_timeout=setTimeout((function(){
this.resetMapPointPositionX();
}).bind(this),1);
}else{
if(this.reset_map_point_timeout!=null){
clearTimeout(this.reset_map_point_timeout);
this.reset_map_point_timeout=null;
}
this.reset_map_point_cnt=0;
}
},resetMapPointPositionX:function(){
this.reset_map_point_cnt++;
this.resetMapPointPositionXAction();
},resetMapPointForReinit:function(){
for(var i=0;i<this.map_point_collection.length;i++){
this.map_point_collection[i].hide();
}
if(this.reset_map_point_timeout2!=null){
clearTimeout(this.reset_map_point_timeout2);
}
if(this.reset_map_point_timeout!=null){
clearTimeout(this.reset_map_point_timeout);
}
this.reset_map_point_cnt2=this.map_point_collection.length+1;
this.resetMapPointForReinitXAction();
this.reset_map_point_lt2=this.parent.getLeftTopCoor();
this.reset_map_point_rb2=this.parent.getRightBottomCoor();
this.reset_map_point_cnt2=-1;
this.resetMapPointForReinitX();
},resetMapPointForReinitXAction:function(){
if(this.reset_map_point_cnt2<this.map_point_collection.length){
while(this.reset_map_point_cnt2%50!=0||this.reset_map_point_cnt2==0){
if(!this.map_point_collection[this.reset_map_point_cnt2].no_reset&&this.map_point_collection[this.reset_map_point_cnt2].div.style.display=="none"){
if(this.map_point_collection[this.reset_map_point_cnt2].ln>this.reset_map_point_lt2[0]&&this.map_point_collection[this.reset_map_point_cnt2].ln<this.reset_map_point_rb2[0]&&this.map_point_collection[this.reset_map_point_cnt2].la<this.reset_map_point_lt2[1]&&this.map_point_collection[this.reset_map_point_cnt2].la>this.reset_map_point_rb2[1]){
this.map_point_collection[this.reset_map_point_cnt2].setPosition();
}else{
}
}else{
}
this.reset_map_point_cnt2++;
if(this.reset_map_point_cnt2>=this.map_point_collection.length){
break;
}
}
this.reset_map_point_timeout2=setTimeout((function(){
this.resetMapPointForReinitX();
}).bind(this),1);
}else{
if(this.reset_map_point_timeout2!=null){
clearTimeout(this.reset_map_point_timeout2);
this.reset_map_point_timeout2=null;
}
this.reset_map_point_cnt2=-1;
}
},resetMapPointForReinitX:function(){
this.reset_map_point_cnt2++;
this.resetMapPointForReinitXAction();
},getMapPointXYMargin:function(){
this.min_ln=0;
this.max_ln=0;
this.min_la=0;
this.max_la=0;
this.displayed_map_point=new Array();
for(var i=0;i<this.map_point_collection.length;i++){
if(!this.map_point_collection[i].isInSight()){
continue;
}
this.displayed_map_point.push(this.map_point_collection[i]);
var _81=this.map_point_collection[i].coor.latlng.gov_lat;
var _82=this.map_point_collection[i].coor.latlng.gov_lng;
if(_82>this.max_ln){
this.max_ln=_82;
}
if(this.min_ln>_82||this.min_ln==0){
this.min_ln=_82;
}
if(_81>this.max_la){
this.max_la=_81;
}
if(this.min_la>_81||this.min_la==0){
this.min_la=_81;
}
}
this.displayed_map_point.sort(this.randArrayOrder);
},calMapPointOverCrowdedIndex:function(){
if(this.map_point_collection==null){
return;
}
if(this.map_point_collection.length<1){
return;
}
this.getMapPointXYMargin();
this.margin_ln=Math.abs(this.max_ln-this.min_ln);
this.margin_la=Math.abs(this.max_la-this.min_la);
var _83=this.map_point_collection.length;
var _84=(this.margin_ln/this.parent.zoom_properties.properties.glg1_per_px)*(this.margin_la/this.parent.zoom_properties.properties.gla1_per_px);
this.map_point_crowd_index=_84/_83;
if(this.map_point_crowd_threshold>this.map_point_crowd_index){
this.setMapPointPaging();
}
},setMapPointPaging:function(){
var _85=Math.floor(this.map_point_collection.length*0.8);
while(true){
var _86=(this.margin_ln/this.parent.zoom_properties.properties.glg1_per_px)*(this.margin_la/this.parent.zoom_properties.properties.gla1_per_px);
var _87=_86/_85;
if(this.map_point_crowd_threshold>_87){
_85=Math.floor(_85*0.8);
}else{
break;
}
}
var _88=Math.ceil(this.map_point_collection.length/_85);
_85=Math.ceil(this.map_point_collection.length/_88);
},onDblClickActionTWF:function(evt){
this.onDblClickAction(evt);
this.postDblClickAction(this.parent.center_ln,this.parent.center_la);
},postDblClickAction:function(x,y){
if(this.parent.map_thumbnail_obj!=null){
this.parent.map_thumbnail_obj.center_la=y;
this.parent.map_thumbnail_obj.center_ln=x;
var _8c=this.parent.map_thumbnail_obj.calCenterClnCla();
this.parent.map_thumbnail_obj.centerMap(_8c[0],_8c[1],true);
}
},destruct:function(){
}};
var Map=Class.create();
Map.prototype={hit_counter:0,hit_counter_dop:0,drag:Drag,tiles:new Array(),tile_width:200,tile_height:200,tile_url:"util/get_tile.php",tile_url2:["http://map.hongkonghomes.com/map2/util/get_tile.php","http://map.hongkonghomes.com:81/map_tile/util/get_tile.php"],tile_mode:1,container:null,zoom:0,map_id:0,zoom_properties:null,center_coor:null,copyright_text:"&copy;2008&nbsp;Survey&nbsp;and&nbsp;Mapping&nbsp;Office,&nbsp;Lands&nbsp;Department<br>Copyright&nbsp;reserved&nbsp;-&nbsp;reproduction&nbsp;by&nbsp;permission&nbsp;only.",setting_obj:null,thumbnail_zoom_level:4,on_drag_external_listener:[],on_zoom_external_listener:[],changeTileMode:function(_8d){
if(isNaN(_8d)){
return false;
}
this.tile_mode=_8d;
for(var x=0;x<this.tile_num_x;x++){
for(var y=0;y<this.tile_num_y;y++){
this.tiles[x][y].updateSrc();
}
}
try{
if(this.map_thumbnail_widget!=null&&typeof (this.map_thumbnail_widget.thumb.changeTileMode)=="function"){
this.map_thumbnail_widget.thumb.changeTileMode(_8d);
}
}
catch(e){
}
if(this.copyright_text_div!=null&&typeof (this.copyright_text_div)=="object"){
switch(this.tile_mode){
case 1:
case "1":
this.copyright_text_div.style.color="#000000";
break;
case 2:
case "2":
this.copyright_text_div.style.color="#FFFFFF";
break;
}
}
return true;
},addOnDragListener:function(f){
if(typeof (f)!="function"){
return false;
}
this.on_drag_external_listener.push(f);
},removeOnDragListener:function(f){
if(typeof (f)!="function"){
return false;
}
var pos=-1;
for(var i=0;i<this.on_drag_external_listener.length;i++){
if(f==this.on_drag_external_listener[i]){
pos=i;
break;
}
}
if(pos!=-1){
this.on_drag_external_listener.splice(pos,1);
}
},addOnZoomListener:function(f){
if(typeof (f)!="function"){
return false;
}
this.on_zoom_external_listener.push(f);
},removeOnZoomListener:function(f){
if(typeof (f)!="function"){
return false;
}
var pos=-1;
for(var i=0;i<this.on_zoom_external_listener.length;i++){
if(f==this.on_zoom_external_listener[i]){
pos=i;
break;
}
}
if(pos!=-1){
this.on_zoom_external_listener.splice(pos,1);
}
},reloadContainerLeftTop:function(){
this.container_left=this.getOffset(this.container,true);
this.container_top=this.getOffset(this.container,false);
this.container_center_left=Math.ceil(this.container_left+(this.container.offsetWidth/2));
this.container_center_top=Math.ceil(this.container_top+(this.container.offsetHeight/2));
},initialize:function(_98,_99,_9a,_9b){
if(typeof (CONST_ZOOM_P1)=="undefined"||typeof (CONST_ZOOM_P2)=="undefined"){
return false;
}
if(_98.tagName.toLowerCase()=="div"&&typeof (_99["center_x"])!="undefined"&&typeof (_99["center_y"])!="undefined"&&typeof (_99["zoom"])!="undefined"){
if(typeof (_99["map"])!="undefined"){
this.map_id=_99["map"];
}
this.thumbnail_zoom_level=parseInt(this.thumbnail_zoom_level);
this.container=_98;
if(typeof (_99["draggable"])!="undefined"){
this.draggable=_99["draggable"];
}else{
this.draggable=true;
}
if(typeof(_99["tile_url2"]) != "undefined" )
	this.tile_url2 = _99["tile_url2"];
this.container_left=this.getOffset(this.container,true);
this.container_top=this.getOffset(this.container,false);
this.container_center_left=Math.ceil(this.container_left+(this.container.offsetWidth/2));
this.container_center_top=Math.ceil(this.container_top+(this.container.offsetHeight/2));
this.zooming_timeout=null;
this.tile_num_x=Math.round(parseInt(this.container.offsetWidth)/this.tile_width)+2;
this.tile_num_y=Math.round(parseInt(this.container.offsetHeight)/this.tile_height)+2;
if(_9b!=null){
this.zooms=_9b;
}else{
this.zooms=CONST_ZOOM_P2;
}
this.min_zoom=null;
this.max_zoom=null;
for(var i=0;i<this.zooms.length;i++){
var _9d=parseInt(this.zooms[i].level);
if(this.min_zoom==null||_9d<this.min_zoom){
this.min_zoom=_9d;
}
if(this.max_val==null||_9d>this.max_zoom){
this.max_zoom=_9d;
}
}
this.zoom=_99["zoom"];
this.zoom_properties=new MapZoom(this);
if(_9a!=null){
this.zoom_properties.setProperties(_9a);
}else{
this.zoom_properties.setProperties(CONST_ZOOM_P1);
}
this.center_x=_99["center_x"];
this.center_y=_99["center_y"];
this.center_ln=_99["center_ln"];
this.center_la=_99["center_la"];
if(this.map_id==1){
var _9e=getCookie("msetting");
if(false){
var _9f=null;
eval("setting_tmp_obj = "+unescape(_9e));
if(typeof (_9f)=="object"){
this.setting_obj=_9f;
if(this.setting_obj.center_ln!=null||this.setting_obj.center_ln!="undefined"){
this.center_ln=this.setting_obj.center_ln;
}
if(this.setting_obj.center_la!=null||this.setting_obj.center_la!="undefined"){
this.center_la=this.setting_obj.center_la;
}
if(this.setting_obj.zoom_level!=null||this.setting_obj.zoom_level!="undefined"){
var pos=-100;
for(var i=0;i<CONST_ALL_ZOOM.length;i++){
if(CONST_ALL_ZOOM[i].id!=null&&parseInt(CONST_ALL_ZOOM[i].level)==this.setting_obj.zoom_level){
pos=i;
break;
}
}
if(pos!=-100&&pos<CONST_ALL_ZOOM.length&&pos>-1){
this.zoom=this.setting_obj.zoom_level;
this.zoom_properties.setProperties(CONST_ALL_ZOOM[pos]);
}
}
}else{
_9f={};
_9f.center_ln=this.center_ln;
_9f.center_la=this.center_la;
_9f.zoom_level=this.zoom;
this.setting_obj=_9f;
}
}else{
var _9f={};
_9f.center_ln=this.center_ln;
_9f.center_la=this.center_la;
_9f.zoom_level=this.zoom;
this.setting_obj=_9f;
}
}
var _a1=this.calCenterClnCla();
var cln=_a1[0];
var cla=_a1[1];
var _a4=Math.floor(_a1[0])-1;
var _a5=Math.floor(_a1[1])-1;
var _a6=_a5;
var _a7=_a4;
this.tiles=new Array();
for(var x=0;x<this.tile_num_x;x++){
this.tiles[x]=new Array();
_a6=_a5;
for(var y=0;y<this.tile_num_y;y++){
var ii=Math.round((this.tile_url2.length-1)*Math.random());
this.tiles[x][y]=new Tile(this,this.tile_url2[ii],_a7,_a6,this.zoom,this.tile_width,this.tile_height);
if(x==0&&y==0){
this.left_top_x=_a7;
this.left_top_y=_a6;
}
_a6++;
}
_a7++;
}
this.temp_xy=this.calCoorByXY(parseInt(this.center_x),parseInt(this.center_y));
this.center_coor=new MapLatLng({"lat":0,"lng":0,"gov_lat":this.temp_xy[1],"gov_lng":this.temp_xy[0]});
this.map_tile_container=new MapTileContainer(this);
this.map_tile_container.initTile();
this.container.appendChild(this.map_tile_container.div);
this.container.appendChild(this.map_tile_container.smooth_zoom_div);
this.container.appendChild(this.map_tile_container.smooth_zoom_div2);
this.map_tile_container_cn=this.map_tile_container.div.childNodes;
this.widget_controller=null;
this.container.oncontextmenu=this.contextmenuHandler.bindAsEventListener(this);
this.container.onclick=this.containerClickHandler.bindAsEventListener(this);
this.attachCopyrightText();
this.centerMap(cln,cla);
this.tools_container=document.createElement("div");
this.tools_container.style.position="absolute";
this.tools_container.style.width=this.container.offsetWidth+"px";
this.tools_container.style.height="0px";
this.tools_container.style.left="0px";
this.tools_container.style.top="0px";
this.tools_container.style.zIndex="999";
this.container.appendChild(this.tools_container);
this.login_manager=null;
if(ie&&this.container.onmousewheel==null){
if(this.map_id==1||this.map_id=="1"){
this.container.onmousewheel=this.mouseWheelCapture.bindAsEventListener(this);
}
}else{
if(this.map_id==1||this.map_id=="1"){
this.container.addEventListener("DOMMouseScroll",this.mouseWheelCaptureNonIE.bindAsEventListener(this),false);
}
}
this.grid_selector_layer=document.createElement("div");
this.grid_selector_layer.style.position="absolute";
this.grid_selector_layer.style.width=this.container.offsetWidth+"px";
this.grid_selector_layer.style.height=this.container.offsetHeight+"px";
this.grid_selector_layer.style.left="0px";
this.grid_selector_layer.style.top="1px";
this.grid_selector_layer.style.backgroundImage="url('images/nbsp.gif')";
this.grid_selector_layer.style.zIndex="902";
this.grid_selector_drag=document.createElement("div");
this.grid_selector_drag.style.position="absolute";
this.grid_selector_drag.style.width="0px";
this.grid_selector_drag.style.height="0px";
this.grid_selector_drag.style.left="0px";
this.grid_selector_drag.style.top="0px";
this.grid_selector_drag.style.overflow="hidden";
this.grid_selector_drag.style.zIndex="901";
this.grid_selector_drag.className="opac3";
this.grid_selector_drag.style.border="2px #000000 dashed";
this.grid_selector_drag.style.backgroundColor="#C0DFEB";
}
},onResizeConstruct:function(){
this.container_left=this.getOffset(this.container,true);
this.container_top=this.getOffset(this.container,false);
this.container_center_left=Math.ceil(this.container_left+(this.container.offsetWidth/2));
this.container_center_top=Math.ceil(this.container_top+(this.container.offsetHeight/2));
this.tile_num_x=Math.round(parseInt(this.container.offsetWidth)/this.tile_width)+2;
this.tile_num_y=Math.round(parseInt(this.container.offsetHeight)/this.tile_height)+2;
var _ab=this.calClnClaByCoor(this.center_ln,this.center_la);
var cln=_ab[0];
var cla=_ab[1];
var _ae=Math.floor(_ab[0])-1;
var _af=Math.floor(_ab[1])-1;
var _b0=_af;
var _b1=_ae;
var _b2=this.tile_height;
var _b3=this.tile_width;
this.map_tile_container.cleanTile();
var _b4=new Array();
_b4=_b4.concat(this.tiles);
this.tiles=new Array();
for(var x=0;x<this.tile_num_x;x++){
this.tiles[x]=new Array();
_b0=_af;
for(var y=0;y<this.tile_num_y;y++){
var ii=Math.round((this.tile_url2.length-1)*Math.random());
if(x<_b4.length&&y<_b4[x].length){
this.tiles[x][y]=_b4[x][y];
this.tiles[x][y].resetProperties(this.tile_url2[ii],_b1,_b0,this.zoom,this.tile_width,this.tile_height);
}else{
this.tiles[x][y]=new Tile(this,this.tile_url2[ii],_b1,_b0,this.zoom,this.tile_width,this.tile_height);
}
t=_b0*_b2+1;
l=_b1*_b3+1;
this.tiles[x][y].setLeftTop(l,t);
this.map_tile_container.div.appendChild(this.tiles[x][y].image);
if(x==0&&y==0){
this.left_top_x=_b1;
this.left_top_y=_b0;
}
_b0++;
}
_b1++;
}
_b4=null;
this.centMapByLnLa(this.center_ln,this.center_la,false);
this.map_tile_container.resetMapPointForReinit();
this.centMapByLnLa(this.center_ln,this.center_la,false);
this.map_tile_container.smoothZoomingDivUpdate();
if(this.map_control!=null&&typeof (this.map_control.resetOnResize)=="function"){
this.map_control.resetOnResize();
}
if(this.map_thumbnail_widget!=null&&typeof (this.map_thumbnail_widget.resetOnResize)=="function"){
this.map_thumbnail_widget.resetOnResize();
}
if(this.map_widget_controller!=null&&typeof (this.map_widget_controller.resetOnResize)=="function"){
this.map_widget_controller.resetOnResize();
}
if(this.property_info_viewer!=null&&typeof (this.property_info_viewer.resetOnResize)=="function"){
this.property_info_viewer.resetOnResize();
}
this.resetCopyrightText();
},destruct:function(){
},getEvt:function(evt){
var e=evt?evt:window.event;
var src=((ie)?e.srcElement:e.target);
return [e,src];
},getOffset:function(obj,_bc){
var _bd=0;
while(obj!=null){
_bd+=obj["offset"+(_bc?"Left":"Top")];
obj=obj.offsetParent;
}
return _bd;
},mouseWheelCaptureNonIE:function(evt){
try{
var e=this.getEvt(evt);
if(e[1].id.indexOf("tile_")==-1&&this.grid_selector_layer!=e[1]){
if(!(e[1].scrollable!=null&&e[1].scrollable)){
return;
}
}
if(this.map_thumbnail_widget!=null){
if(evt.detail==3){
var tmp=this.zoom;
tmp++;
if(tmp<=this.max_zoom){
if(this.map_control!=null){
this.map_control.setZoomLevel(tmp);
}
this.changeZoomLevel(tmp);
}
}else{
if(evt.detail=="-3"){
var tmp=this.zoom;
tmp--;
if(tmp>=this.min_zoom){
if(this.map_control!=null){
this.map_control.setZoomLevel(tmp);
}
this.changeZoomLevel(tmp);
}
}
}
}
}
catch(e){
}
},mouseWheelCapture:function(evt){
var e=this.getEvt(evt);
if(e[1].id.indexOf("tile_")==-1&&this.grid_selector_layer!=e[1]){
if(!(e[1].scrollable!=null&&e[1].scrollable)){
return;
}
}
if(this.map_thumbnail_widget!=null){
if(e[0].wheelDelta<=-120){
var tmp=this.zoom;
tmp++;
if(tmp<=this.max_zoom){
if(this.map_control!=null){
this.map_control.setZoomLevel(tmp);
}
this.changeZoomLevel(tmp);
}
}else{
if(e[0].wheelDelta>=120){
var tmp=this.zoom;
tmp--;
if(tmp>=this.min_zoom){
if(this.map_control!=null){
this.map_control.setZoomLevel(tmp);
}
this.changeZoomLevel(tmp);
}
}
}
}
},saveHitCount:function(){
try{
var _c4=new Ajax.Request("xml/hc.php?h="+this.hit_counter,{method:"get"});
}
catch(e){
}
},saveSetting:function(){
if(this.map_id!=1){
return;
}
this.setting_obj.center_ln=this.center_ln;
this.setting_obj.center_la=this.center_la;
this.setting_obj.zoom_level=this.zoom;
setting_hash=$H(this.setting_obj);
var _c5=setting_hash.inspect().replace(">","").replace("#<Hash:","");
if(typeof (setCookie)=="function"){
var _c6=new Date();
var _c7=new Date(_c6.getTime()+3600000*24*100);
setCookie("msetting",escape(_c5),_c7,"/");
}
},resetCopyrightText:function(){
if(this.copyright_text==null){
return false;
}
this.copyright_text_div.style.left="3px";
this.copyright_text_div.style.top=(parseInt(this.container.offsetHeight)-parseInt(this.copyright_text_div.offsetHeight)-3)+"px";
},attachCopyrightText:function(){
if(this.copyright_text==null){
return false;
}
if(this.copyright_text_div==null){
this.copyright_text_div=window.document.createElement("div");
this.copyright_text_div.style.zIndex="1500";
this.copyright_text_div.style.position="absolute";
this.container.appendChild(this.copyright_text_div);
}
this.copyright_text_div.innerHTML=this.copyright_text;
this.copyright_text_div.className="copyrighttext";
this.copyright_text_div.style.left="3px";
this.copyright_text_div.style.top=(parseInt(this.container.offsetHeight)-parseInt(this.copyright_text_div.offsetHeight)-3)+"px";
},detachCopyrightText:function(){
if(this.copyright_text_div!=null){
try{
this.container.removeChild(this.copyright_text_div);
}
catch(e){
}
}
},calClnClaByCoor:function(ln,la){
var y2=(parseInt(this.zoom_properties.properties["la"])-parseInt(la))/parseFloat(this.zoom_properties.properties["total_y_meter"]);
var y3=y2*parseFloat(this.zoom_properties.properties["total_y_px"]);
var cla=y3/this.tile_height;
var x2=(parseInt(ln)-parseInt(this.zoom_properties.properties["ln"]))/parseFloat(this.zoom_properties.properties["total_x_meter"]);
var x3=x2*parseFloat(this.zoom_properties.properties["total_x_px"]);
var cln=x3/this.tile_width;
return new Array(cln,cla);
},calCenterClnCla:function(){
return this.calClnClaByCoor(this.center_ln,this.center_la);
},calCoorByXY:function(x,y,cln,cla){
if(this.zoom_properties.properties==null){
return;
}
var _d4=((((parseInt(y))*this.tile_height))/this.zoom_properties.properties["total_y_px"])*this.zoom_properties.properties["total_y_meter"];
_d4=Math.ceil(this.zoom_properties.properties["la"])-_d4;
var _d5=_d4;
var _d6=((((parseInt(x))*this.tile_width))/this.zoom_properties.properties["total_x_px"])*this.zoom_properties.properties["total_x_meter"];
_d6=_d6+Math.ceil(this.zoom_properties.properties["ln"]);
var _d7=_d6;
return new Array(_d7,_d5);
},getCoorByXYAxis:function(x,y){
if(x==null||y==null){
return false;
}
var _da=null;
var tl=x;
var tt=y;
for(var x=0;x<this.tile_num_x;x++){
for(var y=0;y<this.tile_num_y;y++){
var l1=this.getOffset(this.tiles[x][y].image,true);
var t1=this.getOffset(this.tiles[x][y].image,false);
var l2=l1+this.tile_width;
var t2=t1+this.tile_height;
if(l1<=tl&&t1<=tt&&l2>=tl&&t2>=tt){
_da=this.tiles[x][y];
break;
}
}
if(_da!=null){
break;
}
}
try{
return this.calCoorByObj(_da.image,tl,tt);
}
catch(e){
return null;
}
},getLeftTopCoor:function(){
var _e1=null;
var tl=this.getOffset(this.container,true)+2;
var tt=this.getOffset(this.container,false)+2;
for(var x=0;x<this.tile_num_x;x++){
for(var y=0;y<this.tile_num_y;y++){
var l1=this.getOffset(this.tiles[x][y].image,true);
var t1=this.getOffset(this.tiles[x][y].image,false);
var l2=l1+this.tile_width;
var t2=t1+this.tile_height;
if(l1<=tl&&t1<=tt&&l2>=tl&&t2>=tt){
_e1=this.tiles[x][y];
break;
}
}
if(_e1!=null){
break;
}
}
return this.calCoorByObj(_e1.image,tl,tt);
},getRightBottomCoor:function(){
var _ea=null;
var tl=this.getOffset(this.container,true)+(Math.ceil(this.container.offsetWidth))+2;
var tt=this.getOffset(this.container,false)+(Math.ceil(this.container.offsetHeight))+2;
for(var x=0;x<this.tile_num_x;x++){
for(var y=0;y<this.tile_num_y;y++){
var l1=this.getOffset(this.tiles[x][y].image,true);
var t1=this.getOffset(this.tiles[x][y].image,false);
var l2=l1+this.tile_width;
var t2=t1+this.tile_height;
if(l1<=tl&&t1<=tt&&l2>=tl&&t2>=tt){
_ea=this.tiles[x][y];
break;
}
}
if(_ea!=null){
break;
}
}
return this.calCoorByObj(_ea.image,tl,tt);
},getCenterCoor2:function(){
var _f3=null;
var tl=this.getOffset(this.container,true)+(Math.ceil(this.container.offsetWidth/2));
var tt=this.getOffset(this.container,false)+(Math.ceil(this.container.offsetHeight/2));
for(var x=0;x<this.tile_num_x;x++){
for(var y=0;y<this.tile_num_y;y++){
var l1=this.getOffset(this.tiles[x][y].image,true);
var t1=this.getOffset(this.tiles[x][y].image,false);
var l2=l1+this.tile_width;
var t2=t1+this.tile_height;
if(l1<=tl&&t1<=tt&&l2>=tl&&t2>=tt){
_f3=this.tiles[x][y];
break;
}
}
if(_f3!=null){
break;
}
}
return this.calCoorByObj(_f3.image,tl,tt);
},calCoorByObj:function(obj,cx,cy){
obj_x=cx-parseInt(this.getOffset(obj,true))-2;
obj_y=cy-parseInt(this.getOffset(obj,false))-2;
var _ff=obj.id.split("_");
var _100=((((parseInt(_ff[2]))*this.tile_height)+obj_y)/this.zoom_properties.properties["total_y_px"])*this.zoom_properties.properties["total_y_meter"];
_100=Math.floor(this.zoom_properties.properties["la"])-_100;
var glat=_100;
var _102=((((parseInt(_ff[1]))*this.tile_width)+obj_x)/this.zoom_properties.properties["total_x_px"])*this.zoom_properties.properties["total_x_meter"];
_102=_102+Math.floor(this.zoom_properties.properties["ln"]);
var glng=_102;
return new Array(glng,glat);
},reinitMapTileContainer:function(){
var _104=this.calCenterClnCla();
var cln=_104[0];
var cla=_104[1];
var _107=Math.floor(cln)-1;
var _108=Math.floor(cla)-1;
var _109=_108;
var _10a=_107;
var _10b=this.tile_height;
var _10c=this.tile_width;
var _10d=0;
var _10e=0;
for(var x=0;x<this.tile_num_x;x++){
_109=_108;
_10d=0;
for(var y=0;y<this.tile_num_y;y++){
this.tiles[x][y].resetProperties(this.tiles[x][y].src,_10a,_109,this.zoom,this.tile_width,this.tile_height);
if(x==0&&y==0){
this.left_top_x=_10a;
this.left_top_y=_109;
}
t=_10d*_10b+1;
l=_10e*_10c+1;
this.tiles[x][y].setLeftTop(l,t);
_109++;
_10d++;
}
_10a++;
_10e++;
}
this.center_coor=new MapLatLng({"lat":0,"lng":0,"gov_lat":this.center_la,"gov_lng":this.center_ln});
this.centerMap(cln,cla);
this.map_tile_container.resetMapPointForReinit();
},centMapByLnLa:function(ln,la,_113){
this.center_ln=ln;
this.center_la=la;
var _114=this.calCenterClnCla();
var cln=_114[0];
var cla=_114[1];
this.centerMap(cln,cla,_113);
},centerThumbnail:function(){
var coor=this.getCenterCoor2();
this.center_ln=coor[0];
this.center_la=coor[1];
if(this.map_thumbnail_widget!=null){
this.map_thumbnail_widget.thumb.centMapByLnLa(this.center_ln,this.center_la,true);
this.map_thumbnail_widget.thumb.map_tile_container.checkBoundary();
}
},centerMap:function(cln,cla,_11a){
var _11b=(cln-Math.floor(cln))*this.tile_width;
var _11c=(cla-Math.floor(cla))*this.tile_height;
var _11d=$("tile_"+Math.floor(cln)+"_"+Math.floor(cla)+"_"+this.zoom+"_"+this.map_id);
if(_11d!=null){
var _11e=this.getOffset(_11d,true)+_11b;
var _11f=this.getOffset(_11d,false)+_11c;
if(_11a!=null&&_11a){
this.map_tile_container.onDblClickProcess2(_11d,_11e,_11f,true);
}else{
this.map_tile_container.onDblClickProcess2(_11d,_11e,_11f,false);
}
}else{
this.reinitMapTileContainer();
if(this.map_thumbnail_widget!=null){
this.changeZoomLevel(this.zoom);
}
}
},changeZoomLevel_xThumb:function(){
if(this.map_thumbnail_widget!=null&&this.thumb_pos!=-100){
this.map_thumbnail_widget.thumb.zoom=CONST_ALL_ZOOM[this.thumb_pos].level;
this.map_thumbnail_widget.thumb.zoom_properties.properties=CONST_ALL_ZOOM[this.thumb_pos];
this.map_thumbnail_widget.thumb.reinitMapTileContainer();
this.map_thumbnail_widget.thumb.centMapByLnLa(this.center_ln,this.center_la,true);
this.map_thumbnail_widget.placeContainer();
}
},changeZoomLevel_x:function(_120,_121){
if(typeof (this.zoom)=="undefined"){
return false;
}
if(_120>this.max_zoom){
_120=this.max_zoom;
}
if(this.map_id==9){
if(_120>10){
_120=10;
}
}else{
if(_120<this.min_zoom){
_120=this.min_zoom;
}
}
this.old_zoom=this.zoom;
this.zoom=_120;
if(this.tile_mode==1){
this.hit_counter++;
}else{
this.hit_counter_dop++;
}
var _122=-1;
var _123=-100;
var _124=parseInt(this.zoom)+parseInt(this.thumbnail_zoom_level);
if(_124>10){
_124=10;
}
for(var i=0;i<CONST_ALL_ZOOM.length;i++){
if(CONST_ALL_ZOOM[i].id!=null&&parseInt(CONST_ALL_ZOOM[i].level)==this.zoom){
_122=i;
}
if(CONST_ALL_ZOOM[i].id!=null&&parseInt(CONST_ALL_ZOOM[i].level)==_124){
_123=i;
}
if(_123!=-100&&_122!=-1){
break;
}
}
this.thumb_pos=_123;
if(_122!=-1){
this.zoom_properties.properties=CONST_ALL_ZOOM[_122];
this.reinitMapTileContainer();
}
if(typeof (info_panel)!="undefined"&&typeof (info_panel.onZoom)=="function"){
info_panel.onZoom(this.zoom);
}
if(this.map_thumbnail_widget!=null&&_123!=-100){
this.changeZoomLevel_xThumb();
}
},virtualZoomFinish:function(){
if(this.zooming_timeout!=null){
clearTimeout(this.zooming_timeout);
}
this.virtualZoomingClick();
while(this.map_tile_container.smooth_zoom_div.childNodes.length>0){
this.map_tile_container.smooth_zoom_div.childNodes[0].src="";
this.map_tile_container.smooth_zoom_div.removeChild(this.map_tile_container.smooth_zoom_div.childNodes[0]);
}
},virtualZoomingClick:function(){
while(this.map_tile_container.smooth_zoom_div.childNodes.length>0){
this.map_tile_container.smooth_zoom_div.childNodes[0].src="";
this.map_tile_container.smooth_zoom_div.removeChild(this.map_tile_container.smooth_zoom_div.childNodes[0]);
}
this.map_tile_container.smooth_zoom_div2.style.display="none";
this.map_tile_container.smooth_zoom_div.style.display="none";
if(ie){
this.changeZoomLevel_x(this.tmp_level,this.tmp_trans);
}
},vartualZooming2:function(step,dir,w,h,l,t,_12c){
clearTimeout(this.zooming_timeout);
w=w+this.zwidth_margin;
h=h+this.zwidth_margin;
if(dir==1){
this.map_tile_container.smooth_zoom_div.style.left=(this.map_tile_container.smooth_zoom_div.offsetLeft-l)+"px";
this.map_tile_container.smooth_zoom_div.style.top=(this.map_tile_container.smooth_zoom_div.offsetTop-t)+"px";
}else{
this.map_tile_container.smooth_zoom_div.style.left=(this.map_tile_container.smooth_zoom_div.offsetLeft+l)+"px";
this.map_tile_container.smooth_zoom_div.style.top=(this.map_tile_container.smooth_zoom_div.offsetTop+t)+"px";
}
this.map_tile_container.smooth_zoom_div.style.width=(this.tile_num_x*w)+"px";
this.map_tile_container.smooth_zoom_div.style.height=(this.tile_num_y*h)+"px";
if(step==1){
this.map_tile_container.smooth_zoom_div2.style.display="none";
this.map_tile_container.smooth_zoom_div.style.display="none";
this.virtualZoomFinish();
}else{
step=step-1;
this.zooming_timeout=setTimeout((function(){
this.vartualZooming2(step,dir,w,h,l,t,_12c);
}).bind(this),5);
}
},virtualZoomingT2:function(dir,lm){
this.zoom_step=6;
this.zwidth_margin=0;
var _12f=0;
if(dir==1){
_12f=200*(lm+1);
this.zwidth_margin=Math.ceil((_12f-200)/this.zoom_step);
}else{
_12f=200/(lm+1);
this.zwidth_margin=Math.ceil(((200-_12f)/this.zoom_step)*-1);
}
if(_12f==0){
return;
}
this.map_tile_container.smooth_zoom_div.style.width=(this.tile_num_x*_12f)+"px";
this.map_tile_container.smooth_zoom_div.style.height=(this.tile_num_y*_12f)+"px";
var ll=Math.abs(this.map_tile_container.l);
var tt=Math.abs(this.map_tile_container.t);
var x1=Math.ceil((this.container.offsetWidth/2)+Math.abs(ll));
var y1=Math.ceil((this.container.offsetHeight/2)+Math.abs(tt));
if(dir==1){
var _134=Math.ceil(((x1*lm)+ll)*-1);
var _135=Math.ceil(((y1*lm)+tt)*-1);
var _136=Math.abs(_134)-ll;
var _137=Math.abs(_135)-tt;
}else{
var _134=Math.ceil(((ll/lm)-((x1)/(2)))*-1);
var _135=Math.ceil(((tt/lm)-((y1)/(2)))*-1);
var _136=Math.abs(_134)+ll;
var _137=Math.abs(_135)+tt;
}
var _138=Math.ceil(_136/this.zoom_step);
var _139=Math.ceil(_137/this.zoom_step);
if(isNaN(_138)||isNaN(_139)||_138=="Infinity"||_139=="Infinity"){
this.map_tile_container.smooth_zoom_div2.style.display="none";
this.map_tile_container.smooth_zoom_div.style.display="none";
this.virtualZoomFinish();
return false;
}
this.map_tile_container.smooth_zoom_div.onmousedown=this.virtualZoomingClick.bindAsEventListener(this);
this.vartualZooming2(this.zoom_step,dir,200,200,_138,_139,0);
},virtualZoomInit:function(dir,lm){
if(this.zooming_timeout!=null){
clearTimeout(this.zooming_timeout);
}
var _13c=null;
while(this.map_tile_container.smooth_zoom_div.childNodes.length>0){
this.map_tile_container.smooth_zoom_div.childNodes[0].src="";
this.map_tile_container.smooth_zoom_div.removeChild(this.map_tile_container.smooth_zoom_div.childNodes[0]);
}
this.map_tile_container.smooth_zoom_div.style.display="";
this.map_tile_container.smooth_zoom_div2.style.display="";
for(var y=0;y<this.tile_num_y;y++){
for(var x=0;x<this.tile_num_x;x++){
_13c=this.tiles[x][y].image.cloneNode(false);
_13c.id=this.tiles[x][y].image.id.replace("tile_","zooming_");
_13c.style.width=Math.floor(100/this.tile_num_x)+"%";
_13c.style.height=Math.floor(100/this.tile_num_y)+"%";
_13c.width=Math.floor(100/this.tile_num_x)+"%";
_13c.height=Math.floor(100/this.tile_num_y)+"%";
_13c.style.position="static";
this.map_tile_container.smooth_zoom_div.appendChild(_13c);
}
}
this.virtualZoomingT2(dir,lm);
},changeZoomLevel:function(_13f,_140){
if(this.map_id==1&&(typeof (_140)=="undefined"||_140)){
this.tmp_level=_13f;
this.tmp_trans=_140;
if(parseInt(this.zoom)>parseInt(_13f)){
this.map_tile_container.smooth_zoom_div.style.left=(this.map_tile_container.l+(this.container.offsetWidth/40))+"px";
this.map_tile_container.smooth_zoom_div.style.top=(this.map_tile_container.t+(this.container.offsetWidth/40))+"px";
var _141=(_13f-this.zoom);
if(_141<=1){
this.virtualZoomInit(1,(this.zoom-_13f));
}
}else{
this.map_tile_container.smooth_zoom_div.style.left=(this.map_tile_container.l)+"px";
this.map_tile_container.smooth_zoom_div.style.top=(this.map_tile_container.t)+"px";
var _141=(this.zoom-_13f);
if(_141<=1){
this.virtualZoomInit(0,(_13f-this.zoom));
}
}
}else{
if(ie){
this.changeZoomLevel_x(_13f,_140);
}
}
if(!ie){
this.changeZoomLevel_x(_13f,_140);
}
if(this.on_zoom_external_listener.length>0){
for(var i=0;i<this.on_zoom_external_listener.length;i++){
this.on_zoom_external_listener[i]();
}
}
return false;
},optimizeMapViewByCoorBoundary:function(_143){
try{
if(_143==null||typeof (_143)=="undefined"||_143.length!=4||this.container==null){
return false;
}
var _144=_143[0];
var _145=_143[2];
var _146=_143[3];
var _147=_143[1];
var _148=(_145-_144);
var _149=(_147-_146);
var _14a=Math.ceil((_148)/2);
var _14b=Math.ceil((_149)/2);
var _14c=0;
var _14d=_148/this.container.offsetWidth;
var _14e=_149/this.container.offsetHeight;
if(_148>_149){
_14c=1;
}else{
if(_149>_148){
_14c=2;
}
}
var _14f=[];
var _150=[];
var rate=1;
for(var i=0;i<CONST_ALL_ZOOM.length;i++){
switch(_14c){
case 1:
case 0:
if(parseFloat(CONST_ALL_ZOOM[i].glg1_per_px)>_14d){
_14f.push(parseInt(CONST_ALL_ZOOM[i].level));
_150.push(parseFloat(CONST_ALL_ZOOM[i].glg1_per_px));
rate=_14d;
}
break;
case 2:
if(parseFloat(CONST_ALL_ZOOM[i].gla1_per_px)>_14e){
_14f.push(parseInt(CONST_ALL_ZOOM[i].level));
_150.push(parseFloat(CONST_ALL_ZOOM[i].gla1_per_px));
rate=_14e;
}
break;
}
}
var _153=0;
var pos=-1;
var plus=0;
if(_14f.length>0){
_153=100;
for(var i=0;i<_14f.length;i++){
if(_14f[i]<_153){
_153=_14f[i];
pos=i;
}
}
}
if((rate/_150[pos])>0.5){
plus=1;
}
this.changeZoomLevel((_153+plus),false);
if(this.map_control!=null){
this.map_control.setZoomLevel(this.zoom);
}
this.centMapByLnLa(parseInt(_144)+parseInt(_14a),parseInt(_147)-parseInt(_14b),false);
}
catch(e){
return false;
}
},locateTile:function(obj,x,y,l,t,d,ll,tt){
obj.image.style.left=ll+"px";
obj.image.style.top=tt+"px";
obj.updatePos(this.left_top_x+x,this.left_top_y+y,this.zoom);
},moveLeft:function(){
l=this.left_top_l;
t=this.left_top_t;
this.left_top_x--;
var o=this.tiles.pop();
if(o){
this.tiles.unshift(o);
for(var i=0;i<o.length;i++){
this.locateTile(o[i],0,i,l,t,1,(l-(this.tile_width*(1))),((i*this.tile_height)+t));
}
}
},moveRight:function(){
l=this.left_top_l;
t=this.left_top_t;
this.left_top_x++;
var o=this.tiles.shift();
this.tiles.push(o);
var x=this.tiles.length-1;
for(var i=0;i<o.length;i++){
this.locateTile(o[i],x,i,l,t,2,(l+(this.tile_width*(x+1))),((i*this.tile_height)+t));
}
},moveTop:function(){
l=this.left_top_l;
t=this.left_top_t;
this.left_top_y--;
for(var i=0;i<this.tiles.length;i++){
var o=this.tiles[i].pop();
this.tiles[i].unshift(o);
this.locateTile(o,i,0,l,t,3,((i*this.tile_width)+l),(t-(this.tile_height*(1))));
}
},moveBottom:function(){
l=this.left_top_l;
t=this.left_top_t;
this.left_top_y++;
var y=this.tiles[0].length-1;
for(var i=0;i<this.tiles.length;i++){
var o=this.tiles[i].shift();
this.tiles[i].push(o);
this.locateTile(o,i,y,l,t,4,((i*this.tile_width)+l),(t+(this.tile_height*(y+1))));
}
},addLoginManager:function(){
this.login_manager=new LoginManager(this);
},addPoint:function(obj){
this.map_tile_container.addPoint(obj);
},addPropertyInfoViewer:function(obj){
this.property_info_viewer=obj;
},addControl:function(obj){
this.map_control=obj;
this.map_control.parent=this;
if(typeof (this.map_control.initDiv)!="function"){
return;
}
this.map_control.initDiv();
if(this.map_control.div!=null){
this.container.appendChild(this.map_control.div_shad);
this.container.appendChild(this.map_control.div);
this.map_control.div.style.left=(this.container.offsetWidth-this.map_control.div.offsetWidth-10)+"px";
this.map_control.div.style.top="10px";
this.map_control.div_shad.style.left=(this.container.offsetWidth-this.map_control.div.offsetWidth-15)+"px";
this.map_control.div_shad.style.top="5px";
this.map_control.div_shad.style.width=(this.map_control.div.offsetWidth+10)+"px";
this.map_control.div_shad.style.height=(this.map_control.div.offsetHeight+10)+"px";
this.map_control.initAction();
}
},addTabs:function(tabs,_16c){
},addTagController:function(obj){
this.tag_controller=obj;
this.tag_controller.initUI();
},addContextMenu:function(obj){
this.map_contextmenu=obj;
this.map_contextmenu.parent=this;
this.container.appendChild(this.map_contextmenu.div);
this.container.appendChild(this.map_contextmenu.div_shad);
},addContextMenuItem:function(obj){
if(this.map_contextmenu!=null){
this.map_contextmenu.addItem(obj);
}
},addMapThumbnailWidget:function(obj){
this.map_thumbnail_widget=obj;
this.map_thumbnail_widget.center_ln=this.center_ln;
this.map_thumbnail_widget.center_la=this.center_la;
var _171=-100;
var _172=parseInt(this.zoom)+parseInt(this.thumbnail_zoom_level);
if(_172>10){
_172=10;
}
for(var i=0;i<CONST_ALL_ZOOM.length;i++){
if(CONST_ALL_ZOOM[i].id!=null&&parseInt(CONST_ALL_ZOOM[i].level)==_172){
_171=i;
break;
}
}
this.thumb_pos=_171;
this.map_thumbnail_widget.zoom=_172;
this.map_thumbnail_widget.zoom_properties=CONST_ALL_ZOOM[_171];
this.map_thumbnail_widget.initDiv();
},addWidgetController:function(obj){
this.map_widget_controller=obj;
this.map_widget_controller.initDiv();
},addWidget:function(url){
if(this.map_widget_controller!=null){
this.map_widget_controller.addWidget(url);
}
},moveByLTMargin:function(_176,_177){
left_final=this.map_tile_container.div.offsetLeft+_176;
top_final=this.map_tile_container.div.offsetTop+_177;
this.map_tile_container.div.style.left=left_final+"px";
this.map_tile_container.div.style.top=top_final+"px";
},transformByLTMargin:function(_178,_179,_17a){
if(_17a!=null&&_17a){
this.map_tile_container.move_act_from_thumb=true;
}
left_final=this.map_tile_container.div.offsetLeft+_178;
top_final=this.map_tile_container.div.offsetTop+_179;
if(this.map_tile_container.transforming){
while(!this.map_tile_container.transforming){
this.map_tile_container.interrupt=true;
}
this.map_tile_container.interrupt=false;
}
if(typeof (drag_start_listener)=="function"){
drag_start_listener();
}
this.map_tile_container.transformLayer(left_final,top_final,this.map_tile_container.div,this.map_tile_container.trans_duration,this.map_tile_container.trans_step,this.map_tile_container.afterTransformDblclick3.bind(this.map_tile_container),this.map_tile_container.preTransformDblclick.bind(this.map_tile_container));
},contextmenuHandler:function(evt){
if(typeof (this.map_contextmenu)=="undefined"){
return false;
}
if(this.map_contextmenu==null||this.map_contextmenu.div==null){
return false;
}
e=this.getEvt(evt);
if(e[1].id!=null&&e[1].id.lastIndexOf("_"+this.map_id)==(e[1].id.length-2)&&e[1].id.indexOf("tile_")==0){
this.map_contextmenu.showMenu(e[1],e[0].clientX,e[0].clientY);
}
return false;
},containerClickHandler:function(evt){
e=this.getEvt(evt);
if(e[0].button==0&&typeof (this.map_contextmenu)!="undefined"){
if(this.map_contextmenu.div!=null){
if(e[1].id.indexOf("context_menu_")==-1){
this.map_contextmenu.hideMenu();
}
}
}
},removeAllPoint:function(){
this.map_tile_container.removeAllPoint();
},removeMapPointGroup:function(_17d){
this.map_tile_container.removeMapPointGroup(_17d);
},removeMapPoint:function(p){
this.map_tile_container.removePoint(p);
},searchPoint:function(p){
return this.map_tile_container.searchPoint(p);
},initMapThumbnailWidgetUI:function(obj){
this.detachCopyrightText();
this.map_tile_container.dbl_click_enable=false;
},switchSelectMode:function(mode){
try{
switch(mode){
case 1:
case "1":
this.container.removeChild(this.grid_selector_layer);
this.container.className="map";
break;
case 2:
case "2":
this.container.appendChild(this.grid_selector_layer);
this.grid_selector_layer.onmousedown=this.gridSelectMouseDown.bindAsEventListener(this);
this.grid_selector_layer.onmousemove=this.gridSelectMouseMove.bindAsEventListener(this);
this.grid_selector_layer.onmouseup=this.gridSelectMouseUp.bindAsEventListener(this);
this.grid_activated=false;
this.container.className="map_grid";
break;
}
}
catch(e){
}
},gridSelectMouseDown:function(evt){
e=this.getEvt(evt);
this.grid_selector_correct_button=false;
this.grid_moved=false;
this.grid_selector_obj=e[1];
this.grid_selector_event_button=e[0].button;
if(ie){
if(this.grid_selector_event_button==1){
this.grid_selector_correct_button=true;
this.grid_activated=true;
}
}else{
if(this.grid_selector_event_button==0){
this.grid_selector_correct_button=true;
this.grid_activated=true;
}
}
this.grid_selector_margin_x=0;
this.grid_selector_margin_y=0;
if(this.grid_activated){
this.grid_selector_layer.appendChild(this.grid_selector_drag);
this.grid_selector_drag.style.width="0px";
this.grid_selector_drag.style.height="0px";
this.grid_selector_move_flag=true;
this.grid_selector_moved=false;
this.grid_selector_x1=e[0].clientX+document.body.scrollLeft-this.container_left;
this.grid_selector_y1=e[0].clientY+document.body.scrollTop-this.container_top;
this.grid_selector_drag.style.display="";
}
},gridSelectMouseMove:function(evt){
if(this.grid_activated){
e=this.getEvt(evt);
this.grid_selector_obj=e[1];
this.grid_selector_event_button=e[0].button;
if(!this.grid_selector_move_flag||!this.grid_selector_correct_button){
return;
}
this.grid_selector_x2=e[0].clientX+document.body.scrollLeft-this.container_left;
this.grid_selector_y2=e[0].clientY+document.body.scrollTop-this.container_top;
if(this.grid_selector_x1>this.grid_selector_x2){
this.grid_selector_minx=this.grid_selector_x2;
this.grid_selector_maxx=this.grid_selector_x1;
}else{
this.grid_selector_minx=this.grid_selector_x1;
this.grid_selector_maxx=this.grid_selector_x2;
}
if(this.grid_selector_y1>this.grid_selector_y2){
this.grid_selector_miny=this.grid_selector_y2;
this.grid_selector_maxy=this.grid_selector_y1;
}else{
this.grid_selector_miny=this.grid_selector_y1;
this.grid_selector_maxy=this.grid_selector_y2;
}
this.grid_selector_drag.style.left=(this.grid_selector_minx)+"px";
this.grid_selector_drag.style.top=(this.grid_selector_miny)+"px";
this.grid_selector_drag.style.width=Math.abs(this.grid_selector_maxx-this.grid_selector_minx-this.grid_selector_margin_x)+"px";
var h=Math.abs(this.grid_selector_maxy-this.grid_selector_miny-this.grid_selector_margin_y);
if(h==0){
h=1;
}
this.grid_selector_drag.style.height=h+"px";
this.grid_moved=true;
}
},gridSelectMouseUp:function(evt){
if(!this.grid_activated&&!this.grid_moved){
this.removeRangeLayer();
return;
}
if(this.grid_selector_drag.offsetWidth==0||this.grid_selector_drag.offsetHeight==0){
this.removeRangeLayer();
return;
}
this.grid_activated=false;
this.grid_moved=false;
var l=this.getOffset(this.grid_selector_drag,true);
var t=this.getOffset(this.grid_selector_drag,false);
var _188=l+Math.ceil(this.grid_selector_drag.offsetWidth/2);
var _189=t+Math.ceil(this.grid_selector_drag.offsetHeight/2);
var c=this.getCoorByXYAxis(_188,_189);
var _18b=this.container.offsetWidth;
var _18c=this.container.offsetHeight;
var zoom=this.zoom;
var _18e=this.grid_selector_drag.offsetWidth/this.zoom_properties.properties.total_x_px;
var _18f=this.grid_selector_drag.offsetHeight/this.zoom_properties.properties.total_y_px;
var _190=CONST_ALL_ZOOM;
var _191=1000000;
var _192=this.zoom;
var _193=1000000;
var _194=this.zoom;
for(var i=0;i<_190.length;i++){
_190[i].m_x=(_18b/_190[i].total_x_px)-_18e;
if(_190[i].m_x<_191&&_190[i].m_x>0){
_191=_190[i].m_x;
_192=_190[i].level;
}
_190[i].m_y=(_18c/_190[i].total_y_px)-_18f;
if(_190[i].m_y<_193&&_190[i].m_y>0){
_193=_190[i].m_y;
_194=_190[i].level;
}
}
this.removeRangeLayer();
this.centMapByLnLa(c[0],c[1],false);
var diff=_192-_194;
if(diff==0||diff>0){
this.changeZoomLevel(_192,false);
}else{
this.changeZoomLevel(_194,false);
}
if(this.map_control!=null&&typeof (this.map_control.setZoomLevel)=="function"){
this.map_control.setZoomLevel(this.zoom);
}
},removeRangeLayer:function(){
try{
this.grid_selector_layer.removeChild(this.grid_selector_drag);
}
catch(e){
}
}};
var MapGrid=Class.create();
MapGrid.prototype={grid_item_width:100,grid_item_height:50,initialize:function(p){
this.parent=p;
this.num_x=Math.ceil(parseInt(this.parent.map_tile_container.div.offsetWidth)/this.grid_item_width);
this.num_y=Math.ceil(parseInt(this.parent.map_tile_container.div.offsetHeight)/this.grid_item_height);
},getGridObj:function(){
this.div=window.document.createElement("DIV");
w=this.num_x*this.grid_item_width+this.num_x;
h=this.num_y*this.grid_item_height+this.num_y;
this.div.style.width=w+"px";
this.div.style.height=h+"px";
this.div.style.position="absolute";
this.div.style.left="0px";
this.div.style.top="0px";
this.div.style.zIndex="1000";
this.div.id="grid_master";
this.html="";
l=0;
t=0;
for(var y=0;y<this.num_y;y++){
for(var x=0;x<this.num_x;x++){
l=x*this.grid_item_width;
div_l=window.document.createElement("DIV");
div_l.style.left=l+"px";
div_l.style.top=t+"px";
div_l.style.position="absolute";
div_l.style.width=this.grid_item_width+"px";
div_l.style.height=this.grid_item_height+"px";
div_l.style.border="1px #DDDDDD solid";
div_l.id="grid_"+x+"_"+y;
div_l.className="test";
div_l.style.display="none";
this.div.appendChild(div_l);
}
t=t+this.grid_item_height;
}
return this.div;
}};
var MapContextMenu=Class.create();
MapContextMenu.prototype={items:null,initialize:function(){
this.items=new Array();
this.parent=null;
this.initDiv();
},initDiv:function(){
this.div=window.document.createElement("div");
this.div.style.position="absolute";
this.div.style.left="0px";
this.div.style.top="0px";
this.div.style.width="180px";
this.div.style.height="100px";
this.div.style.zIndex="2000";
this.div.style.display="none";
this.div.id="context_menu_div";
htm="<table width=\"180\" border=\"0\" cellpadding=\"2\" cellspacing=\"1\" bgcolor=\"#CCCCCC\">";
htm+="  <tr>";
htm+="    <td bgcolor=\"#FFFFFF\" id=\"context_menu_item_list\">--</td>";
htm+="  </tr>";
htm+="</table>";
this.div.innerHTML=htm;
this.div_shad=window.document.createElement("div");
this.div_shad.style.position="absolute";
this.div_shad.style.left="8px";
this.div_shad.style.top="8px";
this.div_shad.style.width="180px";
this.div_shad.style.height="100px";
this.div_shad.style.display="none";
this.div_shad.style.zIndex="1900";
this.div_shad.style.backgroundColor="#999999";
this.div_shad.id="context_menu_shad";
this.div_shad.className="msgshad";
htm="&nbsp;";
this.div_shad.innerHTML=htm;
},searchGroup:function(_19a){
for(var i=0;i<this.items.length;i++){
if(this.items[i][0]!=null&&this.items[i][0]==gname){
return this.items[i];
}
}
return null;
},deleteItemByObject:function(obj){
for(var i=0;i<this.items.length;i++){
if(this.items[i][0]!=null&&this.items[i][0]==obj.group){
var pos=-1;
for(var y=0;y<this.items[i].arr.length;y++){
if(this.items[i][1][y]==obj){
pos=y;
break;
}
}
if(pos!=-1){
return this.items[i][1].splice(pos,1);
}
}
}
return null;
},sortItems:function(a,b){
if(a.k>b.k){
return 1;
}
if(a.k<b.k){
return -1;
}
return 0;
},addItem:function(obj){
if(obj.text!=null&&obj.action!=null&&obj.group!=null){
obj.text.replace("<img","<img width='20px' height='20px'");
this.items.push({"k":obj.group,"o":obj});
this.items.sort(this.sortItems);
}
},displayItems:function(){
var obj=$("context_menu_item_list");
obj.innerHTML="";
if(this.items.length==0){
obj.innerHTML="&nbsp;";
}
var _1a4="";
for(var i=0;i<this.items.length;i++){
var _1a6=document.createElement("div");
_1a6.className="context_header_text";
if(this.items[i].k!=_1a4){
if(i!=0){
xx=document.createElement("hr");
obj.appendChild(xx);
}
_1a6.innerHTML=this.items[i].k;
}
obj.appendChild(_1a6);
this.items[i].o.layer=document.createElement("a");
this.items[i].o.layer.className="context_item_text";
this.items[i].o.layer.innerHTML=this.items[i].o.text;
this.items[i].o.layer.href="javascript:a()";
this.items[i].o.layer.onclick=this.items[i].o.action;
obj.appendChild(this.items[i].o.layer);
_1a4=this.items[i].k;
}
},testing:function(){
alert("ttt");
},showMenu:function(obj,x,y){
this.parent.context_menu_x=x;
this.parent.context_menu_x=y;
var tmp=this.parent.calCoorByObj(obj,x,y);
this.parent.context_menu_ln=tmp[0];
this.parent.context_menu_la=tmp[1];
this.displayItems();
this.div.style.display="";
this.div.style.left=(x-this.parent.getOffset(this.parent.container,true))+"px";
this.div.style.top=(y-this.parent.getOffset(this.parent.container,false))+"px";
this.div.style.height=this.div.childNodes[0].offsetHeight+"px";
this.div_shad.style.display="";
this.div_shad.style.left=(x-this.parent.getOffset(this.parent.container,true)+5)+"px";
this.div_shad.style.top=(y-this.parent.getOffset(this.parent.container,false)+5)+"px";
this.div_shad.style.height=this.div.childNodes[0].offsetHeight+"px";
},hideMenu:function(){
this.div.style.display="none";
this.div_shad.style.display="none";
}};



var MapThumbnailWidget = Class.create();
MapThumbnailWidget.prototype = {
	initialize : function(map)
	{
		this.his_zoom_viewer = false;
		this.toolbar_height = 0;
		this.map = map;
		this.center_ln = 0;
		this.center_la = 0;
		//this.district_list = [{"id":"-1","eng":"Select District:","htm":"","id_arr":null}, {"id":"1","eng":"Hong Kong","htm":"", "id_arr":null}, {"id":"2","eng":"Kowloon","htm":"", "id_arr":null}, {"id":"3","eng":"New Territories","htm":""}, {"id":"4","eng":"Outlying Islands","htm":"", "id_arr":null}];
		this.district_list = [{"id":"-1","eng":"Select District:","htm":"","id_arr":null}, {"id":"1","eng":"Hong Kong","htm":"", "id_arr":null}];
		this.current_selected_district = -1;
		var image1 = new Image();
		image1.src = "../images/tab_bg_hoz1.gif";
		var image2 = new Image();
		image2.src = "../images/tab_bg_hoz2.gif";		
		this.transform_timeout = null;
		this.hidden = false;
		this.initialized = false;
		this.non_ie_past = false;
		this.current_district = "";
	},	
	initDiv : function()
	{
		
		this.district_list_select = document.createElement("span");
		this.district_list_select.style.display = "none";
		for(var i=1; i<this.district_list.length; i++)
		{
			var new_dist = document.createElement("a");
			new_dist.style.cursor = "pointer";
			new_dist.style.border = "1px #FFFFFF solid";
			//new_dist.style.fontWeight = "bold";
			//new_dist.style.fontSize = "12";
			new_dist.className = "widget_title";
			//new_dist.id = this.district_list[i].eng;
			new_dist.innerHTML = this.district_list[i].eng;
			//new_dist.href= "#";
			new_dist.id = "dist_"+this.district_list[i].id;
			new_dist.onclick = this.districtListClick.bindAsEventListener(this);
			new_dist.onmouseover = this.districtListMouseOver.bindAsEventListener(this);
			new_dist.onmouseout = this.districtListMouseOut.bindAsEventListener(this);			
			//this.districtClick.bindAsEventListener(this)
			this.district_list_select.appendChild(new_dist);

			
			var tmp = document.createElement("span");
			tmp.innerHTML = "&nbsp;&nbsp;";
			tmp.style.cursor = "default";						
			this.district_list_select.appendChild(tmp);
		}		
		this.district_list_select_htm = this.district_list_select.innerHTML;
		this.map_width = Math.ceil(this.map.container.offsetWidth/4);
		this.map_height = Math.ceil(this.map.container.offsetHeight/4);
		if(this.map_width < 100)
		{this.map_width = 100;}
		if(this.map_height < 100)
		{this.map_height = 100;}
		if(this.map_width > 150)
		{this.map_width = 150;}
		if(this.map_height > 150)
		{this.map_height = 150;}
		if(this.map_height != this.map_width)
		{
		if(this.map_height > this.map_width )
		{this.map_height = this.map_width;}
		else
		{this.map_width = this.map_height;}
		}		
		//this.map_width = this.map_width*2;
		this.map_height = this.map_height+this.toolbar_height;
		//this.map_width = 150;
		//this.map_height = 150;
		this.show_dist_htm = '&nbsp;Show&nbsp;District&nbsp;List';
		this.show_dist_htm = '&nbsp;';
		this.hide_dist_htm = 'Hide&nbsp;District&nbsp;List&nbsp;';
		this.hide_dist_htm = '&nbsp;';
		var htm = "";
        htm += '    <table id="map_thumbnail_widget_tbl" width="100%" height="100%" border="0" cellspacing="0" cellpadding="0" bgColor="#FFFFFF" style="border:1px #DDDDDD solid">';
        htm += '      <tr>';
        htm += '        <td colspan="2" id="map_thumbnail_widget_content">';
		htm += '	<table id="map_thumbnail_widget_content_tbl" border=0 cellpadding=0 height="100%">';
		htm += '    	<tr valign="top" align="left">';
		htm += '    		<td id="map_thumbnail_widget_content1" height="15px"></td>';
		htm += '    	</tr>';
		htm += '    	<tr valign="top" align="left">';
		htm += '    		<td id="map_thumbnail_widget_content2"><div></div></td>';
		htm += '    	</tr>';
		htm += '    </table>';
        htm += '        </td>';
        htm += '      </tr>';
        htm += '      <tr style="display:none">';
        htm += '        <td height="20px" width="100%" bgColor="#FFFFFF" class="style1" id="district_listing" align="center" bgColor="#FFFFFF" style="border-top:1px #DDDDDD solid;">'+this.show_dist_htm+'</td>';
        htm += '        <td width="21px" style="border-top:1px #DDDDDD solid; border-left:1px #DDDDDD solid"><img id="thumb_map_close_img" src="images/natvigator3/thumb_map_close.gif" width="21" height="21" bgColor="#FFFFFF"></td>';
        htm += '	</tr>';
        htm += '    </table>';
		this.map_container = window.document.createElement("div");
		this.map_container.id = "map_thumbnail_widget_container";
		this.map_container.className = "map";
		
		this.map.tools_container.appendChild(this.map_container);
		
		this.thumbnail_div = window.document.createElement("div");
		this.thumbnail_div.style.position = "absolute";
		this.thumbnail_div.style.width = (this.map_width+6)+"px";
		this.thumbnail_div.style.height = (this.map_height+6)+"px";
		this.thumbnail_div.style.zIndex = "2000";
		this.thumbnail_div.innerHTML = htm;
		this.thumbnail_div.style.overflow = "visible";
		this.map.tools_container.appendChild(this.thumbnail_div);
		$("map_thumbnail_widget_tbl").style.height = $("map_thumbnail_widget_tbl").parentNode.offsetHeight+"px";
		$("map_thumbnail_widget_tbl").style.width = $("map_thumbnail_widget_tbl").parentNode.offsetWidth+"px";
		this.thumbnail_div.style.left = (parseInt(this.map.container.offsetWidth)-parseInt(this.thumbnail_div.offsetWidth)+1)+"px";
		this.thumbnail_div.style.top = (parseInt(this.map.container.offsetHeight)-parseInt(this.thumbnail_div.offsetHeight)+1)+"px";		
		this.thumbnail_div.className = "opac8";
		var p_obj = $("map_thumbnail_widget_content");
		var mc_obj = this.map_container;
		mc_obj.style.width = (p_obj.offsetWidth-5)+"px";
		mc_obj.style.height = (p_obj.offsetHeight-5-this.toolbar_height)+"px";
		mc_obj.style.left = (this.thumbnail_div.offsetLeft+4)+"px";
		
		mc_obj.style.top = (this.thumbnail_div.offsetTop+5+this.toolbar_height)+"px";

		if(typeof(ie) != "undefined" && ie)
			mc_obj.style.border = "1px #DDDDDD solid";

		
		this.thumbnail_div_open = document.createElement("div");
		this.thumbnail_div_open.style.position = "absolute";
		this.thumbnail_div_open.style.width = (21)+"px";
		this.thumbnail_div_open.style.height = (21)+"px";
		this.thumbnail_div_open.style.zIndex = "20000";		
		//this.thumbnail_div_open.innerHTML = '<img id="thumb_map_open_img" src="images/natvigator3/thumb_map_open.gif" width="21" height="21">';
		this.thumbnail_div_open.innerHTML = '<img id="thumb_map_open_img" src="images/natvigator3/thumb_map_close.gif" width="21" height="21">';
		
		this.thumbnail_div_open.style.border = "1px #DDDDDD solid";
		this.thumbnail_div_open.style.left = (this.map.container.offsetWidth-21)+"px";
		this.thumbnail_div_open.style.top = (this.map.container.offsetHeight-21)+"px";
		//this.thumbnail_div_open.style.display = "none";
		//"images/natvigator3/thumb_map_close.gif"
		this.thumbnail_div_open.style.cursor = "pointer";
		this.thumbnail_div_open.style.backgroundColor = "#FFFFFF";
		this.map.tools_container.appendChild(this.thumbnail_div_open);
		
		this.thumb = new Map(mc_obj, {"map":9, "center_ln": this.center_ln, "center_la": this.center_la, "center_x":1, "center_y":1, "zoom": this.zoom, "draggable" : false}, this.zoom_properties );		
		//this.thumb.map_tile_container.div.className = "opac5";
		this.map_thumbnail_drag = Drag2;
		this.map_thumbnail_border = window.document.createElement("div");
		this.map_thumbnail_border.style.border = "2px #654A00 solid";
		this.map_thumbnail_border.innerHTML = "<img src='images/nbsp.gif' width='100%' height='100%'>";
		this.map_thumbnail_border.style.cursor = "move";
		
		this.map_thumbnail_border_static = window.document.createElement("div");
		this.map_thumbnail_border_static.style.border = "2px #654A00 dashed";	
		this.map_thumbnail_border_static.innerHTML = "<img src='images/nbsp.gif' width='100%' height='100%'>";
		this.map_thumbnail_border_static.style.cursor = "move";	
		
		this.map_thumbnail_border_static2 = window.document.createElement("div");
		this.map_thumbnail_border_static2.style.border = "1px #654A00 solid";	
		//this.map_thumbnail_border_static2.style.backgroundColor = "#805C01";	
		this.map_thumbnail_border_static2.style.backgroundColor = "#C0DFEB";	
		this.map_thumbnail_border_static2.className = "opac3";
		this.map_thumbnail_border_static2.innerHTML = "<img src='images/nbsp.gif' width='100%' height='100%'>";
		this.map_thumbnail_border_static2.style.cursor = "move";						
		this.placeContainer();
		this.map_thumbnail_border.style.zIndex = "1100";
		this.map_thumbnail_border.style.position = "absolute";
		this.map_thumbnail_border_static.style.zIndex = "1001";
		this.map_thumbnail_border_static.style.position = "absolute";
		this.map_thumbnail_border_static2.style.zIndex = "1001";
		this.map_thumbnail_border_static2.style.position = "absolute";		
				
		this.thumb.container.appendChild(this.map_thumbnail_border);
		this.thumb.container.appendChild(this.map_thumbnail_border_static);
		this.thumb.container.appendChild(this.map_thumbnail_border_static2);

		this.map_thumbnail_drag.init(this.map_thumbnail_border, null);	
		this.map_thumbnail_border.minX = this.map_thumbnail_border.offsetWidth*(-1)+2;
		this.map_thumbnail_border.maxX = this.thumb.container.offsetWidth-3;
		this.map_thumbnail_border.minY = this.map_thumbnail_border.offsetHeight*(-1)+2;
		this.map_thumbnail_border.maxY = this.thumb.container.offsetHeight-3;
		
		this.map_thumbnail_border.onDragStart = this.onDragStartEvent.bind(this);
		this.map_thumbnail_border.onDrag = this.onDragEvent.bind(this);
		this.map_thumbnail_border.onDragEnd = this.onDragEndEvent.bind(this);
		
		this.ratio_ln1 = this.thumb.zoom_properties.properties["glg1_per_px"]/this.map.zoom_properties.properties["glg1_per_px"];
		this.ratio_la1 = this.thumb.zoom_properties.properties["gla1_per_px"]/this.map.zoom_properties.properties["gla1_per_px"];
				
		this.thumb.initMapThumbnailWidgetUI(this.map);
		this.thumb.map_tile_container.div.ondblclick = this.thumb.map_tile_container.onDblClickActionTWF.bindAsEventListener(this.thumb.map_tile_container);
		
		this.dist_panel = false;
		this.dist_panel_last = false;
		$("district_listing").onclick = this.toggleDistrictList.bindAsEventListener(this);
		$("district_listing").onmouseover = this.districtListingOver.bindAsEventListener(this);
		$("district_listing").onmouseout = this.districtListingOut.bindAsEventListener(this);
		$("map_thumbnail_widget_content1").innerHTML = "";

		$("map_thumbnail_widget_content1").appendChild(this.district_list_select);
		$("map_thumbnail_widget_content_tbl").style.width = ($("map_thumbnail_widget_content").offsetWidth-this.thumb.container.offsetWidth)+"px";
		$("thumb_map_close_img").onclick = this.closeMap.bindAsEventListener(this);
		$("thumb_map_close_img").style.cursor = "pointer";
		this.initialized = true;
		this.transform_timeout = null;
		this.first_district = true;
		
		this.thumbnail_div_open.onclick = this.toggleMapEventListener.bindAsEventListener(this);
		//this.districtChange2(1);
	},
	initDistrictList : function()
	{
		
	},
	getEvt : function(evt)
	{
		var e = evt ? evt : window.event;
		var src = ((ie)?e.srcElement:e.target);
		return [e, src];	
	},			
	getOffset : function(obj, bool)
	{
		var total=0;
		while(obj!=null)
		{
			total+=obj["offset"+(bool?"Left":"Top")];
			
			obj=obj.offsetParent;
		}
		return total;		
	},	
	resetOnResize : function()
	{
		var hh = this.hidden;
		this.resizeConstruct();
		this.thumb.onResizeConstruct();
		this.map.centerThumbnail();				
		if(hh)
		{
			this.closeMap();
		}
	},
	resizeConstruct : function()
	{
		var tmp = this.dist_panel;
		this.dist_panel = true;
		this.openMap();
		this.placeContainer();
		this.toggleDistrictList();
		if(this.closeMap())
			this.openMap();
		
		if(tmp)
			this.dist_panel = false;
		else
			this.dist_panel = true;

		this.toggleDistrictList();
	},
	openMapLite : function(evt)
	{
		this.thumbnail_div.style.left = (parseInt(this.map.container.offsetWidth)-parseInt($("map_thumbnail_widget_tbl").offsetWidth)+1)+"px";
		this.thumbnail_div.style.top = (parseInt(this.map.container.offsetHeight)-parseInt($("map_thumbnail_widget_tbl").offsetHeight)+1)+"px";		
		this.map_container.style.left = (this.thumbnail_div.offsetLeft+4)+"px";
		this.map_container.style.top = (this.thumbnail_div.offsetTop+5+this.toolbar_height)+"px";
		this.thumbnail_div_open.style.display = "none";	

		return true;
	},	
	transformLayer : function (x,y,obj,duration,steps,mode) 
	{
		if(this.transform_timeout != null)
			clearTimeout(this.transform_timeout);
			
		this.x1 = obj.offsetLeft; 
		this.y1 = obj.offsetTop;
		this.x2 = (this.x1+parseInt(obj.offsetWidth)); 
		this.y2 = (this.y1+parseInt(obj.offsetHeight));	
		
		stepDuration = Math.round(duration/steps);
	
		tx1 = this.x1;
		ty1 = this.y1;
	
		x = (x)?x:tx1;
		y = (y)?y:ty1;
		
		difX = (x - tx1)/steps;  
		difY = (y - ty1)/steps;  
		
		tx1 += difX;
		ty1 += difY;
		
		if(!isNaN(tx1) && !isNaN(ty1) && tx1 != "Infinity" && ty1 != "Infinity" && tx1 != "-Infinity" && ty1 != "-Infinity")
		{
			obj.style.left = tx1+"px";
			obj.style.top = ty1+"px";
			if(this.dist_panel)
				this.map_container.style.left = (tx1+$("map_thumbnail_widget_content_tbl").offsetWidth)+"px";
			else
				this.map_container.style.left = (tx1+4)+"px";

			this.map_container.style.top = (ty1+5+this.toolbar_height)+"px";			
		}
		
		duration = (duration - stepDuration);
		steps--;
		
		if(steps>=0)
		{
			this.transform_timeout = setTimeout( (function() {this.transformLayer(x, y, obj, duration, steps,mode)}).bind(this), stepDuration);
		}
		else
		{
			if(mode)
			{
				if(this.transform_timeout != null)
					clearTimeout(this.transform_timeout);
				
				this.map.changeZoomLevel_xThumb();	
				this.hidden = false;
			}
			else
			{
			
				//this.thumbnail_div_open.onclick = this.openMap.bindAsEventListener(this);
				this.hidden = true;				
			}
		}

		return true;
	},
	toggleMapEventListener : function(evt)
	{
		if(this.thumbnail_div_open.childNodes[0].src.indexOf("images/natvigator3/thumb_map_open.gif") != -1)
		{
			this.thumbnail_div_open.childNodes[0].src = "images/natvigator3/thumb_map_close.gif";
			var l = parseInt(this.map.container.offsetWidth)-parseInt($("map_thumbnail_widget_tbl").offsetWidth)+1;
			var t = parseInt(this.map.container.offsetHeight)-parseInt($("map_thumbnail_widget_tbl").offsetHeight)+1;
			if(this.non_ie_past)
			{
				this.thumbnail_div.style.width = (this.map.container.offsetWidth+2)+"px";
				$("district_listing").innerHTML = this.hide_dist_htm;
				this.district_list_select.style.display = "";
				$("map_thumbnail_widget_tbl").style.width = (this.map.container.offsetWidth+2)+"px";
				$("map_thumbnail_widget_content_tbl").style.width = ($("map_thumbnail_widget_content_tbl").parentNode.offsetWidth-this.map_width)+"px";
				$("map_thumbnail_widget_content2").childNodes[0].style.width = $("map_thumbnail_widget_content2").offsetWidth+"px";
				$("map_thumbnail_widget_content2").childNodes[0].style.height = ($("map_thumbnail_widget_content2").offsetHeight-2)+"px";
				$("map_thumbnail_widget_content2").childNodes[0].style.overflow = "auto";
				$("map_thumbnail_widget_content2").childNodes[0].style.display = "";
				this.dist_panel = true;				
				l = parseInt(this.map.container.offsetWidth)-parseInt($("map_thumbnail_widget_tbl").offsetWidth)+1;
		 		t = parseInt(this.map.container.offsetHeight)-parseInt($("map_thumbnail_widget_tbl").offsetHeight)+1;				
			}
			this.transformLayer(l,t,this.thumbnail_div,20,10, true);		
		}
		else
		{
			this.thumbnail_div_open.childNodes[0].src = "images/natvigator3/thumb_map_open.gif";
			this.dist_panel_last = this.dist_panel;
			var l = this.map.container.offsetWidth;
			var t = this.map.container.offsetHeight;
			this.thumbnail_div_open.style.display = "";
			this.thumbnail_div_open.style.left = (this.map.container.offsetWidth-21)+"px";
			this.thumbnail_div_open.style.top = (this.map.container.offsetHeight-21)+"px";		
			this.non_ie_past = this.dist_panel;
			if(this.dist_panel)
				this.toggleDistrictList();			
			this.transformLayer(l,t,this.thumbnail_div,20,10,false);
		
		}		
	},	
	openMap : function(evt)
	{
		//alert(this.thumbnail_div_open.childNodes[0].src);
		//this.thumbnail_div_open.innerHTML = '<img id="thumb_map_open_img" src="images/natvigator3/thumb_map_open.gif" width="21" height="21">';
		//this.thumbnail_div_open.innerHTML = '<img id="thumb_map_open_img" src="images/natvigator3/thumb_map_close.gif" width="21" height="21">';
		
		//this.thumbnail_div_open

		var l = parseInt(this.map.container.offsetWidth)-parseInt($("map_thumbnail_widget_tbl").offsetWidth)+1;
		var t = parseInt(this.map.container.offsetHeight)-parseInt($("map_thumbnail_widget_tbl").offsetHeight)+1;
		//this.thumbnail_div_open.style.display = "none";	
		if(typeof(evt) == "undefined")
		{
			this.thumbnail_div.style.left = l+"px";
			this.thumbnail_div.style.top = t+"px";		
			this.map_container.style.left = (this.thumbnail_div.offsetLeft+4)+"px";
			this.map_container.style.top = (this.thumbnail_div.offsetTop+5)+"px";
			this.map.changeZoomLevel_xThumb();	
			this.hidden = false;
		}
		else
		{
			if(this.non_ie_past)
			{
				this.thumbnail_div.style.width = (this.map.container.offsetWidth+2)+"px";
				$("district_listing").innerHTML = this.hide_dist_htm;
				this.district_list_select.style.display = "";
				$("map_thumbnail_widget_tbl").style.width = (this.map.container.offsetWidth+2)+"px";
				$("map_thumbnail_widget_content_tbl").style.width = ($("map_thumbnail_widget_content_tbl").parentNode.offsetWidth-this.map_width)+"px";
				$("map_thumbnail_widget_content2").childNodes[0].style.width = $("map_thumbnail_widget_content2").offsetWidth+"px";
				$("map_thumbnail_widget_content2").childNodes[0].style.height = ($("map_thumbnail_widget_content2").offsetHeight-2)+"px";
				$("map_thumbnail_widget_content2").childNodes[0].style.overflow = "auto";
				$("map_thumbnail_widget_content2").childNodes[0].style.display = "";
				this.dist_panel = true;				
				l = parseInt(this.map.container.offsetWidth)-parseInt($("map_thumbnail_widget_tbl").offsetWidth)+1;
		 		t = parseInt(this.map.container.offsetHeight)-parseInt($("map_thumbnail_widget_tbl").offsetHeight)+1;				
			}
			this.transformLayer(l,t,this.thumbnail_div,20,10, true);
		}

		return true;
	},
	closeMap : function(evt)
	{
		this.dist_panel_last = this.dist_panel;
		var l = this.map.container.offsetWidth;
		var t = this.map.container.offsetHeight;
		this.thumbnail_div_open.style.display = "";
		this.thumbnail_div_open.style.left = (this.map.container.offsetWidth-21)+"px";
		this.thumbnail_div_open.style.top = (this.map.container.offsetHeight-21)+"px";		
		if(typeof(evt) == "undefined")
		{		
			this.thumbnail_div.style.left = l+"px";
			this.thumbnail_div.style.top = t+"px";
			this.map_container.style.left = (this.thumbnail_div.offsetLeft+4)+"px";
			this.map_container.style.top = (this.thumbnail_div.offsetTop+5)+"px";		
			//this.thumbnail_div_open.onclick = this.openMap.bindAsEventListener(this);
			this.hidden = true;			
		}
		else
		{
				this.non_ie_past = this.dist_panel;
				if(this.dist_panel)
					this.toggleDistrictList();			
			this.transformLayer(l,t,this.thumbnail_div,20,10,false);
		}

		return true;
	},
	districtListMouseOver : function(evt)
	{
		e = this.getEvt(evt);
		if(e[1] != null)
		{
			e[1].style.backgroundColor = "#FFD966";	
		}
	},
	districtListMouseOut : function(evt)
	{
		e = this.getEvt(evt);
		if(e[1] != null)
		{
			if(e[1].id != this.current_district)
			{
				e[1].style.backgroundColor = "#FFFFFF";	
			}
		}
	},
	districtListClick : function(evt)
	{
		e = this.getEvt(evt);
		if(e[1] != null && e[1].id.indexOf("dist_") != -1)
		{
			var dist = e[1].id.replace("dist_", "");
			this.current_district = e[1].id;
			this.districtChange2(dist);
			for(var i=1; i<this.district_list.length; i++)
			{
				if(this.district_list[i].id == dist)
				{
					$("dist_"+this.district_list[i].id).style.backgroundColor = "#FFD966";	
				}
				else
				{
					$("dist_"+this.district_list[i].id).style.backgroundColor = "#FFFFFF";	
				}
			}
		}
		
	},
	districtListingOver : function()
	{
		$("district_listing").className = "style2";
	},
	districtListingOut : function()
	{
		$("district_listing").className = "style1";		
	},
	placeContainer : function()
	{
		var w = (this.thumb.zoom_properties.properties["total_x_px"]/this.map.zoom_properties.properties["total_x_px"])*this.map.container.offsetWidth;
		var h = (this.thumb.zoom_properties.properties["total_y_px"]/this.map.zoom_properties.properties["total_y_px"])*this.map.container.offsetHeight;
		this.map_thumbnail_border.style.width = Math.ceil(w)+"px";
		this.map_thumbnail_border.style.height = Math.ceil(h)+"px";
		this.map_thumbnail_border_static.style.width = Math.ceil(w)+"px";
		this.map_thumbnail_border_static.style.height = Math.ceil(h)+"px";
		this.map_thumbnail_border_static2.style.width = Math.ceil(w)+"px";
		this.map_thumbnail_border_static2.style.height = Math.ceil(h)+"px";		

		var l = (this.thumb.container.offsetWidth-Math.ceil(w))/2;
		var t = (this.thumb.container.offsetHeight-Math.ceil(h))/2;
		this.border_init_left = Math.ceil(l);
		this.border_init_top = Math.ceil(t);
		
		this.map_thumbnail_border.style.left = this.border_init_left+"px";
		this.map_thumbnail_border.style.top = this.border_init_top+"px";
		this.map_thumbnail_border.style.zIndex = "6000";
		this.map_thumbnail_border.style.position = "absolute";	
		
		this.map_thumbnail_border_static.style.left = this.border_init_left+"px";
		this.map_thumbnail_border_static.style.top = this.border_init_top+"px";
		this.map_thumbnail_border_static.style.zIndex = "5900";
		this.map_thumbnail_border_static.style.position = "absolute";	
		
		this.map_thumbnail_border_static2.style.left = this.border_init_left+"px";
		this.map_thumbnail_border_static2.style.top = this.border_init_top+"px";
		this.map_thumbnail_border_static2.style.zIndex = "5900";
		this.map_thumbnail_border_static2.style.position = "absolute";
	},
	toggleMapPanel : function()
	{
		if(	this.thumbnail_div.style.display == "none")
		{
			this.thumbnail_div.style.display = "";
			this.map_container.style.display = "";
		}
		else
		{
			this.thumbnail_div.style.display = "none";
			this.map_container.style.display = "none";
		}
	},
	toggleDistrictList : function()
	{
		if(this.dist_panel)
		{
			this.thumbnail_div.style.width = (this.map_width+6)+"px";
			$("district_listing").innerHTML = this.show_dist_htm;
			this.district_list_select.style.display = "none";
			$("map_thumbnail_widget_content_tbl").style.width = "0px";
			$("map_thumbnail_widget_tbl").style.width = (this.map_width+6)+"px";
			$("map_thumbnail_widget_content2").childNodes[0].style.display = "none";			
			this.dist_panel = false;
			this.thumbnail_div.style.left = (parseInt(this.map.container.offsetWidth)-parseInt(this.thumbnail_div.offsetWidth)+1)+"px";
			this.thumbnail_div.style.top = (parseInt(this.map.container.offsetHeight)-parseInt(this.thumbnail_div.offsetHeight)+1)+"px";		

		}
		else
		{
			this.thumbnail_div.style.width = (this.map.container.offsetWidth+2)+"px";
			$("district_listing").innerHTML = this.hide_dist_htm;
			this.district_list_select.style.display = "";
			$("map_thumbnail_widget_tbl").style.width = (this.map.container.offsetWidth+2)+"px";
			$("map_thumbnail_widget_content_tbl").style.width = ($("map_thumbnail_widget_content_tbl").parentNode.offsetWidth-this.map_width)+"px";
			$("map_thumbnail_widget_content2").childNodes[0].style.width = $("map_thumbnail_widget_content2").offsetWidth+"px";
			$("map_thumbnail_widget_content2").childNodes[0].style.height = ($("map_thumbnail_widget_content2").offsetHeight-2)+"px";
			$("map_thumbnail_widget_content2").childNodes[0].style.overflow = "auto";
			$("map_thumbnail_widget_content2").childNodes[0].style.display = "";
			this.dist_panel = true;
			this.thumbnail_div.style.left = "-1px";
			this.thumbnail_div.style.top = (parseInt(this.map.container.offsetHeight)-parseInt(this.thumbnail_div.offsetHeight)+1)+"px";		
			if(this.first_district)
			{
				this.districtChange2(1);
				this.first_district = false;
			}

		}

	},
	onDragStartEvent : function(evt)
	{

	},
	onDragEvent : function(evt)
	{
		
	},
	onDragEndEvent : function(evt)
	{
		var l = this.map_thumbnail_border.offsetLeft;
		var t = this.map_thumbnail_border.offsetTop;
		var margin_left = l-this.border_init_left;
		var margin_top = t-this.border_init_top;
		this.thumb.transformByLTMargin((margin_left*-1),(margin_top*-1));
		this.transformBorder(this.border_init_left,this.border_init_top,this.map_thumbnail_border,10,8);
		var r_ln = this.thumb.zoom_properties.properties["glg1_per_px"]/this.map.zoom_properties.properties["glg1_per_px"];
		var r_la = this.thumb.zoom_properties.properties["gla1_per_px"]/this.map.zoom_properties.properties["gla1_per_px"];
		this.map.transformByLTMargin((margin_left*-1*r_ln),(margin_top*-1*r_la), true);
	},
	initDistrictLayout : function()
	{
			for(var i=0; i<this.current_dobj.id_arr.length; i++)
			{
				var o = $("district_"+this.current_dobj.id_arr[i].id);
				if(o != null)
				{
					o.style.cursor = "pointer";
					o.properties = this.current_dobj.id_arr[i];
					o.onmouseover = this.districtMouseOver.bindAsEventListener(this);
					o.onmouseout = this.districtMouseOut.bindAsEventListener(this);
					o.onclick = this.districtClick.bindAsEventListener(this);
					o.ondblclick = this.districtDblClick.bindAsEventListener(this);
				}
			}		
	},	
	districtChange2 : function(pos)
	{
		var selected_district = parseInt(pos);
		if(selected_district != -1)
		{
			var obj = null;
			for(var i=0; i < this.district_list.length; i++)
			{
				if(	parseInt(this.district_list[i].id) == selected_district)
				{
					obj = this.district_list[i];
					this.current_dobj = obj;
				}
			}
			if(obj == null)
			{
				$("map_thumbnail_widget_content2").innerHTML = "";	
				return false;
			}
			
			if(obj.htm == "")
			{
				$("map_thumbnail_widget_content2").childNodes[0].innerHTML = "Loading...";	
				var url = "xml/get_district_list.php?d="+obj.id;
				var ajax_request = new Ajax.Request(
					url, 
					{
						method: 'get', 
						onComplete: this.getDistrictListResponse.bind(this)
					});					
				
			}	
			else
			{
				$("map_thumbnail_widget_content2").childNodes[0].innerHTML = obj.htm;
				this.initDistrictLayout();
			}
		}
		else
		{
			$("map_thumbnail_widget_content2").childNodes[0].innerHTML = "";	
		}
	},	
	districtChange : function(evt)
	{
		var selected_district = parseInt(this.district_list_select.options[this.district_list_select.selectedIndex].value);
		if(selected_district != -1)
		{
			var obj = null;
			for(var i=0; i < this.district_list.length; i++)
			{
				if(	parseInt(this.district_list[i].id) == selected_district)
				{
					obj = this.district_list[i];
					this.current_dobj = obj;
				}
			}
			if(obj == null)
			{
				$("map_thumbnail_widget_content2").innerHTML = "";	
				return false;
			}
			
			if(obj.htm == "")
			{
				
				var url = "xml/get_district_list.php?d="+obj.id;
				var ajax_request = new Ajax.Request(
					url, 
					{
						method: 'get', 
						onComplete: this.getDistrictListResponse.bind(this)
					});					
				
			}	
			else
			{
				$("map_thumbnail_widget_content2").childNodes[0].innerHTML = obj.htm;
				this.initDistrictLayout();
			}
		}
		else
		{
			$("map_thumbnail_widget_content2").childNodes[0].innerHTML = "";	
		}
	},

	getDistrictListResponse : function(req)
	{
		var xml = req.responseXML;
		
		if(xml != null && xml.getElementsByTagName("item").length == 2)
		{
			var data = xml.getElementsByTagName("item");
			if(data[0].firstChild != null)
			{
				$("map_thumbnail_widget_content2").childNodes[0].innerHTML = data[0].firstChild.nodeValue;
				this.current_dobj.htm = data[0].firstChild.nodeValue;
			}
			var temp_arr = null;
			eval(" var temp_arr = "+data[1].firstChild.nodeValue);
			this.current_dobj.id_arr = temp_arr;
			this.initDistrictLayout();
		}
	},
	addThumbnailMapPoint : function (obj)
	{
		if(obj.properties.ln != 0)
		{
			//var coor1 = new MapLatLng({"lat" : 0, "lng" : 0, "gov_lat" : obj.properties.la, "gov_lng" : obj.properties.ln});
			//var frame_src = '';
			var img = "<img src='images/map_point/tiny_1_off.gif'>";
			//var defaultMapPointTopping = new MapPointTopping();
			var tmp_div = window.document.createElement("div");
			tmp_div.style.display = "none";
			tmp_div.style.position = "absolute";
			tmp_div.style.left = "0px";
			tmp_div.style.top = "0px";
			tmp_div.style.width = "100%";
			tmp_div.style.height = "100%";		
			tmp_div.style.zIndex = "1000";
			var htm = '<table width="100%" height="100%" border="0" cellspacing="0" cellpadding="0">';
			htm += '  <tr>';
			htm += '    <td nowrap style="font-size:10px">'+obj.properties.title+'</td>';
			htm += '  </tr>';
			htm += '</table>';
			tmp_div.innerHTML = htm;
			//defaultMapPointTopping.addDiv(tmp_div);		
			//defaultMapPointTopping.align = "center";
			var point1 = new MapPoint2(this.thumb, obj.properties.ln, obj.properties.la, obj.properties.title, "<img src='images/map_point/tiny_1_off.gif'>", null, tmp_div, null, {align:"center"});
			//(point_shad_img_obj, topping_layer_obj, topping_shad_img_obj, topping_display_property)
			//var point1 = new MapPoint(this.thumb, coor1, obj.properties.id, frame_src, img, defaultMapPointTopping);
			this.thumb.addPoint(point1);
			point1.toggleContentSimple();
		}			
	},
	districtMouseOver : function(evt)
	{
		e = this.getEvt(evt);
		var obj = e[1];
		if(obj.properties == null)
			return false;
		
		if(obj.properties.id != this.current_selected_district)
			obj.style.backgroundColor = "#FFD966";	
			
		this.addThumbnailMapPoint(obj);
	},
	districtMouseOut : function(evt)
	{
		e = this.getEvt(evt);
		var obj = e[1];
		if(obj.properties == null)
			return false;
		//if(obj.properties.id != this.current_selected_district)
		obj.style.backgroundColor = "#FFFFFF";	
		this.thumb.removeAllPoint();
	},
	
	districtClick : function(evt)
	{
		e = this.getEvt(evt);
		var obj = e[1];
		if(obj.properties != null && obj.properties.ln != 0)
		{
			if($("district_"+this.current_selected_district) != null)
			{
				$("district_"+this.current_selected_district).style.backgroundColor = "#FFFFFF";
			}
				//$("district_"+this.current_selected_district).className = "districttextoff";
				
			this.current_selected_district = obj.properties.id;
			e[1].style.backgroundColor = "#FFD966";	
			this.map.centMapByLnLa(obj.properties.ln, obj.properties.la, true);
		}		
		
		
	},
	districtDblClick : function(evt)
	{
		e = this.getEvt(evt);
	},
	transformBorder : function (x,y,obj,duration,steps) 
	{
		if(this.transform_timeout != null)
			clearTimeout(this.transform_timeout);
			
		this.x1 = obj.offsetLeft; 
		this.y1 = obj.offsetTop;
		this.x2 = (this.x1+parseInt(obj.offsetWidth)); 
		this.y2 = (this.y1+parseInt(obj.offsetHeight));	
		
		stepDuration = Math.round(duration/steps);
	
		tx1 = this.x1;
		ty1 = this.y1;
	
		x = (x)?x:tx1;
		y = (y)?y:ty1;
		
		difX = (x - tx1)/steps;  
		difY = (y - ty1)/steps;  
		
		tx1 += difX;
		ty1 += difY;
		
		if(!isNaN(tx1) && !isNaN(ty1) && tx1 != "Infinity" && ty1 != "Infinity" && tx1 != "-Infinity" && ty1 != "-Infinity")
		{
			obj.style.left = tx1+"px";
			obj.style.top = ty1+"px";
		}
		
		duration = (duration - stepDuration);
		steps--;
		
		if(steps>=0)
		{
			this.transform_timeout = setTimeout( (function() {this.transformBorder(x, y, obj, duration, steps)}).bind(this), stepDuration);
		}
		else
		{
			if(this.transform_timeout != null)
				clearTimeout(this.transform_timeout);		
				
	
		}
		return true;
	}
}
var MapPoint2=Class.create();
MapPoint2.prototype={initialized:false,topping:null,coor:null,div:null,move_margin_x:1,move_margin_y:10,move_adjust_x:1,move_adjust_y:1,no_reset:false,after_click_action:null,initialize:function(_1,ln,la,_4,_5,_6,_7,_8,_9){
if(_1==null||ln==null||la==null){
return;
}
this.parent=_1;
this.ln=ln;
this.la=la;
this.left_adj=0;
this.top_adj=0;
this.title=_4;
this.topping=_7;
this.topping_shad=_8;
this.topping_display=_9;
this.div=document.createElement("div");
this.div.style.position="absolute";
this.div.title=this.title;
this.div.style.zIndex="900";
if(_5!=null){
if(typeof (_5)=="string"){
this.div.innerHTML=_5;
}else{
this.div.appendChild(_5);
}
if(this.div.childNodes.length>0){
this.div.style.width=this.div.childNodes[0].offsetWidth+"px";
this.div.style.height=this.div.childNodes[0].offsetHeight+"px";
}
}else{
var _a="<img src='images/point1.gif' width='15px' height='15px'>";
this.div.innerHTML=htm;
this.div.style.width="15px";
this.div.style.height="15px";
}
if(this.div.childNodes.length>0){
this.div.childNodes[0].onclick=this.pointClick.bindAsEventListener(this);
}
this.div.onmouseover=this.mouseOverAction.bindAsEventListener(this);
this.div.onmouseout=this.mouseOutAction.bindAsEventListener(this);
this.last_zoom=100;
this.cln=0;
this.cla=0;
this.div_shadow_height=0;
this.div_shadow_width=0;
this.div_shadow=null;
if(_6!=null){
this.div_shadow=_6;
this.div_shadow.id="point_shadow_"+_4;
this.div_shadow.style.position="absolute";
this.div_shadow.style.overflow="visible";
this.div_shadow.style.zIndex="890";
this.div_shadow.style.display="none";
this.div_shadow.className="opac5";
this.parent.map_tile_container.div.appendChild(this.div_shadow);
}
this.topping_appended=false;
this.div_topping_shad=null;
this.div.style.zIndex="900";
},getToppingStatus:function(){
if(this.topping.style.display=="none"){
return false;
}else{
return true;
}
},setPosition:function(_b){
var f=false;
if(_b!=null&&_b){
f=true;
}
if(this.parent.zoom!=this.last_zoom||f){
var _d=this.parent.calClnClaByCoor(this.ln,this.la);
this.cln=_d[0];
this.cla=_d[1];
this.last_zoom=this.parent.zoom;
}
y_pos=Math.floor(this.cla);
y_margin=Math.round((this.cla-y_pos)*this.parent.tile_height);
x_pos=Math.floor(this.cln);
x_margin=Math.round((this.cln-x_pos)*this.parent.tile_width);
if(isNaN(y_pos)||isNaN(y_margin)||isNaN(x_pos)||isNaN(x_margin)){
return;
}
this.tile_obj=$("tile_"+x_pos+"_"+y_pos+"_"+this.parent.zoom+"_"+this.parent.map_id);
this.x_margin=x_margin;
this.y_margin=y_margin;
if(this.tile_obj!=null){
this.div.style.display="";
l=(this.tile_obj.offsetLeft+x_margin+this.left_adj);
t=(this.tile_obj.offsetTop+y_margin+this.top_adj);
this.div.style.left=(l)+"px";
this.top_adjustment=0;
if(this.div.childNodes.length>0){
this.top_adjustment=this.div.childNodes[0].offsetHeight;
}
this.div.style.top=(t-this.top_adjustment)+"px";
if(this.div_shadow!=null){
this.div_shadow.style.display="";
var sl=l;
if(this.topping_display.pt_shad_left!=null&&!isNaN(parseInt(this.topping_display.pt_shad_left))){
sl=sl+parseInt(this.topping_display.pt_shad_left);
}
var st=(t-this.div_shadow.offsetHeight);
if(this.topping_display.pt_shad_top!=null&&!isNaN(parseInt(this.topping_display.pt_shad_top))){
st=st+parseInt(this.topping_display.pt_shad_top);
}
this.div_shadow.style.left=(sl)+"px";
this.div_shadow.style.top=(st)+"px";
this.div_shadow_height=this.div_shadow.offsetHeight;
this.div_shadow_width=this.div_shadow.offsetWidth;
}
if(this.topping!=null&&this.topping.style.display!="none"){
this.setToppingPosition();
}
}else{
this.div.style.display="none";
if(this.div_shadow!=null){
this.div_shadow.style.display="none";
}
if(this.div_topping_shad!=null){
this.div_topping_shad.style.display="none";
}
}
_d=null;
y_pos=null;
y_margin=null;
x_pos=null;
x_margin=null;
},isInSight:function(){
if(this.div.offsetLeft>0&&this.div.offsetTop>0){
return true;
}else{
return false;
}
},isInSight2:function(){
var tw=this.div.offsetWidth;
var th=this.div.offsetHeight;
var tx=this.parent.getOffset(this.div,true);
var ty=this.parent.getOffset(this.div,false);
var cx=this.parent.getOffset(this.parent.container,true);
var cy=this.parent.getOffset(this.parent.container,false);
if(tx>cx&&ty>cy&&(tx+tw)<(cx+this.parent.container.offsetWidth)&&(ty+th)<(cy+this.parent.container.offsetHeight)){
return true;
}else{
return false;
}
},mouseOverAction:function(){
this.div.style.zIndex="1500";
},mouseOutAction:function(){
if(this.topping!=null&&this.topping.style.display==""){
this.div.style.zIndex="1000";
}else{
this.div.style.zIndex="900";
}
},preTransform:function(){
this.parent.map_tile_container.preTransformDblclick();
},fetchContent:function(){
if(this.use_content_url!=null&&this.use_content_url&&this.content_url!=null&&this.content_url!=""){
this.use_content_url=false;
this.content_ajax=new Ajax.Request(this.content_url,{method:"get",onComplete:this.parseContent.bind(this)});
}else{
this.setToppingPosition();
if(this.fitscreen==null){
this.fitToScreen();
}else{
if(this.fitscreen){
this.fitToScreen();
}
}
}
},afterTransform:function(){
if(this.parent.map_tile_container!=null){
this.parent.map_tile_container.afterTransformDblclick();
}
},fitToScreen:function(){
if(this.topping!=null){
offset_y=parseInt(this.parent.getOffset(this.topping,false))-this.parent.container_top-this.move_margin_y;
offset_x=parseInt(this.parent.getOffset(this.topping,true))-this.parent.container_left-this.move_margin_x;
move_y=false;
move_x=false;
container_x2=this.parent.container_left+parseInt(this.parent.container.offsetWidth);
div2_x2=parseInt(this.parent.getOffset(this.topping,true))+parseInt(this.topping.offsetWidth)+this.move_margin_x;
if(offset_y<0){
top_final=this.parent.map_tile_container.div.offsetTop-offset_y+this.move_adjust_y;
move_x=true;
}else{
top_final=this.parent.map_tile_container.div.offsetTop;
}
if(div2_x2>container_x2){
left_final=this.parent.map_tile_container.div.offsetLeft-(div2_x2-container_x2)-this.move_adjust_x;
move_x=true;
}else{
if(offset_x<0){
left_final=this.parent.map_tile_container.div.offsetLeft-offset_x+this.move_adjust_x;
move_x=true;
}else{
left_final=this.parent.map_tile_container.div.offsetLeft;
}
}
if(move_y||move_x){
if(this.parent.map_tile_container.transforming){
while(!this.parent.map_tile_container.transforming){
this.parent.map_tile_container.interrupt=true;
}
this.parent.map_tile_container.interrupt=false;
}
this.parent.map_tile_container.transformLayer(left_final,top_final,this.parent.map_tile_container.div,this.parent.map_tile_container.trans_duration,this.parent.map_tile_container.trans_step,this.afterTransform.bind(this),this.preTransform.bind(this));
}
}
},pointClick:function(){
this.toggleContent(true);
if(this.after_click_action!=null){
this.after_click_action(this);
}
},toppingOpenDiv:function(){
var _16=1;
this.div.style.zIndex="1500";
this.topping.style.display="";
if(this.div_topping_shad!=null){
this.div_topping_shad.style.display="";
}
return _16;
},toppingCloseDiv:function(){
var _17=0;
this.div.style.zIndex="900";
this.topping.style.display="none";
if(this.div_topping_shad!=null){
this.div_topping_shad.style.display="none";
}
return _17;
},hideContent:function(){
if(this.topping!=null){
var _18=this.toppingCloseDiv();
this.div.style.zIndex="900";
}else{
var _18=0;
this.div.style.zIndex="900";
}
return _18;
},resetContent:function(){
var d=this.topping.getElementsByTagName("div");
for(var i=0;i<d.length;i++){
if(d[i].id!=null&&d[i].id.indexOf("content")!=-1){
d[i].innerHTML="";
break;
}
}
},parseContent:function(req){
var htm=req.responseText;
var d=this.topping.getElementsByTagName("div");
for(var i=0;i<d.length;i++){
if(d[i].id!=null&&d[i].id.indexOf("content")!=-1){
d[i].innerHTML=htm;
this.setToppingPosition();
if(this.fitscreen==null){
this.fitToScreen();
}else{
if(this.fitscreen){
this.fitToScreen();
}
}
break;
}
}
},toppingToggleDiv:function(){
if(this.topping!=null&&this.topping_appended==false){
this.topping.style.display="none";
this.topping.style.position="absolute";
this.topping.style.overflow="visible";
this.div.appendChild(this.topping);
if(this.topping_shad!=null){
this.div_topping_shad=this.topping_shad;
this.div_topping_shad.id="content_shadow_"+this.title;
this.div_topping_shad.style.position="absolute";
this.div_topping_shad.style.overflow="visible";
this.div_topping_shad.style.zIndex="890";
this.div_topping_shad.style.display="none";
this.div_topping_shad.className="opac4";
this.parent.map_tile_container.div.appendChild(this.div_topping_shad);
}
this.topping_appended=true;
}
var _1f=0;
if(this.topping.style.display=="none"){
_1f=1;
this.div.style.zIndex="1500";
this.topping.style.display="";
if(this.div_topping_shad!=null){
this.div_topping_shad.style.display="";
}
this.setToppingPosition();
}else{
_1f=0;
this.div.style.zIndex="900";
this.topping.style.display="none";
if(this.div_topping_shad!=null){
this.div_topping_shad.style.display="none";
}
}
return _1f;
},toggleContentSimple:function(){
if(this.topping!=null){
var _20=this.toppingToggleDiv();
if(_20){
this.div.style.zIndex="1500";
}else{
this.div.style.zIndex="900";
}
}
return _20;
},highlight_on:function(){
},highlight_off:function(){
},setToppingPosition:function(){
var l=0;
if(this.topping_display!=null&&this.topping_display.left_px!=null){
l=parseInt(this.topping_display.left_px);
this.topping.style.left=l+"px";
}
if(this.topping_display!=null&&this.topping_display.align!=null){
switch(this.topping_display.align){
case "left":
l+=(parseInt(this.topping.offsetWidth))*(-1);
this.topping.style.left=(l)+"px";
break;
case "right":
l+=0;
this.topping.style.left=(l)+"px";
break;
case "center":
l+=(Math.ceil(parseInt(this.topping.offsetWidth)/2)*(-1)+Math.ceil(this.div.childNodes[0].offsetWidth/2));
this.topping.style.left=(l)+"px";
break;
case "map_point_center":
l+=Math.ceil(this.div.childNodes[0].offsetWidth/2)*(-1);
this.topping.style.left=(l)+"px";
break;
default:
l=0;
this.topping.style.left="0px";
break;
}
}else{
l=0;
this.topping.style.left="0px";
}
if(ie){
var t=(parseInt(this.topping.offsetHeight))*(-1);
}else{
var t=(parseInt(this.topping.childNodes[0].offsetHeight))*(-1);
}
this.topping.style.top=(t)+"px";
if(this.div_topping_shad){
this.div_topping_shad.style.display="";
this.div_topping_shad.style.visibility="visible";
var _23=0;
if(this.topping_display.left_px!=null){
_23=parseInt(this.topping_display.left_px);
if(_23<0){
_23=_23*(-1);
}
}
this.div_topping_shad.style.left=(parseInt(this.tile_obj.offsetLeft)+this.x_margin+this.left_adj+this.div_shadow_width-_23)+"px";
this.div_topping_shad.style.top=(parseInt(this.tile_obj.offsetTop)+this.y_margin+this.top_adj-this.div_topping_shad.offsetHeight-this.div_shadow_height)+"px";
_23=null;
}
l=null;
t=null;
},toggleContent:function(_24){
if(this.topping!=null){
var _25=this.toppingToggleDiv();
if(_25){
this.div.style.zIndex="1500";
this.fitscreen=_24;
this.fetchContent();
}else{
this.div.style.zIndex="900";
}
}else{
if(this.div.childNodes[0].tagName=="IMG"){
if(this.div.childNodes[0].src.indexOf("_on")!=-1){
_25=0;
this.div.style.zIndex="900";
}else{
_25=1;
this.div.style.zIndex="1500";
}
}
}
return _25;
},getCoor:function(){
return new Array(this.ln,this.la);
},setCoorByVal:function(la,ln,gla,gln){
if(gln!=null){
this.ln=gln;
}
if(gla!=null){
this.la=gla;
}
},setTitle:function(_2a){
this.title=_2a;
},hide:function(){
this.div.style.display="none";
if(this.div_shadow!=null){
this.div_shadow.style.display="none";
}
},show:function(){
this.div.style.display="";
}};

var MapPoint3=Class.create();
MapPoint3.prototype={initialized:false,topping:null,coor:null,div:null,move_margin_x:1,move_margin_y:10,move_adjust_x:1,move_adjust_y:1,no_reset:false,after_click_action:null,sub_item_list:[],initialize:function(_1,ln,la,_4,_5,_6,_7,_8,_9){
if(_1==null||ln==null||la==null){
return;
}
this.parent=_1;
this.ln=ln;
this.la=la;
this.left_adj=0;
this.top_adj=0;
this.title=_4;
this.topping=_7;
this.topping_shad=_8;
this.topping_display=_9;
this.div=document.createElement("div");
this.div.style.position="absolute";
this.div.title=this.title;
this.div.style.zIndex="900";
if(_5!=null){
if(typeof (_5)=="string"){
this.div.innerHTML=_5;
}else{
this.div.appendChild(_5);
}
if(this.div.childNodes.length>0){
this.div.style.width=this.div.childNodes[0].offsetWidth+"px";
this.div.style.height=this.div.childNodes[0].offsetHeight+"px";
}
}else{
this.div.innerHTML="&nbsp;";
this.div.style.width="1px";
this.div.style.height="1px";
}
if(this.div.childNodes.length>0){
this.div.childNodes[0].onclick=this.pointClick.bindAsEventListener(this);
}
this.div.onmouseover=this.mouseOverAction.bindAsEventListener(this);
this.div.onmouseout=this.mouseOutAction.bindAsEventListener(this);
this.last_zoom=100;
this.cln=0;
this.cla=0;
this.div_shadow_height=0;
this.div_shadow_width=0;
this.div_shadow=null;
if(_6!=null){
this.div_shadow=_6;
this.div_shadow.id="point_shadow_"+_4;
this.div_shadow.style.position="absolute";
this.div_shadow.style.overflow="visible";
this.div_shadow.style.zIndex="890";
this.div_shadow.style.display="none";
this.div_shadow.className="opac5";
this.parent.map_tile_container.div.appendChild(this.div_shadow);
}
this.topping_appended=false;
this.div_topping_shad=null;
this.div.style.zIndex="900";
},getToppingStatus:function(){
if(this.topping.style.display=="none"){
return false;
}else{
return true;
}
},setPosition:function(_a){
var f=false;
if(_a!=null&&_a){
f=true;
}
if(this.parent.zoom!=this.last_zoom||f){
var _c=this.parent.calClnClaByCoor(this.ln,this.la);
this.cln=_c[0];
this.cla=_c[1];
this.last_zoom=this.parent.zoom;
}
y_pos=Math.floor(this.cla);
y_margin=Math.round((this.cla-y_pos)*this.parent.tile_height);
x_pos=Math.floor(this.cln);
x_margin=Math.round((this.cln-x_pos)*this.parent.tile_width);
if(isNaN(y_pos)||isNaN(y_margin)||isNaN(x_pos)||isNaN(x_margin)){
return;
}
this.tile_obj=$("tile_"+x_pos+"_"+y_pos+"_"+this.parent.zoom+"_"+this.parent.map_id);
this.x_margin=x_margin;
this.y_margin=y_margin;
if(this.tile_obj!=null){
this.div.style.display="";
l=(this.tile_obj.offsetLeft+x_margin+this.left_adj);
t=(this.tile_obj.offsetTop+y_margin+this.top_adj);
this.div.style.left=(l)+"px";
this.top_adjustment=0;
if(this.div.childNodes.length>0){
this.top_adjustment=this.div.childNodes[0].offsetHeight;
}
this.div.style.top=(t-this.top_adjustment)+"px";
if(this.div_shadow!=null){
this.div_shadow.style.display="";
var sl=l;
if(this.topping_display.pt_shad_left!=null&&!isNaN(parseInt(this.topping_display.pt_shad_left))){
sl=sl+parseInt(this.topping_display.pt_shad_left);
}
var st=(t-this.div_shadow.offsetHeight);
if(this.topping_display.pt_shad_top!=null&&!isNaN(parseInt(this.topping_display.pt_shad_top))){
st=st+parseInt(this.topping_display.pt_shad_top);
}
this.div_shadow.style.left=(sl)+"px";
this.div_shadow.style.top=(st)+"px";
this.div_shadow_height=this.div_shadow.offsetHeight;
this.div_shadow_width=this.div_shadow.offsetWidth;
}
if(this.topping!=null&&this.topping.style.display!="none"){
this.setToppingPosition();
}
}else{
this.div.style.display="none";
if(this.div_shadow!=null){
this.div_shadow.style.display="none";
}
if(this.div_topping_shad!=null){
this.div_topping_shad.style.display="none";
}
}
_c=null;
y_pos=null;
y_margin=null;
x_pos=null;
x_margin=null;
},isInSight:function(){
if(this.div.offsetLeft>0&&this.div.offsetTop>0){
return true;
}else{
return false;
}
},isInSight2:function(){
var tw=this.div.offsetWidth;
var th=this.div.offsetHeight;
var tx=this.parent.getOffset(this.div,true);
var ty=this.parent.getOffset(this.div,false);
var cx=this.parent.getOffset(this.parent.container,true);
var cy=this.parent.getOffset(this.parent.container,false);
if(tx>cx&&ty>cy&&(tx+tw)<(cx+this.parent.container.offsetWidth)&&(ty+th)<(cy+this.parent.container.offsetHeight)){
return true;
}else{
return false;
}
},mouseOverAction:function(){
this.div.style.zIndex="1500";
},mouseOutAction:function(){
if(this.topping!=null&&this.topping.style.display==""){
this.div.style.zIndex="1000";
}else{
this.div.style.zIndex="900";
}
},preTransform:function(){
this.parent.map_tile_container.preTransformDblclick();
},fetchContent:function(){
if(this.use_content_url!=null&&this.use_content_url&&this.content_url!=null&&this.content_url!=""){
this.use_content_url=false;
this.content_ajax=new Ajax.Request(this.content_url,{method:"get",onComplete:this.parseContent.bind(this)});
}else{
this.setToppingPosition();
if(this.fitscreen==null){
this.fitToScreen();
}else{
if(this.fitscreen){
this.fitToScreen();
}
}
}
},afterTransform:function(){
if(this.parent.map_tile_container!=null){
this.parent.map_tile_container.afterTransformDblclick();
}
},fitToScreen:function(){
if(this.topping!=null){
offset_y=parseInt(this.parent.getOffset(this.topping,false))-this.parent.container_top-this.move_margin_y;
offset_x=parseInt(this.parent.getOffset(this.topping,true))-this.parent.container_left-this.move_margin_x;
move_y=false;
move_x=false;
container_x2=this.parent.container_left+parseInt(this.parent.container.offsetWidth);
div2_x2=parseInt(this.parent.getOffset(this.topping,true))+parseInt(this.topping.offsetWidth)+this.move_margin_x;
if(offset_y<0){
top_final=this.parent.map_tile_container.div.offsetTop-offset_y+this.move_adjust_y;
move_x=true;
}else{
top_final=this.parent.map_tile_container.div.offsetTop;
}
if(div2_x2>container_x2){
left_final=this.parent.map_tile_container.div.offsetLeft-(div2_x2-container_x2)-this.move_adjust_x;
move_x=true;
}else{
if(offset_x<0){
left_final=this.parent.map_tile_container.div.offsetLeft-offset_x+this.move_adjust_x;
move_x=true;
}else{
left_final=this.parent.map_tile_container.div.offsetLeft;
}
}
if(move_y||move_x){
if(this.parent.map_tile_container.transforming){
while(!this.parent.map_tile_container.transforming){
this.parent.map_tile_container.interrupt=true;
}
this.parent.map_tile_container.interrupt=false;
}
this.parent.map_tile_container.transformLayer(left_final,top_final,this.parent.map_tile_container.div,this.parent.map_tile_container.trans_duration,this.parent.map_tile_container.trans_step,this.afterTransform.bind(this),this.preTransform.bind(this));
}
}
},pointClick:function(){
this.toggleContent(true);
if(this.after_click_action!=null){
this.after_click_action(this);
}
},toppingOpenDiv:function(){
var _15=1;
this.div.style.zIndex="1500";
this.topping.style.display="";
if(this.div_topping_shad!=null){
this.div_topping_shad.style.display="";
}
return _15;
},toppingCloseDiv:function(){
var _16=0;
this.div.style.zIndex="900";
this.topping.style.display="none";
if(this.div_topping_shad!=null){
this.div_topping_shad.style.display="none";
}
return _16;
},hideContent:function(){
if(this.topping!=null){
var _17=this.toppingCloseDiv();
this.div.style.zIndex="900";
}else{
var _17=0;
this.div.style.zIndex="900";
}
return _17;
},resetContent:function(){
var d=this.topping.getElementsByTagName("div");
for(var i=0;i<d.length;i++){
if(d[i].id!=null&&d[i].id.indexOf("content")!=-1){
d[i].innerHTML="";
break;
}
}
},parseContent:function(req){
var htm=req.responseText;
var d=this.topping.getElementsByTagName("div");
for(var i=0;i<d.length;i++){
if(d[i].id!=null&&d[i].id.indexOf("content")!=-1){
d[i].innerHTML=htm;
this.setToppingPosition();
if(this.fitscreen==null){
this.fitToScreen();
}else{
if(this.fitscreen){
this.fitToScreen();
}
}
break;
}
}
},toppingToggleDiv:function(){
if(this.topping!=null&&this.topping_appended==false){
this.topping.style.display="none";
this.topping.style.position="absolute";
this.topping.style.overflow="visible";
this.div.appendChild(this.topping);
if(this.topping_shad!=null){
this.div_topping_shad=this.topping_shad;
this.div_topping_shad.id="content_shadow_"+this.title;
this.div_topping_shad.style.position="absolute";
this.div_topping_shad.style.overflow="visible";
this.div_topping_shad.style.zIndex="890";
this.div_topping_shad.style.display="none";
this.div_topping_shad.className="opac4";
this.parent.map_tile_container.div.appendChild(this.div_topping_shad);
}
this.topping_appended=true;
}
var _1e=0;
if(this.topping.style.display=="none"){
_1e=1;
this.div.style.zIndex="1500";
this.topping.style.display="";
if(this.div_topping_shad!=null){
this.div_topping_shad.style.display="";
}
this.setToppingPosition();
}else{
_1e=0;
this.div.style.zIndex="900";
this.topping.style.display="none";
if(this.div_topping_shad!=null){
this.div_topping_shad.style.display="none";
}
}
return _1e;
},toggleContentSimple:function(){
if(this.topping!=null){
var _1f=this.toppingToggleDiv();
if(_1f){
this.div.style.zIndex="1500";
}else{
this.div.style.zIndex="900";
}
}
return _1f;
},highlight_on:function(){
},highlight_off:function(){
},setToppingPosition:function(){
var l=0;
if(this.topping_display!=null&&this.topping_display.left_px!=null){
l=parseInt(this.topping_display.left_px);
this.topping.style.left=l+"px";
}
if(this.topping_display!=null&&this.topping_display.align!=null){
switch(this.topping_display.align){
case "left":
l+=(parseInt(this.topping.offsetWidth))*(-1);
this.topping.style.left=(l)+"px";
break;
case "right":
l+=0;
this.topping.style.left=(l)+"px";
break;
case "center":
l+=(Math.ceil(parseInt(this.topping.offsetWidth)/2)*(-1)+Math.ceil(this.div.childNodes[0].offsetWidth/2));
this.topping.style.left=(l)+"px";
break;
case "map_point_center":
l+=Math.ceil(this.div.childNodes[0].offsetWidth/2)*(-1);
this.topping.style.left=(l)+"px";
break;
default:
l=0;
this.topping.style.left="0px";
break;
}
}else{
l=0;
this.topping.style.left="0px";
}
if(ie){
var t=(parseInt(this.topping.offsetHeight))*(-1);
}else{
var t=(parseInt(this.topping.childNodes[0].offsetHeight))*(-1);
}
this.topping.style.top=(t)+"px";
if(this.div_topping_shad){
this.div_topping_shad.style.display="";
this.div_topping_shad.style.visibility="visible";
var _22=0;
if(this.topping_display.left_px!=null){
_22=parseInt(this.topping_display.left_px);
if(_22<0){
_22=_22*(-1);
}
}
this.div_topping_shad.style.left=(parseInt(this.tile_obj.offsetLeft)+this.x_margin+this.left_adj+this.div_shadow_width-_22)+"px";
this.div_topping_shad.style.top=(parseInt(this.tile_obj.offsetTop)+this.y_margin+this.top_adj-this.div_topping_shad.offsetHeight-this.div_shadow_height)+"px";
_22=null;
}
l=null;
t=null;
},toggleContent:function(_23){
if(this.topping!=null){
var _24=this.toppingToggleDiv();
if(_24){
this.div.style.zIndex="1500";
this.fitscreen=_23;
this.fetchContent();
}else{
this.div.style.zIndex="900";
}
}else{
if(this.div.childNodes[0].tagName=="IMG"){
if(this.div.childNodes[0].src.indexOf("_on")!=-1){
_24=0;
this.div.style.zIndex="900";
}else{
_24=1;
this.div.style.zIndex="1500";
}
}
}
return _24;
},getCoor:function(){
return new Array(this.ln,this.la);
},setCoorByVal:function(la,ln,gla,gln){
if(gln!=null){
this.ln=gln;
}
if(gla!=null){
this.la=gla;
}
},setTitle:function(_29){
this.title=_29;
},hide:function(){
this.div.style.display="none";
if(this.div_shadow!=null){
this.div_shadow.style.display="none";
}
},show:function(){
this.div.style.display="";
},addSubItem:function(obj){
if(obj!=null&&obj.id!=null&&obj.obj!=null){
obj.obj.is_sub_item=true;
this.div.appendChild(obj.obj);
}
},removeSubItem:function(obj){
},removeAllSubItem:function(){
},subItemClickListener:function(){
},subItemMouseoverListener:function(){
},subItemMouseoutListener:function(){
}};

var MapControlStandard3=Class.create();
MapControlStandard3.prototype={initialize:function(){
this.parent=null;
this.zoom_level=new Array();
this.slider=null;
},initDiv:function(){
this.div_shad=window.document.createElement("div");
this.div_shad.style.position="absolute";
this.div_shad.style.position="absolute";
this.div_shad.style.left="0px";
this.div_shad.style.top="20px";
this.div_shad.style.zIndex="2000";
this.div_shad.style.border="1px #999999 solid";
this.div_shad.style.backgroundColor="#FFFFFF";
this.div_shad.className="opac5";
this.div=window.document.createElement("div");
this.div.style.position="absolute";
this.div.style.left="0px";
this.div.style.top="20px";
this.div.style.zIndex="2000";
var _1="<table width=\"63px\" height=\"63px\" border=0 cellpadding=0 cellspacing=0>";
_1+="\t<tr>";
_1+="\t\t<td id=\"map_control_nozoom_left_top\">&nbsp;</td>";
_1+="\t\t<td id=\"map_control_nozoom_top\" background=\"images/natvigator3/dir_n.gif\">&nbsp;</td>";
_1+="\t\t<td id=\"map_control_nozoom_right_top\">&nbsp;</td>";
_1+="\t</tr>";
_1+="\t<tr>";
_1+="\t\t<td id=\"map_control_nozoom_left\" background=\"images/natvigator3/dir_w.gif\">&nbsp;</td>";
_1+="\t\t<td >&nbsp;</td>";
_1+="\t\t<td id=\"map_control_nozoom_right\" background=\"images/natvigator3/dir_e.gif\">&nbsp;</td>";
_1+="\t</tr>";
_1+="\t<tr>";
_1+="\t\t<td id=\"map_control_nozoom_left_bottom\">&nbsp;</td>";
_1+="\t\t<td id=\"map_control_nozoom_bottom\" background=\"images/natvigator3/dir_s.gif\">&nbsp;</td>";
_1+="\t\t<td id=\"map_control_nozoom_right_bottom\">&nbsp;</td>";
_1+="\t</tr>";
_1+="</table>";
_1+="<table width=64 border=0 cellpadding=0 cellspacing=1>";
_1+="<tr><td align=\"center\" height=\"5px\"></td></tr>";
_1+="<tr><td align=\"center\"><div id=\"zoom_control_zoom_level\"></div>";
_1+="</td></tr>";
_1+="<tr><td align=\"center\" height=\"5px\"></td></tr>";
_1+="<tr><td align=\"center\"><img src=\""+sRelativePath+"images/btn_map_on.gif\" id=\"map_B5000\"></td></tr>";
_1+="<tr><td align=\"center\" height=\"5px\"></td></tr>";
_1+="<tr><td align=\"center\"><img src=\""+sRelativePath+"images/btn_aerial_off.gif\" id=\"map_DOP\"></td></tr>";
_1+="<tr><td align=\"center\" height=\"5px\"></td></tr>";
_1+="</table>";
this.div.innerHTML=_1;
},switchToB5000:function(){
this.parent.changeTileMode(1);
if($("map_B5000")!=null){
$("map_B5000").src=sRelativePath+"images/btn_map_on.gif";
}
if($("map_DOP")!=null){
$("map_DOP").src=sRelativePath+"images/btn_aerial_off.gif";
}
},switchToDOP:function(){
this.parent.changeTileMode(2);
if($("map_B5000")!=null){
$("map_B5000").src=sRelativePath+"images/btn_map_off.gif";
}
if($("map_DOP")!=null){
$("map_DOP").src=sRelativePath+"images/btn_aerial_on.gif";
}
},resetOnResize:function(){
this.div.style.left=(this.parent.container.offsetWidth-this.div.offsetWidth-10)+"px";
this.div.style.top="10px";
this.div_shad.style.left=(this.parent.container.offsetWidth-this.div.offsetWidth-15)+"px";
this.div_shad.style.top="5px";
this.div_shad.style.width=(this.div.offsetWidth+10)+"px";
this.div_shad.style.height=(this.div.offsetHeight+10)+"px";
this.slider.reset_drager();
},initAction:function(){
if($("map_B5000")!=null){
$("map_B5000").onclick=this.switchToB5000.bindAsEventListener(this);
$("map_B5000").style.cursor="pointer";
}
if($("map_DOP")!=null){
$("map_DOP").onclick=this.switchToDOP.bindAsEventListener(this);
$("map_DOP").style.cursor="pointer";
}
if($("map_control_nozoom_top")!=null){
$("map_control_nozoom_top").onclick=this.mapMoveTop.bindAsEventListener(this);
$("map_control_nozoom_top").style.cursor="pointer";
}
if($("map_control_nozoom_bottom")!=null){
$("map_control_nozoom_bottom").onclick=this.mapMoveBottom.bindAsEventListener(this);
$("map_control_nozoom_bottom").style.cursor="pointer";
}
if($("map_control_nozoom_right")!=null){
$("map_control_nozoom_right").onclick=this.mapMoveRight.bindAsEventListener(this);
$("map_control_nozoom_right").style.cursor="pointer";
}
if($("map_control_nozoom_left")!=null){
$("map_control_nozoom_left").onclick=this.mapMoveLeft.bindAsEventListener(this);
$("map_control_nozoom_left").style.cursor="pointer";
}
this.c_item={"text":"<img src='images/natvigator2/move.gif' align='absmiddle'>&nbsp;Drag Mode","action":this.mapContextReturn1.bind(this),"obj":this,"group":"Zoom Option"};
this.c_item={"text":"<img src='images/natvigator2/grid.gif' align='absmiddle'>&nbsp;Zoom Range Mode","action":this.mapContextReturn2.bind(this),"obj":this,"group":"Zoom Option"};
this.slider=new SliderX($("zoom_control_zoom_level"),this,80,this.parent.max_zoom,this.parent.min_zoom,1,this.parent.zoom);
this.div_shad.style.width=(this.div.offsetWidth+10)+"px";
this.div_shad.style.height=(this.div.offsetHeight+10)+"px";
},hideZoomLevel:function(){
this.div.childNodes[2].style.display="none";
},showZoomLevel:function(){
this.div.childNodes[2].style.display="";
},zoomLevelMouseOver:function(_2){
return;
var e=this.parent.getEvt(_2);
var _4=e[1].getAttribute("level");
if(_4==null){
return;
}
var _5=null;
var _6=_4;
for(var i=0;i<this.parent.zooms.length;i++){
if($("map_control_zoom_"+this.parent.zooms[i].level)!=null){
_5=$("map_control_zoom_"+this.parent.zooms[i].level);
_6=_5.getAttribute("level");
if(_6==null){
continue;
}
switch((_4-_6)){
case 0:
_5.style.width="26px";
_5.style.height="26px";
break;
case 1:
_5.style.width="24px";
_5.style.height="24px";
break;
case 2:
_5.style.width="22px";
_5.style.height="22px";
break;
case -1:
_5.style.width="24px";
_5.style.height="24px";
break;
case -2:
_5.style.width="22px";
_5.style.height="22px";
break;
default:
_5.style.width="20px";
_5.style.height="20px";
break;
}
}
}
},mapContextReturn1:function(){
$("map_control_grid_button").src="images/grid_off.gif";
$("map_control_move_button").src="images/drag_on.gif";
this.parent.switchSelectMode(1);
},mapContextReturn2:function(){
$("map_control_grid_button").src="images/grid_on.gif";
$("map_control_move_button").src="images/drag_off.gif";
this.parent.switchSelectMode(2);
},mapSelectModeChange:function(_8){
var e=this.parent.getEvt(_8);
if(e[1].id==null||e[1].id==""||e[1].id.indexOf("map_control_")==-1){
return;
}
switch(e[1].id){
case "map_control_move_button":
this.mapContextReturn1();
break;
case "map_control_grid_button":
this.mapContextReturn2();
break;
}
},mapMoveTop:function(){
this.parent.transformByLTMargin(0,400);
},mapMoveBottom:function(){
this.parent.transformByLTMargin(0,-400);
},mapMoveRight:function(){
this.parent.transformByLTMargin(-400,0);
},mapMoveLeft:function(){
this.parent.transformByLTMargin(400,0);
},mapMoveLeftBottom:function(){
this.parent.transformByLTMargin(400,-400);
},mapMoveLeftTop:function(){
this.parent.transformByLTMargin(400,400);
},mapMoveRightBottom:function(){
this.parent.transformByLTMargin(-400,-400);
},mapMoveRightTop:function(){
this.parent.transformByLTMargin(-400,400);
},mapMove:function(_a){
if(typeof (this.parent.transformByLTMargin).toLowerCase()=="function"){
switch(_a){
case 1:
this.parent.transformByLTMargin(400,0);
break;
case 2:
this.parent.transformByLTMargin(-400,0);
break;
case 3:
this.parent.transformByLTMargin(0,400);
break;
case 4:
this.parent.transformByLTMargin(0,-400);
break;
}
}
},mapChangeZoomLevel:function(_b){
if(this.parent.zoom!=_b){
this.parent.changeZoomLevel(_b,true);
}
},setZoomLevel:function(_c){
this.slider.set_val(_c);
}};

