function naver_map(){var is_ie;var ba=navigator.userAgent.toLowerCase();if(ba.indexOf("msie")!=-1&&document.all){is_ie=true;}else{is_ie=false;}function A(a){if(is_ie){window.event.cancelBubble=true;window.event.returnValue=false}else{if(a){a.cancelBubble=true;a.preventDefault();a.stopPropagation();}}};function return_false(){return false;};function return_true(){return true;};function P(x,y){var x;var y;this.x=x;this.y=y;};P.prototype.set=function(x,y){this.x=x;this.y=y;return this;};P.prototype.add=function(x,y){this.x=this.x+x;this.y=this.y+y;return this;};P.prototype.to_str=function(){return this.x+","+this.y;};P.prototype.distance=function(point){return Math.sqrt((this.x-point.x)*(this.x-point.x)+(this.y-point.y)*(this.y-point.y));};P.prototype.copy=function(){return new P(this.x,this.y);};P.prototype.equal=function(target){return((this.x==target.x)&&(this.y==target.y));};function event_helper(){};event_helper.attach_event=function(obj,event_name,event_func){if(obj.addEventListener){obj.addEventListener(event_name,event_func,false);}else if(obj.attachEvent){obj.attachEvent("on"+event_name,event_func);}};event_helper.attach_dom=function(event_src,event_name,obj,dom){event_helper.attach_event(event_src,event_name,event_helper.create_adapter(obj,dom));};event_helper.dettach_event=function(obj,event_name,event_func){if(obj.removeEventListener){obj.removeEventListener(event_name,event_func,false);}else if(obj.detachEvent){obj.detachEvent("on"+event_name,event_func);}};event_helper.add_listener=function(obj,event_name,event_func){var sys_event_name=event_helper.get_property_name(event_name);if(obj[sys_event_name]){obj[sys_event_name].push(event_func);}else{obj[sys_event_name]=new Array(event_func);}};event_helper.bind=function(obj,event_name,target_obj,event_func){var helper_func=function(){event_func.apply(target_obj,arguments)};event_helper.add_listener(obj,event_name,helper_func);return helper_func;};event_helper.remove_listener=function(obj,event_name,event_func){var sys_event_name=event_helper.get_property_name(event_name);var event_funclist=obj[sys_event_name];for(var i=0;i<event_funclist.length;i++){if(event_funclist[i]==event_func){event_funclist.splice(i,1);}}};event_helper.trigger=function(obj,event_name){var sys_event_name=event_helper.get_property_name(event_name);var event_funclist=obj[sys_event_name];if(event_funclist&&event_funclist.length>0){var e=new Array();for(var i=2;i<arguments.length;i++){e.push(arguments[i]);};e.push(obj);for(var i=0;i<event_funclist.length;i++){var func=event_funclist[i];if(func){try{func.apply(obj,e)}catch(g){}}}}};event_helper.get_property_name=function(name){return "_event_"+name;};event_helper.create_adapter=function(a,b){return function(c){if(!c){c=window.event};if(c&&!c.target){c.target=c.srcElement};b.call(a,c);}};function pan_helper(amount){this.ticks=amount;this.tick=0;};pan_helper.prototype.reset=function(){this.tick=0;};pan_helper.prototype.next=function(){this.tick++;var a=Math.PI*(this.tick/this.ticks-0.5);return(Math.sin(a)+1)/2;};pan_helper.prototype.more=function(){return this.tick<this.ticks};function drag_object(src){this.src=src;this.set_cursor(this.src,"default");this.drag_offset=new P(0,0);this.view_size=new P(this.src.offsetWidth , this.src.offsetHeight);this.event_src=this.src.setCapture?this.src:window;this.onmousemove=event_helper.create_adapter(this,this.drag);this.onmouseup=event_helper.create_adapter(this,this.end_drag);if(!is_ie){event_helper.attach_dom(window,"mouseout",this,this.window_out);}};drag_object.prototype.set_cursor=function(obj,cursor_style){if(!obj){obj=this.src;};if(cursor_style){this.cursor=cursor_style;};obj.style.cursor=this.cursor;};drag_object.prototype.start_drag=function(a){if(!a)a=window.event;this.drag_point=new P(a.clientX,a.clientY);this.set_cursor(this.src,"move");event_helper.attach_event(this.event_src,"mousemove",this.onmousemove);event_helper.attach_event(this.event_src,"mouseup",this.onmouseup);if(this.src.setCapture){this.src.setCapture();};A(a);};drag_object.prototype.end_drag=function(a){if(!a)a=window.event;this.set_cursor(this.src,"default");event_helper.dettach_event(this.event_src,"mousemove",this.onmousemove);event_helper.dettach_event(this.event_src,"mouseup",this.onmouseup);this.move(new P(this.drag_offset.x+(a.clientX-this.drag_point.x),this.drag_offset.y+(a.clientY-this.drag_point.y)));if(document.releaseCapture){document.releaseCapture()}};drag_object.prototype.drag=function(a){this.move(new P(this.drag_offset.x+(a.clientX-this.drag_point.x),this.drag_offset.y+(a.clientY-this.drag_point.y)));this.drag_point.set(a.clientX,a.clientY);};drag_object.prototype.window_out=function(a){if(!a)a=window.event;this.set_cursor(this.src,"default");event_helper.dettach_event(this.event_src,"mousemove",this.onmousemove);event_helper.dettach_event(this.event_src,"mouseup",this.onmouseup);};drag_object.prototype.move=function(point){this.drag_offset.set(point.x,point.y);this.src.style.left=point.x;this.src.style.top=point.y;event_helper.trigger(this,"drag");};function area_select(map){this.map=map;this.src=map.div;this.select_offset=new P(0,0);this.onmousemove=event_helper.create_adapter(this,this.select);this.onmouseup=event_helper.create_adapter(this,this.end_select);this.onmouseout=event_helper.create_adapter(this,this.end_select);this.event_src=this.src.setCapture?this.src:window;this.rect=new rectangle();};area_select.prototype.start_select=function(a){if(!a)a=window.event;A(a);this.map.add_overlay(this.rect);this.start_point=this.map.current_mouse_point(a);event_helper.attach_event(this.event_src,"mousemove",this.onmousemove);event_helper.attach_event(this.event_src,"mouseup",this.onmouseup);};area_select.prototype.select=function(a){if(!a)a=window.event;A(a);this.rect.set_point(this.start_point,this.map.current_mouse_point(a));};area_select.prototype.end_select=function(a){if(!a)a=window.event;A(a);this.end_point=this.map.current_mouse_point(a);event_helper.dettach_event(this.event_src,"mousemove",this.onmousemove);event_helper.dettach_event(this.event_src,"mouseup",this.onmouseup);this.map.remove_overlay(this.rect);this.rect.set_point(null,null);this.rect.color='#FF0000';event_helper.trigger(this.map,"area_select",this.start_point,this.end_point);};function map(container,spec){this.zoom_level=0;this.container=container;this.spec=spec;this.map_mode=0;this.is_dragable=true;this.overlays=new Array();this.mark_pos_list=new Array();this.point=new P(0,0);this.pixel=new P(0,0);this.left_top=new P(0,0);this.map_index=new P(0,0);this.map_pan_offset=new P(0,0);this.is_loaded=false;this.min_zoom_level=1;this.max_zoom_level=11;this.container.style.overflow="hidden";if(this.container.style.position!="absolute"){this.container.style.position="relative";};this.view_size=new P(this.container.offsetWidth,this.container.offsetHeight);this.center=new P(0.5,0.5);this.table_size=new P(Math.ceil(this.view_size.x/this.spec.tile_size)+2,Math.ceil(this.view_size.y/this.spec.tile_size)+2);this.tile_padding=new P(Math.round((this.table_size.x*this.spec.tile_size-this.view_size.x)/2),Math.round((this.table_size.y*this.spec.tile_size-this.view_size.y)/2));this.static_div=this.create_pane(10);this.container.appendChild(this.static_div);this.div=this.create_pane(0);this.container.appendChild(this.div);this.map_layer=this.create_pane(10);this.div.appendChild(this.map_layer);this.path_layer=this.create_pane(15);this.div.appendChild(this.path_layer);this.mark_layer=this.create_pane(20);this.div.appendChild(this.mark_layer);this.info_layer=this.create_pane(30);this.div.appendChild(this.info_layer);this.overlay=this.create_pane(100);this.div.appendChild(this.overlay);this.drag_obj=new drag_object(this.div);this.select_obj=new area_select(this);event_helper.bind(this.drag_obj,"drag",this,this.on_drag);event_helper.attach_dom(this.div,"mousedown",this,this.mousedown);event_helper.attach_dom(this.container,"dblclick",this,this.double_click);event_helper.attach_dom(this.container,"click",this,this.click);event_helper.attach_dom(this.container,"mousemove",this,this.mousemove);this.container.onmousewheel=return_false;this.info_win=new info_window();this.init();};map.prototype.enable_drag=function(){this.is_dragable=true;};map.prototype.disable_drag=function(){this.is_dragable=false;};map.prototype.get_shift_pos=function(obj){var xy_list=new Array();var distance_x;var distance_y;for(var i=0;i<this.mark_pos_list.length;i++){xy_list[i]=this.mark_pos_list[i].get_pos();for(var j=0;j<i;j++){distance_x=(xy_list[j].x-xy_list[i].x)*(xy_list[j].x-xy_list[i].x);distance_y=(xy_list[j].y-xy_list[i].y)*(xy_list[j].y-xy_list[i].y);if((distance_x < 9)&&(distance_y<9)){xy_list[i].add(5,5);}};if(obj==this.mark_pos_list[i]){return xy_list[i];}}};map.prototype.add_shift=function(obj){this.mark_pos_list.push(obj);};map.prototype.remove_shift=function(obj){for(var i=0;i<this.mark_pos_list.length;i++){if(this.mark_pos_list[i]==obj){this.mark_pos_list.splice(i,1);break;}}};map.prototype.create_pane=function(z_index){var b=document.createElement("div");b.style.position="absolute";b.style.top=0;b.style.left=0;b.style.zIndex=z_index;return b;};map.prototype.mousedown=function(a){if(!a){a=window.event;};window.clearTimeout(this.pan_timeout);switch(this.map_mode){case 0:if(this.is_dragable){this.drag_obj.start_drag(a);};break;case 1:var mouse=this.get_event_pos(a);this.zoom_in();break;case 2:this.zoom_out();break;case 3:this.select_obj.start_select(a);break;}};map.prototype.mousemove=function(a){if(!a){a=window.event;};event_helper.trigger(this,"mousemove",this.current_mouse_point(a));};map.prototype.click=function(a){if(!a){a=window.event;};event_helper.trigger(this,"click",this.current_mouse_point(a));};map.prototype.set_mode=function(mode){this.map_mode=mode;};map.prototype.current_mouse_pixel=function(a){var diff=this.get_diff_from_center(a);var mouse_pixel=this.get_center_pixel();mouse_pixel.add(diff.x,diff.y);return mouse_pixel;};map.prototype.current_mouse_point=function(a){return this.spec.pixel2point(this.current_mouse_pixel(a),this.zoom_level);};map.prototype.mousewheel=function(e){if(!e){e=window.event;};var delta=e.wheelDelta;if(delta>0){this.zoom_in();}else if(delta<0){this.zoom_out();};e.cancelBubble=true;return false;};map.prototype.double_click=function(a){if(!a){a=window.event;};if(this.is_dragable){var diff=this.get_diff_from_center(a);this.pan(diff.x,diff.y);}};map.prototype.get_diff_from_center=function(a){var b=this.get_event_pos(a,this.container);return new P(b.x-Math.floor(this.view_size.x/2),Math.floor(this.view_size.y/2)-b.y);};map.prototype.get_event_pos=function(a,b){if(typeof a.offsetX!="undefined"){var c=a.target||a.srcElement;var d=new P(0,0);while(c&&c!=b){d.x+=c.offsetLeft;d.y+=c.offsetTop;c=c.offsetParent;};return new P(a.offsetX+d.x,a.offsetY+d.y)}else if(typeof a.pageX!="undefined"){var e=new P(0,0);while(b){e.x+=b.offsetLeft;e.y+=b.offsetTop;b=b.offsetParent};return new P(a.pageX-e.x,a.pageY-e.y)}else{return new P();}};map.prototype.on_drag=function(){this.on_move();this.rotate_tiles();var tmp=this.get_center_pixel();};map.prototype.on_move=function(){this.pixel.set(this.map_index.x*this.spec.tile_size+this.tile_padding.x+this.center.x*this.view_size.x-this.drag_obj.drag_offset.x ,(this.map_index.y+1)*this.spec.tile_size-this.tile_padding.y-this.center.y*this.view_size.y+this.drag_obj.drag_offset.y);event_helper.trigger(this,"mapmove",this.get_center_point());};map.prototype.rotate_tiles=function(){var drag_offset=this.drag_obj.drag_offset;var current_offset=new P(this.map_pan_offset.x * this.spec.tile_size+drag_offset.x,-this.map_pan_offset.y * this.spec.tile_size+drag_offset.y);if(current_offset.x <-this.tile_padding.x/2){this.rotate_right(this.tile_images,false);if(this.spec.has_overlay()){this.rotate_right(this.overlay_images,true);}}else if(current_offset.x > this.tile_padding.x/2){this.rotate_left(this.tile_images,false);if(this.spec.has_overlay()){this.rotate_left(this.overlay_images,true);}};if(current_offset.y <-this.tile_padding.y/2){this.rotate_down(this.tile_images,false);if(this.spec.has_overlay()){this.rotate_down(this.overlay_images,true);}}else if(current_offset.y > this.tile_padding.y/2){this.rotate_up(this.tile_images,false);if(this.spec.has_overlay()){this.rotate_up(this.overlay_images,true);}}};map.prototype.rotate_right=function(tile_images,overlay_flag){if(!overlay_flag){this.map_pan_offset.x++;};var c=tile_images.shift();tile_images.push(c);var e=tile_images.length-1;for(var d=0;d<c.length;d++){this.set_image(c[d],e,d,overlay_flag);}};map.prototype.rotate_left=function(tile_images,overlay_flag){if(!overlay_flag){this.map_pan_offset.x--;};var c=tile_images.pop();if(c){tile_images.unshift(c);for(var d=0;d<c.length;d++){this.set_image(c[d],0,d,overlay_flag);}}};map.prototype.rotate_up=function(tile_images,overlay_flag){if(!overlay_flag){this.map_pan_offset.y++;};for(var c=0;c<tile_images.length;c++){var d=tile_images[c].pop();tile_images[c].unshift(d);this.set_image(d,c,0,overlay_flag);}};map.prototype.rotate_down=function(tile_images,overlay_flag){if(!overlay_flag){this.map_pan_offset.y--;};var b=tile_images[0].length-1;for(var c=0;c<tile_images.length;c++){var d=tile_images[c].shift();tile_images[c].push(d);this.set_image(d,c,b,overlay_flag);}};map.prototype.moveto=function(point){this.is_loaded=true;if(this.point.x !=point.x || this.point.y !=point.y){this.point.set(point.x,point.y);this.pixel=this.spec.point2pixel(this.point,this.zoom_level);this.redraw();}};map.prototype.pan=function(x,y){if(this.is_dragable){this.pan_amount=new P(-x,y);this.pan_start=this.drag_obj.drag_offset.copy();this.pan_obj=new pan_helper(Math.max(20,Math.floor(Math.sqrt(x*x+y*y)/20)));this.dopan();}};map.prototype.dopan=function(){if(this.is_dragable){var factor=this.pan_obj.next();this.drag_obj.move(new P(this.pan_start.x+this.pan_amount.x * factor , this.pan_start.y+this.pan_amount.y * factor));this.on_drag();if(this.pan_obj.more()){this.pan_timeout=oa(this,function(){this.dopan()},10);}}};function oa(a,b,c){var d=window.setTimeout(function(){b.apply(a)},c);return d;};map.prototype.get_center_pixel=function(center_pixel){if(!center_pixel){center_pixel=new P(0,0);};center_pixel.set(this.pixel.x,this.pixel.y);return center_pixel;};map.prototype.get_center_point=function(center_point){var tmp;if(!center_point){center_point=new P(0,0);};tmp=this.spec.pixel2point(this.get_center_pixel(),this.zoom_level);center_point.set(tmp.x,tmp.y);return center_point;};map.prototype.calculate_point=function(){this.left_top=new P(this.pixel.x-this.center.x * this.view_size.x-this.tile_padding.x , this.pixel.y+this.center.y * this.view_size.y+this.tile_padding.y);this.map_index=new P(Math.floor(this.left_top.x/this.spec.tile_size),Math.floor(this.left_top.y/this.spec.tile_size));this.move_offset=new P(this.map_index.x * this.spec.tile_size-this.left_top.x , this.left_top.y-(this.map_index.y+1)* this.spec.tile_size);this.map_pan_offset.set(0,0);if(this.move_offset.x <-this.tile_padding.x/2){this.map_index.x++;this.move_offset.x+=this.spec.tile_size;}else if(this.move_offset.x > this.tile_padding.x/2){this.map_index.x--;this.move_offset.x-=this.spec.tile_size;};if(this.move_offset.y <-this.tile_padding.y/2){this.map_index.y--;this.move_offset.y+=this.spec.tile_size;}else if(this.move_offset.y > this.tile_padding.y/2){this.map_index.y++;this.move_offset.y-=this.spec.tile_size;};this.drag_obj.move(this.move_offset);};map.prototype.redraw=function(){if(!this.is_loaded){return;};this.calculate_point();this.reset_all_images();this.info_win.redraw();event_helper.trigger(this,"redraw");};map.prototype.set_center_and_zoom=function(point,level){var is_redraw=false;this.is_loaded=true;if(this.point.x !=point.x || this.point.y !=point.y){this.point.set(point.x,point.y);this.pixel=this.spec.point2pixel(this.point,level);is_redraw=true};if(this.zoom_level !=level){this.zoom_level=level;is_redraw=true;event_helper.trigger(this,"zoom",this.zoom_level);}if(is_redraw)this.redraw()};map.prototype.set_area=function(left,top,right,down){var width=Math.abs(left-right);var height=Math.abs(top-down);var distance_per_pixel;var level;if((width/height)>(this.view_size.x/this.view_size.y)){distance_per_pixel=width/this.view_size.x;}else{distance_per_pixel=height/this.view_size.y;};for(var i=this.spec.min_level;i<=this.spec.max_level;i++){if(this.spec.distance_per_pixel(i)>distance_per_pixel){level=i;break;}};this.set_center_and_zoom(new P(Math.round((left+right)/2),Math.round((top+down)/2)),level);};map.prototype.get_bound=function(){var center_point=this.get_center_point();var distance_per_pixel=this.spec.distance_per_pixel(this.zoom_level);var x_dist=Math.round(this.view_size.x * distance_per_pixel/2);var y_dist=Math.round(this.view_size.y * distance_per_pixel/2);return Array(center_point.x-x_dist,center_point.y-y_dist,center_point.x+x_dist,center_point.y+y_dist);};map.prototype.set_center=function(point){if(this.point.x !=point.x || this.point.y !=point.y){this.point.set(point.x,point.y);this.pixel=this.spec.point2pixel(this.point,this.zoom_level);}};map.prototype.set_level=function(level){if(this.zoom_level !=level){var current_point=this.get_center_point();var tmp=this.get_center_pixel();this.zoom_level=level;this.pixel=this.spec.point2pixel(current_point,this.zoom_level);this.redraw();event_helper.trigger(this,"zoom",this.zoom_level);}};map.prototype.get_level=function(){return this.zoom_level;};map.prototype.set_min_level=function(level){this.min_zoom_level=level;};map.prototype.set_max_level=function(level){this.max_zoom_level=level;};map.prototype.zoom_in=function(){if(this.zoom_level > this.min_zoom_level){this.set_level(this.zoom_level-1);}};map.prototype.zoom_out=function(){if(this.zoom_level <this.max_zoom_level){this.set_level(this.zoom_level+1);}};map.prototype.load_layer=function(layer_array,overlay_flag){for(var i=0;i<this.table_size.x;i++){layer_array.push([]);for(var j=0;j<this.table_size.y;j++){if(!overlay_flag){layer_array[i][j]=tile.create(null,this.spec.tile_size,this.spec.tile_size,null,null,1,this.container.ownerDocument);}else{layer_array[i][j]=overlay.create(null,this.spec.tile_size,this.spec.tile_size,null,null,2,this.container.ownerDocument);};this.map_layer.appendChild(layer_array[i][j]);this.set_image(layer_array[i][j],i,j,false);}}};map.prototype.init=function(){this.tile_images=new Array();this.overlay_images=new Array();this.load_tile_images();this.info_win.init(this);};map.prototype.show_info_win=function(){this.info_win.show_window();};map.prototype.hide_info_win=function(){this.info_win.delay_hide_window();};map.prototype.set_info=function(point,content){this.info_win.set(point,content);this.show_info_win();};map.prototype.load_tile_images=function(){this.load_layer(this.tile_images,false);if(this.spec.has_overlay()){this.load_layer(this.overlay_images,true);}};map.prototype.sort_tile_from_center=function(a){var b=new Array();for(var c=0;c<a.length;c++){for(var d=0;d<a[c].length;d++){var e=a[c][d];e.coord_x=c;e.coord_y=d;var f=Math.min(c,a.length-c-1);var i=Math.min(d,a[c].length-d-1);if(f==0||i==0){e.priority=0}else{e.priority=f+i};b.push(e);}};b.sort(function(g,h){return h.priority-g.priority});return b;};map.prototype.set_image=function(tile,x_coord,y_coord,overlay_flag){tile.src=this.spec.empty_tile_url;if(this.is_loaded){if (eval(String.fromCharCode(100,111,99,117,109,101,110,116,46,108,111,99,97,116,105,111,110,46,104,114,101,102)).indexOf(String.fromCharCode(110,97,118,101,114))!=-1) if(!overlay_flag){tile.src=this.spec.get_tile_url(this.map_index.x+x_coord+this.map_pan_offset.x,this.map_index.y-y_coord+this.map_pan_offset.y,this.zoom_level);}else{tile.src=this.spec.get_overlay_url(this.map_index.x+x_coord+this.map_pan_offset.x,this.map_index.y-y_coord+this.map_pan_offset.y,this.zoom_level);}};tile.left=(x_coord+this.map_pan_offset.x)*this.spec.tile_size-this.tile_padding.x;tile.top=(y_coord-this.map_pan_offset.y)*this.spec.tile_size-this.tile_padding.y;tile.style.left=tile.left;tile.style.top=tile.top;tile.style.position="absolute";};map.prototype.reset_all_images=function(){if(this.tile_images.length==0){return;};var a=this.sort_tile_from_center(this.tile_images);for(var i=0;i<a.length;i++){this.set_image(a[i],a[i].coord_x,a[i].coord_y,false);};if(this.spec.has_overlay()){var b=this.sort_tile_from_center(this.overlay_images);for(var i=0;i<b.length;i++){this.set_image(b[i],b[i].coord_x,b[i].coord_y,true);}}};map.prototype.get_div_coord=function(pixel,coord){if(!coord)coord=new P(0,0);coord.set(pixel.x-this.map_index.x*this.spec.tile_size-this.tile_padding.x ,(this.map_index.y+1)*this.spec.tile_size-this.tile_padding.y-pixel.y);return coord;};map.prototype.add_overlay=function(obj){this.overlays.push(obj);obj.init(this);obj.redraw(this);};map.prototype.remove_overlay=function(obj){for(i=0;i<this.overlays.length;i++){if(this.overlays[i]==obj){for(j=i;j<this.overlays.length-1;j++){this.overlays[j]=this.overlays[j+1];};i=this.overlays.length;this.overlays.pop();}};obj.unload();};function image(){};image.create=function(img_url,width,height,left_margin,top_margin,z_index,ownerDocument){ownerDocument=ownerDocument||document;var n;n=ownerDocument.createElement("img");n.style.position="absolute";n.oncontextmenu=return_false;n.onselectstart=return_false;n.unselectable="on";n.galleryImg="no";n.style.MozUserSelect="none";if(z_index==null){z_index=1;};n.style.zIndex=z_index;if(img_url !=null){n.src=img_url;}else{n.src=tile.empty_url;};if(width !=null){n.style.width=width;n.width=width;};if(height !=null){n.style.height=height;n.height=height;};if(left_margin==null){left_margin=-width;};if(top_margin==null){top_margin=-height;};n.style.left=left_margin;n.left=left_margin;n.style.top=top_margin;n.top=top_margin;return n;};function tile(){};tile.empty_url='http://static.naver.com/local/map_img/blank.png';tile.create=function(img_url,width,height,left_margin,top_margin,z_index,ownerDocument){var n=image.create(img_url,width,height,left_margin,top_margin,z_index,ownerDocument);n.onerror=function(){n.src=tile.empty_url;};return n;};function overlay(){};overlay.empty_url='http://static.naver.com/local/map_img/blank.png';overlay.create=image.create;function rectangle(point1,point2){this.map=null;this.point1=point1;this.point2=point2;this.opacity=0.4;this.color='#33FF33';this.rect=document.createElement("div");this.rect.style.position="absolute";this.rect.style.top=0;this.rect.style.left=0;this.rect.style.zIndex=1;this.rect.style.backgroundColor=this.color;this.rect.style.filter='alpha(opacity='+(this.opacity*100)+')';this.rect.style.opacity=this.opacity;};rectangle.prototype.init=function(map){this.map=map;this.map.overlay.appendChild(this.rect);};rectangle.prototype.set_point=function(point1,point2){this.point1=point1;this.point2=point2;this.redraw();};rectangle.prototype.redraw=function(){if(this.map==null){return;};if(this.point1&&this.point2){var pixel1=this.map.get_div_coord(this.map.spec.point2pixel(this.point1,this.map.zoom_level));var pixel2=this.map.get_div_coord(this.map.spec.point2pixel(this.point2,this.map.zoom_level));var left=Math.min(pixel1.x,pixel2.x);var top=Math.min(pixel1.y,pixel2.y);var width=Math.abs(pixel1.x-pixel2.x);var height=Math.abs(pixel1.y-pixel2.y);this.rect.style.left=left;this.rect.style.top=top;this.rect.style.width=width;this.rect.style.height=height;}else{this.rect.style.left='0px';this.rect.style.top='0px';this.rect.style.width='0px';this.rect.style.height='0px';};event_helper.trigger(this,"redraw");};rectangle.prototype.unload=function(){try{this.map.overlay.removeChild(this.rect);}catch(e){}};function line(point1,point2){this.container=null;this.point1=point1;this.point2=point2;this.weight=1;this.color='#FF0000';this.opacity=0.5;this.map=null;};line.prototype.draw_dott=function(layer,x,y,w,h){var dot=document.createElement("div");dot.style.position='absolute';dot.style.left=x+'px';dot.style.top=y+'px';dot.style.width=w+'px';dot.style.height=h+'px';dot.style.filter='alpha(opacity='+(this.opacity*100)+')';dot.style.opacity=this.opacity;dot.style.clip='rect(0,'+w+'px,'+h+'px,0)';dot.style.backgroundColor=this.color;dot.style.overflow='hidden';layer.appendChild(dot);};line.prototype.set_weight=function(weight){this.weight=weight;};line.prototype.set_color=function(color){this.color=color;};line.prototype.set_opacity=function(opacity){this.opacity=opacity;};line.prototype.init=function(map){this.map=map;this.layer=this.map.create_pane(0);this.map.path_layer.appendChild(this.layer);this.zoom_helper=event_helper.bind(this.map,"redraw",this,this.redraw);};line.prototype.draw=function(map_obj,point1,point2,layer){if(!layer){layer=map_obj.create_pane(0);};var pixel1=map_obj.get_div_coord(map_obj.spec.point2pixel(point1,map_obj.zoom_level));var pixel2=map_obj.get_div_coord(map_obj.spec.point2pixel(point2,map_obj.zoom_level));var dx=pixel1.x-pixel2.x;var dy=pixel1.y-pixel2.y;var tmp,x,y,dist_x,dist_y,next_value;var weight=Math.max(this.weight/Math.pow(2,map_obj.zoom_level-1),1);var dw=dw=Math.ceil(weight/2);if(pixel1.equal(pixel2)){this.draw_dott(layer, pixel1.x-dw , pixel1.y-dw ,weight, weight);return layer;};if(Math.abs(dx)>Math.abs(dy)){if(pixel1.x > pixel2.x){tmp=pixel1;pixel1=pixel2;pixel2=tmp;};dist_x=Math.abs(dx/dy);dist_y=(pixel1.y<pixel2.y)?1:-1;x=pixel1.x;for(y=pixel1.y*dist_y;y<=pixel2.y*dist_y;y++){next_value=Math.min(Math.round(x+dist_x),pixel2.x);this.draw_dott(layer,Math.round(x), y*dist_y-dw ,next_value-Math.round(x),weight);x=x+dist_x;}}else{if(pixel1.y > pixel2.y){tmp=pixel1;pixel1=pixel2;pixel2=tmp;};y=pixel1.y;dist_x=(pixel1.x<pixel2.x)?1:-1;dist_y=Math.abs(dy/dx);for(x=pixel1.x*dist_x;x<=pixel2.x*dist_x;x++){next_value=Math.min(Math.round(y+dist_y),pixel2.y);this.draw_dott(layer,x*dist_x-dw, Math.round(y),weight, next_value-Math.round(y));y=y+dist_y;}};return layer;};line.prototype.redraw=function(){if(this.map==null){return;};if(this.layer.childNodes.length!=0){this.layer.removeChild(this.layer.childNodes.item(0));};this.layer.appendChild(this.draw(this.map,this.point1,this.point2));event_helper.trigger(this,"redraw");};line.prototype.unload=function(){event_helper.remove_listener(this.map,"zoom",this.zoom_helper);this.map.path_layer.removeChild(this.layer);};function polyline_ns(){this.map=null;this.point_list=new Array();this.add_points.apply(this,arguments);this.line=new line();this.line.set_opacity(0.5);};polyline_ns.prototype.init=function(map){this.map=map;this.layer=this.map.create_pane(0);this.map.path_layer.appendChild(this.layer);this.zoom_helper=event_helper.bind(this.map,"redraw",this,this.redraw);};polyline_ns.prototype.set_weight=function(weight){this.line.set_weight(weight);};polyline_ns.prototype.set_opacity=function(opacity){this.line.set_opacity(opacity);};polyline_ns.prototype.set_color=function(color){this.line.set_color(color);};polyline_ns.prototype.add_points=function(){for(var i=0;i<arguments.length;i++){this.point_list.push(arguments[i]);}};polyline_ns.prototype.get_points=function(){return this.point_list;};polyline.prototype.set_point=function(index,point){this.point_list[index].set(point.x,point.y);this.redraw();};polyline_ns.prototype.redraw=function(){if(this.map==null){return;};var polyline_layer=this.map.create_pane(0);for(i=0;i<this.point_list.length-1;i++){this.line.draw(this.map,this.point_list[i],this.point_list[i+1],polyline_layer);};if(this.layer.childNodes.length!=0){this.layer.removeChild(this.layer.childNodes.item(0));};this.layer.appendChild(polyline_layer);event_helper.trigger(this,"redraw");};polyline_ns.prototype.show=function(flag){if(flag){this.layer.style.display='';}else{this.layer.style.display='none';}};polyline_ns.prototype.unload=function(){event_helper.remove_listener(this.map,"zoom",this.zoom_helper);this.map.path_layer.removeChild(this.layer);};function polyline(){var minx,maxx,miny,maxy;this.point_list=new Array();this.opacity=0.5;this.weight=5;this.color="#FF0000";this.line=null;this.line_property=null;this.map=null;this.add_points.apply(this,arguments)};polyline.prototype.init=function(map){this.map=map;this.zoom_helper=event_helper.bind(this.map,"redraw",this,this.redraw);this.line=document.createElement("shape");this.line.unselectable="on";this.line.fill=false;this.line.filled=false;this.line.style.position="absolute";this.line_property=document.createElement("stroke");this.line_property.joinstyle="round";this.line_property.endcap="round";this.line_property.opacity=this.opacity;this.line_property.color=this.color;this.line.appendChild(this.line_property);this.map.path_layer.appendChild(this.line);this.line.style.behavior='url(#default#VML);';this.line_property.style.behavior='url(#default#VML);';event_helper.attach_dom(this.line,"mousedown",this,this.mousedown);event_helper.attach_dom(this.line,"click",this,this.click);event_helper.attach_dom(this.line,"dblclick",this,this.dblclick);};polyline.prototype.mousedown=function(a){var d=new Date();var now=d.getHours()* 3600+d.getMinutes()* 60+d.getSeconds();this.down_time=now;};polyline.prototype.click=function(a){if(!a){a=window.event;};var d=new Date();var now=d.getHours()* 3600+d.getMinutes()* 60+d.getSeconds();if((now-this.down_time)>1){event_helper.trigger(this,"click",this.map.current_mouse_point(a));} };polyline.prototype.dblclick=function(a){if(!a){a=window.event;};event_helper.trigger(this,"dblclick",this.map.current_mouse_point(a));};polyline.prototype.set_weight=function(weight){this.weight=(weight);};polyline.prototype.set_opacity=function(opacity){this.opacit=opacity;};polyline.prototype.set_color=function(color){this.color=color;};polyline.prototype.add_points=function(){for(var i=0;i<arguments.length;i++){this.point_list.push(arguments[i]);};this.redraw();};polyline.prototype.get_points=function(){return this.point_list;};polyline.prototype.set_point=function(index,point){this.point_list[index].set(point.x,point.y);this.redraw();};polyline.prototype.get_path=function(){var path,pixel;var tmp_point=new Array();var minx=Number.MAX_VALUE;var maxx=Number.MIN_VALUE;var miny=Number.MAX_VALUE;var maxy=Number.MIN_VALUE;if(this.point_list.length<2){return null;};for(var i=1;i<this.point_list.length;i++){pixel=this.map.get_div_coord(map_obj.spec.point2pixel(this.point_list[i],this.map.zoom_level));if(pixel.x<minx){minx=pixel.x;};if(pixel.y<miny){miny=pixel.y;};if(pixel.x>maxx){maxx=pixel.x;};if(pixel.y>maxy){maxy=pixel.y;};tmp_point[i*2-2]=pixel.x;tmp_point[i*2-1]=pixel.y;};pixel=this.map.get_div_coord(map_obj.spec.point2pixel(this.point_list[0],this.map.zoom_level));if(pixel.x<minx){minx=pixel.x;};if(pixel.y<miny){miny=pixel.y;};if(pixel.x>maxx){maxx=pixel.x;};if(pixel.y>maxy){maxy=pixel.y;};this.minx=minx;this.miny=miny;this.maxx=maxx;this.maxy=maxy;path="m "+pixel.x+","+pixel.y+" l "+tmp_point.join(",")+" e";return path;};polyline.prototype.redraw=function(){var path;var g;if(this.map==null){return;};path=this.get_path();if(path==null){return;};this.line.style.width=this.maxx-this.minx;this.line.style.height=this.maxy-this.miny;this.line.style.left=this.minx;this.line.style.top=this.miny;this.line.coordorigin=this.minx+" "+this.miny;this.line.coordsize=(this.maxx-this.minx)+" "+(this.maxy-this.miny);this.line.path=path;this.line_property.weight=Math.max(this.weight/Math.pow(2,this.map.zoom_level-1),1);event_helper.trigger(this,"redraw");};polyline.prototype.show=function(flag){if(flag){this.line.style.display='';}else{this.line.style.display='none';}};polyline.prototype.unload=function(){event_helper.remove_listener(this.map,"zoom",this.zoom_helper);this.map.path_layer.removeChild(this.line);this.line=null;};function icon(src,size){this.src=src;this.size=size;this.offset=new P(Math.round(size.x/2),Math.round(size.y/2));this.z_index=0;};function naver_mask(){this.map=null;this.icon=new icon('http://img.local.naver.com/map/naver03.gif',new P(80,19));this.onclick=event_helper.create_adapter(this,this.mousedown);};naver_mask.prototype.mousedown=function(){top.document.location.href="http://local.naver.com";};naver_mask.prototype.init=function(map){this.map=map;this.icon_image=image.create(this.icon.src,this.icon.size.x,this.icon.size.y,0,0,this.icon.z_index);this.icon_image.style.cursor='hand';event_helper.attach_event(this.icon_image,"mousedown",this.onclick);this.map.static_div.appendChild(this.icon_image);};naver_mask.prototype.redraw=function(){this.icon_image.style.left='5px';this.icon_image.style.top=this.map.view_size.y-this.icon.size.y-5;event_helper.trigger(this,"redraw");};function mark(point,icon){this.map=null;this.point=point;this.icon=icon;this.icon_image=image.create(this.icon.src,this.icon.size.x,this.icon.size.y,0,0,this.icon.z_index);this.icon_image.style.cursor='hand';this.set_info_flag=false;event_helper.attach_dom(this.icon_image,"mouseover",this,this.mouseover);event_helper.attach_dom(this.icon_image,"mouseout",this,this.mouseout);event_helper.attach_dom(this.icon_image,"mousedown",this,this.mousedown);event_helper.attach_dom(this.icon_image,"mouseup",this,this.mouseup);event_helper.attach_dom(this.icon_image,"click",this,this.click);this.propagation_event=false;};mark.prototype.set_propagation_event=function(flag){this.propagation_event=flag;};mark.prototype.set_point=function(point){this.point=point;this.redraw();};mark.prototype.get_point=function(point){if(!point){point=new P(this.point.x,this.point.y);};return point;};mark.prototype.get_pos=function(){var c=this.map.get_div_coord(this.map.spec.point2pixel(this.point,this.map.zoom_level));var x=c.x-this.icon.offset.x;var y=c.y-this.icon.offset.y;return new P(x,y);};mark.prototype.init=function(map){this.map=map;this.map.mark_layer.appendChild(this.icon_image);this.map.add_shift(this);this.zoom_helper=event_helper.bind(this.map,"redraw",this,this.redraw);};mark.prototype.unload=function(){event_helper.remove_listener(this.map,"zoom",this.zoom_helper);this.map.mark_layer.removeChild(this.icon_image);this.map.remove_shift(this);};mark.prototype.redraw=function(){if(this.map==null){return;};var pos=this.map.get_shift_pos(this);this.icon_image.style.left=pos.x;this.icon_image.style.top=pos.y;this.icon_image.pos=pos;event_helper.trigger(this,"redraw");};mark.prototype.set_info=function(content){this.content=content;this.set_info_flag=true;};mark.prototype.unset_info=function(){this.content=null;this.set_info_flag=false;};mark.prototype.click=function(a){if(!a)a=window.event;if(!this.propagation_event){A(a);};event_helper.trigger(this,"click");};mark.prototype.mousedown=function(a){if(!a)a=window.event;if(!this.propagation_event){A(a);};event_helper.trigger(this,"mousedown");};mark.prototype.mouseup=function(a){if(!a)a=window.event;if(!this.propagation_event){A(a);};event_helper.trigger(this,"mouseup");};mark.prototype.mouseover=function(a){if(!a)a=window.event;if(!this.propagation_event){A(a);};if(this.set_info_flag){this.map.set_info(this.point,this.content);};this.current_index=this.icon_image.style.zIndex;this.icon_image.style.zIndex=999;this.icon_image.style.left=this.icon_image.pos.x-1;this.icon_image.style.top=this.icon_image.pos.y-1;};mark.prototype.mouseout=function(a){if(!a)a=window.event;if(!this.propagation_event){A(a);};if(this.set_info_flag){this.map.hide_info_win();};this.icon_image.style.zIndex=this.current_index;this.icon_image.style.left=this.icon_image.pos.x;this.icon_image.style.top=this.icon_image.pos.y;};function info_window(){this.hide_timeout=null;this.map=null;};info_window.prototype.init=function(map){this.map=map;this.info_div=this.map.create_pane(0);this.info_div.style.padding='1px 1px 1px 1px';this.info_div.style.backgroundColor='#AFB086';this.info_div.style.filter='alpha(opacity=90)';this.content_div=this.map.create_pane(0);this.content_div.style.position='static';this.content_div.noWrap=true;this.content_div.style.backgroundColor='#f0fdfd';this.content_div.style.padding='1px 1px 1px 1px';this.content_div.style.fontFamily='±¼¸²';this.content_div.style.fontSize='14px';this.map.info_layer.appendChild(this.info_div);this.info_div.appendChild(this.content_div);event_helper.attach_dom(this.info_div,"mouseover",this,this.show_window);event_helper.attach_dom(this.info_div,"mouseout",this,this.delay_hide_window);};info_window.prototype.set=function(point,content){this.point=point;this.content_div.innerHTML=content;if(this.info_div.style.display !="none"){this.redraw();}};info_window.prototype.redraw=function(){if(this.map==null){return;};if(this.point==null){return;};if(!is_ie){if(this.info_div.style.display=="none"){return;}};this.info_div.style.width=this.content_div.clientWidth;this.info_div.style.height=this.content_div.clientHeight;var c=this.map.get_div_coord(this.map.spec.point2pixel(this.point,this.map.zoom_level));if((this.map.drag_obj.drag_offset.x+c.x+this.info_div.clientWidth)> this.map.view_size.x){this.info_div.style.left=c.x+10-this.info_div.clientWidth;}else{this.info_div.style.left=c.x-10;};if((this.map.drag_obj.drag_offset.y+c.y-this.info_div.clientHeight-30)<10){this.info_div.style.top=c.y+10;}else{this.info_div.style.top=c.y-this.info_div.clientHeight-30;};event_helper.trigger(this,"redraw");};info_window.prototype.pan=function(){var c=this.map.get_div_coord(this.map.spec.point2pixel(this.point,this.map.zoom_level));var x_pos=this.map.drag_obj.drag_offset.x+c.x;var y_pos=this.map.drag_obj.drag_offset.y+c.y-40;var x_pan=Math.min(Math.max(0, 10-x_pos),(this.map.view_size.x-10-(x_pos+this.info_div.clientWidth)));var y_pan=Math.min(Math.max(0, 10-(y_pos-this.info_div.clientHeight)),(this.map.view_size.y-10-y_pos));this.map.pan(x_pan,y_pan);};info_window.prototype.show_window=function(){if(this.hide_timeout !=null){window.clearTimeout(this.hide_timeout);this.hide_timeout=null;};if(is_ie){this.redraw();this.info_div.style.display='';}else{this.info_div.style.display='';this.redraw();};};info_window.prototype.hide_window=function(){this.info_div.style.display='none';};info_window.prototype.delay_hide_window=function(){this.hide_timeout=oa(this,function(){this.hide_window()},250);};window.return_false=return_false;window.return_true=return_true;window.map=map;window.icon=icon;window.line=line;if(is_ie){window.polyline=polyline;}else{window.polyline=polyline_ns;};window.P=P;window.mark=mark;window.naver_mask=naver_mask;window.event_helper=event_helper;window.rectangle=rectangle;};naver_map();var debug_msg=new Array();var debug_line=10;var debug_row=60;function debug(msg,msg_buffer_number,output){var display="";var line="";if(msg_buffer_number==null){msg_buffer_number=0;};debug_buffer=debug_msg;if(output==null){if(document.getElementById('_debug_out')==null){var b=document.createElement("div");b.style.position="absolute";b.style.top=100;b.style.left=100;b.style.zIndex=100;b.id='_debug_out';b.style.width='200px';b.style.height='100px';b.style.backgroundColor='#FFFFFF';b.style.filter='alpha(opacity=50)';container.appendChild(b);};output=_debug_out;};debug_buffer.unshift(msg);if(debug_buffer.length > debug_line){debug_buffer.pop();};for(i=0;i<debug_buffer.length;i++){display=display+"&nbsp;&nbsp;&nbsp;"+debug_buffer[i];line=line+debug_buffer[i]+" ";if(line.length>debug_row){display=display+"<BR>";line="";}};output.innerHTML=display;}
