//WARNING: THIS IS A COMPRESSED FILE AND SHOULD NOT BE EDITED!!!
var oForm = null;
var blnShowRadCountryOT = 'True';
function Validate() {
var sCompany = oForm.co_name.value.toLowerCase()
if (oForm.radABFCust[1].checked) {
if (oForm.acct) {
if (isWhitespace(oForm.acct.value))
{ return warnInvalid(oForm.acct, "Please provide an ABF Account Number."); }
else if (!ValidABFAccount(oForm.acct.value))
{ return warnInvalid(oForm.acct, "Please provide a valid ABF Account Number."); }
}
}
if (isWhitespace(oForm.co_name.value))
{ return warnInvalid(oForm.co_name, "Company name is required."); }
else if (sCompany == "none" || sCompany == "n/a" || sCompany == "na" || sCompany == "home" || sCompany == "retired" || sCompany == "personal" || sCompany == "no")
{ return warnInvalid(oForm.co_name, "ABF offers a variety of online tools for infrequent and regular shippers; however, to use the logged-on version of abf.com, you must have an established ABF account associated with a business or institution. If you’d like to setup an ABF account, please contact your local account manager or call 1-800-610-5544."); }
if (isWhitespace(oForm.first_name.value))
{ return warnInvalid(oForm.first_name, "First name is required."); }
else if (stringContainsChars(oForm.first_name.value,'()\\/\'"'))
{ return warnInvalid(oForm.first_name, "First name can not contain any of the following characters: ( ) ' \" \\ /"); }
if (isWhitespace(oForm.last_name.value))
{ return warnInvalid(oForm.last_name, "Last name is required."); }
else if (stringContainsChars(oForm.last_name.value,'()\\/\'"'))
{ return warnInvalid(oForm.last_name, "Last name can not contain any of the following characters: ( ) ' \" \\ /"); }
if (!ValidLocation(MAIL)) { return false; }
if (oForm.chkFreightLocation.checked) { if (!ValidLocation(FREIGHT)) { return false; } }
if (isWhitespace(oForm.txtphone.value))
{ return warnInvalid(oForm.txtphone, "Telephone Number is required."); }
else if (!eval('oForm.radCountry1[3]').checked) {
if (!checkUSPhone(oForm.txtphone, "Phone")) { return false  }
}
if ((!isWhitespace(oForm.ext.value))&&(!isInteger(oForm.ext.value)))
{ return warnInvalid(oForm.ext, "Please enter a valid phone extension."); }
if (isWhitespace(oForm.email.value))
{ return warnInvalid(oForm.email, "E-mail address is required."); }
else if (!ValidEMail(oForm.email.value))
{ return warnInvalid(oForm.email, "Please verify that you have entered a valid e-mail address. A valid address is similar in format to webmaster@abfs.com and contains no spaces."); }
if ((!isWhitespace(oForm.fax.value))&& (!eval('oForm.radCountry1[3]').checked) && (!checkUSPhone(oForm.fax, "Fax"))) { return false }
if (isWhitespace(oForm.userID.value)) { return warnInvalid(oForm.userID, "Please provide a User ID."); }
else if (!ValidABFUserID(oForm.userID.value)) { return warnInvalid(oForm.userID, "User ID must be between 6 and 50 characters long."); }
else if (!NotAllSpaces(oForm.userID.value)) { return warnInvalid(oForm.userID, "User ID can not be all spaces."); }
else if (!isMainFrameFriendly(oForm.userID.value)) { return warnInvalid(oForm.userID, "User ID can only contain letters and numbers"); }
if (isWhitespace(oForm.password.value)) { return warnInvalid(oForm.password.value, "Please provide a password."); }
else if (!ValidABFPassword(oForm.password.value)) { return warnInvalid(oForm.password, "Password must be between 6 and 20 characters long."); }
else if (!NotAllSpaces(oForm.password.value)) { return warnInvalid(oForm.password, "Password can not be all spaces."); }
else if (!isMainFrameFriendly(oForm.password.value)) { return warnInvalid(oForm.password, "Password can only contain letters and numbers"); }
if (isWhitespace(oForm.passwordConfirm.value)) { return warnInvalid(oForm.passwordConfirm.value, "Please re-enter your password for verification."); }
else if (oForm.password.value != oForm.passwordConfirm.value) { return warnInvalid(oForm.passwordConfirm, "The passwords you entered do not match."); }
oForm.passedValidate.value = 'Y';
return true;
}
function ValidLocation(Type) {
var oCountry = eval("oForm.radCountry"+Type);
var oCountryTxt = eval("oForm.txtCountry"+Type);
var oCity = eval("oForm.txtCity"+Type);
var oCityOther = eval("oForm.txtCityOther"+Type);
var oState = eval("oForm.cboState"+Type);
var oAddress = eval("oForm.txtAddress"+Type);
var oZip = eval("oForm.txtZip"+Type);
var sStateTxt = (oCountry[1].checked)?'Province':'State';
var sZipTxt = (oCountry[0].checked)?'Zip':'Postal';
if (isWhitespace(oAddress.value)) { return warnInvalid(oAddress, "Street address is required."); }
else if (stringContainsChars(oAddress.value,'()\\/\'"')) { return warnInvalid(oAddress, "Street address can not contain any of the following characters: ( ) ' \" \\ /"); }
if (oCountry[3].checked) {
if (isWhitespace(oCityOther.value)) { return warnInvalid(oCityOther, "City is required."); }
if (isWhitespace(oCountryTxt.value)) { return warnInvalid(oCountryTxt, "Please enter a country."); }
}
else {
if (isWhitespace(oCity.value)) { return warnInvalid(oCity, "City is required."); }
if (oState.selectedIndex < 1) { return warnInvalid(oState, "Please select a " + sStateTxt + "."); }
}
if (isWhitespace(oZip.value)) { return warnInvalid(oZip, "A " + sZipTxt + " Code is required."); }
oZip.value = trimWhiteSpace(oZip.value);
if ((oCountry[0].checked) && (!ValidUSZip(oZip))) { return warnInvalid(oZip,"An invalid United States zip code was entered."); }
if ((oCountry[1].checked) && (!ValidCAZip(oZip))) { return warnInvalid(oZip,"An invalid Canadian postal code was entered."); }
if ((oCountry[2].checked) && (!ValidMXZip(oZip))) { return warnInvalid(oZip,"An invalid Mexican postal code was entered."); }
return true ;
}
function showAcctInfo(bShow) {
document.getElementById("AcctInfo").className = (bShow)?"visible":"hidden";
$(".formHeaderCommand")[0].innerHTML = (bShow)?"<b>Request Password</b>":"<b>Create Account</b>";
$("#cmdSubmit")[0].value = (bShow)?"Request Password":"Create Account";
$("#spnWhyPswd")[0].className = (bShow)?"visible":"hidden";
$("#spnWhyAcct")[0].className = (bShow)?"hidden":"visible";
$("#spnReqPswd")[0].className = (bShow)?"visible":"hidden";
$("#spnReqAcct")[0].className = (bShow)?"hidden":"visible";
}
function DisplayFreightAddress() {
if (blnShowFreightDisplay) {
blnShowFreightDisplay = false ;
document.getElementById("FreightDisplay").className = "hidden" ;
document.getElementById("FreightDisplay2").className = "hidden" ;
}
else {
blnShowFreightDisplay = true ;
document.getElementById("FreightDisplay").className = "visible" ;
document.getElementById("FreightDisplay2").className = "visible" ;
}
}
function OriginalAndAlternateDisplay(country, num) {
if (country == "OT") {
eval("document.getElementById('OrigDisplay1"+num+"').className = 'hidden'")
eval("document.getElementById('AltDisplay1"+num+"').className = 'visible'")
eval("document.getElementById('OrigDisplay2"+num+"').className = 'hidden'")
eval("document.getElementById('AltDisplay2"+num+"').className = 'visible'")
}
else {
eval("document.getElementById('OrigDisplay1"+num+"').className = 'visible'")
eval("document.getElementById('AltDisplay1"+num+"').className = 'hidden'")
eval("document.getElementById('OrigDisplay2"+num+"').className = 'visible'")
eval("document.getElementById('AltDisplay2"+num+"').className = 'hidden'")
}
}
function buildCountryList(seq,formName,lstCtyName,lstStName,CountrySelect,blnReqZip,blnShortForm,txtCustName,blnShowMexico,dynState,dynZip,blnOnclick) {
var lastCty = ''
var strSub = ''
if (seq == null)
{ seq = ''  }
else
{ strSub = '['+seq+']' }
if ((CountrySelect == "US") || (CountrySelect == ""))
{  var checkUS = "CHECKED"  }
else if (CountrySelect == "CA")
{  var checkCA = "CHECKED"  }
else if (CountrySelect == "MX")
{  var checkMX = "CHECKED"  }
else
{  var checkOT = "CHECKED"  }
document.write("<table BORDER='0' CELLPADDING='0' CELLSPACING='0' ><tr>")
document.write("<td NOWRAP><input type='radio' value='US' ONCLICK=\"CountryClicked('US','"+formName+"', '"+lstStName+"', '"+lstCtyName+"', '"+strSub+"', '"+seq+"', '"+blnReqZip+"','"+blnShortForm+"','"+txtCustName+"','"+dynState+"','"+dynZip+"','"+blnOnclick+"');\" NAME=\"" + lstCtyName + seq + "\" CLASS=\"frm\" "+checkUS+"></td>")
document.write("<td NOWRAP><font CLASS='formTxt'>United States&nbsp;&nbsp;</font></td>")
document.write("<td NOWRAP><input type='radio' value='CA' ONCLICK=\"CountryClicked('CA','"+formName+"', '"+lstStName+"', '"+lstCtyName+"', '"+strSub+"', '"+seq+"', '"+blnReqZip+"','"+blnShortForm+"','"+txtCustName+"','"+dynState+"','"+dynZip+"','"+blnOnclick+"');\" NAME=\"" + lstCtyName + seq + "\" CLASS=\"frm\" "+checkCA+"></td>")
document.write("<td NOWRAP><font CLASS='formTxt'>Canada&nbsp;&nbsp;</font></td>")
if (blnShowMexico != "False") {
document.write("<td><input type='radio' value='MX' ONCLICK=\"CountryClicked('MX','"+formName+"', '"+lstStName+"', '"+lstCtyName+"', '"+strSub+"', '"+seq+"', '"+blnReqZip+"','"+blnShortForm+"','"+txtCustName+"','"+dynState+"','"+dynZip+"','"+blnOnclick+"');\" NAME=\"" + lstCtyName + seq + "\" CLASS=\"frm\" "+checkMX+"></td>")
document.write("<td NOWRAP><font CLASS='formTxt'>Mexico&nbsp;&nbsp;</font></td>")
}
if (typeof blnShowRadCountryOT != "undefined") {
document.write("<td><input type='radio' value='OT' ONCLICK=\"CountryClicked('OT','"+formName+"', '"+lstStName+"', '"+lstCtyName+"', '"+strSub+"', '"+seq+"', '"+blnReqZip+"','"+blnShortForm+"','"+txtCustName+"','"+dynState+"','"+dynZip+"','"+blnOnclick+"');\" NAME=\"" + lstCtyName + seq + "\" CLASS=\"frm\" "+checkOT+"></td>")
document.write("<td NOWRAP><font CLASS='formTxt'>Other</font></td>")
}
document.write("</tr></table>")
}
function CountryClicked(Country, formName, lstStName, lstCtyName, strSub, seq, blnReqZip, blnShortForm, txtCustName, dynState, dynZip, blnOnclick) {
var objState = eval("document." + formName + "." + lstStName + strSub)
if (typeof(objState) != "undefined")
{ updateStateList(Country,null,eval("document." + formName + "." + lstStName + strSub));  }
updateCheckBox(Country,formName,seq);
ChangeZipPostalText(Country,formName,seq,blnReqZip,blnShortForm,txtCustName,dynState,dynZip);
if (blnOnclick == "True")
{ OnClickCountry(formName, lstStName, lstCtyName, Country, strSub, seq, dynState, dynZip); }
}
function ChangeZipPostalText(Country, formName, seq, blnReqZip, blnShortForm, txtCustName,dynState,dynZip) {
var objDynTxtZip = eval("document."+formName+"."+dynZip)
var objDynTxtState = eval("document."+formName+"."+dynState)
var dynTextZip
var dynTextState
if (formName == "passForm") {
if (Country == 'CA')
{  dynTextState = "Province*"  }
else
{  dynTextState = "State*"  }
}
if ((Country == '') || (Country == 'US')) {
if((formName == "frmLabels")||(formName == "frmBOL")||(formName == "fmPickup"))
{ dynTextZip = "City/State/Zip" }
else
{ dynTextZip = "Zip Code" }
}
else {
if((formName == "frmLabels")||(formName == "frmBOL")||(formName == "fmPickup"))
{ dynTextZip = "City/State/Postal" }
else
{ dynTextZip = "Postal Code" }
}
if (blnShortForm == 'True')
{  dynTextZip = txtCustName+" "+dynTextZip  }
if (blnReqZip=="True")
{  dynTextZip = dynTextZip+"*"  }
if ((seq == '') || (seq == null)) {
if (formName != "frmAddContact") {
objDynTxtZip.value = dynTextZip
objDynTxtState.value = dynTextState
}
}
else {
objDynTxtZip[seq].value = dynTextZip
objDynTxtState[seq].value = dynTextZip
}
}