    // Load images
    theman = new Image;
    theman.src = "registration/images/man.gif";
    theman_on = new Image;
    theman_on.src = "registration/images/man_on.gif";
    thewoman = new Image;
    thewoman.src = "registration/images/woman.gif";
    thewoman_on = new Image;
    thewoman_on.src = "registration/images/woman_on.gif";
    age1 = new Image;
    age1.src = "registration/images/age1.gif";
    age1_on = new Image;
    age1_on.src = "registration/images/age1_on.gif";
    age2 = new Image;
    age2.src = "registration/images/age2.gif";
    age2_on = new Image;
    age2_on.src = "registration/images/age2_on.gif";
    age3 = new Image;
    age3.src = "registration/images/age3.gif";
    age3_on = new Image;
    age3_on.src = "registration/images/age3_on.gif";
    age4 = new Image;
    age4.src = "registration/images/age4.gif";
    age4_on = new Image;
    age4_on.src = "registration/images/age4_on.gif";
    age5 = new Image;
    age5.src = "registration/images/age5.gif";
    age5_on = new Image;
    age5_on.src = "registration/images/age5_on.gif";

    subbyeng = new Image;
    subbyeng.src = "registration/images/finger_buttup.gif";
    subbyeng_on = new Image;
    subbyeng_on.src = "registration/images/finger_button.gif";

    subby = new Image;
    subby.src = "registration/images/submit.gif";
    subby_on = new Image;
    subby_on.src = "registration/images/submit_on.gif";
    enviar = new Image;
    enviar.src = "registration/images/enviar.gif";
    enviar_on = new Image;
    enviar_on.src = "registration/images/enviar_on.gif";

    function chgimg(imgfield,newImg,imgfield2,newImg2,imgfield3,newImg3,imgfield4,newImg4){
        if (document.images) {
            document[imgfield].src=newImg
            document[imgfield2].src=newImg2
            document[imgfield3].src=newImg3
            document[imgfield4].src=newImg4
        }
    }

        // Load images for actions
        shirtinfo = new Image;
        shirtinfo.src = "img/shirtinfo.gif";
        sweetcorninfo = new Image;
        sweetcorninfo.src = "img/sweetcorninfo.gif";
        coffeeinfo = new Image;
        coffeeinfo.src = "img/coffeeinfo.gif";
        keyboardinfo = new Image;
        keyboardinfo.src = "img/keyboardinfo.gif";
        flowersinfo = new Image;
        flowersinfo.src = "img/flowersinfo.gif";

	// Rollover function
	function changeImg(img, newImg) {
		if (document.images) {
			document[img].src = eval(newImg + ".src");
		}
	}

	// Check for name and email
	function checkForm() {

	//em_val = /^\w+@\w+(\.\w+?)/
		if (document.reg.name.value == "") {
			alert("please enter a name");
			document.reg.name.focus();

		} else if (document.reg.firstname.value == "") {
			alert("please enter your first name");
			document.reg.firstname.focus();

		} else if (document.reg.lastname.value == "") {
			alert("please enter your last name");
			document.reg.lastname.focus();

		} else if (document.reg.email.value == "") {
			alert("please enter an email address");
			document.reg.email.focus();

		} else if (document.reg.country.value == "") {
			alert("please select a country");
			document.reg.country.focus();

		} else if (document.reg.email.value != "") {
		   var check = emailCheck(document.reg.email.value);
			if(check){
            document.reg.submit();
			}
		}
    }

    function checkForm2() {
		if (document.reg.address1.value == "") {
			alert("please enter a house number");
			document.reg.address1.focus();

		} else if (document.reg.postcode.value == "") {
			alert("please enter a post code");
			document.reg.postcode.focus();

		} else if (document.reg.postcode.value != "") {
         var check = postcodeCheck(document.reg.postcode.value);
			if(check){
            document.reg.submit();
			}
		}
    }

    function checkActionForm() {

	//em_val = /^\w+@\w+(\.\w+?)/
		if (document.action.name.value == "") {
			alert("please enter a name");
			document.action.name.focus();
			return false;
		} else if (document.action.firstname.value == "") {
			alert("please enter your first name");
			document.action.firstname.focus();
			return false;
		} else if (document.action.lastname.value == "") {
			alert("please enter your last name");
			document.action.lastname.focus();
			return false;
		} else if (document.action.email.value == "") {
			alert("please enter an email address");
			document.action.email.focus();
			return false;
		} else if (document.action.country.value == "") {
			alert("please select a country");
			document.action.country.focus();
			return false;
		} else if (document.action.email.value != "") {
			return emailCheck(document.action.email.value);
		} else {
			document.action.submit();
			return true;
		}
    }

    function postcodeCheck(postcodeStr) {

       var err = 0;
       var ev = postcodeStr;
  	    var pcFilter

       if (ev.length == 0) return false;

       ev = ev.toUpperCase();
       //pcFilter=/^[A-Z]{1,2}[0-9]{1}([0-9]{1}|[A-Z]{0,1}) +[0-9]{1}[A-Z]{2}$/;
       pcFilter=/^[A-Z][0123456789] ?[0123456789][A-Z][A-Z]|[A-Z][0123456789][0123456789] ?[0123456789][A-Z][A-Z]|[A-Z][A-Z][0123456789] ?[0123456789][A-Z][A-Z]|[A-Z][A-Z][0123456789][0123456789] ?[0123456789][A-Z][A-Z]|[A-Z][0123456789][A-Z] ?[0123456789][A-Z][A-Z]|[A-Z][A-Z][0123456789][A-Z] ?[0123456789][A-Z][A-Z]|[A-Z][A-Z][A-Z] ?[0123456789][A-Z][A-Z]$/;
       
		 if (!(pcFilter.test(ev))) {
          err = 1;
       } else {
          //test post code for illegal characters
          var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/
          if (ev.match(illegalChars)) {err = 1;}
       }

       if (err==1) {
          alert(ev + ' is not a valid postal code. Please re-enter.');
       }

       return (err==0);
    }



    function emailCheck (emailStr) {

        var emailPat=/^(.+)@(.+)$/
        var specialChars="\\(\\)<>@,;:\\\\\\\"\\.\\[\\]"
        var validChars="\[^\\s" + specialChars + "\]"
        var quotedUser="(\"[^\"]*\")"
        var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/
        var atom=validChars + '+'
        var word="(" + atom + "|" + quotedUser + ")"

        // The following pattern describes the structure of the user
        var userPat=new RegExp("^" + word + "(\\." + word + ")*$")
        var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$")

        var matchArray=emailStr.match(emailPat)

        //browser detection...
        var browser=navigator.appName;
        if (browser.indexOf("Netscape") >= 0) { return true; }

        if (matchArray==null) {
            /* Too many/few @'s or something; basically, this address doesn't
		         even fit the general mould of a valid e-mail address. */
		      var errStr="The email address you typed has an error.\n\n"
		      errStr += "_______________________________________________\n\n";
		      errStr += "A valid email address has only one @ sign, at least one\n";
		      errStr += "dot (.), no spaces and the @ is followed by more text \n";
		      errStr += "_______________________________________________\n\n";
		      errStr += "Please check what you typed and correct the error.\n";
		      alert(errStr)
		      return false
        }
            
		  var user=matchArray[1]
        var domain=matchArray[2]

        // See if "user" is valid
        if (user.match(userPat)==null) {
		      // user is not valid
		      var errStr="The email address you typed has an error.\n\n"
		      errStr += "_______________________________________________\n\n";
		      errStr += "A valid email address must have some characters \n";
		      errStr += "before and after the @ sign.  \n";
		      errStr += "_______________________________________________\n\n";
		      errStr += "Please check what you typed and correct the error.\n";
		      alert(errStr)
		      return false
        }

        /* if the e-mail address is at an IP address (as opposed to a symbolic
	        host name) make sure the IP address is valid. */
        var IPArray=domain.match(ipDomainPat)
        if (IPArray!=null) {
		      // this is an IP address
		      for (var i=1;i<=4;i++) {
			       if (IPArray[i]>255) {
				       var errStr="The email address you typed has an error.\n\n"
				       errStr += "_______________________________________________\n\n";
				       errStr += "A valid email address with numbers after the @ sign\n";
				       errStr += "must be in the form [255.255.255.255] \n";
				       errStr += "_______________________________________________\n\n";
				       errStr += "Please check what you typed and correct the error.\n";
				       alert(errStr)
			          return false
			       }
		      }
		      return true
        }

        // Domain is symbolic name
        var domainArray=domain.match(domainPat)
        if (domainArray==null) {
		      var errStr="The email address you typed has an error.\n\n"
		      errStr += "_______________________________________________\n\n";
		      errStr += "A valid email address must have characters \n";
		      errStr += "after the @ sign. Most symbols are not valid, \n";
		      errStr += "including spaces in the middle, beginning or end. \n";
		      errStr += "_______________________________________________\n\n";
		      errStr += "Please check what you typed and correct the error.\n";
		      alert(errStr)
		      return false
        }

	     /* domain name seems valid, but now make sure that it ends in a
	        three-letter word (like com, edu, gov), a two-letter word, representing
	        country (uk, nl) or a new four letter domain (info) and that there's a
	        hostname preceding the domain or country. */

	     /* Now we need to break up the domain to get a count of how many atoms
	        it consists of. */
	     var atomPat=new RegExp(atom,"g")
	     var domArr=domain.match(atomPat)
	     var len=domArr.length
	     if (domArr[domArr.length-1].length<2 || domArr[domArr.length-1].length>4) {
	         // the address must end in a two letter or three letter word.
	         var errStr="The email address you typed has an error.\n\n"
	         errStr += "_______________________________________________\n\n";
	         errStr += "The address must end in a two, three or four letter domain,\n";
	         errStr += "or country code like: '.COM', '.INFO' or '.UK'\n";
	         errStr += "_______________________________________________\n\n";
	         errStr += "Please check what you typed and correct the error.\n";
	         alert(errStr)
	         return false
	     }

        // Make sure there's a host name preceding the domain.
	     if (len<2) {
	         var errStr="The email address you typed has an error.\n\n"
	         errStr += "_______________________________________________\n\n";
	         errStr += "A valid email address has at least three parts separated \n";
	         errStr += "by the @ symbol and dots like: yourname@yourhost.com \n";
	         errStr += "_______________________________________________\n\n";
	         errStr += "Please check what you typed and correct the error.\n";
	         alert(errStr)
	         return false
	     }

	     // If you've gotten this far, everything's valid!
	     return true;
	}

    // onSubmit open new popup script
    function openTarget (form, features, windowName) {
        if (!windowName)
            windowName = 'formTarget' + (new Date().getTime());
            form.target = windowName;
            open ('', windowName, features);
    }




