function validate_form(thisform)
{

	//First Name
	if (thisform.txtName.value=="")
	{
		alert("Please enter a value for the \"Name\" field.");
		thisform.txtName.focus();
		return false;
	}
	
	//Surname
	if (thisform.txtSurname.value=="")
	{
		alert("Please enter a value for the \"Surname\" field.");
		thisform.txtSurname.focus();
		return (false);
	}

	//Treatment
	if (thisform.ddTreatment.value=="")
	{
		alert("Please select a value for the \"Treatment\" field.");
		thisform.ddTreatment.focus();
		return (false);
	}

	//Date
	if (thisform.txtDate.value=="")
	{
		alert("Please enter a value for the \"Date\" field.");
		thisform.txtDate.focus();
		return (false);
	}

	//Time - Hour
	if (thisform.ddHour.value=="")
	{
		alert("Please select a value for the \"Time\" field.");
		thisform.ddHour.focus();
		return (false);
	}

	//Time - Minute
	if (thisform.ddMinute.value=="")
	{
		alert("Please select a value for the \"Time\" field.");
		thisform.ddMinute.focus();
		return (false);
	}	
	
	//Cell Number
	var checkOK = "0123456789-+";
	var checkStr = thisform.txtCellNumber.value;
	var allValid = true;
	
	if (thisform.txtCellNumber.value=="")
	{
		alert("Invalid Cellphone number");
		thisform.txtCellNumber.focus();
		return (false);
	}
	else
	{	
		for (i = 0;  i < checkStr.length;  i++)
		{
			ch = checkStr.charAt(i);
			for (j = 0;  j < checkOK.length;  j++)
				if (ch == checkOK.charAt(j))
					break;
				if (j == checkOK.length)
				{
					allValid = false;
					break;
				}
		}
		if (!allValid)
		{
			alert("Please enter only digit characters in the \"Cellphone number\" field.");
			thisform.txtCellNumber.focus();
			return (false);
		}
	}	

	//Email Addresses
	var at="@";
	var dot=".";
	
	var lat_1=thisform.txtEmail.value.indexOf(at);
	var lstr_1=thisform.txtEmail.value.length;
	var ldot_1=thisform.txtEmail.value.indexOf(dot);
	if (thisform.txtEmail.value.indexOf(at)==-1){
	   alert("Invalid E-mail Address");
	   thisform.txtEmail.focus();
	   return (false);
	}

	if (thisform.txtEmail.value.indexOf(at)==-1 || thisform.txtEmail.value.indexOf(at)==0 || thisform.txtEmail.value.indexOf(at)==lstr_1){
	   alert("Invalid E-mail Address");
	   thisform.txtEmail.focus();
	   return (false);
	}

	if (thisform.txtEmail.value.indexOf(dot)==-1 || thisform.txtEmail.value.indexOf(dot)==0 || thisform.txtEmail.value.indexOf(dot)==lstr_1){
	    alert("Invalid E-mail Address");
	    thisform.txtEmail.focus();
	    return (false);
	}

	 if (thisform.txtEmail.value.indexOf(at,(lat_1+1))!=-1){
	    alert("Invalid E-mail Address");
	    thisform.txtEmail.focus();
	    return (false);
	 }

	 if (thisform.txtEmail.value.substring(lat_1-1,lat_1)==dot || thisform.txtEmail.value.substring(lat_1+1,lat_1+2)==dot){
	    alert("Invalid E-mail Address");
	    thisform.txtEmail.focus();
	    return (false);
	 }

	 if (thisform.txtEmail.value.indexOf(dot,(lat_1+2))==-1){
	    alert("Invalid E-mail Address");
	    thisform.txtEmail.focus();
	    return (false);
	 }
		
	 if (thisform.txtEmail.value.indexOf(" ")!=-1){
	    alert("Invalid E-mail Address");
	    thisform.txtEmail.focus();
	    return (false);
	 }
}