function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("Invalid Email Address")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid Email Address")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
			alert("Invalid Email Address")
			return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
			alert("Invalid Email Address")
			return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
			alert("Invalid Email Address")
			return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
			alert("Invalid Email Address")
			return false
		 }
		
		 if (str.indexOf(" ")!=-1){
			alert("Invalid Email Address")
			return false
		 }

		 return true
	}

function checkCWform(){
	validForm = 1
	if(validForm==1){
		if(document.form.firstname){
			if(document.form.firstname.value==''){
				alert('Please enter a value into the first name field')
				document.form.firstname.focus();
				validForm = 0
			}
		}
	}
	if(validForm==1){
		if(document.form.lastname){
			if(document.form.lastname.value==''){
				alert('Please enter a value into the last name field')
				document.form.lastname.focus();
				validForm = 0
			}
		}
	}
	if(validForm==1){
		if(document.form.company){
			if(document.form.email.value==''){
				alert('Please enter a value into the email field')
				document.form.email.focus();
				validForm = 0
			}
		}
	}
	if(validForm==1){
		if(document.form.addressB){
			if(document.form.email.value==''){
				alert('Please enter a value into the email field')
				document.form.email.focus();
				validForm = 0
			}
		}
	}
	if(validForm==1){
		if(document.form.cityB){
			if(document.form.email.value==''){
				alert('Please enter a value into the email field')
				document.form.email.focus();
				validForm = 0
			}
		}
	}
	if(validForm==1){
		if(document.form.stateB){
			if(document.form.email.value==''){
				alert('Please enter a value into the email field')
				document.form.email.focus();
				validForm = 0
			}
		}
	}
	if(validForm==1){
		if(document.form.zipB){
			if(document.form.email.value==''){
				alert('Please enter a value into the email field')
				document.form.email.focus();
				validForm = 0
			}
		}
	}
	if(validForm==1){
		if(document.form.faxB){
			if(document.form.email.value==''){
				alert('Please enter a value into the email field')
				document.form.email.focus();
				validForm = 0
			}
		}
	}
	if(validForm==1){
		if(document.form.email){
			if(document.form.email.value==''){
				alert('Please enter a value into the email field')
				document.form.email.focus();
				validForm = 0
			}
		}
	}
	if(validForm==1){
		if (echeck(document.form.email.value)==false){
			document.form.email.focus();
			validForm = 0
		}
	}
	if(validForm==1){
		if(document.form.addressP){
			if(document.form.email.value==''){
				alert('Please enter a value into the email field')
				document.form.email.focus();
				validForm = 0
			}
		}
	}
	if(validForm==1){
		if(document.form.cityP){
			if(document.form.email.value==''){
				alert('Please enter a value into the email field')
				document.form.email.focus();
				validForm = 0
			}
		}
	}
	if(validForm==1){
		if(document.form.cityP){
			if(document.form.email.value==''){
				alert('Please enter a value into the email field')
				document.form.email.focus();
				validForm = 0
			}
		}
	}
	if(validForm==1){
		if(document.form.cityP){
			if(document.form.email.value==''){
				alert('Please enter a value into the email field')
				document.form.email.focus();
				validForm = 0
			}
		}
	}
	if(validForm==1){
		if(document.form.cityP){
			if(document.form.email.value==''){
				alert('Please enter a value into the email field')
				document.form.email.focus();
				validForm = 0
			}
		}
	}
	if(validForm==1){
		if(document.form.cityP){
			if(document.form.email.value==''){
				alert('Please enter a value into the email field')
				document.form.email.focus();
				validForm = 0
			}
		}
	}
	if(validForm==1){
		if(document.form.cityP){
			if(document.form.email.value==''){
				alert('Please enter a value into the email field')
				document.form.email.focus();
				validForm = 0
			}
		}
	}
	if(validForm==1){
		if(document.form.cityP){
			if(document.form.email.value==''){
				alert('Please enter a value into the email field')
				document.form.email.focus();
				validForm = 0
			}
		}
	}
	

	if(validForm==1){
		if(document.form.confirmtext){
			if(document.form.confirmtext.value==''){
				alert('Please confirm that you agree to the terms and conditions')
				document.form.confirmtext.focus();
				validForm = 0
			}
		}
	}
if(validForm==1){
	return true;
}
else{
	return false;
}
}
