// JavaScript Document
function form_validate()
{	
	// CHECKING IF RADIO BOX HAS BEEN SELECTED
	if (!(is_radio_selected(form1.sal,"Please choose a salutation before your name.")))
		return false
	
	// CHECKING IF A VALID FIRST AND FAMILY NAMES HAVE BEEN ENTERED
	if(isempty(form1.fname,"Please enter your First name."))
	{
		form1.fname.focus();
		return false
	}
	
	if (!(is_only_text(form1.fname,1,"The First name you have entered is invalid.\nPlease correct it.")))
	{
		form1.fname.focus();
		return false
	}

	if(isempty(form1.lname,"Please enter your Last name."))
	{
		form1.lname.focus();
		return false
	}

	if (!(is_only_text(form1.lname,1, "The Last name you have entered is invalid.\nPlease correct it.")))
	{
		form1.lname.focus();
		return false
	}
	//------------------------------------------

	// CHECKING IF AN ADDRESS HAS BEEN ENTERED
	if(isempty(form1.add1,"Please enter your Address."))
	{
		form1.add1.focus();
		return false
	}
	
	//------------------------------------------	

	// CHECKING IF A CITY NAME HAS BEEN ENTERED
	if(isempty(form1.city,"Please enter your City of residence."))
	{
		form1.city.focus();
		return false
	}
	//------------------------------------------	

	// CHECKING IF A COUNTRY NAME HAS BEEN ENTERED
	if(isempty(form1.country,"Please enter your Country of residence."))
	{
		form1.country.focus();
		return false
	}
	//------------------------------------------
    
	
	// CHECKING IF A VALID PIN CODE HAS BEEN ENTERED
	if(isempty(form1.pin,"Please enter your PIN Code."))
	{
		form1.pin.focus();
		return false
	}

	if (!(is_only_number(form1.pin,"The PIN Code you have entered is invalid. Please correct it.")))
	{
		form1.pin.focus();
		return false
	}
	//------------------------------------------	


    // SPECIAL CASE PIN CODE CHECKING FOR SPECIFIC COUNTRIES 
	// INDIA : PIN = 6 DIGITS
	if(!(is_exactly(form1.pin,6,"The PIN Code for India is of 6 digits. Please correct the \nvalue you have entered.")))
	{
		form1.pin.focus();
		return false
	}
	
	
	// CHECKING IF A VALID CITY PHONE CODE HAS BEEN ENTERED
	if(isempty(form1.ph_city,"Please enter the city code for your telephone number."))
	{
		form1.ph_city.focus();
		return false
	}
	if(!(is_only_number(form1.ph_city,"The city phone code you have entered is invalid. Please correct it.")))
	{
		form1.ph_city.focus();
		return false
	}
		
	// CHECKING THE CITY'S PHONE CODE TO CONTAIN EXACTLY 3 DIGITS
	if(!(is_exactly(form1.ph_city, 3, "The city phone code you have entered must be 3 digits.\nPlease correct the value you have entered.")))
	{
		form1.ph_city.focus();
		return false
	}
	//------------------------------------------



	// CHECKING IF A VALID TELEPHONE NUMBER HAS BEEN ENTERED
	if(isempty(form1.phone1,"Please enter your telephone number."))
	{
		form1.phone1.focus();
		return false
	}

	if(!(is_only_number(form1.phone1,"The telephone number you have entered is invalid. Please correct it.")))
	{
		form1.phone1.focus();
		return false
	}
		
	// CHECKING THE MINIMIUM AND MAXIMUM VALUES FOR A TELEPHONE NUMBER
	if(is_less_than(form1.phone1, 4, "The telephone number you have entered must be 4 or more digits.\nPlease correct the value you have entered."))
	{
		form1.phone1.focus();
		return false
	}
	
	// CHECKING PHONE1 EXTENSION :
	
	if(form1.ph1_ext.value!="")
	{
	if(!(is_only_number(form1.ph1_ext,"The extension to the first telephone number is invalid.\nPlease correct it.")))
	{
		form1.ph1_ext.focus();
		return false
	}
	}
	
	
	// CHECKING PHONE 2
	
	if(form1.phone2.value!="")
	{
	if(!(is_only_number(form1.phone2,"The telephone number you have entered is invalid. Please correct it.")))
	{
		form1.phone2.focus();
		return false
	}
		
	// CHECKING THE MINIMIUM AND MAXIMUM VALUES FOR A TELEPHONE NUMBER
	if(is_less_than(form1.phone2, 4, "The telephone number you have entered must be 4 or more digits.\nPlease correct the value you have entered."))
	{
		form1.phone2.focus();
		return false
	}
	}

	if(form1.ph2_ext.value!="")
	{
	if(!(is_only_number(form1.ph2_ext,"The extension to the second telephone number is invalid.\nPlease correct it.")))
	{
		form1.ph2_ext.focus();
		return false
	}
	
	// CHECKING IF 2ND TELE NUMBER IS ADDED IF THE 2ND EXTENSION NUMBER IS ADDED :
	if(isempty(form1.phone2,"You have entered an extension for the second telephone number, but you\nhavent entered the second telephone number itself.\n\nPlease either enter a telephone number or remove its extension."))
	{
		form1.phone2.focus();
		return false
	}
	
	}
	
	
	
	// CHECKING FAXES : 
	
	if(form1.fax1.value!="")
	{
	if(!(is_only_number(form1.fax1,"The fax number you have entered is invalid. Please correct it.")))
	{
		form1.fax1.focus();
		return false
	}
		
	// CHECKING THE MINIMIUM AND MAXIMUM VALUES FOR A TELEPHONE NUMBER
	if(is_less_than(form1.fax1, 4, "The fax number you have entered must be 4 or more digits.\nPlease correct the value you have entered."))
	{
		form1.fax1.focus();
		return false
	}
	}
	
	if(form1.fax2.value!="")
	{
	if(!(is_only_number(form1.fax2,"The fax number you have entered is invalid. Please correct it.")))
	{
		form1.fax2.focus();
		return false
	}
		
	// CHECKING THE MINIMIUM AND MAXIMUM VALUES FOR A TELEPHONE NUMBER
	if(is_less_than(form1.fax2, 4, "The fax number you have entered must be 4 or more digits.\nPlease correct the value you have entered."))
	{
		form1.fax2.focus();
		return false
	}
	}
	//------------------------------------------	
		

	// CHECKING IF A VALID COUNTRY CODE HAS BEEN ENTERED FOR A MOBILE NUMBER
	if(!(mobile_country(form1.mob1, "The country code for a cellular phone must contain 2 digits, \nand begin with a \n \t\t+ OR 0\n\nPlease correct the values you have entered.")))
	{
		form1.mob1.focus();
		return false
	}

	
	// CHECKING IF A VALID MOBILE NUMBER HAS BEEN ENTERED
	if(!(mobile_ok(form1.mob2, "Please enter a valid 10 digit mobile number.")))
	{
		form1.mob1.focus();
		return false
	}

	// CHECKING IF THE USER HAS ENTERED EITHER BOTH OR NONE OF THE MOBILE COUNTRY CODE AND MOBILE NUMBER
	if(!(is_mobile_consistent(form1.mob1, form1.mob2)))
	{
		form1.mob1.focus();
		return false
	}
	//------------------------------------------		
	

	// CHECKING IF A VALID EMAIL ADDRESS HAS BEEN ENTERED
	if(!(email_ok(form1.email)))
	{
		form1.email.focus();
		return false
	}
		
		
	// CHECKING IF A COMPANY HAS BEEN ENTERED
	if(isempty(form1.company,"Please enter your company name."))
	{
		form1.company.focus();
		return false
	}

	//------------------------------------------	
	
	if(isempty(form1.industry,"Please select Industry Segment."))
	{
		form1.industry.focus();
		return false
	}

	//------------------------------------------
	if(isempty(form1.turnover,"Please select annual turnover of your Company."))
	{
		form1.turnover.focus();
		return false
	}

	//------------------------------------------	
	
		
	// CHECKING IF A DESIGNATION HAS BEEN ENTERED
	if(isempty(form1.desig,"Please enter your designation."))
	{
		form1.desig.focus();
		return false
	}
	//------------------------------------------
		if(isempty(form1.jobrole,"Please select your job role."))
	{
		form1.jobrole.focus();
		return false
	}

	//------------------------------------------	
	
		
	return true
}
	// END OF DOCUMENT