
	// CheckBox ALL
	function CheckAll() {	
		var f = document.frm.boardidx ;
		if (document.frm.allchk.checked == true)
			var p1 = 1;
		else
			var p1 = 0;

		if (f.length > 1) {
			for (var x=0; x< f.length; x++) {
				if (p1 == 0)
					f[x].checked = false;
				else
					f[x].checked = true;
			}
		} else {
			if (p1 == 0)
				f.checked = false;
			else
				f.checked = true;
		}
	}
	
	function CheckAll2() {	
		var f = document.frm.boardidx ;
		if (document.frm.allchk2.checked == true)
			var p1 = 1;
		else
			var p1 = 0;

		if (f.length > 1) {
			for (var x=0; x< f.length; x++) {
				if (p1 == 0)
					f[x].checked = false;
				else
					f[x].checked = true;
			}
		} else {
			if (p1 == 0)
				f.checked = false;
			else
				f.checked = true;
		}
	}

	// Check ¿©ºÎ °Ë»ö
	function SelectChk() {
		var f = document.frm.boardidx;
		var chkidx = "";
		j = 0
		if(f) {
			for (i = 0; i < f.length; i++) {			
				if (f[i].checked == true) {	
					chkidx = chkidx + "|" + f[i].value;			
					j = j+1;
				}
			}
		
			if (f.checked == true) {
				chkidx = chkidx + "|" + f.value;			
				j = 1	
			}
		}			
			if (j > 0)
				return chkidx;
			else
				return j;
	}

