function init(){document.getElementById("appTitle").innerHTML="Get Rates";framework.widget.helpmenu.init("rate_helpmenu");framework.widget.module.init("service_module",getModuleHelpMessagesInternationalRates,"","afterModuleInit");framework.widget.module.init("payment_terms_module",getModuleHelpMessagesInternationalRates,"","afterModuleInit");
framework.widget.module.init("shipper_info_module",getModuleHelpMessagesInternationalRates,"","afterModuleInit");framework.widget.module.init("from_module",getModuleHelpMessagesInternationalRates,"","afterModuleInit");framework.widget.module.init("to_module",getModuleHelpMessagesInternationalRates,"","afterModuleInit");
framework.widget.module.init("freight_desc_module",getModuleHelpMessagesInternationalRates,"","afterModuleInit");framework.widget.module.init("additional_charges_module",getModuleHelpMessagesInternationalRates,"","afterModuleInit");framework.widget.module.init("declared_value_module",getModuleHelpMessagesInternationalRates,"","afterModuleInit");
framework.widget.module.init("special_instr_module",getModuleHelpMessagesInternationalRates,"","afterModuleInit");framework.widget.module.init("special_instr_module",getModuleHelpMessagesInternationalRates,"","afterModuleInit");populateLabels("shipperStateLabel","shipperZipLabel","US");populateLabels("","fromZipLabel","US");
populateLabels("","toZipLabel","US");if(document.getElementById("countryList").value!="US"){populateCountryDropDown("shipperCountry");populateCountryDropDown("fromCountry");populateCountryDropDown("toCountry");}populateStateDropDown("shipperState","US");if(document.getElementById("shipperPhoneCntryCd").value=="001"){document.getElementById("usPhoneFormat").style.display="inline";
document.getElementById("usFaxFormat").style.display="inline";document.getElementById("intlPhoneFormat").style.display="none";document.getElementById("intlFaxFormat").style.display="none";}else{document.getElementById("usPhoneFormat").style.display="none";document.getElementById("usFaxFormat").style.display="none";
document.getElementById("intlPhoneFormat").style.display="inline";document.getElementById("intlFaxFormat").style.display="inline";}if(document.getElementById("shipperFaxCntryCd").value=="001"){document.getElementById("usPhoneFormat").style.display="inline";document.getElementById("usFaxFormat").style.display="inline";
document.getElementById("intlPhoneFormat").style.display="none";document.getElementById("intlFaxFormat").style.display="none";}else{document.getElementById("usPhoneFormat").style.display="none";document.getElementById("usFaxFormat").style.display="none";document.getElementById("intlPhoneFormat").style.display="inline";
document.getElementById("intlFaxFormat").style.display="inline";}var b="Eur";var d="Cen";var e=document.getElementById("pageTitle").value.substring(0,3);if((e==b)||(e==d)){document.getElementById("nationalService").disabled="disabled";}var a=document.getElementById("freightService").checked;var c=document.getElementById("nationalService").checked;
if((a==true)||(c==true)){enableForm();enableDependentModules();svcSelect();}else{disableForm();disableDependentModules();}}function disableDependentModules(){framework.widget.module.collapse("payment_terms_module");framework.util.hideElement("payment_terms_module._headerEdit");clearShipperType();framework.widget.module.collapse("shipper_info_module");
framework.util.hideElement("shipper_info_module._headerEdit");framework.widget.module.collapse("from_module");framework.util.hideElement("from_module._headerEdit");framework.widget.module.collapse("to_module");framework.util.hideElement("to_module._headerEdit");framework.widget.module.collapse("freight_desc_module");
framework.util.hideElement("freight_desc_module._headerEdit");framework.widget.module.collapse("additional_charges_module");framework.util.hideElement("additional_charges_module._headerEdit");framework.widget.module.collapse("declared_value_module");framework.util.hideElement("declared_value_module._headerEdit");
framework.widget.module.collapse("special_instr_module");framework.util.hideElement("special_instr_module._headerEdit");}function enableDependentModules(){framework.widget.module.expand("payment_terms_module");framework.widget.module.expand("shipper_info_module");framework.widget.module.expand("from_module");
framework.widget.module.expand("to_module");framework.widget.module.expand("freight_desc_module");framework.widget.module.expand("additional_charges_module");framework.widget.module.expand("declared_value_module");framework.widget.module.expand("special_instr_module");}function afterModuleInit(a){setModuleSummary(a);
}function setModuleSummary(b){if(framework.widget.module.isCollapsed(b)){var a=getModuleSummaryMessages(b);if(a!=""){framework.util.setInnerHTML(b+"._collapsed",a);}}}function getModuleSummaryMessages(e){var b="";switch(e){case"service_module":b=getCheckedValue(document.forms["offshoreForm"].elements["serviceSelect"]);
if(b==""){b="Please select a service.";}break;case"payment_terms_module":b=getCheckedValue(document.forms["offshoreForm"].elements["radShipType"]);if(b==""){b="Please select a shipper type/terms.";}break;case"shipper_info_module":if(document.getElementById("shipperCountry").value!=""){b+=document.getElementById("shipperCountry").value+", ";
}if(document.getElementById("shipperCompany").value!=""){b+=document.getElementById("shipperCompany").value+", ";}if(document.getElementById("shipperFirstName").value!=""){b+=document.getElementById("shipperFirstName").value+", ";}if(document.getElementById("shipperLastName").value!=""){b+=document.getElementById("shipperLastName").value+", ";
}if(document.getElementById("shipperAddress").value!=""){b+=document.getElementById("shipperAddress").value+", ";}if(document.getElementById("shipperCity").value!=""){b+=document.getElementById("shipperCity").value+", ";}if(document.getElementById("shipperState").value!=""){b+=document.getElementById("shipperState").value+", ";
}if(document.getElementById("shipperZip").value!=""){b+=document.getElementById("shipperZip").value+", ";}var d=combinePhoneNumber("shipperPhoneCntryCd","shipperPhoneAreaCode","shipperPhonePrefix","shipperPhoneLineNbr");if(d!=""){b+=d+", ";}var a=combinePhoneNumber("shipperFaxCntryCd","shipperFaxAreaCode","shipperFaxPrefix","shipperFaxLineNbr");
if(a!=""){b+=a+", ";}if(document.getElementById("shipperEmail").value!=""){b+=document.getElementById("shipperEmail").value+", ";}b=b.substring(0,b.length-2);if(b==""){b="Please enter shipper information.";}break;case"from_module":if(document.getElementById("fromCountry").value!=""){b+=document.getElementById("fromCountry").value+", ";
}if(document.getElementById("fromCity").value!=""){b+=document.getElementById("fromCity").value+", ";}if(document.getElementById("fromZip").value!=""){b+=document.getElementById("fromZip").value+", ";}b=b.substring(0,b.length-2);if(b==""){b="Please enter from information.";}break;case"to_module":if((document.getElementById("toCountry").value!="")||(document.getElementById("toCountry").value!="")){b+=document.getElementById("toCountry").value+", ";
}if(document.getElementById("toCity").value!=""){b+=document.getElementById("toCity").value+", ";}if(document.getElementById("toZip").value!=""){b+=document.getElementById("toZip").value+", ";}b=b.substring(0,b.length-2);if(b==""){b="Please enter to information.";}break;case"freight_desc_module":var c="n";
if(document.getElementById("handlingUnits1").value!=""){b+=document.getElementById("handlingUnits1").value+", ";c="y";}if(document.getElementById("palletPieces1").value!=""){b+=document.getElementById("palletPieces1").value+", ";c="y";}if(document.getElementById("commodity1").value!=""){b+=document.getElementById("commodity1").value+", ";
c="y";}if(document.getElementById("class1").value!=""){b+=document.getElementById("class1").value+", ";c="y";}if(document.getElementById("totalWeight1").value!=""){b+=document.getElementById("totalWeight1").value+", ";c="y";}if(document.getElementById("length1").value!=""){b+=document.getElementById("length1").value+", ";
c="y";}if(document.getElementById("width1").value!=""){b+=document.getElementById("width1").value+", ";c="y";}if(document.getElementById("height1").value!=""){b+=document.getElementById("height1").value+", ";c="y";}if(c=="y"){b=b.substring(0,b.length-2);b+="<br/>";}c="n";if(document.getElementById("handlingUnits2").value!=""){b+=document.getElementById("handlingUnits2").value+", ";
c="y";}if(document.getElementById("palletPieces2").value!=""){b+=document.getElementById("palletPieces2").value+", ";c="y";}if(document.getElementById("commodity2").value!=""){b+=document.getElementById("commodity2").value+", ";c="y";}if(document.getElementById("class2").value!=""){b+=document.getElementById("class2").value+", ";
c="y";}if(document.getElementById("totalWeight2").value!=""){b+=document.getElementById("totalWeight2").value+", ";c="y";}if(document.getElementById("length2").value!=""){b+=document.getElementById("length2").value+", ";c="y";}if(document.getElementById("width2").value!=""){b+=document.getElementById("width2").value+", ";
c="y";}if(document.getElementById("height2").value!=""){b+=document.getElementById("height2").value+", ";c="y";}if(c=="y"){b=b.substring(0,b.length-2);b+="<br/>";}c="n";if(document.getElementById("handlingUnits3").value!=""){b+=document.getElementById("handlingUnits3").value+", ";c="y";}if(document.getElementById("palletPieces3").value!=""){b+=document.getElementById("palletPieces3").value+", ";
c="y";}if(document.getElementById("commodity3").value!=""){b+=document.getElementById("commodity3").value+", ";c="y";}if(document.getElementById("class3").value!=""){b+=document.getElementById("class3").value+", ";c="y";}if(document.getElementById("totalWeight3").value!=""){b+=document.getElementById("totalWeight3").value+", ";
c="y";}if(document.getElementById("length3").value!=""){b+=document.getElementById("length3").value+", ";c="y";}if(document.getElementById("width3").value!=""){b+=document.getElementById("width3").value+", ";c="y";}if(document.getElementById("height3").value!=""){b+=document.getElementById("height3").value+", ";
c="y";}if(c=="y"){b=b.substring(0,b.length-2);b+="<br/>";}if(document.getElementById("totalCube").value!=""){b+=document.getElementById("totalCube").value+", ";}if((document.getElementById("salesTerms")!=null)&&(document.getElementById("salesTerms").value!="")){b+=document.getElementById("salesTerms").value+", ";
}if(b.substr((b.length-2),2)==", "){b=b.substring(0,b.length-2);}if(b==""){b="Please enter freight description information.";}break;case"additional_charges_module":break;case"declared_value_module":if(document.getElementById("as_declared_value").value!=""){b+=document.getElementById("as_declared_value").value+", ";
}if((document.getElementById("as_cod_amt")!=null)&&(document.getElementById("as_cod_amt").value!="")){b+=document.getElementById("as_cod_amt").value+", ";}b=b.substring(0,b.length-2);if(b==""){b="Please enter declared value/COD information.";}break;case"special_instr_module":if(document.getElementById("as_comments").value!=""){b+=document.getElementById("as_comments").value;
}else{b="Please enter special instructions.";}break;}return b;}function hideHelpFloatingWindow(){framework.widget.floatingWindow.hide("help_floatingWindow");}function getModuleHelpMessages(c){var b;var a="";switch(c){case"ship.module._headerHelp":b="Shipment Module <b style='color:#660099;'>Help</b> Message";
break;case"other.module._headerHelp":b="Other Module <b style='color:#660099;'>Help</b> Message";break;case"grid.module._headerHelp":a="index.jsp";break;default:b="No help for this module.";break;}if(a!=""){window.open(a,null,"resizable=no,scrollbars=yes,status=no,height=600,width=800");return"popup";
}else{return b;}}function evalSameAs(){var c=document.truckloadForm;var b=document.truckloadForm.sameAs;var a="";for(i=0;i<b.length;i++){if(b[i].checked){a=b[i].value;break;}}if(a=="shipper"){c.debtorCountry.value=c.shipperCountry.value;c.debtorName.value=c.shipperName.value;c.debtorCustNbr.value=c.shipperCustNbr.value;
c.debtorAddr.value=c.shipperAddr.value;c.debtorCity.value=c.shipperCity.value;c.debtorState.value=c.shipperState.value;c.debtorZip.value=c.shipperZip.value;}else{if(a=="consignee"){c.debtorCountry.value=c.consigneeCountry.value;c.debtorName.value=c.consigneeName.value;c.debtorCustNbr.value=c.consigneeCustNbr.value;
c.debtorAddr.value=c.consigneeAddr.value;c.debtorCity.value=c.consigneeCity.value;c.debtorState.value=c.consigneeState.value;c.debtorZip.value=c.consigneeZip.value;}else{}}}function maxLength(b,a){if(b.value.length>=a){b.value=b.value.slice(0,a);}}function svcSelect(){var a=document.offshoreForm.serviceSelect[0].checked;
var b=document.offshoreForm.serviceSelect[1].checked;enableForm();if(a==true&&b==false){document.getElementById("freightAC").style.display="inline";document.getElementById("nationalAC").style.display="none";}else{if(a==false&&b==true){document.getElementById("freightAC").style.display="none";document.getElementById("nationalAC").style.display="inline";
}else{document.getElementById("freightAC").style.display="none";document.getElementById("nationalAC").style.display="none";}}enableDependentModules();}function enableForm(){var a=document.offshoreForm;var b=document.getElementById("freightService").disabled;var d=document.getElementById("nationalService").disabled;
for(i=0;i<a.length;i++){var c=a.elements[i];if(true){c.disabled=false;}}document.getElementById("freightService").disabled=b;document.getElementById("nationalService").disabled=d;}function disableForm(){var a=document.offshoreForm;for(i=0;i<a.length;i++){var b=a.elements[i];if(true){b.disabled=true;}}document.getElementById("freightService").disabled=false;
document.getElementById("nationalService").disabled=false;}function clearShipperType(){document.getElementById("radShipTypeS").checked=false;document.getElementById("radShipTypeC").checked=false;document.getElementById("radShipTypeB").checked=false;}