function submit_account(account_action)
{
	var first_name = $('FIRST_NAME');
	var last_name = $('LAST_NAME');
	var company_name = $('COMPANY_NAME');
	var email = $('EMAIL');
	var confirm_email = $('CONFIRM_EMAIL');
	var address_1 = $('ADDRESS_1');
	var address_2 = $('ADDRESS_2');
	var city = $('CITY');
	var state = $('STATE');
	var zip = $('ZIP');
	var phone = $('PHONE');
	var extension = $('EXTENSION');
	var fax = $('FAX');
	
	// only check password if creating account
	if (account_action == "CREATE") {
		var password = $('PASSWORD');
		var confirm_password = $('CONFIRM_PASSWORD');
	}

	
	first_name.value = trim(first_name.value);
	last_name.value = trim(last_name.value);
	company_name.value = trim(company_name.value);
	email.value = trim(email.value);
	confirm_email.value = trim(confirm_email.value);
	address_1.value = trim(address_1.value);
	address_2.value = trim(address_2.value);
	city.value = trim(city.value);
	zip.value = trim(zip.value);
	phone.value = trim(phone.value);
	extension.value = trim(extension.value);
	if (fax) { fax.value = trim(fax.value); }
	
	// only check password if creating account
	if (account_action == "CREATE") {
		password.value = trim(password.value);
		confirm_password.value = trim(confirm_password.value);
	}
	
	var first_name_text = '';
	var last_name_text = '';
	var company_name_text = '';
	var email_text = '';
	var confirm_email_text = '';
	var address_1_text = '';
	var address_2_text = '';
	var city_text = '';
	var state_text = '';
	var zip_text = '';
	var phone_text = '';
	var extension_text = '';
	if (fax) { var fax_text = ''; }
	
	// only check password if creating account
	if (account_action == "CREATE") {
		var password_text = '';
		var confirm_password_text = '';
	}
	
	var error_str = '';
	
	if (first_name.value.length < 1) { error_str += 'First Name - blank \n'; first_name_text = 'red_text'; }
	else if (!is_alpha(first_name.value)) { error_str += 'First Name - Invalid characters used \n'; first_name_text = 'red_text'; }
	if (last_name.value.length < 1) { error_str += 'Last Name - blank \n'; last_name_text = 'red_text'; }
	else if (!is_alpha(last_name.value)) { error_str += 'Last Name - Invalid characters used \n'; last_name_text = 'red_text'; }
	if (company_name.value.length && !is_alpha(company_name.value)) { error_str += 'Company Name - Invalid characters used \n'; company_name_text = 'red_text'; }
	if (email.value.length < 1) { error_str += 'Email Address - blank \n'; email_text = 'red_text'; }
	else if (!check_email(email.value)) { error_str += 'Email Address - invalid (please check) \n'; email_text = 'red_text'; }
	else if (confirm_email.value.length < 1) { error_str += 'Confirm Email Address - blank \n'; confirm_email_text = 'red_text'; }
	else if (confirm_email.value != email.value) { error_str += 'Confirm Email Address - does not match Email Address \n'; confirm_email_text = 'red_text'; }
	
	// only check password if creating account
	if (account_action == "CREATE") {
		if (((password.value != 'xxxx') && (account_action == 'UPDATE')) || (account_action == 'CREATE'))
		{
			if (password.value.length < 1) { error_str += 'Password - blank \n'; password_text = 'red_text'; }
			else if ((password.value.length < 6) || (password.length > 12)) 
			{ 
				error_str += 'Password - must have between 6 and 12 characters \n'; password_text = 'red_text'; 
			}
			else if (!is_alpha(password.value)) { error_str += 'Password - Invalid characters used \n'; password_text = 'red_text'; }
			else if (confirm_password.value.length < 1) { error_str += 'Confirm Password - blank \n'; confirm_password_text = 'red_text'; }
			else if (confirm_password.value != password.value) { error_str += 'Confirm Password - does not match Password \n'; confirm_password_text = 'red_text'; }
		}
	}
	
	if (city.value.length < 1) { error_str += 'City - blank \n'; city_text = 'red_text'; }
	else if (!is_alpha(city.value)) { error_str += 'City - Invalid characters used \n'; city_text = 'red_text'; }
	if (address_1.value.length < 1) { error_str += 'Address Line 1 - blank \n'; address_1_text = 'red_text'; }
	else if (!is_alpha(address_1.value)) { error_str += 'Address Line 1 - Invalid characters used \n'; address_1_text = 'red_text'; }
	if (address_2.value.length && !is_alpha(address_2.value)) { error_str += 'Address Line 2 - Invalid characters used \n'; address_2_text = 'red_text'; }
	if (state.value < 1) { error_str += 'State - Please make selection \n'; state_text = 'red_text'; }
	
	if (zip.value.length < 1) { error_str += 'Zip - blank \n'; zip_text = 'red_text'; }
	else if (!is_zip(zip.value)) { error_str += 'Zip - invalid (please check) \n'; zip_text = 'red_text'; }
		
	if (phone.value.length < 1) { error_str += 'Phone - blank \n'; phone_text = 'red_text'; }
	else if (!check_phone(phone.value)) { error_str += 'Phone - invalid (please check) \n'; phone_text = 'red_text'; }
	if (extension.value.length && !is_extension(extension.value)) { error_str += 'Phone Extension - Invalid characters used \n'; extension_text = 'red_text'; }
	if (fax) {
		if (fax.value.length && !check_phone(fax.value)) { error_str += 'Fax - invalid (please check) \n'; fax_text = 'red_text'; }
	}
	
	if (error_str.length) 
	{ 
		$('first_name_text').className = first_name_text;
		$('last_name_text').className = last_name_text;
		$('company_name_text').className = company_name_text;
		$('email_text').className = email_text;
		$('confirm_email_text').className = confirm_email_text;
		$('address_1_text').className = address_1_text;
		$('address_2_text').className = address_2_text;
		$('city_text').className = city_text;
		$('state_text').className = state_text;
		$('zip_text').className = zip_text;
		$('phone_text').className = phone_text;
		$('extension_text').className = extension_text;
		if (fax) { $('fax_text').className = fax_text; }
		
		// only check password if creating account
		if (account_action == "CREATE") {
			$('password_text').className = password_text;
			$('confirm_password_text').className = confirm_password_text;
		}
		
		alert('Please correct the following: \n \n' + error_str); 
	}
	else
	{		
		if (account_action == 'CREATE')
		{
			document.myForm.ACTION.value = "ACCOUNT";
			document.myForm.ACTION_TARGET.value = 'ADD';
		}
		else if (account_action == 'UPDATE')
		{
			document.myForm.ACTION.value = "ACCOUNT";
			document.myForm.ACTION_TARGET.value = 'UPDATE';
		}
		
		document.myForm.submit();	
	}
}

function reset_password()
{
	var error_str = '';
	
	var password = $('PASSWORD');
	password.value = trim(password.value);
	$('PASSWORD').value = password.value;
	
	var confirm_password = $('CONFIRM_PASSWORD');
	confirm_password.value = trim(confirm_password.value);
	$('CONFIRM_PASSWORD').value = confirm_password.value;
		
	if ((password.value.length < 6) || (password.value.length > 12))
	{
		error_str += '[Password] - must be between 6 to 12 chars \n';
		password.value = '';
		confirm_password.value = '';
	}
	else if (!is_alpha(password.value)) 
	{ 
		error_str += '[Password] - invalid characters used';
		password.value = '';
		confirm_password.value = '';
	}
	else if (confirm_password.value != password.value)
	{
		error_str += '[Confirm Password] - does not match password \n';	
		confirm_password.value = '';
	}
	
	if (error_str.length)
	{
		alert('Please correct the following: \n \n' + error_str);	
	}
	else
	{
		$('ACTION').value = 'RESET_PASSWORD_PROCESS';
		document.myForm.submit();
	}
}