<!--//--><![CDATA[//><!--
//THIS FILE HAS VALIDATE SCRIPT FOR CLP, FLP REG and TAF FORMS //				  
				  
// BEGIN OF CLP SECTION ///
    function clp_validateForm()
	   {				 
	   		alert("In the Validator");
                 var l_blnNoErrors = true;
                 var l_strError = "";
				 var strAddress = document.formReq.address.value;
myRE = new RegExp("http", "i");

				 if(strAddress.match(myRE)) 
                 {
                       alert("URLs are not allowed in our form.");
                       l_strError += "error \n";
                       document.formReq.address.focus();
                       document.formReq.address.select();
                       return false;
                  } 
				 
				 var stre = document.formReq.experience.value;
				if(stre.match(myRE)) 
                {
                     alert("URLs are not allowed in our form.");
                      l_strError += "error \n";
                       document.formReq.experience.focus();
                       document.formReq.experience.select();
                       return false;
                  }  

				 var strg = document.formReq.goals.value;
				 if(strg.match(myRE)) 
                {
                     alert("URLs are not allowed in our form.");
                      l_strError += "error \n";
                       document.formReq.goals.focus();
                       document.formReq.goals.select();
                       return false;
                  }  
 				 var strc = document.formReq.comments.value;
				 if(strc.match(myRE)) 
                {
                     alert("URLs are not allowed in our form.");
                      l_strError += "error \n";
                       document.formReq.comments.focus();
                       document.formReq.comments.select();
                       return false;
                  }  				 

				var fullname = document.formReq.fullname.value;
				var strCity = document.formReq.city.value;
				var strState = document.formReq.state.value;
				  
				if(fullname == "" || fullname == " " || fullname == null) 
                 {
                       alert("Please enter your full name.");
                       l_strError += "error \n";
                       document.formReq.fullname.focus();
                       document.formReq.fullname.select();
                       return false;
                  }  
				 
				 if(strAddress == "" || strAddress == " " || strAddress == null) 
                 {
                       alert("Please enter your address.");
                       l_strError += "error \n";
                       document.formReq.address.focus();
                       document.formReq.address.select();
                       return false;
                  }  
				   
				 if(strCity == "" || strCity == " " || strCity == null) 
                 {
                       alert("Please enter your city of residence.");
                       l_strError += "error \n";
                       document.formReq.city.focus();
                       document.formReq.city.select();
                       return false;
                  }  

				 if(strState == "" || strState == " " || strState == null) 
                 {
                       alert("Please enter your state of residence.");
                       l_strError += "error \n";
                       document.formReq.state.focus();
                       document.formReq.state.select();
                       return false;
                  }  
				 var strZipCode  = document.formReq.zip.value;  
                 reZip = /^\d{5}$/;
				 if(!reZip.test(strZipCode)) {
				       alert("Please enter a 5 digit zip code.");
                       l_strError += "error \n";
                       document.formReq.zip.focus();
					   document.formReq.zip.select();
                       return false;
				 }
                  var strPhone1 = document.formReq.phone1.value;
                  var strPhone2 = document.formReq.phone2.value;
                rePhone = /^\d{3}-\d{3}-\d{4}$/;   
                if(!rePhone.test(strPhone1)) 
                 {
                       alert("Please enter your phone number in the format xxx-xxx-xxxx.");
                       l_strError += "error \n";
                       document.formReq.phone1.focus();
                       document.formReq.phone1.select();
                       return false;
                 } 
				 if  (!(strPhone2 == "" || strPhone2 == " " || strPhone2 == null) )
				 {
				   if(!rePhone.test(strPhone2)) 
                   {
                       alert("Please enter your phone number in the format xxx-xxx-xxxx.");
                       l_strError += "error \n";
                       document.formReq.phone2.focus();
                       document.formReq.phone2.select();
                       return false;
                   }
				 }
				var strEmail = document.formReq.email.value;
                reEmailChar = /[^\w\.@-]/;
                reEmailLength = /^[\w\.@-]{5,64}$/;
                if(reEmailChar.test(strEmail) ||  !reEmailLength.test(strEmail) || !strEmail.match(/@{1}/) || !strEmail.match(/\.+/))
                 {
                         alert("Please enter a valid email address");
                         l_strError += "error \n";
                         document.formReq.email.focus();
                         document.formReq.email.select();
                         return false;
                  }
				var examLang = document.formReq.studylang.selectedIndex;  
				 if (examLang == 0){
				       alert("Please select a language.");
                       l_strError += "error \n";
                       document.formReq.studylang.focus();
                       return false;
				 }
		      var ckbAccept = document.formReq.accept;
			  if(ckbAccept.checked == false)
                 {
                       alert("Please check the box indicating your acceptance of our terms and conditions.");
                       l_strError += "error \n";
                       document.formReq.accept.focus();
                       return false;
                  }  
               if (l_strError == "" || l_strError==" ")
               {
                       l_blnNoErrors = true;       
               } else {      
                      l_blnNoErrors = false;
                      alert (l_strError );
               }
              return l_blnNoErrors;
     } 	