/// ÀÏ¹ÝÀûÀ¸·Î ¾²ÀÎ ½ºÅ©¸³Æ® ÇÔ¼ö

	/*'
		onKeyPress : ÀÔ·ÂÇÑ ¹®ÀÚ°¡ ¼ýÀÚÀÎÁö check
	*/
	function checkNum(txtBox) 	{
		if(isNaN(txtBox.value + String.fromCharCode(event.keyCode)))
		{
			alert('¼ýÀÚ¸¦ ÀÔ·ÂÇÏ½Ê½Ã¿À.!');
			event.keyCode = 0;
		  }
	}
	 
    // ´Ü¼ø °ø¹éÀÎÁö °Ë»ç
    function removeblank1(obj) {
    	var str;
    	str = removeblank(obj.value);
    	if( (parseInt(str.length) < 1 )  ||  str == "undefined")  return false;  
    	else return true; 
    }

    // ÁÖ¾îÁø ¹®ÀÚ¿­(str)ÀÇ °ø¹éÀ» Á¦°ÅÇÏ´Â ÇÔ¼ö
    function removeblank(str) {
    	var zero = String.fromCharCode(32); //blank(32)°ø¹é¹®ÀÚ¿­
    	var i = 0, temp = "", ch = "";
    
    	for (i; i < str.length; i++) {
    		ch = str.charAt(i);
    		if (ch == zero) continue; 
    		else temp += ch; 
    	}
    	return temp;
    }
	//°ø¹éÁ¦°Å ÇÔ¼ö
	//»ç¿ë¹ý:form.aa.value.trim()== ""
	String.prototype.trim = function(){
		var str=this.replace(/(\s+$)/g,"");
		return str;
	}

	//trim±â´É
	function trim(strSource) {
	 re = /^\s+|\s+$/g;
	 return strSource.replace(re, '');
	}

    // °´Ã¼ÀÇ °ª(value)¸¦ ÃÊ±âÈ­ ÇÏ°í Æ÷Ä¿½º¸¦ °®°Ô ÇÑ´Ù.
    function resetvalue(obj) {
    	obj.focus();
    	obj.select();
    }  

    // obj : ±æÀÌ¸¦ Ã¼Å©ÇÒ °³Ã¼, msg : ¹®ÀÚ¿­(err), lnum : ÃÖ¼Ò±æÀÌ
    function lencheck(obj,lnum) {
    	obj = eval(obj);
    	var temp = removeblank(obj.value);
    	if (temp.length < lnum) return false; 
    	else return true;
    }

	//¼ýÀÚ Ã¼Å©
	function check_num(input)
	{
		var num_cnt = 0 ; 
		for (var i = 0; i < input.length; i++)	{
			var val = input.charAt(i);
			if (val >= "0" && val <= "9") {
				num_cnt ++
			} else {
				num_cnt = 0 ; 
				break ; 
			}
		}
		if (num_cnt != 0 )
			return true;
		else
			return false;
	}

	// ¼ýÀÚ¸¸ ÀÔ·Â
	function onlyNumber() {
		e = window.event;
		if(e.keyCode >= 48 && e.keyCode <= 57 || e.keyCode >= 96 && e.keyCode <= 105 || e.keyCode == 8 || e.keyCode == 46 || e.keyCode == 9 || e.keyCode == 13 || e.keyCode == 86 || e.keyCode == 90 || e.keyCode == 37 || e.keyCode == 39)
		{
			return;
		}
		else
			e.returnValue=false;
	}

	// ÆË¾÷ °¡¿îµ¥ ¶ç¿ì±â
	function windowOpen(url, title, cw, cy, etc) {
		//½ºÅ©¸°ÀÇ Å©±â
		sw=screen.availWidth;
		sh=screen.availHeight;

		//¿­ Ã¢ÀÇ Æ÷Áö¼Ç
		px=(sw-cw)/2;
		py=(sh-cy)/2;
		var win = window.open (url, title, "width=" + cw + ",height=" + cy + ",left=" + px + ",top=" + py + "," + etc);
		win.focus();
	}

	// ÇÑ±Û¸¸ ÀÔ·Â
	function hangul() {
		if((event.keyCode < 12592 || event.keyCode > 12687) && !(event.keyCode == 8 || event.keyCode == 46 || event.keyCode == 9 || event.keyCode == 13))
			event.returnValue = false;
	}

	// ÄÞ¸¶ Âï±â
	function setComma(str)
	{
		var temp_str = String(str); 
		for (var i = 0 , retValue = String() , stop = temp_str.length; i < stop ; i++) retValue = ((i%3) == 0) && i != 0 ? temp_str.charAt((stop - i) -1) + "," + retValue : temp_str.charAt((stop - i) -1) + retValue; 
		return retValue; 
	}
	// Á¦ÇÑ ±ÛÀÚ¼öº¸´Ù ¸¹À¸¸é false, ÀûÀ¸¸é true
	function checkTextLength(pString, pLimitLength)
	{
		var re = /[¤¡-¤¾°¡-ÆR]/gi;
	  	var arr = pString.match(re);

		var arrLength = 0;
	  	if (arr != null) arrLength = (pString.length > 0 ) ? arr.length : 0;
   		if((arrLength + pString.length) < pLimitLength) return true;
   		else return false;
  	}
