

// È¸¿ø°¡ÀÔ½Ã ÀÔ·Â°ª ¿¡·¯ Ã¼Å©
function checkIt(form)
{

	if(!form.ename.value)
	{
		alert("Please enter your Name"); 
		form.ename.focus();
		return false;
	}
	
	if(form.ename.value.length < 1 || form.ename.value.length > 50){
		alert("The maximum characters of the name are 50");
		form.ename.focus();
		return false;
	}		
	
	if(!form.uid.value)
	{
		alert("Please enter your ID"); 
		form.uid.focus();
		return false;
	}else {
	
		if(IsNumber(form.uid))
		{
			alert("The capital letters or the numbers only are not allowed");
			form.uid.focus();
			return false;
		}

		if(form.uid.value.length < 4 || form.uid.value.length > 12){
			alert("ID should be input by 4~12 small letters or including numbers without a blank space. ");
			form.uid.focus();
			return false;
		}			
			
		for(var i=0;i<form.uid.value.length;i++)
		{
			var chr=form.uid.value.substr(i,1);
			if (chr>="A" && chr<="Z") {
				alert("The capital letters or the numbers only are not allowed");
				form.uid.focus();
				return false;
			}
			
		}

		if(!isString(form.uid.value,"@")){
			alert("ID should be input by 4~12 small letters or including numbers without a blank space.");
			form.uid.focus();
			return false;
		
		}
		
	}


	if(!form.upassword.value )
	{
		alert("Please enter your Password"); 
		form.upassword.focus();	
		return false;
	}
	
	if(!form.upasswordchk.value )
	{
		alert("Please enter your Repeat Password"); 
		form.upasswordchk.focus();	
		return false;
	}

	if( form.upassword.value != form.upasswordchk.value ){
			alert("Your password is in error. Please input correctly.");
			form.upasswordchk.focus();
			return false;	
	}

	if(!IsPW(document.form.upassword))
	{
		alert("The password should be input by 4~12 small letters or including numbers without a blank space."); 
		form.upassword.focus();
		return false;
	}

	if(!form.tel.value)
	{
		alert("Please enter your Phone number"); 
		form.tel.focus();
		return false;
	}

	if(!form.email.value)
	{
		alert("Please enter your E-mail"); 	
		form.email.focus();
		return false;
	}
	
	if(!isEmail(form.email.value))
	{
		alert("Please input the e-mail address according to the form"); 	
		form.email.focus();
		return false;
	}

	if(!form.zipcode1.value)
	{
		alert("Please enter your Postal Code"); 
		return false;
	}			
	
	if(!form.address1.value)
	{
		alert("Please enter your Address"); 
		form.address1.focus();
		return false;
	}			
	

	if (Chk_Radio(form.desire,4) == 0) { 
		alert("Please choose your application fields"); 
	}


	if(!form.career.value)
	{
		alert("Please enter your Career"); 
		form.career.focus();
		return false;
	}			

	form.submit();

}


// È¸¿øÁ¤º¸¼öÁ¤½Ã ÀÔ·Â°ª Ã¼Å©
function checkEdit(form)
{
	
	
	form.submit();
}



function IsID(formname)
{

	var form= formname; 
	
	if(form.value.length < 4 || form.value.length > 12)
		return false;
 
 
	for(var i=0;i<form.value.length;i++)
	{
		var chr=form.value.substr(i,1);
		if(chr < '4' || chr > '12')
		{ 
			return false;
		}
	}
	return true;
}


function IsPW(formname)
{
	var form=formname
 
	if(form.value.length < 4 || form.value.length >12)
		return false;

	if(!isString(form.value,"" || !isString(form.value,"") )){
		return false;		
	}
		
	for(var i=0;i<form.value.length;i++)
	{
		var chr=form.value.substr(i,1);
		if (chr>="A" && chr<="Z") {
			return false;
		}
			
	}
	return true;
}


function IsNumber(formname)
{
	var form = formname;
  
	for(var i=0;i<form.value.length;i++)
	{
		var chr=form.value.substr(i,1);
		if( chr < '0' || chr > '9' ) return false;
	}
	return true;
}

// Email °Ë»ç
function isEmail(strCk) {
	chk = false;
	if (isString(strCk,"@.") && strCk.indexOf('@', 0) != -1 && strCk.indexOf('.', 0) != -1) {
		chk = true;
	}
		
	return chk;
}

// ¶óµð¿À ¹öÆ° °ª °Ë»ç
function Chk_Radio(form,num) 
{ 
	count = 0 
	for (i=0;i<num;i++){ 
		if (form[i].checked){ 
			return true; 
			break; 
		} 
	} 
	return false; 
} 

// ÀÔ·Â ¹®ÀÚ¿­ °Ë»ç (¿µÀÚ/¼ýÀÚ/Æ¯¼ö¹®ÀÚ)
function isString(strCk, charSet) {
	var chk=true;
	for (i=0; i<=strCk.length-1; i++) {
		ch = strCk.substring(i,i+1);
		if ((ch>="0" && ch<="9") || (ch>="a" && ch<="z") || (ch>="A" && ch<="Z")) {
			chk = true;
		} else {
			chk=false;
			for (j=0; j<=charSet.length-1; j++) {
				comp = charSet.substring(j,j+1);
				if (ch==comp) {
					chk = true;
					break;
				}
			}
			break;
		}
	}
	return chk;
}

 function searchID(ref){
 			
  if(form.uid.value != ''){
		if(IsNumber(form.uid))
		{
			alert("The capital letters or the numbers only are not allowed.");
			form.uid.focus();
			return false;
		}
		if(form.uid.value.length < 4 || form.uid.value.length > 12){
			alert("ID should be input by 4~12 small letters or including numbers without a blank space");
			form.uid.focus();
			return false;
		}			
		for(var i=0;i<form.uid.value.length;i++)
		{
			var chr=form.uid.value.substr(i,1);
			if (chr>="A" && chr<="Z") {
				alert("The capital letters or the numbers only are not allowed.");
				form.uid.focus();
				return false;
			}
		}
		if(!isString(form.uid.value,"@")){
			alert("ID should be input by 4~12 small letters or including numbers without a blank space");
			form.uid.focus();
			return false;
		}
	}
 			var id = document.form.uid.value;

			
 			var ref = ref;
 			ref = ref + '?id=' + id;

         var window_left=(screen.width-300)/2;
         var window_top=(screen.height-400)/2;
         win = window.open(ref,"searchIDwin",'width=300,height=205,status=no,top='+window_top + ',left=' +window_left + '');
         win.focus();
 }
 
 
 function searchID1(ref){
 			
 	if(document.form.uid.value == ''){
 		alert('Please confirm in advance if your ID is overlapping');
 			var id = document.form.uid.value;

			
 			var ref = ref;
 			ref = ref + '?id=' + id;

      var window_left=(screen.width-300)/2;
      var window_top=(screen.height-400)/2;
      win = window.open(ref,"searchIDwin",'width=300,height=205,status=no,top='+window_top + ',left=' +window_left + '');
      win.focus();  
           
	}

 }



