		/* common.js */
	function getCookie(strName)
	{
		var strArg = new String(strName + "=");	
		var nArgLen, nCookieLen, nEnd;
		var i = 0, j;
		
		nArgLen    = strArg.length;
		nCookieLen = document.cookie.length;
		
		if(nCookieLen > 0){
			while(i < nCookieLen){
				j = i + nArgLen;
				if(document.cookie.substring(i, j) == strArg){
					nEnd = document.cookie.indexOf (";", j);
					if(nEnd == -1) nEnd = document.cookie.length;
					return unescape(document.cookie.substring(j, nEnd));
				}
				i = document.cookie.indexOf(" ", i) + 1;
				if (i == 0) break;
		}
	}
	return "";
	}
	function popHistory(no)
	{
		var arURL = new Array("/HKPay/my_pay_list.asp", "/HK_Payment/MBP_History.asp");
		var winHis = window.open(arURL[no], "History", "width=570,height=420,scrollbars=no,resizable=no");
	}
	function popMBCharge(szMode)
	{
		if(!szMode)
			var winMBCharge = window.open("/HK_Payment/pop_MBManage.asp", "MBManage", "width=461,height=575,resizable=no,statusbars=no");
		else
			var winMBCharge = window.open("/HK_Payment/en_pop_MBManage.asp", "MBManage", "width=461,height=575,resizable=no,statusbars=no");
	}
	function point_charge(szMode, szENChk)
	{
		if (!szMode)
			szMode = "buy"
		if (typeof(szENChk) == "string" || typeof(szENChk) == "number")
			szENChk = "en_"
		else
			szENChk = ""
		var winHKCharge = window.open("/HK_Payment/" + szENChk + "pop_HKManage.asp?mode=" + szMode, "HKManage", "width=461,height=575,resizable=no,statusbars=no");
	}
	function MM_showHideLayers() 
	{ //v9.0
	  var i,p,v,obj,args=MM_showHideLayers.arguments;
	  for (i=0; i<(args.length-2); i+=3) 
	  with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2];
	    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
	    obj.visibility=v; }
	}
	function MM_openBrWindow(theURL,winName,features) 
	{ //v2.0
 		window.open(theURL,winName,features);
	}
	
	//¼ýÀÚ¸¸ ÀÔ·Â¹Þ±â
	function onlyNumber() 
	{
      if((event.keyCode<48)||(event.keyCode>57))
         event.returnValue=false;
	}
	
	function checkBalance(szUID, objNm)
	{
		new Ajax.Request('/HKBoard/Employ/biz_proc.asp',
		{
			method:'post',
			parameters: {mode: 'checkBalance', userid: szUID},
			asynchronous: false,
			onSuccess: function(transport)
			{
				var response = transport.responseText;
				$(objNm).value = response;
				return response;
			},
			onFailure: function(transport)
			{
				var response = transport.responseText;
				$(objNm).value = -1;
				return -1;
			}
		});
	}
	
	function searchOnGMas(szAddr)
	{
		var winMap = window.open("http://maps.google.com/maps?f=q&hl=en&q=" + szAddr);
	}
	
	// Function for controlling a certain type of board so admin can manage
	function setField(nBoard, nIdx, szField, nVar, obj)
	{
		new Ajax.Updater(obj, '/common/proc_SetField.asp',
		{
			method:'post',
			parameters: {idx:nIdx, board_no:nBoard, field:szField, amount:nVar},
			insertion: Insertion.top
		});
	}

		function showTicketWindow(bToggle, szReceiver, nKind, nBoardNo, nArticleNo)
	{
		if(bToggle) {
			if ($('ticket_observer').value.length == 0)
			{
				alert("·Î±×ÀÎ ÇÑ È¸¿ø¸¸ ½Å°í¸¦ ÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù.");
				showTicketWindow(false);
				return;
			}
			$('div_edit').style.opacity = 1.9;
			$('div_edit').style.filter = 'progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=90);opacity=1.90;';
			$('div_overlay').style.display = '';
			$('div_edit').style.display = '';
			$('div_container').style.height = '330px';
			$('ticket_receiver').value = szReceiver;
			$('ticket_boardno').value = nBoardNo;
			$('ticket_articleno').value = nArticleNo;
			$('ticket_kind').value = nKind;
			processLoading(false);
		}
		else {
			$('div_edit').style.display = 'none';
			$('div_overlay').style.display = 'none';
			processLoading(true);
		}
	}
	function giveTicket(objFrm)
	{
			new Ajax.Request('/common/lib/proc_GiveTicket.asp',
			{
				method:'post',
				parameters: {receiver: objFrm.ticket_receiver.value, kind: objFrm.ticket_kind.value, board_no: objFrm.ticket_boardno.value, article_no: objFrm.ticket_articleno.value, desc: encodeURIComponent(objFrm.ticket_desc.value)},
				onSuccess: function(transport)
				{
					var response = transport.responseText;
					showTicketWindow(false);
					if (response=="<ok/>")
						alert("Á¢¼ö µÇ¾ú½À´Ï´Ù.\n\n½Å°íÇÏ½Å ³»¿ëÀº °ü¸®ÀÚ¿¡°Ô Àü´ÞµÇ¾î Ã³¸®µË´Ï´Ù.\n\n°¨»çÇÕ´Ï´Ù.");
					else if (response=="<black/>")
						alert("È¸¿ø´Ô²²¼­´Â °Ô½ÃÆÇÀÇ ±Û ÀÛ¼º ±ÇÇÑÀÌ Á¦ÇÑµÈ »óÅÂÀÔ´Ï´Ù.\n\n±âÅ¸ ÀÚ¼¼ÇÑ »çÇ×Àº ÇÏ´Ü Contact US ¸¦ ÅëÇØ ¹®ÀÇ ¹Ù¶ø´Ï´Ù.\n\n°¨»çÇÕ´Ï´Ù.");
					else if (response=="<already/>")
						alert("ÀÌ¹Ì ½Å°í°¡ Á¢¼öµÈ »óÅÂÀÔ´Ï´Ù.\n\nÀÌ»óÀÌ ÀÖÀ¸½Ã¸é °ü¸®ÀÚ¿¡°Ô ¹®ÀÇÇØÁÖ½Ê½Ã¿À.\n\n°¨»çÇÕ´Ï´Ù.");
					else if (response=="<error/>")
						alert("¿À·ù°¡ ¹ß°ßµÇ¾ú½À´Ï´Ù.\n\n´Ù½Ã ½ÃµµÇØ ÁÖ½Ã°Å³ª °ü¸®ÀÚ¿¡°Ô ¹®ÀÇÇØÁÖ½Ê½Ã¿À.");
					else
						alert(response);
				},
				onFailure: function(transport)
				{
					var response = transport.responseText;
					alert(response);
				}
			});
	}

	function processLoading(bFlag) {
		$('loading').style.display = bFlag ? "block" : "none";
	}
	function changeTabCss (pObjName, obj){
		var tabList = $(pObjName).getElementsByTagName(obj.tagName);
		var tabCount = $(pObjName).getElementsByTagName(obj.tagName).length;
    var oppTabClsName		
		if(obj.className == "tab_on"){
			oppTabClsName = "tab_off";
		}
		else{
			oppTabClsName = "tab_on";			
		}
		var i
		for(i=0;i<tabCount;i++){
				tabList[i].className = obj.className;
		}
		obj.className=oppTabClsName
	}
