	
	/*
		Àü¿ªº¯¼ö _ajax_name Àº ÇØ´ç ÆäÀÌÁö¿¡ ¼±¾ð
	*/
	
	var _HCODE_MIDDLE;
	var _HCODE_SMALL;
		
	//ÁöµµÀÌµ¿ÈÄ ÄÞº¸¹Ú½º ¼¼ÆÃ
	function SetHCodeComboBox_Ajax(lon, lat)
	{
		try
		{
			eval(_ajax_name+"_aspx").GetHCodeByCoord(lon, lat, GetHCodeByCoord_CallBack);	
		}catch(ex){
			//setTimeout("SetHCodeComboBox(" + lon + ", " + lat + ")", 2000);
		}
	}
	function SetHCodeChangeAr1(hcode)
	{
		H_ChangeAr1_Ajax(hcode);
	}
	function GetHCodeByCoord_CallBack(res)
	{
		try{
			var hCode = res.value;
			
			//Àü¿ªº¯¼ö ¼ÂÆÃ
			if( hCode != null && hCode != "" ) {
				_HCODE_MIDDLE = hCode.substring(0,5);
				_HCODE_SMALL = hCode;
				
				SetHCodeChangeAr1(hCode);
			}
			//$("yeda").value += "GetHCodeByCoord_CallBack \n";
		}catch(ex){
		}
	}
	
	function SetHCodeValue(hcode, objName)
	{
		var comboValue = "";
		for(var i=0; i < document.f_ar[objName].length; i++)
		{
			comboValue = document.f_ar[objName].options[i].value.split(",")[0];

			if(comboValue == hcode)
			{
				document.f_ar[objName].options[i].selected = true;
			}
		}
	}
	//½Ãµµ º¯°æ½Ã ÁÖ¼Ò °Ë»ö
	function H_ChangeAr1_Ajax(hcode) 
	{
		//onMoved ÀÌº¥Æ®¿¡¼­ Áö¿ªÀÌµ¿ ¼¼ÆÃ½Ã¿¡´Â hcode °ªÀÌ ³Ñ¾î¿Â´Ù.
		//Áö¿ªÀÌµ¿ ÄÞº¸¹Ú½º¿¡ ÀÇÇÑ È£Ãâ½Ã hcode °ªÀº null
		if(hcode != null)	
			SetHCodeValue(hcode.substring(0,2), "H_LARGE");	//ÇØ´çÁö¿ªÀÇ H_LARGE ÄÞº¸ Select
		
	
		var idx,code;
		idx = document.f_ar['H_LARGE'].selectedIndex;	
		code = document.f_ar['H_LARGE'].options[idx].value;

		arryCode = code.split(',');
	    if(hcode == null){
		    document.f_ar.h_code.value = arryCode[0];
			document.f_ar.set_lon.value = arryCode[1]*10;
			document.f_ar.set_lat.value = arryCode[2]*10;
		}
		
		obj = document.f_ar['H_MIDDLE'];
		obj.length = 0;	
		obj.length++;
		obj.options[0].value = '';
		obj.options[0].text = 'Loading...';
		
		obj = document.f_ar['H_SMALL'];
		obj.length = 0;	
		obj.length++;
		obj.options[0].value = '';
		obj.options[0].text = 'µ¿/À¾/¸é';
		
		if(hcode == null)
		{
			if(arryCode[0].substring(0,2) > 70) //ºÏÇÑÁö¿ª ¼±ÅÃ½Ã /ClientUI/JS/HCodeLib.js ÂüÁ¶
				Mountain_North_MiddleHCode(arryCode[0], document.f_ar['H_MIDDLE'], document.f_ar['H_SMALL'], hcode);  
			else {
				eval(_ajax_name+"_aspx").GetHCodeLargeList(arryCode[0], GetHCodeList_CallBack);
            }
		}
		else
		{
			if(arryCode[0].substring(0,2) > 70) //ºÏÇÑÁö¿ª ¼±ÅÃ½Ã /ClientUI/JS/HCodeLib.js ÂüÁ¶
				Mountain_North_MiddleHCode(arryCode[0], document.f_ar['H_MIDDLE'], document.f_ar['H_SMALL'], hcode);  
			else
				eval(_ajax_name+"_aspx").GetHCodeLargeList(parseInt(hcode.substring(0,2)), GetHCodeList_CallBack);
		}
			
		var codeArr = code.split(",");
		if(hcode == null) {
			SetLevelCenterMove(codeArr[1], codeArr[2], 9);		//ÇØ´çÆäÀÌÁö¿¡ ¼±¾ð
			}
		
		if(hcode != null){
			H_ChangeAr2_Ajax(hcode);
		}
		
		//$("yeda").value += "H_ChangeAr1_Ajax \n";
	}

	//±¸±º º¯°æ½Ã ÁÖ¼Ò °Ë»ö
	function H_ChangeAr2_Ajax(hcode) 
	{	
		if(hcode == null)
		{
			var idx,code;
			idx = document.f_ar['H_MIDDLE'].selectedIndex;		
			if (idx < 1) {
				obj = document.f_ar['H_SMALL'];
				obj.length = 0;
				obj.length++;
				obj.options[0].value = '';
				obj.options[0].text = 'µ¿/À¾/¸é';
				
				idx = document.f_ar['H_LARGE'].selectedIndex;	
				code = document.f_ar['H_LARGE'].options[idx].value;

				arryCode = code.split(',');
				document.f_ar.h_code.value = arryCode[0];
				document.f_ar.set_lon.value = arryCode[1]*10;
				document.f_ar.set_lat.value = arryCode[2]*10;
				return;
			}
		
			code = document.f_ar['H_MIDDLE'].options[idx].value;

			arryCode = code.split(',');
			document.f_ar.h_code.value = arryCode[0];
			document.f_ar.set_lon.value = arryCode[1]*10;
			document.f_ar.set_lat.value = arryCode[2]*10;

			obj = document.f_ar['H_SMALL'];
			obj.length = 0;	
			obj.length++;
			obj.options[0].value = '';
			obj.options[0].text = 'Loading...';

			eval(_ajax_name+"_aspx").GetHCodeMiddleList(arryCode[0], GetHCodeList_CallBack);
			
			var codeArr = code.split(",");
			SetLevelCenterMove(codeArr[1], codeArr[2], 8);			//ÇØ´çÆäÀÌÁö¿¡ ¼±¾ð
		}
		else	//ÁöµµÀÌµ¿½Ã ÄÞº¸ ¼ÂÆÃ
		{
			eval(_ajax_name+"_aspx").GetHCodeMiddleList(hcode.substring(0,5), GetHCodeList_CallBack);
		}
		//$("yeda").value += "H_ChangeAr2_Ajax \n";
	}
	//µ¿ º¯°æ½Ã ÁÖ¼Ò °Ë»ö	
	function H_ChangeAr3_Ajax(hcode) {
		var idx,code;
		idx = document.f_ar['H_SMALL'].selectedIndex;
		if (idx < 1) {
			idx = document.f_ar['H_MIDDLE'].selectedIndex;
			code = document.f_ar['H_MIDDLE'].options[idx].value;
			arryCode = code.split(',');
			document.f_ar.h_code.value = arryCode[0];
			document.f_ar.set_lon.value = arryCode[1]*10;
			document.f_ar.set_lat.value = arryCode[2]*10;
			return;
		}
		
		code = document.f_ar['H_SMALL'].options[idx].value;
		arryCode = code.split(',');
		document.f_ar.h_code.value = arryCode[0];
		document.f_ar.set_lon.value = arryCode[1]*10;
		document.f_ar.set_lat.value = arryCode[2]*10;
		
		var codeArr = code.split(",");
		SetLevelCenterMove(codeArr[1], codeArr[2], 5);			//ÇØ´çÆäÀÌÁö¿¡ ¼±¾ð
		
		//$("yeda").value += "H_ChangeAr3_Ajax \n";
	}	
	
	function GetHCodeList_CallBack(res)
	{	
		try
		{
			var obj = document.f_ar[res.value.Tables[1].Rows[0]["name"]];
			if (obj == "undefined") {
				setTimeout("SetAr()",1000);
				return;
			}
			obj.length = 0;
			obj.length++;
			obj.options[0].value = '';
			
			if(res.value.Tables[1].Rows[0]["name"] == "H_MIDDLE")
				obj.options[0].text = '½Ã/±º/±¸';
			else
				obj.options[0].text = 'µ¿/À¾/¸é';
				
			var i = 1;
			
			for(var m=0;m < res.value.Tables[0].Rows.length;m++)
			{
				obj.length++;
				obj.options[i].value = res.value.Tables[0].Rows[m]["h_code"] +","+ res.value.Tables[0].Rows[m]["lon"]+","+res.value.Tables[0].Rows[m]["lat"];
				obj.options[i].text = res.value.Tables[0].Rows[m]["name"];
				
				if(res.value.Tables[1].Rows[0]["name"] == "H_MIDDLE"){
					if(res.value.Tables[0].Rows[m]["h_code"] == _HCODE_MIDDLE) {
						obj.options[i].selected = true;
					}
				}
				if(res.value.Tables[1].Rows[0]["name"] == "H_SMALL"){
					if(res.value.Tables[0].Rows[m]["h_code"] == _HCODE_SMALL) {
						obj.options[i].selected = true;			
					}
				}	
				i++;
			}
		}catch(ex){
			var obj = document.f_ar["H_MIDDLE"];
			obj.options[0].text = '½Ã/±º/±¸';
		}
	}

	
	
	