	function fnValidate()
	{
		if (document.frmAppointments.doctorname.value=="nameofdoctor")
		{
			alert("Select name of doctor.");
			document.frmAppointments.doctorname.focus();
			return false;
		}
		if (document.frmAppointments.office.value=="Officelocation")
		{
			alert("Select office location.");
			document.frmAppointments.office.focus();
			return false;
		}

		if (document.frmAppointments.fname.value=="")
		{
			alert("Enter patient's first name.");
			document.frmAppointments.fname.focus();
			return false;
		}
		if (document.frmAppointments.lname.value=="")
		{
			alert("Enter patient's last name.");
			document.frmAppointments.lname.focus();
			return false;
		}
	if(frmAppointments.txtEmail.value != "")
	{
		if (document.frmAppointments.txtEmail.value.indexOf ('@') == -1 || document.frmAppointments.txtEmail.value.indexOf ('.') == -1)	{
			alert("Please Enter proper Email Id");
			frmAppointments.txtEmail.focus();
			return false;}
		else if(document.frmAppointments.txtEmail.value.indexOf ('@')> document.frmAppointments.txtEmail.value.indexOf ('.')){
			alert("Please Enter proper Email Id");
			frmAppointments.txtEmail.focus();
			return false;}
		else if(document.frmAppointments.txtEmail.value.indexOf ('@')+1 == document.frmAppointments.txtEmail.value.indexOf ('.')){
			alert("Please Enter proper Email Id");
			frmAppointments.txtEmail.focus();
			return false;}
	}
		
		return true;
	}	
	
	function CheckNumerals(key)
{
	if ((key<48|| key>57))
	{
		return 0;
	}	
	else
		return key;	

}
function fnCheckNumerals(){
window.event.keyCode=CheckNumerals(window.event.keyCode);   	
	return true;
}

