<!--
function nextFocus(val, nextfocus, limit)
{
	if(val.length == limit)
	{
		nextfocus.focus();
	}
}

function empty(str) {
	for(var i = 0; i < str.length; i++) {
		if(str.substring(i, i+1) != " ") {
			return false;
		}
	}
	return true;
}

function space(str) {
	if(!str) {
		return false;
	} else {
		for(var i = 0; i < str.length; i++) {
			if(str.charAt(i) == " ") {
				return true;
			}
		}
	}
	return false;
}

function checkID(id){
	str = id;
	var temp	= str.replace(' ', '');
	var msg		= '';

	if((id.length < 4) || (id.length > 12)) {
		return false;
	}
	str1 = str.toUpperCase();

	for(i = 0; i < str1.length; i++) {
		if (str1.charAt(i) == " "){
			return false;
		} else if (((str1.charAt(i) < "A") || (str1.charAt(i) > "Z")) && ((str1.charAt(i) < "0") || (str1.charAt(i) > "9"))) {
			return false;
		}
	}
	str2 = str.toLowerCase();
	id = str2;
	return true;
}

function checkEng(id)
{
	str = id;

	str1 = str.toUpperCase();

	if((id.length < 3) || (id.length > 12)) {
		return false;
	}

	for(i = 0; i < str1.length; i++) {
		if (str1.charAt(i) == " "){
			return false;
		} else if (((str1.charAt(i) < "A") || (str1.charAt(i) > "Z")) && ((str1.charAt(i) < "0") || (str1.charAt(i) > "9"))) {
			return false;
		}
	}
	return true;
}

function checkDigit(digit) {
	strl = digit.toUpperCase();

	if(digit == "") {
		return false;
	}

	for(var i = 0; i < strl.length; i++) {
		if(strl.charAt(i) < "0" || strl.charAt(i) > "9") {
			return false;
		}
	}
	return true;
}

function checkEmail(strEmail)
{
    var regDoNot = /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)/; 
    var regMust = /^[a-zA-Z0-9\-\.\_]+\@[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3})$/;
	
	if (!regDoNot.test(strEmail) && regMust.test(strEmail)) {
		return true;
	} else {
		return false;
	}
}

function checkPhone(phone1, phone2, phone3) {
	str1 = phone1;
	str2 = phone2;
	str3 = phone3;

	if(phone1 == "" || phone2 == "" || phone3 == "") {
		return false;
	} else {
		if(!checkDigit(phone1) || !checkDigit(phone2) || !checkDigit(phone3)) {
			return false;
		}
	}
	return true;
}

function checkPassword(password) {
	str = password;
	
	var temp = str.replace(' ','');
	var MSG = '';
	var Flag = '0';

	if(( password.length < 4 ) || ( password.length > 16 )) {
		return false;
	}

	str1 = str.toUpperCase();
	
	for(i = 0; i < str1.length; i++) {
		if ((str1.charAt(i) < "0") || (str1.charAt(i) > "9")) {
			Flag = '1';
		}
	}

	//¿¬¼ÓµÈ ¼ýÀÚ³ª ¹®ÀÚ°¡ 4ÀÚ¸® ÀÌ»óÀÎÁö È®ÀÎ
	cnt = 0;
	for (i=0; i<str1.length;i++) {
		if (((str1.charCodeAt(i) - str1.charCodeAt(i+1)) == 1) || ((str1.charCodeAt(i) - str1.charCodeAt(i+1)) == -1)) {
			cnt++;
		}
	}

	if (cnt == (str1.length-1)) {
		return false;
	}

	for(i = 0; i < str1.length; i++) {
		str2 = '';

		for (j=0;j<str1.length;j++) {
			str2 = str2 + str1.charAt(i);
		}

		if ( str1.indexOf(str2) != -1 ) {
			return false;
		}
	}

	if ( Flag == '1') {
		for(i=0; i<str1.length; i++) {
			if (str1.charAt(i) == " ") {
				continue;
			} else if (((str1.charAt(i) < "A") || (str1.charAt(i) > "Z")) && ((str1.charAt(i) < "0") || (str1.charAt(i) > "9"))) {
				return false;
			}
		}
	} else {
		return false;
	}

	str2 = str.toLowerCase();
	id = str2;

	return true;
}

function checkRegcode(biscode){

	var vencod = "";
    var sum = 0;
    var getlist =new Array(10);
    var chkvalue =new Array("1","3","7","1","3","7","1","3","5");

	for(var i = 0; i < biscode.length; i++) {
		vencod = vencod + biscode.charAt(i).replace('-', '');
	}

	if(vencod.length != 10) {
		return false;
	}

	for(var i = 0; i < 10; i++) {
		getlist[i] = vencod.substring(i,i+1);
	}
	for(var i = 0; i < 9; i++) {
		sum += getlist[i] * chkvalue[i];
	}
	sum = sum + parseInt((getlist[8] * 5) / 10) ;
	sidliy = sum % 10;
	sidchk = 0;

	if (sidliy != 0) {
		sidchk = 10 - sidliy;
	} else {
		sidchk = 0;
	}
	if(sidchk != getlist[9]) {
		return false;
	}
	return true;
}

