function validate_form (obj) {
	var ret = true;
	var m = new Array;
	var regex 		= new RegExp("^[0-9a-z\\._]+@[0-9a-z]+\\..+$","i");
	
	if ($F('fname').length < 1) { $('fname').setStyle({ border: '1px solid red' }); ret = false; }
	if ($F('lname').length < 1) { $('lname').setStyle({ border: '1px solid red' }); ret = false; }	
	if ($F('email') != $F('vemail')) { $('email').setStyle({ border: '1px solid red' }); $('vemail').setStyle({ border: '1px solid red' }); ret = false; }
	if ($F('zip').length < 1)  { $('zip') .setStyle({ border: '1px solid red' }); ret = false; }
	if ($F('password') != $F('vpassword')) { m.push('Passwords do not match.'); $('password') .setStyle({ border: '1px solid red' }); $('vpassword') .setStyle({ border: '1px solid red' }); ret = false; }
	if ($F('password').length < 4) {  m.push("Password must be 5 or more characters"); $('password') .setStyle({ border: '1px solid red' }); ret = false; }
	if (!regex.test($F('email'))) { m.push('Email is an invalid format.'); $('email').setStyle({ border: '1px solid red' }); ret = false; }
	
	if (ret) {
		$('part3').hide();
		$('part2').hide();
		$('part1').hide();
			
	} else {
		if (m.length > 0) { alert(m.join("\n")); }
		$('errors').show();
		$('no_error').hide();
		$('part3').hide();
		$('part2').hide();
		$('part1').show();	
	}
	
	new Ajax.Request('/php/fanclub.php', 
		{ 
			method: 'post', 
			parameters: $('fanclub').serialize(),
			onComplete: function (r) {
				var txt = r.responseText;
				if (txt) { 
					alert(txt);
					$('errors').show();
					$('no_error').hide();
					$('part3').hide();
					$('part2').hide();
					$('part1').show();	
				}	else {
					$('errors').hide();
					$('no_error').hide();
					$('part3').hide();
					$('part2').hide();
					$('part1').hide();
					$('thankyou').show();	
				}
			}
		}
	);
	
	return false;
}

/*
       <div id="thankyou" style="width:100%;display:none;">
        	Thank you for signing up for our fan club.
        </div>
        */