﻿
function ValidateForm()
{
	var loginId = document.getElementById("txtLoginID");
	if (loginId != null && loginId.value == "")
	{
		radalert('Login ID is a required field!', 300, 180);
		return false;
	}

	var firstName = document.getElementById("txtFirstName");
	if (firstName != null && firstName.value == "")
	{
		radalert('First Name is a required field!', 300, 180);
		return false;
	}

	var lastName = document.getElementById("txtLastName");
	if (lastName != null && lastName.value == "")
	{
		radalert('Last Name is a required field!', 300, 180);
		return false;
	}

	var emailId = document.getElementById("txtEmailAddress");
	if (emailId != null && emailId.value == "")
	{
		radalert('Email Address is a required field!', 300, 180);
		return false;
	}

	var femail_svc = ['aol.com', 'comcast.net', 'earthlink.net', 'gmail.com', 'hotmail.com', 'inbox.com', 'live.com', 'msn.com', 'yahoo.com'];
	var test_email = emailId.value.toLowerCase();

	for (i = 0; i < femail_svc.length; i++)
	{
		if (test_email.indexOf(femail_svc[i]) != -1)
		{
			radalert('Sorry but for the protection of our service, we do not accept email accounts from free email services. Please use or register an email address with your company\'s domain name.', 500, 180);
			return false;
		}
	}

	if (!CheckEmailId(Trim(emailId.value)))
	{
		radalert('Please specify a valid Email Address!', 300, 180);
		return false;
	}

	var address = document.getElementById("txtAddress");
	if (address != null && address.value == "")
	{
		radalert('Address is a required field!', 300, 180);
		return false;
	}

	var city = document.getElementById("txtCity");
	if (city != null && city.value == "")
	{
		radalert('City is a required field!', 300, 180);
		return false;
	}

	var zip = document.getElementById("txtZip");
	if (zip != null && zip.value == "")
	{
		radalert('Zip is a required field!', 300, 180);
		return false;
	}

	var phone = document.getElementById("txtPhone");
	if (phone != null && phone.value == "")
	{
		radalert('Phone number is a required field!', 300, 180);
		return false;
	}

	var chkIAgree = document.getElementById("chkAgree");
	if (chkIAgree != null && chkIAgree.checked == false)
	{
		radalert('Please check terms and condition!', 300, 180);
		return false;
	}

	return true;
}
		
	



