%@page session="true"%><%@ taglib uri="http://www.e-deal.com/taglib/fl" prefix="fl" %><%
response.setContentType("application/x-javascript");
%>
var eraseFaxOnSubmit = false;
function doOnLoad() {
var f = window.document.forms[0];
if (f) {
if (f.EdiZip) {
f.EdiZip.onchange = doZipChange;
}
if (f.EdiCtrID) {
f.EdiCtrID.onchange = doCountryChange;
}
if (f.EdiPhone) {
f.EdiPhone.onchange = doPhoneChange;
}
if (f.EdiFax) {
f.EdiFax.onchange = doFaxChange;
}
}
}
function matchCode() {
var countryID = document.forms[0].EdiCtrID.options[document.forms[0].EdiCtrID.selectedIndex].value;
var phone = doEpurePhone(document.forms[0].EPhone.value);
var result = countryID;
result += '#' + phone.substring(0, phone.length - 3) ;
return result;
}
function doSubmit() {
var f = document.forms[0];
return true;
}
function doZipChange() {
var f = document.forms[0];
retrieveCity(f.EdiCtrID.options[f.EdiCtrID.selectedIndex].value, f.EdiZip.value, 'EdiCity');
}
function doCountryChange() {
var f = document.forms[0];
var field = f.EdiCtrID;
var oldCountry = field.options[field.selectedIndex].value;
retrieveCity(field.options[field.selectedIndex].value, f.EdiZip.value, 'EdiCity');
doEpureTel(f.EdiPhone, f.EdiPhone, oldCountry);
doEpureTel(f.EdiFax, f.EdiFax, oldCountry);
doFormatTel(f.EdiPhone, ' :', field);
doFormatTel(f.EdiFax, ' :', field);
}
function doPhoneChange() {
var f = document.forms[0];
var phoneField = f.EdiPhone;
var faxField = f.EdiFax;
var countryField = f.EdiCtrID;
if (faxField.value == '' && phoneField.value.length > 3) {
faxField.value = phoneField.value.substring(0, phoneField.value.length - 3);
}
doFormatTel(phoneField, ' :', countryField);
}
function doFaxChange() {
var f = document.forms[0];
var faxField = f.EdiFax;
var countryField = f.EdiCtrID;
doFormatTel(faxField, ' :', countryField);
}