	//ÁöµµÀÌµ¿ÈÄ ÄÞº¸¹Ú½º ¼¼ÆÃ
	function SetHCodeComboBox_Ajax(lon, lat)
	{
		try
		{
			SearchMap_aspx.GetHCodeByCoord(lon, lat, GetHCodeByCoord_CallBack);	
		}catch(ex){
			//setTimeout("SetHCodeComboBox(" + lon + ", " + lat + ")", 2000);
		}
	}
	function SetHCodeChangeAr1(hcode)
	{
		H_ChangeAr1_Ajax(hcode);
	}
	function GetHCodeByCoord_CallBack(res)
	{
		var hCode = res.value;
		
		//Àü¿ªº¯¼ö ¼ÂÆÃ
		_HCODE_MIDDLE = hCode.substring(0,5);
		_HCODE_SMALL = hCode;
		
		SetHCodeChangeAr1(hCode);
	}
	// ÅëÇÕ°Ë»ö 
	function ResultDataTotal_Ajax(sx, sy, ex, ey, order) 
	{
		CATECODE = "99";
		isTotalSearch = true;
		
		SearchMap_aspx.ResultDataTotal(parseInt(sx), parseInt(sy), parseInt(ex), parseInt(ey), order, ResultDataTotal_CallBack);	
	}
	function ResultDataTotal_CallBack(res)
	{
		try
		{
			document.getElementById("resultData").style.display = "";
			document.getElementById("searchIngMsg").style.display = "none";
			
			if(res.value.Tables[0].Rows.length == 0 && res.value.Tables[2].Rows.length == 0 && res.value.Tables[4].Rows.length == 0)
			{
				SetNoResultMessage();
			}
			else
			{
				if(res.value.Tables[2].Rows.length > 0)
				{
					POIAddHandler("ClimbBook", res, 2);
					PrintHtmlHandler("ClimbBook", res, 2);
				}
				if(res.value.Tables[4].Rows.length > 0)
				{
					POIAddHandler("Theme", res, 4);
					PrintHtmlHandler("Theme", res, 4);		
				}
				if(res.value.Tables[0].Rows.length > 0)
				{
					POIAddHandler("ClimbInfo", res, 0);
					PrintHtmlHandler("ClimbInfo", res, 0);
				}				
			}
		}
		catch(ex)
		{
		}
		finally
		{
			isTotalSearch = false;
		}
	}
	//»êÁ¤º¸ °Ë»ö
	function ResultClimbInfoData_Ajax(sx, sy, ex, ey, order, pageNo)
	{
		isInfoSearch = true;
		var pageSize;		
		if(SEARCH_KIND == "total")
			pageSize = _PAGESIZE;
		else
			pageSize = _SUBPAGESIZE;
		SearchMap_aspx.ResultClimbInfoData(parseInt(sx), parseInt(sy), parseInt(ex), parseInt(ey), order, pageNo, pageSize, ResultClimbInfoData_CallBack);		
	}
	function ResultClimbInfoData_CallBack(res)
	{	
		try
		{
			document.getElementById("resultData").style.display = "";
			document.getElementById("searchIngMsg").style.display = "none";
			
			if(res.value.Tables[0].Rows.length > 0)
			{
				PrintHtmlHandler("ClimbInfo", res, 0);
				POIAddHandler("ClimbInfo", res, 0);
			}
			else
			{
				SetNoResultMessage();
			}
		}catch(ex){
		}finally{
			isInfoSearch = false;
		}
	}
	//»êÇà±â °Ë»ö
	function ResultClimbBookData_Ajax(sx, sy, ex, ey, order, pageNo)
	{
		isBookSearch = true;
		var pageSize;		
		if(SEARCH_KIND == "total")
			pageSize = _PAGESIZE;
		else
			pageSize = _SUBPAGESIZE;
			
		SearchMap_aspx.ResultClimbBookData(parseInt(sx), parseInt(sy), parseInt(ex), parseInt(ey), order, pageNo, pageSize, ResultClimbBookData_CallBack);	
	}
	function ResultClimbBookData_CallBack(res)
	{
		try
		{
			document.getElementById("resultData").style.display = "";
			document.getElementById("searchIngMsg").style.display = "none";
			
			if(res.value.Tables[0].Rows.length > 0)
			{
				PrintHtmlHandler("ClimbBook", res, 0);
				POIAddHandler("ClimbBook", res, 0);
			}
			else
			{
				SetNoResultMessage();
			}
		}catch(ex){
		}finally{
			isBookSearch = false;
		}
	}
	//Å×¸¶ °Ë»ö
	function ResultThemeData_Ajax(sx, sy, ex, ey, pageNo, cateCode)
	{	
		isThemeSearch = true;
		var pageSize;
		if(SEARCH_KIND == "total")
			pageSize = _PAGESIZE;
		else
			pageSize = _SUBPAGESIZE;		
		SearchMap_aspx.ResultThemeData(parseInt(sx), parseInt(sy), parseInt(ex), parseInt(ey), pageNo, pageSize, cateCode, ResultThemeData_CallBack);	
	}
	function ResultThemeData_CallBack(res)
	{
		try
		{
			document.getElementById("resultData").style.display = "";
			document.getElementById("searchIngMsg").style.display = "none";
			
			if(res.value.Tables[0].Rows.length > 0)
			{
				PrintHtmlHandler("Theme", res, 0);
				POIAddHandler("Theme", res, 0);
			}
			else
			{
				SetNoResultMessage();
			}		
		}catch(ex){
		}finally{
			isThemeSearch = false;
		}
	}
	//»ç¿ëÀÚ Å×¸¶ °Ë»ö
	function ResultUserThemeData_Ajax(sx, sy, ex, ey, pageNo, cateCode) 
	{
		isUserThemeSearch = true;
		var pageSize;
		if(SEARCH_KIND == "total")
			pageSize = _PAGESIZE;
		else
			pageSize = _SUBPAGESIZE;
		SearchMap_aspx.ResultUserThemeData(parseInt(sx), parseInt(sy), parseInt(ex), parseInt(ey), pageNo, pageSize, cateCode, ResultUserThemeData_CallBack);	
	}
	function ResultUserThemeData_CallBack(res)
	{
		try
		{
			document.getElementById("resultData").style.display = "";
			document.getElementById("searchIngMsg").style.display = "none";
			
			if(res.value.Tables[0].Rows.length > 0)
			{
				PrintHtmlHandler("UserTheme", res, 0);
				POIAddHandler("UserTheme", res, 0);
			}
			else
			{
				SetNoResultMessage();
			}			
		}catch(ex){
		}finally{
			isUserThemeSearch = false;
		}
	}
	//ÇØ´ç »êÀÇ ÄÚ½º Select
	function SetCourseList_Ajax(poiID)
	{
		SearchMap_aspx.SelectCourseList(poiID, SelectCourseList_CallBack);
	}
	 
	function SelectCourseList_CallBack(res)
	{	
		try
		{
			var courseListArr = new Array();
			for(var i = 0; i < res.value.Tables[4].Rows.length; i++)
			{
				courseListArr.push(parseInt(res.value.Tables[4].Rows[i]["course_id"]));
			}
			
			MTMan.MTAdd(courseListArr, 1, res.value.Tables[0].Rows[0]["fname"], res.value.Tables[0].Rows[0]["ltlon"], res.value.Tables[0].Rows[0]["ltlat"], 
									res.value.Tables[0].Rows[0]["rblon"], res.value.Tables[0].Rows[0]["rblat"], res.value.Tables[0].Rows[0]["viewlevel"], res.value.Tables[0].Rows[0]["poi_id"]);
									
			//document.getElementById("courseId").value = courseListArr + " " + res.value.Tables[0].Rows[0]["fname"] + " " + res.value.Tables[0].Rows[0]["ltlon"] + " " + res.value.Tables[0].Rows[0]["ltlat"]+ " " + 
			//						res.value.Tables[0].Rows[0]["rblon"]+ " " + res.value.Tables[0].Rows[0]["rblat"];							
			courseListArr = new Array();
			
			isSelectMountain.check = true;
			isSelectMountain.ltlon = res.value.Tables[0].Rows[0]["ltlon"];
			isSelectMountain.ltlat = res.value.Tables[0].Rows[0]["ltlat"];
			isSelectMountain.rblon = res.value.Tables[0].Rows[0]["rblon"];
			isSelectMountain.rblat = res.value.Tables[0].Rows[0]["rblat"];
		}catch(ex){
		}finally{
			var Coord = MapMan.GetCenterCoord();	
			SetHCodeComboBox_Ajax(Coord.Lon, Coord.Lat);
			SetMTUrlValue(Coord.Lon, Coord.Lat);
			begin();
			SetResultSearch("total", 1);	//ÇØ´ç ¿µ¿ª°Ë»ö È£Ãâ
		}
	}

	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
				SearchMap_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
				SearchMap_aspx.GetHCodeLargeList(parseInt(hcode.substring(0,2)), GetHCodeList_CallBack);
		}

		var codeArr = code.split(",");
		if(hcode == null) {
		    CenterMove(codeArr[1], codeArr[2], 9);
        }
		
		if(hcode != null){
			H_ChangeAr2_Ajax(hcode);
		}
	}

	//±¸±º º¯°æ½Ã ÁÖ¼Ò °Ë»ö
	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...';

			SearchMap_aspx.GetHCodeMiddleList(arryCode[0], GetHCodeList_CallBack);
			
			var codeArr = code.split(",");
			CenterMove(codeArr[1], codeArr[2], 8);
		}
		else	//ÁöµµÀÌµ¿½Ã ÄÞº¸ ¼ÂÆÃ
		{
			SearchMap_aspx.GetHCodeMiddleList(hcode.substring(0,5), GetHCodeList_CallBack);
		}
	}
	//µ¿ º¯°æ½Ã ÁÖ¼Ò °Ë»ö	
	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(",");
		CenterMove(codeArr[1], codeArr[2], 5);
	}	
	
	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 = '½Ã/±º/±¸';
		}
	}
	