/* top.js */
function onLoadTop() {
	document.getElementById('frmTopSearch').onsubmit = function(e) {
		return submitTopSearch();
	}

	document.getElementById('see_box11').onfocus = function(e) {
		if (document.getElementById('see_box11').defaultValue == $F('see_box11')) document.getElementById('see_box11').value = '';
	}
	document.getElementById('see_box11').onblur = function(e) {
		if ($F('see_box11') == '') document.getElementById('see_box11').value = document.getElementById('see_box11').defaultValue;
	}

	document.getElementById('area_btn').onmouseover = function() {
		toggleLayer('area_div');
	}

	var select_area_list = document.getElementById('area_list');
	if(session_location.length > 0) {
		select_area_list.value = session_location;
		document.getElementById('area_name').innerHTML = select_area_list.options[select_area_list.selectedIndex].text;
	}

	document.getElementById('area_list').onchange = function(e) {
		try {
			setCookie('cookieLocationCode', document.getElementById('area_list').value, 30) ;
			location.href = location.href;
		} catch(err) {}
	}
}
function submitTopSearch() {
	if (document.getElementById('see_box11').defaultValue == $F('see_box11')) document.getElementById('see_box11').value = '';
}

function toggleLayer(src) {
	document.getElementById(src).style.display = (document.getElementById(src).style.display=='none')?'':'none';
}

