// JavaScript Document

function checkemail(){

		var str=document.investUpdateForm.email.value;
		var msgstr = "Please input a valid email address!"

	var filter=/^(\w+(?:\.\w+)*)@((?:\w+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
	if (filter.test(str) && str != "username@mydomain.com"){
		testresults=true;
	}else{
		alert(msgstr);
		testresults=false;
	}
	return (testresults);
} 

function validate1() {
	myForm = document.getElementById('checkAgree');	
	if(myForm.agree.checked != true) { alert("You must agree to proceed"); }
}

function Validate(){
	myForm = document.investUpdateForm;

	if(myForm.fname.value==''){
		alert('Please enter your Name');
		myForm.fname.focus();
		return false;
	}

	if(myForm.cert.value==''){
		alert('Please enter your Investor Number');
		myForm.cert.focus();
		return false;
	}
 

	if(myForm.addy.value==''){
		alert('Please enter your Address');
		myForm.addy.focus();
		return false;
	}
 

	if(myForm.sub.value==''){
		alert('Please enter your Suburb');
		myForm.sub.focus();
		return false;
	}
 

	if(myForm.home.value==''){
		alert('Please enter your Home Phone number');
		myForm.home.focus();
		return false;
	}
 

	if(myForm.work.value==''){
		alert('Please enter your Work Phone Number');
		myForm.work.focus();
		return false;
	}
		if(myForm.postcode.value==''){
		alert('Please enter your Post Code');
		myForm.work.focus();
		return false;
	}
 

	if (checkemail() == false){
			myForm.email.focus();
			return false;
	}
	
	
		//return true;	
}
