/* FILE ARCHIVED ON 8:59:54 Feb 15, 2013 AND RETRIEVED FROM THE AN OPENWAYBACK INSTANCE ON 10:21:01 Apr 28, 2024. JAVASCRIPT APPENDED BY OPENWAYBACK, COPYRIGHT INTERNET ARCHIVE. ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C. SECTION 108(a)(3)). */ function addContact(type) { var tbody = document.getElementById("body" + type); var nextRow = tbody.rows.length; var totalRows = document.getElementById("bodyPhone").rows.length + document.getElementById("bodyEmail").rows.length; //append new row to table var row = tbody.insertRow(nextRow); //first column - contact type + 2 hidden fields var col1 = row.insertCell(0); if (type == 'Phone') { col1.setAttribute("headers", "phoneContactType"); } else { col1.setAttribute("headers", "emailContactType"); } var e1 = document.createElement("input"); e1.setAttribute("type", "hidden"); e1.setAttribute("name", "alt"+type); e1.setAttribute("value", totalRows); col1.appendChild(e1); var e1a = document.createElement("input"); e1a.setAttribute("type", "hidden"); e1a.setAttribute("name", "alt"+type+"_"+totalRows); e1a.setAttribute("value", "false"); col1.appendChild(e1a); var sel1 = document.createElement("select"); sel1.setAttribute("name", "contactType" + type + "_" + totalRows); sel1.options[0] = new Option("Work", "WORK"); sel1.options[1] = new Option("Home", "HOME"); if (type == 'Phone') { sel1.options[2] = new Option("Mobile", "MOBILE"); } col1.appendChild(sel1); //second column - phone type if (type == 'Phone') { var col2 = row.insertCell(1); col2.setAttribute("headers", "phoneType"); var sel2 = document.createElement("select"); sel2.setAttribute("name", "phoneType" + "_" + totalRows); sel2.options[0] = new Option("Voice", "VOICE"); sel2.options[1] = new Option("Fax", "FAX"); sel2.options[2] = new Option("TTY", "TTY"); sel2.options[3] = new Option("Other", "OTHER"); col2.appendChild(sel2); } //third column - value var col3; if (type == 'Phone') { col3= row.insertCell(2); col3.setAttribute("headers", "phoneValue"); } else { col3 = row.insertCell(1); col3.setAttribute("headers", "emailValue"); } var e2 = document.createElement("input"); e2.setAttribute("type", "text"); e2.setAttribute("name", type + "_" + totalRows); e2.setAttribute("value", ""); e2.setAttribute("id", type + "_" + totalRows); if (type == 'Phone') { e2.setAttribute("maxlength", "20"); } else { e2.setAttribute("maxlength", "55"); } col3.appendChild(e2); //fourth column - primary var col4; if (type == 'Phone') { col4 = row.insertCell(3); col4.setAttribute("headers", "primaryPhone"); } else { col4 = row.insertCell(2); col4.setAttribute("headers", "primaryEmail"); } col4.setAttribute("align", "center"); var e3 = document.createElement("input"); e3.setAttribute("type", "radio"); if (type == "Phone") { e3.setAttribute("name", "primaryPhoneNumber.id"); } else { e3.setAttribute("name", "primaryEmailAddress.id"); } e3.setAttribute("value", totalRows); if (nextRow == 0) { e3.setAttribute("selected", "selected"); } col4.appendChild(e3); //fifth column - preferred var col5; if (type == 'Phone') { col5 = row.insertCell(4); col5.setAttribute("headers", "preferredPhone"); } else { col5 = row.insertCell(3); col5.setAttribute("headers", "preferredEmail"); } col5.setAttribute("align", "center"); var e4 = document.createElement("input"); e4.setAttribute("type", "radio"); e4.setAttribute("name", "preferredContact.id"); e4.setAttribute("value", totalRows); if (nextRow == 0) { e4.setAttribute("selected", "selected"); } col5.appendChild(e4); //sixth column - delete var col6; if (type == 'Phone') { col6 = row.insertCell(5); col6.setAttribute("headers", "deletePhone"); } else { col6 = row.insertCell(4); col6.setAttribute("headers", "deleteEmail"); } col6.setAttribute("align", "center"); var e5 = document.createElement("input"); e5.setAttribute("type", "checkbox"); e5.setAttribute("name", "delete" + type); e5.setAttribute("value", totalRows); col6.appendChild(e5); } function countryChanged(obj) { var country = obj.options[obj.selectedIndex].value; if (country == 'USA') { document.getElementById("usstate").style.display = ""; document.getElementById("uszip").style.display = ""; document.getElementById("foreignProvince").style.display = "none"; document.getElementById("foreignZip").style.display = "none"; } else { document.getElementById("usstate").style.display = "none"; document.getElementById("uszip").style.display = "none"; document.getElementById("foreignProvince").style.display = ""; document.getElementById("foreignZip").style.display = ""; } } function validateContacts() { var inputs = document.getElementsByTagName("INPUT"); var preferredId; var primaryPhone; var primaryEmail; //preferred contact for (var i=0;i