// Opens Terms and Conditions Window

function opentc()
	{
	tcWindow = open("tc.html","","width=600,height=500,scrollbars=yes")
	}

// Opens Company Information Window

function openinfo()
	{
	infoWindow = open("info.html","","width=600,height=500,scrollbars=yes")
	}

// Opens Company Vacancy Window
	
function openvacancy()
	{
	vacancyWindow = open("coapp.html","","width=600,height=500,scrollbars=yes")
	}
	


// Validation of Form Information

function validateForm()

{

  // Declaration of Variables
  // and Assignment of Values to Variables

      var funcDay = DonkeyForm.Day.value;
      var funcMonth = DonkeyForm.Month.value;
      var funcYear = DonkeyForm.Year.value;
      
      var monthNum;
      
      var county1 = DonkeyForm.County1.value;
      var county2 = DonkeyForm.County2.value;
      
      var town = DonkeyForm.Town.value;
      		//var i = 0;
      		//var x = town.length;
      		//do   		
      		//{
      		//	if (town.charAt(i) == "'")
      		//	{
      		//		alert(x);
      		//	}
      		//	
      		//	i = i + 1;
      		//} while (i < x);
      	
      	town = town.substr(0,1).toUpperCase() + town.substr(1);
      	DonkeyForm.Town.value = town;
      
      var happening = DonkeyForm.TypeOfEvent.value;
      	happening = happening.substr(0,1).toUpperCase() + happening.substr(1);
      	DonkeyForm.TypeOfEvent.value = happening;
       
      var comments = DonkeyForm.Comments.value;
      	comments = comments.substr(0,1).toUpperCase() + comments.substr(1);
		DonkeyForm.Comments.value = comments;
      
      var title = DonkeyForm.Title.value;
      
      var name1 = DonkeyForm.Name1.value; // First name
      	name1 = name1.substr(0,1).toUpperCase() + name1.substr(1);
		DonkeyForm.Name1.value = name1;
		
      var name2 = DonkeyForm.Name2.value; // Surname
      	name2 = name2.substr(0,1).toUpperCase() + name2.substr(1);
		DonkeyForm.Name2.value = name2;
        
      var phone = DonkeyForm.Phone.value;
      var timeOffice = DonkeyForm.OfficeHours.value;
      var timeEvening = DonkeyForm.Evenings.value;
      var timeWeekend = DonkeyForm.Weekends.value;
      
      var emailA = DonkeyForm.EmailA.value;
      var emailB = DonkeyForm.EmailB.value;
      
      var post = DonkeyForm.Post.value;
      	post = post.toUpperCase();
      	DonkeyForm.Post.value = post
           
      var contactSum = 0;
      var callTime = 0;
      
      var superAnalyse = 0;
      var analyseSecA = 0;
      var analyseSecB = 0;
      var analyseSecC = 0;
      var analyseSecD = 0;
      var analyseSecE = 0;
      var analyseSecF = 0;

	  var district = DonkeyForm.District.value;
	    district = district.substr(0,1).toUpperCase() + district.substr(1);
		DonkeyForm.District.value = district;
			
	  var dayGuests = DonkeyForm.DaytimeGuests.value;
	  var eveningGuests = DonkeyForm.EveningGuests.value;
	  
	  var marquee = DonkeyForm.Marquee.value;
        marquee = marquee.substr(0,1).toUpperCase() + marquee.substr(1);
		DonkeyForm.Marquee.value = marquee;
		
		var layout = DonkeyForm.Layout.value;
		
		var linings = DonkeyForm.Linings.value;
		var starRoof = DonkeyForm.StarlightRoof.value;
		var hardFloor = DonkeyForm.WoodFloorCarpets.value;
		var matting = DonkeyForm.CoirMatting.value;
		var lighting = DonkeyForm.Lighting.value;
		var heating = DonkeyForm.Heating.value;
		var tablesChairs = DonkeyForm.TablesChairs.value;
		var danceFloor = DonkeyForm.DanceFloor.value;
		var stage = DonkeyForm.Stage.value;
		var catererTent = DonkeyForm.CatererTent.value;
		
		var posMarquee = DonkeyForm.PositionOfMarquee.value;
		
		var land = DonkeyForm.Land.value;
			land = land.substr(0,1).toUpperCase() + land.substr(1);
			DonkeyForm.Land.value = land;
		
		var ground = DonkeyForm.Ground.value;
			ground = ground.substr(0,1).toUpperCase() + ground.substr(1);
			DonkeyForm.Ground.value = ground;
		
		var landArea = DonkeyForm.LandArea.value;
			landArea = landArea.substr(0,1).toUpperCase() + landArea.substr(1);
			DonkeyForm.LandArea.value = landArea;
		
		var electricity = DonkeyForm.ElectricitySupply.value;
		var vehAccess = DonkeyForm.VehicleAccess.value;
		
		var organisation = DonkeyForm.Organisation.value;
			organisation = organisation.toUpperCase();
			DonkeyForm.Organisation.value = organisation;
		
		var phonelength;


// Validation of Section 1.  Date of Function.

  // Validation that a date selection has been made.
    
    if ( funcMonth == "Month" )  	
      	{
            alert ( "Please enter the full date of your function in the Date Boxes" );
                          	
          	DonkeyForm.Month.focus();
          
      		return false;

      	}
      
    
    
    if ( funcYear == "Year" )  	
    
    	{
    		alert ( "Please enter the full date of your function in the Date Boxes" );

			DonkeyForm.Year.focus();
			
			return false;
		}

    // Validation that the Date selected is true.
      
      if (funcDay != "Day")
      
      {
      
        if (funcMonth == "April" && funcDay == 31) 
        
            {
            
                alert ( "The function date you have entered  -  31 April " + funcYear + "  -  does not exist.  April has only 30 days.  Please select correct date in date boxes." );
                
        		DonkeyForm.Day.focus();
        		
        		return false;
    
    		}
     
        if (funcMonth == "June" && funcDay == 31) 
        
            {
            
                alert ( "The function date you have entered  -  31 June " + funcYear + "  -  does not exist.  June has only 30 days.  Please select correct date in date boxes." );
                
                DonkeyForm.Day.focus();
                
                return false;
            
            }
        
        if (funcMonth == "September" && funcDay == 31) 
        
            {
            
                alert ( "The function date you have entered  -  31 September " + funcYear + "  -  does not exist.  September has only 30 days.  Please select correct date in date boxes." );
                
                DonkeyForm.Day.focus();
                
                return false;
            
            }
        
        if (funcMonth == "November" && funcDay == 31) 
        
            {
            
                alert ( "The function date you have entered  -  31 November " + funcYear + "  -  does not exist.  November has only 30 days.  Please select correct date in date boxes." );
                
                DonkeyForm.Day.focus();
                
                return false;
            
            }
        
        if (funcMonth == "February" && funcDay > 29) 
        
        	{
        
            	alert ("The function date you have entered  -  " + funcDay + " February " + funcYear + "  -  does not exist.  Please enter correct date.");
      
      			DonkeyForm.Day.focus();
      
            	return false;
        	
        	}
      
      	if (funcMonth == "February" && funcDay == 29)
      	
      		{
      		
      		var leapYear = 2008;
      		
      		while (leapYear < funcYear)
      		{
      		leapYear = leapYear + 4;
      		}
      		
      			if (funcYear != leapYear)
      				{	
      		            	alert ("The function date you have entered  -  29 February " + funcYear + "  -  does not exist.  Please enter correct date.");
                  
                  			DonkeyForm.Day.focus();
                  
                        	return false;
      				}
      		
      		}
      
      }
      
      
    // Validation that the Date selected is a future date.
    
    var rightNow = new Date();
    
    var rightNowDate = rightNow.getDate();
    
    var rightNowMonth = rightNow.getMonth();
    
    var rightNowYear = rightNow.getFullYear();
    
   
    if (funcYear < rightNowYear) 
    
    	{
    
    		alert ( "The Function Date you have selected  -  " + funcDay + " " + funcMonth + " " + funcYear + "  -  has already passed.  Please select correct Date.");
        
        	DonkeyForm.Year.focus();
        	
        	return false;
        	
    	}
    
    if (funcMonth == "January") monthNum = 0;
    
    if (funcMonth == "February") monthNum = 1;
            
    if (funcMonth == "March") monthNum = 2;

    if (funcMonth == "April") monthNum = 3;
    
    if (funcMonth == "May") monthNum = 4;
    
    if (funcMonth == "June") monthNum = 5;
    
    if (funcMonth == "July") monthNum = 6;
        
    if (funcMonth == "August") monthNum = 7;
    
    if (funcMonth == "September") monthNum = 8;
    
    if (funcMonth == "October") monthNum = 9;
    
    if (funcMonth == "November") monthNum = 10;
    
    if (funcMonth == "December") monthNum = 11;
     
    
    if (funcYear == rightNowYear && monthNum < rightNowMonth)  
    
    	{
    
    		alert ("The Function Date you have selected  -  " + funcDay + " " + funcMonth + " " + funcYear + "  -  has already passed.  Please select correct Date.");
    
    		DonkeyForm.Month.focus();
    		
    		return false;
    		
    	}
        
    
    if (funcDay != "Day")
    
    {
    
      if (funcYear == rightNowYear && monthNum == rightNowMonth && funcDay < rightNowDate) 
      
      	{
      
          	alert ( "The Function Date you have selected  -  " + funcDay + " " + funcMonth + " " + funcYear + "  -  has already passed.  Please select correct Date."); 
       
       		DonkeyForm.Day.focus();
       
       		return false;
             
       	} 
    }   
   
    // Validation that the Day Box is selected when time limits require this.
    
    if (funcDay == "Day")
    
    {
      
	  // Ensures that the Full Date including Day is selected if there is less than 9 months until the date of the function.
	  		
      if (funcYear == rightNowYear && monthNum < (rightNowMonth + 9)) 
      
      		{
      
      		alert ( "Please insert Full Date of Function." );
      		
      		DonkeyForm.Day.focus();
      		
      		return false;
      
      		}
      
      else if (funcYear == (rightNowYear + 1) && (monthNum + 3) < rightNowMonth) 
            {
      
      		alert ( "Please insert Full Date of Function." );
      		
      		DonkeyForm.Day.focus();
      		
      		return false;
      
      		}

    }
    
    // Amendment of Day Box before submission
    // Not part of validation
        
        if (funcDay == "Day") 
            
            {
            funcDay = "";
            
            DonkeyForm.Day.value = funcDay;
        	}



// Validation of Section 2.  Location of Function.

    // Validation of County Boxes.
      
        // Validation that a selection has been made in both boxes.
            
            if (county1 == "Select County or Area") 
            
            {
            
                alert ( "Please select in both County Boxes the County or Area where your function will take place.");
                
                DonkeyForm.County1.focus();
                
                return false;
            
            }

            if (county2 == "Confirm County or Area") 
            
            {
            
                alert ( "Please select in both County Boxes the County or Area where your function will take place.");
            
            	DonkeyForm.County2.focus();
                
                return false;

        	}
        
        
        // Validation of County accuracy.
              
            if ( county1 != county2 ) 
            
            {
            
            alert ( "Please ensure that the correct county is selected in both County Boxes" );
       
       		DonkeyForm.County1.focus();
       		
       		return false;
       		
       		}
       
    // Validation of Town Box.
        
         // Validation that an entry has been made.
          
            if (town == "") 
            
            {
            
            alert ("Please enter into the Town Box the name of the town [or nearest town] where your  function will take place." );
      
      		DonkeyForm.Town.focus();
      		
      		return false;
      		
			} 
			
		// Validation that town input meets required criteria
			
			if (town != "")
			
			{
			
				if (town.length < 3)  // Validation that Town input exceeds 2 characters 
				
				{
				
    				alert ("Please enter into the Town Box the correct name of the town {or nearest town} where your function will take place.");
    				
    				DonkeyForm.Town.focus();
    				
    				return false;
    				
				}
			
			
				if (town.length > 30)  // Validation that Town input is less than 31 characters 
				
				{
				
    				alert ("Please enter into the Town Box the correct name of the town {or nearest town} where your function will take place.");
    				
    				DonkeyForm.Town.focus();
    				
    				return false;
    				
				}

				if (town.charAt(0) == town.charAt(1) && town.charAt(0) == town.charAt(2))  // Validation that Town input is not a string of identical characters 
				
				{
				
    				alert ("Please enter into the Town Box the correct name of the town {or nearest town} where your function will take place.");
    				
    				DonkeyForm.Town.focus();
    				
    				return false;
    				
				}

			
			}
     
      
      // Validation that district input meets required criteria
			
			if (district != "")
			
			{
			
				if (district.length < 3)  // Validation that District input exceeds 2 characters 
				
				{
				
    				alert ("Please enter into the District Box the correct name of the district or village where your function will take place.");
    				
    				DonkeyForm.District.focus();
    				
    				return false;
    				
				}
			
			
				if (district.length > 30)  // Validation that District input is less than 31 characters 
				
				{
				
    				alert ("Please enter into the District Box the correct name of the district or village where your function will take place.");
    				
    				DonkeyForm.District.focus();
    				
    				return false;
    				
				}

				if (district.charAt(0) == district.charAt(1) && district.charAt(0) == district.charAt(2))  // Validation that District input is not a string of identical characters 
				
				{
				
    				alert ("Please enter into the District Box the correct name of the district or village where your function will take place.");
    				
    				DonkeyForm.District.focus();
    				
    				return false;
    				
				}

	}      
      

// Validation of Section 3.  Type and size of Function.

  	// Validation of Type of Event box.
  
    	// Validation that an entry has been made.
    
      		if (happening == "") 
      		


      			{
      		
      				alert ("Please enter the Type of your Event into the Type of Event Box.")
    
    				DonkeyForm.TypeOfEvent.focus();
    				
    				return false;
    
    			}
    			
    			// Validation that Type of Event input meets required criteria
			
			if (happening != "")
			
			{
			
				if (happening.length < 3)  // Validation that Type of Event input exceeds 2 characters 
				
				{
				
    				alert ("Please enter into the Type of Event Box the type of your Event or Function.");
    				
    				DonkeyForm.TypeOfEvent.focus();
    				
    				return false;
    				
				}
			
			
				if (happening.length > 50)  // Validation that Type of Event input is less than 51 characters 
				
				{
				
    				alert ("Please enter into the Type of Event Box the type of your Event or Function.");
    				
    				DonkeyForm.TypeOfEvent.focus();
    				
    				return false;
    				
				}

				if (happening.charAt(0) == happening.charAt(1) && happening.charAt(0) == happening.charAt(2))  // Validation that Type of Event input is not a string of identical characters 
				
				{
				
    				alert ("Please enter into the Type of Event Box the type of your Event or Function.");
    				
    				DonkeyForm.TypeOfEvent.focus();
    				
    				return false;
    				
				}


			}

    			
    			// Validation that marquee input meets required criteria
			
				if (marquee != "")
			
				{
			
				if (marquee.length < 3)  // Validation that Marquee input exceeds 2 characters 
				
				{
				
    				alert ("Please enter into the Marquee Box the size of the marquee you want, if you know it.");
    				
    				DonkeyForm.Marquee.focus();
    				
    				return false;
    				
				}
			
			
				if (marquee.length > 30)  // Validation that Marquee input is less than 31 characters 
				
				{
				
    				alert ("Please enter into the Marquee Box the size of the marquee you want, if you know it.");
    				
    				DonkeyForm.Marquee.focus();
    				
    				return false;
    				
				}

				if (marquee.charAt(0) == marquee.charAt(1) && marquee.charAt(0) == marquee.charAt(2))  // Validation that Marquee input is not a string of identical characters 
				
				{
				
    				alert ("Please enter into the Marquee Box the size of the marquee you want, if you know it.");
    				
    				DonkeyForm.Marquee.focus();
    				
    				return false;
    				
				}
		}


    			
// Validation of Section 5.  Siting of marquee.
    			
    			
    // Validation that Land input meets required criteria
			
			if (land != "")
			
			{
			
				if (land.length < 3)  // Validation that Land input exceeds 2 characters 
				
				{
				
    				alert ("Please enter into the Land Box the type of land where the marquee is to be installed.");
    				
    				DonkeyForm.Land.focus();
    				
    				return false;
    				
				}
			
			
				if (land.length > 40)  // Validation that Land input is less than 41 characters 
				
				{
				
    				alert ("Please enter into the Land Box the type of land where the marquee is to be installed.");
    				
    				DonkeyForm.Land.focus();
    				
    				return false;
    				
				}

				if (land.charAt(0) == land.charAt(1) && land.charAt(0) == land.charAt(2))  // Validation that Land input is not a string of identical characters 
				
				{
				
    				alert ("Please enter into the Land Box the the type of land where the marquee is to be installed.");
    				
    				DonkeyForm.Land.focus();
    				
    				return false;
    				
				}
		}
    			
    			// Validation that Ground input meets required criteria
			
			if (ground != "")
			
			{
			
				if (ground.length < 3)  // Validation that Ground input exceeds 2 characters 
				
				{
				
    				alert ("Please enter into the Ground Box the type of ground surface where the marquee is to be installed.");
    				
    				DonkeyForm.Ground.focus();
    				
    				return false;
    				
				}
			
			
				if (ground.length > 40)  // Validation that Ground input is less than 41 characters 
				
				{
				
    				alert ("Please enter into the Ground Box the type of ground surface where the marquee is to be installed.");
    				
    				DonkeyForm.Ground.focus();
    				
    				return false;
    				
				}

				if (ground.charAt(0) == ground.charAt(1) && ground.charAt(0) == ground.charAt(2))  // Validation that Ground input is not a string of identical characters 
				
				{
				
    				alert ("Please enter into the Ground Box the type of ground surface where the marquee is to be installed.");
    				
    				DonkeyForm.Ground.focus();
    				
    				return false;
    				
				}
		}
    			
    			// Validation that Land Area input meets required criteria
			
			if (landArea != "")
			
			{
			
				if (landArea.length < 3)  // Validation that Land Area input exceeds 2 characters 
				
				{
				
    				alert ("Please enter into the Land Area Box the size of the land upon which the marquee is to be installed.");
    				
    				DonkeyForm.LandArea.focus();
    				
    				return false;
    				
				}
			
			
				if (landArea.length > 30)  // Validation that Land Area input is less than 31 characters 
				
				{
				
    				alert ("Please enter into the Land Area Box the size of the land upon which the marquee is to be installed.");
    				
    				DonkeyForm.LandArea.focus();
    				
    				return false;
    				
				}

				if (landArea.charAt(0) == landArea.charAt(1) && landArea.charAt(0) == landArea.charAt(2))  // Validation that Land Area input is not a string of identical characters 
				
				{
				
    				alert ("Please enter into the Land Area Box the size of the land upon which the marquee is to be installed.");
    				
    				DonkeyForm.LandArea.focus();
    				
    				return false;
    				
				}

    		}	
    			
// Validation of Section 6.  Comments




		if (comments != "")
			
			{
			

				if (comments.charAt(0) == comments.charAt(1) && comments.charAt(0) == comments.charAt(2))  // Validation that Land Area input is not a string of identical characters 
				
				{
				
    				alert ("Please enter appropriate information into the Comments Box.");
    				
    				DonkeyForm.Comments.focus();
    				
    				return false;
    				
				}

    		}	
    




// Validation of Section 7.  Contact Data.
    
    // Validation of Name.
        
        // Validation of First Name.
            
            if (name1 == "")
            
            {
            
				  	alert ( "Please enter your first name or initial into the First Name Box." );
				  	
				  	DonkeyForm.Name1.focus(); 
            
            		return false;
            }
            
    	// Validation of Last Name.
        	
        	if (name2 == "")
            
            {
            
  				alert ( "Please enter your last name or surname into the Last Name Box." );
  				
  				DonkeyForm.Name2.focus();
            
            	return false;
            
            }
        
        // Amendment of Title Box before transmission
        // Not part of validation
            
            if (title == "Title")
            {
              title = "";
              
              DonkeyForm.Title.value = title;
            }
    

	// Validation of Organisation Box
	
		if (organisation != "")
		{
		
			
				if (organisation.length < 2)  // Validation that Organisation Box input exceeds 1 character 
				
				{
				
    				alert ("Please enter into the Organisation Box the name of your organisation.");
    				
    				DonkeyForm.Organisation.focus();
    				
    				return false;
    				
				}
			
			
				if (organisation.length > 40)  // Validation that Organisation Box input is less than 41 characters 
				
				{
				
    				alert ("Please enter into the Organisation Box the name of your organisation.");
    				
    				DonkeyForm.Organisation.focus();
    				
    				return false;
    				
				}

				if (organisation.charAt(0) == organisation.charAt(1) && organisation.charAt(0) == organisation.charAt(2) && organisation.charAt(0) == organisation.charAt(3))  // Validation that Land Area input is not a string of identical characters 
				
				{
				
    				alert ("Please enter into the Organisation Box the name of your organisation.");
    				
    				DonkeyForm.Organisation.focus();
    				
    				return false;
    				
				}

    		}	

		       
                
    // Validation of Contact Methods
    
    	// Validation that at least two Contact Methods are entered
    	
    			if (emailA == "E-mail Address")
    				{
    				emailA = "";
    				DonkeyForm.EmailA.value = emailA;
    				}
    				
    			if (emailB == "Confirm E-mail Address")
    				{
    				emailB = "";
    				DonkeyForm.EmailB.value = emailB;
    				}

    	        if (emailA != "" && emailB != "") {contactSum = contactSum + 1;}
            	
        		if (phone != "") {contactSum = contactSum + 1;}
        		
        		if (post != "") {contactSum = contactSum + 1;}
        		
        		
                		if (contactSum < 2)
                		
                		{
                		
                		alert ("Please enter at least 2 Contact Methods");
                		
                		DonkeyForm.EmailA.focus();
                		
                		return false;
                		
						}
						
		// Validation that both E-mail address entries are valid and equal 


                
                var attA = 1;
                var dotA = 1;
                var attB = 1;
                var dotB = 1;
  
if (emailA != "")
{
              
while (attA < emailA.length)
{

if (emailA.charAt(attA) == "@")
{
break;
}
attA = attA + 1;

if (attA == emailA.length)
        		{
                  alert ("Please enter a valid e-mail address in both E-mail Boxes.");
                  DonkeyForm.EmailA.focus();
                  return false;
                }
}


while (dotA < emailA.length)
{

if (emailA.charAt(dotA) == "." && dotA > attA)
{
break;
}
dotA = dotA + 1;

if (dotA == emailA.length)
        		{
                  alert ("Please enter a valid e-mail address in both E-mail Boxes.");
                  DonkeyForm.EmailA.focus();
                  return false;
                }
}
}


if (emailB != "")
{

while (attB < emailB.length)
{

if (emailB.charAt(attB) == "@")
{
break;
}
attB = attB + 1;

if (attB == emailB.length)
        		{
                  alert ("Please enter a valid e-mail address in both E-mail Boxes.");
                  DonkeyForm.EmailB.focus();
                  return false;
                }
}


while (dotB < emailB.length)
{

if (emailB.charAt(dotB) == ".")
{
if (dotB > attB) {break;}
}
dotB = dotB + 1;

if (dotB == emailB.length)
        		{
                  alert ("Please enter a valid e-mail address in both E-mail Boxes.");
                  DonkeyForm.EmailB.focus();
                  return false;
                }
}
}


if (emailA != "")

{

if (attA < 2 && dotA < (attA + 2) && (dotA + 2) > emailA.length)

        		{
                  alert ("Please enter a valid e-mail address in both E-mail Boxes.");
                  DonkeyForm.EmailA.focus();
                  return false;
                }
}

if (emailB != "")

{

if (attB < 2 && dotB < (attB + 2) && (dotB + 2) > emailB.length)

        		{
                  alert ("Please enter a valid e-mail address in both E-mail Boxes.");
                  DonkeyForm.EmailB.focus();
                  return false;
                }
}


      		if (emailA != emailB)
        		{
                  alert ("Please enter your correct e-mail address in both E-mail Boxes.");
                  DonkeyForm.EmailA.focus();
                  return false;
                }



        
        // Validation that Telephone Number is true and at least one Calling Time is selected
        
        // Validation that Telephone Number is between 10 and 18 characters in length
        
        if (phone != "")
        
        {
        
        if (phone.length <= 9)
        
        {
        alert ("Please enter a valid telephone number.");
        DonkeyForm.Phone.focus();
        return false;
        }

        if (phone.length >= 19)
        
        {
        alert ("Please enter a valid telephone number.");
        DonkeyForm.Phone.focus();
        return false;
        }
        }
        
        // Validation that Telephone Number consists of numeric characters or whitespace or +
        
        if (phone != "")
        
        {
        
        phonelength = phone.length;
        
  
        
        var phonearray = new Array();
        phonearray[0] = "0";
        phonearray[1] = "1";
        phonearray[2] = "2";
        phonearray[3] = "3";
        phonearray[4] = "4";
        phonearray[5] = "5";
        phonearray[6] = "6";
        phonearray[7] = "7";
        phonearray[8] = "8";
        phonearray[9] = "9";
        phonearray[10] = " ";//Whitespace
        phonearray[11] = "+";
        
        var phoneinc1 = 0;
        var phoneinc2 = 0;
        
        var phonechar;
        
		var phonecharOK = 0; 
        
        while (phoneinc1 < phonelength)//Start of first loop
        {
        phonecharOK = 0;
        phonechar = phone.charAt(phoneinc1);
        
       
        
        while (phoneinc2 < 12)//Start of second loop
        {
        
        
        
        if (phonechar == phonearray[phoneinc2])
        {
        phonecharOK = 1;
        phoneinc2 = 0;
        break;
        }
        phoneinc2 = phoneinc2 + 1;
        
        }//End of second loop
        
        if (phonecharOK == 0)
        {
        
        alert ("Please enter a valid telephone number.");
        DonkeyForm.Phone.focus();
        return false;
        }

        
        
        phoneinc1 = phoneinc1 + 1;
        }//End of first loop
        
        }
        
        
        
        // Validation that Telephone Number has a zero or plus sign as first character
        
        if (phone != "")
        
        {
        
        if (phone.charAt(0) != 0 && phone.charAt(0) != "+")
        
        {
        alert ("Please enter a valid telephone number.");
        DonkeyForm.Phone.focus();
        return false;
        }
        
        }
        
        // Validation that Telephone Number does not consist of a sequence of either zeros or +'s 
        
        if (phone != "")
        
        {
        
        if (phone.charAt(0) == 0 && phone.charAt(1) == 0 && phone.charAt(2) == 0)
        
        {
        alert ("Please enter a valid telephone number.");
        DonkeyForm.Phone.focus();
        return false;
        }
        }
        
        // Validation that at least one Calling Time is selected if a Telephone Number is entered
        
        /*if (phone != "")
        
        {
        
        	if (timeOffice != "No")
        	{
        		callTime = callTime + 1;
        	}
        
        	if (timeEvening != "No")
        	{
        		callTime = callTime + 1;
        	}
        
        	if (timeWeekend != "No")
        	{
        		callTime = callTime + 1;
        	}
        
        		if (callTime == 0)
        		{
        			//alert ("Please select a convenient time or times for contact by telephone.");
        
        			DonkeyForm.OfficeHours.focus();
        
        			return false;
        		}
        
        }*/
        
        // Validation of Postal Address
   
   		if (post != "")
   		
   		{
  		        if (post.length < 10)
        
                  {
                    alert ("Please enter a valid postal address.");
                    DonkeyForm.Post.focus();
                    return false;
                  }

				if (post.charAt(1) == post.charAt(0) && post.charAt(2) == post.charAt(0))
        
                  {
                    alert ("Please enter a valid postal address.");
                    DonkeyForm.Post.focus();
                    return false;
                  }


   		}
   
 
   

   // Analysis of non-validated inputs to determine whether sufficient
   // information has been entered overall to enable clients to issue a
   // quotation, and to assess the authenticity of the enquiry
   
   
   // Analysis of Section 2
   
   /*
   
   if (district.length == 0)
   {
   analyseSecA = analyseSecA;
   }
   else
   {
   analyseSecA = (analyseSecA + 1);
   }
   
   if (analyseSecA == 1)
   {
   superAnalyse = superAnalyse + 1;
   }

   // Analysis of Section 3
   
   if (dayGuests.length == 0)
   {
   analyseSecB = analyseSecB;
   }
   else
   {
   analyseSecB = (analyseSecB + 1);
   }
   

   if (eveningGuests.length == 0)
   {
   analyseSecB = analyseSecB;
   }
   else
   {
   analyseSecB = (analyseSecB + 1);
   }
   

	if (marquee.length == 0)
   {
   analyseSecB = analyseSecB;
   }
   else
   {
   analyseSecB = (analyseSecB + 1);
   }
   

   if (layout == "No Selection")
   {
   analyseSecB = analyseSecB;
   }
   else
   {
   analyseSecB = (analyseSecB + 1);
   }
   
	if (analyseSecB == 1)
	{
	superAnalyse = (superAnalyse + 1);
	}
	
	if (analyseSecB > 1)
	{
	superAnalyse = (superAnalyse + 2);

	}

   
   // Analysis of Section 4
   
   if (linings != "No")
   {
   analyseSecC = analyseSecC + 1;
   }
   
   if (starRoof != "No")
   {
   analyseSecC = analyseSecC + 1;
   }
   
	if (hardFloor != "No")
   {
   analyseSecC = analyseSecC + 1;
   }
   
	if (matting != "No")
   {
   analyseSecC = analyseSecC + 1;
   }
   
	if (lighting != "No")
   {
   analyseSecC = analyseSecC + 1;
   }
   
	if (heating != "No")
   {
   analyseSecC = analyseSecC + 1;
   }
   
	if (tablesChairs != "No")
   {
   analyseSecC = analyseSecC + 1;
   }
   
	if (danceFloor != "No")
   {
   analyseSecC = analyseSecC + 1;
   }
   
	if (stage != "No")
   {
   analyseSecC = analyseSecC + 1;
   }
   
	if (catererTent != "No")
   {
   analyseSecC = analyseSecC + 1;
   }
   
	if (analyseSecC > 0 && analyseSecC < 3)
	{
	superAnalyse = superAnalyse + 1;
	}
	
	if (analyseSecC > 2)
	{
	superAnalyse = superAnalyse + 2;
	}

   // Analysis of Section 5
   
   if (posMarquee != "Not Known")
   {
   analyseSecD = analyseSecD + 1;
   }
   
   if (land != "")
   {
   analyseSecD = analyseSecD + 1;
   }
   
	if (ground != "")
   {
   analyseSecD = analyseSecD + 1;
   }
   
	if (landArea != "")
   {
   analyseSecD = analyseSecD + 1;
   }
   
	if (electricity != "Not Known")
   {
   analyseSecD = analyseSecD + 1;
   }
   
	if (vehAccess != "Not Known")
   {
   analyseSecD = analyseSecD + 1;
   }
   
	if (analyseSecD > 0 && analyseSecD < 3)
	{
	superAnalyse = superAnalyse + 1;
	}
	
	if (analyseSecD > 2)
	{
	superAnalyse = superAnalyse + 2;
	}
	
   // Analysis of Section 6
   
   if (DonkeyForm.Comments.length > 0 && DonkeyForm.Comments.length < 50)
   {
   analyseSecE = analyseSecE + 1;
   }
   
   if (DonkeyForm.Comments.length > 49)
   {
   analyseSecE = analyseSecE + 2;
   }
   
   superAnalyse = superAnalyse + analyseSecE;
      
      

   // Analysis of Section 7
   
   if (organisation != "")
   {
   analyseSecF = analyseSecF + 1;
   }
     
   if (emailA != "")
   {
   analyseSecF = analyseSecF + 1;
   }
   
   if (phone != "")
   {
   analyseSecF = analyseSecF + 1;
   }
   
	if (post != "")
   {
   analyseSecF = analyseSecF + 1;
   }
   
	if (analyseSecF > 2)
	{
	superAnalyse = superAnalyse + 1;
	}
	if (superAnalyse < 5)
	{
	alert ("The amount of information that you have supplied is inadequate to enable a quotation to be given.  Please infil more of the boxes.");
	DonkeyForm.District.focus();
	return false; 
	}   
   
   */
   
   return true;
}