/*--------------------------------------------------------------------------
-- ¼³    ¸í : Radio Button Settiong
--------------------------------------------------------------------------*/
function setRadio(objRadio, value)
{
    var i;
	if (value == "")	
	{
		for(i=0;i<objRadio.length;i++)
		{
			if(objRadio[i].defaultChecked == true)	objRadio[i].checked = true;
		}	
	}
	else
	{
		for(i=0;i<objRadio.length;i++)
		{
			if(objRadio[i].value == value)	objRadio[i].checked = true;
		}
	}
}
/*--------------------------------------------------------------------------
-- ¼³    ¸í : Radio Button get value
--------------------------------------------------------------------------*/
function getRadio(objRadio)
{
	for(var i=0;i<objRadio.length;i++)
	{
		if(objRadio[i].checked == true)	return objRadio[i].value;
	}
}
/*--------------------------------------------------------------------------
-- ¼³    ¸í : ¼¼¼ÇÀÌ Á¸ÀçÇÏ¸é true, ¼¼¼ÇÀÌ ¾øÀ¸¸é false ¹ÝÈ¯
--------------------------------------------------------------------------*/
function getSessionStatus()
{
    var pdom = new ActiveXObject("Microsoft.XMLDOM");
    var str = "<xml></xml>";
    
    var objXMLHttp = new ActiveXObject("Microsoft.XMLHTTP");
    objXMLHttp.open("POST","/Include/Usr_GetSessionStatus.asp",false);
    var tPara = "";

	objXMLHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	objXMLHttp.send(pdom);
  
  	if(objXMLHttp.status == 200)
	{
    	//alert(objXMLHttp.status);
    	//alert(objXMLHttp.responseText);
    	if(objXMLHttp.responseText == "true") return true;
    	else return false;
	}
	else
	{
    	return false;
	}  
}
/*--------------------------------------------------------------------------
-- ¼³    ¸í : ASP¿¡¼­´Â Æû ÇÊµåÀÇ ÇÑ°è°¡ 100KÀÌ¹Ç·Î 100K¾¿ Àß¶ó¼­ Àü¼ÛÇÑ´Ù
--------------------------------------------------------------------------*/
function DivideString(strSrc)
{
	var strTag = strSrc;
	var form = document.frm;
	var tags;

	while(strTag.length > 0)
	{
		tags = document.createElement("TEXTAREA");
		tags.name = "contents";
		tags.value = strTag.substr(0, 102400);
		form.appendChild(tags);
		strTag = strTag.substr(102400);
	}

	tags = document.createElement("TEXTAREA");
	tags.name = "contents";
	tags.value = strTag;
	form.appendChild(tags);
}
// ÇÃ·¡½Ã ÆÄÀÏ ÆÐÄ¡¿ë ½ºÅ©¸³Æ®
function embedFlash(src, width, height, ider){
	var object = '';
	object += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' + width + '" height="' + height + '" id="' + ider + '" align="middle">';
	object += '<param name="allowScriptAccess" value="always">';
	object += '<param name="wmode" value="transparent">';
	object += '<param name="movie" value="' + src + '">';
	object += '<param name="quality" value="high">';
	object += '<param name="bgcolor" value="#ffffff">';
	object += '<embed src="' + src + '" quality="high" wmode="transparent" bgcolor="#ffffff" width="' + width + '" height="' + height + '" name="' + ider + '" align="middle" allowscriptaccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">';
	object += '</object>';
	document.write(object);
}


// ie7 ÀÎÁö Ã¼Å©
function ie7Check()
{
	var IE = document.all ? true:false;
	var msie_vs = navigator.appVersion.match(/MSIE \d+.\d+/)[0].split(" ")[1];

	if ( (IE && msie_vs) > "6.0"){
		return  true;
	}else {
		return false;
	}
}

/**
 *	vista ÀÎÁö Ã¼Å©
 *	2007-01-31 By RahXephon
 */
function vistaCheck()
{
	var navi		= navigator.appVersion.split(";");
	var os_version	= navi[2]

	if ( os_version.indexOf("Windows NT 6.0") >= 0 ) 
		return true;
	else 
		return false;
}

/**
 *	vistaÀÏ °æ¿ì height °ª Á¶Á¤
 *  2007-01-31 By RahXephon
 */
function vistaHeight(p_height)
{
	if ( vistaCheck() )
	{
		p_height	+= 10;
	}

	return p_height;
}

/**
 *	IE7 ÀÏ °æ¿ì resizeTo ÇÔ¼ö »ç¿ëÇÒ ¶§ height º¯°æ
 *	2006-12-05 By RahXephon
 *	ºñ½ºÅ¸ »çÀÌÁî Àû¿ë 2007-01-31 By RahXephon
 */
function resizeTo_ie7(p_width, p_height)
{
//	var height_add	= ie7Check() ? 20 : 0;	// IE7 ÀÏ °æ¿ì +20
	var height_add	= "";	// IE7 ÀÏ °æ¿ì +20

	if ( vistaCheck() )		// vista Ã¼Å©
	{
		height_add	= 30; 
	}	
	else
	{
		if ( ie7Check() )	// IE7 Ã¼Å©
		{
			height_add	= 20;
		}
	}
	
	window.resizeTo(p_width, p_height + height_add);	
}

/**
 *	IE7 ÀÏ °æ¿ì resizeTo ÇÔ¼ö »ç¿ëÇÒ ¶§ height º¯°æ
 *	2006-12-05 By RahXephon
 *	ºñ½ºÅ¸ »çÀÌÁî Àû¿ë 2007-01-31 By RahXephon
 */