function setCookie(cookieName, cookieValue, nDays) 
{
	var today = new Date();
	var expire = new Date();
	if (nDays==null || nDays==0) nDays=1;
	expire.setTime(today.getTime() + 3600000*24*nDays);
	document.cookie = cookieName + "=" + escape(cookieValue) + ";expires=" + expire.toGMTString() + ";path=/;domain=.heykorean.com";
}
function getCookie(c_name)
{
	if (document.cookie.length>0)
	{
		c_start=document.cookie.indexOf(c_name + "=");
		if (c_start!=-1)
		{ 
			c_start = c_start + c_name.length + 1 ;
			c_end = document.cookie.indexOf(";", c_start);
			if (c_end==-1)
				c_end=document.cookie.length;
			return unescape(document.cookie.substring(c_start,c_end));
		} 
	}
	return "";
}
function setLanguage(szLng)
{
//	alert("Coming soon!");
	setCookie("cookieLanguage", szLng, 365);
	location.reload();
}
/* /common/js/embed.js  */

function MakeFlashString(source, id, width, height, wmode, otherParam)
{	
	if (window.ActiveXObject) { 
		// IE ActiveX Code 
		a="<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" width="+width+" height="+height+" id="+id+">"
	} else { 
		// Mozilla based Plugin Code 		
		a="<object type=\"application/x-shockwave-flash\" data=\""+source+"\" width="+width+" height="+height+" wmode="+wmode+" id="+id+">"
	} 

	a += "<param name=wmode value=\"" + wmode + "\" /><param name=\"allowScriptAccess\" value=\"always\"><param name=movie value=\"" + source + "\" /><param name=\"quality\" value=\"high\" />" + otherParam
	a += "<embed src=\"" + source +"\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" allowScriptAccess=\"always\" width=\"" + width + "\" height=\"" + height + "\"></embed>";
	a += "</object>";
	return a;
}
function MakeFlashString(source, id, width, height, wmode, otherParam)
{	
	if (window.ActiveXObject) { 
		// IE ActiveX Code 
		a="<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" width="+width+" height="+height+" id="+id+">"
	} else { 
		// Mozilla based Plugin Code 		
		a="<object type=\"application/x-shockwave-flash\" data=\""+source+"\" width="+width+" height="+height+" wmode="+wmode+" id="+id+">"
	} 

	a += "<param name=wmode value=\"" + wmode + "\" /><param name=\"allowScriptAccess\" value=\"always\"><param name=movie value=\"" + source + "\" /><param name=\"quality\" value=\"high\" />" + otherParam
	a += "<embed src=\"" + source +"\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" allowScriptAccess=\"always\" width=\"" + width + "\" height=\"" + height + "\"></embed>";
	a += "</object>";
	return a;
}

