/**************************************** FuncLib.js ****************************************************
'Author(s)			: Victor Joseph
'Date				: Oct 14, 2008
'Version			: v1.0.0
'Description		: Christmas2008 promotion - $30 Member Dollars offered - WEB-560
'Called From		: /Hotelclub/christmas2008.asp
****************************************************************************************************************/

function FormSubmit(btn) {
var formObj = btn.form
    
	with (formObj)
	{
		if (isEmpty(fname, "", fname_val.value)) return;
		//if (charCheck(fname, langMsg_val.value)) return;

		if (isEmpty(lname, "", lname_val.value)) return;
        //if (charCheck(lname, langMsg_val.value)) return;

		if (isEmpty(email, "", email_val.value)) return;
		if (notEmail(email, "", emailnotvalid_val.value)) return;

		if (typeof emailconfirm != "undefined" && typeof emailconfirm_req != "undefined") {
			if (email.value != emailconfirm.value) {
				alert(emailreconfirm_val.value)
				emailconfirm.focus() 
				return
			}
		}

		if (typeof password != "undefined" && typeof password_req != "undefined") {
			if (isEmpty(password, "", password_val.value)) return;
			//if (charCheck(password, langMsg_val.value)) return;
		}

		if (typeof cpassword != "undefined" && typeof cpassword_req != "undefined") {
			if (password.value != cpassword.value) {
				alert(passwordreconfirm_val.value)
				cpassword.focus() 
				return
			}
		}

        if (typeof address != "undefined") {
			//if (charCheck(address, langMsg_val.value)) return;
			if (typeof address_req != "undefined") {
			    if (isEmpty(address, "", address_val.value)) return;
			}
		}

		if (typeof city != "undefined") {
			//if (charCheck(city, langMsg_val.value)) return;
			if (typeof city_req != "undefined") {
                if (isEmpty(city, "", city_val.value)) return;			
			}
		}

		if (typeof state != "undefined") {
			//if (charCheck(state, langMsg_val.value)) return;
			if (typeof state_req != "undefined") {
                if (isEmpty(state, "", state_val.value)) return;			
			}
		}

		if (typeof postcode != "undefined" && typeof postcode_req != "undefined") {
			if (isEmpty(postcode, "", postcode_val.value)) return;
		}

		if (typeof countryid != "undefined" && typeof country_req != "undefined") {
			if (notSelected(countryid, "", country_val.value)) return
		}
	
		if (typeof iaccept != "undefined" && typeof iaccept_req != "undefined") {
			if (!iaccept.checked) {
				alert(iaccept_val.value);
				iaccept.focus();
				return;
			}
		}
	}
	
	formObj.submit()
}




function FormLogin(btn) {

    var formObj = btn.form
	with (formObj)
	{

		if (isEmpty(email, "", email_val.value)) return;
		if (notEmail(email, "", emailnotvalid_val.value)) return;


		if (typeof password != "undefined" && typeof password_req != "undefined") {
			if (isEmpty(password, "", password_val.value)) return;
		}

			}
	
	formObj.submit()
}
