function redirect(URLStr) 
{ 
   location = URLStr; 
}

function setUserIDFromEmail()
{
  var userField  = document.getElementById("userIdField");
  var emailField = document.getElementById("emailField");
  userField.value = emailField.value;
}

	function validateInput()
	{
		 var userFormProfile = {
			// filters change the field value and are applied before validation.
			trim: ["userIdField", "nameField", "emailField"],
			//uppercase: [],
			lowercase: ["userIdField", "emailField"],
			//ucfirst: [],
			//digit: [],

			// required input fields that are blank will be reported missing.
			// required radio button groups and drop-down lists with no selection will be reported missing.
			// checkbox groups and selectboxes can be required to have more than one value selected.
			// List required fields by name and use this notation to require more than one value: {checkboxgroup: 2}, {selectboxname: 3}.
			required: ["userIdField", "nameField", "emailField", "phoneField", "passwordField"],
			
			// dependant/conditional fields are required if the target field is present and not blank.
			// At present only textbox, password, and textarea fields are supported.
			//dependancies:	{},
			
			// Fields can be validated using any boolean valued function.  
			// Use arrays to specify parameters in addition to the field value.
			constraints: {
				userIdField: [dojo.validate.isEmailAddress, false, true],
				emailField: [dojo.validate.isEmailAddress, false, true],
				phoneField: [dojo.validate.us.isPhoneNumber,false,true]
			},

			// Confirm is a sort of conditional validation.
			// It associates each field in its property list with another field whose value should be equal.
			// If the values are not equal, the field in the property list is reported as Invalid. Unless the target field is blank.
			confirm: {
				emailField: "userIdField"	
			}
		};
	
	   var results = dojo.validate.check($("procesRegistrationForm"),userFormProfile);
	   
	   if (!results.isSuccessful())
	   {
	      if (results.hasMissing())
	      {
	         alert("The following fields are missing required fields: " + results.getMissing().join(","));
	      }
	      else
	      if (results.hasInvalid())
	      {
	        alert("The following Fields contain invalid input: " + results.getInvalid().join(","));
	      }
	      
	      
	   }
 
        return results.isSuccessful();
	}