+.rolldown_button {
+ min-width: 80px;
+ margin-left: 100px;
+ min-height: 20px;
+ background-color: #efefef;
+ border: 1px solid #7e0079;
+ z-index: 1;
+ text-align: center;
+}
+
+</STYLE>
+
+% # activate rolldown buttons for hidden package blocks
+<SCRIPT TYPE="text/javascript">
+function toggle_rolldown() {
+ var up_arrow = <% decode_entities('⬆') |js_string %>;
+ var dn_arrow = <% decode_entities('⬇') |js_string %>;
+ var pkgnum = this.id.replace('rolldown_', '');
+ var hidden = document.getElementById('cust_pkg'+pkgnum+'_block');
+ if (hidden.style.display == 'none') {
+ hidden.style.display = '';
+ this.textContent = this.textContent.replace(dn_arrow, up_arrow);
+ } else {
+ hidden.style.display = 'none';
+ this.textContent = this.textContent.replace(up_arrow, dn_arrow);
+ }
+}
+<&| /elements/onload.js &>
+var el;
+% if ( $cgi->param('fragment') =~ /^cust_pkg(\d+)$/ ) {
+% # IE-specific hack, but also unhide the row if it's in a hidden block
+el = document.getElementById('cust_pkg<% $1 %>');
+% }
+var all_buttons = document.getElementsByClassName('rolldown_button');
+for (var i = 0; i < all_buttons.length; i++) {
+ all_buttons[i].onclick = toggle_rolldown;
+ var block_id = all_buttons[i].id.replace('rolldown_', '');
+ if ( el && document.getElementById('cust_pkg'+block_id+'_block')
+ .contains(el)
+ ) {
+ // then toggle it now
+ all_buttons[i].click();
+ }
+}
+if ( el ) el.scrollIntoView(true);
+</&>
+</SCRIPT>
+
+<TABLE>
+ <TR>
+ <TD ALIGN="left" VALIGN="top">
+
+% my $br = 0;
+
+% if ( $total_pkgs > $maxrecords ) {
+
+% if ( 1 ) { #FS::pkg_class->num_pkg_class ) {
+ <% $br++ ? ' | ' : '' %>
+ Class: <& /elements/select-cust-pkg_class.html,
+ curr_value => scalar($cgi->param('classnum')),
+ onchange => 'classnum_changed(this);',
+ pre_options => [ '-1' => 'all',
+ '0' => '(none)',
+ ],
+ &>
+% }