	if(typeof KCTA == "undefined"){
		var KCTA = {
			namespace: function(){
				var a=arguments, o=null, i, j, d;
				for (i=0; i<a.length; i=i+1) {
					d=a[i].split(".");
					o=KCTA;
	
					for (j=0; j<d.length; j=j+1) {
						o[d[j]]=o[d[j]] || {};
						o=o[d[j]];
					}
				}
	
				return o;				
			},
			
			
			// °³Ã¼ È®Àå..
			extend: function(destination, source) {
				for (var property in source) {
					destination[property] = source[property];
				}
				
				return destination;
			},
			
			
			// ÆÄ¶ó¹ÌÅÍ °´Ã¼ÀÇ ¸ðµç ÀÚ½Ä³ëµå »èÁ¦..
			removeAllChildNodes: function(obj) {
				if ( obj )
					while(obj.childNodes[0])
						obj.removeChild(obj.childNodes[0]);
				return;
			}
		};
	}


	
	/* »ó´Ü TOP ¸Þ´º */
	KCTA.namespace("MENU.TOP");

	KCTA.MENU.TOP = {
		txtSearch: null,					// Çì´õ¿µ¿ªÀÇ °Ë»ö¾î ÇÊµå..
		btnSearch: null,					// Çì´õ¿µ¿ªÀÇ °Ë»ö ¹öÆ°..

		// ÃÊ±âÈ­ ¹× ÀÌº¥Æ® Listener µî·Ï..
		Init: function(){
			var oThis = this;

			oThis.txtSearch = $("txtHeaderSearch");
			oThis.btnSearch = $("btnHeaderSearch");

			oThis.btnSearch.style.cursor = "hand";

			oThis.txtSearch.onkeyup = function(){
				if( window.event.keyCode == 13 ){
					oThis.Search();
				} else{
					return;
				}
			};

			oThis.btnSearch.onclick = function(){
				oThis.Search();
			};
		},


		// °Ë»ö..
		Search: function(){
			window.location.href = "/footer/m00_search_list.asp?schString=" + escape(this.txtSearch.value);
		},

		
		// ·Î±×ÀÎ ÆäÀÌÁö ÀÌµ¿..
		goLogin: function(){
			SetCookie("rtnUrl", location.href, 1);
			window.location.href = "/member/m00_mem_frmLogin.asp";
		},
		
		
		// ·Î±×¾Æ¿ô..
		goLogOut: function(){
			var oHiddenFrame = document.getElementById("runHere");
	
			if( !oHiddenFrame ){
				oHiddenFrame = document.createElement("iframe");
				oHiddenFrame.id = oHiddenFrame.name = "runHere";
				oHiddenFrame.style.display = "none";
	
				document.body.appendChild( oHiddenFrame );
			}
	
			oHiddenFrame.src = "/member/behind_codes/member_logout.asp";
		},
		
		
		// È¸¿ø°¡ÀÔ ÆäÀÌÁö ÀÌµ¿..
		goJoin: function(){
			window.location.href = "/member/m00_mem_s1_joinyn.asp";
		},
		
		
		// °³ÀÎÁ¤º¸¼öÁ¤ ÆäÀÌÁö ÀÌµ¿..
		goMyInfo: function(){
			window.location.href = "/member/m00_mem_frmEdit.asp";
		},
		
		
		// Contact US ÆäÀÌÁö ÀÌµ¿..
		goContactUS: function(){
			window.location.href = "/introduce/m01_sketch.asp";
		},
		
		
		// SiteMap ÆäÀÌÁö ÀÌµ¿..
		goSiteMap: function(){
			alert("ÁØºñÁßÀÔ´Ï´Ù.");
			return;			
		}
	};
	
	
	
	
	
	/* ÇÏ´Ü È¸¿ø»ç °Ë»ö ¹× Ã¤³Î°Ë»ö */
	KCTA.namespace("MENU.BOTTOM");
	
	KCTA.MENU.BOTTOM = {
		http: null,

		selSido: null,					// ½Ã/µµ ¸®½ºÆ®..
		selGugun: null,					// ±¸/±º ¸®½ºÆ®..
		selChannel: null,				// Ã¤³Î ¸®½ºÆ®..

		btnSearch: null,				// °Ë»ö¹öÆ°..


		// ÃÊ±âÈ­ ¹× ÀÌº¥Æ® Listener µî·Ï..
		Init: function(){
			var oThis = this;

			oThis.http = new oXMLHttp();

			oThis.selSido = $("selFooterSido");
			oThis.selGugun = $("selFooterGugun");
			oThis.selChannel = $("selFooterChannel");

			oThis.btnSearch = $("btnFooterSearch");

			if( oThis.selSido.options.length > 0 ){
				oThis.btnSearch.style.cursor = "hand";

				oThis.selSido.onchange = function(){
					oThis.initGugunList();

					if(this.selectedIndex > 0){
						KCTA.MENU.BOTTOM.getGugunList( this.value );
					}
				}
			}


			oThis.selChannel.onchange = function(){
				window.location.href = "/umember/m05_chInfo.asp?channel_cd=" + this.value;
			};
			

			oThis.btnSearch.onclick = function(){
				if( (oThis.selSido.selectedIndex > 0) && (oThis.selGugun.selectedIndex > 0) ){
					oThis.Search(oThis.selSido.value, oThis.selGugun.value);
				} else{
					window.location.href = "/umember/m05_location_list.asp?sido_cd=" + oThis.selSido.value;
				}
			};
		},


		// °Ë»ö..
		Search: function(sido_cd, gugun){
			window.location.href = "/umember/m05_location_list.asp?sido_cd=" + sido_cd + "&gugun=" + escape(gugun);
		},


		// ±¸/±º ¸®½ºÆ® ÃÊ±âÈ­..
		initGugunList: function(){
			for(var i=1; i<this.selGugun.options.length; i++){
				this.selGugun.options[i] = null;
			}
		},


		// ±¸/±º °Ë»ö..
		getGugunList: function(sCode){
			this.selGugun.disabled = true;

			this.http.sendRequest(
				"/common/behind_codes/getFooterGugunList.asp?code=" + sCode, 
				null, 
				"KCTA.MENU.BOTTOM.updateGugunList"
			);
		},


		// ±¸/±º °Ë»ö °á°ú Ç¥½Ã..
		updateGugunList: function(xmlHttp){
			var txtJSON = xmlHttp.responseText;

			if(txtJSON.length > 10){
				var oDATA = txtJSON.parseJSON();

				for(var i=0; i<oDATA.length; i++){
					this.selGugun.options[i+1] = new Option( oDATA[i], oDATA[i] );
				}

				this.selGugun.disabled = false;
				this.selGugun.focus();
			}
		}
	};
	
	
