  /* 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';
}
}

/* Banner */

window.onload = initBannerLink;

var adImages = new Array("images/banner1.jpg","images/banner1.jpg","images/banner1.jpg");
var adURL = new Array("teamsnowtrax.co.uk/Snowtrax%20Membership%20Form.pdf","teamsnowtrax.co.uk/Snowtrax%20Membership%20Form.pdf","teamsnowtrax.co.uk/Snowtrax%20Membership%20Form.pdf");
var thisAd = 0;

function rotate() {
	thisAd++;
	if (thisAd == adImages.length) {
		thisAd = 0;
	}
	document.getElementById("adBanner").src = adImages[thisAd];

	setTimeout("rotate()", 3 * 1000);
}

function newLocation() {
	document.location.href = "http://www." + adURL[thisAd];
	return false;
}

function initBannerLink() {
	if (document.getElementById("adBanner").parentNode.tagName == "A") {
		document.getElementById("adBanner").parentNode.onclick = newLocation;
	}
	
	rotate();
}

/* JAVASCRIPT ENDS HERE */