function resizeTo_vista(p_width, p_height)
{
	var height_add	= 0;	
	var width_add	= 0;
	var isXp = navigator.userAgent.indexOf('Windows NT 5.1') > 0

    // XP (¼­ºñ½ºÆÑ °ü·Ã) & vista ÀÏ ¶§
    if ( isXp || vistaCheck() ) {
        height_add += 58;
		width_add	= 10;
    }

    // IE7 ÀÏ °æ¿ì
	if ( ie7Check() ) {
        height_add += 18;
		width_add	= 10;
    }

	window.resizeTo(parseInt(p_width) + width_add, parseInt(p_height) + height_add);	
}

/*
 * °¡ÀÌµå ÆË¾÷À» ¶ç¿ó´Ï´Ù.
*/
function guide_pop(val) {
	var guide = window.open('/Home/Order/settleGuide.asp?val='+val, 'guide_pop', 'toolbar=no, location=0, directory=no, status=no, menubar=0, scrollbars=yes, resizable=yes, width=757, height=610, top=50, left=50');
	guide.opener = this;
	guide.focus();
}

/*
 * ·Î±×ÀÎ ÆË¾÷Ã¢À» ¶ç¿ó´Ï´Ù.
*/
function login_pop() {
	var remote = open("/Home/MemReg/Popup_Login_Frm.asp?WM_SEQ=<%=WM_SEQ%>&category=<%=category%>&WB_SEQ=<%=WB_SEQ%>", "Login_popup", "toolbar=no, location=0, directory=no, status=no, menubar=0, scrollbars=no, resizable=no, width=461, height=478, top=100, left=200");
	remote.opener = this;
	remote.focus();	
}

function rPg_login_pop(rPg) {
	var remote = open("/Home/MemReg/Popup_Login_Frm.asp?WM_SEQ=<%=WM_SEQ%>&category=<%=category%>&WB_SEQ=<%=WB_SEQ%>&rPg="+rPg, "Login_popup", "toolbar=no, location=0, directory=no, status=no, menubar=0, scrollbars=no, resizable=no, width=461, height=478, top=100, left=200");
	remote.opener = this;
	remote.focus();	
}

// À¥Áø¿ë ·Î±×ÀÎÆË¾÷ 09.05.13
function login_WebZine() {
	var remote = open("/Home/MemReg/Popup_Login_Frm.asp", "Login_popup", "toolbar=no, location=0, directory=no, status=no, menubar=0, scrollbars=no, resizable=no, width=461, height=478, top=100, left=200");
	remote.opener = this;
	remote.focus();	
}
/**
 * ¹®ÀÚ¿­³»¿¡ ÀÖ´Â ', "¸¦ \', \" ·Îº¯È¯ÇÑ´Ù.
 *
 * @param	str	º¯È¯ÇÒ ¹®ÀÚ¿­
 **/
function toValidStr(str)
{
	/*
	alert(str);
	var ret = "";
	for (i = 0; i < str.length; i++)
	{
		if (str.charAt(i) == '\'')
			ret += '\\\'';
		else if (str.charAt(i) == '"')
			ret += '\\\"';
		else
			ret += str.charAt(i);
	}
	*/

	re1 = /\'/gi;
	re2 = /\"/gi;
	str = str.replace(re1, "\\\'");
	str = str.replace(re2, "\\\""); 
	return str;	
	
}

function encChar(str)
{
	var temp1 = "@@@@@";
	re1 = /\'/g;
	re2 = /\"/g;
	str = str.replace(re1, temp1);
	return str;
}	

function decChar(str)
{
	re3 = /@@@@@/g;
	str = str.replace(re3, "'");
	return str;
}

// ÄíÆù ´Ù¿î·Îµå
function goCpnDwn(cm_key) {
	windowOpen("","CpnPop",400,370,"") ; 
	form_cpn.cm_key.value = cm_key;
	form_cpn.target = "CpnPop";
	form_cpn.action = "/Home/GdsLst/Pop_Cpn.asp";
	form_cpn.submit();
}
