<!--
var doc = 'document.frmTrial.';

function resetForm()
{
   eval(doc+'UID').value = '';
   eval(doc+'Pwd').value = '';
   eval(doc+'ConfirmPwd').value = '';
   eval(doc+'FName').value = '';
   eval(doc+'LName').value = '';
   eval(doc+'EMail').value = '';
   eval(doc+'Org').value = '';
   eval(doc+'Address').value = '';
   eval(doc+'City').value = '';
   eval(doc+'Zip').value = '';
   eval(doc+'Tel').value = '';
   eval(doc+'State').selectedIndex = 0;
   eval(doc+'How').selectedIndex = 0;
   eval(doc+'chkRead').checked = false;
   eval(doc+'chkContactMe').checked = false;   
   eval(doc+'UID').focus();
}


function submitForm()
{
	//verify that all fields are filled in
	if (!isText(eval(doc+'UID'), 2, 'User ID', true, false)) {return;}
	if (!isText(eval(doc+'Pwd'), 8, 'Password', true, false)) {return;}
	if (!isText(eval(doc+'ConfirmPwd'), 8, 'Confirm Password', true, false)) {return;}
	if (!isPasswordMatched(eval(doc+'Pwd'), eval(doc+'ConfirmPwd'))) {return;}
	if (!isText(eval(doc+'FName'), 2, 'First Name', true, false)) {return;}
	if (!isText(eval(doc+'LName'), 2, 'Last Name', true, false)) {return;}
	if (!isEMail(eval(doc+'EMail'))) {return;}	
	if (!isText(eval(doc+'Org'), 2, 'Organization', true, false)) {return;}
	if (!isText(eval(doc+'Address'), 6, 'Address', true, false)) {return;}
	if (!isText(eval(doc+'City'), 3, 'City', true, false)) {return;}
	if (eval(doc+'State').selectedIndex == 0) {
		alert('Must specify State for address.');
		return;
	}
	if (!isText(eval(doc+'Zip'), 5, 'Zip', true, false)) {return;}
	if (!isText(eval(doc+'Tel'), 10, 'Telephone', true, false)) {return;}
	if (eval(doc+'How').selectedIndex == 0) {
		alert('Please indicate how you heard about us.');
		return;
	}
	if (!eval(doc+'chkRead').checked)	 {
		alert('You must agree to the terms and conditions of the EPSS™ Online\nSubscription Agreement!');
		return;
	}
	
	//check to see if the user is from HealthSouth and if so, direct them to Jackie Colley to create a perm user acct
	if (isHealthSouth(eval(doc+'EMail'), true)) {return;}
	
	//if we got to this point, there must be no errors.  Submit form now
	document.frmTrial.submit();
}


function isHealthSouth (email, freetrial) {
	var HS_CONTACT = '(Jackie Colley at jackie.colley@healthsouth.com)';
	var HS_USER = '@healthsouth.com';
	var msg = '';
	
	//if HealthSouth user is trying to submit a contact request, then direct them
	//to Jackie Colley
	if (eval(doc+'EMail').value.toLowerCase().indexOf(HS_USER) != -1) {
		if (freetrial) {
			msg='Thank you for requesting a free trial account.  However, all\n';
			msg=msg+'HealthSouth users should contact the HealthSouth EPSS Admin\n';
			msg=msg+ HS_CONTACT + ' and request a\n';
			msg=msg+'permanent user account created for use with the EPSS system.';
		}
		else {			
			msg='If you are inquiring about the EPSS product, please contact the Healthsouth\n';
			msg=msg+'EPSS Admin ' + HS_CONTACT + ' for more\n';
			msg=msg+'information.  Otherwise, please call our EPSS Sales at 813.975.1157.';
		}
		msg=msg+'\n\nThank you!';
		alert(msg);
		return true;
	}
	
	return false;
}

//-->