function verifydata()
{
        if ((isEmpty(document.registration.CompanyName.value)) || (isEmpty(document.registration.Address.value)) || (isEmpty(document.registration.City.value)) || (isEmpty(document.registration.State.value)) || (isEmpty(document.registration.PostalCode.value)) || (isEmpty(document.registration.Country.value)) || (isEmpty(document.registration.URL.value)) || (isEmpty(document.registration.Email.value)) || (isEmpty(document.registration.Phone.value)))
        {
           alert("Error! \n\nAll fields are required. Please complete all fields.");
           return false;
        }
	
	    invalidCharsList = " /:,;~#!";
	    if (document.registration.Email.value.indexOf('@',0)== -1 ||
	        document.registration.Email.value.indexOf('@',0)== 0 ||
	        document.registration.Email.value.indexOf('.',0)== -1) {
	        alert("Error! \n\nThe email address you entered appears to be invalid! \n\nPlease re-enter your email address and try again.");   
	        document.registration.Email.select();
	        document.registration.Email.focus();
	        return false;
	   }
	    for (i = 0; i < invalidCharsList.length; i++) {
	        errorChar = invalidCharsList.charAt(i);
	        if (document.registration.Email.value.indexOf(errorChar,0) != -1) {
	            alert("Error! \n\nThe email address you entered appears to be invalid! \n\nPlease re-enter your email address and try again.");
		        document.registration.Email.select();
	            document.registration.Email.focus();
	            return false;
	        }
	    }
		if (document.registration.UserName.value.indexOf('@',0)== -1 ||
	        document.registration.UserName.value.indexOf('@',0)== 0 ||
	        document.registration.UserName.value.indexOf('.',0)== -1) {
	        alert("Error! \n\nThe login email address you entered appears to be invalid! \n\nPlease re-enter your login email address and try again.");   
	        document.registration.UserName.select();
	        document.registration.UserName.focus();
	        return false;
	   }
	    for (i = 0; i < invalidCharsList.length; i++) {
	        errorChar = invalidCharsList.charAt(i);
	        if (document.registration.UserName.value.indexOf(errorChar,0) != -1) {
	            alert("Error! \n\nThe login email address you entered appears to be invalid! \n\nPlease re-enter your login email address and try again.");
		        document.registration.UserName.select();
	            document.registration.UserName.focus();
	            return false;
	        }
	    }

        if (document.registration.Password.value.length < 5) {
			alert("Error! \n\nPassword must be at least 5 characters long.");
			document.registration.Password.select()
	        document.registration.Password.focus()
			return false;
		}
		if (document.registration.Password.value != document.registration.ConfirmPassword.value) {
			alert("Error! \n\n Password fields do not match. Please re-enter your passwords and try again.");
			document.registration.Password.select()
	        document.registration.Password.focus()
			return false;
		}
		
}

function isEmpty(data)
{
	   for (var i=0; i<data.length; i++){
	      if(data.substring(i, i+1) != " ")
	         return(false);
	   }
	   return(true);
}
