//¸µÅ© ÁÖ¼Ò ¾Èº¸ÀÌ°Ô ÇÏ±â
function hidestatus() 
{ 
	window.status="" 
	return true 
} 
	if (document.layers) 
	document.captureEvents(Event.mouseover | Event.mouseout) 
	document.onmouseover=hidestatus 
	document.onmouseout=hidestatus 

// °ø¹é °Ë»ç	
	function IsEmptyChk(strTmp)
	{
		var len,i;

		len = strTmp.length;
		
		for(i=0; i<len; i++)
		{
			if(strTmp.charAt(i)!=" ") return false;
		}

		return true;
	}

// Á¤¼ö °Ë»ç	
	function IsIntChk(strTmp)
	{
		var len, i, imsi;

		strTmp = "" + strTmp;

		if(IsEmptyChk(strTmp))
			return false;

		len = strTmp.length;
		
		for(i=0; i<len; i++)
		{
			imsi = strTmp.charAt(i);
			
			if(imsi<"0" || imsi>"9")
			{
				return false;
			}
		}

		return true;
	}

// Á¤¼ö(0) °Ë»ç	
	function IsIntChk_Zero(strTmp)
	{
		var imsi;

		strTmp = "" + strTmp;
		imsi = strTmp.charAt(0);
			
		if(imsi=="0")
		{
			return false;
		} else {
			return true;
		}
	}
	
//¼ýÀÚ¸¸ÀÔ·Â(onKeypress='return keyIntCheck(event)')
var n4 = (document.layers)?true:false;
var e4 = (document.all)?true:false;

function keyIntCheck(e) { 
	if(n4) var keyValue = e.which
	else if(e4) var keyValue = event.keyCode
	if (((keyValue >= 48) && (keyValue <= 57)) || keyValue==13) return true; 
	else return false
}
	
// ÀÌ¸ÞÀÏ°Ë»ç	
	function IsEmailChk(str) 
	{
		var filter=(/^\s*[\w\~\-\.]+\@[\w\~\-]+(\.[\w\~\-]+)+\s*$/g);

    if (filter.test(str)) { 
    	return true; 
    } else { 
    	return false; 
    }

	}
	
// ÁÖ¹Î¹øÈ£ °Ë»ç	
	function IsJuminChk(P_Jumin) 
	{
		var IDtot, IDAdd, i; 

		IDtot = 0;
		IDAdd="234567892345";
		
		if(IsEmptyChk(P_Jumin)) return false;

		for(i=0;i<12;i++) 
		{
			IDtot=IDtot+parseInt(P_Jumin.substring(i,i+1))*parseInt(IDAdd.substring(i,i+1));
		}

		IDtot=11-(IDtot%11);
		if(IDtot==10) 
		{
			IDtot=0;
		}
		else if(IDtot==11)
			 {
				IDtot=1;
			 }

		if(parseInt(P_Jumin.substring(12,13))!=IDtot) return false;

		return true;
	}
	
// ³¯Â¥ °Ë»ç
function IsDateChk(strDate)
{
	var imsi, tempDate, temp, temp1;
	
	//°ø¹é°Ë»ç
	if(IsEmptyChk(strDate)) return false;
	
	// Á¤¼ö°Ë»ç
	if(!IsIntChk(strDate)) return false;
	
	if(strDate.length!=8) return false;
	
	imsi = "" + strDate.substring(0,4);
	imsi = imsi + "/" + strDate.substring(4,6);
	imsi = imsi + "/" + strDate.substring(6,8);
	
	tempDate = new Date(imsi);

	
	if(tempDate.getYear()==100)
		temp = "2000"
	else
	{
		if(tempDate.getYear()<2000)
			temp = "19" + tempDate.getYear();
		else
			temp = tempDate.getYear();
	}

	temp1 = tempDate.getMonth()+1;
	if(temp1<10)
		temp = temp + "/" + "0" + temp1;
	else
		temp = temp + "/" + temp1;
	
	if(tempDate.getDate()<10)
		temp = temp + "/" + "0" + tempDate.getDate();
	else
		temp = temp + "/" + tempDate.getDate();

	if(imsi!=temp) return false;
	
	return true;
}


