+function confirm_censustract_ship() {
+ var cf = document.CustomerForm;
+ if ( cf.elements['same'].checked ) {
+ submit_continue();
+ } else {
+ confirm_censustract('ship_');
+ }
+}
+
+%# called from confirm-censustract.html
+function set_censustract(tract, year, pre) {
+ var cf = document.CustomerForm;
+ cf.elements[pre + 'censustract'].value = tract;
+ cf.elements[pre + 'censusyear'].value = year;
+ submit_continue();
+}
+
+function check_unique() {
+ var search_hash = {};
+% if ($uniqueness eq 'address') {
+ search_hash['address'] = [
+ document.CustomerForm.elements['bill_address1'].value,
+ document.CustomerForm.elements['ship_address1'].value
+ ];
+% }
+%# no other options yet
+
+%# supported in IE8+, Firefox 3.5+, WebKit, Opera 10.5+
+ duplicates_form(JSON.stringify(search_hash), confirm_unique);
+}
+
+function confirm_unique(arg) {
+ if ( arg.match(/\S/) ) {
+%# arg contains a complete form to choose an existing customer, or not
+ overlib( arg, CAPTION, 'Duplicate customer', STICKY, AUTOSTATUSCAP,
+ CLOSETEXT, '', MIDX, 0, MIDY, 0, DRAGGABLE, WIDTH, 576, HEIGHT,
+ 268, BGCOLOR, '#333399', CGCOLOR, '#333399', TEXTSIZE, 3 );
+ } else { // no duplicates
+ submit_continue();
+ }
+}