<!--
    var Obj         = document;             // OBJÀÇ À§Ä¡
    var now_level    = 0;                    // ÇöÀç ·¹º§
    var now_skip     = 0;                    // ÇöÀç ½ºÅ²
    var start_flag = 0;
    var index_map_onoff = 0;
    var flag = 0;
    var center_search_onoff = 0;
    var now_map_mode;
    var now_cns_type;
    var top_menu_flag = 0;
    var edit_flag = 0;
    var set_flag = 0;
    var adminof = 1;    // ÇàÁ¤±¸¿ª ÃÊ±â
    var symof     = 0;    // ½Éº¼ ÃÊ±â
    var txtof     = 0;    // ÅØ½ºÆ® ÃÊ±â
    var solidof = 0;    // 2.5D ÃÊ±â
    var mail_flag = 0;

    function overImg( menu, url )
    {
        menu.src = url
    }
    function outImg( menu, url )
    {
        menu.src = url
    }
    
    function MM_preloadImages() { //v3.0
        var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
        if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    }

    function MM_findObj(n, d) { //v4.01
        var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
        d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
    if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
    for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
    if(!x && d.getElementById) x=d.getElementById(n); return x;
    }

    function MM_swapImgRestore() { //v3.0
        var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
    }

    function MM_swapImage() { //v3.0
        var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
        if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
    }

    // ·¹º§À» ¼³Á¤ÇÕ´Ï´Ù.
    
    function level(level) {
        if (level == 10) {
            IMAPOCX1.SetFreeScaleMode(5000.0);
        } else if (level == 9) {
            IMAPOCX1.SetFreeScaleMode(8000.0);
        } else if (level == 8) {
            IMAPOCX1.SetFreeScaleMode(14000.0);
        } else if (level == 7) {
            IMAPOCX1.SetFreeScaleMode(28000.0);
        } else if (level == 6) {
            IMAPOCX1.SetFreeScaleMode(56000.0);
        } else if (level == 5) {
            IMAPOCX1.SetFreeScaleMode(110000.0);
        } else if (level == 4) {
            IMAPOCX1.SetFreeScaleMode(220000.0);
        } else if (level == 3) {
            IMAPOCX1.SetFreeScaleMode(400000.0);
        } else if (level == 2) {
            IMAPOCX1.SetFreeScaleMode(800000.0);
        } else if (level == 1) {
            IMAPOCX1.SetFreeScaleMode(6399470.0);
        }

        level_image_change(level);
    }

    // ·¹º§ ±×¸²À» º¯°æÇÕ´Ï´Ù.
    function level_image_change(level) {
        for (i=1; i<=10; i++) {
            if (i==1) ImgNum = "01";
            else if (i==2) ImgNum = "02";
            else if (i==3) ImgNum = "03";
            else if (i==4) ImgNum = "04";
            else if (i==5) ImgNum = "05";
            else if (i==6) ImgNum = "06";
            else if (i==7) ImgNum = "07";
            else if (i==8) ImgNum = "08";
            else if (i==9) ImgNum = "09";
            else if (i==10) ImgNum = "10";

            if (i == level) {
                document.all['level' + i].src = 'images/zlevel_step1b.gif';
                now_level = i;
            } else {
                document.all['level' + i].src = 'images/zlevel_step1.gif';
            }
        }
    }

    function map_level_minus() {
        if (now_level != 1) {
            level(now_level-1);
        }
    }

    function map_level_add() {
        if (now_level != 9) {
            level(now_level+1);
        }
    }

    // ±âº»ÀûÀÎ ½ºÅ² Ã³¸®
    function map_skip(type) {

        if (type == 1) {           // ÀÌÀü
            Obj.IMAPOCX1.OnMovePrevious();
        }

        else if (type == 2) {           // ´ÙÀ½
            Obj.IMAPOCX1.OnMoveNext();
        }

        else if (type == 3) {                // È®´ë
            Obj.IMAPOCX1.MapMode = 112;
        }

        else if (type == 4) {           // Ãà¼Ò
            Obj.IMAPOCX1.MapMode = 113;
        }

        else if (type == 5) {           // ÀÌµ¿
            Obj.IMAPOCX1.MapMode = 111;
        }

        else if (type == 6) {           // ÃÊ±âÈ­
        }

        else if (type == 7) {           // µ¸º¸±â
            Obj.IMAPOCX1.DoMagniFier();
        }

        else if (type == 8) {           // °Å¸®°è»ê
            Obj.IMAPOCX1.MapMode = 114;
        }

        else if (type == 9) {           // ¸éÀû°è»ê
            Obj.IMAPOCX1.MapMode = 115;
        }

        else if (type == 10) {           // ´Ù¸éÀû
            Obj.IMAPOCX1.MapMode        = 116;
        }

        else if (type == 11) {           // Ç©¸»Âï±â
            Obj.IMAPOCX1.OnToolTextNormal();
        }

        else if (type == 12) {           // Ç©¸»Ãë¼Ò
            Obj.IMAPOCX1.OnToolNormalDelete();
        }

        else if (type == 13) {           // °´Ã¼¼±ÅÃ
            Obj.IMAPOCX1.MapMode        = 125;
        }

        else if (type == 14) {           // Áöµµ¼¼ÆÃ
            if(set_flag == 0) {
                set_flag = 1;
                basic_layer.style.display = "none";
                edit_layer.style.display = "none";
                set_layer.style.display = "";
            } else {
                set_flag = 0;
                basic_layer.style.display = "";
                edit_layer.style.display = "none";
                set_layer.style.display = "none";
            }
        }
        
        else if (type == 15) {           // ¾àµµÆíÁý
            if(edit_flag == 0) {
                edit_flag = 1;
                basic_layer.style.display = "none";
                edit_layer.style.display = "";
                set_layer.style.display = "none";
            } else {
                edit_flag = 0;
                basic_layer.style.display = "";
                edit_layer.style.display = "none";
                set_layer.style.display = "none";
            }
        }
        
        else if (type == 16) {          // ÀÎµ¦½º
            if (index_map_onoff == 0) {
                    IMAPOCX1.OpenIndexMapCombo('2');
                    index_map_onoff = 1;
            } else {
                IMAPOCX1.CloseIndexMapCombo();
                index_map_onoff = 0;
            }
        }

        else if (type == 17) {           // ÇÁ¸°Æ®
            mail_flag = 0;
            var strDirectory = Obj.IMAPOCX1.GetZeroMapDirectory();
	        strDirectory += "\\urimapprint.dat";
	        Obj.IMAPOCX1.OnPrinting3(598,450,strDirectory);        
        }

        else if (type == 18) {          // ÀúÀå
            Obj.IMAPOCX1.OnImageSave();
        }

        else if (type == 19) {           // ¸ÞÀÏ
            mail_flag = 1;  
            var strDirectory = Obj.IMAPOCX1.GetZeroMapDirectory();
	        strDirectory += "\\urimapprint.dat";
	        Obj.IMAPOCX1.OnPrinting3(598,450,strDirectory);       
        }
        
        else if (type == 20) {          // µµ¿ò¸»
            var sUrl = 'map_help.html';
            var winl = (screen.width - 667) / 2;
            var wint = (screen.height - 620) / 2 ;
            var sEnv = 'toolbar=no, scrollbars=yes, directories=no, resizable=0, menubar=no, width=667, height=620,left='+ winl+',top=' + wint  ;
            remote = window.open('', 'Window', sEnv);
            remote.focus();
            remote.location.href = sUrl;
        }

        // ¸Þ´º ±×¸²À» º¯°æÇÕ´Ï´Ù.
        change_menu_image(type);
    }

     // ¸Þ´º ±×¸²À» º¯°æÇÕ´Ï´Ù.
    function change_menu_image(type) {

        for(i=3; i<=5; i++) {
            if (type == i) {
                Obj.all['skip' + i].src = 'images/mb' + i + '_o.gif';
                now_skip = i;
            } else {
                Obj.all['skip' + i].src = 'images/mb' + i + '_d.gif';
            }
        }
    }
    
    function index_map_location() {
        var location = indexmap.value;      
        document.IMAPOCX1.OpenIndexMap('2','http://korealife.chzero.com/map_option/indexmap',location); 
    }

    function center_search_view(Length) {
        document.IMAPOCX1.SetDrawRange(Length);
    }

    function make_sigungu(frm_name, obj) {
        if_make_sigungu_dong.location.href = "make_sigungu_dong.jsp?form_name=" + frm_name + "&search_sido=" + obj.value + "&db_sigungu=" + gSigungu;
    }

    function make_dong(frm_name, obj) {
        var frm = eval("document." + frm_name);
        if_make_sigungu_dong.location.href = "make_sigungu_dong.jsp?form_name=" + frm_name + "&search_sido=" + frm.search_sido.value + "&search_sigungu=" + obj.value;
    }
    
    function make_dong2(frm_name, _sido, _sigungu, _dong) {
        var frm = eval("document." + frm_name);
        if_make_sigungu_dong2.location.href = "make_sigungu_dong.jsp?form_name=" + frm_name + "&search_sido=" + _sido + "&search_sigungu=" + _sigungu + "&db_dong=" + _dong;
    }

    function view_left_layer(name) {
        if(name == "poi_search_layer") {
            poi_search_layer.style.display = "";
            addr_search_layer.style.display = "none";
            cate_search_layer.style.display = "none";
            cns_search_layer.style.display = "none";
            subway_search_layer.style.display = "none";
            document.all["top_menu1"].src = "images/left_tm1b.gif";
            document.all["top_menu2"].src = "images/left_tm2.gif";
            top_menu_flag = 0;
        } else if(name == "addr_search_layer") {
            addr_search_layer.style.display = "";
            poi_search_layer.style.display = "none";
            cate_search_layer.style.display = "none";
            cns_search_layer.style.display = "none";
            subway_search_layer.style.display = "none";
            document.all["top_menu1"].src = "images/left_tm1b.gif";
            document.all["top_menu2"].src = "images/left_tm2.gif";
            top_menu_flag = 0;
        } else if(name == "cate_search_layer") {
            cate_search_layer.style.display = "";
            addr_search_layer.style.display = "none";
            poi_search_layer.style.display = "none";
            cns_search_layer.style.display = "none";
            subway_search_layer.style.display = "none";
            document.all["top_menu1"].src = "images/left_tm1b.gif";
            document.all["top_menu2"].src = "images/left_tm2.gif";
            top_menu_flag = 0;
        } else if(name == "cns_search_layer") {
            cns_search_layer.style.display = "";
            cate_search_layer.style.display = "none";
            addr_search_layer.style.display = "none";
            poi_search_layer.style.display = "none";
            subway_search_layer.style.display = "none";
            document.all["top_menu1"].src = "images/left_tm1.gif";
            document.all["top_menu2"].src = "images/left_tm2b.gif";
            top_menu_flag = 1;
        } else if(name == "subway_search_layer") {
            subway_search_layer.style.display = "";
            cns_search_layer.style.display = "none";
            cate_search_layer.style.display = "none";
            addr_search_layer.style.display = "none";
            poi_search_layer.style.display = "none";
            document.all["top_menu1"].src = "images/left_tm1.gif";
            document.all["top_menu2"].src = "images/left_tm2b.gif";
            top_menu_flag = 1;            
        }
        
        if(name == "subway_search_layer") {
            zero_map.style.display = "none";
            menu_layer.style.display = "none";
            //search_xy_layer.style.display = "none";
            subway_map.style.display = "";
        } else {
            zero_map.style.display = "";
            menu_layer.style.display = "";
            //search_xy_layer.style.display = "";
            subway_map.style.display = "none";
        }
    }

    function map_editing(type) {
        if (type == 1) {                    // Àß³ª³»±â
            IMAPOCX1.UserEditCut();
        } else if (type == 2) {                // º¹»çÇÏ±â
            IMAPOCX1.UserEditCopy();
        } else if (type == 3) {                // ºÙ¿©³õ±â
            IMAPOCX1.UserEditPaste();
        } else if (type == 4) {                // ½Éº¼°ü¸®
            IMAPOCX1.OnToolSymbol();
        } else if (type == 5) {                // °³Ã¼¼±ÅÃ
            IMAPOCX1.OnSelectObject();
        } else if (type == 6) {                // °³Ã¼ÀüÃ¼¼±ÅÃ
            IMAPOCX1.OnSelectAll();
        } else if (type == 7) {                // È­»ìÇ¥ ±×¸®±â
            IMAPOCX1.OnToolArrow();
        } else if (type == 8) {                // Ç©¸» ±Û ¾²±â
            IMAPOCX1.OnToolText();
        } else if (type == 9) {                // Á÷¼±±×¸®±â
            IMAPOCX1.OnToolLine();
        } else if (type ==10) {                // ¿ø±×¸®±â
            IMAPOCX1.OnToolCircle();
        } else if (type ==11) {                // »ç°¢Çü±×¸®±â
            IMAPOCX1.OnToolRectangle();
        } else if (type ==12) {                // µÕ±Ù»ç°¢Çü±×¸®±â
            IMAPOCX1.OnToolRoundRect();
        } else if (type ==13) {                // Æú¸®°ï±×¸®±â
            IMAPOCX1.OnToolPolygon();
        } else if (type ==14) {                // ÆùÆ® ¼³Á¤
            IMAPOCX1.SetUserEditFont();
        } else if (type ==15) {                // Å×µÎ¸® »ö ¼³Á¤
            IMAPOCX1.SetUserEditLineColor();
        } else if (type ==16) {                // ¹ÙÅÁ»ö ¼³Á¤
            IMAPOCX1.SetUserEditBoundColor();
        } else if (type ==17) {                // ¸Ç¾ÕÀ¸·Î ÀÌµ¿
            IMAPOCX1.SetMoveToFront();
        } else if (type ==18) {                // ¸ÇµÚ·Î ÀÌµ¿
            IMAPOCX1.SetMoveToBack();
        } else if (type ==19) {                // ÇÏ³ª ¾ÕÀ¸·Î ÀÌµ¿
            IMAPOCX1.SetMoveToForward();
        } else if (type ==20) {                // ÇÏ³ª µÚ·Î ÀÌµ¿
            IMAPOCX1.SetMoveToPre();
        }
    }
    
        function map_setting(type) {
        if (type == 1) {
            // ÇàÁ¤°æ°è on/off
            if (adminof == 0) {
                IMAPOCX1.SetAdmiLineVisible(0);
                adminof = 1;
            } else if(adminof == 1) {
                IMAPOCX1.SetAdmiLineVisible(1);
                adminof = 0;
            }
        } else if (type == 2) {
            // ½Éº¼ on/off
            if (symof == 0) {
                IMAPOCX1.SetSymbolVisible(0);
                symof   = 1;
            }
            else if(symof == 1) {
                IMAPOCX1.SetSymbolVisible(1);
                symof   = 0;
            }
        } else if (type == 3) {
            // ÅØ½ºÆ® on/off
            if (txtof == 0) {
                IMAPOCX1.SetTextVisible(0);
                txtof = 1;
            }
            else if(txtof == 1) {
                IMAPOCX1.SetTextVisible(1);
                txtof = 0;
            }
        } else if (type == 4) {
            // 2.5D on/off
            if (solidof == 0) {
                IMAPOCX1.SetQuarterViewVisible(0);
                solidof = 1;
            }
            else if(solidof == 1) {
                IMAPOCX1.SetQuarterViewVisible(1);
                solidof = 0;
            }
        }
    }
    
