// JavaScript Document
    // set the focus to the first input box
    function InitUserRegisterVariables()
    {
		var elemFocus = document.getElementById("InputFirstName");
        if(elemFocus)
        {
           //elemFocus.select();
           elemFocus.focus();
		   //setTimeout("elemFocus.focus()",0);
		   //setTimeout("elemFocus.select();",0);
        }
    }
    
    // check all form details are not bad data
    function CheckSubmit()
		{		
		  var bValid = true;
		  var strFirstName = document.getElementById("InputFirstName").value;
		  //alert (document.getElementById("InputSecondName").value);
		  var strSecondName = document.getElementById("InputSecondName").value;
		  var strContactEmail = document.getElementById("InputContactEmail").value;
		  var strConfirmEmail = document.getElementById("InputConfirmEmail").value;
		  var strTeamName = document.getElementById("InputTeamName").value;
		  var nChoice = document.getElementById("SelectCountries").value;
			
          if (ContentCheck(document.getElementById("InputFirstName"), "First Name")==false)
			bValid = false;
		  if (ContentCheck(document.getElementById("InputSecondName"), "Second Name")==false)
			bValid = false;
		  if (ContentCheck(document.getElementById("InputContactEmail"), "Email Address")==false)
			bValid = false;
		  if (ContentCheck(document.getElementById("InputConfirmEmail"), "Email Address")==false)
			bValid = false;						
		  if (ContentCheck(document.getElementById("InputTeamName"), "Team Name")==false)
			bValid = false;
					
		  // check the email address in client side
		  // (i) must have a "@", (ii) must have a "." and (iii) must not have any " "
		  if(strContactEmail.indexOf("@") == -1 || strContactEmail.indexOf(".") == -1 || strContactEmail.indexOf(" ") != -1)
			{
				alert("Please use a valid email address. \n\nYour username and password will be sent to it.");
				document.getElementById("InputContactEmail").select();
				document.getElementById("InputContactEmail").focus();
				return false;
			}
			
			// double check their email address...
		  if (strContactEmail!=strConfirmEmail)
			{
				alert("Oops, please check the email addresses, are they same?");
				document.getElementById("InputConfirmEmail").select();
				document.getElementById("InputConfirmEmail").focus();
				bValid=false;
			}
		  // all values are ok?	
		  if(!bValid)
			{
				return false; // No, not ok
			}
			else //Yes, all ok
			{
				document.getElementById("InputSubmit").value = "Submitting...";
				document.getElementById("InputSubmit").disabled = true;		
				return true;
			}
		}
		

