36b93f9a801a286f6bcb6e0cc7d0c7e86dfbdf4b
[freeside.git] / FS-Test / share / output / edit / cust_main.cgi / 135
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <HTML>
3   <HEAD>
4     <TITLE>
5       Edit Customer: Olson Inc (Towne, Samara)
6     </TITLE>
7     <!-- per RT, to prevent IE compatibility mode -->
8     <meta http-equiv="X-UA-Compatible" content="IE=edge" />
9     <!-- The X-UA-Compatible <meta> tag above must be very early in <head> -->
10     <META HTTP-Equiv="Cache-Control" Content="no-cache">
11     <META HTTP-Equiv="Pragma" Content="no-cache">
12     <META HTTP-Equiv="Expires" Content="0"> 
13
14     <script type="text/javascript" src="http://localhost/freeside/elements/cssexpr.js"></script>
15
16
17   <script type="text/javascript" src="http://localhost/freeside/elements/xmenu.top.js"></script>
18   <link href="http://localhost/freeside/elements/xmenu.top.css" type="text/css" rel="stylesheet">
19
20
21   <link href="http://localhost/freeside/elements/freeside.css" type="text/css" rel="stylesheet">
22   <link href="http://localhost/freeside/elements/freeside-print.css" type="text/css" rel="stylesheet" media="print">
23 <link href="http://localhost/freeside/elements/freeside-menu.css" type="text/css" rel="stylesheet">
24
25 <SCRIPT TYPE="text/javascript">
26
27   function about_freeside() {
28     overlib( OLiframeContent('http://localhost/freeside/docs/about.html', 300, 375, 'popup-0000000000-0000-000000000.000000', 0, 'auto' ), CAPTION, 'About', STICKY, AUTOSTATUSCAP, MIDX, 0, MIDY, 0, DRAGGABLE, CLOSECLICK, BGCOLOR, '#7e0079', CGCOLOR, '#7e0079', CLOSETEXT, 'Close'); 
29   }
30
31   webfxMenuImagePath      = "http://localhost/freeside/images/";
32   webfxMenuUseHover       = 1;
33   webfxMenuShowTime       = 300;
34   webfxMenuHideTime       = 500;
35
36   var myBar = new WebFXMenuBar;
37
38     
39           myBar.add(new WebFXMenuButton('Billing Main', "http://localhost/freeside/", 'Billing start page' ));
40
41     
42           myBar.add(new WebFXMenuButton('Ticketing Main', "http://localhost/freeside/rt/", 'Ticketing start page' ));
43
44     
45           myBar.add(new WebFXMenuButton('New prospect', "http://localhost/freeside/edit/prospect_main.html", 'Add a new prospect' ));
46
47     
48           myBar.add(new WebFXMenuButton('New customer', "http://localhost/freeside/edit/cust_main.cgi", 'Add a new customer' ));
49
50
51           var myMenu0 = new WebFXMenu;
52 myMenu0.emptyText = '';
53 var myMenu1 = new WebFXMenu;
54 myMenu1.emptyText = '';
55 myMenu1.add(new WebFXMenuItem("List prospects", "http://localhost/freeside/search/prospect_main.html", "" ));
56 myMenu1.add(new WebFXMenuItem("Advanced prospect reports", "http://localhost/freeside/search/report_prospect_main.html", "" ));
57 myMenu1.add(new WebFXMenuSeparator());
58 myMenu1.add(new WebFXMenuItem("Prospect contacts", "http://localhost/freeside/search/report_contact.html?link=prospect_main", "" ));
59 myMenu1.width = 256;
60
61 myMenu0.add(new WebFXMenuItem("Prospects", null, "Prospect reports", myMenu1 ));
62 var myMenu2 = new WebFXMenu;
63 myMenu2.emptyText = '';
64 myMenu2.add(new WebFXMenuItem("List quotations", "http://localhost/freeside/search/quotation.html", "" ));
65 myMenu2.add(new WebFXMenuItem("Advanced quotation reports", "http://localhost/freeside/search/report_quotation.html", "" ));
66 myMenu2.width = 256;
67
68 myMenu0.add(new WebFXMenuItem("Quotations", null, "Quotation reports", myMenu2 ));
69 var myMenu3 = new WebFXMenu;
70 myMenu3.emptyText = '';
71 var myMenu4 = new WebFXMenu;
72 myMenu4.emptyText = '';
73 myMenu4.add(new WebFXMenuItem("by customer number", "http://localhost/freeside/search/cust_main.cgi?browse=custnum", "" ));
74 myMenu4.add(new WebFXMenuItem("by last name", "http://localhost/freeside/search/cust_main.cgi?browse=last", "" ));
75 myMenu4.add(new WebFXMenuItem("by company name", "http://localhost/freeside/search/cust_main.cgi?browse=company", "" ));
76 myMenu4.add(new WebFXMenuItem("by active trouble tickets", "http://localhost/freeside/search/cust_main.cgi?browse=tickets", "" ));
77 myMenu4.width = 256;
78
79 myMenu3.add(new WebFXMenuItem("List customers", null, "List customers", myMenu4 ));
80 myMenu3.add(new WebFXMenuItem("Zip code distribution", "http://localhost/freeside/search/report_cust_main-zip.html", "Zip codes by number of customers" ));
81 myMenu3.add(new WebFXMenuItem("Customer signup report", "http://localhost/freeside/graph/report_cust_signup.html", "New customer signups by date" ));
82 myMenu3.add(new WebFXMenuItem("Customer churn report", "http://localhost/freeside/graph/report_cust_churn.html", "New customers, suspensions, and cancellations summary" ));
83 myMenu3.add(new WebFXMenuItem("Signup date report", "http://localhost/freeside/graph/report_signupdate.html", "Signup date report (by date of signup)" ));
84 myMenu3.add(new WebFXMenuItem("Advanced customer reports", "http://localhost/freeside/search/report_cust_main.html", "by status, signup date, agent, etc." ));
85 myMenu3.add(new WebFXMenuSeparator());
86 myMenu3.add(new WebFXMenuItem("Customer contacts", "http://localhost/freeside/search/report_contact.html?link=cust_main", "" ));
87 myMenu3.width = 256;
88
89 myMenu0.add(new WebFXMenuItem("Customers", null, "Customer reports", myMenu3 ));
90 var myMenu5 = new WebFXMenu;
91 myMenu5.emptyText = '';
92 var myMenu6 = new WebFXMenu;
93 myMenu6.emptyText = '';
94 myMenu6.add(new WebFXMenuItem("All open invoices", "http://localhost/freeside/search/cust_bill.html?OPEN_date", "All invoices with an unpaid balance" ));
95 myMenu6.add(new WebFXMenuItem("15 day open invoices", "http://localhost/freeside/search/cust_bill.html?OPEN15_date", "Invoices 15 days or older with an unpaid balance" ));
96 myMenu6.add(new WebFXMenuItem("30 day open invoices", "http://localhost/freeside/search/cust_bill.html?OPEN30_date", "Invoices 30 days or older with an unpaid balance" ));
97 myMenu6.add(new WebFXMenuItem("60 day open invoices", "http://localhost/freeside/search/cust_bill.html?OPEN60_date", "Invoices 60 days or older with an unpaid balance" ));
98 myMenu6.add(new WebFXMenuItem("90 day open invoices", "http://localhost/freeside/search/cust_bill.html?OPEN90_date", "Invoices 90 days or older with an unpaid balance" ));
99 myMenu6.add(new WebFXMenuItem("120 day open invoices", "http://localhost/freeside/search/cust_bill.html?OPEN120_date", "Invoices 120 days or older with an unpaid balance" ));
100 myMenu6.width = 256;
101
102 myMenu5.add(new WebFXMenuItem("Open invoices", null, "Open invoices", myMenu6 ));
103 myMenu5.add(new WebFXMenuItem("All invoices", "http://localhost/freeside/search/cust_bill.html?date", "List all invoices" ));
104 myMenu5.add(new WebFXMenuItem("Advanced invoice reports", "http://localhost/freeside/search/report_cust_bill.html", "by agent, date range, etc." ));
105 myMenu5.add(new WebFXMenuSeparator());
106 myMenu5.add(new WebFXMenuItem("Line items", "http://localhost/freeside/search/report_cust_bill_pkg.html", "Individual line item detail" ));
107 myMenu5.add(new WebFXMenuItem("Voided invoices", "http://localhost/freeside/search/report_cust_bill_void.html", "Search for voided invoices" ));
108 myMenu5.width = 256;
109
110 myMenu0.add(new WebFXMenuItem("Invoices", null, "Invoice reports", myMenu5 ));
111 var myMenu7 = new WebFXMenu;
112 myMenu7.emptyText = '';
113 myMenu7.add(new WebFXMenuItem("Discount graph", "http://localhost/freeside/graph/report_cust_bill_pkg_discount.html", "Discount overview per month" ));
114 myMenu7.add(new WebFXMenuItem("Discount detail", "http://localhost/freeside/search/report_cust_bill_pkg_discount.html", "Discount report (by employee and/or date range)" ));
115 myMenu7.add(new WebFXMenuItem("Package discounts", "http://localhost/freeside/search/report_cust_pkg_discount.html", "Active/inactive discounts by package" ));
116 myMenu7.width = 256;
117
118 myMenu0.add(new WebFXMenuItem("Discounts", null, "Discount reports", myMenu7 ));
119 var myMenu8 = new WebFXMenu;
120 myMenu8.emptyText = '';
121 myMenu8.add(new WebFXMenuItem("Payments", "http://localhost/freeside/search/report_cust_pay.html", "Payment report (by type and/or date range)" ));
122 myMenu8.add(new WebFXMenuItem("Payment application detail", "http://localhost/freeside/search/report_cust_bill_pay_pkg.html", "Line item application detail" ));
123 myMenu8.add(new WebFXMenuItem("Pending Payments", "http://localhost/freeside/search/cust_pay_pending.html?magic=_date;statusNOT=done", "Pending real-time payments" ));
124 myMenu8.add(new WebFXMenuItem("Unapplied Payments", "http://localhost/freeside/search/report_cust_pay.html?unapplied=1", "Unapplied payment report (by type and/or date range)" ));
125 myMenu8.add(new WebFXMenuItem("Voided Payments", "http://localhost/freeside/search/report_cust_pay.html?void=1", "Voided payment report (by type and/or date range)" ));
126 myMenu8.add(new WebFXMenuItem("Unapplied Payment Aging", "http://localhost/freeside/search/report_unapplied_cust_pay.html", "Unapplied payment aging report" ));
127 myMenu8.width = 256;
128
129 myMenu0.add(new WebFXMenuItem("Payments", null, "Payment reports", myMenu8 ));
130 var myMenu9 = new WebFXMenu;
131 myMenu9.emptyText = '';
132 myMenu9.add(new WebFXMenuItem("Package definitions (by # active)", "http://localhost/freeside/browse/part_pkg.cgi?active=1", "Package definitions by number of active packages" ));
133 myMenu9.add(new WebFXMenuItem("Package costs", "http://localhost/freeside/graph/report_cust_pkg_cost.html", "Package setup and recurring costs graph" ));
134 myMenu9.add(new WebFXMenuSeparator());
135 myMenu9.add(new WebFXMenuItem("Package churn", "http://localhost/freeside/graph/report_cust_pkg.html", "Orders, suspensions and cancellations summary graph" ));
136 myMenu9.add(new WebFXMenuSeparator());
137 myMenu9.add(new WebFXMenuItem("All customer packages", "http://localhost/freeside/search/cust_pkg.cgi?pkgnum", "List all customer packages" ));
138 myMenu9.add(new WebFXMenuItem("Package summary", "http://localhost/freeside/search/cust_pkg_summary.html", "Show package sales summary" ));
139 myMenu9.add(new WebFXMenuItem("Suspended customer packages", "http://localhost/freeside/search/cust_pkg.cgi?magic=suspended", "List suspended packages" ));
140 myMenu9.add(new WebFXMenuItem("Suspension summary", "http://localhost/freeside/search/cust_pkg_susp.html", "Show suspension activity" ));
141 myMenu9.add(new WebFXMenuItem("Customer packages with unconfigured services", "http://localhost/freeside/search/cust_pkg.cgi?APKG_pkgnum", "List packages which have provisionable services" ));
142 myMenu9.add(new WebFXMenuItem("Advanced package reports", "http://localhost/freeside/search/report_cust_pkg.html", "by agent, date range, status, package definition" ));
143 myMenu9.width = 256;
144
145 myMenu0.add(new WebFXMenuItem("Packages", null, "Package reports", myMenu9 ));
146 var myMenu10 = new WebFXMenu;
147 myMenu10.emptyText = '';
148 myMenu10.add(new WebFXMenuItem("Service definitions", "http://localhost/freeside/browse/part_svc.cgi?orderby=active", "Service definitions by number of active packages" ));
149 myMenu10.add(new WebFXMenuSeparator());
150 myMenu10.add(new WebFXMenuItem("Unprovisioned services", "http://localhost/freeside/search/report_unprovisioned_services.html", "Unprovisioned services" ));
151 myMenu10.add(new WebFXMenuSeparator());
152 var myMenu11 = new WebFXMenu;
153 myMenu11.emptyText = '';
154 myMenu11.add(new WebFXMenuItem("All accounts by Username", "http://localhost/freeside/search/svc_acct.cgi?magic=all;sortby=username", "" ));
155 myMenu11.add(new WebFXMenuItem("All accounts by UID", "http://localhost/freeside/search/svc_acct.cgi?magic=all;sortby=uid", "" ));
156 myMenu11.add(new WebFXMenuItem("All accounts with Time Remaining", "http://localhost/freeside/search/svc_acct.cgi?magic=all;sortby=seconds", "" ));
157 myMenu11.add(new WebFXMenuItem("All accounts by Last login", "http://localhost/freeside/search/svc_acct.cgi?magic=all;sortby=last_login", "" ));
158 myMenu11.add(new WebFXMenuItem("All accounts never logged in", "http://localhost/freeside/search/svc_acct.cgi?magic=nologin;sortby=svcnum", "" ));
159 myMenu11.add(new WebFXMenuItem("Advanced account reports", "http://localhost/freeside/search/report_svc_acct.html", "" ));
160 myMenu11.width = 256;
161
162 myMenu10.add(new WebFXMenuItem("Accounts", null, "Access accounts and mailboxes", myMenu11 ));
163 var myMenu12 = new WebFXMenu;
164 myMenu12.emptyText = '';
165 myMenu12.add(new WebFXMenuItem("All domains", "http://localhost/freeside/search/svc_domain.cgi?magic=all;sortby=domain", "" ));
166 myMenu12.width = 256;
167
168 myMenu10.add(new WebFXMenuItem("Domains", null, "Domains", myMenu12 ));
169 var myMenu13 = new WebFXMenu;
170 myMenu13.emptyText = '';
171 myMenu13.add(new WebFXMenuItem("All certificates", "http://localhost/freeside/search/cust_svc.html?svcdb=svc_cert;magic=all;sortby=svcnum", "" ));
172 myMenu13.width = 256;
173
174 myMenu10.add(new WebFXMenuItem("Certificates", null, "Example services", myMenu13 ));
175 var myMenu14 = new WebFXMenu;
176 myMenu14.emptyText = '';
177 myMenu14.add(new WebFXMenuItem("All mail forwards", "http://localhost/freeside/search/svc_forward.cgi?magic=all;sortby=svcnum", "" ));
178 myMenu14.width = 256;
179
180 myMenu10.add(new WebFXMenuItem("Mail forwards", null, "Mail forwards", myMenu14 ));
181 var myMenu15 = new WebFXMenu;
182 myMenu15.emptyText = '';
183 myMenu15.add(new WebFXMenuItem("All mailing lists", "http://localhost/freeside/search/cust_svc.html?svcdb=svc_mailinglist;magic=all;sortby=svcnum", "" ));
184 myMenu15.width = 256;
185
186 myMenu10.add(new WebFXMenuItem("Mailing lists", null, "Mailing lists", myMenu15 ));
187 var myMenu16 = new WebFXMenu;
188 myMenu16.emptyText = '';
189 myMenu16.add(new WebFXMenuItem("All virtual hosting services", "http://localhost/freeside/search/svc_www.cgi?magic=all;sortby=svcnum", "" ));
190 myMenu16.width = 256;
191
192 myMenu10.add(new WebFXMenuItem("Virtual hosting services", null, "Virtual hosting services", myMenu16 ));
193 var myMenu17 = new WebFXMenu;
194 myMenu17.emptyText = '';
195 myMenu17.add(new WebFXMenuItem("All wireless broadband services", "http://localhost/freeside/search/svc_broadband.cgi?magic=all;sortby=svcnum", "" ));
196 myMenu17.add(new WebFXMenuItem("Advanced wireless broadband reports", "http://localhost/freeside/search/report_svc_broadband.html", "" ));
197 myMenu17.width = 256;
198
199 myMenu10.add(new WebFXMenuItem("Wireless broadband services", null, "Fixed wireless broadband services", myMenu17 ));
200 var myMenu18 = new WebFXMenu;
201 myMenu18.emptyText = '';
202 myMenu18.add(new WebFXMenuItem("All cable subscribers by Service", "http://localhost/freeside/search/cust_svc.html?svcdb=svc_cable;magic=all;sortby=svcnum", "" ));
203 myMenu18.add(new WebFXMenuItem("All cable subscribers by Serial number", "http://localhost/freeside/search/cust_svc.html?svcdb=svc_cable;magic=all;sortby=serialnum", "" ));
204 myMenu18.add(new WebFXMenuItem("All cable subscribers by MAC address", "http://localhost/freeside/search/cust_svc.html?svcdb=svc_cable;magic=all;sortby=mac_addr", "" ));
205 myMenu18.width = 256;
206
207 myMenu10.add(new WebFXMenuItem("Cable Subscribers", null, "Cable Subscribers", myMenu18 ));
208 var myMenu19 = new WebFXMenu;
209 myMenu19.emptyText = '';
210 myMenu19.add(new WebFXMenuItem("All DSLs", "http://localhost/freeside/search/cust_svc.html?svcdb=svc_dsl;magic=all;sortby=phonenum", "" ));
211 myMenu19.add(new WebFXMenuItem("Qualifications", "http://localhost/freeside/search/qual.cgi", "" ));
212 myMenu19.width = 256;
213
214 myMenu10.add(new WebFXMenuItem("DSLs", null, "DSLs", myMenu19 ));
215 var myMenu20 = new WebFXMenu;
216 myMenu20.emptyText = '';
217 myMenu20.add(new WebFXMenuItem("All dish services", "http://localhost/freeside/search/svc_dish.cgi?magic=all;sortby=svcnum", "" ));
218 myMenu20.width = 256;
219
220 myMenu10.add(new WebFXMenuItem("Dish services", null, "Dish services", myMenu20 ));
221 var myMenu21 = new WebFXMenu;
222 myMenu21.emptyText = '';
223 myMenu21.add(new WebFXMenuItem("All hardware", "http://localhost/freeside/search/svc_hardware.cgi?magic=all;sortby=svcnum", "" ));
224 myMenu21.add(new WebFXMenuItem("Advanced hardware reports", "http://localhost/freeside/search/report_svc_hardware.html", "" ));
225 myMenu21.width = 256;
226
227 myMenu10.add(new WebFXMenuItem("Hardware", null, "Hardware", myMenu21 ));
228 var myMenu22 = new WebFXMenu;
229 myMenu22.emptyText = '';
230 myMenu22.add(new WebFXMenuItem("All phone numbers", "http://localhost/freeside/search/svc_phone.cgi?magic=all;sortby=phonenum", "" ));
231 myMenu22.add(new WebFXMenuItem("Phone numbers' total usage by time period", "http://localhost/freeside/search/report_svc_phone_usage.html", "Total usage (minutes, and amount billed) for the specified time period, per phone number." ));
232 myMenu22.add(new WebFXMenuItem("Phone numbers by state", "http://localhost/freeside/search/phone_state.html", "Current or historical phone services broken down by state." ));
233 myMenu22.add(new WebFXMenuItem("Advanced phone number reports", "http://localhost/freeside/search/report_svc_phone.html", "" ));
234 myMenu22.add(new WebFXMenuItem("Phone number (DID) availability", "http://localhost/freeside/search/report_phone_avail.html", "" ));
235 myMenu22.add(new WebFXMenuItem("Inventory/Provisioning Status", "http://localhost/freeside/search/phone_inventory_provisioned.html", "" ));
236 myMenu22.width = 256;
237
238 myMenu10.add(new WebFXMenuItem("Phone numbers", null, "Phone numbers", myMenu22 ));
239 var myMenu23 = new WebFXMenu;
240 myMenu23.emptyText = '';
241 myMenu23.add(new WebFXMenuItem("All PBXs", "http://localhost/freeside/search/cust_svc.html?svcdb=svc_pbx;magic=all;sortby=svcnum", "" ));
242 myMenu23.width = 256;
243
244 myMenu10.add(new WebFXMenuItem("PBXs", null, "PBXs", myMenu23 ));
245 var myMenu24 = new WebFXMenu;
246 myMenu24.emptyText = '';
247 myMenu24.add(new WebFXMenuItem("All circuits", "http://localhost/freeside/search/svc_circuit.cgi?magic=all;sortby=svcnum", "" ));
248 myMenu24.width = 256;
249
250 myMenu10.add(new WebFXMenuItem("Circuits", null, "Voice and data circuit services", myMenu24 ));
251 var myMenu25 = new WebFXMenu;
252 myMenu25.emptyText = '';
253 myMenu25.add(new WebFXMenuItem("All ports", "http://localhost/freeside/search/cust_svc.html?svcdb=svc_port;magic=all;sortby=serviceid", "" ));
254 myMenu25.width = 256;
255
256 myMenu10.add(new WebFXMenuItem("Ports", null, "Ports", myMenu25 ));
257 var myMenu26 = new WebFXMenu;
258 myMenu26.emptyText = '';
259 myMenu26.add(new WebFXMenuItem("All alarm services", "http://localhost/freeside/search/cust_svc.html?svcdb=svc_alarm;magic=all;sortby=acctnum", "" ));
260 myMenu26.width = 256;
261
262 myMenu10.add(new WebFXMenuItem("Alarm services", null, "Alarm services", myMenu26 ));
263 var myMenu27 = new WebFXMenu;
264 myMenu27.emptyText = '';
265 myMenu27.add(new WebFXMenuItem("All external services", "http://localhost/freeside/search/svc_external.cgi?magic=all;sortby=id", "" ));
266 myMenu27.width = 256;
267
268 myMenu10.add(new WebFXMenuItem("External services", null, "External services", myMenu27 ));
269 myMenu10.width = 256;
270
271 myMenu0.add(new WebFXMenuItem("Services", null, "Services reports", myMenu10 ));
272 var myMenu28 = new WebFXMenu;
273 myMenu28.emptyText = '';
274 myMenu28.add(new WebFXMenuItem("Inventory by agent", "http://localhost/freeside/search/report_agent_inventory.html", "" ));
275 myMenu28.add(new WebFXMenuItem("Inventory activity", "http://localhost/freeside/search/report_h_inventory_item.html", "" ));
276 myMenu28.width = 256;
277
278 myMenu0.add(new WebFXMenuItem("Inventory", null, "Inventory reports", myMenu28 ));
279 var myMenu29 = new WebFXMenu;
280 myMenu29.emptyText = '';
281 myMenu29.add(new WebFXMenuItem("RADIUS sessions", "http://localhost/freeside/search/sqlradius.html", "" ));
282 myMenu29.add(new WebFXMenuItem("RADIUS data usage", "http://localhost/freeside/search/report_sqlradius_usage.html", "" ));
283 myMenu29.add(new WebFXMenuItem("Call Detail Records (CDRs)", "http://localhost/freeside/search/report_cdr.html", "" ));
284 myMenu29.add(new WebFXMenuItem("Unrateable CDRs", "http://localhost/freeside/search/cdr.html?freesidestatus=failed;cdrbatchnum=_ALL_", "" ));
285 myMenu29.width = 256;
286
287 myMenu0.add(new WebFXMenuItem("Usage", null, "Usage reports", myMenu29 ));
288 var myMenu30 = new WebFXMenu;
289 myMenu30.emptyText = '';
290 var myMenu31 = new WebFXMenu;
291 myMenu31.emptyText = '';
292 myMenu31.add(new WebFXMenuItem("Tickets per day per Queue", "http://localhost/freeside/rt/RTx/Statistics/CallsQueueDay", "View the number of tickets created, resolved or deleted in a specific Queue, over the requested period of days" ));
293 myMenu31.add(new WebFXMenuItem("Ticket status by Queue", "http://localhost/freeside/rt/RTx/Statistics/OpenStalled", "View numbers of new, open and stalled tickets in a selected Queue" ));
294 myMenu31.add(new WebFXMenuItem("Tickets per day (multiple Queues)", "http://localhost/freeside/rt/RTx/Statistics/CallsMultiQueue", "View tickets created, resolved or deleted on in one or more Queues over a specified time period" ));
295 myMenu31.add(new WebFXMenuItem("Tickets per Day of Week", "http://localhost/freeside/rt/RTx/Statistics/DayOfWeek", "View trends showing when tickets are created, resolved or deleted" ));
296 myMenu31.add(new WebFXMenuItem("Time to resolve", "http://localhost/freeside/rt/RTx/Statistics/Resolution", "View how long tickets take to be resolved by Queue" ));
297 myMenu31.add(new WebFXMenuItem("Time to resolve (scatter graph)", "http://localhost/freeside/rt/RTx/Statistics/TimeToResolve", "View a detailed scatter graph of time to resolve tickets by Queue" ));
298 myMenu31.width = 256;
299
300 myMenu30.add(new WebFXMenuItem("Statistics", null, "", myMenu31 ));
301 myMenu30.add(new WebFXMenuSeparator());
302 myMenu30.add(new WebFXMenuItem("Advanced ticket reports", "http://localhost/freeside/rt/Search/Build.html?NewQuery=1", "List tickets by any criteria" ));
303 myMenu30.width = 256;
304
305 myMenu0.add(new WebFXMenuItem("Tickets", null, "Ticket reports", myMenu30 ));
306 var myMenu32 = new WebFXMenu;
307 myMenu32.emptyText = '';
308 myMenu32.add(new WebFXMenuItem("Employee Commission Report", "http://localhost/freeside/search/report_employee_commission.html", "" ));
309 myMenu32.add(new WebFXMenuItem("Employee Audit Report", "http://localhost/freeside/search/report_employee_audit.html", "Employee audit report" ));
310 myMenu32.width = 256;
311
312 myMenu0.add(new WebFXMenuItem("Employees", null, "Employee reports", myMenu32 ));
313 var myMenu33 = new WebFXMenu;
314 myMenu33.emptyText = '';
315 myMenu33.add(new WebFXMenuItem("All billing events", "http://localhost/freeside/search/report_cust_event.html", "All billing events for a date range" ));
316 myMenu33.add(new WebFXMenuItem("Billing event errors", "http://localhost/freeside/search/report_cust_event.html?failed=1", "Failed credit cards, processor or printer problems, etc." ));
317 myMenu33.width = 256;
318
319 myMenu0.add(new WebFXMenuItem("Billing events", null, "Billing events", myMenu33 ));
320 var myMenu34 = new WebFXMenu;
321 myMenu34.emptyText = '';
322 var myMenu35 = new WebFXMenu;
323 myMenu35.emptyText = '';
324 myMenu35.add(new WebFXMenuItem("Sales, Credits and Receipts", "http://localhost/freeside/graph/report_money_time.html", "Sales, credits and receipts summary graph" ));
325 myMenu35.add(new WebFXMenuItem("Daily Sales, Credits and Receipts", "http://localhost/freeside/graph/report_money_time_daily.html", "Sales, credits and receipts (broken down by day) summary graph" ));
326 myMenu35.add(new WebFXMenuItem("Sales Report", "http://localhost/freeside/graph/report_cust_bill_pkg.html", "Sales report and graph (by agent, package class and/or date range)" ));
327 myMenu35.add(new WebFXMenuItem("Rated Call Sales Report", "http://localhost/freeside/graph/report_cust_bill_pkg_detail.html", "Sales report and graph (by agent, package class, usage class and/or date range)" ));
328 myMenu35.add(new WebFXMenuItem("Sales with Advertising Source", "http://localhost/freeside/search/report_cust_bill_pkg_referral.html", "" ));
329 myMenu35.width = 256;
330
331 myMenu34.add(new WebFXMenuItem("Sales", null, "Sales reports", myMenu35 ));
332 var myMenu36 = new WebFXMenu;
333 myMenu36.emptyText = '';
334 myMenu36.add(new WebFXMenuItem("Credit Report", "http://localhost/freeside/search/report_cust_credit.html", "Credit report (by employee and/or date range)" ));
335 myMenu36.add(new WebFXMenuItem("Credit application detail", "http://localhost/freeside/search/report_cust_credit_bill_pkg.html", "Line item application detail" ));
336 myMenu36.add(new WebFXMenuItem("Unapplied Credits", "http://localhost/freeside/search/report_cust_credit.html?unapplied=1", "Unapplied credit report (by type and/or date range)" ));
337 myMenu36.add(new WebFXMenuItem("Voided Credits", "http://localhost/freeside/search/report_cust_credit_void.html", "Voided credit report (by employee and/or date range)" ));
338 myMenu36.width = 256;
339
340 myMenu34.add(new WebFXMenuItem("Credits", null, "Credit reports", myMenu36 ));
341 var myMenu37 = new WebFXMenu;
342 myMenu37.emptyText = '';
343 myMenu37.add(new WebFXMenuItem("Refund Report", "http://localhost/freeside/search/report_cust_refund.html", "Refund report (by type and/or date range)" ));
344 myMenu37.add(new WebFXMenuItem("Unapplied Refunds", "http://localhost/freeside/search/report_cust_refund.html?unapplied=1", "Unapplied refund report (by type and/or date range)" ));
345 myMenu37.width = 256;
346
347 myMenu34.add(new WebFXMenuItem("Refunds", null, "Refund reports", myMenu37 ));
348 var myMenu38 = new WebFXMenu;
349 myMenu38.emptyText = '';
350 myMenu38.add(new WebFXMenuItem("Agent Commissions", "http://localhost/freeside/search/report_agent_commission.html", "" ));
351 myMenu38.add(new WebFXMenuItem("Agent Commissions Per Package", "http://localhost/freeside/search/report_agent_commission_pkg.html", "" ));
352 myMenu38.add(new WebFXMenuItem("Sales Person Commissions", "http://localhost/freeside/search/report_sales_commission.html", "" ));
353 myMenu38.add(new WebFXMenuItem("Sales Person Commissions Per Package", "http://localhost/freeside/search/report_sales_commission_pkg.html", "" ));
354 myMenu38.add(new WebFXMenuItem("Employee Commissions", "http://localhost/freeside/search/report_employee_commission.html", "" ));
355 myMenu38.width = 256;
356
357 myMenu34.add(new WebFXMenuItem("Commissions", null, "Commission reports", myMenu38 ));
358 myMenu34.add(new WebFXMenuItem("A/R Aging", "http://localhost/freeside/search/report_receivables.html", "Accounts Receivable Aging report" ));
359 myMenu34.add(new WebFXMenuItem("Prepaid Income", "http://localhost/freeside/search/report_prepaid_income.html", "Prepaid income (unearned revenue)  report" ));
360 myMenu34.add(new WebFXMenuItem("Tax Liability", "http://localhost/freeside/search/report_tax.html", "Tax liability report (internal tax data)" ));
361 myMenu34.add(new WebFXMenuItem("E911 Fee Summary", "http://localhost/freeside/search/report_e911.html", "E911 fee summary" ));
362 myMenu34.add(new WebFXMenuItem("Customer Accounting Summary", "http://localhost/freeside/search/report_customer_accounting_summary.html", "Customer accounting summary report" ));
363 myMenu34.width = 256;
364
365 myMenu0.add(new WebFXMenuItem("Financial", null, "Financial reports", myMenu34 ));
366 var myMenu39 = new WebFXMenu;
367 myMenu39.emptyText = '';
368 myMenu39.add(new WebFXMenuItem("Credit limit incidents", "http://localhost/freeside/search/report_cust_main_credit_limit.html", "" ));
369 myMenu39.add(new WebFXMenuItem("System log", "http://localhost/freeside/search/log.html", "View system events and debugging information." ));
370 myMenu39.add(new WebFXMenuItem("Outgoing messages", "http://localhost/freeside/search/cust_msg.html", "View outgoing message log" ));
371 myMenu39.width = 256;
372
373 myMenu0.add(new WebFXMenuItem("Logs", null, "System and email logs", myMenu39 ));
374 myMenu0.width = 256;
375
376           myBar.add(new WebFXMenuButton('Reports', null, 'Lists, reporting and graphing', myMenu0 ));
377
378
379           var myMenu40 = new WebFXMenu;
380 myMenu40.emptyText = '';
381 myMenu40.add(new WebFXMenuItem("Quick payment entry", "http://localhost/freeside/misc/batch-cust_pay.html", "Enter multiple payments in a batch" ));
382 myMenu40.add(new WebFXMenuItem("Download invoice batches", "http://localhost/freeside/search/bill_batch.cgi", "" ));
383 myMenu40.add(new WebFXMenuItem("Bulk DID Orders", "http://localhost/freeside/browse/did_order.html", "View/manage bulk DID orders" ));
384 myMenu40.add(new WebFXMenuItem("Job Queue", "http://localhost/freeside/search/queue.html", "View pending job queue" ));
385 var myMenu41 = new WebFXMenu;
386 myMenu41.emptyText = '';
387 var myMenu42 = new WebFXMenu;
388 myMenu42.emptyText = '';
389 myMenu42.add(new WebFXMenuItem("Overview", "http://localhost/freeside/rt/Articles/index.html", "" ));
390 myMenu42.add(new WebFXMenuItem("Search", "http://localhost/freeside/rt/Articles/Article/Search.html", "" ));
391 myMenu42.add(new WebFXMenuItem("Topics", "http://localhost/freeside/rt/Articles/Topics.html", "" ));
392 myMenu42.width = 256;
393
394 myMenu41.add(new WebFXMenuItem("Articles", null, "", myMenu42 ));
395 myMenu41.add(new WebFXMenuItem("My Day", "http://localhost/freeside/rt/Tools/MyDay.html", "" ));
396 myMenu41.add(new WebFXMenuItem("My Reminders", "http://localhost/freeside/rt/Tools/MyReminders.html", "" ));
397 myMenu41.add(new WebFXMenuItem("Offline", "http://localhost/freeside/rt/Tools/Offline.html", "" ));
398 myMenu41.add(new WebFXMenuItem("Approval", "http://localhost/freeside/rt/Approvals/", "" ));
399 myMenu41.width = 256;
400
401 myMenu40.add(new WebFXMenuItem("Ticketing", null, "Ticketing tools", myMenu41 ));
402 myMenu40.add(new WebFXMenuItem("Customer email settings", "http://localhost/freeside/misc/manage_cust_email.html", "" ));
403 myMenu40.add(new WebFXMenuItem("Business card scan", "http://localhost/freeside/edit/prospect_main-upload.html", "" ));
404 myMenu40.add(new WebFXMenuItem("Attachments", "http://localhost/freeside/browse/cust_attachment.html", "View customer attachments" ));
405 var myMenu43 = new WebFXMenu;
406 myMenu43.emptyText = '';
407 myMenu43.add(new WebFXMenuItem("Customers", "http://localhost/freeside/misc/cust_main-import.cgi", "" ));
408 myMenu43.add(new WebFXMenuItem("Package definitions", "http://localhost/freeside/misc/part_pkg-import.html", "" ));
409 myMenu43.add(new WebFXMenuItem("Customer packages", "http://localhost/freeside/misc/cust_pkg-import.html", "" ));
410 myMenu43.add(new WebFXMenuItem("Customer comments", "http://localhost/freeside/misc/cust_main_note-import.html", "" ));
411 myMenu43.add(new WebFXMenuItem("One-time charges", "http://localhost/freeside/misc/cust_main-import_charges.cgi", "" ));
412 myMenu43.add(new WebFXMenuItem("Payments", "http://localhost/freeside/misc/cust_pay-import.cgi", "" ));
413 myMenu43.add(new WebFXMenuItem("Credits", "http://localhost/freeside/misc/cust_credit-import.html", "" ));
414 myMenu43.add(new WebFXMenuItem("Phone numbers (DIDs)", "http://localhost/freeside/misc/phone_avail-import.html", "" ));
415 myMenu43.add(new WebFXMenuItem("Call Detail Records (CDRs)", "http://localhost/freeside/misc/cdr-import.html", "" ));
416 myMenu43.width = 256;
417
418 myMenu40.add(new WebFXMenuItem("Importing", null, "Import tools", myMenu43 ));
419 var myMenu44 = new WebFXMenu;
420 myMenu44.emptyText = '';
421 myMenu44.add(new WebFXMenuItem("Download database dump", "http://localhost/freeside/misc/dump.cgi", "" ));
422 myMenu44.width = 256;
423
424 myMenu40.add(new WebFXMenuItem("Exporting", null, "Export tools", myMenu44 ));
425 myMenu40.add(new WebFXMenuItem("Status", "http://localhost/freeside/view/Status.html", "System status" ));
426 myMenu40.width = 256;
427
428           myBar.add(new WebFXMenuButton('Tools', null, 'Tools', myMenu40 ));
429
430
431           var myMenu45 = new WebFXMenu;
432 myMenu45.emptyText = '';
433 myMenu45.add(new WebFXMenuItem("Settings", "http://localhost/freeside/config/config-view.cgi", "" ));
434 myMenu45.add(new WebFXMenuSeparator());
435 var myMenu46 = new WebFXMenu;
436 myMenu46.emptyText = '';
437 myMenu46.add(new WebFXMenuItem("Agent types", "http://localhost/freeside/browse/agent_type.cgi", "Agent types define groups of package definitions that you can then assign to particular agents" ));
438 myMenu46.add(new WebFXMenuItem("Agents", "http://localhost/freeside/browse/agent.cgi", "Agents are resellers of your service. Agents may be limited to a subset of your full offerings (via their type)" ));
439 myMenu46.add(new WebFXMenuItem("Agent payment gateways", "http://localhost/freeside/browse/payment_gateway.html", "Credit card and electronic check processors for agent overrides" ));
440 myMenu46.width = 256;
441
442 myMenu45.add(new WebFXMenuItem("Companies", null, "", myMenu46 ));
443 var myMenu47 = new WebFXMenu;
444 myMenu47.emptyText = '';
445 myMenu47.add(new WebFXMenuItem("Sales People", "http://localhost/freeside/browse/sales.html", "Sales people bring in new business." ));
446 myMenu47.width = 256;
447
448 myMenu45.add(new WebFXMenuItem("Sales People", null, "", myMenu47 ));
449 var myMenu48 = new WebFXMenu;
450 myMenu48.emptyText = '';
451 myMenu48.add(new WebFXMenuItem("Employees", "http://localhost/freeside/browse/access_user.html", "Setup internal users" ));
452 myMenu48.add(new WebFXMenuItem("Employee groups", "http://localhost/freeside/browse/access_group.html", "Employee groups allow you to control access to the backend" ));
453 myMenu48.add(new WebFXMenuItem("Installer availability", "http://localhost/freeside/browse/sched_item.html", "Installer availability" ));
454 myMenu48.width = 256;
455
456 myMenu45.add(new WebFXMenuItem("Employees", null, "", myMenu48 ));
457 myMenu45.add(new WebFXMenuSeparator());
458 var myMenu49 = new WebFXMenu;
459 myMenu49.emptyText = '';
460 myMenu49.add(new WebFXMenuItem("Customer tags", "http://localhost/freeside/browse/part_tag.html", "" ));
461 myMenu49.add(new WebFXMenuItem("Customer classes", "http://localhost/freeside/browse/cust_class.html", "Customer classes define groups of customers for reporting." ));
462 myMenu49.add(new WebFXMenuItem("Customer categories", "http://localhost/freeside/browse/cust_category.html", "Customer categories define groups of customer classes." ));
463 myMenu49.add(new WebFXMenuSeparator());
464 myMenu49.add(new WebFXMenuItem("Contact types", "http://localhost/freeside/browse/contact_class.html", "" ));
465 myMenu49.width = 256;
466
467 myMenu45.add(new WebFXMenuItem("Customers", null, "", myMenu49 ));
468 var myMenu50 = new WebFXMenu;
469 myMenu50.emptyText = '';
470 myMenu50.add(new WebFXMenuItem("Package definitions", "http://localhost/freeside/browse/part_pkg.cgi", "One or more services are grouped together into a package and given pricing information. Customers purchase packages, not services" ));
471 myMenu50.add(new WebFXMenuItem("Package classes", "http://localhost/freeside/browse/pkg_class.html", "Package classes define groups of packages, for taxation, ordering convenience and reporting." ));
472 myMenu50.add(new WebFXMenuItem("Package categories", "http://localhost/freeside/browse/pkg_category.html", "Package categories define groups of package classes, for invoice sections." ));
473 myMenu50.add(new WebFXMenuItem("Package report classes", "http://localhost/freeside/browse/part_pkg_report_option.html", "Package classes define optional groups of packages for reporting only." ));
474 myMenu50.add(new WebFXMenuItem("Fees", "http://localhost/freeside/browse/part_fee.html", "" ));
475 myMenu50.add(new WebFXMenuItem("Discounts", "http://localhost/freeside/browse/discount.html", "" ));
476 myMenu50.add(new WebFXMenuItem("Discount classes", "http://localhost/freeside/browse/discount_class.html", "" ));
477 var myMenu51 = new WebFXMenu;
478 myMenu51.emptyText = '';
479 myMenu51.add(new WebFXMenuItem("Cancel reasons", "http://localhost/freeside/browse/reason.html?class=C", "Cancel reasons explain why a service was cancelled." ));
480 myMenu51.add(new WebFXMenuItem("Cancel reason types", "http://localhost/freeside/browse/reason_type.html?class=C", "Cancel reason types define groups of reasons." ));
481 myMenu51.add(new WebFXMenuItem("Suspend reasons", "http://localhost/freeside/browse/reason.html?class=S", "Suspend reasons explain why a service was suspended." ));
482 myMenu51.add(new WebFXMenuItem("Suspend reason types", "http://localhost/freeside/browse/reason_type.html?class=S", "Suspend reason types define groups of reasons." ));
483 myMenu51.width = 256;
484
485 myMenu50.add(new WebFXMenuItem("Cancel/Suspend Reasons", null, "", myMenu51 ));
486 myMenu50.width = 256;
487
488 myMenu45.add(new WebFXMenuItem("Packages", null, "", myMenu50 ));
489 var myMenu52 = new WebFXMenu;
490 myMenu52.emptyText = '';
491 myMenu52.add(new WebFXMenuItem("Service definitions", "http://localhost/freeside/browse/part_svc.cgi", "Services are items you offer to your customers" ));
492 myMenu52.add(new WebFXMenuItem("Service classes", "http://localhost/freeside/browse/part_svc_class.html", "Services classes are user-defined, informational types for services" ));
493 myMenu52.add(new WebFXMenuItem("Provisioning exports", "http://localhost/freeside/browse/part_export.cgi", "Provisioning services to external machines, databases and APIs" ));
494 var myMenu53 = new WebFXMenu;
495 myMenu53.emptyText = '';
496 myMenu53.add(new WebFXMenuItem("Access numbers", "http://localhost/freeside/browse/svc_acct_pop.cgi", "Points of Presence" ));
497 myMenu53.width = 256;
498
499 myMenu52.add(new WebFXMenuItem("Dialup", null, "", myMenu53 ));
500 var myMenu54 = new WebFXMenu;
501 myMenu54.emptyText = '';
502 myMenu54.add(new WebFXMenuItem("Towers", "http://localhost/freeside/browse/tower.html", "Towers and sectors" ));
503 myMenu54.add(new WebFXMenuItem("Routers", "http://localhost/freeside/browse/router.cgi", "Broadband access routers" ));
504 myMenu54.add(new WebFXMenuItem("Address blocks", "http://localhost/freeside/browse/addr_block.cgi", "Manage address blocks and block assignments to broadband routers" ));
505 myMenu54.add(new WebFXMenuItem("Address ranges", "http://localhost/freeside/browse/addr_range.html", "Designate special address ranges" ));
506 myMenu54.width = 256;
507
508 myMenu52.add(new WebFXMenuItem("Wireless broadband", null, "", myMenu54 ));
509 var myMenu55 = new WebFXMenu;
510 myMenu55.emptyText = '';
511 myMenu55.add(new WebFXMenuItem("View/Edit phone device types", "http://localhost/freeside/browse/part_device.html", "Phone device types" ));
512 myMenu55.add(new WebFXMenuItem("View/Edit bulk DID vendors", "http://localhost/freeside/browse/did_vendor.html", "Bulk DID vendors" ));
513 myMenu55.add(new WebFXMenuItem("View/Edit Carriers", "http://localhost/freeside/browse/cdr_carrier.html", "Carriers" ));
514 myMenu55.width = 256;
515
516 myMenu52.add(new WebFXMenuItem("Phone", null, "", myMenu55 ));
517 var myMenu56 = new WebFXMenu;
518 myMenu56.emptyText = '';
519 myMenu56.add(new WebFXMenuItem("RADIUS Groups", "http://localhost/freeside/browse/radius_group.html", "Manage RADIUS groups" ));
520 myMenu56.add(new WebFXMenuItem("RADIUS Clients", "http://localhost/freeside/browse/nas.html", "Manage RADIUS clients" ));
521 myMenu56.width = 256;
522
523 myMenu52.add(new WebFXMenuItem("RADIUS", null, "", myMenu56 ));
524 var myMenu57 = new WebFXMenu;
525 myMenu57.emptyText = '';
526 myMenu57.add(new WebFXMenuItem("Cable providers", "http://localhost/freeside/browse/cable_provider.html", "" ));
527 myMenu57.add(new WebFXMenuItem("Cable modem models", "http://localhost/freeside/browse/cable_model.html", "" ));
528 myMenu57.width = 256;
529
530 myMenu52.add(new WebFXMenuItem("Cable", null, "", myMenu57 ));
531 var myMenu58 = new WebFXMenu;
532 myMenu58.emptyText = '';
533 myMenu58.add(new WebFXMenuItem("Alarm system vendors", "http://localhost/freeside/browse/alarm_system.html", "" ));
534 myMenu58.add(new WebFXMenuItem("Alarm system types", "http://localhost/freeside/browse/alarm_type.html", "" ));
535 myMenu58.add(new WebFXMenuItem("Alarm central stations", "http://localhost/freeside/browse/alarm_station.html", "" ));
536 myMenu58.width = 256;
537
538 myMenu52.add(new WebFXMenuItem("Alarm", null, "", myMenu58 ));
539 var myMenu59 = new WebFXMenu;
540 myMenu59.emptyText = '';
541 myMenu59.add(new WebFXMenuItem("Circuit types", "http://localhost/freeside/browse/circuit_type.html", "" ));
542 myMenu59.add(new WebFXMenuItem("Circuit providers", "http://localhost/freeside/browse/circuit_provider.html", "" ));
543 myMenu59.add(new WebFXMenuItem("Termination types", "http://localhost/freeside/browse/circuit_termination.html", "" ));
544 myMenu59.width = 256;
545
546 myMenu52.add(new WebFXMenuItem("Circuits", null, "", myMenu59 ));
547 myMenu52.add(new WebFXMenuItem("Hardware types", "http://localhost/freeside/browse/hardware_class.html", "Set up hardware type catalog" ));
548 myMenu52.width = 256;
549
550 myMenu45.add(new WebFXMenuItem("Services", null, "", myMenu52 ));
551 myMenu45.add(new WebFXMenuSeparator());
552 var myMenu60 = new WebFXMenu;
553 myMenu60.emptyText = '';
554 myMenu60.add(new WebFXMenuItem("Billing events", "http://localhost/freeside/browse/part_event.html", "Billing actions for customers, invoices and packages" ));
555 myMenu60.add(new WebFXMenuItem("Invoice configurations", "http://localhost/freeside/browse/invoice_conf.html", "Adjust invoice settings for special-purpose notices" ));
556 myMenu60.add(new WebFXMenuItem("Invoice templates", "http://localhost/freeside/browse/invoice_template.html", "Edit templates for HTML, plaintext and typeset invoices" ));
557 myMenu60.add(new WebFXMenuItem("Prepaid cards", "http://localhost/freeside/search/prepay_credit.html", "View outstanding cards, generate new cards" ));
558 var myMenu61 = new WebFXMenu;
559 myMenu61.emptyText = '';
560 myMenu61.add(new WebFXMenuItem("Rate plans", "http://localhost/freeside/browse/rate.cgi", "Manage rate plans" ));
561 myMenu61.add(new WebFXMenuItem("Regions and prefixes", "http://localhost/freeside/browse/rate_region.html", "Manage regions and prefixes" ));
562 myMenu61.add(new WebFXMenuItem("Usage classes", "http://localhost/freeside/browse/usage_class.html", "Usage classes define groups of usage for taxation." ));
563 myMenu61.add(new WebFXMenuItem("Time periods", "http://localhost/freeside/browse/rate_time.html", "Time periods define days and hours for rate plans" ));
564 myMenu61.add(new WebFXMenuItem("Edit rates with Excel", "http://localhost/freeside/misc/rate_edit_excel.html", "Download and edit rates with Excel, then upload changes." ));
565 myMenu61.add(new WebFXMenuSeparator());
566 myMenu61.add(new WebFXMenuItem("Tiering plans", "http://localhost/freeside/browse/rate_tier.html", "Rating tiers" ));
567 myMenu61.width = 256;
568
569 myMenu60.add(new WebFXMenuItem("Call rates and regions", null, "Manage rate plans, regions and prefixes for VoIP and call billing", myMenu61 ));
570 myMenu60.add(new WebFXMenuItem("Locales and tax rates", "http://localhost/freeside/browse/cust_main_county.cgi", "Change tax rates, or break down a country into states, or a state into counties and assign different tax rates to each" ));
571 myMenu60.add(new WebFXMenuItem("Tax classes", "http://localhost/freeside/browse/part_pkg_taxclass.html", "Tax classes" ));
572 myMenu60.add(new WebFXMenuItem("Credit reasons", "http://localhost/freeside/browse/reason.html?class=R", "Credit reasons explain why a credit was issued." ));
573 myMenu60.add(new WebFXMenuItem("Credit reason types", "http://localhost/freeside/browse/reason_type.html?class=R", "Credit reason types define groups of reasons." ));
574 myMenu60.width = 256;
575
576 myMenu45.add(new WebFXMenuItem("Billing", null, "", myMenu60 ));
577 myMenu45.add(new WebFXMenuSeparator());
578 var myMenu62 = new WebFXMenu;
579 myMenu62.emptyText = '';
580 myMenu62.add(new WebFXMenuItem("Message templates", "http://localhost/freeside/browse/msg_template.html", "Templates for customer notices" ));
581 myMenu62.add(new WebFXMenuItem("Advertising sources", "http://localhost/freeside/browse/part_referral.html", "Where a customer heard about your service." ));
582 myMenu62.add(new WebFXMenuItem("Custom fields", "http://localhost/freeside/browse/part_virtual_field.html", "Locally defined fields" ));
583 myMenu62.add(new WebFXMenuItem("Translation strings", "http://localhost/freeside/browse/msgcat.html", "Translations and other customizable labels for each locale" ));
584 myMenu62.add(new WebFXMenuItem("Inventory classes and inventory", "http://localhost/freeside/browse/inventory_class.html", "Setup inventory classes and stock inventory" ));
585 myMenu62.add(new WebFXMenuItem("Upload targets", "http://localhost/freeside/browse/upload_target.html", "Billing and payment upload destinations" ));
586 myMenu62.width = 256;
587
588 myMenu45.add(new WebFXMenuItem("Miscellaneous", null, "", myMenu62 ));
589 myMenu45.width = 256;
590
591           myBar.add(new WebFXMenuButton('Configuration', null, 'Configuration and setup', myMenu45 ));
592
593
594           var myMenu63 = new WebFXMenu;
595 myMenu63.emptyText = '';
596 myMenu63.add(new WebFXMenuItem("Billing documentation", "http://www.freeside.biz/mediawiki/index.php/Freeside:3:Documentation", "Freeside documentation" ));
597 myMenu63.add(new WebFXMenuItem("Ticketing documentation", "http://wiki.bestpractical.com/", "Request Tracker Wiki" ));
598 myMenu63.add(new WebFXMenuSeparator());
599 myMenu63.add(new WebFXMenuItem("About Freeside v3.8git", "javascript:about_freeside()", "" ));
600 myMenu63.add(new WebFXMenuItem("About RT v4.0.23", "http://www.bestpractical.com/rt", "Request Tracker Homepage" ));
601 myMenu63.width = 256;
602
603           myBar.add(new WebFXMenuButton('Help', null, '', myMenu63 ));
604
605
606   myBar.show( null, 'vertical' );
607   myBar.width = 154;
608
609 </SCRIPT>
610
611
612
613
614       <SCRIPT TYPE="text/javascript" SRC="http://localhost/freeside/elements/overlibmws.js"></SCRIPT>
615   <SCRIPT TYPE="text/javascript" SRC="http://localhost/freeside/elements/overlibmws_iframe.js"></SCRIPT>
616   <SCRIPT TYPE="text/javascript" SRC="http://localhost/freeside/elements/overlibmws_draggable.js"></SCRIPT>
617   <SCRIPT TYPE="text/javascript" SRC="http://localhost/freeside/elements/overlibmws_crossframe.js"></SCRIPT>
618   <SCRIPT TYPE="text/javascript" SRC="http://localhost/freeside/elements/iframecontentmws.js"></SCRIPT>
619   <SCRIPT TYPE="text/javascript" SRC="http://localhost/freeside/elements/ajaxcontentmws.js"></SCRIPT>
620
621     <SCRIPT TYPE="text/javascript">
622
623   function rs_init_object() {
624     var A;
625     try {
626       A=new ActiveXObject("Msxml2.XMLHTTP");
627     } catch (e) {
628       try {
629         A=new ActiveXObject("Microsoft.XMLHTTP");
630       } catch (oc) {
631         A=null;
632       }
633     }
634     if(!A && typeof XMLHttpRequest != "undefined")
635       A = new XMLHttpRequest();
636     if (!A)
637       alert("Can't create XMLHttpRequest object");
638     return A;
639
640   }
641
642 </SCRIPT>
643
644     <SCRIPT TYPE="text/javascript">
645
646   function logout() {
647     // count args; build URL
648     var url = "http://localhost/freeside/loginout/logout.html";
649
650     var xmlhttp = rs_init_object();
651     xmlhttp.open("GET", url, false, "magic", "notyet");
652     xmlhttp.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
653     xmlhttp.send(null);
654
655     if (xmlhttp.readyState != 4) {
656       alert("Logout failed: readyState is " + xmlhttp.readyState);
657       return;
658     }
659
660     if (xmlhttp.status != 200) {
661       alert("Logout failed: status is " + xmlhttp.status);
662     } else {
663       var data = xmlhttp.responseText;
664       // alert('received response: ' + data);
665       if ( data.indexOf("<b>System error</b>") > -1 ) {
666         var w;
667         if ( w = window.open("about:blank") ) {
668           w.document.write(data);
669         } else {
670           // popup blocking?  should use an overlib popup instead 
671           alert("Error popup disabled; try disabling popup blocking to see");
672         }
673       } else {
674         window.location = "http://localhost/freeside/loginout/logout.html";
675       }
676     }
677   }
678
679 </SCRIPT>
680
681
682     
683
684   </HEAD>
685   <BODY BGCOLOR="#f8f8f8"  onUnload="myclose()" STYLE="margin-top:0; margin-bottom:0; margin-left:0px; margin-right:0px">
686     <table width="100%" CELLPADDING=0 CELLSPACING=0 STYLE="padding-left:0px; padding-right:4px" CLASS="fshead">
687       <tr>
688         <td BGCOLOR="#ffffff"><IMG BORDER=0 ALT="freeside" HEIGHT="36" SRC="http://localhost/freeside/view/REAL_logo.cgi"></td>
689         <td align=left BGCOLOR="#ffffff"> <!-- valign="top" -->
690           <font size=6>Freeside Test 3.8.1</font>
691         </td>
692         <td align=right valign=top BGCOLOR="#ffffff"><FONT SIZE="-1">Logged in as <b>test&nbsp;</b> <FONT SIZE="-2"><a href="javascript:void(0);" onClick="logout();">logout</a></FONT><br></FONT><FONT SIZE="-2"><a href="http://localhost/freeside/pref/pref.html" STYLE="color: #000000">Preferences</a>
693           <BR></FONT>
694         </td>
695       </tr>
696     </table>
697
698     <TABLE WIDTH="100%" CELLSPACING=0 CELLPADDING=0>
699
700 <link href="http://localhost/freeside/elements/freeside-menu.css" type="text/css" rel="stylesheet">
701
702
703       <TR CLASS="fsmenubar">
704
705
706         <TD COLSPAN="7" WIDTH="100%" STYLE="padding:1px 0px 0px 0px;border-top: 1px solid #7e0079" BGCOLOR="#cccccc">
707           <SCRIPT TYPE="text/javascript">
708             document.write(myBar);
709           </SCRIPT>
710         </TD>
711
712       </TR>
713
714       <TR CLASS="fssearchbar">
715
716         <TD COLSPAN=1 BGCOLOR="#cccccc" ALIGN="right" STYLE="padding-left:2px">
717           
718   <FORM ACTION="http://localhost/freeside/search/prospect_main.html" METHOD="GET" STYLE="margin:0">
719     <INPUT NAME="search_prospect" TYPE="text" VALUE="(name, company or phone)" STYLE="width:155px" onFocus="clearhint_search_prospect(this);" onClick="clearhint_search_prospect(this);" CLASS="fstext"><BR>
720     <A HREF="http://localhost/freeside/search/report_prospect_main.html" CLASS="fslink" STYLE="font-size: 11px">Adv</A>
721     <INPUT TYPE="submit" VALUE="Search prospects" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:11px;padding-left:1px;padding-right:1px">
722   </FORM>
723   
724
725
726 <SCRIPT TYPE="text/javascript">
727
728   function clearhint_search_prospect (what) {
729     if ( what.value == '(name, company or phone)' )
730       what.value = '';
731   }
732
733 </SCRIPT>
734
735         </TD>
736
737         <TD COLSPAN=1 BGCOLOR="#cccccc" ALIGN="right" STYLE="padding-left:2px">
738           
739   <FORM ACTION="http://localhost/freeside/search/cust_main.cgi" METHOD="POST" STYLE="margin:0">
740     <INPUT NAME="search_cust" TYPE="text" VALUE="(cust #, name, company or contact phone)" STYLE="width:246px" onFocus="clearhint_search_cust(this);" onClick="clearhint_search_cust(this);" CLASS="fstext"><BR>
741     <A HREF="http://localhost/freeside/search/report_cust_main.html" CLASS="fslink" STYLE="font-size: 11px">Advanced</A>
742     <INPUT TYPE="submit" VALUE="Search customers" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:11px">
743   </FORM>
744   
745
746
747 <SCRIPT TYPE="text/javascript">
748
749   function clearhint_search_cust (what) {
750     if ( what.value == '(cust #, name, company or contact phone)' )
751       what.value = '';
752   }
753
754 </SCRIPT>
755
756         </TD>
757
758         <TD COLSPAN=1 BGCOLOR="#cccccc" ALIGN="center">
759           
760 <SCRIPT TYPE="text/javascript">
761
762   function clearhint_search_address2 (what) {
763     if ( what.value == '(Unit #)' )
764       what.value = '';
765   }
766
767 </SCRIPT>
768
769         </TD>
770
771         <TD COLSPAN=1 BGCOLOR="#cccccc" ALIGN="right">
772           
773   <FORM ACTION="http://localhost/freeside/search/cust_bill.html" METHOD="GET" STYLE="margin:0;display:inline">
774     <INPUT NAME="invnum" TYPE="text" VALUE="(inv #)" STYLE="width:56px" onFocus="clearhint_search_invoice(this);" onClick="clearhint_search_invoice(this);" CLASS="fstext">
775     <A HREF="http://localhost/freeside/search/report_cust_bill.html" CLASS="fslink" STYLE="font-size: 11px">Adv</A>    <BR>
776     <INPUT TYPE="submit" VALUE="Search invoices" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:11px;padding-left:1px;padding-right:1px;margin-top:3px">
777   </FORM>
778   
779
780
781 <SCRIPT TYPE="text/javascript">
782
783   function clearhint_search_invoice (what) {
784     if ( what.value == '(inv #)' )
785       what.value = '';
786   }
787
788 </SCRIPT>
789
790         </TD>
791
792         <TD COLSPAN=1 BGCOLOR="#cccccc" ALIGN="right" STYLE="padding-left:2px">
793           
794   <FORM ACTION="http://localhost/freeside/search/cust_svc.html" METHOD="GET" STYLE="margin:0">
795     <INPUT NAME="search_svc" TYPE="text" VALUE="(user, email, ip, mac, domain or service phone)" STYLE="width:271px" onFocus="clearhint_search_svc(this);" onClick="clearhint_search_svc(this);" CLASS="fstext"><BR>
796     <A NOTYET="http://localhost/freeside/search/svc_Smarter.html" STYLE="color: #cccccc; font-size:11px">Advanced</A>
797     <INPUT TYPE="submit" VALUE="Search services" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:11px">
798   </FORM>
799   
800
801
802 <SCRIPT TYPE="text/javascript">
803
804   function clearhint_search_svc (what) {
805     if ( what.value == '(user, email, ip, mac, domain or service phone)' )
806       what.value = '';
807   }
808
809 </SCRIPT>
810
811         </TD>
812
813         <TD COLSPAN=1 BGCOLOR="#cccccc" ALIGN="right" STYLE="padding-left:2px;padding-right:2px">
814           
815   <FORM ACTION="http://localhost/freeside//rt/index.html" METHOD="GET" STYLE="margin:0">
816     <INPUT NAME="q" TYPE="text" VALUE="(ticket #, subject, email or fulltext:text)" STYLE="width:223px" onFocus="clearhint_search_ticket(this);" onClick="clearhint_search_ticket(this);" CLASS="fstext"><BR>
817     <A HREF="http://localhost/freeside//rt/Search/Build.html?NewQuery=1" CLASS="fslink" STYLE="font-size:11px">Advanced</A>
818     <INPUT TYPE="submit" VALUE="Search tickets" CLASS="fsblackbutton" onMouseOver="this.className='fsblackbuttonselected'; return true;" onMouseOut="this.className='fsblackbutton'; return true;" STYLE="font-size:11px">
819   </FORM>
820   
821
822
823 <SCRIPT TYPE="text/javascript">
824
825   function clearhint_search_ticket (what) {
826     if ( what.value == '(ticket #, subject, email or fulltext:text)' )
827       what.value = '';
828   }
829
830 </SCRIPT>
831
832         </TD>
833
834       </TR>
835     </TABLE>
836
837
838
839     <TABLE WIDTH="100%" HEIGHT="100%" CELLSPACING=0 CELLPADDING=4>
840
841       <TR HEIGHT="100%">
842
843         <TD CLASS="background" HEIGHT="100%" VALIGN="top"> <!-- WIDTH="100%"> -->
844
845           <FONT SIZE=6>
846             Edit Customer: Olson Inc (Towne, Samara)
847           </FONT>
848
849           <BR><BR>
850
851           
852
853
854
855
856 <FORM NAME   = "CustomerForm"
857       METHOD = "POST"
858       ACTION = "http://localhost/freeside/edit/process/cust_main.cgi"
859 >
860
861 <INPUT TYPE="hidden" NAME="custnum"     VALUE="135">
862 <INPUT TYPE="hidden" NAME="prospectnum" VALUE="">
863
864   Customer #<B>135</B> - 
865   <B><FONT COLOR="#00CC00">
866     Active
867   </FONT></B>
868   <BR><BR>
869
870 <FONT CLASS="fsinnerbox-title">Basics</FONT>
871 <TABLE CLASS="fsinnerbox">
872
873 <TR>
874   <TD ALIGN="right">Residential</TD>
875   <TD><INPUT TYPE     = "radio"
876              NAME     = "residential_commercial"
877              ID       = "residential_commercial_Residential"
878              VALUE    = "Residential"
879              onChange = "rescom_changed(this)"
880        
881   ></TD>
882 </TR>
883 <TR>
884   <TD ALIGN="right">Commercial</TD>
885   <TD><INPUT TYPE     = "radio"
886              NAME     = "residential_commercial"
887              ID       = "residential_commercial_Commercial"
888              VALUE    = "Commercial"
889              onChange = "rescom_changed(this)"
890        CHECKED
891   ></TD>
892 </TR>
893
894 <SCRIPT TYPE="text/javascript">
895
896   function rescom_changed(what) {
897     if ( what.checked == (what.value == 'Commercial' ) ) {
898       document.getElementById('company_row').style.display = '';
899       document.getElementById('contacts_div').style.display = '';
900       document.getElementById('spouse_row').style.display = 'none';
901     } else {
902       if ( document.getElementById('company').value.length == 0 ) {
903         document.getElementById('company_row').style.display = 'none';
904       }
905       document.getElementById('contacts_div').style.display = 'none';
906       document.getElementById('spouse_row').style.display = '';
907     }
908   }
909
910
911   var ship_locked_agents = {};
912   var ship_fields = [
913     'locationname', 'address1', 'city', 'state', 'zip', 'country', 
914     'latitude', 'longitude', 'district'
915   ];
916
917   function agent_changed(what) {
918     var agentnum = what.value;
919
920
921     var f = what.form;
922     if ( ship_locked_agents[agentnum] ) {
923       for(var x in ship_locked_agents[agentnum]) {
924         f['ship_'+x].value = ship_locked_agents[agentnum][x];
925         f['ship_'+x].disabled = true;
926       }
927       f['same'].checked = false;
928       f['same'].disabled = true;
929     } else {
930       for(var i=0; i<ship_fields.length; i++) {
931         x = ship_fields[i];
932         if ( f['ship_'+x].disabled )  {
933           f['ship_'+x].value  = f['old_ship_'+x].value;
934         }
935         f['ship_'+x].disabled = false;
936       }
937       f['same'].disabled = false;
938     }
939     samechanged(f['same']);
940
941     salesnum_agentnum_changed(what);
942
943   }
944
945   (function() {
946   var myonload = function() {
947
948   rescom_changed(document.getElementById('residential_commercial_Residential'));
949   agent_changed(document.getElementById('agentnum'))
950   
951   }
952   if ( window.addEventListener ) {
953     window.addEventListener('load', myonload);
954   } else if ( window.attachEvent ) {
955     window.attachEvent('onload', myonload);
956   }
957 })();
958
959  
960 </SCRIPT>
961
962
963
964
965
966
967
968   
969   <INPUT TYPE  = "hidden"
970          NAME  = "agentnum"
971          ID    = "agentnum"
972          VALUE = "1"
973   >
974
975       <TR>
976       </TR>
977
978
979
980
981
982     <INPUT TYPE="hidden" NAME="agent_custid" VALUE="">
983
984
985
986   <INPUT TYPE="hidden" NAME="classnum" VALUE="">
987
988
989
990
991
992   <INPUT TYPE  = "hidden"
993          NAME  = "salesnum"
994          ID    = "salesnum"
995          VALUE = ""
996   >
997
998       <TR>
999       </TR>
1000
1001 <SCRIPT TYPE="text/javascript">
1002
1003   function rs_init_object() {
1004     var A;
1005     try {
1006       A=new ActiveXObject("Msxml2.XMLHTTP");
1007     } catch (e) {
1008       try {
1009         A=new ActiveXObject("Microsoft.XMLHTTP");
1010       } catch (oc) {
1011         A=null;
1012       }
1013     }
1014     if(!A && typeof XMLHttpRequest != "undefined")
1015       A = new XMLHttpRequest();
1016     if (!A)
1017       alert("Can't create XMLHttpRequest object");
1018     return A;
1019
1020   }
1021
1022 </SCRIPT>
1023
1024
1025 <SCRIPT TYPE="text/javascript">
1026
1027
1028     function get_sales() {
1029         // count args; build URL
1030         var url = "http://localhost/freeside/misc/sales.cgi?";
1031         var a = get_sales.arguments;
1032
1033         var args;
1034         var len;
1035         var content = 'sub=get_sales';
1036         if ( a && typeof a  == 'object'  && a[0].constructor == Array ) {
1037             args = a[0];
1038             len = args.length
1039         } else {
1040             args = a;
1041             len = args.length - 1;
1042         }
1043         for (var i = 0; i < len; i++) 
1044             content = content + "&arg=" + escape(args[i]);
1045         content = content.replace( /[+]/g, '%2B'); // fix unescaped plus signs 
1046
1047         if ( 'GET' == 'GET' ) {
1048           url = url + content;
1049         }
1050
1051         //alert('GET ' + url);
1052
1053         var xmlhttp = rs_init_object();
1054         xmlhttp.open("GET", url, true);
1055
1056         xmlhttp.onreadystatechange = function() {
1057             if (xmlhttp.readyState != 4) 
1058                 return;
1059
1060             if (xmlhttp.status != 200) {
1061               if ( xmlhttp.status != 0 ) {
1062                 //not warning on the 0 errors, they pop up when navagating away
1063                 // from the page
1064                 alert(xmlhttp.status + " status connecting to " + url);
1065               }
1066             } else {
1067               var data = xmlhttp.responseText;
1068               //alert('received response: ' + data);
1069               if ( data.indexOf("<b>System error</b>") > -1 ) {
1070                 // trim this a little
1071                 var end = data.indexOf('<a href="#raw">') - 1;
1072                 data = data.substring(0, end);
1073
1074                 overlib(data,
1075                   WIDTH, 480, MIDX, 0, MIDY, 0,
1076                   CAPTION, 'Error', STICKY, AUTOSTATUSCAP, DRAGGABLE,
1077                   CLOSECLICK, BGCOLOR, '#f00', CGCOLOR, '#f00'
1078                 );
1079                 //var w;
1080                 //if ( w = window.open("about:blank") ) {
1081                 //  w.document.write(data);
1082                 //} else {
1083                 //  // popup blocking?  should use an overlib popup instead 
1084                 //  alert("Error popup disabled; try disabling popup blocking to see");
1085                 //}
1086               } else {
1087                 // invoke the callback
1088                 a[a.length-1](data);
1089               }
1090             }
1091         }
1092
1093         if ( 'GET' == 'POST' ) {
1094
1095           xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
1096           xmlhttp.send(content);
1097
1098         } else {
1099
1100           xmlhttp.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
1101           xmlhttp.send(null);
1102
1103         }
1104
1105         //rs_debug("x_$func_name url = " + url);
1106         //rs_debug("x_$func_name waiting..");
1107     }
1108
1109
1110 </SCRIPT>
1111
1112 <SCRIPT TYPE="text/javascript">
1113
1114
1115   function salesnum_opt(what, value, text) {
1116     var optionName = new Option(text, value, false, false);
1117     var length = what.length;
1118     what.options[length] = optionName;
1119   }
1120
1121   function salesnum_agentnum_changed(what) {
1122     what.form.salesnum.disabled = 'disabled'; //disable sales dropdown
1123
1124     if ( what.type == 'hidden' ) { 
1125       agentnum = what.value;
1126     } else {
1127       agentnum = what.options[what.selectedIndex].value;
1128     }
1129
1130     function update_salesnum(sales) {
1131
1132       if ( what.form.salesnum.type == 'hidden' ) {
1133         what.form.salesnum.disabled = ''; //re-enable sales dropdown
1134         return;
1135       }
1136
1137       // save the current salesnum
1138       var salesnum = what.form.salesnum.value;
1139
1140       // blank the current sales people
1141       for ( var i = what.form.salesnum.length; i>= 0; i-- )
1142         what.form.salesnum.options[i] = null;
1143
1144       // add the new sales people
1145
1146
1147         salesnum_opt( what.form.salesnum,
1148                           '',
1149                           '(none)'
1150                         );
1151
1152       var salesArray = eval('(' + sales + ')' );
1153       for ( var s = 0; s < salesArray.length; s=s+2 ) {
1154         //surely this should be some kind of JSON structure
1155         var salesLabel  = salesArray[s+1];
1156         salesnum_opt( what.form.salesnum, salesArray[s], salesLabel );
1157       }
1158
1159       what.form.salesnum.disabled = ''; //re-enable sales dropdown
1160
1161       //restore salesnum if possible
1162       what.form.salesnum.value = salesnum;
1163
1164     }
1165
1166     get_sales( agentnum,
1167                update_salesnum
1168              );
1169   }
1170
1171   (function() {
1172   var myonload = function() {
1173
1174     salesnum_agentnum_changed(document.getElementById('agentnum'));
1175   
1176   }
1177   if ( window.addEventListener ) {
1178     window.addEventListener('load', myonload);
1179   } else if ( window.attachEvent ) {
1180     window.attachEvent('onload', myonload);
1181   }
1182 })();
1183
1184
1185 </SCRIPT>
1186
1187
1188
1189
1190   <INPUT TYPE="hidden" NAME="refnum" VALUE="1">
1191
1192
1193
1194
1195   <TR>
1196     <TD ALIGN="right">Referring customer</TD>
1197     <TD>
1198       <INPUT TYPE="hidden" NAME="referral_custnum" ID="referral_custnum" VALUE="">
1199
1200 <!-- some false laziness w/ misc/batch-cust_pay.html, though not as bad as i'd thought at first... -->
1201
1202 <INPUT TYPE = "text"
1203        NAME = "referral_custnum_search"
1204        ID   = "referral_custnum_search"
1205        SIZE = "32"
1206        VALUE="(cust #, name or company)"
1207        onFocus="clearhint_referral_custnum_search(this);"
1208        onClick="clearhint_referral_custnum_search(this);"
1209        onChange="smart_referral_custnum_search(this);"
1210 >
1211
1212
1213 <SELECT NAME="referral_custnum_select" ID="referral_custnum_select" STYLE="color:#ff0000; display:none" onChange="select_referral_custnum(this);">
1214 </SELECT>
1215
1216 <SCRIPT TYPE="text/javascript">
1217
1218   function rs_init_object() {
1219     var A;
1220     try {
1221       A=new ActiveXObject("Msxml2.XMLHTTP");
1222     } catch (e) {
1223       try {
1224         A=new ActiveXObject("Microsoft.XMLHTTP");
1225       } catch (oc) {
1226         A=null;
1227       }
1228     }
1229     if(!A && typeof XMLHttpRequest != "undefined")
1230       A = new XMLHttpRequest();
1231     if (!A)
1232       alert("Can't create XMLHttpRequest object");
1233     return A;
1234
1235   }
1236
1237 </SCRIPT>
1238
1239
1240 <SCRIPT TYPE="text/javascript">
1241
1242
1243     function smart_search() {
1244         // count args; build URL
1245         var url = "http://localhost/freeside/misc/xmlhttp-cust_main-search.cgi?";
1246         var a = smart_search.arguments;
1247
1248         var args;
1249         var len;
1250         var content = 'sub=smart_search';
1251         if ( a && typeof a  == 'object'  && a[0].constructor == Array ) {
1252             args = a[0];
1253             len = args.length
1254         } else {
1255             args = a;
1256             len = args.length - 1;
1257         }
1258         for (var i = 0; i < len; i++) 
1259             content = content + "&arg=" + escape(args[i]);
1260         content = content.replace( /[+]/g, '%2B'); // fix unescaped plus signs 
1261
1262         if ( 'GET' == 'GET' ) {
1263           url = url + content;
1264         }
1265
1266         //alert('GET ' + url);
1267
1268         var xmlhttp = rs_init_object();
1269         xmlhttp.open("GET", url, true);
1270
1271         xmlhttp.onreadystatechange = function() {
1272             if (xmlhttp.readyState != 4) 
1273                 return;
1274
1275             if (xmlhttp.status != 200) {
1276               if ( xmlhttp.status != 0 ) {
1277                 //not warning on the 0 errors, they pop up when navagating away
1278                 // from the page
1279                 alert(xmlhttp.status + " status connecting to " + url);
1280               }
1281             } else {
1282               var data = xmlhttp.responseText;
1283               //alert('received response: ' + data);
1284               if ( data.indexOf("<b>System error</b>") > -1 ) {
1285                 // trim this a little
1286                 var end = data.indexOf('<a href="#raw">') - 1;
1287                 data = data.substring(0, end);
1288
1289                 overlib(data,
1290                   WIDTH, 480, MIDX, 0, MIDY, 0,
1291                   CAPTION, 'Error', STICKY, AUTOSTATUSCAP, DRAGGABLE,
1292                   CLOSECLICK, BGCOLOR, '#f00', CGCOLOR, '#f00'
1293                 );
1294                 //var w;
1295                 //if ( w = window.open("about:blank") ) {
1296                 //  w.document.write(data);
1297                 //} else {
1298                 //  // popup blocking?  should use an overlib popup instead 
1299                 //  alert("Error popup disabled; try disabling popup blocking to see");
1300                 //}
1301               } else {
1302                 // invoke the callback
1303                 a[a.length-1](data);
1304               }
1305             }
1306         }
1307
1308         if ( 'GET' == 'POST' ) {
1309
1310           xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
1311           xmlhttp.send(content);
1312
1313         } else {
1314
1315           xmlhttp.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
1316           xmlhttp.send(null);
1317
1318         }
1319
1320         //rs_debug("x_$func_name url = " + url);
1321         //rs_debug("x_$func_name waiting..");
1322     }
1323
1324
1325 </SCRIPT>
1326
1327
1328 <SCRIPT TYPE="text/javascript">
1329
1330   function clearhint_referral_custnum_search (what) {
1331
1332     what.style.color = '#000000';
1333
1334     if ( what.value == '(cust #, name or company)' )
1335       what.value = '';
1336
1337     if ( what.value.indexOf('Customer not found: ') == 0 )
1338       what.value = what.value.substr(20);
1339
1340   }
1341
1342   var referral_custnum_search_active = false;
1343
1344   function smart_referral_custnum_search(what) {
1345
1346     if ( referral_custnum_search_active )
1347       return;
1348
1349     var customer = what.value;
1350
1351     if ( customer == 'searching...' || customer == ''
1352          || customer.indexOf('Customer not found: ') == 0 )
1353       return;
1354
1355     if ( what.getAttribute('magic') == 'nosearch' ) {
1356       what.setAttribute('magic', '');
1357       return;
1358     }
1359
1360     //what.value = 'searching...'
1361     what.disabled = true;
1362     what.style.color= '#000000';
1363     what.style.backgroundColor = '#dddddd';
1364
1365     var customer_select = document.getElementById('referral_custnum_select');
1366
1367     //alert("search for customer " + customer);
1368
1369     function referral_custnum_search_update(customers) {
1370
1371       //alert('customers returned: ' + customers);
1372
1373       var customerArray = eval('(' + customers + ')');
1374
1375       what.disabled = false;
1376       what.style.backgroundColor = '#ffffff';
1377
1378       if ( customerArray.length == 0 ) {
1379
1380         what.form.referral_custnum.value = '';
1381
1382         what.value = 'Customer not found: ' + what.value;
1383         what.style.color = '#ff0000';
1384
1385         what.style.display = '';
1386         customer_select.style.display = 'none';
1387
1388       } else if ( customerArray.length == 1 ) {
1389
1390         //alert('one customer found: ' + customerArray[0]);
1391
1392         what.form.referral_custnum.value = customerArray[0][0];
1393         what.value = customerArray[0][1];
1394
1395         what.style.display = '';
1396         customer_select.style.display = 'none';
1397
1398       } else {
1399
1400         //alert('multiple customers found, have to create select dropdown');
1401
1402         //blank the current list
1403         for ( var i = customer_select.length; i >= 0; i-- )
1404           customer_select.options[i] = null;
1405
1406         opt(customer_select, '', 'Multiple customers match "' + customer + '" - select one', '#ff0000');
1407
1408         //add the multiple customers
1409         for ( var s = 0; s < customerArray.length; s++ )
1410           opt(customer_select, customerArray[s][0], customerArray[s][1], '#000000');
1411
1412         opt(customer_select, 'cancel', '(Edit search string)', '#000000');
1413
1414         what.style.display = 'none';
1415         customer_select.style.display = '';
1416
1417       }
1418
1419       referral_custnum_search_active = false;
1420
1421     }
1422
1423     referral_custnum_search_active = true;
1424
1425     smart_search( customer, referral_custnum_search_update );
1426
1427
1428   }
1429
1430   function select_referral_custnum (what) {
1431
1432     var custnum = what.options[what.selectedIndex].value;
1433     var customer = what.options[what.selectedIndex].text;
1434
1435     var customer_obj = document.getElementById('referral_custnum_search');
1436
1437     if ( custnum == '' ) {
1438       //what.style.color = '#ff0000';
1439
1440     } else if ( custnum == 'cancel' ) {
1441
1442       customer_obj.style.color = '#000000';
1443
1444       what.style.display = 'none';
1445       customer_obj.style.display = '';
1446       customer_obj.focus();
1447
1448     } else {
1449     
1450       what.form.referral_custnum.value = custnum;
1451
1452       customer_obj.value = customer;
1453       customer_obj.style.color = '#000000';
1454
1455       what.style.display = 'none';
1456       customer_obj.style.display = '';
1457
1458     }
1459
1460   }
1461
1462   function opt(what,value,text,color) {
1463     var optionName = new Option(text, value, false, false);
1464     optionName.style.color = color;
1465     var length = what.length;
1466     what.options[length] = optionName;
1467   }
1468
1469 </SCRIPT>
1470
1471     </TD>
1472   </TR>
1473
1474
1475
1476   <INPUT TYPE="hidden" NAME="edit_subject" VALUE="">
1477
1478   <INPUT TYPE="hidden" NAME="calling_list_exempt" VALUE="">
1479
1480 </TABLE>
1481
1482
1483
1484 <BR>
1485 <TABLE> <TR>
1486   <TD STYLE="width:650px">
1487     <FONT CLASS="fsinnerbox-title">Billing address</FONT>
1488     <TABLE CLASS="fsinnerbox" WIDTH="100%">
1489     
1490 <TR>
1491   <TD CLASS="required label">Contact name</TD>
1492   <TD COLSPAN=6 STYLE="vertical-align:top">
1493         
1494 <DIV STYLE="display: inline-block">
1495   <INPUT TYPE="text" NAME="last" VALUE="Towne" ,>
1496   <BR><FONT SIZE=-1>Last</FONT>
1497 </DIV>
1498
1499         
1500 <DIV STYLE="display: inline-block">
1501   <INPUT TYPE="text" NAME="first" VALUE="Samara" >
1502   <BR><FONT SIZE=-1>First</FONT>
1503 </DIV>
1504
1505         <INPUT TYPE="hidden" NAME="ss" VALUE="">
1506   </TD>
1507 </TR>
1508
1509
1510   <TR ID="company_row" >
1511   <TD ALIGN="right">Company</TD>
1512   <TD COLSPAN=6><INPUT TYPE="text" NAME="company" ID="company" SIZE=60
1513              VALUE="Olson Inc">
1514   </TD>
1515 </TR>
1516
1517
1518     
1519
1520     <INPUT TYPE  = "hidden"
1521        NAME  = "bill_locationname"
1522        ID    = "bill_locationname"
1523        VALUE = ""
1524 >
1525
1526
1527
1528
1529 <TR>
1530   <TH STYLE="width:16ex" ALIGN="right"><font color="#ff0000">*</font>&nbsp;Address</TH>
1531   <TD COLSPAN=7>
1532     <INPUT TYPE     = "text"
1533            NAME     = "bill_address1"
1534            ID       = "bill_address1"
1535            VALUE    = "46706 Kadin Hill #780"
1536            SIZE     = 54
1537            onChange = ""
1538            
1539            
1540     >
1541   </TD>
1542 </TR>
1543
1544
1545 <TR>
1546       <TD ALIGN="right"><FONT ID="bill_address2_required" color="#ff0000" STYLE="visibility:hidden">*</FONT>&nbsp;<FONT ID="bill_address2_label" STYLE="visibility:hidden"><B>Unit&nbsp;#</B></FONT></TD>
1547       <TD COLSPAN=7>
1548         <INPUT TYPE     = "text"
1549                NAME     = "bill_address2"
1550                ID       = "bill_address2"
1551                VALUE    = "Trailer W 2-E"
1552                SIZE     = 54
1553                onChange = ""
1554                
1555                
1556         >
1557       </TD>
1558 </TR>
1559
1560
1561
1562 <TR>
1563   <TH ALIGN="right">
1564   <font color="#ff0000">*</font>&nbsp;City
1565   </TH>
1566   <TD WIDTH="1">
1567
1568
1569 <SCRIPT TYPE="text/javascript">
1570
1571   function rs_init_object() {
1572     var A;
1573     try {
1574       A=new ActiveXObject("Msxml2.XMLHTTP");
1575     } catch (e) {
1576       try {
1577         A=new ActiveXObject("Microsoft.XMLHTTP");
1578       } catch (oc) {
1579         A=null;
1580       }
1581     }
1582     if(!A && typeof XMLHttpRequest != "undefined")
1583       A = new XMLHttpRequest();
1584     if (!A)
1585       alert("Can't create XMLHttpRequest object");
1586     return A;
1587
1588   }
1589
1590 </SCRIPT>
1591
1592
1593 <SCRIPT TYPE="text/javascript">
1594
1595
1596     function bill_get_cities() {
1597         // count args; build URL
1598         var url = "http://localhost/freeside/misc/cities.cgi?";
1599         var a = bill_get_cities.arguments;
1600
1601         var args;
1602         var len;
1603         var content = 'sub=bill_get_cities';
1604         if ( a && typeof a  == 'object'  && a[0].constructor == Array ) {
1605             args = a[0];
1606             len = args.length
1607         } else {
1608             args = a;
1609             len = args.length - 1;
1610         }
1611         for (var i = 0; i < len; i++) 
1612             content = content + "&arg=" + escape(args[i]);
1613         content = content.replace( /[+]/g, '%2B'); // fix unescaped plus signs 
1614
1615         if ( 'GET' == 'GET' ) {
1616           url = url + content;
1617         }
1618
1619         //alert('GET ' + url);
1620
1621         var xmlhttp = rs_init_object();
1622         xmlhttp.open("GET", url, true);
1623
1624         xmlhttp.onreadystatechange = function() {
1625             if (xmlhttp.readyState != 4) 
1626                 return;
1627
1628             if (xmlhttp.status != 200) {
1629               if ( xmlhttp.status != 0 ) {
1630                 //not warning on the 0 errors, they pop up when navagating away
1631                 // from the page
1632                 alert(xmlhttp.status + " status connecting to " + url);
1633               }
1634             } else {
1635               var data = xmlhttp.responseText;
1636               //alert('received response: ' + data);
1637               if ( data.indexOf("<b>System error</b>") > -1 ) {
1638                 // trim this a little
1639                 var end = data.indexOf('<a href="#raw">') - 1;
1640                 data = data.substring(0, end);
1641
1642                 overlib(data,
1643                   WIDTH, 480, MIDX, 0, MIDY, 0,
1644                   CAPTION, 'Error', STICKY, AUTOSTATUSCAP, DRAGGABLE,
1645                   CLOSECLICK, BGCOLOR, '#f00', CGCOLOR, '#f00'
1646                 );
1647                 //var w;
1648                 //if ( w = window.open("about:blank") ) {
1649                 //  w.document.write(data);
1650                 //} else {
1651                 //  // popup blocking?  should use an overlib popup instead 
1652                 //  alert("Error popup disabled; try disabling popup blocking to see");
1653                 //}
1654               } else {
1655                 // invoke the callback
1656                 a[a.length-1](data);
1657               }
1658             }
1659         }
1660
1661         if ( 'GET' == 'POST' ) {
1662
1663           xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
1664           xmlhttp.send(content);
1665
1666         } else {
1667
1668           xmlhttp.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
1669           xmlhttp.send(null);
1670
1671         }
1672
1673         //rs_debug("x_$func_name url = " + url);
1674         //rs_debug("x_$func_name waiting..");
1675     }
1676
1677
1678 </SCRIPT>
1679
1680
1681 <SCRIPT TYPE="text/javascript">
1682
1683   function opt(what,value,text) {
1684     var optionName = new Option(text, value, false, false);
1685     var length = what.length;
1686     what.options[length] = optionName;
1687   }
1688
1689   var saved_bill_city= 'Owensboro';
1690
1691   function bill_county_changed(what, callback) {
1692
1693     what.form.bill_city_select.disabled = 'disabled';
1694
1695     county  = what.options[what.selectedIndex].value;
1696     state   = what.form.bill_state.options[what.form.bill_state.selectedIndex].value;
1697     country = what.form.bill_country.options[what.form.bill_country.selectedIndex].value;
1698
1699     function bill_update_cities(cities) {
1700
1701       // blank the current city list
1702       for ( var i = what.form.bill_city_select.length; i >= 0; i-- )
1703           what.form.bill_city_select.options[i] = null;
1704
1705
1706       // add the new cities
1707       var citiesArray = eval('(' + cities + ')' );
1708
1709       for ( var s = 0; s < citiesArray.length; s++ ) {
1710           var cityLabel = citiesArray[s];
1711           if ( cityLabel == "" )
1712               cityLabel = '(n/a)';
1713           opt(what.form.bill_city_select, citiesArray[s], cityLabel);
1714       }
1715
1716      if ( citiesArray.length > 1 || (citiesArray[0] && citiesArray[0].length) ){
1717         // turn off the text city, turn on the select
1718         saved_bill_city = what.form.bill_city.value;
1719         bill_city_select_changed(what.form.bill_city_select);
1720         what.form.bill_city.style.display = 'none';
1721         what.form.bill_city_select.style.display = '';
1722       } else if ( what.form.bill_city.style.display == 'none' ) {
1723         // turn on the text city, turn off the select
1724         what.form.bill_city.value = saved_bill_city;
1725         what.form.bill_city.style.display = '';
1726         what.form.bill_city_select.style.display = 'none';
1727       }
1728
1729       what.form.bill_city_select.disabled = '';
1730
1731       //run the callback
1732       if ( callback != null )
1733         callback();
1734     }
1735
1736     // go get the new cities
1737     bill_get_cities( county, state, country, bill_update_cities );
1738
1739   }
1740
1741   function bill_city_select_changed(what) {
1742     what.form.bill_city.value = what.options[what.selectedIndex].value;
1743   }
1744
1745 </SCRIPT>
1746
1747
1748 <INPUT TYPE     = "text"
1749        NAME     = "bill_city"
1750        ID       = "bill_city"
1751        VALUE    = "Owensboro"
1752        onChange = ""
1753        
1754        
1755 >
1756
1757
1758     <SELECT NAME     = "bill_city_select"
1759             ID       = "bill_city_select"
1760             onChange = "bill_city_select_changed(this); "
1761             
1762             STYLE="display:none"
1763     >
1764
1765
1766
1767       <OPTION VALUE=""
1768               
1769       >
1770
1771
1772     </SELECT>
1773
1774 </TD>
1775   <TH ALIGN="right" WIDTH="1" ID="bill_countylabel" STYLE="display:none"><font color="#ff0000">*</font>&nbsp;County</TH>
1776   <TD WIDTH="1">
1777   <SCRIPT TYPE="text/javascript">
1778     function bill_state_changed(what) {
1779     }
1780   </SCRIPT>
1781
1782   <SELECT NAME  = "bill_county"
1783            ID   = "bill_county"
1784           STYLE = "display:none"
1785   >
1786     <OPTION SELECTED VALUE="">
1787   </SELECT>
1788
1789
1790 </TD>
1791   <TH ALIGN="right" WIDTH="1"><font color="#ff0000">*</font>&nbsp;State</TH>
1792   <TD WIDTH="1">
1793     
1794 <SELECT NAME     = "bill_state"
1795         ID       = "bill_state"
1796         onChange = "bill_state_changed(this); "
1797         
1798         
1799 >
1800
1801
1802
1803   <OPTION VALUE="AK">AK
1804
1805
1806   <OPTION VALUE="AL">AL
1807
1808
1809   <OPTION VALUE="AR">AR
1810
1811
1812   <OPTION VALUE="AS">AS
1813
1814
1815   <OPTION VALUE="AZ">AZ
1816
1817
1818   <OPTION VALUE="CA">CA
1819
1820
1821   <OPTION VALUE="CO">CO
1822
1823
1824   <OPTION VALUE="CT">CT
1825
1826
1827   <OPTION VALUE="DC">DC
1828
1829
1830   <OPTION VALUE="DE">DE
1831
1832
1833   <OPTION VALUE="FL">FL
1834
1835
1836   <OPTION VALUE="GA">GA
1837
1838
1839   <OPTION VALUE="GU">GU
1840
1841
1842   <OPTION VALUE="HI">HI
1843
1844
1845   <OPTION VALUE="IA">IA
1846
1847
1848   <OPTION VALUE="ID">ID
1849
1850
1851   <OPTION VALUE="IL">IL
1852
1853
1854   <OPTION VALUE="IN">IN
1855
1856
1857   <OPTION VALUE="KS" SELECTED>KS
1858
1859
1860   <OPTION VALUE="KY">KY
1861
1862
1863   <OPTION VALUE="LA">LA
1864
1865
1866   <OPTION VALUE="MA">MA
1867
1868
1869   <OPTION VALUE="MD">MD
1870
1871
1872   <OPTION VALUE="ME">ME
1873
1874
1875   <OPTION VALUE="MI">MI
1876
1877
1878   <OPTION VALUE="MN">MN
1879
1880
1881   <OPTION VALUE="MO">MO
1882
1883
1884   <OPTION VALUE="MP">MP
1885
1886
1887   <OPTION VALUE="MS">MS
1888
1889
1890   <OPTION VALUE="MT">MT
1891
1892
1893   <OPTION VALUE="NC">NC
1894
1895
1896   <OPTION VALUE="ND">ND
1897
1898
1899   <OPTION VALUE="NE">NE
1900
1901
1902   <OPTION VALUE="NH">NH
1903
1904
1905   <OPTION VALUE="NJ">NJ
1906
1907
1908   <OPTION VALUE="NM">NM
1909
1910
1911   <OPTION VALUE="NV">NV
1912
1913
1914   <OPTION VALUE="NY">NY
1915
1916
1917   <OPTION VALUE="OH">OH
1918
1919
1920   <OPTION VALUE="OK">OK
1921
1922
1923   <OPTION VALUE="OR">OR
1924
1925
1926   <OPTION VALUE="PA">PA
1927
1928
1929   <OPTION VALUE="PR">PR
1930
1931
1932   <OPTION VALUE="RI">RI
1933
1934
1935   <OPTION VALUE="SC">SC
1936
1937
1938   <OPTION VALUE="SD">SD
1939
1940
1941   <OPTION VALUE="TN">TN
1942
1943
1944   <OPTION VALUE="TX">TX
1945
1946
1947   <OPTION VALUE="UM">UM
1948
1949
1950   <OPTION VALUE="UT">UT
1951
1952
1953   <OPTION VALUE="VA">VA
1954
1955
1956   <OPTION VALUE="VI">VI
1957
1958
1959   <OPTION VALUE="VT">VT
1960
1961
1962   <OPTION VALUE="WA">WA
1963
1964
1965   <OPTION VALUE="WI">WI
1966
1967
1968   <OPTION VALUE="WV">WV
1969
1970
1971   <OPTION VALUE="WY">WY
1972
1973
1974
1975 </SELECT>
1976
1977
1978
1979   </TD>
1980   <TH ALIGN="right" WIDTH="1"><font color="#ff0000">*</font>&nbsp;Zip</TH>
1981   <TD>
1982     <INPUT TYPE     = "text"
1983            NAME     = "bill_zip"
1984            ID       = "bill_zip"
1985            VALUE    = "69113"
1986            SIZE     = 11
1987            onChange = ""
1988            
1989            
1990     >
1991   </TD>
1992 </TR>
1993
1994 <TR>
1995   <TH ALIGN="right"><font color="#ff0000">*</font>&nbsp;Country</TH>
1996   <TD COLSPAN=6>
1997   <SCRIPT TYPE="text/javascript">
1998
1999   function rs_init_object() {
2000     var A;
2001     try {
2002       A=new ActiveXObject("Msxml2.XMLHTTP");
2003     } catch (e) {
2004       try {
2005         A=new ActiveXObject("Microsoft.XMLHTTP");
2006       } catch (oc) {
2007         A=null;
2008       }
2009     }
2010     if(!A && typeof XMLHttpRequest != "undefined")
2011       A = new XMLHttpRequest();
2012     if (!A)
2013       alert("Can't create XMLHttpRequest object");
2014     return A;
2015
2016   }
2017
2018 </SCRIPT>
2019
2020
2021 <SCRIPT TYPE="text/javascript">
2022
2023
2024     function bill_get_states() {
2025         // count args; build URL
2026         var url = "http://localhost/freeside/misc/states.cgi?";
2027         var a = bill_get_states.arguments;
2028
2029         var args;
2030         var len;
2031         var content = 'sub=bill_get_states';
2032         if ( a && typeof a  == 'object'  && a[0].constructor == Array ) {
2033             args = a[0];
2034             len = args.length
2035         } else {
2036             args = a;
2037             len = args.length - 1;
2038         }
2039         for (var i = 0; i < len; i++) 
2040             content = content + "&arg=" + escape(args[i]);
2041         content = content.replace( /[+]/g, '%2B'); // fix unescaped plus signs 
2042
2043         if ( 'GET' == 'GET' ) {
2044           url = url + content;
2045         }
2046
2047         //alert('GET ' + url);
2048
2049         var xmlhttp = rs_init_object();
2050         xmlhttp.open("GET", url, true);
2051
2052         xmlhttp.onreadystatechange = function() {
2053             if (xmlhttp.readyState != 4) 
2054                 return;
2055
2056             if (xmlhttp.status != 200) {
2057               if ( xmlhttp.status != 0 ) {
2058                 //not warning on the 0 errors, they pop up when navagating away
2059                 // from the page
2060                 alert(xmlhttp.status + " status connecting to " + url);
2061               }
2062             } else {
2063               var data = xmlhttp.responseText;
2064               //alert('received response: ' + data);
2065               if ( data.indexOf("<b>System error</b>") > -1 ) {
2066                 // trim this a little
2067                 var end = data.indexOf('<a href="#raw">') - 1;
2068                 data = data.substring(0, end);
2069
2070                 overlib(data,
2071                   WIDTH, 480, MIDX, 0, MIDY, 0,
2072                   CAPTION, 'Error', STICKY, AUTOSTATUSCAP, DRAGGABLE,
2073                   CLOSECLICK, BGCOLOR, '#f00', CGCOLOR, '#f00'
2074                 );
2075                 //var w;
2076                 //if ( w = window.open("about:blank") ) {
2077                 //  w.document.write(data);
2078                 //} else {
2079                 //  // popup blocking?  should use an overlib popup instead 
2080                 //  alert("Error popup disabled; try disabling popup blocking to see");
2081                 //}
2082               } else {
2083                 // invoke the callback
2084                 a[a.length-1](data);
2085               }
2086             }
2087         }
2088
2089         if ( 'GET' == 'POST' ) {
2090
2091           xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
2092           xmlhttp.send(content);
2093
2094         } else {
2095
2096           xmlhttp.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
2097           xmlhttp.send(null);
2098
2099         }
2100
2101         //rs_debug("x_$func_name url = " + url);
2102         //rs_debug("x_$func_name waiting..");
2103     }
2104
2105
2106 </SCRIPT>
2107
2108   
2109   <SCRIPT TYPE="text/javascript">
2110   
2111     function opt(what,value,text) {
2112       var optionName = new Option(text, value, false, false);
2113       var length = what.length;
2114       what.options[length] = optionName;
2115     }
2116   
2117     function bill_country_changed(what, callback) {
2118
2119       what.form.bill_state.disabled = 'disabled';
2120   
2121       country = what.options[what.selectedIndex].value;
2122   
2123       function bill_update_states(states) {
2124   
2125         // blank the current state list
2126         for ( var i = what.form.bill_state.length; i >= 0; i-- )
2127             what.form.bill_state.options[i] = null;
2128   
2129         // add the new states
2130         var statesArray = eval('(' + states + ')' );
2131
2132         for ( var s = 0; s < statesArray.length; s=s+2 ) {
2133             var stateLabel = statesArray[s+1];
2134             if ( stateLabel == "" )
2135                 stateLabel = '(n/a)';
2136             opt(what.form.bill_state, statesArray[s], stateLabel);
2137         }
2138
2139         what.form.bill_state.disabled = '';
2140   
2141         //run the callback
2142         if ( callback != null ) {
2143           callback();
2144         } else {
2145           bill_state_changed(what.form.bill_state);
2146         }
2147       }
2148   
2149       // go get the new states
2150       bill_get_states( country, bill_update_states );
2151   
2152     }
2153   
2154   </SCRIPT>
2155
2156
2157 <SELECT NAME     = "bill_country"
2158         ID       = "bill_country"
2159         onChange = "bill_country_changed(this); "
2160         
2161         
2162 >
2163
2164
2165
2166   <OPTION VALUE="US"
2167            SELECTED
2168   >United States (US)
2169
2170
2171   <OPTION VALUE="AF"
2172           
2173   >Afghanistan (AF)
2174
2175
2176   <OPTION VALUE="AX"
2177           
2178   >Aland Islands (AX)
2179
2180
2181   <OPTION VALUE="AL"
2182           
2183   >Albania (AL)
2184
2185
2186   <OPTION VALUE="DZ"
2187           
2188   >Algeria (DZ)
2189
2190
2191   <OPTION VALUE="AS"
2192           
2193   >American Samoa (AS)
2194
2195
2196   <OPTION VALUE="AD"
2197           
2198   >Andorra (AD)
2199
2200
2201   <OPTION VALUE="AO"
2202           
2203   >Angola (AO)
2204
2205
2206   <OPTION VALUE="AI"
2207           
2208   >Anguilla (AI)
2209
2210
2211   <OPTION VALUE="AQ"
2212           
2213   >Antarctica (AQ)
2214
2215
2216   <OPTION VALUE="AG"
2217           
2218   >Antigua and Barbuda (AG)
2219
2220
2221   <OPTION VALUE="AR"
2222           
2223   >Argentina (AR)
2224
2225
2226   <OPTION VALUE="AM"
2227           
2228   >Armenia (AM)
2229
2230
2231   <OPTION VALUE="AW"
2232           
2233   >Aruba (AW)
2234
2235
2236   <OPTION VALUE="AU"
2237           
2238   >Australia (AU)
2239
2240
2241   <OPTION VALUE="AT"
2242           
2243   >Austria (AT)
2244
2245
2246   <OPTION VALUE="AZ"
2247           
2248   >Azerbaijan (AZ)
2249
2250
2251   <OPTION VALUE="BS"
2252           
2253   >Bahamas (BS)
2254
2255
2256   <OPTION VALUE="BH"
2257           
2258   >Bahrain (BH)
2259
2260
2261   <OPTION VALUE="BD"
2262           
2263   >Bangladesh (BD)
2264
2265
2266   <OPTION VALUE="BB"
2267           
2268   >Barbados (BB)
2269
2270
2271   <OPTION VALUE="BY"
2272           
2273   >Belarus (BY)
2274
2275
2276   <OPTION VALUE="BE"
2277           
2278   >Belgium (BE)
2279
2280
2281   <OPTION VALUE="BZ"
2282           
2283   >Belize (BZ)
2284
2285
2286   <OPTION VALUE="BJ"
2287           
2288   >Benin (BJ)
2289
2290
2291   <OPTION VALUE="BM"
2292           
2293   >Bermuda (BM)
2294
2295
2296   <OPTION VALUE="BT"
2297           
2298   >Bhutan (BT)
2299
2300
2301   <OPTION VALUE="BO"
2302           
2303   >Bolivia, Plurinational State of (BO)
2304
2305
2306   <OPTION VALUE="BQ"
2307           
2308   >Bonaire, Sint Eustatius and Saba (BQ)
2309
2310
2311   <OPTION VALUE="BA"
2312           
2313   >Bosnia and Herzegovina (BA)
2314
2315
2316   <OPTION VALUE="BW"
2317           
2318   >Botswana (BW)
2319
2320
2321   <OPTION VALUE="BV"
2322           
2323   >Bouvet Island (BV)
2324
2325
2326   <OPTION VALUE="BR"
2327           
2328   >Brazil (BR)
2329
2330
2331   <OPTION VALUE="IO"
2332           
2333   >British Indian Ocean Territory (IO)
2334
2335
2336   <OPTION VALUE="BN"
2337           
2338   >Brunei Darussalam (BN)
2339
2340
2341   <OPTION VALUE="BG"
2342           
2343   >Bulgaria (BG)
2344
2345
2346   <OPTION VALUE="BF"
2347           
2348   >Burkina Faso (BF)
2349
2350
2351   <OPTION VALUE="BI"
2352           
2353   >Burundi (BI)
2354
2355
2356   <OPTION VALUE="KH"
2357           
2358   >Cambodia (KH)
2359
2360
2361   <OPTION VALUE="CM"
2362           
2363   >Cameroon (CM)
2364
2365
2366   <OPTION VALUE="CA"
2367           
2368   >Canada (CA)
2369
2370
2371   <OPTION VALUE="CV"
2372           
2373   >Cape Verde (CV)
2374
2375
2376   <OPTION VALUE="KY"
2377           
2378   >Cayman Islands (KY)
2379
2380
2381   <OPTION VALUE="CF"
2382           
2383   >Central African Republic (CF)
2384
2385
2386   <OPTION VALUE="TD"
2387           
2388   >Chad (TD)
2389
2390
2391   <OPTION VALUE="CL"
2392           
2393   >Chile (CL)
2394
2395
2396   <OPTION VALUE="CN"
2397           
2398   >China (CN)
2399
2400
2401   <OPTION VALUE="CX"
2402           
2403   >Christmas Island (CX)
2404
2405
2406   <OPTION VALUE="CC"
2407           
2408   >Cocos (Keeling) Islands (CC)
2409
2410
2411   <OPTION VALUE="CO"
2412           
2413   >Colombia (CO)
2414
2415
2416   <OPTION VALUE="KM"
2417           
2418   >Comoros (KM)
2419
2420
2421   <OPTION VALUE="CG"
2422           
2423   >Congo (CG)
2424
2425
2426   <OPTION VALUE="CD"
2427           
2428   >Congo (The Democratic Republic of the) (CD)
2429
2430
2431   <OPTION VALUE="CK"
2432           
2433   >Cook Islands (CK)
2434
2435
2436   <OPTION VALUE="CR"
2437           
2438   >Costa Rica (CR)
2439
2440
2441   <OPTION VALUE="CI"
2442           
2443   >Cote d'Ivoire (CI)
2444
2445
2446   <OPTION VALUE="HR"
2447           
2448   >Croatia (HR)
2449
2450
2451   <OPTION VALUE="CU"
2452           
2453   >Cuba (CU)
2454
2455
2456   <OPTION VALUE="CW"
2457           
2458   >Curacao (CW)
2459
2460
2461   <OPTION VALUE="CY"
2462           
2463   >Cyprus (CY)
2464
2465
2466   <OPTION VALUE="CZ"
2467           
2468   >Czech Republic (CZ)
2469
2470
2471   <OPTION VALUE="DK"
2472           
2473   >Denmark (DK)
2474
2475
2476   <OPTION VALUE="DJ"
2477           
2478   >Djibouti (DJ)
2479
2480
2481   <OPTION VALUE="DM"
2482           
2483   >Dominica (DM)
2484
2485
2486   <OPTION VALUE="DO"
2487           
2488   >Dominican Republic (DO)
2489
2490
2491   <OPTION VALUE="EC"
2492           
2493   >Ecuador (EC)
2494
2495
2496   <OPTION VALUE="EG"
2497           
2498   >Egypt (EG)
2499
2500
2501   <OPTION VALUE="SV"
2502           
2503   >El Salvador (SV)
2504
2505
2506   <OPTION VALUE="GQ"
2507           
2508   >Equatorial Guinea (GQ)
2509
2510
2511   <OPTION VALUE="ER"
2512           
2513   >Eritrea (ER)
2514
2515
2516   <OPTION VALUE="EE"
2517           
2518   >Estonia (EE)
2519
2520
2521   <OPTION VALUE="ET"
2522           
2523   >Ethiopia (ET)
2524
2525
2526   <OPTION VALUE="FK"
2527           
2528   >Falkland Islands (The) [Malvinas] (FK)
2529
2530
2531   <OPTION VALUE="FO"
2532           
2533   >Faroe Islands (FO)
2534
2535
2536   <OPTION VALUE="FJ"
2537           
2538   >Fiji (FJ)
2539
2540
2541   <OPTION VALUE="FI"
2542           
2543   >Finland (FI)
2544
2545
2546   <OPTION VALUE="FR"
2547           
2548   >France (FR)
2549
2550
2551   <OPTION VALUE="GF"
2552           
2553   >French Guiana (GF)
2554
2555
2556   <OPTION VALUE="PF"
2557           
2558   >French Polynesia (PF)
2559
2560
2561   <OPTION VALUE="TF"
2562           
2563   >French Southern Territories (TF)
2564
2565
2566   <OPTION VALUE="GA"
2567           
2568   >Gabon (GA)
2569
2570
2571   <OPTION VALUE="GM"
2572           
2573   >Gambia (GM)
2574
2575
2576   <OPTION VALUE="GE"
2577           
2578   >Georgia (GE)
2579
2580
2581   <OPTION VALUE="DE"
2582           
2583   >Germany (DE)
2584
2585
2586   <OPTION VALUE="GH"
2587           
2588   >Ghana (GH)
2589
2590
2591   <OPTION VALUE="GI"
2592           
2593   >Gibraltar (GI)
2594
2595
2596   <OPTION VALUE="GR"
2597           
2598   >Greece (GR)
2599
2600
2601   <OPTION VALUE="GL"
2602           
2603   >Greenland (GL)
2604
2605
2606   <OPTION VALUE="GD"
2607           
2608   >Grenada (GD)
2609
2610
2611   <OPTION VALUE="GP"
2612           
2613   >Guadeloupe (GP)
2614
2615
2616   <OPTION VALUE="GU"
2617           
2618   >Guam (GU)
2619
2620
2621   <OPTION VALUE="GT"
2622           
2623   >Guatemala (GT)
2624
2625
2626   <OPTION VALUE="GG"
2627           
2628   >Guernsey (GG)
2629
2630
2631   <OPTION VALUE="GN"
2632           
2633   >Guinea (GN)
2634
2635
2636   <OPTION VALUE="GW"
2637           
2638   >Guinea-Bissau (GW)
2639
2640
2641   <OPTION VALUE="GY"
2642           
2643   >Guyana (GY)
2644
2645
2646   <OPTION VALUE="HT"
2647           
2648   >Haiti (HT)
2649
2650
2651   <OPTION VALUE="HM"
2652           
2653   >Heard Island and McDonald Islands (HM)
2654
2655
2656   <OPTION VALUE="VA"
2657           
2658   >Holy See (The) [Vatican City State] (VA)
2659
2660
2661   <OPTION VALUE="HN"
2662           
2663   >Honduras (HN)
2664
2665
2666   <OPTION VALUE="HK"
2667           
2668   >Hong Kong (HK)
2669
2670
2671   <OPTION VALUE="HU"
2672           
2673   >Hungary (HU)
2674
2675
2676   <OPTION VALUE="IS"
2677           
2678   >Iceland (IS)
2679
2680
2681   <OPTION VALUE="IN"
2682           
2683   >India (IN)
2684
2685
2686   <OPTION VALUE="ID"
2687           
2688   >Indonesia (ID)
2689
2690
2691   <OPTION VALUE="IR"
2692           
2693   >Iran, The Islamic Republic of (IR)
2694
2695
2696   <OPTION VALUE="IQ"
2697           
2698   >Iraq (IQ)
2699
2700
2701   <OPTION VALUE="IE"
2702           
2703   >Ireland (IE)
2704
2705
2706   <OPTION VALUE="IM"
2707           
2708   >Isle of Man (IM)
2709
2710
2711   <OPTION VALUE="IL"
2712           
2713   >Israel (IL)
2714
2715
2716   <OPTION VALUE="IT"
2717           
2718   >Italy (IT)
2719
2720
2721   <OPTION VALUE="JM"
2722           
2723   >Jamaica (JM)
2724
2725
2726   <OPTION VALUE="JP"
2727           
2728   >Japan (JP)
2729
2730
2731   <OPTION VALUE="JE"
2732           
2733   >Jersey (JE)
2734
2735
2736   <OPTION VALUE="JO"
2737           
2738   >Jordan (JO)
2739
2740
2741   <OPTION VALUE="KZ"
2742           
2743   >Kazakhstan (KZ)
2744
2745
2746   <OPTION VALUE="KE"
2747           
2748   >Kenya (KE)
2749
2750
2751   <OPTION VALUE="KI"
2752           
2753   >Kiribati (KI)
2754
2755
2756   <OPTION VALUE="KP"
2757           
2758   >Korea, The Democratic People's Republic of (KP)
2759
2760
2761   <OPTION VALUE="KR"
2762           
2763   >Korea, The Republic of (KR)
2764
2765
2766   <OPTION VALUE="KW"
2767           
2768   >Kuwait (KW)
2769
2770
2771   <OPTION VALUE="KG"
2772           
2773   >Kyrgyzstan (KG)
2774
2775
2776   <OPTION VALUE="LA"
2777           
2778   >Lao People's Democratic Republic (LA)
2779
2780
2781   <OPTION VALUE="LV"
2782           
2783   >Latvia (LV)
2784
2785
2786   <OPTION VALUE="LB"
2787           
2788   >Lebanon (LB)
2789
2790
2791   <OPTION VALUE="LS"
2792           
2793   >Lesotho (LS)
2794
2795
2796   <OPTION VALUE="LR"
2797           
2798   >Liberia (LR)
2799
2800
2801   <OPTION VALUE="LY"
2802           
2803   >Libya (LY)
2804
2805
2806   <OPTION VALUE="LI"
2807           
2808   >Liechtenstein (LI)
2809
2810
2811   <OPTION VALUE="LT"
2812           
2813   >Lithuania (LT)
2814
2815
2816   <OPTION VALUE="LU"
2817           
2818   >Luxembourg (LU)
2819
2820
2821   <OPTION VALUE="MO"
2822           
2823   >Macao (MO)
2824
2825
2826   <OPTION VALUE="MK"
2827           
2828   >Macedonia, The former Yugoslav Republic of (MK)
2829
2830
2831   <OPTION VALUE="MG"
2832           
2833   >Madagascar (MG)
2834
2835
2836   <OPTION VALUE="MW"
2837           
2838   >Malawi (MW)
2839
2840
2841   <OPTION VALUE="MY"
2842           
2843   >Malaysia (MY)
2844
2845
2846   <OPTION VALUE="MV"
2847           
2848   >Maldives (MV)
2849
2850
2851   <OPTION VALUE="ML"
2852           
2853   >Mali (ML)
2854
2855
2856   <OPTION VALUE="MT"
2857           
2858   >Malta (MT)
2859
2860
2861   <OPTION VALUE="MH"
2862           
2863   >Marshall Islands (MH)
2864
2865
2866   <OPTION VALUE="MQ"
2867           
2868   >Martinique (MQ)
2869
2870
2871   <OPTION VALUE="MR"
2872           
2873   >Mauritania (MR)
2874
2875
2876   <OPTION VALUE="MU"
2877           
2878   >Mauritius (MU)
2879
2880
2881   <OPTION VALUE="YT"
2882           
2883   >Mayotte (YT)
2884
2885
2886   <OPTION VALUE="MX"
2887           
2888   >Mexico (MX)
2889
2890
2891   <OPTION VALUE="FM"
2892           
2893   >Micronesia, The Federated States of (FM)
2894
2895
2896   <OPTION VALUE="MD"
2897           
2898   >Moldova, The Republic of (MD)
2899
2900
2901   <OPTION VALUE="MC"
2902           
2903   >Monaco (MC)
2904
2905
2906   <OPTION VALUE="MN"
2907           
2908   >Mongolia (MN)
2909
2910
2911   <OPTION VALUE="ME"
2912           
2913   >Montenegro (ME)
2914
2915
2916   <OPTION VALUE="MS"
2917           
2918   >Montserrat (MS)
2919
2920
2921   <OPTION VALUE="MA"
2922           
2923   >Morocco (MA)
2924
2925
2926   <OPTION VALUE="MZ"
2927           
2928   >Mozambique (MZ)
2929
2930
2931   <OPTION VALUE="MM"
2932           
2933   >Myanmar (MM)
2934
2935
2936   <OPTION VALUE="NA"
2937           
2938   >Namibia (NA)
2939
2940
2941   <OPTION VALUE="NR"
2942           
2943   >Nauru (NR)
2944
2945
2946   <OPTION VALUE="NP"
2947           
2948   >Nepal (NP)
2949
2950
2951   <OPTION VALUE="NL"
2952           
2953   >Netherlands (NL)
2954
2955
2956   <OPTION VALUE="NC"
2957           
2958   >New Caledonia (NC)
2959
2960
2961   <OPTION VALUE="NZ"
2962           
2963   >New Zealand (NZ)
2964
2965
2966   <OPTION VALUE="NI"
2967           
2968   >Nicaragua (NI)
2969
2970
2971   <OPTION VALUE="NE"
2972           
2973   >Niger (NE)
2974
2975
2976   <OPTION VALUE="NG"
2977           
2978   >Nigeria (NG)
2979
2980
2981   <OPTION VALUE="NU"
2982           
2983   >Niue (NU)
2984
2985
2986   <OPTION VALUE="NF"
2987           
2988   >Norfolk Island (NF)
2989
2990
2991   <OPTION VALUE="MP"
2992           
2993   >Northern Mariana Islands (MP)
2994
2995
2996   <OPTION VALUE="NO"
2997           
2998   >Norway (NO)
2999
3000
3001   <OPTION VALUE="OM"
3002           
3003   >Oman (OM)
3004
3005
3006   <OPTION VALUE="PK"
3007           
3008   >Pakistan (PK)
3009
3010
3011   <OPTION VALUE="PW"
3012           
3013   >Palau (PW)
3014
3015
3016   <OPTION VALUE="PS"
3017           
3018   >Palestine, State of (PS)
3019
3020
3021   <OPTION VALUE="PA"
3022           
3023   >Panama (PA)
3024
3025
3026   <OPTION VALUE="PG"
3027           
3028   >Papua New Guinea (PG)
3029
3030
3031   <OPTION VALUE="PY"
3032           
3033   >Paraguay (PY)
3034
3035
3036   <OPTION VALUE="PE"
3037           
3038   >Peru (PE)
3039
3040
3041   <OPTION VALUE="PH"
3042           
3043   >Philippines (PH)
3044
3045
3046   <OPTION VALUE="PN"
3047           
3048   >Pitcairn (PN)
3049
3050
3051   <OPTION VALUE="PL"
3052           
3053   >Poland (PL)
3054
3055
3056   <OPTION VALUE="PT"
3057           
3058   >Portugal (PT)
3059
3060
3061   <OPTION VALUE="PR"
3062           
3063   >Puerto Rico (PR)
3064
3065
3066   <OPTION VALUE="QA"
3067           
3068   >Qatar (QA)
3069
3070
3071   <OPTION VALUE="RE"
3072           
3073   >Reunion (RE)
3074
3075
3076   <OPTION VALUE="RO"
3077           
3078   >Romania (RO)
3079
3080
3081   <OPTION VALUE="RU"
3082           
3083   >Russian Federation (RU)
3084
3085
3086   <OPTION VALUE="RW"
3087           
3088   >Rwanda (RW)
3089
3090
3091   <OPTION VALUE="BL"
3092           
3093   >Saint Barthelemy (BL)
3094
3095
3096   <OPTION VALUE="SH"
3097           
3098   >Saint Helena, Ascension and Tristan da Cunha (SH)
3099
3100
3101   <OPTION VALUE="KN"
3102           
3103   >Saint Kitts and Nevis (KN)
3104
3105
3106   <OPTION VALUE="LC"
3107           
3108   >Saint Lucia (LC)
3109
3110
3111   <OPTION VALUE="MF"
3112           
3113   >Saint Martin (French part) (MF)
3114
3115
3116   <OPTION VALUE="PM"
3117           
3118   >Saint Pierre and Miquelon (PM)
3119
3120
3121   <OPTION VALUE="VC"
3122           
3123   >Saint Vincent and the Grenadines (VC)
3124
3125
3126   <OPTION VALUE="WS"
3127           
3128   >Samoa (WS)
3129
3130
3131   <OPTION VALUE="SM"
3132           
3133   >San Marino (SM)
3134
3135
3136   <OPTION VALUE="ST"
3137           
3138   >Sao Tome and Principe (ST)
3139
3140
3141   <OPTION VALUE="SA"
3142           
3143   >Saudi Arabia (SA)
3144
3145
3146   <OPTION VALUE="SN"
3147           
3148   >Senegal (SN)
3149
3150
3151   <OPTION VALUE="RS"
3152           
3153   >Serbia (RS)
3154
3155
3156   <OPTION VALUE="SC"
3157           
3158   >Seychelles (SC)
3159
3160
3161   <OPTION VALUE="SL"
3162           
3163   >Sierra Leone (SL)
3164
3165
3166   <OPTION VALUE="SG"
3167           
3168   >Singapore (SG)
3169
3170
3171   <OPTION VALUE="SX"
3172           
3173   >Sint Maarten (Dutch part) (SX)
3174
3175
3176   <OPTION VALUE="SK"
3177           
3178   >Slovakia (SK)
3179
3180
3181   <OPTION VALUE="SI"
3182           
3183   >Slovenia (SI)
3184
3185
3186   <OPTION VALUE="SB"
3187           
3188   >Solomon Islands (SB)
3189
3190
3191   <OPTION VALUE="SO"
3192           
3193   >Somalia (SO)
3194
3195
3196   <OPTION VALUE="ZA"
3197           
3198   >South Africa (ZA)
3199
3200
3201   <OPTION VALUE="GS"
3202           
3203   >South Georgia and the South Sandwich Islands (GS)
3204
3205
3206   <OPTION VALUE="SS"
3207           
3208   >South Sudan (SS)
3209
3210
3211   <OPTION VALUE="ES"
3212           
3213   >Spain (ES)
3214
3215
3216   <OPTION VALUE="LK"
3217           
3218   >Sri Lanka (LK)
3219
3220
3221   <OPTION VALUE="SD"
3222           
3223   >Sudan (SD)
3224
3225
3226   <OPTION VALUE="SR"
3227           
3228   >Suriname (SR)
3229
3230
3231   <OPTION VALUE="SJ"
3232           
3233   >Svalbard and Jan Mayen (SJ)
3234
3235
3236   <OPTION VALUE="SZ"
3237           
3238   >Swaziland (SZ)
3239
3240
3241   <OPTION VALUE="SE"
3242           
3243   >Sweden (SE)
3244
3245
3246   <OPTION VALUE="CH"
3247           
3248   >Switzerland (CH)
3249
3250
3251   <OPTION VALUE="SY"
3252           
3253   >Syrian Arab Republic (SY)
3254
3255
3256   <OPTION VALUE="TW"
3257           
3258   >Taiwan (Province of China) (TW)
3259
3260
3261   <OPTION VALUE="TJ"
3262           
3263   >Tajikistan (TJ)
3264
3265
3266   <OPTION VALUE="TZ"
3267           
3268   >Tanzania, United Republic of (TZ)
3269
3270
3271   <OPTION VALUE="TH"
3272           
3273   >Thailand (TH)
3274
3275
3276   <OPTION VALUE="TL"
3277           
3278   >Timor-Leste (TL)
3279
3280
3281   <OPTION VALUE="TG"
3282           
3283   >Togo (TG)
3284
3285
3286   <OPTION VALUE="TK"
3287           
3288   >Tokelau (TK)
3289
3290
3291   <OPTION VALUE="TO"
3292           
3293   >Tonga (TO)
3294
3295
3296   <OPTION VALUE="TT"
3297           
3298   >Trinidad and Tobago (TT)
3299
3300
3301   <OPTION VALUE="TN"
3302           
3303   >Tunisia (TN)
3304
3305
3306   <OPTION VALUE="TR"
3307           
3308   >Turkey (TR)
3309
3310
3311   <OPTION VALUE="TM"
3312           
3313   >Turkmenistan (TM)
3314
3315
3316   <OPTION VALUE="TC"
3317           
3318   >Turks and Caicos Islands (TC)
3319
3320
3321   <OPTION VALUE="TV"
3322           
3323   >Tuvalu (TV)
3324
3325
3326   <OPTION VALUE="UG"
3327           
3328   >Uganda (UG)
3329
3330
3331   <OPTION VALUE="UA"
3332           
3333   >Ukraine (UA)
3334
3335
3336   <OPTION VALUE="AE"
3337           
3338   >United Arab Emirates (AE)
3339
3340
3341   <OPTION VALUE="GB"
3342           
3343   >United Kingdom (GB)
3344
3345
3346   <OPTION VALUE="UM"
3347           
3348   >United States Minor Outlying Islands (UM)
3349
3350
3351   <OPTION VALUE="UY"
3352           
3353   >Uruguay (UY)
3354
3355
3356   <OPTION VALUE="UZ"
3357           
3358   >Uzbekistan (UZ)
3359
3360
3361   <OPTION VALUE="VU"
3362           
3363   >Vanuatu (VU)
3364
3365
3366   <OPTION VALUE="VE"
3367           
3368   >Venezuela, Bolivarian Republic of  (VE)
3369
3370
3371   <OPTION VALUE="VN"
3372           
3373   >Viet Nam (VN)
3374
3375
3376   <OPTION VALUE="VG"
3377           
3378   >Virgin Islands (British) (VG)
3379
3380
3381   <OPTION VALUE="VI"
3382           
3383   >Virgin Islands (U.S.) (VI)
3384
3385
3386   <OPTION VALUE="WF"
3387           
3388   >Wallis and Futuna (WF)
3389
3390
3391   <OPTION VALUE="EH"
3392           
3393   >Western Sahara (EH)
3394
3395
3396   <OPTION VALUE="YE"
3397           
3398   >Yemen (YE)
3399
3400
3401   <OPTION VALUE="ZM"
3402           
3403   >Zambia (ZM)
3404
3405
3406   <OPTION VALUE="ZW"
3407           
3408   >Zimbabwe (ZW)
3409
3410
3411 </SELECT>
3412
3413 </TD>
3414 </TR>
3415
3416 <TR>
3417   <TD ALIGN="right">Latitude</TD>
3418   <TD COLSPAN=7>
3419     <INPUT TYPE  = "text"
3420            NAME  = "bill_latitude"
3421            ID    = "bill_latitude"
3422            VALUE = "38.5000000"
3423            
3424            
3425     >
3426     Longitude
3427     <INPUT TYPE  = "text"
3428            NAME  = "bill_longitude"
3429            ID    = "bill_longitude"
3430            VALUE = "-121.5000000"
3431            
3432            
3433     >
3434   </TD>
3435 </TR>
3436   <INPUT TYPE  = "hidden"
3437        NAME  = "bill_coord_auto"
3438        ID    = "bill_coord_auto"
3439        VALUE = "Y"
3440 >
3441
3442
3443   <INPUT TYPE  = "hidden"
3444        NAME  = "bill_geocode"
3445        ID    = "bill_geocode"
3446        VALUE = ""
3447 >
3448
3449
3450   <INPUT TYPE  = "hidden"
3451        NAME  = "bill_censustract"
3452        ID    = "bill_censustract"
3453        VALUE = ""
3454 >
3455
3456
3457   <INPUT TYPE  = "hidden"
3458        NAME  = "bill_censusyear"
3459        ID    = "bill_censusyear"
3460        VALUE = ""
3461 >
3462
3463
3464 <TR>
3465   <TD ALIGN="right">Census&nbsp;tract</TD>
3466   <TD COLSPAN=8>
3467     <INPUT TYPE="text" SIZE=15
3468            ID="bill_enter_censustract" 
3469            NAME="bill_enter_censustract" 
3470            VALUE="">
3471     (automatic)
3472   </TD>
3473 </TR>
3474   <INPUT TYPE  = "hidden"
3475        NAME  = "bill_district"
3476        ID    = "bill_district"
3477        VALUE = ""
3478 >
3479
3480
3481
3482 <INPUT TYPE  = "hidden"
3483        NAME  = "old_bill_address1"
3484        ID    = "old_bill_address1"
3485        VALUE = "46706 Kadin Hill #780"
3486 >
3487
3488
3489 <INPUT TYPE  = "hidden"
3490        NAME  = "old_bill_city"
3491        ID    = "old_bill_city"
3492        VALUE = "Owensboro"
3493 >
3494
3495
3496 <INPUT TYPE  = "hidden"
3497        NAME  = "old_bill_state"
3498        ID    = "old_bill_state"
3499        VALUE = "KS"
3500 >
3501
3502
3503 <INPUT TYPE  = "hidden"
3504        NAME  = "old_bill_country"
3505        ID    = "old_bill_country"
3506        VALUE = "US"
3507 >
3508
3509
3510 <INPUT TYPE  = "hidden"
3511        NAME  = "old_bill_zip"
3512        ID    = "old_bill_zip"
3513        VALUE = "69113"
3514 >
3515
3516
3517 <INPUT TYPE  = "hidden"
3518        NAME  = "old_bill_latitude"
3519        ID    = "old_bill_latitude"
3520        VALUE = "38.5000000"
3521 >
3522
3523
3524 <INPUT TYPE  = "hidden"
3525        NAME  = "old_bill_longitude"
3526        ID    = "old_bill_longitude"
3527        VALUE = "-121.5000000"
3528 >
3529
3530
3531 <INPUT TYPE  = "hidden"
3532        NAME  = "old_bill_censustract"
3533        ID    = "old_bill_censustract"
3534        VALUE = ""
3535 >
3536
3537
3538 <INPUT TYPE  = "hidden"
3539        NAME  = "old_bill_district"
3540        ID    = "old_bill_district"
3541        VALUE = ""
3542 >
3543
3544
3545 <INPUT TYPE  = "hidden"
3546        NAME  = "old_bill_addr_clean"
3547        ID    = "old_bill_addr_clean"
3548        VALUE = ""
3549 >
3550
3551
3552 <INPUT TYPE  = "hidden"
3553        NAME  = "bill_cachenum"
3554        ID    = "bill_cachenum"
3555        VALUE = ""
3556 >
3557
3558
3559 <INPUT TYPE  = "hidden"
3560        NAME  = "bill_addr_clean"
3561        ID    = "bill_addr_clean"
3562        VALUE = ""
3563 >
3564
3565
3566
3567 <SCRIPT TYPE="text/javascript">
3568 (function() {
3569   var myonload = function() {
3570
3571   var clear_coords_ids = [
3572     'bill_latitude',
3573     'bill_longitude',
3574     'bill_enter_censustract',
3575     'bill_censustract',
3576     'bill_district'
3577   ];
3578   function clear_coords() {
3579     for (var i=0; i < clear_coords_ids.length; i++) {
3580       var el = document.getElementById(clear_coords_ids[i]);
3581       if ( el ) {
3582         el.value = '';
3583       }
3584     }
3585   }
3586   var clear_coords_on_change = [
3587     'bill_address1',
3588     'bill_address2',
3589     'bill_city',
3590     'bill_state',
3591     'bill_zip',
3592     'bill_country'
3593   ];
3594   for (var i=0; i < clear_coords_on_change.length; i++) {
3595     var el = document.getElementById(clear_coords_on_change[i]);
3596     if ( el.addEventListener ) {
3597       el.addEventListener('change', clear_coords);
3598     } else if ( el.attachEvent ) {
3599       el.attachEvent('onchange', clear_coords);
3600     }
3601   }
3602   function clear_censustract() {
3603     // if the user manually edits the census tract, clear the 'hard' census
3604     // tract field so that we can re-verify and present a confirmation popup 
3605
3606     // get the ID of the hidden censustract field
3607     var censustract_id = this.id.replace('enter_', '');
3608     var el = document.getElementById(censustract_id);
3609     if (el) {
3610       el.value = '';
3611     }
3612   }
3613   var el = document.getElementById('bill_enter_censustract');
3614   if (el) {
3615     if ( el.addEventListener ) {
3616       el.addEventListener('change', clear_censustract);
3617     } else if ( el.attachEvent ) {
3618       el.attachEvent('onchange', clear_censustract);
3619     }
3620   }
3621
3622
3623   }
3624   if ( window.addEventListener ) {
3625     window.addEventListener('load', myonload);
3626   } else if ( window.attachEvent ) {
3627     window.attachEvent('onload', myonload);
3628   }
3629 })();
3630
3631 </SCRIPT>
3632
3633
3634       <TR>
3635   <TD VALIGN="top" ALIGN="right">Phones</TD>
3636   <TD COLSPAN=6>
3637     <TABLE CELLSPACING=0 CELLPADDING=0>
3638       <TR>
3639         <TD>
3640           <INPUT TYPE="text"
3641                  NAME="daytime"
3642                  VALUE="297-868-7684 x427"
3643                  SIZE=18
3644           >
3645           <BR><FONT SIZE=-1>Day Phone</FONT>
3646         </TD>
3647         <TD>&nbsp;</TD>
3648         <TD>
3649           <INPUT TYPE="text"
3650                  NAME="night"
3651                  VALUE="538-045-0820"
3652                  SIZE=18
3653           >
3654           <BR><FONT SIZE=-1>Night Phone</FONT>
3655         </TD>
3656         <TD>&nbsp;</TD>
3657         <TD>
3658           <INPUT TYPE="text"
3659                  NAME="mobile"
3660                  VALUE=""
3661                  SIZE=18
3662           >
3663           <BR><FONT SIZE=-1>Mobile</FONT>
3664         </TD>
3665         <TD>&nbsp;</TD>
3666       </TR>
3667     </TABLE>
3668   </TD>
3669 </TR>
3670
3671   <TR>
3672   <TD ALIGN="right">Fax</TD>
3673   <TD><INPUT TYPE="text" NAME="fax" VALUE="" SIZE=18></TD>
3674 </TR>
3675
3676 <INPUT TYPE="hidden" NAME="stateid" VALUE="">
3677 <INPUT TYPE="hidden" NAME="stateid_state" VALUE="KS">
3678
3679
3680
3681     </TABLE>
3682   </TD>
3683 </TR>
3684 <TR><TD STYLE="height:40px"></TD></TR>
3685 <TR>
3686   <TD STYLE="width:650px">
3687     <FONT CLASS="fsinnerbox-title">Service address</FONT>
3688     <INPUT TYPE="checkbox" 
3689            NAME="same"
3690            ID="same"
3691            onclick="samechanged(this)"
3692            onkeyup="samechanged(this)"
3693            VALUE="Y"
3694            CHECKED
3695     >same as billing address
3696     <DIV CLASS="fsinnerbox">
3697       <TABLE ID="table_ship_location" WIDTH="100%">
3698       
3699       
3700
3701     <INPUT TYPE  = "hidden"
3702        NAME  = "ship_locationname"
3703        ID    = "ship_locationname"
3704        VALUE = ""
3705 >
3706
3707
3708
3709
3710 <TR>
3711   <TH STYLE="width:16ex" ALIGN="right"><font color="#ff0000">*</font>&nbsp;Address</TH>
3712   <TD COLSPAN=7>
3713     <INPUT TYPE     = "text"
3714            NAME     = "ship_address1"
3715            ID       = "ship_address1"
3716            VALUE    = "46706 Kadin Hill #780"
3717            SIZE     = 54
3718            onChange = ""
3719            
3720            
3721     >
3722   </TD>
3723 </TR>
3724
3725
3726 <TR>
3727       <TD ALIGN="right"><FONT ID="ship_address2_required" color="#ff0000" STYLE="visibility:hidden">*</FONT>&nbsp;<FONT ID="ship_address2_label" STYLE="visibility:hidden"><B>Unit&nbsp;#</B></FONT></TD>
3728       <TD COLSPAN=7>
3729         <INPUT TYPE     = "text"
3730                NAME     = "ship_address2"
3731                ID       = "ship_address2"
3732                VALUE    = "Trailer W 2-E"
3733                SIZE     = 54
3734                onChange = ""
3735                
3736                
3737         >
3738       </TD>
3739 </TR>
3740
3741
3742
3743 <TR>
3744   <TH ALIGN="right">
3745   <font color="#ff0000">*</font>&nbsp;City
3746   </TH>
3747   <TD WIDTH="1">
3748
3749
3750 <SCRIPT TYPE="text/javascript">
3751
3752   function rs_init_object() {
3753     var A;
3754     try {
3755       A=new ActiveXObject("Msxml2.XMLHTTP");
3756     } catch (e) {
3757       try {
3758         A=new ActiveXObject("Microsoft.XMLHTTP");
3759       } catch (oc) {
3760         A=null;
3761       }
3762     }
3763     if(!A && typeof XMLHttpRequest != "undefined")
3764       A = new XMLHttpRequest();
3765     if (!A)
3766       alert("Can't create XMLHttpRequest object");
3767     return A;
3768
3769   }
3770
3771 </SCRIPT>
3772
3773
3774 <SCRIPT TYPE="text/javascript">
3775
3776
3777     function ship_get_cities() {
3778         // count args; build URL
3779         var url = "http://localhost/freeside/misc/cities.cgi?";
3780         var a = ship_get_cities.arguments;
3781
3782         var args;
3783         var len;
3784         var content = 'sub=ship_get_cities';
3785         if ( a && typeof a  == 'object'  && a[0].constructor == Array ) {
3786             args = a[0];
3787             len = args.length
3788         } else {
3789             args = a;
3790             len = args.length - 1;
3791         }
3792         for (var i = 0; i < len; i++) 
3793             content = content + "&arg=" + escape(args[i]);
3794         content = content.replace( /[+]/g, '%2B'); // fix unescaped plus signs 
3795
3796         if ( 'GET' == 'GET' ) {
3797           url = url + content;
3798         }
3799
3800         //alert('GET ' + url);
3801
3802         var xmlhttp = rs_init_object();
3803         xmlhttp.open("GET", url, true);
3804
3805         xmlhttp.onreadystatechange = function() {
3806             if (xmlhttp.readyState != 4) 
3807                 return;
3808
3809             if (xmlhttp.status != 200) {
3810               if ( xmlhttp.status != 0 ) {
3811                 //not warning on the 0 errors, they pop up when navagating away
3812                 // from the page
3813                 alert(xmlhttp.status + " status connecting to " + url);
3814               }
3815             } else {
3816               var data = xmlhttp.responseText;
3817               //alert('received response: ' + data);
3818               if ( data.indexOf("<b>System error</b>") > -1 ) {
3819                 // trim this a little
3820                 var end = data.indexOf('<a href="#raw">') - 1;
3821                 data = data.substring(0, end);
3822
3823                 overlib(data,
3824                   WIDTH, 480, MIDX, 0, MIDY, 0,
3825                   CAPTION, 'Error', STICKY, AUTOSTATUSCAP, DRAGGABLE,
3826                   CLOSECLICK, BGCOLOR, '#f00', CGCOLOR, '#f00'
3827                 );
3828                 //var w;
3829                 //if ( w = window.open("about:blank") ) {
3830                 //  w.document.write(data);
3831                 //} else {
3832                 //  // popup blocking?  should use an overlib popup instead 
3833                 //  alert("Error popup disabled; try disabling popup blocking to see");
3834                 //}
3835               } else {
3836                 // invoke the callback
3837                 a[a.length-1](data);
3838               }
3839             }
3840         }
3841
3842         if ( 'GET' == 'POST' ) {
3843
3844           xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
3845           xmlhttp.send(content);
3846
3847         } else {
3848
3849           xmlhttp.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
3850           xmlhttp.send(null);
3851
3852         }
3853
3854         //rs_debug("x_$func_name url = " + url);
3855         //rs_debug("x_$func_name waiting..");
3856     }
3857
3858
3859 </SCRIPT>
3860
3861
3862 <SCRIPT TYPE="text/javascript">
3863
3864   function opt(what,value,text) {
3865     var optionName = new Option(text, value, false, false);
3866     var length = what.length;
3867     what.options[length] = optionName;
3868   }
3869
3870   var saved_ship_city= 'Owensboro';
3871
3872   function ship_county_changed(what, callback) {
3873
3874     what.form.ship_city_select.disabled = 'disabled';
3875
3876     county  = what.options[what.selectedIndex].value;
3877     state   = what.form.ship_state.options[what.form.ship_state.selectedIndex].value;
3878     country = what.form.ship_country.options[what.form.ship_country.selectedIndex].value;
3879
3880     function ship_update_cities(cities) {
3881
3882       // blank the current city list
3883       for ( var i = what.form.ship_city_select.length; i >= 0; i-- )
3884           what.form.ship_city_select.options[i] = null;
3885
3886
3887       // add the new cities
3888       var citiesArray = eval('(' + cities + ')' );
3889
3890       for ( var s = 0; s < citiesArray.length; s++ ) {
3891           var cityLabel = citiesArray[s];
3892           if ( cityLabel == "" )
3893               cityLabel = '(n/a)';
3894           opt(what.form.ship_city_select, citiesArray[s], cityLabel);
3895       }
3896
3897      if ( citiesArray.length > 1 || (citiesArray[0] && citiesArray[0].length) ){
3898         // turn off the text city, turn on the select
3899         saved_ship_city = what.form.ship_city.value;
3900         ship_city_select_changed(what.form.ship_city_select);
3901         what.form.ship_city.style.display = 'none';
3902         what.form.ship_city_select.style.display = '';
3903       } else if ( what.form.ship_city.style.display == 'none' ) {
3904         // turn on the text city, turn off the select
3905         what.form.ship_city.value = saved_ship_city;
3906         what.form.ship_city.style.display = '';
3907         what.form.ship_city_select.style.display = 'none';
3908       }
3909
3910       what.form.ship_city_select.disabled = '';
3911
3912       //run the callback
3913       if ( callback != null )
3914         callback();
3915     }
3916
3917     // go get the new cities
3918     ship_get_cities( county, state, country, ship_update_cities );
3919
3920   }
3921
3922   function ship_city_select_changed(what) {
3923     what.form.ship_city.value = what.options[what.selectedIndex].value;
3924   }
3925
3926 </SCRIPT>
3927
3928
3929 <INPUT TYPE     = "text"
3930        NAME     = "ship_city"
3931        ID       = "ship_city"
3932        VALUE    = "Owensboro"
3933        onChange = ""
3934        
3935        
3936 >
3937
3938
3939     <SELECT NAME     = "ship_city_select"
3940             ID       = "ship_city_select"
3941             onChange = "ship_city_select_changed(this); "
3942             
3943             STYLE="display:none"
3944     >
3945
3946
3947
3948       <OPTION VALUE=""
3949               
3950       >
3951
3952
3953     </SELECT>
3954
3955 </TD>
3956   <TH ALIGN="right" WIDTH="1" ID="ship_countylabel" STYLE="display:none"><font color="#ff0000">*</font>&nbsp;County</TH>
3957   <TD WIDTH="1">
3958   <SCRIPT TYPE="text/javascript">
3959     function ship_state_changed(what) {
3960     }
3961   </SCRIPT>
3962
3963   <SELECT NAME  = "ship_county"
3964            ID   = "ship_county"
3965           STYLE = "display:none"
3966   >
3967     <OPTION SELECTED VALUE="">
3968   </SELECT>
3969
3970
3971 </TD>
3972   <TH ALIGN="right" WIDTH="1"><font color="#ff0000">*</font>&nbsp;State</TH>
3973   <TD WIDTH="1">
3974     
3975 <SELECT NAME     = "ship_state"
3976         ID       = "ship_state"
3977         onChange = "ship_state_changed(this); "
3978         
3979         
3980 >
3981
3982
3983
3984   <OPTION VALUE="AK">AK
3985
3986
3987   <OPTION VALUE="AL">AL
3988
3989
3990   <OPTION VALUE="AR">AR
3991
3992
3993   <OPTION VALUE="AS">AS
3994
3995
3996   <OPTION VALUE="AZ">AZ
3997
3998
3999   <OPTION VALUE="CA">CA
4000
4001
4002   <OPTION VALUE="CO">CO
4003
4004
4005   <OPTION VALUE="CT">CT
4006
4007
4008   <OPTION VALUE="DC">DC
4009
4010
4011   <OPTION VALUE="DE">DE
4012
4013
4014   <OPTION VALUE="FL">FL
4015
4016
4017   <OPTION VALUE="GA">GA
4018
4019
4020   <OPTION VALUE="GU">GU
4021
4022
4023   <OPTION VALUE="HI">HI
4024
4025
4026   <OPTION VALUE="IA">IA
4027
4028
4029   <OPTION VALUE="ID">ID
4030
4031
4032   <OPTION VALUE="IL">IL
4033
4034
4035   <OPTION VALUE="IN">IN
4036
4037
4038   <OPTION VALUE="KS" SELECTED>KS
4039
4040
4041   <OPTION VALUE="KY">KY
4042
4043
4044   <OPTION VALUE="LA">LA
4045
4046
4047   <OPTION VALUE="MA">MA
4048
4049
4050   <OPTION VALUE="MD">MD
4051
4052
4053   <OPTION VALUE="ME">ME
4054
4055
4056   <OPTION VALUE="MI">MI
4057
4058
4059   <OPTION VALUE="MN">MN
4060
4061
4062   <OPTION VALUE="MO">MO
4063
4064
4065   <OPTION VALUE="MP">MP
4066
4067
4068   <OPTION VALUE="MS">MS
4069
4070
4071   <OPTION VALUE="MT">MT
4072
4073
4074   <OPTION VALUE="NC">NC
4075
4076
4077   <OPTION VALUE="ND">ND
4078
4079
4080   <OPTION VALUE="NE">NE
4081
4082
4083   <OPTION VALUE="NH">NH
4084
4085
4086   <OPTION VALUE="NJ">NJ
4087
4088
4089   <OPTION VALUE="NM">NM
4090
4091
4092   <OPTION VALUE="NV">NV
4093
4094
4095   <OPTION VALUE="NY">NY
4096
4097
4098   <OPTION VALUE="OH">OH
4099
4100
4101   <OPTION VALUE="OK">OK
4102
4103
4104   <OPTION VALUE="OR">OR
4105
4106
4107   <OPTION VALUE="PA">PA
4108
4109
4110   <OPTION VALUE="PR">PR
4111
4112
4113   <OPTION VALUE="RI">RI
4114
4115
4116   <OPTION VALUE="SC">SC
4117
4118
4119   <OPTION VALUE="SD">SD
4120
4121
4122   <OPTION VALUE="TN">TN
4123
4124
4125   <OPTION VALUE="TX">TX
4126
4127
4128   <OPTION VALUE="UM">UM
4129
4130
4131   <OPTION VALUE="UT">UT
4132
4133
4134   <OPTION VALUE="VA">VA
4135
4136
4137   <OPTION VALUE="VI">VI
4138
4139
4140   <OPTION VALUE="VT">VT
4141
4142
4143   <OPTION VALUE="WA">WA
4144
4145
4146   <OPTION VALUE="WI">WI
4147
4148
4149   <OPTION VALUE="WV">WV
4150
4151
4152   <OPTION VALUE="WY">WY
4153
4154
4155
4156 </SELECT>
4157
4158
4159
4160   </TD>
4161   <TH ALIGN="right" WIDTH="1"><font color="#ff0000">*</font>&nbsp;Zip</TH>
4162   <TD>
4163     <INPUT TYPE     = "text"
4164            NAME     = "ship_zip"
4165            ID       = "ship_zip"
4166            VALUE    = "69113"
4167            SIZE     = 11
4168            onChange = ""
4169            
4170            
4171     >
4172   </TD>
4173 </TR>
4174
4175 <TR>
4176   <TH ALIGN="right"><font color="#ff0000">*</font>&nbsp;Country</TH>
4177   <TD COLSPAN=6>
4178   <SCRIPT TYPE="text/javascript">
4179
4180   function rs_init_object() {
4181     var A;
4182     try {
4183       A=new ActiveXObject("Msxml2.XMLHTTP");
4184     } catch (e) {
4185       try {
4186         A=new ActiveXObject("Microsoft.XMLHTTP");
4187       } catch (oc) {
4188         A=null;
4189       }
4190     }
4191     if(!A && typeof XMLHttpRequest != "undefined")
4192       A = new XMLHttpRequest();
4193     if (!A)
4194       alert("Can't create XMLHttpRequest object");
4195     return A;
4196
4197   }
4198
4199 </SCRIPT>
4200
4201
4202 <SCRIPT TYPE="text/javascript">
4203
4204
4205     function ship_get_states() {
4206         // count args; build URL
4207         var url = "http://localhost/freeside/misc/states.cgi?";
4208         var a = ship_get_states.arguments;
4209
4210         var args;
4211         var len;
4212         var content = 'sub=ship_get_states';
4213         if ( a && typeof a  == 'object'  && a[0].constructor == Array ) {
4214             args = a[0];
4215             len = args.length
4216         } else {
4217             args = a;
4218             len = args.length - 1;
4219         }
4220         for (var i = 0; i < len; i++) 
4221             content = content + "&arg=" + escape(args[i]);
4222         content = content.replace( /[+]/g, '%2B'); // fix unescaped plus signs 
4223
4224         if ( 'GET' == 'GET' ) {
4225           url = url + content;
4226         }
4227
4228         //alert('GET ' + url);
4229
4230         var xmlhttp = rs_init_object();
4231         xmlhttp.open("GET", url, true);
4232
4233         xmlhttp.onreadystatechange = function() {
4234             if (xmlhttp.readyState != 4) 
4235                 return;
4236
4237             if (xmlhttp.status != 200) {
4238               if ( xmlhttp.status != 0 ) {
4239                 //not warning on the 0 errors, they pop up when navagating away
4240                 // from the page
4241                 alert(xmlhttp.status + " status connecting to " + url);
4242               }
4243             } else {
4244               var data = xmlhttp.responseText;
4245               //alert('received response: ' + data);
4246               if ( data.indexOf("<b>System error</b>") > -1 ) {
4247                 // trim this a little
4248                 var end = data.indexOf('<a href="#raw">') - 1;
4249                 data = data.substring(0, end);
4250
4251                 overlib(data,
4252                   WIDTH, 480, MIDX, 0, MIDY, 0,
4253                   CAPTION, 'Error', STICKY, AUTOSTATUSCAP, DRAGGABLE,
4254                   CLOSECLICK, BGCOLOR, '#f00', CGCOLOR, '#f00'
4255                 );
4256                 //var w;
4257                 //if ( w = window.open("about:blank") ) {
4258                 //  w.document.write(data);
4259                 //} else {
4260                 //  // popup blocking?  should use an overlib popup instead 
4261                 //  alert("Error popup disabled; try disabling popup blocking to see");
4262                 //}
4263               } else {
4264                 // invoke the callback
4265                 a[a.length-1](data);
4266               }
4267             }
4268         }
4269
4270         if ( 'GET' == 'POST' ) {
4271
4272           xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
4273           xmlhttp.send(content);
4274
4275         } else {
4276
4277           xmlhttp.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
4278           xmlhttp.send(null);
4279
4280         }
4281
4282         //rs_debug("x_$func_name url = " + url);
4283         //rs_debug("x_$func_name waiting..");
4284     }
4285
4286
4287 </SCRIPT>
4288
4289   
4290   <SCRIPT TYPE="text/javascript">
4291   
4292     function opt(what,value,text) {
4293       var optionName = new Option(text, value, false, false);
4294       var length = what.length;
4295       what.options[length] = optionName;
4296     }
4297   
4298     function ship_country_changed(what, callback) {
4299
4300       what.form.ship_state.disabled = 'disabled';
4301   
4302       country = what.options[what.selectedIndex].value;
4303   
4304       function ship_update_states(states) {
4305   
4306         // blank the current state list
4307         for ( var i = what.form.ship_state.length; i >= 0; i-- )
4308             what.form.ship_state.options[i] = null;
4309   
4310         // add the new states
4311         var statesArray = eval('(' + states + ')' );
4312
4313         for ( var s = 0; s < statesArray.length; s=s+2 ) {
4314             var stateLabel = statesArray[s+1];
4315             if ( stateLabel == "" )
4316                 stateLabel = '(n/a)';
4317             opt(what.form.ship_state, statesArray[s], stateLabel);
4318         }
4319
4320         what.form.ship_state.disabled = '';
4321   
4322         //run the callback
4323         if ( callback != null ) {
4324           callback();
4325         } else {
4326           ship_state_changed(what.form.ship_state);
4327         }
4328       }
4329   
4330       // go get the new states
4331       ship_get_states( country, ship_update_states );
4332   
4333     }
4334   
4335   </SCRIPT>
4336
4337
4338 <SELECT NAME     = "ship_country"
4339         ID       = "ship_country"
4340         onChange = "ship_country_changed(this); "
4341         
4342         
4343 >
4344
4345
4346
4347   <OPTION VALUE="US"
4348            SELECTED
4349   >United States (US)
4350
4351
4352   <OPTION VALUE="AF"
4353           
4354   >Afghanistan (AF)
4355
4356
4357   <OPTION VALUE="AX"
4358           
4359   >Aland Islands (AX)
4360
4361
4362   <OPTION VALUE="AL"
4363           
4364   >Albania (AL)
4365
4366
4367   <OPTION VALUE="DZ"
4368           
4369   >Algeria (DZ)
4370
4371
4372   <OPTION VALUE="AS"
4373           
4374   >American Samoa (AS)
4375
4376
4377   <OPTION VALUE="AD"
4378           
4379   >Andorra (AD)
4380
4381
4382   <OPTION VALUE="AO"
4383           
4384   >Angola (AO)
4385
4386
4387   <OPTION VALUE="AI"
4388           
4389   >Anguilla (AI)
4390
4391
4392   <OPTION VALUE="AQ"
4393           
4394   >Antarctica (AQ)
4395
4396
4397   <OPTION VALUE="AG"
4398           
4399   >Antigua and Barbuda (AG)
4400
4401
4402   <OPTION VALUE="AR"
4403           
4404   >Argentina (AR)
4405
4406
4407   <OPTION VALUE="AM"
4408           
4409   >Armenia (AM)
4410
4411
4412   <OPTION VALUE="AW"
4413           
4414   >Aruba (AW)
4415
4416
4417   <OPTION VALUE="AU"
4418           
4419   >Australia (AU)
4420
4421
4422   <OPTION VALUE="AT"
4423           
4424   >Austria (AT)
4425
4426
4427   <OPTION VALUE="AZ"
4428           
4429   >Azerbaijan (AZ)
4430
4431
4432   <OPTION VALUE="BS"
4433           
4434   >Bahamas (BS)
4435
4436
4437   <OPTION VALUE="BH"
4438           
4439   >Bahrain (BH)
4440
4441
4442   <OPTION VALUE="BD"
4443           
4444   >Bangladesh (BD)
4445
4446
4447   <OPTION VALUE="BB"
4448           
4449   >Barbados (BB)
4450
4451
4452   <OPTION VALUE="BY"
4453           
4454   >Belarus (BY)
4455
4456
4457   <OPTION VALUE="BE"
4458           
4459   >Belgium (BE)
4460
4461
4462   <OPTION VALUE="BZ"
4463           
4464   >Belize (BZ)
4465
4466
4467   <OPTION VALUE="BJ"
4468           
4469   >Benin (BJ)
4470
4471
4472   <OPTION VALUE="BM"
4473           
4474   >Bermuda (BM)
4475
4476
4477   <OPTION VALUE="BT"
4478           
4479   >Bhutan (BT)
4480
4481
4482   <OPTION VALUE="BO"
4483           
4484   >Bolivia, Plurinational State of (BO)
4485
4486
4487   <OPTION VALUE="BQ"
4488           
4489   >Bonaire, Sint Eustatius and Saba (BQ)
4490
4491
4492   <OPTION VALUE="BA"
4493           
4494   >Bosnia and Herzegovina (BA)
4495
4496
4497   <OPTION VALUE="BW"
4498           
4499   >Botswana (BW)
4500
4501
4502   <OPTION VALUE="BV"
4503           
4504   >Bouvet Island (BV)
4505
4506
4507   <OPTION VALUE="BR"
4508           
4509   >Brazil (BR)
4510
4511
4512   <OPTION VALUE="IO"
4513           
4514   >British Indian Ocean Territory (IO)
4515
4516
4517   <OPTION VALUE="BN"
4518           
4519   >Brunei Darussalam (BN)
4520
4521
4522   <OPTION VALUE="BG"
4523           
4524   >Bulgaria (BG)
4525
4526
4527   <OPTION VALUE="BF"
4528           
4529   >Burkina Faso (BF)
4530
4531
4532   <OPTION VALUE="BI"
4533           
4534   >Burundi (BI)
4535
4536
4537   <OPTION VALUE="KH"
4538           
4539   >Cambodia (KH)
4540
4541
4542   <OPTION VALUE="CM"
4543           
4544   >Cameroon (CM)
4545
4546
4547   <OPTION VALUE="CA"
4548           
4549   >Canada (CA)
4550
4551
4552   <OPTION VALUE="CV"
4553           
4554   >Cape Verde (CV)
4555
4556
4557   <OPTION VALUE="KY"
4558           
4559   >Cayman Islands (KY)
4560
4561
4562   <OPTION VALUE="CF"
4563           
4564   >Central African Republic (CF)
4565
4566
4567   <OPTION VALUE="TD"
4568           
4569   >Chad (TD)
4570
4571
4572   <OPTION VALUE="CL"
4573           
4574   >Chile (CL)
4575
4576
4577   <OPTION VALUE="CN"
4578           
4579   >China (CN)
4580
4581
4582   <OPTION VALUE="CX"
4583           
4584   >Christmas Island (CX)
4585
4586
4587   <OPTION VALUE="CC"
4588           
4589   >Cocos (Keeling) Islands (CC)
4590
4591
4592   <OPTION VALUE="CO"
4593           
4594   >Colombia (CO)
4595
4596
4597   <OPTION VALUE="KM"
4598           
4599   >Comoros (KM)
4600
4601
4602   <OPTION VALUE="CG"
4603           
4604   >Congo (CG)
4605
4606
4607   <OPTION VALUE="CD"
4608           
4609   >Congo (The Democratic Republic of the) (CD)
4610
4611
4612   <OPTION VALUE="CK"
4613           
4614   >Cook Islands (CK)
4615
4616
4617   <OPTION VALUE="CR"
4618           
4619   >Costa Rica (CR)
4620
4621
4622   <OPTION VALUE="CI"
4623           
4624   >Cote d'Ivoire (CI)
4625
4626
4627   <OPTION VALUE="HR"
4628           
4629   >Croatia (HR)
4630
4631
4632   <OPTION VALUE="CU"
4633           
4634   >Cuba (CU)
4635
4636
4637   <OPTION VALUE="CW"
4638           
4639   >Curacao (CW)
4640
4641
4642   <OPTION VALUE="CY"
4643           
4644   >Cyprus (CY)
4645
4646
4647   <OPTION VALUE="CZ"
4648           
4649   >Czech Republic (CZ)
4650
4651
4652   <OPTION VALUE="DK"
4653           
4654   >Denmark (DK)
4655
4656
4657   <OPTION VALUE="DJ"
4658           
4659   >Djibouti (DJ)
4660
4661
4662   <OPTION VALUE="DM"
4663           
4664   >Dominica (DM)
4665
4666
4667   <OPTION VALUE="DO"
4668           
4669   >Dominican Republic (DO)
4670
4671
4672   <OPTION VALUE="EC"
4673           
4674   >Ecuador (EC)
4675
4676
4677   <OPTION VALUE="EG"
4678           
4679   >Egypt (EG)
4680
4681
4682   <OPTION VALUE="SV"
4683           
4684   >El Salvador (SV)
4685
4686
4687   <OPTION VALUE="GQ"
4688           
4689   >Equatorial Guinea (GQ)
4690
4691
4692   <OPTION VALUE="ER"
4693           
4694   >Eritrea (ER)
4695
4696
4697   <OPTION VALUE="EE"
4698           
4699   >Estonia (EE)
4700
4701
4702   <OPTION VALUE="ET"
4703           
4704   >Ethiopia (ET)
4705
4706
4707   <OPTION VALUE="FK"
4708           
4709   >Falkland Islands (The) [Malvinas] (FK)
4710
4711
4712   <OPTION VALUE="FO"
4713           
4714   >Faroe Islands (FO)
4715
4716
4717   <OPTION VALUE="FJ"
4718           
4719   >Fiji (FJ)
4720
4721
4722   <OPTION VALUE="FI"
4723           
4724   >Finland (FI)
4725
4726
4727   <OPTION VALUE="FR"
4728           
4729   >France (FR)
4730
4731
4732   <OPTION VALUE="GF"
4733           
4734   >French Guiana (GF)
4735
4736
4737   <OPTION VALUE="PF"
4738           
4739   >French Polynesia (PF)
4740
4741
4742   <OPTION VALUE="TF"
4743           
4744   >French Southern Territories (TF)
4745
4746
4747   <OPTION VALUE="GA"
4748           
4749   >Gabon (GA)
4750
4751
4752   <OPTION VALUE="GM"
4753           
4754   >Gambia (GM)
4755
4756
4757   <OPTION VALUE="GE"
4758           
4759   >Georgia (GE)
4760
4761
4762   <OPTION VALUE="DE"
4763           
4764   >Germany (DE)
4765
4766
4767   <OPTION VALUE="GH"
4768           
4769   >Ghana (GH)
4770
4771
4772   <OPTION VALUE="GI"
4773           
4774   >Gibraltar (GI)
4775
4776
4777   <OPTION VALUE="GR"
4778           
4779   >Greece (GR)
4780
4781
4782   <OPTION VALUE="GL"
4783           
4784   >Greenland (GL)
4785
4786
4787   <OPTION VALUE="GD"
4788           
4789   >Grenada (GD)
4790
4791
4792   <OPTION VALUE="GP"
4793           
4794   >Guadeloupe (GP)
4795
4796
4797   <OPTION VALUE="GU"
4798           
4799   >Guam (GU)
4800
4801
4802   <OPTION VALUE="GT"
4803           
4804   >Guatemala (GT)
4805
4806
4807   <OPTION VALUE="GG"
4808           
4809   >Guernsey (GG)
4810
4811
4812   <OPTION VALUE="GN"
4813           
4814   >Guinea (GN)
4815
4816
4817   <OPTION VALUE="GW"
4818           
4819   >Guinea-Bissau (GW)
4820
4821
4822   <OPTION VALUE="GY"
4823           
4824   >Guyana (GY)
4825
4826
4827   <OPTION VALUE="HT"
4828           
4829   >Haiti (HT)
4830
4831
4832   <OPTION VALUE="HM"
4833           
4834   >Heard Island and McDonald Islands (HM)
4835
4836
4837   <OPTION VALUE="VA"
4838           
4839   >Holy See (The) [Vatican City State] (VA)
4840
4841
4842   <OPTION VALUE="HN"
4843           
4844   >Honduras (HN)
4845
4846
4847   <OPTION VALUE="HK"
4848           
4849   >Hong Kong (HK)
4850
4851
4852   <OPTION VALUE="HU"
4853           
4854   >Hungary (HU)
4855
4856
4857   <OPTION VALUE="IS"
4858           
4859   >Iceland (IS)
4860
4861
4862   <OPTION VALUE="IN"
4863           
4864   >India (IN)
4865
4866
4867   <OPTION VALUE="ID"
4868           
4869   >Indonesia (ID)
4870
4871
4872   <OPTION VALUE="IR"
4873           
4874   >Iran, The Islamic Republic of (IR)
4875
4876
4877   <OPTION VALUE="IQ"
4878           
4879   >Iraq (IQ)
4880
4881
4882   <OPTION VALUE="IE"
4883           
4884   >Ireland (IE)
4885
4886
4887   <OPTION VALUE="IM"
4888           
4889   >Isle of Man (IM)
4890
4891
4892   <OPTION VALUE="IL"
4893           
4894   >Israel (IL)
4895
4896
4897   <OPTION VALUE="IT"
4898           
4899   >Italy (IT)
4900
4901
4902   <OPTION VALUE="JM"
4903           
4904   >Jamaica (JM)
4905
4906
4907   <OPTION VALUE="JP"
4908           
4909   >Japan (JP)
4910
4911
4912   <OPTION VALUE="JE"
4913           
4914   >Jersey (JE)
4915
4916
4917   <OPTION VALUE="JO"
4918           
4919   >Jordan (JO)
4920
4921
4922   <OPTION VALUE="KZ"
4923           
4924   >Kazakhstan (KZ)
4925
4926
4927   <OPTION VALUE="KE"
4928           
4929   >Kenya (KE)
4930
4931
4932   <OPTION VALUE="KI"
4933           
4934   >Kiribati (KI)
4935
4936
4937   <OPTION VALUE="KP"
4938           
4939   >Korea, The Democratic People's Republic of (KP)
4940
4941
4942   <OPTION VALUE="KR"
4943           
4944   >Korea, The Republic of (KR)
4945
4946
4947   <OPTION VALUE="KW"
4948           
4949   >Kuwait (KW)
4950
4951
4952   <OPTION VALUE="KG"
4953           
4954   >Kyrgyzstan (KG)
4955
4956
4957   <OPTION VALUE="LA"
4958           
4959   >Lao People's Democratic Republic (LA)
4960
4961
4962   <OPTION VALUE="LV"
4963           
4964   >Latvia (LV)
4965
4966
4967   <OPTION VALUE="LB"
4968           
4969   >Lebanon (LB)
4970
4971
4972   <OPTION VALUE="LS"
4973           
4974   >Lesotho (LS)
4975
4976
4977   <OPTION VALUE="LR"
4978           
4979   >Liberia (LR)
4980
4981
4982   <OPTION VALUE="LY"
4983           
4984   >Libya (LY)
4985
4986
4987   <OPTION VALUE="LI"
4988           
4989   >Liechtenstein (LI)
4990
4991
4992   <OPTION VALUE="LT"
4993           
4994   >Lithuania (LT)
4995
4996
4997   <OPTION VALUE="LU"
4998           
4999   >Luxembourg (LU)
5000
5001
5002   <OPTION VALUE="MO"
5003           
5004   >Macao (MO)
5005
5006
5007   <OPTION VALUE="MK"
5008           
5009   >Macedonia, The former Yugoslav Republic of (MK)
5010
5011
5012   <OPTION VALUE="MG"
5013           
5014   >Madagascar (MG)
5015
5016
5017   <OPTION VALUE="MW"
5018           
5019   >Malawi (MW)
5020
5021
5022   <OPTION VALUE="MY"
5023           
5024   >Malaysia (MY)
5025
5026
5027   <OPTION VALUE="MV"
5028           
5029   >Maldives (MV)
5030
5031
5032   <OPTION VALUE="ML"
5033           
5034   >Mali (ML)
5035
5036
5037   <OPTION VALUE="MT"
5038           
5039   >Malta (MT)
5040
5041
5042   <OPTION VALUE="MH"
5043           
5044   >Marshall Islands (MH)
5045
5046
5047   <OPTION VALUE="MQ"
5048           
5049   >Martinique (MQ)
5050
5051
5052   <OPTION VALUE="MR"
5053           
5054   >Mauritania (MR)
5055
5056
5057   <OPTION VALUE="MU"
5058           
5059   >Mauritius (MU)
5060
5061
5062   <OPTION VALUE="YT"
5063           
5064   >Mayotte (YT)
5065
5066
5067   <OPTION VALUE="MX"
5068           
5069   >Mexico (MX)
5070
5071
5072   <OPTION VALUE="FM"
5073           
5074   >Micronesia, The Federated States of (FM)
5075
5076
5077   <OPTION VALUE="MD"
5078           
5079   >Moldova, The Republic of (MD)
5080
5081
5082   <OPTION VALUE="MC"
5083           
5084   >Monaco (MC)
5085
5086
5087   <OPTION VALUE="MN"
5088           
5089   >Mongolia (MN)
5090
5091
5092   <OPTION VALUE="ME"
5093           
5094   >Montenegro (ME)
5095
5096
5097   <OPTION VALUE="MS"
5098           
5099   >Montserrat (MS)
5100
5101
5102   <OPTION VALUE="MA"
5103           
5104   >Morocco (MA)
5105
5106
5107   <OPTION VALUE="MZ"
5108           
5109   >Mozambique (MZ)
5110
5111
5112   <OPTION VALUE="MM"
5113           
5114   >Myanmar (MM)
5115
5116
5117   <OPTION VALUE="NA"
5118           
5119   >Namibia (NA)
5120
5121
5122   <OPTION VALUE="NR"
5123           
5124   >Nauru (NR)
5125
5126
5127   <OPTION VALUE="NP"
5128           
5129   >Nepal (NP)
5130
5131
5132   <OPTION VALUE="NL"
5133           
5134   >Netherlands (NL)
5135
5136
5137   <OPTION VALUE="NC"
5138           
5139   >New Caledonia (NC)
5140
5141
5142   <OPTION VALUE="NZ"
5143           
5144   >New Zealand (NZ)
5145
5146
5147   <OPTION VALUE="NI"
5148           
5149   >Nicaragua (NI)
5150
5151
5152   <OPTION VALUE="NE"
5153           
5154   >Niger (NE)
5155
5156
5157   <OPTION VALUE="NG"
5158           
5159   >Nigeria (NG)
5160
5161
5162   <OPTION VALUE="NU"
5163           
5164   >Niue (NU)
5165
5166
5167   <OPTION VALUE="NF"
5168           
5169   >Norfolk Island (NF)
5170
5171
5172   <OPTION VALUE="MP"
5173           
5174   >Northern Mariana Islands (MP)
5175
5176
5177   <OPTION VALUE="NO"
5178           
5179   >Norway (NO)
5180
5181
5182   <OPTION VALUE="OM"
5183           
5184   >Oman (OM)
5185
5186
5187   <OPTION VALUE="PK"
5188           
5189   >Pakistan (PK)
5190
5191
5192   <OPTION VALUE="PW"
5193           
5194   >Palau (PW)
5195
5196
5197   <OPTION VALUE="PS"
5198           
5199   >Palestine, State of (PS)
5200
5201
5202   <OPTION VALUE="PA"
5203           
5204   >Panama (PA)
5205
5206
5207   <OPTION VALUE="PG"
5208           
5209   >Papua New Guinea (PG)
5210
5211
5212   <OPTION VALUE="PY"
5213           
5214   >Paraguay (PY)
5215
5216
5217   <OPTION VALUE="PE"
5218           
5219   >Peru (PE)
5220
5221
5222   <OPTION VALUE="PH"
5223           
5224   >Philippines (PH)
5225
5226
5227   <OPTION VALUE="PN"
5228           
5229   >Pitcairn (PN)
5230
5231
5232   <OPTION VALUE="PL"
5233           
5234   >Poland (PL)
5235
5236
5237   <OPTION VALUE="PT"
5238           
5239   >Portugal (PT)
5240
5241
5242   <OPTION VALUE="PR"
5243           
5244   >Puerto Rico (PR)
5245
5246
5247   <OPTION VALUE="QA"
5248           
5249   >Qatar (QA)
5250
5251
5252   <OPTION VALUE="RE"
5253           
5254   >Reunion (RE)
5255
5256
5257   <OPTION VALUE="RO"
5258           
5259   >Romania (RO)
5260
5261
5262   <OPTION VALUE="RU"
5263           
5264   >Russian Federation (RU)
5265
5266
5267   <OPTION VALUE="RW"
5268           
5269   >Rwanda (RW)
5270
5271
5272   <OPTION VALUE="BL"
5273           
5274   >Saint Barthelemy (BL)
5275
5276
5277   <OPTION VALUE="SH"
5278           
5279   >Saint Helena, Ascension and Tristan da Cunha (SH)
5280
5281
5282   <OPTION VALUE="KN"
5283           
5284   >Saint Kitts and Nevis (KN)
5285
5286
5287   <OPTION VALUE="LC"
5288           
5289   >Saint Lucia (LC)
5290
5291
5292   <OPTION VALUE="MF"
5293           
5294   >Saint Martin (French part) (MF)
5295
5296
5297   <OPTION VALUE="PM"
5298           
5299   >Saint Pierre and Miquelon (PM)
5300
5301
5302   <OPTION VALUE="VC"
5303           
5304   >Saint Vincent and the Grenadines (VC)
5305
5306
5307   <OPTION VALUE="WS"
5308           
5309   >Samoa (WS)
5310
5311
5312   <OPTION VALUE="SM"
5313           
5314   >San Marino (SM)
5315
5316
5317   <OPTION VALUE="ST"
5318           
5319   >Sao Tome and Principe (ST)
5320
5321
5322   <OPTION VALUE="SA"
5323           
5324   >Saudi Arabia (SA)
5325
5326
5327   <OPTION VALUE="SN"
5328           
5329   >Senegal (SN)
5330
5331
5332   <OPTION VALUE="RS"
5333           
5334   >Serbia (RS)
5335
5336
5337   <OPTION VALUE="SC"
5338           
5339   >Seychelles (SC)
5340
5341
5342   <OPTION VALUE="SL"
5343           
5344   >Sierra Leone (SL)
5345
5346
5347   <OPTION VALUE="SG"
5348           
5349   >Singapore (SG)
5350
5351
5352   <OPTION VALUE="SX"
5353           
5354   >Sint Maarten (Dutch part) (SX)
5355
5356
5357   <OPTION VALUE="SK"
5358           
5359   >Slovakia (SK)
5360
5361
5362   <OPTION VALUE="SI"
5363           
5364   >Slovenia (SI)
5365
5366
5367   <OPTION VALUE="SB"
5368           
5369   >Solomon Islands (SB)
5370
5371
5372   <OPTION VALUE="SO"
5373           
5374   >Somalia (SO)
5375
5376
5377   <OPTION VALUE="ZA"
5378           
5379   >South Africa (ZA)
5380
5381
5382   <OPTION VALUE="GS"
5383           
5384   >South Georgia and the South Sandwich Islands (GS)
5385
5386
5387   <OPTION VALUE="SS"
5388           
5389   >South Sudan (SS)
5390
5391
5392   <OPTION VALUE="ES"
5393           
5394   >Spain (ES)
5395
5396
5397   <OPTION VALUE="LK"
5398           
5399   >Sri Lanka (LK)
5400
5401
5402   <OPTION VALUE="SD"
5403           
5404   >Sudan (SD)
5405
5406
5407   <OPTION VALUE="SR"
5408           
5409   >Suriname (SR)
5410
5411
5412   <OPTION VALUE="SJ"
5413           
5414   >Svalbard and Jan Mayen (SJ)
5415
5416
5417   <OPTION VALUE="SZ"
5418           
5419   >Swaziland (SZ)
5420
5421
5422   <OPTION VALUE="SE"
5423           
5424   >Sweden (SE)
5425
5426
5427   <OPTION VALUE="CH"
5428           
5429   >Switzerland (CH)
5430
5431
5432   <OPTION VALUE="SY"
5433           
5434   >Syrian Arab Republic (SY)
5435
5436
5437   <OPTION VALUE="TW"
5438           
5439   >Taiwan (Province of China) (TW)
5440
5441
5442   <OPTION VALUE="TJ"
5443           
5444   >Tajikistan (TJ)
5445
5446
5447   <OPTION VALUE="TZ"
5448           
5449   >Tanzania, United Republic of (TZ)
5450
5451
5452   <OPTION VALUE="TH"
5453           
5454   >Thailand (TH)
5455
5456
5457   <OPTION VALUE="TL"
5458           
5459   >Timor-Leste (TL)
5460
5461
5462   <OPTION VALUE="TG"
5463           
5464   >Togo (TG)
5465
5466
5467   <OPTION VALUE="TK"
5468           
5469   >Tokelau (TK)
5470
5471
5472   <OPTION VALUE="TO"
5473           
5474   >Tonga (TO)
5475
5476
5477   <OPTION VALUE="TT"
5478           
5479   >Trinidad and Tobago (TT)
5480
5481
5482   <OPTION VALUE="TN"
5483           
5484   >Tunisia (TN)
5485
5486
5487   <OPTION VALUE="TR"
5488           
5489   >Turkey (TR)
5490
5491
5492   <OPTION VALUE="TM"
5493           
5494   >Turkmenistan (TM)
5495
5496
5497   <OPTION VALUE="TC"
5498           
5499   >Turks and Caicos Islands (TC)
5500
5501
5502   <OPTION VALUE="TV"
5503           
5504   >Tuvalu (TV)
5505
5506
5507   <OPTION VALUE="UG"
5508           
5509   >Uganda (UG)
5510
5511
5512   <OPTION VALUE="UA"
5513           
5514   >Ukraine (UA)
5515
5516
5517   <OPTION VALUE="AE"
5518           
5519   >United Arab Emirates (AE)
5520
5521
5522   <OPTION VALUE="GB"
5523           
5524   >United Kingdom (GB)
5525
5526
5527   <OPTION VALUE="UM"
5528           
5529   >United States Minor Outlying Islands (UM)
5530
5531
5532   <OPTION VALUE="UY"
5533           
5534   >Uruguay (UY)
5535
5536
5537   <OPTION VALUE="UZ"
5538           
5539   >Uzbekistan (UZ)
5540
5541
5542   <OPTION VALUE="VU"
5543           
5544   >Vanuatu (VU)
5545
5546
5547   <OPTION VALUE="VE"
5548           
5549   >Venezuela, Bolivarian Republic of  (VE)
5550
5551
5552   <OPTION VALUE="VN"
5553           
5554   >Viet Nam (VN)
5555
5556
5557   <OPTION VALUE="VG"
5558           
5559   >Virgin Islands (British) (VG)
5560
5561
5562   <OPTION VALUE="VI"
5563           
5564   >Virgin Islands (U.S.) (VI)
5565
5566
5567   <OPTION VALUE="WF"
5568           
5569   >Wallis and Futuna (WF)
5570
5571
5572   <OPTION VALUE="EH"
5573           
5574   >Western Sahara (EH)
5575
5576
5577   <OPTION VALUE="YE"
5578           
5579   >Yemen (YE)
5580
5581
5582   <OPTION VALUE="ZM"
5583           
5584   >Zambia (ZM)
5585
5586
5587   <OPTION VALUE="ZW"
5588           
5589   >Zimbabwe (ZW)
5590
5591
5592 </SELECT>
5593
5594 </TD>
5595 </TR>
5596
5597 <TR>
5598   <TD ALIGN="right">Latitude</TD>
5599   <TD COLSPAN=7>
5600     <INPUT TYPE  = "text"
5601            NAME  = "ship_latitude"
5602            ID    = "ship_latitude"
5603            VALUE = "38.5000000"
5604            
5605            
5606     >
5607     Longitude
5608     <INPUT TYPE  = "text"
5609            NAME  = "ship_longitude"
5610            ID    = "ship_longitude"
5611            VALUE = "-121.5000000"
5612            
5613            
5614     >
5615   </TD>
5616 </TR>
5617   <INPUT TYPE  = "hidden"
5618        NAME  = "ship_coord_auto"
5619        ID    = "ship_coord_auto"
5620        VALUE = "Y"
5621 >
5622
5623
5624   <INPUT TYPE  = "hidden"
5625        NAME  = "ship_geocode"
5626        ID    = "ship_geocode"
5627        VALUE = ""
5628 >
5629
5630
5631   <INPUT TYPE  = "hidden"
5632        NAME  = "ship_censustract"
5633        ID    = "ship_censustract"
5634        VALUE = ""
5635 >
5636
5637
5638   <INPUT TYPE  = "hidden"
5639        NAME  = "ship_censusyear"
5640        ID    = "ship_censusyear"
5641        VALUE = ""
5642 >
5643
5644
5645 <TR>
5646   <TD ALIGN="right">Census&nbsp;tract</TD>
5647   <TD COLSPAN=8>
5648     <INPUT TYPE="text" SIZE=15
5649            ID="ship_enter_censustract" 
5650            NAME="ship_enter_censustract" 
5651            VALUE="">
5652     (automatic)
5653   </TD>
5654 </TR>
5655   <INPUT TYPE  = "hidden"
5656        NAME  = "ship_district"
5657        ID    = "ship_district"
5658        VALUE = ""
5659 >
5660
5661
5662
5663 <INPUT TYPE  = "hidden"
5664        NAME  = "old_ship_address1"
5665        ID    = "old_ship_address1"
5666        VALUE = "46706 Kadin Hill #780"
5667 >
5668
5669
5670 <INPUT TYPE  = "hidden"
5671        NAME  = "old_ship_city"
5672        ID    = "old_ship_city"
5673        VALUE = "Owensboro"
5674 >
5675
5676
5677 <INPUT TYPE  = "hidden"
5678        NAME  = "old_ship_state"
5679        ID    = "old_ship_state"
5680        VALUE = "KS"
5681 >
5682
5683
5684 <INPUT TYPE  = "hidden"
5685        NAME  = "old_ship_country"
5686        ID    = "old_ship_country"
5687        VALUE = "US"
5688 >
5689
5690
5691 <INPUT TYPE  = "hidden"
5692        NAME  = "old_ship_zip"
5693        ID    = "old_ship_zip"
5694        VALUE = "69113"
5695 >
5696
5697
5698 <INPUT TYPE  = "hidden"
5699        NAME  = "old_ship_latitude"
5700        ID    = "old_ship_latitude"
5701        VALUE = "38.5000000"
5702 >
5703
5704
5705 <INPUT TYPE  = "hidden"
5706        NAME  = "old_ship_longitude"
5707        ID    = "old_ship_longitude"
5708        VALUE = "-121.5000000"
5709 >
5710
5711
5712 <INPUT TYPE  = "hidden"
5713        NAME  = "old_ship_censustract"
5714        ID    = "old_ship_censustract"
5715        VALUE = ""
5716 >
5717
5718
5719 <INPUT TYPE  = "hidden"
5720        NAME  = "old_ship_district"
5721        ID    = "old_ship_district"
5722        VALUE = ""
5723 >
5724
5725
5726 <INPUT TYPE  = "hidden"
5727        NAME  = "old_ship_addr_clean"
5728        ID    = "old_ship_addr_clean"
5729        VALUE = ""
5730 >
5731
5732
5733 <INPUT TYPE  = "hidden"
5734        NAME  = "ship_cachenum"
5735        ID    = "ship_cachenum"
5736        VALUE = ""
5737 >
5738
5739
5740 <INPUT TYPE  = "hidden"
5741        NAME  = "ship_addr_clean"
5742        ID    = "ship_addr_clean"
5743        VALUE = ""
5744 >
5745
5746
5747
5748 <SCRIPT TYPE="text/javascript">
5749 (function() {
5750   var myonload = function() {
5751
5752   var clear_coords_ids = [
5753     'ship_latitude',
5754     'ship_longitude',
5755     'ship_enter_censustract',
5756     'ship_censustract',
5757     'ship_district'
5758   ];
5759   function clear_coords() {
5760     for (var i=0; i < clear_coords_ids.length; i++) {
5761       var el = document.getElementById(clear_coords_ids[i]);
5762       if ( el ) {
5763         el.value = '';
5764       }
5765     }
5766   }
5767   var clear_coords_on_change = [
5768     'ship_address1',
5769     'ship_address2',
5770     'ship_city',
5771     'ship_state',
5772     'ship_zip',
5773     'ship_country'
5774   ];
5775   for (var i=0; i < clear_coords_on_change.length; i++) {
5776     var el = document.getElementById(clear_coords_on_change[i]);
5777     if ( el.addEventListener ) {
5778       el.addEventListener('change', clear_coords);
5779     } else if ( el.attachEvent ) {
5780       el.attachEvent('onchange', clear_coords);
5781     }
5782   }
5783   function clear_censustract() {
5784     // if the user manually edits the census tract, clear the 'hard' census
5785     // tract field so that we can re-verify and present a confirmation popup 
5786
5787     // get the ID of the hidden censustract field
5788     var censustract_id = this.id.replace('enter_', '');
5789     var el = document.getElementById(censustract_id);
5790     if (el) {
5791       el.value = '';
5792     }
5793   }
5794   var el = document.getElementById('ship_enter_censustract');
5795   if (el) {
5796     if ( el.addEventListener ) {
5797       el.addEventListener('change', clear_censustract);
5798     } else if ( el.attachEvent ) {
5799       el.attachEvent('onchange', clear_censustract);
5800     }
5801   }
5802
5803
5804   }
5805   if ( window.addEventListener ) {
5806     window.addEventListener('load', myonload);
5807   } else if ( window.attachEvent ) {
5808     window.attachEvent('onload', myonload);
5809   }
5810 })();
5811
5812 </SCRIPT>
5813
5814
5815         <TR>
5816           <TD COLSPAN="8">
5817             <INPUT TYPE  = "checkbox"
5818                            NAME  = "invoice_ship_address"
5819                            ID    = ""
5820                            VALUE = "Y"
5821                            
5822                            
5823                            
5824                     >Include service address on invoices
5825
5826           </TD>
5827         </TR>
5828       </TABLE>
5829     </DIV>
5830   </TD>
5831 </TR></TABLE>
5832
5833 <SCRIPT>
5834 function samechanged(what) {
5835   var t1 = document.getElementById('table_ship_location');
5836   if ( what.checked ) {
5837     t1.style.visibility = 'hidden';
5838   }
5839   else {
5840     t1.style.visibility = 'visible'
5841   }
5842 }
5843 samechanged(document.getElementById('same'));
5844 </SCRIPT>
5845
5846 <BR>
5847
5848 <DIV ID="contacts_div" STYLE="display:">
5849 <BR>
5850 <FONT CLASS="fsinnerbox-title">Contacts</FONT>
5851
5852
5853 <TABLE ID="TableNumber0" BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0>
5854
5855
5856       <TR>
5857
5858   <TD ALIGN  = "right"
5859       VALIGN = "top"
5860       STYLE  = "padding-top: 3px"
5861       ID     = "contactnum_label0"
5862   >Contact</TD>
5863
5864
5865       <TD COLSPAN="6">
5866       
5867   <INPUT TYPE="hidden" NAME="contactnum0" ID="contactnum0" VALUE="">
5868
5869   <TABLE STYLE="display:inline">
5870     <TR>
5871         <TD>
5872           <SELECT NAME="contactnum0_classnum" onChange="
5873 spawn_contactnum(this);">
5874             <OPTION VALUE="">
5875               <OPTION VALUE="1"
5876                  
5877               >Service
5878           </SELECT><BR>
5879           <FONT SIZE="-1">Type</FONT>
5880         </TD>
5881
5882         <TD>
5883             <INPUT TYPE  = "text"
5884                    NAME  = "contactnum0_first"
5885                    ID    = "contactnum0_first"
5886                    SIZE  = "14"
5887                    VALUE = ""
5888                    onChange="
5889 spawn_contactnum(this);"
5890             >
5891           <BR>
5892           <FONT SIZE="-1">First name</FONT>
5893         </TD>
5894
5895         <TD>
5896             <INPUT TYPE  = "text"
5897                    NAME  = "contactnum0_last"
5898                    ID    = "contactnum0_last"
5899                    SIZE  = "14"
5900                    VALUE = ""
5901                    onChange="
5902 spawn_contactnum(this);"
5903             >
5904           <BR>
5905           <FONT SIZE="-1">Last name</FONT>
5906         </TD>
5907
5908         <TD>
5909             <INPUT TYPE  = "text"
5910                    NAME  = "contactnum0_title"
5911                    ID    = "contactnum0_title"
5912                    SIZE  = "12"
5913                    VALUE = ""
5914                    onChange="
5915 spawn_contactnum(this);"
5916             >
5917           <BR>
5918           <FONT SIZE="-1">Title/Position</FONT>
5919         </TD>
5920
5921         <TD>
5922             <INPUT TYPE  = "text"
5923                    NAME  = "contactnum0_emailaddress"
5924                    ID    = "contactnum0_emailaddress"
5925                    SIZE  = "14"
5926                    VALUE = ""
5927                    onChange="
5928 spawn_contactnum(this);"
5929             >
5930           <BR>
5931           <FONT SIZE="-1">Email</FONT>
5932         </TD>
5933
5934         <TD>
5935             <SELECT NAME = "contactnum0_selfservice_access"
5936                     ID   = "contactnum0_selfservice_access"
5937             >
5938               <OPTION VALUE="">Disabled
5939             </SELECT>
5940
5941           <BR>
5942           <FONT SIZE="-1">Self-service</FONT>
5943         </TD>
5944
5945         <TD>
5946             <INPUT TYPE  = "text"
5947                    NAME  = "contactnum0_phonetypenum1"
5948                    ID    = "contactnum0_phonetypenum1"
5949                    SIZE  = "15"
5950                    VALUE = ""
5951                    onChange="
5952 spawn_contactnum(this);"
5953             >
5954           <BR>
5955           <FONT SIZE="-1">Work phone</FONT>
5956         </TD>
5957
5958         <TD>
5959             <INPUT TYPE  = "text"
5960                    NAME  = "contactnum0_phonetypenum3"
5961                    ID    = "contactnum0_phonetypenum3"
5962                    SIZE  = "10"
5963                    VALUE = ""
5964                    onChange="
5965 spawn_contactnum(this);"
5966             >
5967           <BR>
5968           <FONT SIZE="-1">Mobile phone</FONT>
5969         </TD>
5970
5971         <TD>
5972             <INPUT TYPE  = "text"
5973                    NAME  = "contactnum0_phonetypenum4"
5974                    ID    = "contactnum0_phonetypenum4"
5975                    SIZE  = "10"
5976                    VALUE = ""
5977                    onChange="
5978 spawn_contactnum(this);"
5979             >
5980           <BR>
5981           <FONT SIZE="-1">Fax phone</FONT>
5982         </TD>
5983
5984         <TD>
5985             <INPUT TYPE  = "text"
5986                    NAME  = "contactnum0_comment"
5987                    ID    = "contactnum0_comment"
5988                    SIZE  = "14"
5989                    VALUE = ""
5990                    onChange="
5991 spawn_contactnum(this);"
5992             >
5993           <BR>
5994           <FONT SIZE="-1">Comment</FONT>
5995         </TD>
5996     </TR>
5997   </TABLE>
5998
5999
6000       </TD>
6001
6002
6003       </TR>
6004
6005
6006       <SCRIPT TYPE="text/javascript">
6007
6008         var contactnum_rownum = 1;
6009         var contactnum_fieldnum = 0;
6010
6011         function spawn_contactnum(what) {
6012
6013           // only spawn if we're the last element... return if not
6014
6015           var field_regex = /(\d+)(_[a-z_]+)?$/;
6016           var match = field_regex.exec(what.name);
6017           if ( !match ) {
6018             alert(what.name + " didn't match for " + what);
6019             return;
6020           }
6021           if ( match[1] != contactnum_fieldnum ) {
6022             return;
6023           }
6024
6025           // change the label on the last entry & add a remove button
6026           var prev_label = document.getElementById('contactnum_label' + contactnum_fieldnum );
6027           prev_label.innerHTML = '<INPUT TYPE="button" VALUE="X" TITLE="Remove this contact" onClick="remove_contactnum(' + contactnum_fieldnum + ');" STYLE="color:#ff0000;font-weight:bold;padding-left:2px;padding-right:2px" >&nbsp;Contact';
6028
6029           contactnum_fieldnum++;
6030
6031           //get the new widget
6032
6033
6034           var newrow =  '\n  <INPUT TYPE="hidden" NAME="contactnumMAGIC_NUMBER" ID="contactnumMAGIC_NUMBER" VALUE="">\n\n  <TABLE STYLE="display:inline">\n    <TR>\n        <TD>\n          <SELECT NAME="contactnumMAGIC_NUMBER_classnum" onChange="\nspawn_contactnum(this);">\n            <OPTION VALUE="">\n              <OPTION VALUE="1"\n                 \n              >Service\n          </SELECT><BR>\n          <FONT SIZE="-1">Type</FONT>\n        </TD>\n\n        <TD>\n            <INPUT TYPE  = "text"\n                   NAME  = "contactnumMAGIC_NUMBER_first"\n                   ID    = "contactnumMAGIC_NUMBER_first"\n                   SIZE  = "14"\n                   VALUE = ""\n                   onChange="\nspawn_contactnum(this);"\n            >\n          <BR>\n          <FONT SIZE="-1">First name</FONT>\n        </TD>\n\n        <TD>\n            <INPUT TYPE  = "text"\n                   NAME  = "contactnumMAGIC_NUMBER_last"\n                   ID    = "contactnumMAGIC_NUMBER_last"\n                   SIZE  = "14"\n                   VALUE = ""\n                   onChange="\nspawn_contactnum(this);"\n            >\n          <BR>\n          <FONT SIZE="-1">Last name</FONT>\n        </TD>\n\n        <TD>\n            <INPUT TYPE  = "text"\n                   NAME  = "contactnumMAGIC_NUMBER_title"\n                   ID    = "contactnumMAGIC_NUMBER_title"\n                   SIZE  = "12"\n                   VALUE = ""\n                   onChange="\nspawn_contactnum(this);"\n            >\n          <BR>\n          <FONT SIZE="-1">Title/Position</FONT>\n        </TD>\n\n        <TD>\n            <INPUT TYPE  = "text"\n                   NAME  = "contactnumMAGIC_NUMBER_emailaddress"\n                   ID    = "contactnumMAGIC_NUMBER_emailaddress"\n                   SIZE  = "14"\n                   VALUE = ""\n                   onChange="\nspawn_contactnum(this);"\n            >\n          <BR>\n          <FONT SIZE="-1">Email</FONT>\n        </TD>\n\n        <TD>\n            <SELECT NAME = "contactnumMAGIC_NUMBER_selfservice_access"\n                    ID   = "contactnumMAGIC_NUMBER_selfservice_access"\n            >\n              <OPTION VALUE="">Disabled\n            </SELECT>\n\n          <BR>\n          <FONT SIZE="-1">Self-service</FONT>\n        </TD>\n\n        <TD>\n            <INPUT TYPE  = "text"\n                   NAME  = "contactnumMAGIC_NUMBER_phonetypenum1"\n                   ID    = "contactnumMAGIC_NUMBER_phonetypenum1"\n                   SIZE  = "15"\n                   VALUE = ""\n                   onChange="\nspawn_contactnum(this);"\n            >\n          <BR>\n          <FONT SIZE="-1">Work phone</FONT>\n        </TD>\n\n        <TD>\n            <INPUT TYPE  = "text"\n                   NAME  = "contactnumMAGIC_NUMBER_phonetypenum3"\n                   ID    = "contactnumMAGIC_NUMBER_phonetypenum3"\n                   SIZE  = "10"\n                   VALUE = ""\n                   onChange="\nspawn_contactnum(this);"\n            >\n          <BR>\n          <FONT SIZE="-1">Mobile phone</FONT>\n        </TD>\n\n        <TD>\n            <INPUT TYPE  = "text"\n                   NAME  = "contactnumMAGIC_NUMBER_phonetypenum4"\n                   ID    = "contactnumMAGIC_NUMBER_phonetypenum4"\n                   SIZE  = "10"\n                   VALUE = ""\n                   onChange="\nspawn_contactnum(this);"\n            >\n          <BR>\n          <FONT SIZE="-1">Fax phone</FONT>\n        </TD>\n\n        <TD>\n            <INPUT TYPE  = "text"\n                   NAME  = "contactnumMAGIC_NUMBER_comment"\n                   ID    = "contactnumMAGIC_NUMBER_comment"\n                   SIZE  = "14"\n                   VALUE = ""\n                   onChange="\nspawn_contactnum(this);"\n            >\n          <BR>\n          <FONT SIZE="-1">Comment</FONT>\n        </TD>\n    </TR>\n  </TABLE>\n\n';
6035
6036             var newfunc = '';
6037
6038           // substitute in the new field name
6039           var magic_regex = /MAGIC_NUMBER/g;
6040           newrow  = newrow.replace(  magic_regex, contactnum_fieldnum );
6041           newfunc = newfunc.replace( magic_regex, contactnum_fieldnum );
6042
6043           // evaluate new_func
6044           if (window.ActiveXObject) {
6045             window.execScript(newfunc);
6046           } else { /* (window.XMLHttpRequest) */
6047             //window.eval(newfunc);
6048             setTimeout(newfunc, 0);
6049           }
6050
6051           // add new row
6052
6053           //hmm, can't use selectlayers after a tablebreak-title for now
6054           var table = document.getElementById('TableNumber0');
6055
6056           var row = table.insertRow(contactnum_rownum++);
6057
6058           var label_cell = document.createElement('TD');
6059
6060           label_cell.id = 'contactnum_label' + contactnum_fieldnum;
6061
6062           label_cell.style.textAlign = "right";
6063           label_cell.style.verticalAlign = "top";
6064           label_cell.style.borderTop = "1px solid black";
6065           label_cell.style.paddingTop = "5px";
6066
6067           label_cell.innerHTML = 'Contact';
6068
6069           row.appendChild(label_cell);
6070           
6071           var widget_cell = document.createElement('TD');
6072
6073           widget_cell.style.borderTop = "1px solid black";
6074           widget_cell.style.paddingTop = "3px";
6075           widget_cell.colSpan = "6";
6076
6077           widget_cell.innerHTML = newrow;
6078
6079           row.appendChild(widget_cell);
6080
6081
6082
6083         }
6084
6085         function remove_contactnum(remove_fieldnum) {
6086           //alert("remove contactnum " + remove_fieldnum);
6087           var select = document.getElementById('contactnum' + remove_fieldnum);
6088
6089           if ( ! select ) {
6090             alert("can't find element contactnum" + remove_fieldnum);
6091             return;
6092           }
6093
6094
6095           select.disabled = 'disabled'; // this seems to prevent it from being submitted on tested browsers so far (IE, moz, konq at least)
6096           var label_td = document.getElementById('contactnum_label' + remove_fieldnum );
6097           label_td.parentNode.style.display = 'none';
6098
6099
6100         }
6101
6102       </SCRIPT>
6103
6104
6105
6106
6107
6108 </TABLE>
6109
6110
6111
6112
6113 </DIV>
6114
6115
6116
6117   <BR><FONT CLASS="fsinnerbox-title">Billing information</FONT>
6118   <TABLE BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0>
6119
6120     <TR>
6121       <TD ALIGN="right" WIDTH="200"><font color="#ff0000">*</font>&nbsp;Billing type</TD>
6122
6123   <SCRIPT>
6124
6125     var mywindow = -1;
6126     function myopen(filename,windowname,properties) {
6127       myclose();
6128       mywindow = window.open(filename,windowname,properties);
6129     }
6130     function myclose() {
6131       if ( mywindow != -1 )
6132         mywindow.close();
6133       mywindow = -1;
6134     }
6135
6136     var achwindow = -1;
6137     function achopen(filename,windowname,properties) {
6138       achclose();
6139       achwindow = window.open(filename,windowname,properties);
6140     }
6141     function achclose() {
6142       if ( achwindow != -1 )
6143         achwindow.close();
6144       achwindow = -1;
6145     }
6146
6147     function card_changed(what) {
6148       if (
6149              what.form.payinfo.value.substring(0, 4) == '4093' 
6150           || what.form.payinfo.value.substring(0, 4) == '4911' 
6151           || what.form.payinfo.value.substring(0, 4) == '4936' 
6152           || what.form.payinfo.value.substring(0, 6) == '564132' 
6153           || what.form.payinfo.value.substring(0, 2) == '63' 
6154           || what.form.payinfo.value.substring(0, 2) == '67' 
6155          )
6156       {
6157         what.form.paystart_month.disabled = false;
6158         what.form.paystart_year.disabled = false;
6159         what.form.payissue.disabled = false;
6160         what.form.paystart_month.style.backgroundColor = '#ffffff';
6161         what.form.paystart_year.style.backgroundColor = '#ffffff';
6162         what.form.payissue.style.backgroundColor = '#ffffff';
6163         document.getElementById('paystart_label').style.color = '#000000';
6164         document.getElementById('payissue_label').style.color = '#000000';
6165       } else {
6166         what.form.paystart_month.disabled = true;
6167         what.form.paystart_year.disabled = true;
6168         what.form.payissue.disabled = true;
6169         what.form.paystart_month.style.backgroundColor = '#dddddd';
6170         what.form.paystart_year.style.backgroundColor = '#dddddd';
6171         what.form.payissue.style.backgroundColor = '#dddddd';
6172         document.getElementById('paystart_label').style.color = '#999999';
6173         document.getElementById('payissue_label').style.color = '#999999';
6174       }
6175       return true;
6176     }
6177
6178     function init_payauto_changed(){
6179         var f = document.getElementById('CARD_payauto');
6180         if(f != null) payauto_changed(f);
6181         f = document.getElementById('CHEK_payauto');
6182         if(f != null) payauto_changed(f);
6183     }
6184
6185     function payauto_changed(payauto_field){
6186         var select = (payauto_field.name == 'CARD_payauto') ? 'CARD_billday' : 'CHEK_billday';
6187         var span = document.getElementById('td_'+select);
6188         select = document.getElementById(select);
6189         if (span == null || select == null) return;
6190         if(payauto_field.checked) {
6191             span.style.color = '#000000';
6192             select.disabled = false;
6193         }
6194         else {
6195             span.style.color = '#999999';
6196             select.disabled = true;
6197             //why? select.selectedIndex = 0;
6198         }
6199     }
6200
6201     function tax_changed(what) {
6202       var num = document.getElementById(what.id + '_num'); 
6203       if ( what.checked ) {
6204         num.disabled = false;
6205       } else {
6206         num.disabled = true;
6207       }
6208     }
6209     
6210   </SCRIPT>
6211
6212   
6213
6214
6215   <TD WIDTH="408">
6216         <SCRIPT TYPE="text/javascript">
6217
6218
6219       function paybychanged(what) {
6220
6221         init_payauto_changed();
6222
6223         var paybylayer = what.options[what.selectedIndex].value;
6224
6225           if (paybylayer == "CARD" ) {
6226
6227               document.getElementById('paybydCHEK').style.display = "none";
6228               document.getElementById('paybydCHEK').style.zIndex = 0;
6229               document.getElementById('paybydLECB').style.display = "none";
6230               document.getElementById('paybydLECB').style.zIndex = 0;
6231               document.getElementById('paybydBILL').style.display = "none";
6232               document.getElementById('paybydBILL').style.zIndex = 0;
6233               document.getElementById('paybydCOMP').style.display = "none";
6234               document.getElementById('paybydCOMP').style.zIndex = 0;
6235
6236             document.getElementById('paybydCARD').style.display = "";
6237             document.getElementById('paybydCARD').style.zIndex = 1;
6238
6239           }
6240           if (paybylayer == "CHEK" ) {
6241
6242               document.getElementById('paybydCARD').style.display = "none";
6243               document.getElementById('paybydCARD').style.zIndex = 0;
6244               document.getElementById('paybydLECB').style.display = "none";
6245               document.getElementById('paybydLECB').style.zIndex = 0;
6246               document.getElementById('paybydBILL').style.display = "none";
6247               document.getElementById('paybydBILL').style.zIndex = 0;
6248               document.getElementById('paybydCOMP').style.display = "none";
6249               document.getElementById('paybydCOMP').style.zIndex = 0;
6250
6251             document.getElementById('paybydCHEK').style.display = "";
6252             document.getElementById('paybydCHEK').style.zIndex = 1;
6253
6254           }
6255           if (paybylayer == "LECB" ) {
6256
6257               document.getElementById('paybydCARD').style.display = "none";
6258               document.getElementById('paybydCARD').style.zIndex = 0;
6259               document.getElementById('paybydCHEK').style.display = "none";
6260               document.getElementById('paybydCHEK').style.zIndex = 0;
6261               document.getElementById('paybydBILL').style.display = "none";
6262               document.getElementById('paybydBILL').style.zIndex = 0;
6263               document.getElementById('paybydCOMP').style.display = "none";
6264               document.getElementById('paybydCOMP').style.zIndex = 0;
6265
6266             document.getElementById('paybydLECB').style.display = "";
6267             document.getElementById('paybydLECB').style.zIndex = 1;
6268
6269           }
6270           if (paybylayer == "BILL" ) {
6271
6272               document.getElementById('paybydCARD').style.display = "none";
6273               document.getElementById('paybydCARD').style.zIndex = 0;
6274               document.getElementById('paybydCHEK').style.display = "none";
6275               document.getElementById('paybydCHEK').style.zIndex = 0;
6276               document.getElementById('paybydLECB').style.display = "none";
6277               document.getElementById('paybydLECB').style.zIndex = 0;
6278               document.getElementById('paybydCOMP').style.display = "none";
6279               document.getElementById('paybydCOMP').style.zIndex = 0;
6280
6281             document.getElementById('paybydBILL').style.display = "";
6282             document.getElementById('paybydBILL').style.zIndex = 1;
6283
6284           }
6285           if (paybylayer == "COMP" ) {
6286
6287               document.getElementById('paybydCARD').style.display = "none";
6288               document.getElementById('paybydCARD').style.zIndex = 0;
6289               document.getElementById('paybydCHEK').style.display = "none";
6290               document.getElementById('paybydCHEK').style.zIndex = 0;
6291               document.getElementById('paybydLECB').style.display = "none";
6292               document.getElementById('paybydLECB').style.zIndex = 0;
6293               document.getElementById('paybydBILL').style.display = "none";
6294               document.getElementById('paybydBILL').style.zIndex = 0;
6295
6296             document.getElementById('paybydCOMP').style.display = "";
6297             document.getElementById('paybydCOMP').style.zIndex = 1;
6298
6299           }
6300
6301         //init_payauto_changed();
6302
6303       }
6304     </SCRIPT>
6305
6306     <SELECT NAME          = "payby"
6307             ID            = "payby"
6308             previousValue = "CARD"
6309             previousText  = "Credit card"
6310             onChange="paybychanged(this);"
6311     >
6312
6313
6314         <OPTION VALUE="CARD"
6315                  SELECTED
6316         >Credit card</OPTION>
6317
6318
6319         <OPTION VALUE="CHEK"
6320                 
6321         >Electronic check</OPTION>
6322
6323
6324         <OPTION VALUE="LECB"
6325                 
6326         >Phone bill billing</OPTION>
6327
6328
6329         <OPTION VALUE="BILL"
6330                 
6331         >Billing</OPTION>
6332
6333
6334         <OPTION VALUE="COMP"
6335                 
6336         >Complimentary</OPTION>
6337
6338
6339     </SELECT>
6340
6341
6342 </TD></TR></TABLE>
6343
6344
6345
6346       <DIV ID="paybydCARD"
6347            STYLE="display: block; z-index: 1"
6348       >
6349
6350         <TABLE BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0 HEIGHT=192><TR><TD ALIGN="right" WIDTH="200"><font color="#ff0000">*</font>&nbsp;Card number </TD><TD WIDTH="408"><INPUT TYPE="text" NAME="CARD_payinfo" VALUE="412325xxxxxx4150" MAXLENGTH=19 onChange="card_changed(this)" onKeyUp="card_changed(this)"></TD></TR><TR><TD ALIGN="right" WIDTH="200"><font color="#ff0000">*</font>&nbsp;Expiration </TD><TD WIDTH="408"><SELECT NAME="CARD_exp_month" SIZE="1" >
6351
6352
6353
6354    <OPTION VALUE="1">01
6355
6356    <OPTION VALUE="2">02
6357
6358    <OPTION VALUE="3">03
6359
6360    <OPTION VALUE="4">04
6361
6362    <OPTION SELECTED VALUE="5">05
6363
6364    <OPTION VALUE="6">06
6365
6366    <OPTION VALUE="7">07
6367
6368    <OPTION VALUE="8">08
6369
6370    <OPTION VALUE="9">09
6371
6372    <OPTION VALUE="10">10
6373
6374    <OPTION VALUE="11">11
6375
6376    <OPTION VALUE="12">12
6377
6378
6379 </SELECT>/<SELECT NAME="CARD_exp_year" SIZE="1" >
6380
6381
6382
6383    <OPTION VALUE="2016">2016
6384
6385    <OPTION VALUE="2017">2017
6386
6387    <OPTION VALUE="2018">2018
6388
6389    <OPTION VALUE="2019">2019
6390
6391    <OPTION SELECTED VALUE="2020">2020
6392
6393    <OPTION VALUE="2021">2021
6394
6395    <OPTION VALUE="2022">2022
6396
6397    <OPTION VALUE="2023">2023
6398
6399    <OPTION VALUE="2024">2024
6400
6401    <OPTION VALUE="2025">2025
6402
6403    <OPTION VALUE="2026">2026
6404
6405    <OPTION VALUE="2027">2027
6406
6407    <OPTION VALUE="2028">2028
6408
6409    <OPTION VALUE="2029">2029
6410
6411    <OPTION VALUE="2030">2030
6412
6413    <OPTION VALUE="2031">2031
6414
6415    <OPTION VALUE="2032">2032
6416
6417    <OPTION VALUE="2033">2033
6418
6419    <OPTION VALUE="2034">2034
6420
6421    <OPTION VALUE="2035">2035
6422
6423    <OPTION VALUE="2036">2036
6424
6425    <OPTION VALUE="2037">2037
6426
6427 </SELECT>
6428
6429 </TD></TR><TR><TD ALIGN="right" WIDTH="200">CVV2&nbsp;(<A HREF="javascript:void(0);" onClick="overlib( OLiframeContent('../docs/cvv2.html', 480, 352, 'cvv2_popup' ), CAPTION, 'CVV2 Help', STICKY, AUTOSTATUSCAP, CLOSECLICK, DRAGGABLE ); return false;">help</A>)</TD><TD WIDTH="408"><INPUT TYPE="text" NAME="CARD_paycvv" VALUE="" SIZE=4 MAXLENGTH=4><TR><TD ALIGN="right" WIDTH="200"><SPAN ID="paystart_label" style="color: #999999">Start date </SPAN></TD><TD WIDTH="408"><SELECT NAME="CARD_paystart_month" SIZE="1" DISABLED style="background-color: #dddddd">
6430
6431 <OPTION VALUE="">
6432
6433    <OPTION VALUE="1">01
6434
6435    <OPTION VALUE="2">02
6436
6437    <OPTION VALUE="3">03
6438
6439    <OPTION VALUE="4">04
6440
6441    <OPTION VALUE="5">05
6442
6443    <OPTION VALUE="6">06
6444
6445    <OPTION VALUE="7">07
6446
6447    <OPTION VALUE="8">08
6448
6449    <OPTION VALUE="9">09
6450
6451    <OPTION VALUE="10">10
6452
6453    <OPTION VALUE="11">11
6454
6455    <OPTION VALUE="12">12
6456
6457
6458 </SELECT>/<SELECT NAME="CARD_paystart_year" SIZE="1" DISABLED style="background-color: #dddddd">
6459
6460 <OPTION VALUE="">
6461
6462    <OPTION VALUE="2000">2000
6463
6464    <OPTION VALUE="2001">2001
6465
6466    <OPTION VALUE="2002">2002
6467
6468    <OPTION VALUE="2003">2003
6469
6470    <OPTION VALUE="2004">2004
6471
6472    <OPTION VALUE="2005">2005
6473
6474    <OPTION VALUE="2006">2006
6475
6476    <OPTION VALUE="2007">2007
6477
6478    <OPTION VALUE="2008">2008
6479
6480    <OPTION VALUE="2009">2009
6481
6482    <OPTION VALUE="2010">2010
6483
6484    <OPTION VALUE="2011">2011
6485
6486    <OPTION VALUE="2012">2012
6487
6488    <OPTION VALUE="2013">2013
6489
6490    <OPTION VALUE="2014">2014
6491
6492    <OPTION VALUE="2015">2015
6493
6494    <OPTION VALUE="2016">2016
6495
6496 </SELECT>
6497
6498 <SPAN ID="payissue_label" style="color: #999999">or Issue number </SPAN><INPUT TYPE="text" NAME="CARD_payissue" VALUE="" SIZE=3 MAXLENGTH=2 DISABLED style="background-color: #dddddd"></TD></TR><TR><TD ALIGN="right" WIDTH="200"><font color="#ff0000">*</font>&nbsp;Exact name on card </TD><TD WIDTH="408"><INPUT TYPE="text" NAME="CARD_payname" VALUE="Samara Towne"></TD></TR><TR><TD COLSPAN=2 WIDTH="608"><INPUT TYPE="checkbox" onchange="payauto_changed(this);" ID="CARD_payauto" NAME="CARD_payauto" CHECKED> Charge future payments to this credit card automatically</TD></TR></TABLE>
6499
6500       </DIV>
6501
6502
6503       <DIV ID="paybydCHEK"
6504            STYLE="display: none; z-index: 0"
6505       >
6506
6507         <TABLE BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0 HEIGHT=192><TR><TD ALIGN="right" WIDTH="200"><font color="#ff0000">*</font>&nbsp;Account number </TD><TD><INPUT TYPE="text" SIZE=12 NAME="CHEK_payinfo1" VALUE=""></TD><TD ALIGN="right">Type</TD><TD><SELECT NAME="CHEK_paytype"><OPTION VALUE="" SELECTED></OPTION><OPTION VALUE="Personal checking" >Personal checking</OPTION><OPTION VALUE="Personal savings" >Personal savings</OPTION><OPTION VALUE="Business checking" >Business checking</OPTION><OPTION VALUE="Business savings" >Business savings</OPTION></SELECT></TD></TR><TR><TD ALIGN="right" WIDTH="200"><font color="#ff0000">*</font>&nbsp;ABA/Routing number </TD><TD COLSPAN="3" WIDTH="408"><INPUT TYPE="text" SIZE=10 MAXLENGTH=9 NAME="CHEK_payinfo2" VALUE=""> (<A HREF="javascript:void(0);" onClick="overlib( OLiframeContent('../docs/ach.html', 380, 240, 'ach_popup' ), CAPTION, 'ACH Help', STICKY, AUTOSTATUSCAP, CLOSECLICK, DRAGGABLE ); return false;">help</A>)</TD></TR><INPUT TYPE="hidden" NAME="CHEK_exp_month" VALUE="12"><INPUT TYPE="hidden" NAME="CHEK_exp_year" VALUE="2037"><TR><TD ALIGN="right" WIDTH="200"><font color="#ff0000">*</font>&nbsp;Bank name </TD><TD COLSPAN="3" WIDTH="408"><INPUT TYPE="text" NAME="CHEK_payname" VALUE=""></TD></TR><INPUT TYPE="hidden" NAME="CHEK_paystate" VALUE=""><TR><TD COLSPAN=4 WIDTH="608"><INPUT TYPE="checkbox" onchange="payauto_changed(this);" ID="CHEK_payauto" NAME="CHEK_payauto" CHECKED> Charge future payments to this electronic check automatically</TD></TR></TABLE>
6508
6509       </DIV>
6510
6511
6512       <DIV ID="paybydLECB"
6513            STYLE="display: none; z-index: 0"
6514       >
6515
6516         <TABLE BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0 HEIGHT=192><TR><TD ALIGN="right" WIDTH="200"><font color="#ff0000">*</font>&nbsp;Phone number </TD><TD WIDTH="408"><INPUT TYPE="text" NAME="LECB_payinfo" VALUE="" MAXLENGTH=15 SIZE=16></TD></TR><INPUT TYPE="hidden" NAME="LECB_exp_month" VALUE="12"><INPUT TYPE="hidden" NAME="LECB_exp_year" VALUE="2037"><INPUT TYPE="hidden" NAME="LECB_payname" VALUE=""><TR><TD>&nbsp;</TD></TR><TR><TD>&nbsp;</TD></TR><TR><TD>&nbsp;</TD></TR><TR><TD>&nbsp;</TD></TR><TR><TD>&nbsp;</TD></TR><TR><TD>&nbsp;</TD></TR></TABLE>
6517
6518       </DIV>
6519
6520
6521       <DIV ID="paybydBILL"
6522            STYLE="display: none; z-index: 0"
6523       >
6524
6525         <TABLE BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0 HEIGHT=192><TR><TD ALIGN="right" WIDTH="200">P.O. </TD><TD WIDTH="408"><INPUT TYPE="text" NAME="BILL_payinfo" VALUE=""></TD></TR><INPUT TYPE="hidden" NAME="BILL_exp_month" VALUE="12"><INPUT TYPE="hidden" NAME="BILL_exp_year" VALUE="2037"><TR><TD ALIGN="right" WIDTH="200">Attention </TD><TD WIDTH="408"><INPUT TYPE="text" NAME="BILL_payname" VALUE=""></TD></TR><TR><TD>&nbsp;</TD></TR><TR><TD>&nbsp;</TD></TR><TR><TD>&nbsp;</TD></TR><TR><TD>&nbsp;</TD></TR><TR><TD>&nbsp;</TD></TR></TABLE>
6526
6527       </DIV>
6528
6529
6530       <DIV ID="paybydCOMP"
6531            STYLE="display: none; z-index: 0"
6532       >
6533
6534         <TABLE BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0 HEIGHT=192><TR><TD ALIGN="right" WIDTH="200"><font color="#ff0000">*</font>&nbsp;Approved by </TD><TD WIDTH="408"><INPUT TYPE="text" NAME="COMP_payinfo" VALUE=""></TD></TR><TR><TD ALIGN="right" WIDTH="200"><font color="#ff0000">*</font>&nbsp;Expiration </TD><TD WIDTH="408"><SELECT NAME="COMP_exp_month" SIZE="1" >
6535
6536
6537
6538    <OPTION VALUE="1">01
6539
6540    <OPTION VALUE="2">02
6541
6542    <OPTION VALUE="3">03
6543
6544    <OPTION VALUE="4">04
6545
6546    <OPTION VALUE="5">05
6547
6548    <OPTION VALUE="6">06
6549
6550    <OPTION VALUE="7">07
6551
6552    <OPTION VALUE="8">08
6553
6554    <OPTION VALUE="9">09
6555
6556    <OPTION VALUE="10">10
6557
6558    <OPTION VALUE="11">11
6559
6560    <OPTION VALUE="12">12
6561
6562
6563 </SELECT>/<SELECT NAME="COMP_exp_year" SIZE="1" >
6564
6565
6566
6567    <OPTION VALUE="2016">2016
6568
6569    <OPTION VALUE="2017">2017
6570
6571    <OPTION VALUE="2018">2018
6572
6573    <OPTION VALUE="2019">2019
6574
6575    <OPTION VALUE="2020">2020
6576
6577    <OPTION VALUE="2021">2021
6578
6579    <OPTION VALUE="2022">2022
6580
6581    <OPTION VALUE="2023">2023
6582
6583    <OPTION VALUE="2024">2024
6584
6585    <OPTION VALUE="2025">2025
6586
6587    <OPTION VALUE="2026">2026
6588
6589    <OPTION VALUE="2027">2027
6590
6591    <OPTION VALUE="2028">2028
6592
6593    <OPTION VALUE="2029">2029
6594
6595    <OPTION VALUE="2030">2030
6596
6597    <OPTION VALUE="2031">2031
6598
6599    <OPTION VALUE="2032">2032
6600
6601    <OPTION VALUE="2033">2033
6602
6603    <OPTION VALUE="2034">2034
6604
6605    <OPTION VALUE="2035">2035
6606
6607    <OPTION VALUE="2036">2036
6608
6609    <OPTION VALUE="2037">2037
6610
6611 </SELECT>
6612
6613 </TD></TR><TR><TD>&nbsp;</TD></TR><TR><TD>&nbsp;</TD></TR><TR><TD>&nbsp;</TD></TR><TR><TD>&nbsp;</TD></TR><TR><TD>&nbsp;</TD></TR></TABLE>
6614
6615       </DIV>
6616
6617
6618
6619
6620   <TABLE BGCOLOR="#cccccc" BORDER=0 CELLSPACING=0>
6621
6622     <TR><TD>&nbsp;</TD></TR>
6623
6624
6625       <TR>
6626         <TD WIDTH="608" COLSPAN="2"><INPUT TYPE="checkbox" NAME="tax" VALUE="Y" > Tax Exempt</TD>
6627       </TR>
6628
6629
6630
6631
6632     <TR>
6633       <TD WIDTH="608" COLSPAN="2"><INPUT TYPE="checkbox" NAME="invoicing_list_POST" VALUE="POST" > Postal mail invoices 
6634
6635       </TD>
6636     </TR>
6637
6638     <TR>
6639       <TD WIDTH="608" COLSPAN="2"><INPUT TYPE="checkbox" NAME="invoicing_list_FAX" VALUE="FAX" > Fax invoices 
6640
6641       </TD>
6642     </TR>
6643
6644
6645     <TR>
6646       <TD WIDTH="608" COLSPAN="2"><INPUT TYPE="checkbox" NAME="invoice_email" VALUE="Y" CHECKED> Email invoices 
6647
6648       </TD>
6649     </TR>
6650
6651    <TR>
6652       <TD ALIGN="right" WIDTH="200">
6653         Email address(es)
6654       </TD>
6655       <TD WIDTH="408"><INPUT TYPE="text" NAME="invoicing_list" VALUE="">
6656       <INPUT TYPE="checkbox" NAME="message_noemail" VALUE="Y" > Do not send notices
6657       </TD>
6658     </TR>
6659
6660     <INPUT TYPE="hidden" NAME="prorate_day" VALUE="">
6661
6662     <TR>
6663       <TD ALIGN="right" WIDTH="200">Invoice terms </TD>
6664       <TD WIDTH="408">
6665         <SELECT NAME = "invoice_terms"
6666         ID   = "invoice_terms"
6667         
6668 >
6669 # #false laziness w/select-table.html
6670
6671   <OPTION VALUE="">Default (Payable upon receipt)
6672     <OPTION VALUE="Payable upon receipt" >Payable upon receipt
6673     <OPTION VALUE="Net 0" >Net 0
6674     <OPTION VALUE="Net 3" >Net 3
6675     <OPTION VALUE="Net 5" >Net 5
6676     <OPTION VALUE="Net 9" >Net 9
6677     <OPTION VALUE="Net 10" >Net 10
6678     <OPTION VALUE="Net 14" >Net 14
6679     <OPTION VALUE="Net 15" >Net 15
6680     <OPTION VALUE="Net 18" >Net 18
6681     <OPTION VALUE="Net 20" >Net 20
6682     <OPTION VALUE="Net 21" >Net 21
6683     <OPTION VALUE="Net 25" >Net 25
6684     <OPTION VALUE="Net 30" >Net 30
6685     <OPTION VALUE="Net 45" >Net 45
6686     <OPTION VALUE="Net 60" >Net 60
6687     <OPTION VALUE="Net 90" >Net 90
6688 </SELECT>
6689
6690       </TD>
6691     </TR>
6692
6693     <TR>
6694       <TD ALIGN="right" WIDTH="200">Credit limit </TD>
6695       <TD WIDTH="408">
6696         <SCRIPT TYPE="text/javascript">
6697 function toggle(obj) {
6698   obj.form.credit_limit.disabled = obj.checked;
6699 }
6700         </SCRIPT>
6701         <INPUT TYPE  = "text"
6702                NAME  = "credit_limit"
6703                VALUE = "0.00"
6704                 DISABLED
6705         >
6706         <INPUT TYPE  = "checkbox"
6707                NAME  = "no_credit_limit"
6708                VALUE = 1
6709                onClick="toggle(this)"
6710                 CHECKED
6711         > Unlimited 
6712       </TD>
6713     </TR>
6714
6715       <INPUT TYPE="hidden" NAME="spool_cdr" VALUE="">
6716
6717       <INPUT TYPE="hidden" NAME="squelch_cdr" VALUE="">
6718
6719       <INPUT TYPE="hidden" NAME="email_csv_cdr" VALUE="">
6720
6721        <INPUT TYPE="hidden" NAME="accountcode_cdr" VALUE="">
6722
6723       <INPUT TYPE="hidden" NAME="cdr_termination_percentage" VALUE="">
6724
6725
6726   </TABLE>
6727
6728   <font color="#ff0000">*</font>&nbsp;required fields 
6729
6730 <script type="text/javascript">
6731     init_payauto_changed();
6732 </script>
6733
6734
6735 <BR>
6736
6737
6738
6739 <INPUT TYPE="hidden" NAME="locationnum" VALUE="">
6740
6741 <INPUT TYPE="hidden" NAME="usernum" VALUE="3">
6742
6743     <INPUT TYPE="hidden" NAME="payauto" VALUE="">
6744     <INPUT TYPE="hidden" NAME="billday" VALUE="">
6745     <INPUT TYPE="hidden" NAME="payinfo" VALUE="">
6746     <INPUT TYPE="hidden" NAME="payinfo1" VALUE="">
6747     <INPUT TYPE="hidden" NAME="payinfo2" VALUE="">
6748     <INPUT TYPE="hidden" NAME="payinfo3" VALUE="">
6749     <INPUT TYPE="hidden" NAME="paytype" VALUE="">
6750     <INPUT TYPE="hidden" NAME="payname" VALUE="">
6751     <INPUT TYPE="hidden" NAME="paystate" VALUE="">
6752     <INPUT TYPE="hidden" NAME="exp_month" VALUE="">
6753     <INPUT TYPE="hidden" NAME="exp_year" VALUE="">
6754     <INPUT TYPE="hidden" NAME="paycvv" VALUE="">
6755     <INPUT TYPE="hidden" NAME="paystart_month" VALUE="">
6756     <INPUT TYPE="hidden" NAME="paystart_year" VALUE="">
6757     <INPUT TYPE="hidden" NAME="payissue" VALUE="">
6758     <INPUT TYPE="hidden" NAME="payip" VALUE="">
6759     <INPUT TYPE="hidden" NAME="paid" VALUE="">
6760
6761
6762
6763 <SCRIPT TYPE="text/javascript">
6764
6765   function rs_init_object() {
6766     var A;
6767     try {
6768       A=new ActiveXObject("Msxml2.XMLHTTP");
6769     } catch (e) {
6770       try {
6771         A=new ActiveXObject("Microsoft.XMLHTTP");
6772       } catch (oc) {
6773         A=null;
6774       }
6775     }
6776     if(!A && typeof XMLHttpRequest != "undefined")
6777       A = new XMLHttpRequest();
6778     if (!A)
6779       alert("Can't create XMLHttpRequest object");
6780     return A;
6781
6782   }
6783
6784 </SCRIPT>
6785
6786
6787 <SCRIPT TYPE="text/javascript">
6788
6789
6790     function address_standardize() {
6791         // count args; build URL
6792         var url = "http://localhost/freeside/misc/xmlhttp-address_standardize.html";
6793         var a = address_standardize.arguments;
6794
6795         var args;
6796         var len;
6797         var content = 'sub=address_standardize';
6798         if ( a && typeof a  == 'object'  && a[0].constructor == Array ) {
6799             args = a[0];
6800             len = args.length
6801         } else {
6802             args = a;
6803             len = args.length - 1;
6804         }
6805         for (var i = 0; i < len; i++) 
6806             content = content + "&arg=" + escape(args[i]);
6807         content = content.replace( /[+]/g, '%2B'); // fix unescaped plus signs 
6808
6809         if ( 'POST' == 'GET' ) {
6810           url = url + content;
6811         }
6812
6813         //alert('POST ' + url);
6814
6815         var xmlhttp = rs_init_object();
6816         xmlhttp.open("POST", url, true);
6817
6818         xmlhttp.onreadystatechange = function() {
6819             if (xmlhttp.readyState != 4) 
6820                 return;
6821
6822             if (xmlhttp.status != 200) {
6823               if ( xmlhttp.status != 0 ) {
6824                 //not warning on the 0 errors, they pop up when navagating away
6825                 // from the page
6826                 alert(xmlhttp.status + " status connecting to " + url);
6827               }
6828             } else {
6829               var data = xmlhttp.responseText;
6830               //alert('received response: ' + data);
6831               if ( data.indexOf("<b>System error</b>") > -1 ) {
6832                 // trim this a little
6833                 var end = data.indexOf('<a href="#raw">') - 1;
6834                 data = data.substring(0, end);
6835
6836                 overlib(data,
6837                   WIDTH, 480, MIDX, 0, MIDY, 0,
6838                   CAPTION, 'Error', STICKY, AUTOSTATUSCAP, DRAGGABLE,
6839                   CLOSECLICK, BGCOLOR, '#f00', CGCOLOR, '#f00'
6840                 );
6841                 //var w;
6842                 //if ( w = window.open("about:blank") ) {
6843                 //  w.document.write(data);
6844                 //} else {
6845                 //  // popup blocking?  should use an overlib popup instead 
6846                 //  alert("Error popup disabled; try disabling popup blocking to see");
6847                 //}
6848               } else {
6849                 // invoke the callback
6850                 a[a.length-1](data);
6851               }
6852             }
6853         }
6854
6855         if ( 'POST' == 'POST' ) {
6856
6857           xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
6858           xmlhttp.send(content);
6859
6860         } else {
6861
6862           xmlhttp.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
6863           xmlhttp.send(null);
6864
6865         }
6866
6867         //rs_debug("x_$func_name url = " + url);
6868         //rs_debug("x_$func_name waiting..");
6869     }
6870
6871
6872 </SCRIPT>
6873
6874
6875 <INPUT TYPE="hidden" NAME="duplicate_of_custnum" VALUE="">
6876 <SCRIPT TYPE="text/javascript">
6877
6878   function rs_init_object() {
6879     var A;
6880     try {
6881       A=new ActiveXObject("Msxml2.XMLHTTP");
6882     } catch (e) {
6883       try {
6884         A=new ActiveXObject("Microsoft.XMLHTTP");
6885       } catch (oc) {
6886         A=null;
6887       }
6888     }
6889     if(!A && typeof XMLHttpRequest != "undefined")
6890       A = new XMLHttpRequest();
6891     if (!A)
6892       alert("Can't create XMLHttpRequest object");
6893     return A;
6894
6895   }
6896
6897 </SCRIPT>
6898
6899
6900 <SCRIPT TYPE="text/javascript">
6901
6902
6903     function duplicates_form() {
6904         // count args; build URL
6905         var url = "http://localhost/freeside/misc/xmlhttp-cust_main-duplicates.html?";
6906         var a = duplicates_form.arguments;
6907
6908         var args;
6909         var len;
6910         var content = 'sub=duplicates_form';
6911         if ( a && typeof a  == 'object'  && a[0].constructor == Array ) {
6912             args = a[0];
6913             len = args.length
6914         } else {
6915             args = a;
6916             len = args.length - 1;
6917         }
6918         for (var i = 0; i < len; i++) 
6919             content = content + "&arg=" + escape(args[i]);
6920         content = content.replace( /[+]/g, '%2B'); // fix unescaped plus signs 
6921
6922         if ( 'GET' == 'GET' ) {
6923           url = url + content;
6924         }
6925
6926         //alert('GET ' + url);
6927
6928         var xmlhttp = rs_init_object();
6929         xmlhttp.open("GET", url, true);
6930
6931         xmlhttp.onreadystatechange = function() {
6932             if (xmlhttp.readyState != 4) 
6933                 return;
6934
6935             if (xmlhttp.status != 200) {
6936               if ( xmlhttp.status != 0 ) {
6937                 //not warning on the 0 errors, they pop up when navagating away
6938                 // from the page
6939                 alert(xmlhttp.status + " status connecting to " + url);
6940               }
6941             } else {
6942               var data = xmlhttp.responseText;
6943               //alert('received response: ' + data);
6944               if ( data.indexOf("<b>System error</b>") > -1 ) {
6945                 // trim this a little
6946                 var end = data.indexOf('<a href="#raw">') - 1;
6947                 data = data.substring(0, end);
6948
6949                 overlib(data,
6950                   WIDTH, 480, MIDX, 0, MIDY, 0,
6951                   CAPTION, 'Error', STICKY, AUTOSTATUSCAP, DRAGGABLE,
6952                   CLOSECLICK, BGCOLOR, '#f00', CGCOLOR, '#f00'
6953                 );
6954                 //var w;
6955                 //if ( w = window.open("about:blank") ) {
6956                 //  w.document.write(data);
6957                 //} else {
6958                 //  // popup blocking?  should use an overlib popup instead 
6959                 //  alert("Error popup disabled; try disabling popup blocking to see");
6960                 //}
6961               } else {
6962                 // invoke the callback
6963                 a[a.length-1](data);
6964               }
6965             }
6966         }
6967
6968         if ( 'GET' == 'POST' ) {
6969
6970           xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
6971           xmlhttp.send(content);
6972
6973         } else {
6974
6975           xmlhttp.setRequestHeader("If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT");
6976           xmlhttp.send(null);
6977
6978         }
6979
6980         //rs_debug("x_$func_name url = " + url);
6981         //rs_debug("x_$func_name waiting..");
6982     }
6983
6984
6985 </SCRIPT>
6986
6987
6988 <SCRIPT TYPE="text/javascript">
6989 var fixups = ["copy_payby_fields","standardize_locations","do_submit"];
6990 var fixup_position;
6991 var running = false;
6992
6993 (function() {
6994   var myonload = function() {
6995
6996 submit_abort();
6997
6998   }
6999   if ( window.addEventListener ) {
7000     window.addEventListener('load', myonload);
7001   } else if ( window.attachEvent ) {
7002     window.attachEvent('onload', myonload);
7003   }
7004 })();
7005
7006
7007 function submit_continue() {
7008   if ( running ) {
7009     window[ fixups[fixup_position++] ].call();
7010   }
7011 }
7012
7013 function submit_abort() {
7014   running = false;
7015   fixup_position = 0;
7016   document.CustomerForm.submitButton.disabled = false;
7017   cClick();
7018 }
7019
7020 function bottomfixup(what) {
7021   fixup_position = 0;
7022   document.CustomerForm.submitButton.disabled = true;
7023   running = true;
7024   submit_continue();
7025 }
7026
7027 function do_submit() {
7028   document.CustomerForm.submit();
7029 }
7030
7031 function copy_payby_fields() {
7032   var layervars = new Array(
7033     'payauto', 'billday',
7034     'payinfo', 'payinfo1', 'payinfo2', 'payinfo3', 'paytype',
7035     'payname', 'paystate', 'exp_month', 'exp_year', 'paycvv',
7036     'paystart_month', 'paystart_year', 'payissue',
7037     'payip',
7038     'paid'
7039   );
7040
7041   var cf = document.CustomerForm;
7042   var payby = cf.payby.options[cf.payby.selectedIndex].value;
7043   for ( f=0; f < layervars.length; f++ ) {
7044     var field = layervars[f];
7045     copyelement( cf.elements[payby + '_' + field],
7046                  cf.elements[field]
7047                );
7048   }
7049   submit_continue();
7050 }
7051
7052 function status_message(text, caption) {
7053   text = '<P STYLE="position:absolute; top:50%; margin-top:-1em; width:100%; text-align:center"><B><FONT SIZE="+1">' + text + '</FONT></B></P>';
7054   caption = caption || 'Please wait...';
7055   overlib(text, WIDTH, 444, HEIGHT, 168, CAPTION, caption, STICKY, AUTOSTATUSCAP, CLOSECLICK, MIDX, 0, MIDY, 0);
7056 }
7057
7058 function form_address_info() {
7059   var cf = document.CustomerForm;
7060
7061   var returnobj = { billship: 1 };
7062   returnobj['same'] = cf.elements['same'].checked;
7063     returnobj['bill_address1'] = cf.elements['bill_address1'].value;
7064     returnobj['bill_address2'] = cf.elements['bill_address2'].value;
7065     returnobj['bill_state'] = cf.elements['bill_state'].value;
7066     returnobj['bill_zip'] = cf.elements['bill_zip'].value;
7067     returnobj['bill_country'] = cf.elements['bill_country'].value;
7068     returnobj['bill_city'] = cf.elements['bill_city'].value;
7069     returnobj['bill_censustract'] = cf.elements['bill_enter_censustract'].value;
7070     returnobj['ship_address1'] = cf.elements['ship_address1'].value;
7071     returnobj['ship_address2'] = cf.elements['ship_address2'].value;
7072     returnobj['ship_state'] = cf.elements['ship_state'].value;
7073     returnobj['ship_zip'] = cf.elements['ship_zip'].value;
7074     returnobj['ship_country'] = cf.elements['ship_country'].value;
7075     returnobj['ship_city'] = cf.elements['ship_city'].value;
7076     returnobj['ship_censustract'] = cf.elements['ship_enter_censustract'].value;
7077
7078   return returnobj;
7079 }
7080
7081 function standardize_locations() {
7082
7083   var cf = document.CustomerForm;
7084   var address_info = form_address_info();
7085
7086   var changed = false; // have any of the address fields been changed?
7087
7088 // clear coord_auto fields if the user has changed the coordinates
7089
7090   if ( cf.elements['bill_latitude'].value != cf.elements['old_bill_latitude'].value ) {
7091     cf.elements['bill_coord_auto'].value = '';
7092   }
7093
7094
7095   if ( cf.elements['bill_longitude'].value != cf.elements['old_bill_longitude'].value ) {
7096     cf.elements['bill_coord_auto'].value = '';
7097   }
7098
7099   // but if the coordinates have been set to null, turn coord_auto on 
7100   // and standardize
7101   if ( cf.elements['bill_latitude'].value == '' &&
7102        cf.elements['bill_longitude'].value == '' ) {
7103     cf.elements['bill_coord_auto'].value = 'Y';
7104     changed = true;
7105   }
7106   // standardize if the old address wasn't clean
7107   if ( cf.elements['bill_addr_clean'].value == '' ) {
7108     changed = true;
7109   }
7110
7111   if ( cf.elements['ship_latitude'].value != cf.elements['old_ship_latitude'].value ) {
7112     cf.elements['ship_coord_auto'].value = '';
7113   }
7114
7115
7116   if ( cf.elements['ship_longitude'].value != cf.elements['old_ship_longitude'].value ) {
7117     cf.elements['ship_coord_auto'].value = '';
7118   }
7119
7120   // but if the coordinates have been set to null, turn coord_auto on 
7121   // and standardize
7122   if ( cf.elements['ship_latitude'].value == '' &&
7123        cf.elements['ship_longitude'].value == '' ) {
7124     cf.elements['ship_coord_auto'].value = 'Y';
7125     changed = true;
7126   }
7127   // standardize if the old address wasn't clean
7128   if ( cf.elements['ship_addr_clean'].value == '' ) {
7129     changed = true;
7130   }
7131
7132   // or if it was clean but has been changed
7133   for (var key in address_info) {
7134     var old_el = cf.elements['old_'+key];
7135     if ( old_el && address_info[key] != old_el.value ) {
7136       changed = true;
7137       break;
7138     }
7139   }
7140
7141
7142   if ( !changed && 1 ) {
7143     if ( address_info['same'] ) {
7144       cf.elements['bill_censustract'].value =
7145         address_info['bill_censustract'];
7146     } else {
7147       cf.elements['ship_censustract'].value =
7148         address_info['ship_censustract'];
7149     }
7150   }
7151
7152
7153   post_standardization();
7154
7155 }
7156
7157 var returned;
7158
7159 function confirm_standardize(arg) {
7160   // contains 'old', which was what we sent, and 'new', which is what came
7161   // back, including any errors
7162   returned = JSON.parse(arg);
7163
7164   if ( 0 ) {
7165
7166     replace_address(); // with the contents of returned['new']
7167   
7168   } else if ( returned['all_same'] ) {
7169
7170     // then all entered address fields are correct
7171     // but we still need to set the lat/long fields and addr_clean
7172     status_message('Verified');
7173     replace_address();
7174
7175   } else {
7176
7177     var querystring = encodeURIComponent( JSON.stringify(returned) );
7178     // confirmation popup: knows to call replace_address(), 
7179     // post_standardization(), or submit_abort() depending on the 
7180     // user's choice.
7181     OLpostAJAX(
7182         'http://localhost/freeside//misc/confirm-address_standardize.html', 
7183         'q='+querystring,
7184         function() {
7185           overlib( OLresponseAJAX, CAPTION, 'Address standardization', STICKY, 
7186             AUTOSTATUSCAP, CLOSETEXT, '', MIDX, 0, MIDY, 0, DRAGGABLE, WIDTH, 
7187             576, HEIGHT, 268, BGCOLOR, '#333399', CGCOLOR, '#333399', 
7188             TEXTSIZE, 3 );
7189         }, 0);
7190
7191   }
7192 }
7193
7194 function replace_address() {
7195
7196   var newaddr = returned['new'];
7197
7198   var cf = document.CustomerForm;
7199   var clean = newaddr['bill_addr_clean'] == 'Y';
7200   var error = newaddr['bill_error'];
7201   if ( clean ) {
7202     cf.elements['bill_address1'].value = newaddr['bill_address1'];
7203     cf.elements['bill_address2'].value = newaddr['bill_address2'];
7204     cf.elements['bill_state'].value = newaddr['bill_state'];
7205     cf.elements['bill_zip'].value = newaddr['bill_zip'];
7206     cf.elements['bill_addr_clean'].value = newaddr['bill_addr_clean'];
7207     cf.elements['bill_city'].value = newaddr['bill_city'];
7208
7209     if ( cf.elements['bill_coord_auto'].value ) {
7210       cf.elements['bill_latitude'].value  = newaddr['bill_latitude'];
7211       cf.elements['bill_longitude'].value = newaddr['bill_longitude'];
7212     }
7213     if ( clean && newaddr['bill_censustract'] ) {
7214       cf.elements['bill_censustract'].value = newaddr['bill_censustract'];
7215     }
7216   } // if clean
7217   var clean = newaddr['ship_addr_clean'] == 'Y';
7218   var error = newaddr['ship_error'];
7219   if ( clean ) {
7220     cf.elements['ship_address1'].value = newaddr['ship_address1'];
7221     cf.elements['ship_address2'].value = newaddr['ship_address2'];
7222     cf.elements['ship_state'].value = newaddr['ship_state'];
7223     cf.elements['ship_zip'].value = newaddr['ship_zip'];
7224     cf.elements['ship_addr_clean'].value = newaddr['ship_addr_clean'];
7225     cf.elements['ship_city'].value = newaddr['ship_city'];
7226
7227     if ( cf.elements['ship_coord_auto'].value ) {
7228       cf.elements['ship_latitude'].value  = newaddr['ship_latitude'];
7229       cf.elements['ship_longitude'].value = newaddr['ship_longitude'];
7230     }
7231     if ( clean && newaddr['ship_censustract'] ) {
7232       cf.elements['ship_censustract'].value = newaddr['ship_censustract'];
7233     }
7234   } // if clean
7235
7236   post_standardization();
7237
7238 }
7239
7240 function confirm_manual_address() {
7241   var cf = document.CustomerForm;
7242   cf.elements['bill_censustract'].value =
7243     cf.elements['bill_enter_censustract'].value;
7244   cf.elements['ship_censustract'].value =
7245     cf.elements['ship_enter_censustract'].value;
7246   post_standardization();
7247 }
7248
7249 function post_standardization() {
7250
7251
7252   submit_continue();;
7253
7254
7255 }
7256
7257 function update_geocode() {
7258
7259   //yay closures
7260   set_geocode = function (what) {
7261
7262     var cf = document.CustomerForm;
7263     var prefix = 'bill_';
7264     if ( cf.elements['same']
7265       && cf.elements['same'].checked
7266       && prefix == 'ship_' ) {
7267       prefix = 'bill_';
7268     }
7269
7270     //alert(what.options[what.selectedIndex].value);
7271     var argsHash = eval('(' + what.options[what.selectedIndex].value + ')');
7272     cf.elements[prefix + 'city'].value     = argsHash['city'];
7273     setselect(cf.elements[prefix + 'state'], argsHash['state']);
7274     cf.elements[prefix + 'zip'].value      = argsHash['zip'];
7275     cf.elements[prefix + 'geocode'].value  = argsHash['geocode'];
7276     submit_continue();;
7277
7278   }
7279
7280   // popup a chooser
7281
7282   overlib( OLresponseAJAX, CAPTION, 'Select tax location', STICKY, AUTOSTATUSCAP, CLOSETEXT, '', MIDX, 0, MIDY, 0, WIDTH, 576, HEIGHT, 268, BGCOLOR, '#333399', CGCOLOR, '#333399', TEXTSIZE, 3 );
7283
7284 }
7285
7286 function setselect(el, value) {
7287
7288   for ( var s = 0; s < el.options.length; s++ ) {
7289      if ( el.options[s].value == value ) {
7290        el.selectedIndex = s;
7291      }
7292   }
7293
7294 }
7295
7296
7297
7298
7299 function copyelement(from, to) {
7300   if ( from == undefined ) {
7301     to.value = '';
7302   } else if ( from.type == 'select-one' ) {
7303     to.value = from.options[from.selectedIndex].value;
7304     //alert(from + " (" + from.type + "): " + to.name + " => (" + from.selectedIndex + ") " + to.value);
7305   } else if ( from.type == 'checkbox' ) {
7306     if ( from.checked ) {
7307       to.value = from.value;
7308     } else {
7309       to.value = '';
7310     }
7311   } else {
7312     if ( from.value == undefined ) {
7313       to.value = '';
7314     } else {
7315       to.value = from.value;
7316     }
7317   }
7318   //alert(from + " (" + from.type + "): " + to.name + " => " + to.value);
7319 }
7320
7321 function confirm_censustract(pre) {
7322   var cf = document.CustomerForm;
7323   if ( cf.elements[pre+'censustract'].value == '' ) {
7324     var address_info = form_address_info();
7325     address_info[pre+'latitude']  = cf.elements[pre+'latitude'].value;
7326     address_info[pre+'longitude'] = cf.elements[pre+'longitude'].value;
7327     address_info['prefix'] = pre;
7328     OLpostAJAX(
7329         'http://localhost/freeside//misc/confirm-censustract.html',
7330         'q=' + encodeURIComponent(JSON.stringify(address_info)),
7331         function() {
7332           if ( OLresponseAJAX ) {
7333             overlib( OLresponseAJAX, CAPTION, 'Confirm censustract', STICKY,
7334               AUTOSTATUSCAP, CLOSETEXT, '', MIDX, 0, MIDY, 0, DRAGGABLE, WIDTH,
7335               576, HEIGHT, 268, BGCOLOR, '#333399', CGCOLOR, '#333399',
7336               TEXTSIZE, 3 );
7337           } else
7338             submit_continue();
7339         },
7340         0);
7341   } else submit_continue();
7342 }
7343 function confirm_censustract_bill() {
7344   confirm_censustract('bill_');
7345 }
7346
7347 function confirm_censustract_ship() {
7348   var cf = document.CustomerForm;
7349   if ( cf.elements['same'].checked ) {
7350     submit_continue();
7351   } else {
7352     confirm_censustract('ship_');
7353   }
7354 }
7355
7356 function set_censustract(tract, year, pre) {
7357   var cf = document.CustomerForm;
7358   cf.elements[pre + 'censustract'].value = tract;
7359   cf.elements[pre + 'censusyear'].value = year;
7360   submit_continue();
7361 }
7362
7363 function check_unique() {
7364   var search_hash = {};
7365
7366   duplicates_form(JSON.stringify(search_hash), confirm_unique);
7367 }
7368
7369 function confirm_unique(arg) {
7370   if ( arg.match(/\S/) ) {
7371   overlib( arg, CAPTION, 'Duplicate customer', STICKY, AUTOSTATUSCAP, 
7372       CLOSETEXT, '', MIDX, 0, MIDY, 0, DRAGGABLE, WIDTH, 576, HEIGHT, 
7373       268, BGCOLOR, '#333399', CGCOLOR, '#333399', TEXTSIZE, 3 );
7374   } else { // no duplicates
7375     submit_continue();
7376   }
7377 }
7378
7379
7380 </SCRIPT>
7381
7382
7383 <BR>
7384 <INPUT TYPE    = "button"
7385        NAME    = "submitButton"
7386        ID      = "submitButton"
7387        VALUE   = "Apply changes"
7388        onClick = "this.disabled=true; bottomfixup(this.form);"
7389 >
7390 <BR><BR>
7391 </FORM>
7392
7393         </TD>
7394       </TR>
7395     </TABLE>
7396   </BODY>
7397 </HTML>
7398
7399