   
   	function ClearForm(){
    	document.requestform.reset();
	}
   
   //Firstname
    function checkFirstname(whatYouTyped) {
        var fieldset = whatYouTyped.parentNode;
        var txt = whatYouTyped.value;
        if (txt.length > 1 && txt.length < 25) {
            fieldset.className = "yes";
			document.getElementById("error_firstname").style.display = "none";
        }
        else {
            fieldset.className = "no";
			document.getElementById("error_firstname").style.display = "block";
        }
    }
	
	//Surname
    function checkSurname(whatYouTyped) {
        var fieldset = whatYouTyped.parentNode;
        var txt = whatYouTyped.value;
        if (txt.length > 1 && txt.length < 25) {
            fieldset.className = "yes";
			document.getElementById("error_surname").style.display = "none";
        }
        else {
            fieldset.className = "no";
			document.getElementById("error_surname").style.display = "block";
        }
    }
    
	//age
	function checkAge(whatYouTyped) {
        var fieldset = whatYouTyped.parentNode;
        var txt = whatYouTyped.value;
        if (txt == "Nothing selected") {
            fieldset.className = "no";
			document.getElementById("error_age").style.display = "block";
        } else{
			document.getElementById("error_age").style.display = "none";
            fieldset.className = "yes";
			
        }
    }
	
	//Gender
    function checkGender(whatYouTyped) {
        var fieldset = whatYouTyped.parentNode;
        var txt = whatYouTyped.value;
        if (txt == "Male") {
            fieldset.className = "yes";
			document.getElementById("error_gender").style.display = "none";
        }
		else if (txt == "Female") {
            fieldset.className = "yes";
			document.getElementById("error_gender").style.display = "none";
        }
        else {
            fieldset.className = "no";
			document.getElementById("error_gender").style.display = "block";
        }
    }
	
	//email 
    function checkEmail(whatYouTyped) {
        var fieldset = whatYouTyped.parentNode;
        var txt = whatYouTyped.value;
        if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(txt)) {
            fieldset.className = "yes";
			document.getElementById("error_email").style.display = "none";
        } else {
            fieldset.className = "no";
			document.getElementById("error_email").style.display = "block";
        }
    }
	
	//Phone
	function checkPhone(whatYouTyped) {
        var fieldset = whatYouTyped.parentNode;
        var txt = whatYouTyped.value;
        if (txt.length > 9 && txt.length < 14) {
            fieldset.className = "yes";
			document.getElementById("error_phone").style.display = "none";
        } else{
            fieldset.className = "no";
			document.getElementById("error_phone").style.display = "block";
        }
    }
	
	//Address line 01
    function checkAdd01(whatYouTyped) {
        var fieldset = whatYouTyped.parentNode;
        var txt = whatYouTyped.value;
        if (txt.length > 1 && txt.length < 50) {
            fieldset.className = "yes";
			document.getElementById("error_address").style.display = "none";
        }
        else {
            fieldset.className = "no";
			document.getElementById("error_address").style.display = "block";
        }
    }
	
	//Address line 01
    function checkTown(whatYouTyped) {
        var fieldset = whatYouTyped.parentNode;
        var txt = whatYouTyped.value;
        if (txt.length > 1 && txt.length < 50) {
            fieldset.className = "yes";
			document.getElementById("error_town").style.display = "none";
        }
        else {
            fieldset.className = "no";
			document.getElementById("error_town").style.display = "block";
        }
    }
	
	//County
    function checkCounty(whatYouTyped) {
        var fieldset = whatYouTyped.parentNode;
        var txt = whatYouTyped.value;
        if (txt == "Nothing selected") {
            fieldset.className = "no";
			document.getElementById("error_county").style.display = "block";
		} else {
            fieldset.className = "yes";
			document.getElementById("error_county").style.display = "none";
        }
    }
	
	//Postcode
	function checkPostcode(whatYouTyped) {
        var fieldset = whatYouTyped.parentNode;
        var txt = whatYouTyped.value;
        if (txt.length > 5 && txt.length < 9) {
            fieldset.className = "yes";
			document.getElementById("error_postcode").style.display = "none";
        } else{
            fieldset.className = "no";
			document.getElementById("error_postcode").style.display = "block";
        }
    }
	
	//How
    function checkHow(whatYouTyped) {
        var fieldset = whatYouTyped.parentNode;
        var txt = whatYouTyped.value;
        if (txt == "Nothing selected") {
            fieldset.className = "no";
			document.getElementById("error_how").style.display = "block";
			
		} else {
            fieldset.className = "yes";
			document.getElementById("error_how").style.display = "none";
        }
    }

    // this part is for the form field hints to display
    // only on the condition that the text input has focus.
    // otherwise, it stays hidden.
    
    function addLoadEvent(func) {
      var oldonload = window.onload;
      if (typeof window.onload != 'function') {
        window.onload = func;
      } else {
        window.onload = function() {
          oldonload();
          func();
        }
      }
    }
