+
+% if ($census_functions) { # do not use this in cust_main
+function confirm_censustract() {
+% if ( FS::Conf->new->exists('cust_main-require_censustract') ) {
+ var form = document.<% $formname %>;
+ if ( form.elements['censustract'].value == '' ) {
+ var address_info = form_address_info();
+ address_info['latitude'] = form.elements['latitude'].value;
+ address_info['longitude'] = form.elements['longitude'].value;
+ OLpostAJAX(
+ '<%$p%>/misc/confirm-censustract.html',
+ 'q=' + encodeURIComponent(JSON.stringify(address_info)),
+ function() {
+ if ( OLresponseAJAX ) {
+ overlib( OLresponseAJAX, CAPTION, 'Confirm censustract', STICKY,
+ AUTOSTATUSCAP, CLOSETEXT, '', MIDX, 0, MIDY, 0, DRAGGABLE, WIDTH,
+ 576, HEIGHT, 268, BGCOLOR, '#333399', CGCOLOR, '#333399',
+ TEXTSIZE, 3 );
+ } else {
+ // no response
+ <% $post_censustract %>;
+ }
+ },
+ 0);
+ } else {
+ <% $post_censustract %>;
+ }
+% } else { # skip this step
+ <% $post_censustract %>;
+% }
+}
+
+function set_censustract(tract, year) {
+ var form = document.<% $formname %>;
+ form.elements['censustract'].value = tract;
+ form.elements['censusyear'].value = year;
+ <% $post_censustract %>;
+}
+
+% } # $census_functions
+