// END OF CLP SECTION ///
// BEGIN FLP FORM SECTION //////////////////////////////////////////////////////////////////
//  This function validates the form by checking the values entered by the user             
//  by accessing the form's elements array before allowing the form to submit using the   
//  event handler, onSubmit, to call the function when the user clicks the submit button.   
//  If the function returns true, the form submits, if it returns false, the form will not     
//  submit. As the function executes, alert windows open up to guide the user                    
//  in providing the required info.             
/////////////////////////////////////////////////////////////////////////////////// 
 
     function flp_validateForm()
	   {
                /////////////////////////////////////////////////////////////////////////////////
                // The first variable is Boolean. It is initialized with a true value and will be assigned  
                //   value if any errors are found in the form at the last condition of the function..          
                //  Its value is returned at the end of the function. True allows the form to submit.        
                //  False prevents it. It is a bit redundant in that rather than using the boolean               
                //  value of this variable, the statements return true and return false could be used.       
                //  I wanted to halt the execution of the function as errors occurred in order to put        
                //  focus and selection onto the form's text boxes, to alert the user error by error,         
                //  rather than potencially barraging the user with multiple alerts upon submit.              
                /////////////////////////////////////////////////////////////////////////////////

                 var l_blnNoErrors = true;

                 /////////////////////////////////////////////////////////////////////////////////
                 //  An Error value is created with this string variable. It is used to track the                  
                 //  presence of errors (and the number of errors in  the debugging process)                      
                 //  It is initialized with a null value. As the function executes, its is given a value         
                 //  upon each occurance of invalid entries by the user. In the function's final condition   
                 //  it's value is used to determine whether the form submits or not. If its value is         
                 //  no longer null, the boolean variable  which is returned by the function is assigned     
                 //  the value false . If strError's retains it's initialized value of null                               
                 //  the boolean value is unchanged.                                                                                    
                 /////////////////////////////////////////////////////////////////////////////////

                 var l_strError = "";
				 
				 var firstname = document.intakeForm.intakeForm_firstname.value;
				 if(firstname == "" || firstname == " " || firstname == null) 
                 {
                       alert("Please enter your first name.");
                       l_strError += "error \n";
                       document.intakeForm.intakeForm_firstname.focus();
                       document.intakeForm.intakeForm_firstname.select();
                       return false;
                  }  
				var lastname = document.intakeForm.intakeForm_lastname.value;
				 if(lastname == "" || lastname == " " || lastname == null) 
                 {
                       alert("Please enter your last name.");
                       l_strError += "error \n";
                       document.intakeForm.intakeForm_lastname.focus();
                       document.intakeForm.intakeForm_lastname.select();
                       return false;
                  } 
             
                //creating a variable for the value of the form element object txtEmail

                var strEmail = document.intakeForm.intakeForm_email.value;

                ////////////////////////////////////////////////////////////////////////////
                //  creating a regular expression to match for a pattern where any one character    
                //  is not any of the following characters :  the @ symbol, the  ".", the hyphen,       
                // underscore, a number between 0-9, a letter  a-z or  A-Z                                  
                ////////////////////////////////////////////////////////////////////////////

                reEmailChar = /[^\w\.@-]/;

                ///////////////////////////////////////////////////////////////////
                // this regular expression will be used to check the length of the value    
                // of the string parameter to ensure it is between 5-64 characters        
                ///////////////////////////////////////////////////////////////////

                reEmailLength = /^[\w\.@-]{5,64}$/;

                /////////////////////////////////////////////////////////////////////////////////////
                //  here the string parameter  strEmail is tested for a match of the pattern defined          
                //  as  reEmail which checks for the presence of any one invalid character within its value, 
                //   OR if the string parameter is NOT 5-64 characters in length  OR  if there is NOT an      
                //  occurance of the @symbol , OR if there is NOT at least one period(.) then the following     
                //  code is executed an alert guides the user to change the invalid entry,                              
                //  a value is assigned to the variable strError, focus and selection are passed to the form   
                //  element and the false value is returned to the function to halt execution so that the user 
                //  can correct the entry                //////////////////////////////////////////////////////////////////////////////////////
                 
                if(reEmailChar.test(strEmail) ||  !reEmailLength.test(strEmail) || !strEmail.match(/@{1}/) || !strEmail.match(/\.+/))
                 {
                         alert("Please enter a valid email address");
                         l_strError += "error \n";
                         document.intakeForm.intakeForm_email.focus();
                         document.intakeForm.intakeForm_email.select();
                         return false;
                  }

                //creating a string variable for the value of the form element object txtBday
				
				
                  var strPhone1 = document.intakeForm.intakeForm_phone1.value;
                  var strPhone2 = document.intakeForm.intakeForm_phone2.value;
				  
                //////////////////////////////////////////////////////////////////////                      
                //  creating a regular expression to match the phone pattern  xxx-xxx-xxxx    
                //  which looks for the entire string to match the pattern of any number     
                //  0-9 occurring thrice followed by a hyphen, followed by again     
                //  three of any numbers 0-9 followed by a hyphen followed by           
                //  four of any numbers between 0-9                                                          
                /////////////////////////////////////////////////////////////////////
                       
                rePhone = /^\d{3}-\d{3}-\d{4}$/;   

        //////////////////////////////////////////////////////////////////////////////////////
                //  If the pattern defined in  reBdayis NOT matched the following code is executed                 
                //  an alert guides the user to change the invalid entry ,                                                       
                //  a value is assigned to the variable strError, focus and selection are passed to the form     
                //  element and the false value is returned to the function to halt execution so that the user 
                //  can correct the entry            //////////////////////////////////////////////////////////////////////////////////////

                if(!rePhone.test(strPhone1)) 
                 {
                       alert("Please enter your phone number in the format xxx-xxx-xxxx.");
                       l_strError += "error \n";
                       document.intakeForm.intakeForm_phone1.focus();
                       document.intakeForm.intakeForm_phone1.select();
                       return false;
                 } 
				 
				 
				 var phone1type = document.intakeForm.intakeForm_phone1type.selectedIndex;  
                 
				 if (phone1type == 0){
				       alert("Please select the type of phone.");
                       l_strError += "error \n";
                       document.intakeForm.intakeForm_phone1type.focus();
                       return false;
				 }
				 
				 
				 if  (!(strPhone2 == "" || strPhone2 == " " || strPhone2 == null) )
				 {
				   if(!rePhone.test(strPhone2)) 
                   {
                       alert("Please enter your phone number in the format xxx-xxx-xxxx.");
                       l_strError += "error \n";
                       document.intakeForm.intakeForm_phone2.focus();
                       document.intakeForm.intakeForm_phone2.select();
                       return false;
                   }
				   }
				 
				 
				var referral = document.intakeForm.intakeForm_referral.selectedIndex;  
                 
				 if (referral == 0){
				       alert("Choose one...");
                       l_strError += "error \n";
                       document.intakeForm.intakeForm_referral.focus();
                       return false;
				 }
				var examLang = document.intakeForm.intakeForm_lang.selectedIndex;  
                 
				 if (examLang == 0){
				       alert("Please select a language.");
                       l_strError += "error \n";
                       document.intakeForm.intakeForm_lang.focus();
                       return false;
				 }
/////////////////////////////////////////////////////////////////////////////////////////
                //  This is the final condition of the function which compares the value of the variable      
                //  tracking the occurance of errors, strError,to the null value. A null value indicates that every
                //  form element validated, A value is NOT null indicates at least one error . If the value IS null
                // the user is alerted with a thank you and the Boolean Variable l_blnNoErrors is assigned  
                // a value of true and execution of the function continues to return the true value.
                //  ELSE the boolean variable is assigned a value of false which is returned by the function 
                ////////////////////////////////////////////////////////////////////////////////////////

               if (l_strError == "" || l_strError==" ")
               {
                       l_blnNoErrors = true;
                       
               }
               else
               {      
                      l_blnNoErrors = false;
                      alert (l_strError );
               }

              //-----Here the value of the Boolean variable is returned to the event handler.
              //----- If it is true the form submits, if false the function will be called again 
              //-----when the user clicks the Submit button again.

              return l_blnNoErrors;
     } 
	      function validateRegFormStep1()
	   {

               var l_blnNoErrors = true;

               var l_strError = ""; 
				 
	  		   var selectedLang = document.formStep1.langID.selectedIndex;  
                 
			   if (selectedLang == 0){
				       alert("Please select a language.");
                       l_strError += "error \n";
                       document.formStep1.langID.focus();
                       return false;
				}
	  
	           if (l_strError == "" || l_strError==" ")
               {
                       l_blnNoErrors = true;
                       
               }
               else
               {      
                      l_blnNoErrors = false;
                      alert (l_strError );
               }

              return l_blnNoErrors;
     } 
	     function validateRegFormStep2()
	   {

               var l_blnNoErrors = true;

               var l_strError = ""; 
				 
	  		   var selectedCourse = document.formStep2.courseID.selectedIndex;  
                 
			   if (selectedCourse == 0){
				       alert("Please select a course.");
                       l_strError += "error \n";
                       document.formStep2.courseID.focus();
                       return false;
				}
	  
	           if (l_strError == "" || l_strError==" ")
               {
                       l_blnNoErrors = true;
                       
               }
               else
               {      
                      l_blnNoErrors = false;
                      alert (l_strError );
               }

              return l_blnNoErrors;
     } 
