function checkemail(){
			var testresults;			
			var str=document.demo_account_form.email.value;
			var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
			if (filter.test(str))
				testresults=true
			else				
				testresults=false				
			return (testresults)			
			}	
			
			function trim(s) {
  			while (s.substring(0,1) == ' ') {
    			s = s.substring(1,s.length);
  			}
  			while (s.substring(s.length-1,s.length) == ' ') {
    			s = s.substring(0,s.length-1);
  			}
  			return s;
			}
			
			function isAlpha(s) {
			if(s == null)
			return false;
		
			if(s.length == 0)
			return false;
		
			for(var i=0; i<s.length; ++i)
			{
				if("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890".indexOf(s.charAt(i)) < 0)
				{
					return false;
				}
			}
			return true;
			}


		function ValidateForm(){
			
			//make sure the client has picked a demo account type
			if (document.demo_account_form.fx_sub_company.value == undefined)
			{
				if ((document.demo_account_form.fx_sub_company[0].checked == false) && (document.demo_account_form.fx_sub_company[1].checked == false))
			  {
			  	//Trading profile needs to be selected
			  	alert ("Please select your demo type");
			  	document.demo_account_form.fx_sub_company[0].focus();
			  	//and return false so the form doesn't get submitteds				
          return false;
         }							
       }       

			//make sure that the first name is not blank.
			if (document.demo_account_form.first_name.value.length == 0)  {
				//it isn't so show the user an alert and go to that field
				alert ("Please enter your first name");
				document.demo_account_form.first_name.focus();
				//and return false so the form doesn't get submitted
				return false;
			}
				
			//make sure that the last name field is not blank.
			if (document.demo_account_form.last_name.value.length == 0)  {
				//it isn't so show the user an alert and go to that field
				alert ("Please enter your last name");
				document.demo_account_form.last_name.focus();
				//and return false so the form doesn't get submitted
				return false;
			}			

			//make sure that the country field is not blank.
			if (document.demo_account_form.country.value.length == 0)  {
				//it isn't so show the user an alert and go to that field
				alert ("Please enter your country");
				document.demo_account_form.country.focus();
				//and return false so the form doesn't get submitted
				return false;
			}
			
			//make sure that the phone field is not blank.
			if (document.demo_account_form.phone.value.length < 6)  {
				//it isn't so show the user an alert and go to that field
				alert ("Please enter a valid phone number");
				document.demo_account_form.phone.focus();
				//and return false so the form doesn't get submitted
				return false;
			}
			
			//make sure the email address is formatted properly
      if (checkemail()==false)
      {
      	alert ("Please check your email address, it is not valid");
      	document.demo_account_form.email.focus();
      	//and return false so the form doesn't get submitted
        return false;
     }
     	
			var pwtest = trim(document.demo_account_form.password.value);
						
			if (pwtest.length < 4)  {
				//it isn't so show the user an alert and go to that field
				alert ("Please enter a password with at least 4 characters");
				document.demo_account_form.password.focus();
				//and return false so the form doesn't get submitted                                
				return false;
			}
			
			//make sure the password is alpha chars only
      if (isAlpha(pwtest)==false)
      {
       	alert ("Please use only alpha numeric characters [A-z, 0-9]");
       	document.demo_account_form.password.focus();
      	//and return false so the form doesn't get submitted
        return false;
      }			
			
			//everything checks out, submit the form			
      
      document.demo_account_form.resolution.value = window.screen.width + 'x' + window.screen.height;
              				
			return true;
		}
		
		function ValidateFormDE(){
			
			//make sure the client has picked a demo account type
			if (document.demo_account_form.fx_sub_company.value == undefined)
			{
				if ((document.demo_account_form.fx_sub_company[0].checked == false) && (document.demo_account_form.fx_sub_company[1].checked == false))
			  {
			  	//Trading profile needs to be selected
			  	alert ("Wählen Sie bitte Ihr Demo Kontoart aus");
			  	document.demo_account_form.fx_sub_company[0].focus();
			  	//and return false so the form doesn't get submitteds				
          return false;
         }							
       }       

			//make sure that the first name is not blank.
			if (document.demo_account_form.first_name.value.length == 0)  {
				//it isn't so show the user an alert and go to that field
				alert ("Geben Sie bitte Ihren Vornamen ein");
				document.demo_account_form.first_name.focus();
				//and return false so the form doesn't get submitted
				return false;
			}
				
			//make sure that the last name field is not blank.
			if (document.demo_account_form.last_name.value.length == 0)  {
				//it isn't so show the user an alert and go to that field
				alert ("Geben Sie bitte Ihren Familiennamen ein");
				document.demo_account_form.last_name.focus();
				//and return false so the form doesn't get submitted
				return false;
			}			

			//make sure that the country field is not blank.
			if (document.demo_account_form.country.value.length == 0)  {
				//it isn't so show the user an alert and go to that field
				alert ("Wählen Sie bitte Ihr Land aus");
				document.demo_account_form.country.focus();
				//and return false so the form doesn't get submitted
				return false;
			}
			
			//make sure that the phone field is not blank.
			if (document.demo_account_form.phone.value.length < 6)  {
				//it isn't so show the user an alert and go to that field
				alert ("Geben Sie bitte eine gültige Telefonnummer ein");
				document.demo_account_form.phone.focus();
				//and return false so the form doesn't get submitted
				return false;
			}
			
			//make sure the email address is formatted properly
      if (checkemail()==false)
      {
      	alert ("Überprüfen Sie Ihre Email Adresse");
      	document.demo_account_form.email.focus();
      	//and return false so the form doesn't get submitted
        return false;
     }
     	
			var pwtest = trim(document.demo_account_form.password.value);
						
			if (pwtest.length < 4)  {
				//it isn't so show the user an alert and go to that field
				alert ("Geben Sie Ihr Passwort ein , bestehend aus mindestesn 4 Zeichen");
				document.demo_account_form.password.focus();
				//and return false so the form doesn't get submitted                                
				return false;
			}
			
			//make sure the password is alpha chars only
      if (isAlpha(pwtest)==false)
      {
       	alert ("Verwende Sie nur Buchstaben und Zahlen [A-z, 0-9]");
       	document.demo_account_form.password.focus();
      	//and return false so the form doesn't get submitted
        return false;
      }			
			
			//everything checks out, submit the form			
      
      document.demo_account_form.resolution.value = window.screen.width + 'x' + window.screen.height;
              				
			return true;
		}
		
		function ValidateFormRU(){
			
			//make sure the client has picked a demo account type
			if (document.demo_account_form.fx_sub_company.value == undefined)
			{
				if ((document.demo_account_form.fx_sub_company[0].checked == false) && (document.demo_account_form.fx_sub_company[1].checked == false))
			  {
			  	//Trading profile needs to be selected
			  	alert ("Ïîæàëóéñòà, âûáåðèòå òèï Âàøåãî äåìî ñ÷åòà");
			  	document.demo_account_form.fx_sub_company[0].focus();
			  	//and return false so the form doesn't get submitteds				
          return false;
         }							
       }       

			//make sure that the first name is not blank.
			if (document.demo_account_form.first_name.value.length == 0)  {
				//it isn't so show the user an alert and go to that field
				alert ("Ïîæàëóéñòà, ââåäèòå Âàøå èìÿ");
				document.demo_account_form.first_name.focus();
				//and return false so the form doesn't get submitted
				return false;
			}
				
			//make sure that the last name field is not blank.
			if (document.demo_account_form.last_name.value.length == 0)  {
				//it isn't so show the user an alert and go to that field
				alert ("Ïîæàëóéñòà, ââåäèòå Âàøó ôàìèëèþ");
				document.demo_account_form.last_name.focus();
				//and return false so the form doesn't get submitted
				return false;
			}			

			//make sure that the country field is not blank.
			if (document.demo_account_form.country.value.length == 0)  {
				//it isn't so show the user an alert and go to that field
				alert ("Ïîæàëóéñòà, óêàæèòå Âàøó ñòðàíó");
				document.demo_account_form.country.focus();
				//and return false so the form doesn't get submitted
				return false;
			}
			
			//make sure that the phone field is not blank.
			if (document.demo_account_form.phone.value.length < 6)  {
				//it isn't so show the user an alert and go to that field
				alert ("Ïîæàëóéñòà, ââåäèòå Âàø êîíòàêòíûé íîìåð");
				document.demo_account_form.phone.focus();
				//and return false so the form doesn't get submitted
				return false;
			}
			
			//make sure the email address is formatted properly
      if (checkemail()==false)
      {
      	alert ("Ïîæàëóéñòà, èñïðàâüòå Âàø àäðåñ ýëåêòðîííîé ïî÷òû, ââåäåííûé Âàìè àäðåñ íå âåðåí");
      	document.demo_account_form.email.focus();
      	//and return false so the form doesn't get submitted
        return false;
     }
     	
			var pwtest = trim(document.demo_account_form.password.value);
						
			if (pwtest.length < 4)  {
				//it isn't so show the user an alert and go to that field
				alert ("Ïîæàëóéñòà, ââåäèòå ïàðîëü ìèíèìóì èç 4åõ ñèìâîëîâ");
				document.demo_account_form.password.focus();
				//and return false so the form doesn't get submitted                                
				return false;
			}
			
			//make sure the password is alpha chars only
      if (isAlpha(pwtest)==false)
      {
       	alert ("Ïîæàëóéñòà, èñïîëüçóéòå òîëüêî ëàòèíñêèå áóêâû (A-z) è öèôðû (0-9)");
       	document.demo_account_form.password.focus();
      	//and return false so the form doesn't get submitted
        return false;
      }			
			
			//everything checks out, submit the form			
      
      document.demo_account_form.resolution.value = window.screen.width + 'x' + window.screen.height;
              				
			return true;
		}
		
		function ValidateFormFR(){
			
			//make sure the client has picked a demo account type
			if (document.demo_account_form.fx_sub_company.value == undefined)
			{
				if ((document.demo_account_form.fx_sub_company[0].checked == false) && (document.demo_account_form.fx_sub_company[1].checked == false))
			  {
			  	//Trading profile needs to be selected
			  	alert ("Veuillez sélectionner votre type de démo");
			  	document.demo_account_form.fx_sub_company[0].focus();
			  	//and return false so the form doesn't get submitteds				
          return false;
         }							
       }       

			//make sure that the first name is not blank.
			if (document.demo_account_form.first_name.value.length == 0)  {
				//it isn't so show the user an alert and go to that field
				alert ("Veuillez entrer votre prénom");
				document.demo_account_form.first_name.focus();
				//and return false so the form doesn't get submitted
				return false;
			}
				
			//make sure that the last name field is not blank.
			if (document.demo_account_form.last_name.value.length == 0)  {
				//it isn't so show the user an alert and go to that field
				alert ("Veuillez entrer votre nom de famille");
				document.demo_account_form.last_name.focus();
				//and return false so the form doesn't get submitted
				return false;
			}			

			//make sure that the country field is not blank.
			if (document.demo_account_form.country.value.length == 0)  {
				//it isn't so show the user an alert and go to that field
				alert ("Veuillez entrer votre pays");
				document.demo_account_form.country.focus();
				//and return false so the form doesn't get submitted
				return false;
			}
			
			//make sure that the phone field is not blank.
			if (document.demo_account_form.phone.value.length < 6)  {
				//it isn't so show the user an alert and go to that field
				alert ("Veuillez entrer un numéro de téléphone valide");
				document.demo_account_form.phone.focus();
				//and return false so the form doesn't get submitted
				return false;
			}
			
			//make sure the email address is formatted properly
      if (checkemail()==false)
      {
      	alert ("Votre adresse email est invalide, veuillez revoir votre saisie");
      	document.demo_account_form.email.focus();
      	//and return false so the form doesn't get submitted
        return false;
     }
     	
			var pwtest = trim(document.demo_account_form.password.value);
						
			if (pwtest.length < 4)  {
				//it isn't so show the user an alert and go to that field
				alert ("Veuillez entrer un mot de passe d'au moins 4 caractères");
				document.demo_account_form.password.focus();
				//and return false so the form doesn't get submitted                                
				return false;
			}
			
			//make sure the password is alpha chars only
      if (isAlpha(pwtest)==false)
      {
       	alert ("Veuillez utiliser uniquement des caractères alpha numérique [A-z, 0-9]");
       	document.demo_account_form.password.focus();
      	//and return false so the form doesn't get submitted
        return false;
      }			
			
			//everything checks out, submit the form			
      
      document.demo_account_form.resolution.value = window.screen.width + 'x' + window.screen.height;
              				
			return true;
		}
		
		function ValidateFormNL(){
			
			//make sure the client has picked a demo account type
			if (document.demo_account_form.fx_sub_company.value == undefined)
			{
				if ((document.demo_account_form.fx_sub_company[0].checked == false) && (document.demo_account_form.fx_sub_company[1].checked == false))
			  {
			  	//Trading profile needs to be selected
			  	alert ("Selecteer aub een demotype");
			  	document.demo_account_form.fx_sub_company[0].focus();
			  	//and return false so the form doesn't get submitteds				
          return false;
         }							
       }       

			//make sure that the first name is not blank.
			if (document.demo_account_form.first_name.value.length == 0)  {
				//it isn't so show the user an alert and go to that field
				alert ("Voer aub uw voornaam in");
				document.demo_account_form.first_name.focus();
				//and return false so the form doesn't get submitted
				return false;
			}
				
			//make sure that the last name field is not blank.
			if (document.demo_account_form.last_name.value.length == 0)  {
				//it isn't so show the user an alert and go to that field
				alert ("Voer aub uw achternaam in");
				document.demo_account_form.last_name.focus();
				//and return false so the form doesn't get submitted
				return false;
			}			

			//make sure that the country field is not blank.
			if (document.demo_account_form.country.value.length == 0)  {
				//it isn't so show the user an alert and go to that field
				alert ("Kies aub uw land");
				document.demo_account_form.country.focus();
				//and return false so the form doesn't get submitted
				return false;
			}
			
			//make sure that the phone field is not blank.
			if (document.demo_account_form.phone.value.length < 6)  {
				//it isn't so show the user an alert and go to that field
				alert ("Voer aub een geldig telefoonnummer in");
				document.demo_account_form.phone.focus();
				//and return false so the form doesn't get submitted
				return false;
			}
			
			//make sure the email address is formatted properly
      if (checkemail()==false)
      {
      	alert ("Controleer aub uw emailadres, het ingevoerde adres is ongeldig");
      	document.demo_account_form.email.focus();
      	//and return false so the form doesn't get submitted
        return false;
     }
     	
			var pwtest = trim(document.demo_account_form.password.value);
						
			if (pwtest.length < 4)  {
				//it isn't so show the user an alert and go to that field
				alert ("Voer aub een wachtwoord van minimaal 4 tekens in");
				document.demo_account_form.password.focus();
				//and return false so the form doesn't get submitted                                
				return false;
			}
			
			//make sure the password is alpha chars only
      if (isAlpha(pwtest)==false)
      {
       	alert ("Gebruik aub alleen alfanumerieke tekens [A-z, 0-9]");
       	document.demo_account_form.password.focus();
      	//and return false so the form doesn't get submitted
        return false;
      }			
			
			//everything checks out, submit the form			
      
      document.demo_account_form.resolution.value = window.screen.width + 'x' + window.screen.height;
              				
			return true;
		}