// ÇÁ¸°Æ®È­¸éÀ» º¸¿©ÁÝ´Ï´Ù.
var g_print_file_name;
function print_view(strFileName) {
	g_print_file_name = strFileName;
    url = "./map_print.html";

    window.open(url,"","status=no,toolbar=no,scrollbars=yes,width=670,height=620");
}

// ¸ÞÀÏÈ­¸éÀ» º¸¿©ÁÝ´Ï´Ù.
function mail_view(strFileName) {
    url = "./map_mail.html";

    window.open(url,"","status=no,toolbar=no,scrollbars=yes,width=670,height=620");
}

	function zr() {
	   this.hl = document.getElementsByTagName("head").item(0);
	   this.sc = 0;
	   this.sa = new Array();
	}
	
	zr.prototype.ast = function (f) {
		var now = new Date() 
		this.noCacheIE = "&noCacheIE="+ now.getTime(); 
		this.fullUrl = f; 
		this.scriptId = "YJscriptId" + this.sc++;
		this.scriptObj = document.createElement("script");
		this.scriptObj.setAttribute("type", "text/javascript");
		this.scriptObj.setAttribute("src", this.fullUrl + this.noCacheIE);
		this.scriptObj.setAttribute("id", this.scriptId);
		this.hl.appendChild(this.scriptObj);
		this.sa.push(this.scriptObj);
	}
	zr.prototype.rst = function() {
		this.sc--;
		if(this.sc == 0){
			while(this.sa.length){
				this.hl.removeChild(this.sa.pop()); 
			}
		}
	}
	
	var g_zr = new zr();	
	
	var gForm;
	
	function getSigungu(_form) {
		gForm = _form;
		
		var getUrl = "http://www.chzero.com/GetDongCode?sido=" + _form.search_sido.value;
	    getUrl += "&callBack=setSigungu";
	    g_zr.ast(getUrl); 
	}
	
	function setSigungu(jData) {
		//alert(jData);
		
		for(var inx = gForm.search_sigungu.length; inx >= 0; inx--) {
	    	gForm.search_sigungu.options[inx] = null;
	    }
	
		var opt = new Option('½Ã/±¸/±º','',true);
		gForm.search_sigungu.options[0] = opt;
		
		if(jData.DONGCODE != null && typeof(jData.DONGCODE) != "undefined") {           
			var jnx = 1;
	        for(var inx = 0 ; inx < jData.DONGCODE.length ; inx++) {
	        	if(jData.DONGCODE[inx].ADM != "") {
		        	opt = new Option(jData.DONGCODE[inx].ADM,jData.DONGCODE[inx].ADM, true);
		        	gForm.search_sigungu.options[jnx] = opt;
		        	if(gForm.search_sigungu.options[jnx].value == gSigungu) {
		        		gForm.search_sigungu.options[jnx].selected = true;
		        	}
		        	jnx++;
	        	}
	        }
	            
		}
	}	
	function getRoad(_form) {
		gForm = _form;
		
		for(var inx = _form.rd_nm.options.length - 1 ; inx > 0 ; inx--) {
        	_form.rd_nm.options[inx] = null;
	    }
	        
		var getUrl = "http://www.chzero.com/GetRoadCode?sido=" + _form.search_sido.value + "&sigungu=" + _form.search_sigungu.value;
	    getUrl += "&callBack=setRoad";
	    g_zr.ast(getUrl); 
	}
	
	function getRoad2(_form, _sido, _sigungu) {
		gForm = _form;
		
		for(var inx = _form.rd_nm.options.length - 1 ; inx > 0 ; inx--) {
        	_form.rd_nm.options[inx] = null;
	    }
	        
		var getUrl = "http://www.chzero.com/GetRoadCode?sido=" + _sido + "&sigungu=" + _sigungu;
	    getUrl += "&callBack=setRoad";
	    g_zr.ast(getUrl); 
	}	
	
	function setRoad(jData) {
		//alert(jData);
		
		for(var inx = gForm.rd_nm.length; inx >= 0; inx--) {
	    	gForm.rd_nm.options[inx] = null;
	    }
	
		var opt = new Option('µµ·Î¸íÀ» ¼±ÅÃÇÏ¼¼¿ä.','',true);
		gForm.rd_nm.options[0] = opt;
		
		if(jData.ROADCODE != null && typeof(jData.ROADCODE) != "undefined") {     		      
			var jnx = 1;
	        for(var inx = 0 ; inx < jData.ROADCODE.length ; inx++) {
	        	if(jData.ROADCODE[inx].RD_NM != null && typeof(jData.ROADCODE[inx].RD_NM) != "undefined" && jData.ROADCODE[inx].RD_NM != "") {
		        	opt = new Option(jData.ROADCODE[inx].RD_NM,jData.ROADCODE[inx].RD_NM, true);
		        	gForm.rd_nm.options[jnx] = opt;
		        	if(gForm.rd_nm.options[jnx].value == gRdNm) {
		        		gForm.rd_nm.options[jnx].selected = true;
		        	}
		        	jnx++;
	        	}
	        }
	            
		}
	}	
//-->

