function formCheck() { //v3.0
	var errors="";//clear error var
	if (document.register.firstname.value == "") {
		errors+='- first name is required.\n';
	}

	if (document.register.lastname.value == "") {
		errors+='- last name is required.\n';
	}

	if (document.register.company.value == "") {
	errors+='- company name is required.\n';
	}

	if (document.register.address.value == "") {
	errors+='- address is required.\n';
	}

	if (document.register.city.value == "") {
	errors+='- city is required.\n';
	}

	if (document.register.stateprovince.options[document.register.stateprovince.selectedIndex].value == "blank"){
	errors+='- state/province required.\n';
	}

	if (document.register.phone.value == "") {
	errors+='- phone # is required.\n';	
	}

	if (document.register.zip.value == "") {
	errors+='- zip/postal code is required.\n';
	}else{
	var illegalChars = /[\W_]/; // allow only letters and numbers
	zip=document.register.zip.value;
	zip= zip.replace(" ","");

	if (illegalChars.test(zip)) {
	errors+='- postal/zip code contains illegal characters.\n';
	}
	
	}

	//check if e-mail contains @ character
	if (document.register.email.value.indexOf("@") == -1 || document.register.email.value == "") {
		errors+='- please include a proper e-mail address.\n';
	}

	if(document.register.username.value==""){
		errors+='- username is required.\n';
	}else{
	var illegalChars = /\W/;
	// allow only letters, numbers, and underscores
	if (illegalChars.test(document.register.username.value)) {
		errors+='- username contains illegal characters.\n';
	}

	if (document.register.username.value.length < 6 ) {	
		errors+='- username must contain at least 6 characters.\n';
	} 

	}


	if (document.register.password1.value == "" || document.register.password2.value == "") {
	errors+='- password fields are required.\n';
	}else{
	//see if the password fields match
		if (document.register.password1.value != document.register.password2.value){
		errors+='- password fields must match.\n';
		}

	if (document.register.password1.value.length < 6 ) {
		errors+='- password must contain at least 6 characters.\n';
	} 

	}

	if (document.register.existing1.checked == false && document.register.existing2.checked == false ) {
		errors+='- existing customer information is required.\n';

	}

	if (document.register.existing1.checked == true && document.register.existing2.checked == true ) {
		errors+='- only one value should be checked for existing customer information .\n';
	}

	if (errors) {
		alert('The following error(s) occurred:\n'+errors)
		return false;
	}

}