var http_request = false;
   var resultbox = '';
   var messageflag;
   var messagetext = '';
      
	  
function ValidateForm(form)
{
   if(form.forename.value=="") 
   { 
      alert('Please enter your name'); 
      form.forename.focus(); 
      return false; 
   } 
   
   if(form.surname.value=="") 
   { 
      alert('Please enter your surname'); 
      form.surname.focus(); 
      return false; 
   } 
 	
	if(form.Address.value=="") 
   { 
      alert('Please enter your (Home) address');
      form.Address.focus(); 
      return false; 
   }
   
   if(form.Town.value=="") 
   { 
      alert('Please enter your town or city'); 
      form.Town.focus(); 
      return false; 
   }
   
    if(form.postcode.value=="") 
   { 
      alert('Please enter your postcode'); 
      form.postcode.focus(); 
      return false; 
   }
   
   if(form.telephone.value=="") 
   { 
      alert('Please enter a telephone number so that we may call you to confirm your booking');
      form.telephone.focus(); 
      return false; 
   }
   
   
  
   if(form.email2.value=="") 
   { 
      alert('Please enter your email');
      form.email2.focus(); 
      return false; 
      } 
	  
	   if(form.week.value=="please choose...") 
   { 
      alert('Please select your dates');
      form.week.focus(); 
      return false; 
      }
	
	//if (form.TandC.checked == false) 
  // { 
    //  alert('Please tick to accept the terms and conditions') 
     // form.TandC.focus(); 
    //  return false; 
    //  } 
	  
 
return true;
} 

function showadult() {
var adult;
adult="<div align='left'><strong><img src='graphics/level0.gif' width='70' height='25' /></strong>You have never skied before.<br /><br /></div>";
        
adult = adult + "<div align='left'><strong><img src='graphics/level1.gif' width='70' height='25' align='left' /></strong> You have had a few lessons on a dry slope or are a nervous 1 week skier and feel more comfortable in your snowplough going in one direction than the other.<br /><br /></div>";
        
adult = adult + "<div align='left'><strong><img src='graphics/level2.gif' width='70' height='26' /></strong>You can link turns on green and easy blue runs, sometimes they are snowploughs and other times closer to parallel. You are a normally confident 1 week skier or a nervous 2 week skier.<br /><br /></div>";
        
adult = adult + "<div align='left'><strong><img src='graphics/level3.gif' width='70' height='26' /></strong>You can manage parallels on green and easy blue runs but need to learn the art of staying parallel when it gets a bit steeper or faster.<br /><br /></div>";
        
adult = adult + "<div align='left'><strong><img src='graphics/level4.gif' width='70' height='26' /></strong>You ski confidently on blue and red runs with your skis parallel and your goal is to become more effective, vary the type of turns you do and be introduced to bumps and powder.<br /><br /></div>";
        
adult = adult + "<div align='left'><strong><img src='graphics/level5.gif' width='70' height='26' /></strong>You are able to ski anywhere but wish to improve your technique to feel more comfortable with speed, bumps, off-piste and hone your general advanced level skills.</div>";
document.getElementById('levels').innerHTML=adult;
}

function showkids() {
var kids;
kids="<div align='left'><strong><img src='graphics/freshers.gif' width='70' height='25' /></strong>Children who have never skied before or have skied less than 4 hours on a dry slope.<br /><br /></div>";
        
kids = kids + "<div align='left'><strong><img src='graphics/swifts.gif' width='70' height='25' align='left' /></strong>Children who can link snowplough turns on green runs and are able to ride the button lifts without falling off.<br /><br /></div>";
        
kids = kids + "<div align='left'><strong><img src='graphics/cruisers.gif' width='70' height='26' /></strong>Children who can confidently ski blue runs with the skis parallel although maybe still wide apart.<br /><br /></div>";
        
kids = kids + "<div align='left'><strong><img src='graphics/rockers.gif' width='70' height='26' /></strong>Children who can ski parallel confidently on red runs.<br /><br /></div>";
        
kids = kids + "<div align='left'><strong><img src='graphics/topcats.gif' width='70' height='26' /></strong>For those children who are ready to sample a bit of excitement - steeps, bumps, off piste, speed.<br /><br /></div>";

document.getElementById('levels').innerHTML=kids;
}

function showsurf() {
var surf;
surf="";
surf="<div align='left'><strong><img src='graphics/level0.gif' width='70' height='25' /></strong>Just kicking off - no experience.<br /><br /></div>";
        
surf = surf + "<div align='left'><strong><img src='graphics/level1.gif' width='70' height='25' align='left' /></strong> You can get up, turn well in one direction but are weak on the other side.<br /><br /></div>";
        
surf = surf + "<div align='left'><strong><img src='graphics/level2.gif' width='70' height='26' /></strong>You wish to move up a gear being able to turn well in both directions on green and easy sections of blue runs.<br /><br /></div>";
        
surf = surf + "<div align='left'><strong><img src='graphics/level3.gif' width='70' height='26' /></strong>You are turning well on difficult blue runs but struggle a bit on red runs. You want to link your turns more smoothly on red runs and learn to carve on easier runs.<br /><br /></div>";
        
surf = surf + "<div align='left'><strong><img src='graphics/level4.gif' width='70' height='26' /></strong>You can link your turns well on red runs and can get down black runs (albeit shakily!). You want to improve your carving and off-piste skills and learn to switch.<br /><br /></div>";

document.getElementById('levels').innerHTML=surf;
}


function makeRequest(url, parameters, whereto, message) {
      http_request = false;
	  resultbox = whereto; // the html id we want to put new content into
	  if (message != '') {
		  messageflag = true;
		  messagetext = message;
	  }

      if (window.XMLHttpRequest) { // Mozilla, Safari,...
         http_request = new XMLHttpRequest();
         if (http_request.overrideMimeType) {
         	// set type accordingly to anticipated content type
            //http_request.overrideMimeType('text/xml');
            http_request.overrideMimeType('text/html');
         }
      } else if (window.ActiveXObject) { // IE
         try {
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
         } catch (e) {
            try {
               http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
         }
      }
      if (!http_request) {
         alert('Cannot create XMLHTTP instance');
         return false;
      }

	http_request.onreadystatechange = alertContents;

      http_request.open('GET', url + parameters, true);
      http_request.send(null);
   }

   function alertContents() {
      if (http_request.readyState == 4) {
         if (http_request.status == 200) {
            //alert(http_request.responseText); //comment this line out
            result = http_request.responseText;
			
			if (resultbox != '') {
            	document.getElementById(resultbox).innerHTML = result;
			}
			
			if (messageflag==true) {
				document.getElementById('eventsmessage').innerHTML = messagetext;
				setTimeout("clearSaveMessage('eventsmessage')",15000);
			}
			
         } else {
            alert('There was a problem with the request.');
         }
      }
   }


function findemail() {

	 var poststr = encodeURI( "?email=" + document.getElementById("email").value );
	  makeRequest('ajax_FindByEmail.asp', poststr, 'addressform' );
}