//¼ýÀÚ°ËÁõ-------------------------------------------------------------------------------------------------------------
function IsNumeric(checkStr) {
	var checkOK = "0123456789-";
	for (i = 0;  i < checkStr.length;  i++) {
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
			if (ch == checkOK.charAt(j)) break;
		if (j == checkOK.length) {
			return (false);
        		break;
		}
	}
	return (true);
}
//¸ÞÀÏ°ËÁõ-------------------------------------------------------------------------------------------------------------
function check_mail(form) {
	emailEx1 = /[^@]+@[A-Za-z0-9_-]+.[A-Za-z]+/;
	emailEx2 = /[^@]+@[A-Za-z0-9_-]+.[A-Za-z0-9_-]+.[A-Za-z]+/;
	emailEx3 = /[^@]+@[A-Za-z0-9_-]+.[A-Za-z0-9_-]+.[A-Za-z0-9_-]+.[A-Za-z]+/;

	if(emailEx1.test(form.email.value)) return true;
	if(emailEx2.test(form.email.value)) return true;
	if(emailEx3.test(form.email.value)) return true;

	return false;
}
//¹®ÀÚ°ËÁõ-------------------------------------------------------------------------------------------------------------
function IsAlphaNumeric(checkStr) {
	var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ";
	for (i = 0;  i < checkStr.length;  i++) {
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
			if (ch == checkOK.charAt(j)) break;
		if (j == checkOK.length) {
			return (false);
			break;
		}
	}
	return (true);
}
//¼º¸í°ËÁõ-------------------------------------------------------------------------------------------------------------
function IsName(checkStr) {
	var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789¡Ù¡Ú@$.%.&()+,-.../...........:.;[{.<\|";
	for (i = 0;  i < checkStr.length;  i++) {
		ch = checkStr.charAt(i);
		for (j = 0;  j < checkOK.length;  j++)
			if (ch == checkOK.charAt(j)) break;
		if (j == checkOK.length) {
			return (false);
			break;
		}
	}
	return (true);
}

//½Å¿ëÄ«µå°ËÁõ---------------------------------------------------------------------------------------------------------
function basic_check(form) {
	var str_len=0;

    	return true;	
}	


//½Å¿ëÄ«µåÄ«µå½ÂÀÎ¿äÃ»-------------------------------------------------------------------------------------------------
function submit_auth(form) {

	if(form.h_name.value=="") {
		alert('Type in the exact hotel name.');
		form.h_name.focus();	
		return false;
	}
		
	if ((form.yyyy_in.value == "" ) || (form.mm_in.value == "" ) || (form.dd_in.value == "" )){
		alert ("Type in the check-in date.");
		form.yyyy_in.focus();
		return(false);
	}	

	if ((form.yyyy_out.value == "" ) || (form.mm_out.value == "" ) || (form.dd_out.value == "" )){
		alert ("Type in the check-out date.");
		form.yyyy_out.focus();
		return(false);
	}	

		
	if(form.number.value.length==0) {
		alert('Type in the exact room numbers.');
		form.number.focus();	
		return false;
	}
		
	if((form.adult.value.length==0)&&(form.child.value.length==0)) {
		alert('Type in the exact number of the guests.');
		form.adult.focus();	
		return false;
	}
		
	if(form.roomtype.value.length==0) {
		alert('Type in the exact room types.');
		form.roomtype.focus();	
		return false;
	}
	if(form.first.value=="") {
		alert('Input your name correctly, please');
		form.first.focus();	
		return false;
	}
		
	if(form.name.value=="") {
		alert('Input your last name correctly, please.');
		form.name.focus();	
		return false;
	}		


	if (eval(form.yyyy.value) < 1900 || eval(form.yyyy.value) > 1996 || form.yyyy.value==""){
	    alert ('Input your year of birth correctly, please.');
		form.yyyy.focus();
		return(false);
	}	

	if (eval(form.mm.value) < 1 || eval(form.mm.value) > 12 || form.mm.value=="" || form.mm.value.length!=2){
	    alert ('Input your month of birth correctly, please.');
		form.mm.focus();
		return(false);
	}	
	
	if (eval(form.dd.value) < 1 || eval(form.dd.value) > 31 || form.dd.value=="" || form.dd.value.length!=2){
	    alert ('Input your day of birth correctly, please.');
		form.dd.focus();
		return(false);
	}	

if (form.old.value.length == 0 ){
	alert ("Select your age, please.");
	form.old.focus();
	return(false);
	}

if (form.country.value.length == 0 ){
	alert ("Select your nationality, please.");
	form.country.focus();
	return(false);
	}

if (form.tel.value.length == 0 ){
	alert ("Input your phone number correctly, please.");
	form.tel.focus();
	return(false);
	}
	

	if(check_mail(form)==false) {
		alert('Input your e-mail correctly, please');
		form.email.focus();	
		return false;
	}	

	if(basic_check(form)) {
		form.action = "http://www.hotelwide.com/account/group_form.asp";
		form.BtnSetAuth.disabled = true;
		form.submit();
	}
}

function yyyy_next(form) {
	if(form.yyyy.value.length == 4) form.mm.focus();
}
function mm_next(form) {
	if(form.mm.value.length == 2) form.dd.focus();
}


 