function xssFilter(InStr) {

	
	if ( InStr.replace(/\</g, "")) return false;
	if ( InStr.replace(/\>/g, "")) return false;
	if ( InStr.replace(/\"/g, "")) return false;
	if ( InStr.replace(/\'/g, "")) return false;
	if ( InStr.replace(/\%/g, "")) return false;
	if ( InStr.replace(/\;/g, "")) return false;
	if ( InStr.replace(/\(/g, "")) return false;
	if ( InStr.replace(/\)/g, "")) return false;
	if ( InStr.replace(/\&/g, "")) return false;
	if ( InStr.replace(/\+/g, "")) return false;

}


function check_write(){

		obj =  document.theForm;

		if(obj.strTitle.value == ""){
			alert("Á¦¸ñÀ» ÀÔ·ÂÇÏ¼¼¿ä.");
			obj.strTitle.focus();
			return false;
		}
		if(obj.strName.value == ""){
			alert("ÀÛ¼ºÀÚ¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
			obj.strName.focus();
			return false;
		}
		
		if(obj.strPass.value == ""){
			alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
			obj.strPass.focus();
			return false;
		}

		if(obj.content.value == ""){
			alert("³»¿ëÀ» ÀÔ·ÂÇÏ¼¼¿ä.");
			obj.content.focus();
			return false;
		}
		
	/*sendHTML(obj.ms_desc, false);

	if(obj.ms_desc.value.length < 1) {
		alert("¸ÞÀÏ ³»¿ëÀ» ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
		return false ;
	} 
	*/


}

// °Ô½ÃÆÇ
//---------------------------------------- check_modify
function check_modify(){

	obj =  document.theForm;

	if(obj.strTitle.value == ""){
		alert("Á¦¸ñÀ» ÀÔ·ÂÇÏ¼¼¿ä.");
		obj.strTitle.focus();
		return false;
	}
		
	sendHTML(obj.ms_desc, false);

	if(obj.ms_desc.value.length < 1) {
		alert("¸ÞÀÏ ³»¿ëÀ» ÀÔ·ÂÇØ ÁÖ½Ê½Ã¿À.");
		return false ;
	} 	
		
	if(obj.strPass.value == ""){
		alert("ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
		obj.strPass.focus();
		return false;
	}

}
//---------------------------------------- check_search
function check_search(obj){
	if(obj.sKeyword.value == ""){
		alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇÏ¼¼¿ä.");
		obj.sKeyword.focus();
		return false;
	}
}

//°Ô½ÃÆÇ ³»¿ë ÇÁ¸°Æ®ÇÏ±â
function printArea() 
{ 
	var initBody      
	
	function beforePrint(){
		initBody = document.body.innerHTML;
		document.body.innerHTML = idPrint.innerHTML;
	} 
	
	function afterPrint(){  
		document.body.innerHTML = initBody;                   
	} 
	
	window.onbeforeprint = beforePrint;
	window.onafterprint = afterPrint;
	window.print();

}

//È®´ëÀÌ¹ÌÁö º¸±â
function viewPicture(imgPath, imgW, imgH) {
	
	var opt = 'leftmargin=0, toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,resicopyhistory=0,width='+imgW+',height='+imgH; 	

	openWin = window.open ('', 'viewP', opt);
	openWin.document.write ("<html>");
	openWin.document.write ("<head>");
	openWin.document.write ("<title>È®´ë ÀÌ¹ÌÁö º¸±â</title>");
	openWin.document.write ("<body leftmargin=0 topmargin=0>");
	openWin.document.write ("<table width="+imgW+" height='"+imgH+"' border='0' cellpadding='0' cellspacing='0'>");
	openWin.document.write ("  <tr>");
	openWin.document.write ("    <td><img src='"+imgPath+"' width='"+imgW+"' height='"+imgH+"' onClick='self.close()'></td>");
	openWin.document.write ("  </tr>");
	openWin.document.write ("</table>");
	openWin.document.write ("</body>");
	openWin.document.write ("</html>");
}

///////// ¸ÞÀÎ »ó´Ü ¸Þ´º ¸¶ÀÌ½º¿À¹ö½Ã ¸Þ´º º¸ÀÌ±â ////////////
function submenu_on(i)
{
		var obj, j

		for (j=1; j < 9; j++) {
			obj = eval("submenu_"+j);
			if ( j == i ) {
				obj.style.display='';
			} else {
				obj.style.display='none';
			}
		}


}


//////////////// ¾ÆÀÌµð Áßº¹Ã¼Å© ////////////////////
function id_check(objForm)
{
	var imsi;
	
	imsi = objForm.f_id.value;
	if(imsi=="") 
	{
		alert("¾ÆÀÌµð¸¦ 4ÀÚ¸® ÀÌ»ó ÀÔ·ÂÇÏ½Ê½Ã¿À!");
		objForm.f_id.focus();
		return;
					
	 } else {
		imsi = objForm.f_id.value;
		var eng=/(^[a-zA-Z][a-zA-Z0-9_-]{3,21})$/
		if(eng.test(imsi)==false){
			alert("ID Çü½ÄÀÌ Æ²¸³´Ï´Ù.\n´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä.")
			objForm.f_id.focus();
			return;
		}
		window.open('/member/id_check.asp?f_id='+imsi ,'checkID','scrollbars=no,width=400,height=230');
	}
}

function SetID(strID, strFlag)
{
	imsi = document.sfm.f_id;
	imsi.value = strID;
	//ÁÖÀÇ : readonly ·Î ¾²¸é ¾ÈµÊ readOnly ·Î ½á¾ßÇÔ
	imsi.readOnly = true;
	document.sfm.f_id_flag.value = strFlag;
	document.sfm.f_pwd1.focus();
}

//////////////// ¿ìÆí¹øÈ£ °Ë»ö ////////////////////
function address_check()
{
  window.open('/member/address_check.asp','openPost','scrollbars=no,width=400,height=420');
}

//////////////// ¾ÆÀÌµð/ºñ¹Ð¹øÈ£ Ã£±â ////////////////////
function idpw_search()
{
  window.open('/member/idpw_search.asp','openPost','scrollbars=no,width=400,height=330');
}

//////////////// Æ÷Ä¿½º ³Ñ±â±â ////////////////////
function fnSizeCheck(obj,nextobj)
{
	if (obj.value.length == obj.maxLength ) {
		nextobj.focus();
	}

}

////////////// ÅØ½ºÆ®¹Ú½º °ª ¿©·¯°³ ¹Þ±â ////////////////
function Iprice(val)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
{                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
	if(val != "")                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  
	{                         
	
		n   = val.indexOf("-"); 
		m   = val.indexOf("@");  
		len = val.length;  
		
		Ipr    = val.substring(0, n);                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
		Iidx   = val.substring(n + 1, m); 
		Ipoint = val.substring(m + 1, len);
		
		document.pForm.optionIdx.value=Iidx;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
		document.pForm.price.value=Ipr; 
		document.pForm.p_point.value=Ipoint;                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 
	}	                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
}
//-->

