<!--

///////////////////////////////////////////////////////////////////////////
//	function name	 :	isid()
//	기능	:	회원가입 아이디체크
//	옵션	:	6자이상 12자이하
//				첫글자는 무조건 영문 소문자가 와야 함
//				소문자 a-z , 숫자 0-9까지의 조합
///////////////////////////////////////////////////////////////////////////
String.prototype.isid = function()
{
	if( this.length < 6 || this.length > 12 ) { return false; }
	if( this.charAt(0).search(/[^a-z]/) > -1 ) { return false; }
	if( this.search(/[^a-z0-9]{1,}/) == -1 && this.chknull() ) return true;
	else return false;
}

///////////////////////////////////////////////////////////////////////////
//	function name	 :	isnickname()
//	기능	:	회원가입 닉네임체크
//	옵션	:	12자이하
//				첫글자는 무조건 영문 대/소문자, 숫자가 와야 함
//				대/소문자 A-Z , a-z , 숫자 0-9 까지의 조합
///////////////////////////////////////////////////////////////////////////
String.prototype.isnickname = function()
{
	if( this.length > 12 ) { return false; }
	if( this.charAt(0).search(/[^A-Za-z0-9]/) > -1 ) { return false; }
	if( this.search(/[^A-Za-z0-9-]{1,}/) == -1 && this.chknull()) return true;
	else return false;
}

