+% if ( $export->get_dids_can_manual ) {
+ <TR>
+
+ <TD VALIGN="top">
+ <INPUT TYPE = "radio"
+ NAME = "phonenum_which"
+ VALUE = "phonenum_manual"
+ onChange = "phonenum_which_changed(this)"
+ onClick = "phonenum_which_changed(this)"
+ <% $manual_checked %>
+ > Manual entry
+ </TD>
+
+ <TD VALIGN="top" COLSPAN=4>
+ <& /elements/input-text.html,
+ %opt,
+ field => 'phonenum_manual',
+ id => 'phonenum_manual',
+ type => 'text',
+ disabled => ( $phonenum_checked ? 1 : 0 ),
+ &>
+ </TD>
+ </TR>
+
+ <SCRIPT TYPE="text/javascript">
+ function phonenum_which_changed(what) {
+
+ if ( what.value == 'phonenum' && what.checked ) {
+
+ what.form.phonenum_manual.disabled = true;
+ what.form.phonenum_manual.style.backgroundColor = '#dddddd';
+
+ what.form.phonenum_state.disabled = false;
+
+ document.getElementById('phonenum_state_label').style.color = '#000000';
+ if ( document.getElementById('areacode_label') ) {
+ document.getElementById('areacode_label').style.color = '#000000';
+ }
+ if ( document.getElementById('exchange_label') ) {
+ document.getElementById('exchange_label').style.color = '#000000';
+ }
+ if ( document.getElementById('region_label') ) {
+ document.getElementById('region_label').style.color = '#000000';
+ }
+ document.getElementById('phonenum_phonenum_label').style.color = '#000000';
+
+ var value = what.form.phonenum_state.options[ what.form.phonenum_state.selectedIndex].value;
+
+ if ( value != '' ) {
+
+ if ( what.form.areacode ) {
+ what.form.areacode.disabled = false;
+
+ var areacode_value = what.form.areacode.options[ what.form.areacode.selectedIndex].value;
+
+ if ( areacode_value != '' ) {
+ what.form.exchange.disabled = false;
+
+ var exchange_value = what.form.exchange.options[ what.form.exchange.selectedIndex].value;
+
+ if ( exchange_value != '' ) {
+ what.form.phonenum.disabled = false;
+ }
+
+ }
+
+ }
+ if ( what.form.region ) {
+ what.form.region.disabled = false;
+
+ var region_value = what.form.region.options[ what.form.region.selectedIndex].value;
+
+ if ( region_value != '' ) {
+ what.form.phonenum.disabled = false;
+ }
+
+ }
+
+ }
+
+ }
+
+ if ( what.value == 'phonenum_manual' && what.checked ) {
+
+ what.form.phonenum_manual.disabled = false;
+ what.form.phonenum_manual.style.backgroundColor = '#ffffff';
+
+ what.form.phonenum_state.disabled = true;
+
+ document.getElementById('phonenum_state_label').style.color = '#999999';
+ if ( document.getElementById('areacode_label') ) {
+ document.getElementById('areacode_label').style.color = '#999999';
+ }
+ if ( document.getElementById('exchange_label') ) {
+ document.getElementById('exchange_label').style.color = '#999999';
+ }
+ if ( document.getElementById('region_label') ) {
+ document.getElementById('region_label').style.color = '#999999';
+ }
+ document.getElementById('phonenum_phonenum_label').style.color = '#999999';
+
+ if ( what.form.areacode ) {
+ what.form.areacode.disabled = true;
+ }
+
+ if ( what.form.exchange ) {
+ what.form.exchange.disabled = true;
+ }
+
+ if ( what.form.region ) {
+ what.form.region.disabled = true;
+ }
+
+ what.form.phonenum.disabled = true;
+ }
+
+ }
+ </SCRIPT>
+
+% }
+