/**************************************** CampaignBuilder.js ****************************************************
Author(s)		: Sasidevi Yuvaraj
Date			: November 08, 2005
Version			: v1.0.1
Description		: MARS - Campaign Builder - Script used for validation of membership registration form.
Called From		: 
-----------------------------------------------------------------------------------------------------------------
Name:				Date:			Description:

****************************************************************************************************************/

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 country != "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()
}
