// JavaScript Document //Display Only $(document).ready(function(){ // Functions for removal of Table columns and rows $.fn.removeCol = function(col){ // Make sure col has value if(!col){ col = 1; } $('tr td:nth-child('+col+'), tr th:nth-child('+col+')', this).remove(); return this; }; function removeTableRow(jQtable){ jQtable.each(function(){ if($('tbody', this).length > 0){ $('tbody tr:last', this).remove(); }else { $('tr:last', this).remove(); } }); }; var $is_link=$("[name=is_link_print]").val(); var $display_only=$("[name=d_Only]").val(); var $curcopy1=$("[name=cur_copy_1]").val(); var $curcopy2=$("[name=cur_copy_2]").val(); var $curcopy3=$("[name=cur_copy_3]").val(); var $curcopy4=$("[name=cur_copy_4]").val(); var $curcopy5=$("[name=cur_copy_5]").val(); var $curcopy6=$("[name=cur_copy_6]").val(); var $curcopy7=$("[name=cur_copy_7]").val(); var $curcopy8=$("[name=cur_copy_8]").val(); var $curcopy9=$("[name=cur_copy_9]").val(); var $app_purpose=$("[name=application$app_purpose]").val(); var $pubacc=$("[name=pubacc]").val(); var $printform=$("[name=printform]").val(); var $orig_app_purpose=$("[name=orig_app_purpose]").val(); // If display only show all subforms and remove buttons if ($display_only == 'Y') { //$("div#Instructions-Link").hide("fast"); $("div#CORES_HOME").hide("FAST"); // Hide all subforms with no rows if ($curcopy1 == "0" ) { $("input#Cownership_group").after('

[Enter Station Information]

'); $("div#DIVOG").hide("fast"); } else { $("div#DIVOG").show("fast"); $('#OGTBLI').removeCol(6); removeTableRow($('#OGTBLI')); $("input[id^='OGFC'],input[id^='OGFID'], input[id^='OGCALLSGN'],select[id^='OGCS'] ,input[id^='OGCC'],select[id^='OGFSO']").each ( function( intIndex ){ var d_Only_val = $(this).val(); $(this).after( d_Only_val ); $(this).remove(); } //end function );//end each } // end else copy 1 /* End of copy 1 */ /* Copy 2 */ if ($curcopy2 == "0" ) { $("input#Cownership_contract").after('

[Enter Contract Information]

'); $("div#DIVCT").hide("fast"); } else { $("div#DIVCT").show("fast"); $('#OCTBLI').removeCol(7); removeTableRow($('#OCTBLI')); // textboxes $("input[id^='OCCD'],input[id^='OCCP'], input[id^='OCXDM'], input[id^='OCXDY'],input[id^='OCEDY']").each ( function( intIndex ){ var d_Only_val = $(this).val(); $(this).after( d_Only_val ); $(this).remove(); } //end function );//end each }// end of copy 2 /* End of copy 2 */ //Copy 3 if ($curcopy3 == "0" ) { $("input#Cownership_capitalization").after('

[Enter Capitalization Information]

'); $("div#DIVCAP").hide("fast"); } else { $("div#DIVCAP").show("fast"); //removed in section removeTableRow($('#CITBLI')); // textboxes $("input[id^='OCCOSO'],input[id^='OCIS'],input[id^='OCAS'],input[id^='OCTS'],input[id^='OCUS']").each ( function( intIndex ){ var d_Only_val = $(this).val(); $(this).after(d_Only_val); $(this).remove(); } //end function );//end each } // Copy 4 if ($curcopy4 == "0" ) { $("input#Cownership_structure").after('

[Enter Ownership Interests Information]

'); $("div#DIVOS").hide("fast"); } else { $("div#DIVOS").show("fast"); $("div#OSCB").hide("fast"); $('#OSTBLI').removeCol(5); $("input[id^='owncbox']").hide("fast"); removeTableRow($('#OSTBLI')); removeTableRow($('#OSTBLI')); //$('#OSTBLI').removeCol(5); //$('#OSTBLI').removeCol(4); $('#OSVS').remove(); $('#OSSS').remove(); $("input[id^='OSSUFRN']").remove(); $("input[id^='OSFRN']").remove(); // $("input[id^='SPECFRN']").remove(); // textboxes $("input[id^='NAME'],input[id^='OSSA1'],input[id^='OSSA2'],input[id^='OSCITY'],input[id^='OSZIP1'],input[id^='OSZIP2'],input[id^='OSCOUNTRY'],input[id^='OSPIO'],input[id^='OSCITIZEN'],input[id^='OSVP'],input[id^='OSAP'],input[id^='OSEP'],input[id^='OSNAME'],input[id^='OSPIOI']").each ( function( intIndex ){ var d_Only_val = $(this).val(); $(this).after(d_Only_val); $(this).remove(); } //end function );//end each } // end of Copy 4 if ($curcopy5 == "0" ) { $("input#Cownership_other_intB").after('

[Broadcast Interests Subform]