///////////////////////////////////////////////////////////////////////////
//	function name	 :	ispass()
//	기능	:	회원가입 암호체크
//	옵션	:	6자 이상 14자이하
//				대/소문자 A-Z , a-z , 숫자 0-9 , 특수문자 _ - ! @ # 까지의 조합
//////////////////////////////////////////////////////////////////////////
String.prototype.ispass = function()
{
	if( this.length < 6 || this.length > 14 ) { return false; }
	if( this.search(/[^A-Za-z0-9_\-\!@#]{1,}/) == -1 && this.chknull() ) return true;
	else return false;
}

///////////////////////////////////////////////////////////////////////////
//	function name	 :	isemail()
//	기능	:	회원가입 이메일체크
//	옵션	:	**@**.**의 형식에 맞춤
//				대/소문자 A-Z , a-z , 숫자 0-9 , 특수문자 _ - 까지의 조합
//////////////////////////////////////////////////////////////////////////
String.prototype.isemail = function()
{
	if( this.search(/[a-z0-9_-]{1,}@[a-z0-9_-]{1,}\.[A-Za-z]{1,}$/) > -1 ) return true;
	else if( this.search(/[A-Za-z0-9_-]{1,}@[A-Za-z0-9_-]{1,}\.[A-Za-z]{2,}\.[A-Za-z]{2,}$/) > -1 ) return true;
	else return false;
}

///////////////////////////////////////////////////////////////////////////
//	function name	 :	isname()
//	기능	:	회원가입 성명체크
//	옵션	:	30자 이하
//				첫글자는 무조건 대/소문자 A-Z , a-z 와야 함
//				대/소문자 A-Z , a-z 까지의 조합
//////////////////////////////////////////////////////////////////////////
String.prototype.isname = function()
{
	if( this.length < 1 || this.length > 30 ) { return false; }
	if( this.charAt(0).search(/[^A-Za-z]/) > -1 ) { return false; }
	if( this.search(/[^A-Za-z_-]{1,}/) == -1 && this.chknull() ) return true;
	else return false;
}

String.prototype.issecurity = function()
{
	if( this.length < 3 || this.length > 4 ) { return false; }
	if( this.keyCode != 13){ if (this.keyCode < 48 || this.keyCode > 57) return false; }
	if( this.search(/[^0-9-]{1,}/) == -1 && this.chknull()) return true;
	else return false;
}


String.prototype.chknull = function()
{
	var thisv = this;
	for (; thisv.indexOf(" ") != -1 ; )	thisv = thisv.replace(" ","");
	if( thisv.length > 0 ) return true;
	else return false;
}

String.prototype.trim = function()
{
	var thisv = this;
	return thisv.replace(/^\s+/,'').replace(/\s+$/,'');
}

String.prototype.isninenum = function()
{
	if( this.length > 4 ) { return false; }
	if( this.keyCode != 13){ if (this.keyCode < 48 || this.keyCode > 57) return false; }
	if( this.search(/^[0-9]{1,}$/) == -1 && this.chknull()) return true;
	else return false;
}


// HTML 방지코드
String.prototype.htmlChars = function ()
{
	var str = ((this.replace('"', '&')).replace('"', '"')).replace('\'', '');
	return (str.replace('<', '&lt;')).replace('>', '&gt;');
}

function Popup_CenterWindow(url, wName, ww, wh)
{
	var oPop;
	var sw = screen.availWidth;
	var sh = screen.availHeight;

	sw = (sw - ww) / 2;
	sh = (sh - wh) / 2;
	
	oPop =  window.open(url, wName, "left=" + sw + ",top=" + sh + ",width=" + ww + ",height=" + wh + ",toolbar=no,menubar=no,status=no,scrollbars=no,resizable=no");

	if(oPop == null)
	{
		alert("Please unblock popup window.");
		return null;
	}
	else
	{
		return oPop;
	}
}
function search(f, sCtl)
{
	if(!sCtl.value.trim().htmlChars())
	{
		alert("Enter keyword");
		sCtl.focus();
		return false;
	}
	f.page.value = 1;
}

function Read(f, seq, act)
{
	f.action = act + ".asp";
	f.seq.value = seq;
	f.submit();
}

function List(f, act)
{
	f.action = act;
	f.submit();
}

function EnableBtn(obj1, obj2)
{
	if(obj1.checked)
	{		
		if(obj2 != null)
		{
			obj2.disabled = false;
		}
	}
	else
	{
		if(obj2 != null)
		{
			obj2.disabled = true;
		}
	}
}


function getCookieVal (offset)
{
   var endstr = document.cookie.indexOf (";", offset);
   if (endstr == -1) endstr = document.cookie.length;
   return document.cookie.substring(offset, endstr);
}

function getCookie (name)
{
   var arg = name + "=";
   var alen = arg.length;
   var clen = document.cookie.length;
   var i = 0;
   while (i < clen)
   {   //while open
      var j = i + alen;
      if (document.cookie.substring(i, j) == arg)
         return getCookieVal (j);
      i = document.cookie.indexOf(" ", i) + 1;
      if (i == 0) break;
   }    //while close
   return "";
}

function setCookie(name, value)
{
   var argv = setCookie.arguments;
   var argc = setCookie.arguments.length;
   var expires = (2 < argc) ? argv[2] : null;
   var path = (3 < argc) ? argv[3] : null;
   var domain = (4 < argc) ? argv[4] : null;
   var secure = (5 < argc) ? argv[5] : false;
   document.cookie = name + "=" + value +
        ((expires == null) ? "" : ("; expires="+expires.toGMTString())) +
     ((path == null) ? "" : ("; path=" + path)) +
     ((domain == null) ? "" : ("; domain=" + domain)) +
        ((secure == true) ? "; secure" : "");
}

function onlyNumber()
{
	if(event.keyCode != 13)
	{
		if (event.keyCode < 48 || event.keyCode > 57)
		return  false;
	}
}

function keypressed()
{
	if (event.ctrlKey == true )
	{
		alert('Can not use Ctrl Key.');
		return false;
	}

	if (event.altKey == true )
	{
		alert('Can not use Alt Key.');
		return false;
	}
}


// 문자만 입력
function CheckKeys() 
{ 
	if ( event.keyCode < 48 || event.keyCode > 57) 
	{ 
		event.keyCode=0; 
	} 
} 


//텍스트필드 클릭하면 기본 메세지 사라짐
function clearField(field)
{ 
	if (field.value == field.defaultValue)
	{ 
		field.value = ''; 
	} 
} 

function checkField(field)
{ 
	if (field.value == '')
	{ 
		field.value = field.defaultValue; 
	}
}


function SetNum(obj)
{
 val=obj.value;
 re=/[^0-9]/gi;
 obj.value=val.replace(re,"");
}

 

//-->