function MakeFlashString2(source, id, width, height, wmode, otherParam)
{	
	/*
	if (window.ActiveXObject) { 
		// IE ActiveX Code 
		a="<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" width="+width+" height="+height+" id="+id+">"
	} else { 
		// Mozilla based Plugin Code 		
		a="<object type=\"application/x-shockwave-flash\" data=\""+source+"\" width="+width+" height="+height+" wmode="+wmode+" id="+id+">"
	} 
*/
//	a += "<param name=wmode value=\"" + wmode + "\" /><param name=\"allowScriptAccess\" value=\"always\"><param name=movie value=\"" + source + "\" /><param name=\"quality\" value=\"high\" />" + otherParam
	a = "<embed src=\"" + source +"\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" allowScriptAccess=\"always\" width=\"" + width + "\" height=\"" + height + "\"></embed>";
//	a += "</object>";
	return a;
}


function MakeObjectString(classid, codebase, name, id, width,height, param)
{
	return "<object classid="+classid+" codebase="+codebase+" name="+name+" width="+width+" height="+height+" id="+id+"><param name=wmode value="+wmode+" />"+param+"</object>";
}

//ÀÌ¹ÌÁö ¹è³Ê´Â ¸ñÀûÁö°æ·Î ÁöÁ¤ °¡´É (param)
function MakeImgString(source, name, width, height, id, param)
{	
	imgbanner_str="<img src='"+source+"' name='"+name+"' width='"+width+"' height='"+height+"' id='"+id+"' alt='' border='0'>";
	if (param != "")
	{
		imgbanner_link1="<a href='"+param+"' target='_blank'>";
		imgbanner_link2="</a>";
		imgbanner_str=imgbanner_link1 + imgbanner_str + imgbanner_link2;
	}
	return imgbanner_str;
}
function MakeImgString(source, name, width, height, id, param, target)
{	
	imgbanner_str="<img src='"+source+"' name='"+name+"' width='"+width+"' height='"+height+"' id='"+id+"' alt='' border='0'>";
	if (param != "")
	{
		imgbanner_link1="<a href='"+param+"' target='" + target + "'>";
		imgbanner_link2="</a>";
		imgbanner_str=imgbanner_link1 + imgbanner_str + imgbanner_link2;
	}
	return imgbanner_str;
}

function MakeImgString_self(source, name, width, height, id, param)
{	
	imgbanner_str="<img src='"+source+"' name='"+name+"' width='"+width+"' height='"+height+"' id='"+id+"' alt='' border='0'>";
	if (param != "")
	{
		imgbanner_link1="<a href='"+param+"' target='_self'>";
		imgbanner_link2="</a>";
		imgbanner_str=imgbanner_link1 + imgbanner_str + imgbanner_link2;
	}
	
	return imgbanner_str;
}
// innerHTML Type
function SetInnerHTML(target, code)
{ 
	target.innerHTML = code; 
}

// Direct Write Type
function DocumentWrite(src)
{
	document.write(src);
}
function DocumentWrite2(src)
{
	alert(src);
}

/* footer.js */
function openPopup(url, w,h)
{
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;

	window.open(url,'_blank','width='+w+', height='+h+', Scrollbars=no, top='+wint+', left='+winl); 
}


function resetClubInfoTextCodeOfEid(eid, bgcode){
//	document.getElementById(eid).value = bgcode;
//	document.getElementById(eid).style.backgroundColor =  "#" + bgcode;
//	document.getElementById('clubInfo').style.color = "#" + bgcode; 
	var aObj = document.getElementById('clubInfo').getElementsByTagName('a');
	var bObj = document.getElementById('clubInfo').getElementsByTagName('b');
	var spanObj = document.getElementById('clubInfo').getElementsByTagName('span');	
	var i
	for(i=0; i<aObj.length; i++){
		document.getElementById('clubInfo').getElementsByTagName('a')[i].style.color =  "#707070";
	}
	for(i=0; i<bObj.length; i++){
		document.getElementById('clubInfo').getElementsByTagName('b')[i].style.color =  "#" +bgcode;
	}
	for(i=0; i<spanObj.length; i++){
		document.getElementById('clubInfo').getElementsByTagName('span')[i].style.color =  "#707070";
	}	
}