
// JavaScript Document

function checkContactForm()
{
 var Counter;
 var Correct;

 Correct = 0;

 if( document.forms[0].Title_of_Audit_Program.value == "" )
 {
 	alert("Please insert the Title of Audit Project.");
 	document.forms[0].Title_of_Audit_Program.focus( );
 	return false;
 }

 if( document.forms[0].Name_of_Organisation.value == "" )
 {
 	alert("Please insert the Name of Organisation.");
 	document.forms[0].Title_of_Audit_Program.focus( );
 	return false;
 }

 if( document.forms[0].Address.value == "" )
 {
 	alert("Please insert an Address.");
 	document.forms[0].Title_of_Audit_Program.focus( );
 	return false;
 }

 if( document.forms[0].realname.value == "" )
 {
 	alert("Please insert the name of Project Lead.");
 	document.forms[0].realname.focus( );
 	return false;
 }

 if( document.forms[0].Contact_Address.value == "" )
 {
 	alert("Please insert Project Lead Address.");
 	document.forms[0].Contact_Address.focus( );
 	return false;
 }

 if( document.forms[0].Phone_Day_Time.value == "" )
 {
 	alert("Please insert Day Time Phone Number.");
 	document.forms[0].Phone_Day_Time.focus( );
 	return false;
 }


 if( document.forms[0].Contact_Address.value == "" )
 {
 	alert("Please insert Contact Address.");
 	document.forms[0].Contact_Address.focus( );
 	return false;
 }

 if( document.forms[0].Email.value == "" )
 {
 	alert("Please insert Email.");
 	document.forms[0].Email.focus( );
 	return false;
 }

  if(-1 == document.forms[0].Email.value.indexOf("@")) { 
       document.forms[0].Email.focus(); 
       alert("Your email must have a '@'."); 
       return false; 
       }
    if(-1 != document.forms[0].Email.value.indexOf(",")) { 
       document.forms[0].Email.focus(); 
       alert("Your email must not have a ',' in it"); 
       return false; 
       }
    if(-1 != document.forms[0].Email.value.indexOf("#")) { 
       document.forms[0].Email.focus(); 
       alert("Your email must not have an '#' in it." ); 
       return false; 
       }
    if(-1 != document.forms[0].Email.value.indexOf("!")) { 
       document.forms[0].Email.focus(); 
       alert("Your email must not have a '!' in it." ); 
       return false; 
       }
    if(-1 != document.forms[0].Email.value.indexOf(" ")) { 
       document.forms[0].Email.focus(); 
       alert("Your email must not have a space in it." ); 
       return false; 
       }
    if(document.forms[0].Email.value.length ==
         (document.forms[0].Email.value.indexOf("@")+1) ) {
       document.forms[0].Email.focus();
       alert("Your email must have a domain name after the '@'.");
       return false;
       }

    if(document.forms[0].Email.value.length == 0) { 
      document.forms[0].Email.focus(); 
      alert("Please enter your email."); 
      return false; 
      }

 if( document.forms[0].Finance_Director.value == "" )
 {
 	alert("Please insert Finance Director Name.");
 	document.forms[0].Finance_Director.focus( );
 	return false;
 }

 if( document.forms[0].Finance_Director_Address.value == "" )
 {
 	alert("Please insert Finance Director Address.");
 	document.forms[0].Finance_Director_Address.focus( );
 	return false;
 }

 if( document.forms[0].Finance_Director_Phone_Day_Time.value == "" )
 {
 	alert("Please insert Finance Director Telephone Number.");
 	document.forms[0].Finance_Director_Phone_Day_Time.focus( );
 	return false;
 }


 if( document.forms[0].Finance_Director_Email.value == "" )
 {
 	alert("Please insert Finance Director Email.");
 	document.forms[0].Finance_Director_Email.focus( );
 	return false;
 }

  if(-1 == document.forms[0].Finance_Director_Email.value.indexOf("@")) { 
       document.forms[0].Finance_Director_Email.focus(); 
       alert("Your email must have a '@'."); 
       return false; 
       }
    if(-1 != document.forms[0].Finance_Director_Email.value.indexOf(",")) { 
       document.forms[0].Finance_Director_Email.focus(); 
       alert("Your email must not have a ',' in it"); 
       return false; 
       }
    if(-1 != document.forms[0].Finance_Director_Email.value.indexOf("#")) { 
       document.forms[0].Finance_Director_Email.focus(); 
       alert("Your email must not have an '#' in it." ); 
       return false; 
       }
    if(-1 != document.forms[0].Finance_Director_Email.value.indexOf("!")) { 
       document.forms[0].Finance_Director_Email.focus(); 
       alert("Your email must not have a '!' in it." ); 
       return false; 
       }
    if(-1 != document.forms[0].Finance_Director_Email.value.indexOf(" ")) { 
       document.forms[0].Finance_Director_Email.focus(); 
       alert("Your email must not have a space in it." ); 
       return false; 
       }
    if(document.forms[0].Finance_Director_Email.value.length ==
         (document.forms[0].Finance_Director_Email.value.indexOf("@")+1) ) {
       document.forms[0].Finance_Director_Email.focus();
       alert("Your email must have a domain name after the '@'.");
       return false;
       }

    if(document.forms[0].Finance_Director_Email.value.length == 0) { 
      document.forms[0].Finance_Director_Email.focus(); 
      alert("Please enter Finance Director email."); 
      return false; 
      }


 if( document.forms[0].Project_Title.value == "" )
 {
 	alert("Please insert Project Title.");
 	document.forms[0].Project_Title.focus( );
 	return false;
 }



 if( document.forms[0].Project_Title.value == "" )
 {
 	alert("Please insert Project Title.");
 	document.forms[0].Project_Title.focus( );
 	return false;
 }

 if( document.forms[0].Confirmation.checked == false )
 {
 	alert("Please Confirm that you have read this application and support this request.");
 	document.forms[0].Confirmation.focus( );
 	return false;
 }

 if( document.forms[0].Chief_Executive_Organisation.value == "" )
 {
 	alert("Please insert Name of Chief Executive Organisation.");
 	document.forms[0].Chief_Executive_Organisation.focus( );
 	return false;
 }


 if( document.forms[0].Chief_Executive_Full_Name.value == "" )
 {
 	alert("Please insert Name of Chief Executive.");
 	document.forms[0].Chief_Executive_Full_Name.focus( );
 	return false;
 }

 if( document.forms[0].Chief_Executive_Address.value == "" )
 {
 	alert("Please insert address of Chief Executive.");
 	document.forms[0].Chief_Executive_Address.focus( );
 	return false;
 }

 if( document.forms[0].Chief_Executive_Phone_Day_Time.value == "" )
 {
 	alert("Please insert phone number of Chief Executive.");
 	document.forms[0].Chief_Executive_Phone_Day_Time.focus( );
 	return false;
 }

    return true;
  }



