    	// 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";



	// Rollover function

	function changeImg(img, newImg) {

		if (document.images) {

			document[img].src = eval(newImg + ".src");

		}

	}





	function checkForm() {
	//em_val = /^\w+@\w+(\.\w+?)/
		if (document.action.firstname.value == "") {
			alert("Falta el nom.Gràcies");
			document.action.firstname.focus();
		} else if (document.action.lastname.value == "") {
			alert("Falta el cognom.Gràcies");
			document.action.lastname.focus();
		} else if (document.action.email.value == "") {
		    alert("Falta el correu electrònic.Gràcies.");
			document.action.email.focus();
		} else if (document.action.country.value == "") {
			alert("Falta el el pais.Gràcies");
			document.action.country.focus();
		} else if (document.action.email.value.indexOf('@',0)==-1 || document.action.email.value.indexOf('@',0)== 0 || document.action.email.value.indexOf('.',0)==-1) {
		        alert("Format incorrecte del mail.Gràcies.")
		    
		} else {
			document.action.submit();
				}
}



    function checkForm2() {

        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 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) {      



            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="Crikey!  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="Whoops!  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="Shit!  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="Uh-oh!  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="Oops!  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="Yikes!  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;

	}



    // closes the browser detection IF clause

    }







    // onSubmit open new popup script

    function openTarget (form, features, windowName) {

        if (!windowName)

            windowName = 'formTarget' + (new Date().getTime());
			 form.varOptin.value=varOptin;
            form.target = windowName;

            open ('', windowName, features);

    }










