  /* crossarrow - www.crossarrow.co.uk */
	
	
/* JAVASCRIPT STARTS HERE */


//Validation for Contact Us form

			function validateFirstName(myForm) 
			{
//Test to check Family Name is just letters.  Uses regular 
//expression below to test pattern and puts up alert box if incorrect.
			reFirstName = /^(\D+)$/
			if (reFirstName.test(myForm))
				return true;
						 else
        return false;
			}
						
			function validateSurname(myForm) 
			{
//Test to check Surname is just letters.  Uses regular 
//expression below to test pattern and puts up alert box if incorrect.
			reSurname = /^(\D+)$/
			if (reSurname.test(myForm))
				return true;
						 else
        return false;
			}
			
			
			function validateEmail(myForm) 
			{
//Test to check Email address input is correct.  Uses regular 
//expression below to test pattern and puts up alert box if incorrect.
			reEmail = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/
			if (reEmail.test(myForm))
				return true;
						 else
        return false;
				}

			
// ALERT BOX FORM VALIDATIONS: The function is called from the form, which 
//then calls the appropriate validation functions. If false an alert appears.
// First is the family Name followed by Phone Number then Email address.

			function validateForm(myForm) 
			{
			if (validateFirstName(myForm.FirstName.value) == false) 
			{
				 alert("Please enter your first name.");
				 							 myForm.FirstName.focus();
				 							 myForm.FirstName.select();
			return false;
		}
		
			 
			if (validateSurname(myForm.Surname.value) == false) 
			{
				 alert("Please enter your surname.");
				 							 myForm.Surname.focus();
				 							 myForm.Surname.select();
			return false;
		}
			
											
			if (validateEmail(myForm.Email.value) == false) 
			{
				 alert("Sorry your email address does not seem right!  please try again.");
				 							myForm.Email.focus();
				 							myForm.Email.select();
			return false;
		}
		   
			return true;
}
			
/*JavaScript Menu starts here*/

//Menu is hidden if the browser is DOM Capable.  If it is not the menu opens for manual use.
(document.getElementById ? DOMCapable=true:DOMCapable=false);
function hide(menuName)
{
if (DOMCapable)
{
var theMenu=document.getElementById(menuName+"choices");
theMenu.style.visibility='hidden';
}
}
function show(menuName)
{
if (DOMCapable)
{
var theMenu=document.getElementById(menuName+"choices");
theMenu.style.visibility='visible';
}
}

/* Javascript for the slideshow. */

//This creates an array of the images.
	 var myPix = new Array("imagesphotogallery/picture1.jpg","imagesphotogallery/picture2.jpg","imagesphotogallery/picture3.jpg","imagesphotogallery/picture4.jpg","imagesphotogallery/picture5.jpg","imagesphotogallery/picture7.jpg","imagesphotogallery/picture8.jpg","imagesphotogallery/picture9.jpg","imagesphotogallery/picture10.jpg","imagesphotogallery/picture11.jpg","imagesphotogallery/picture12.jpg","imagesphotogallery/picture13.jpg","imagesphotogallery/picture14.jpg");
//This sets the beginning value in the code. 
	 var thisPic = 0;
//This is the number of elements in the array, making it easy to add more pictures later. The -1 is set to one less than the true value is the Javascript begins at 0
	 var imgCt = myPix.length - 1;
//This creates an array of the texts to go with the images.
   var captionText = new Array("A perfect flying side kick as a 1st Dan.  Wish I could do that now!!","Gordon Slater as a yellow belt-1983.","Jumping knuckle push-ups.","Gordon Slater with Grand Master Hee il Cho, 9th Dan.","Gordon Slater with Grand Master Rhee Ki Ha, 9th Dan and his good friend Mr Bonthuys, 4th Dan 2001.","Slater Junior.","A social occasion - The Christmas Party 2005.","Chief Instructor Mr. Slater & his son Ben Slater.","Mr Slater did get into the UFC ring!!!","Mr Slater (far right) as a young 1st Dan","Mr Slater presenting one of his students Mr. Richardson his 2nd Dan certificate","Mr. Slater presenting one of his students Mr. Mann with his 3rd Dan certificate, Mr. Mann started at Essex Taekwondo Academy as a 12 year old!","Mr Slater presenting one of his very first students Mr. Baldwin with his 4th Dan certificate")
// This operates the number of elements in the words array making it easier to add new slides or words later.
	 var imgCt = captionText.length;
	
	
//The function to create the slideshow with parameter to declare the direction.
	function newSlide(direction)  
	 {
//Check browser understands images
		if (document.images) 
		{
//thisPic, which starts at 0 is set to it's own value plus the direction parameter.
			thisPic = thisPic + direction;
//If the pic is less than 0.
			 if (thisPic < 0)
			 {
//Sets the value of this pic to the imgCt -1.
				thisPic = imgCt-1;
			 }
//If it was less than 0 then set imgCt.
				if (thisPic == imgCt)
			  {
// setting picture to 0
				 thisPic = 0;
			 }
//Starts the pictures by stating the document and the HTM name
			document.slideshow.src =myPix[thisPic];
// Starts the words to go with the slides.
			document.imgForm.imgText.value = captionText[thisPic];
		}
	}
	 
/* This script is based on scripts in the book JavaScript for the World Wide Web: 
Negrino & Smith.  The script is a combination of script 5.6 Building Wraparound Slideshows
and 16.6 A slideshow with captions. */

/* JAVASCRIPT ENDS HERE */
