/**
 * Login Checker
 * Marc Giguere, November 2006
 * Copyright (c) 2006 Artemis IT Solutions
 *
 */
function ValidateLogin (oForm) {
	
	//Check that email was provided
	if(IsEmailValid(oForm.email) && oForm.sitepw.value != '') {
		return true;
	}
	return false;
}

//Passes in object instead of direct string...
function IsEmailValid(sEmail)
{

	// Use Regular Expressions for Email Verification
	// Credit Reg-Ex Check: Gavin Sharp (http://www.glensharp.com/gavin/)
	REEmail = /^(([A-Za-z0-9]+_+)|([A-Za-z0-9]+\-+)|([A-Za-z0-9]+\.+)|([A-Za-z0-9]+\++))*[A-Za-z0-9]+@((\w+\-+)|(\w+\.))*\w{1,63}\.[a-zA-Z]{2,6}$/
	
	//Check if blank, if so, ignore for now
	if (sEmail.value == '') {
		alert("You must enter in a valid email address");
		return 0;
	} else {
		if (!sEmail.value.match(REEmail)) {
			alert("Please enter a valid email address.");		
			sEmail.select();
			return 0;
		} else {
			return 1;
		}
	}
}
