function validateRegister()
{
	var tA = validate('myform');
		
	if($F("user_password") != $F("user_password2")){
		tA.push({field: "password", message: "Passwords do not match"});
	}	
		
	if(tA == true){
		$("myform").submit();
	}else{
		
	}
		
	if(tA.length > 0)
	{
		var t = "";
		for(var i=0;i<tA.length;i++){
			t += tA[i].message + "\n";
		}
		alert(t);
	}

}