+ function location_disable(what) {
+% for (@location_fields, 'city_select') {
+ what.form.<%$_%>.disabled = true;
+ var ftype = what.form.<%$_%>.tagName;
+ if( ftype == 'SELECT') changeSelect(what.form.<%$_%>, '');
+ else what.form.<%$_%>.value = '';
+ if( ftype != 'SELECT') what.form.<%$_%>.style.backgroundColor = '#dddddd';
+% }
+ }
+
+ function location_clear(what) {
+% for (grep { $_ ne 'location_number' } @location_fields, 'city_select') {
+ var ftype = what.form.<%$_%>.tagName;
+ if( ftype == 'INPUT' ) what.form.<%$_%>.value = '';
+% }
+% if ( $opt{'alt_format'} ) {
+ changeSelect(what.form.location_kind, '');
+ changeSelect(what.form.location_type, '');
+ what.form.location_number.value = '';
+% }
+ }
+
+ function location_enable(what) {
+% for (grep { $_ ne 'location_number' } @location_fields, 'city_select') {
+ what.form.<%$_%>.disabled = false;
+ var ftype = what.form.<%$_%>.tagName;
+ if( ftype != 'SELECT') what.form.<%$_%>.style.backgroundColor = '#ffffff';
+% }
+
+ if ( what.form.location_type.options[what.form.location_type.selectedIndex].value ) {
+ what.form.location_number.disabled = false;
+ what.form.location_number.style.backgroundColor = '#ffffff';
+ }
+ }
+