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