/*
 * @author Chris Lewis <chris@rosaloves.com> 9/29/2006
 */
function rlValidateUserLogin(event) {
	var valid = true;
	//First check for empty fields.
	var fields = ['RlUserEmail', 'RlUserPassword'];
	fields.each( function(field) {
		valid = valid && ($F(field).length > 0);
		if($(field).style) {
			$(field).style.borderBottom = $F(field).length < 1
				? '1px dotted #ff0000' : '1px solid #ffffff';
		}
	});
	
	if(! valid) {
		alert('Please complete all fields.');
		Event.stop(event);
	}
	
}

Event.observe($('loginForm'), 'submit', function(event) { rlValidateUserLogin(event); } );