'); $("div#DIVAT").hide("fast"); } else { $("div#DIVAT").show("fast"); if ($app_purpose == "OB" || $orig_app_purpose == "OB") { $('#OOIBTBLI').removeCol(10); // $('#OOIBTBLI').removeCol(8); } else { $('#OOIBTBLI').removeCol(10); $('#OOIBTBLI').removeCol(9); } removeTableRow($('#OOIBTBLI')); $('#OOIBSS').remove(); $('#OOIBVS').remove(); // textboxes $("input[id^='OOINAMEB'],input[id^='OOICALLB'],input[id^='OOICCB'],input[id^='OOICSB'],input[id^='OOIFIB'],input[id^='OOIVPB'],input[id^='OOIEPB'],input[id^='OOIAPB'],input[id^='OOIBOTH']").each ( function( intIndex ){ var d_Only_val = $(this).val(); $(this).after(d_Only_val); $(this).remove(); } //end function );//end each } if ($curcopy6 == "0" ) { $("input#Cownership_other_intN").after('

[Newspaper Interests Subform]

'); $("div#DIVNEW").hide("fast"); } else { $("div#DIVNEW").show("fast"); if ($app_purpose == "OB" || $orig_app_purpose == "OB") { $('#OOINTBLI').removeCol(9); // $('#OOINTBLI').removeCol(10); } else { $('#OOINTBLI').removeCol(8); } removeTableRow($('#OOINTBLI')); $('#OOINSS').remove(); $('#OOINVS').remove(); // textboxes $("input[id^='OOINAMEN'],input[id^='OOINEWSN'],input[id^='OOICITYN'],input[id^='OOISTATEN'],input[id^='OOIVOTESN'],input[id^='OOIEPN'],input[id^='OOIAPN'],,input[id^='OOINOTH']").each ( function( intIndex ){ var d_Only_val = $(this).val(); $(this).after(d_Only_val); $(this).remove(); } //end function );//end each } // Copy 7 if ($curcopy7 == "0" ) { $("input#Cownership_relationships").after('

[Enter Familial Relationships Information]

'); $("div#DIVREL").hide("fast"); } else { $("div#DIVREL").show("fast"); $('#ORTBLI').removeCol(6); removeTableRow($('#ORTBLI')); $('#ORVS').remove(); $('#ORSS').remove(); // textboxes $("input[id^='ORNAMES']").each ( function( intIndex ){ var d_Only_val = $(this).val(); $(this).after(d_Only_val); $(this).remove(); } //end function );//end each } if ($curcopy8 == "0" ) { $("input#Cownership_exemptions").after('

[Enter Attribution Exemption Information]

'); $("div#DIVEX").hide("fast"); } else { $("div#DIVEX").show("fast"); $('#OETBLI').removeCol(5); removeTableRow($('#OETBLI')); $('#OEVS').remove(); $('#OESS').remove(); // textboxes $("input[id^='OENAME'],input[id^='OETITLE']").each ( function( intIndex ){ var d_Only_val = $(this).val(); $(this).after(d_Only_val); $(this).remove(); } //end function );//end each } // Copy 9 if ($curcopy9 == "0" ) { $("input#Cownership_interests").after('

[Enter Respondent Interests Held Information]

'); $("div#DIVRESP").hide("fast"); } else { $("div#DIVRESP").show("fast"); $('#OITBLI').removeCol(4); removeTableRow($('#OITBLI')); $('#OIVS').remove(); $('#OISS').remove(); // textboxes $("input[id^='OINAME'],input[id^='OIFRN']").each ( function( intIndex ){ var d_Only_val = $(this).val(); $(this).after(d_Only_val); $(this).remove(); } //end function );//end each } // hide all buttons that should not be displayed //subform buttons $('#Cownership_group').hide(); $('#Downership_group').hide(); $('#Cownership_contract').hide(); $('#Downership_contract').hide(); $('#Cownership_capitalization').hide(); $('#Downership_capitalization').hide(); $('#Cownership_structure').hide(); $('#Downership_structure').hide(); $('#Cownership_interests').hide(); $('#Downership_interests').hide(); $('#Cownership_exemptions').hide(); $('#Downership_exemptions').hide(); $('#Cownership_other_intB').hide(); $('#Downership_other_intB').hide(); //$('#Cownership_other_intN').hide(); //$('#Downership_other_intN').hide(); $('#Cownership_relationships').hide(); $('#Downership_relationships').hide(); $('#exhibit1').after('[ Exhibit 1 ]'); $('#exhibit1').hide(); $('#exhibit2').after('[ Exhibit 2 ]'); $('#exhibit2').hide(); $('#exhibit3').after('[ Exhibit 3 ]'); $('#exhibit3').hide(); $("input[id^='exhibit4']").after('[ Exhibit 4 ]'); $('#exhibit4').hide(); $("input[id^='exhibit4']").hide(); $('#exhibit5').after('[ Exhibit 5 ]'); $('#exhibit5').hide(); $('#exhibit6').after('[ Exhibit 6 ]'); $('#exhibit6').hide(); $('input[name=submit]').hide(); $('#FRN').hide(); $('#SAVE').hide(); $('#Validate').hide(); /// end of hiding if ($pubacc == "N" && $is_link == "Y") { $('#Menu').show(); }; } });