function checkForm() 
{
	/* ----------begning of checking full name ----------------*/
	spattern = /^[\s]+$/
	pattern = /^[a-zA-Z\'\s]+$/
	str = document.forms[0].txtName.value
	
	if (str.match(spattern)) 
	{
		alert("Please enter a valid entry for your full name.")
		document.forms[0].txtName.focus();
		return false;
	}
	
	if (document.forms[0].txtName.value=="") 
	{
		alert("Please enter your full name")
		document.forms[0].txtName.focus();
		return false
	} 
	
	if (!str.match(pattern)) 
	{
		alert("Invalid characters. Please enter only letters in your name.")
		document.forms[0].txtName.focus();
		return false;
	}
	/* ----------end of checking full name ----------------*/
	
	/* ----------begning of checking Policy No 1 ----------------*/
	
	str = document.forms[0].txtPolicy1.value
	///pattern = /^[a-zA-Z0-9\/\-\s]+$/
	invalid = " "; // Invalid character is a space
	invpat = /[a-zA-Z]$/
		
	//if (str.match(spattern)) 
	//{
	//	alert("Please enter a valid entry for your policy number 1.")
	//	document.forms[0].txtPolicy1.focus();
	//	return false;
	//}

	//if (str.match(invpat)) 
	//{
	//	alert("Please enter a valid entry for your policy number 1.")
	//	document.forms[0].txtPolicy1.focus();
	//	return false;
	//}

	//if ((document.forms[0].txtPolicy1.value.length) < 10) 
	//{
	//	alert("Please enter a valid entry for your policy number 1.")
	//	document.forms[0].txtPolicy1.focus();
	//	return false;
	//}

	if (document.forms[0].txtPolicy1.value=="") 
	{
		alert("Please enter your policy number 1")
		document.forms[0].txtPolicy1.focus();
		return false
	} 
	/*
	if (!str.match(pattern)) 
	{
		alert("Invalid characters. Please check your policy number 1.")
		document.forms[0].txtPolicy1.focus();
		return false;
	}
	*/
	if (document.forms[0].txtPolicy1.value.indexOf(invalid) > -1) 
	{
		alert("Sorry, spaces are not allowed.");
		document.forms[0].txtPolicy1.focus();
		return false;
	}	
	
	/* ----------end of checking Policy No 1 ----------------*/

	/* ----------begning of checking Date of birth -------------*/
	/* birth years */
	if (document.forms[0].cmbYearPHdob.selectedIndex==0) 
	{
		alert("Please select your birth year");
		document.forms[0].cmbYearPHdob.focus();
		return false
	}
	
	/* birth month */
	if (document.forms[0].cmbMonthPHdob.selectedIndex==0) 
	{
		alert("Please select your birth month");
		document.forms[0].cmbMonthPHdob.focus();
		return false
	}		
	
	/* birth date */
	if (document.forms[0].cmbDayPHdob.selectedIndex==0) 
	{
		alert("Please select your birth date");
		document.forms[0].cmbDayPHdob.focus();
		return false
	}	
	/*---------- end of checking Date of birth ----------------*/

	/* ----------begning of  checking National Identity card ----------------*/
	str = document.forms[0].txtNICNo.value
	pattern = /^[a-zA-Z0-9\/\-\s]+$/
	patternNIC2 = /^[a-zA-Z]/
	patternNIC3 = /[0-9]+$/
	
	if (str.match(spattern)) 
	{
		alert("Please enter a valid entry for your National Identity Card.")
		document.forms[0].txtNICNo.focus();
		return false;
	}

	if (str.match(patternNIC2)) 
	{
		alert("Please enter a valid entry for your National Identity Card.")
		document.forms[0].txtNICNo.focus();
		return false;
	}
	
	if (str.match(patternNIC3)) 
	{
		alert("Please enter a valid entry for your National Identity Card.")
		document.forms[0].txtNICNo.focus();
		return false;
	}
	
	if ((document.forms[0].txtNICNo.value.length) < 10) 
	{
		alert("Please enter a valid entry for your National Identity Card.")
		document.forms[0].txtNICNo.focus();
		return false;
	}

	if (document.forms[0].txtNICNo.value=="") 
	{
		alert("Please enter your National Identity Card")
		document.forms[0].txtNICNo.focus();
		return false
	} 
	
	if (!str.match(pattern)) 
	{
		alert("Invalid characters. Please check your National Identity Card.")
		document.forms[0].txtNICNo.focus();
		return false;
	}	
	/* ----------end of checking National Identity card ----------------*/

	/* ----------begning of checking Login name  ----------------*/
	patternLogN = /^[a-zA-Z0-9\_\s]+$/
	patternLogN2 = /^[0-9]/
	
	str = document.forms[0].txtLoginName.value
	
	if (str.match(spattern)) 
	{
		alert("Please enter a valid entry for your Login name.")
		document.forms[0].txtLoginName.focus();
		return false;
	}
	
	if ((document.forms[0].txtLoginName.value.length) < 4) 
	{
		alert("Your Login name must be at least 4 characters.")
		document.forms[0].txtLoginName.focus();
		return false;
	}

	if (str.match(patternLogN2)) 
	{
		alert("Please enter a valid entry for your Login name.")
		document.forms[0].txtLoginName.focus();
		return false;
	}

	if (document.forms[0].txtLoginName.value=="") 
	{
		alert("Please enter your Login name")
		document.forms[0].txtLoginName.focus();
		return false
	} 
	
	if (!str.match(patternLogN)) 
	{
		alert("Invalid characters. Please check your Login name.")
		document.forms[0].txtLoginName.focus();
		return false;
	}
	/* ----------end of checking Login name ----------------*/

	/* ----------begning of checking password ----------------*/
	str = document.forms[0].txtPwd.value

	if ((document.forms[0].txtPwd.value.length) < 6) 
	{
		alert("Your password must be at least 6 characters.")
		document.forms[0].txtPwd.focus();
		return false;
	}

	if (document.forms[0].txtPwd.value=="") 
	{
		alert("Please enter your password")
		document.forms[0].txtPwd.focus();
		return false
	} 
	/* ----------end of checking password ----------------*/

	/* ----------begning of checking re-type password ----------------*/
	password1 = document.forms[0].txtPwd.value
	password2 = document.forms[0].txtRePwd.value

	if (document.forms[0].txtRePwd.value=="") 
	{
		alert("Please enter your confirm password")
		document.forms[0].txtRePwd.focus();
		return false
	} 
	if (password1 != password2) 
	{
		alert("Your password entries did not match.");
		document.forms[0].txtRePwd.focus();
		return false;
	}
	/* ----------end of checking re-type password ----------------*/

	/* ----------bedgning of checking Address1----------------*/
	pattern = /^[a-zA-Z0-9\'\,\.\-\/\\\+\#\s]+$/
	str = document.forms[0].txtAddress1.value
	if (document.forms[0].txtAddress1.value=="") 
	{
		alert("Please enter your Permanent Address");
		document.forms[0].txtAddress1.focus();
		return false
	} 
	
	if (str.match(spattern)) 
	{
		alert("Please enter a valid entry for your Permanent Address")
		document.forms[0].txtAddress1.focus();
		return false;
		}	
	
	if (!str.match(pattern)) 
	{
		alert("Invalid characters. Please check and re-enter your Address 1.")
		document.forms[0].txtAddress1.focus();
		return false;
	}
	/* ------------ end of checking Permanent Address----------------*/

	/* birth years */
	document.forms[0].cmbYearPHdob[document.forms[0].cmbYearPHdob.selectedIndex].value = document.forms[0].cmbYearPHdob[document.forms[0].cmbYearPHdob.selectedIndex].value
	/* birth month */
	document.forms[0].cmbMonthPHdob[document.forms[0].cmbMonthPHdob.selectedIndex].value = document.forms[0].cmbMonthPHdob[document.forms[0].cmbMonthPHdob.selectedIndex].value
	/* birth date */
	document.forms[0].cmbDayPHdob[document.forms[0].cmbDayPHdob.selectedIndex].value = document.forms[0].cmbDayPHdob[document.forms[0].cmbDayPHdob.selectedIndex].value
}