

function ManagerInsert( frmName )
{
	var frm				= document.forms[frmName];
	var strFirstName	= frm.first_name.value;
	var strLastName		= frm.last_name.value;
	var strAddress1		= frm.address_1.value;
	var strAddress2		= frm.address_2.value;
	var strAddress3		= frm.address_3.value;
	//var strCity			= frm.city.value;
	var strZipcode		= frm.zipcode.value;
	var strPhone		= frm.phone.value;
	var strFax			= frm.fax.value;
	var strEmail		= frm.email_address.value;
	var strPassword		= frm.password.value;
	var strVPassword	= frm.verify_password.value;
	var strAlertMsg		= ""
	
	if ( strFirstName == "" ) {
		strAlertMsg = "First Name \n";
		}
	if ( strLastName == "" ) {
		strAlertMsg = strAlertMsg + "Last Name \n";
		}
	
	if ( strAddress1 == "" ) {
		strAlertMsg = strAlertMsg + "Address \n";
		}
		
	if ( strZipcode == "" ) {
		strAlertMsg = strAlertMsg + "Zipcode \n";
		}
		
	if ( strPhone == "" ) {
		strAlertMsg = strAlertMsg + "Phone Number \n";
		}
		
	if ( strEmail == "" ) {
		strAlertMsg = strAlertMsg + "Email Address \n";
		}
	
	if ( isEmail( strEmail ) != true ) {
		strAlertMsg = strAlertMsg + "Invalid Email Address \n";
		}
	
	if ( strPassword == "" ) {
		strAlertMsg = strAlertMsg + "Password \n";
		}
		
	if ( strVPassword != strPassword ) {
		strAlertMsg = strAlertMsg + "Your Passwords do NOT match, please re-enter them. \n";
		}
		
	if ( strAlertMsg != "" ) {
		strAlertMsg = "Please enter the following fields: \n \n" + strAlertMsg;
		alert( strAlertMsg )
		return false;
		}
		else
		{
		return true;
		}
	
}


function ManagerUpdate( frmName )
{
	var frm				= document.forms[frmName];
	var strFirstName	= frm.first_name.value;
	var strLastName		= frm.last_name.value;
	var strAddress1		= frm.address_1.value;
	var strAddress2		= frm.address_2.value;
	var strAddress3		= frm.address_3.value;
	//var strCity			= frm.city.value;
	var strZipcode		= frm.zipcode.value;
	var strPhone		= frm.phone.value;
	var strFax			= frm.fax.value;
	var strAlertMsg		= ""
	
	if ( strFirstName == "" ) {
		strAlertMsg = "First Name \n";
		}
	if ( strLastName == "" ) {
		strAlertMsg = strAlertMsg + "Last Name \n";
		}
	
	if ( strAddress1 == "" ) {
		strAlertMsg = strAlertMsg + "Address \n";
		}
		
	if ( strZipcode == "" ) {
		strAlertMsg = strAlertMsg + "Zipcode \n";
		}
		
	if ( strPhone == "" ) {
		strAlertMsg = strAlertMsg + "Phone Number \n";
		}
		
	if ( strAlertMsg != "" ) {
		strAlertMsg = "Please enter the following fields: \n \n" + strAlertMsg;
		alert( strAlertMsg )
		return false;
		}
		else
		{
		return true;
		}
	
}


function isEmail(emailAddress)
{
	if ( emailAddress.indexOf ('@',0) == -1 || 
	emailAddress.indexOf ('.',0) == -1)
{
	return false;
}
else
{
	return true;
}
}
	