function checkJumin(no1, no2) {
	if (no1.length != 6) {
		return false;
	} else if (no2.length != 7) {
		return false;
	} else {
		var str_serial1 = no1;
		var str_serial2 = no2;
 
		var digit=0
		for (var i = 0; i < str_serial1.length; i++){
			var str_dig=str_serial1.substring(i,i+1);
			if (str_dig<'0' || str_dig>'9') {
				digit = digit+1
			}
		}

		if ((str_serial1 == '') || ( digit != 0 )) {
			return false;
		}

		var digit1=0
		for (var i=0;i<str_serial2.length;i++){
			var str_dig1=str_serial2.substring(i,i+1);
			if (str_dig1<'0' || str_dig1>'9'){ 
				digit1=digit1+1 
			}
		}

		if ((str_serial2 == '') || ( digit1 != 0 )) {
			return false;
		}
		if (str_serial1.substring(2,3) > 1) {
			return false;
		}
		if (str_serial1.substring(4,5) > 3) {
			return false;
		}
		if (str_serial2.substring(0,1) > 4 || str_serial2.substring(0,1) == 0) {
			return false;
		}

		var a1=str_serial1.substring(0,1)
		var a2=str_serial1.substring(1,2)
		var a3=str_serial1.substring(2,3)
		var a4=str_serial1.substring(3,4)
		var a5=str_serial1.substring(4,5)
		var a6=str_serial1.substring(5,6)
        var check_digit=a1*2+a2*3+a3*4+a4*5+a5*6+a6*7
		var b1=str_serial2.substring(0,1)
		var b2=str_serial2.substring(1,2)
		var b3=str_serial2.substring(2,3)
		var b4=str_serial2.substring(3,4)
		var b5=str_serial2.substring(4,5)
		var b6=str_serial2.substring(5,6)
		var b7=str_serial2.substring(6,7)
		var check_digit=check_digit+b1*8+b2*9+b3*2+b4*3+b5*4+b6*5 
        
		check_digit = check_digit%11
		check_digit = 11 - check_digit
		check_digit = check_digit%10

		if (check_digit != b7) {
			return false;
		} else {
			return true;
		}
	}
}

function dispImage(width, height)
{
	var sleft = (screen.width - width) / 2;
	var stop = (screen.height - height) / 2;

	document.all.disp_save.style.top = stop;
	document.all.disp_save.style.left = sleft;
	document.all.disp_save.style.visibility = "visible";
}

function payImage(width, height)
{
	var sleft = (screen.width - width) / 2;
	var stop = (screen.height - height) / 2;

	document.all.pay_process.style.top = stop;
	document.all.pay_process.style.left = sleft;
	document.all.pay_process.style.visibility = "visible";
}

function showModal(href, width, height) {
	var style = "dialogwidth:"+width+"px;dialogHeight:"+height+"px;scroll:0;help:0;status:0"
	window.showModalDialog(href,'IDSearch',style);
}

function openWin(href, width, height, scroll) {
	var sleft = (screen.width - width) / 2;
	var stop = (screen.height - height) / 2;

	var style = "left="+sleft+",top="+stop+",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars="+scroll+",resizable=no,width="+width+",height="+height+"";
	window.open(href,'openWin',style);
}

function openBoard(href, width, height, scroll, resize) {
	var sleft = (screen.width - width) / 2;
	var stop = (screen.height - height) / 2;

	var style = "left="+sleft+",top="+stop+",toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars="+scroll+",resizable="+resize+",width="+width+",height="+height+"";
	window.open(href,'openWin',style);
}

function getCookie(name) {

	var Found = false;
	var start = "";
	var end = "";
	var i = 0

	// cookie ¹®ÀÚ¿­ ÀüÃ¼¸¦ °Ë»ö
	while(i <= document.cookie.length) {
		start = i;
		end = start + name.length;
		// name°ú µ¿ÀÏÇÑ ¹®ÀÚ°¡ ÀÖ´Ù¸é
		if(document.cookie.substring(start, end) == name)
		{
			Found = true;
			break;
		}
		i++;
	}

	// name ¹®ÀÚ¿­À» cookie¿¡¼­ Ã£¾Ò´Ù¸é
	if(Found == true) {
		start = end + 1;
		end = document.cookie.indexOf(";", start);

		if(end < start)
		{
			end = document.cookie.length;
		}
		return document.cookie.substring(start, end);
	}
	return false;
}

function openTodayPopup(href, name, width, height, scroll, resize) 
{
	var scrollbars = "no";
	var resizable = "no";

	if(scroll == 1)
	{
		scrollbars = "yes";
	}
	if(resize == 1)
	{
		resizable = "yes";
	}

	var eventCookie = getCookie(name);
	var style = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars="+scrollbars+",resizable="+resizable+",width="+width+",height="+height+"";

	if (eventCookie != "no")
	{
		window.open(href,name,style);
	}
}




function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
-->