//END OF FLP SECTION //	 
//BEGIN TAF SECTION //	  
     function taf_validateForm()
	   {


                 var l_blnNoErrors = true;

                 var l_strError = "";

				 var friends_name = document.taf.friends_name.value;
				 if(friends_name == "" || friends_name == " " || friends_name == null) 
                 {
                       alert("Please enter your friend's name.");
                       l_strError += "error \n";
                       document.taf.friends_name.focus();
                       document.taf.friends_name.select();
                       return false;
                  } 
             
                var friendsEmail = document.taf.friends_email.value;
                            
                reEmailChar = /[^\w\.@-]/;

                reEmailLength = /^[\w\.@-]{5,64}$/;
                                                                                                           
                if(reEmailChar.test(friendsEmail) ||  !reEmailLength.test(friendsEmail) || !friendsEmail.match(/@{1}/) || !friendsEmail.match(/\.+/))
                 {
                         alert("Please enter a valid email address");
                         l_strError += "error \n";
                         document.taf.friends_email.focus();
                         document.taf.friends_email.select();
                         return false;
                  }

				 
				 var your_name = document.taf.your_name.value;
				 if(your_name == "" || your_name == " " || your_name == null) 
                 {
                       alert("Please enter your name.");
                       l_strError += "error \n";
                       document.taf.your_name.focus();
                       document.taf.your_name.select();
                       return false;
                  }  
				 
                var yourEmail = document.taf.your_email.value;

              if(reEmailChar.test(yourEmail) ||  !reEmailLength.test(yourEmail) || !yourEmail.match(/@{1}/) || !yourEmail.match(/\.+/))
                 {
                         alert("Please enter a valid email address");
                         l_strError += "error \n";
                         document.taf.your_email.focus();
                         document.taf.your_email.select();
                         return false;
                  }
               if (l_strError == "" || l_strError==" ")
               {
                       l_blnNoErrors = true;
                       
               }
               else
               {      
                      l_blnNoErrors = false;
                      alert (l_strError );
               }
              return l_blnNoErrors;
     } 
 
//--><!]]>