function checkInviteForm()
{
 var Counter;
 var Correct;

 Correct = 0;

 if( document.forms[0].realname.value == "" )
 {
 	alert("Please insert Name.");
 	document.forms[0].realname.focus( );
 	return false;
 }

 if( document.forms[0].Job_title.value == "" )
 {
 	alert("Please insert Job Title.");
 	document.forms[0].Job_title.focus( );
 	return false;
 }

 if( document.forms[0].Organisation.value == "" )
 {
 	alert("Please insert Organisation.");
 	document.forms[0].Organisation.focus( );
 	return false;
 }

 if( document.forms[0].Address.value == "" )
 {
 	alert("Please insert Address.");
 	document.forms[0].Address.focus( );
 	return false;
 }

 if( document.forms[0].Telephone.value == "" )
 {
 	alert("Please insert Telephone Number.");
 	document.forms[0].Telephone.focus( );
 	return false;
 }

 if( document.forms[0].Email.value == "" )
 {
 	alert("Please insert Email Address.");
 	document.forms[0].Email.focus( );
 	return false;
 }

    if(-1 == document.forms[0].Email.value.indexOf("@")) { 
       document.forms[0].Email.focus(); 
       alert("Your email must have a '@'."); 
       return false; 
       }
    if(-1 != document.forms[0].Email.value.indexOf(",")) { 
       document.forms[0].Email.focus(); 
       alert("Your email must not have a ',' in it"); 
       return false; 
       }
    if(-1 != document.forms[0].Email.value.indexOf("#")) { 
       document.forms[0].Email.focus(); 
       alert("Your email must not have an '#' in it." ); 
       return false; 
       }
    if(-1 != document.forms[0].Email.value.indexOf("!")) { 
       document.forms[0].Email.focus(); 
       alert("Your email must not have a '!' in it." ); 
       return false; 
       }
    if(-1 != document.forms[0].Email.value.indexOf(" ")) { 
       document.forms[0].Email.focus(); 
       alert("Your email must not have a space in it." ); 
       return false; 
       }
    if(document.forms[0].Email.value.length ==
         (document.forms[0].Email.value.indexOf("@")+1) ) {
       document.forms[0].Email.focus();
       alert("Your email must have a domain name after the '@'.");
       return false;
       }

    if(document.forms[0].Email.value.length == 0) { 
      document.forms[0].Email.focus(); 
      alert("Please enter your email."); 
      return false; 
      }

    return true;
  }

