function weaverx_form_menu_opts($value, $submit = false)
{
    // build the rows for area settings
    //echo '<table><tr><td>';
    $name = $value['name'];
    $id = $value['id'];
    $opts = array(array('name' => $name, 'id' => '-menu', 'type' => 'header_area', 'info' => $value['info']), array('name' => __('Menu Bar', 'weaver-xtreme'), 'id' => $id, 'type' => 'titles_menu', 'info' => __('Entire Menu Bar', 'weaver-xtreme')), array('name' => __('Item BG', 'weaver-xtreme'), 'id' => $id . '_link_bgcolor', 'type' => 'ctext', 'info' => '<em>' . $name . '</em>' . __(': Background Color for Menu Bar Items (links)', 'weaver-xtreme')), array('name' => '<small>' . __('Dividers between menu items', 'weaver-xtreme') . '</small>', 'id' => $id . '_dividers_color', 'type' => '+color', 'info' => '<em>' . $name . '</em>' . __(': Add colored dividers between menu items. Leave blank for none. (&starf;Plus)', 'weaver-xtreme')), array('name' => '<small>' . __('Hover BG', 'weaver-xtreme') . '</small>', 'id' => $id . '_hover_bgcolor', 'type' => 'ctext', 'info' => '<em>' . $name . '</em>' . __(': Hover BG Color (Default: rgba(255,255,255,0.15))', 'weaver-xtreme')), array('name' => '<small>' . __('Hover Text Color', 'weaver-xtreme') . '</small>', 'id' => $id . '_hover_color', 'type' => 'color', 'info' => '<em>' . $name . '</em>' . __(': Hover Text Color', 'weaver-xtreme')), array('name' => '<small>' . __('<em>Mobile</em> Open Submenu Arrow BG -<br /><em>Not used by SmarMenus</em>', 'weaver-xtreme') . '</small>', 'id' => $id . '_clickable_bgcolor', 'type' => 'ctext', 'info' => '<em>' . $name . '</em>' . __(': Clickable mobile open submenu arrow BG. Contrasting BG color required for proper user interface. <em>Not used by SmartMenus</em>. (Default: rgba(255,255,255,0.2))', 'weaver-xtreme')), array('name' => __('Submenu BG', 'weaver-xtreme'), 'id' => $id . '_sub_bgcolor', 'type' => 'ctext', 'info' => '<em>' . $name . '</em>' . __(': Background Color for submenus', 'weaver-xtreme')), array('name' => '<small>' . __('Submenu Text Color', 'weaver-xtreme') . '</small>', 'id' => $id . '_sub_color', 'type' => 'ctext', 'info' => '<em>' . $name . '</em>' . __(': Text Color for submenus', 'weaver-xtreme')), array('name' => '<small>' . __('Submenu Hover BG', 'weaver-xtreme') . '</small>', 'id' => $id . '_sub_hover_bgcolor', 'type' => 'ctext', 'info' => '<em>' . $name . '</em>' . __(': Submenu Hover BG Color (Default: Inherit Top Level)', 'weaver-xtreme')), array('name' => '<small>' . __('Submenu Hover Text Color', 'weaver-xtreme') . '</small>', 'id' => $id . '_sub_hover_color', 'type' => 'color', 'info' => '<em>' . $name . '</em>' . __(': Submenu Hover Text Color (Default: Inherit Top Level)', 'weaver-xtreme')), array('name' => '<small>' . __('Full-width BG', 'weaver-xtreme') . '</small>', 'id' => $id . '_extend_bgcolor', 'type' => '+color', 'info' => '<em>' . $name . '</em>' . __(': Extend BG color to full theme width on Desktop View (&starf;Plus)', 'weaver-xtreme'), 'value' => array()), array('name' => '<span class="i-left" style="font-size:150%;">&harr;</span><small>' . __('Extend BG Attributes', 'weaver-xtreme') . '</small>', 'id' => $id . '_extend_width', 'type' => 'checkbox', 'info' => '<em>' . $name . '</em>' . __(': Extend all BG Attributes to full width. Overrides Full-width BG color.', 'weaver-xtreme')), array('name' => '<span class="i-left dashicons dashicons-editor-alignleft"></span>' . __('Align Menu', 'weaver-xtreme'), 'id' => $id . '_align', 'type' => 'select_id', 'info' => __('Align this menu on desktop view. Mobile, accordion, and vertical menus always left aligned.', 'weaver-xtreme'), 'value' => array(array('val' => 'left', 'desc' => 'Left'), array('val' => 'center', 'desc' => 'Center'), array('val' => 'right', 'desc' => 'Right'))), array('name' => '<span class="i-left" style="font-size:200%;margin-left:4px;">&#x25a1;</span><small>' . __('Add Border', 'weaver-xtreme') . '</small>', 'id' => $id . '_border', 'type' => 'checkbox', 'info' => '<em>' . $name . '</em>' . ': Add the "standard" border (as set on Custom tab)'), array('name' => '<span class="i-left" style="font-size:200%;margin-left:4px;">&#x25a1;</span><small>' . __('Add Border to Submenus', 'weaver-xtreme') . '</small>', 'id' => $id . '_sub_border', 'type' => 'checkbox', 'info' => '<em>' . $name . '</em>' . ': Add the "standard" border to Submenus'), array('name' => '<span class="i-left dashicons dashicons-marker"></span><small>' . __('Rounded Submenu Corners', 'weaver-xtreme') . '</small>', 'id' => $id . '_sub_rounded', 'type' => 'checkbox', 'info' => '<em>' . $name . '</em>' . ': Add rounded corners to Submenus'), array('name' => '<span class="i-left dashicons dashicons-admin-page"></span><small>' . __('Shadow', 'weaver-xtreme') . '</small>', 'id' => $id . '_shadow', 'type' => 'shadows', 'info' => '<em>' . $name . '</em>' . __(': Wrap Menu Bar with Shadow.', 'weaver-xtreme')), array('name' => '<span class="i-left dashicons dashicons-marker"></span><small>' . __('Rounded Corners', 'weaver-xtreme') . '</small>', 'id' => $id . '_rounded', 'type' => 'rounded', 'info' => '<em>' . $name . '</em>' . __(': Add rounded corners to menu. <em>You might need to set overlapping corners Header/Wrapper areas also!</em>', 'weaver-xtreme')));
    weaverx_form_show_options($opts, false, false);
    if ($id == 'm_primary') {
        weaverx_form_checkbox(array('name' => '<small>' . __('Move Primary Menu to Top', 'weaver-xtreme') . '</small>', 'id' => $id . '_move', 'info' => '<em>' . $name . '</em>' . __(': Move Primary Menu at Top of Header Area (Default: Bottom)', 'weaver-xtreme'), 'value' => ''));
    } elseif ($id == 'm_secondary') {
        weaverx_form_checkbox(array('name' => '<small>' . __('Move Secondary Menu to Bottom', 'weaver-xtreme') . '</small>', 'id' => $id . '_move', 'info' => '<em>' . $name . '</em>' . __(': Move Secondary Menu at Bottom of Header Area (Default: Top)', 'weaver-xtreme'), 'value' => ''));
    }
    $opts2 = array(array('name' => '<span class="i-left dashicons dashicons-visibility"></span><small>' . __('Hide Area', 'weaver-xtreme') . '</small>', 'id' => $id . '_hide', 'type' => 'select_hide', 'info' => '<em>' . $name . '</em>' . __(': Hide menu on different display devices', 'weaver-xtreme')), array('name' => '<span class="i-left dashicons dashicons-visibility"></span><small>' . __('Hide Arrows', 'weaver-xtreme') . '</small>', 'id' => $id . '_hide_arrows', 'type' => 'checkbox', 'info' => '<em>' . $name . '</em>' . __(': Hide Arrows on Desktop Menu', 'weaver-xtreme')), array('name' => '<span class="i-left dashicons dashicons-align-none"></span><small>' . __('Desktop Menu Vertical Padding', 'weaver-xtreme') . '</small>', 'id' => $id . '_menu_pad_dec', 'type' => 'val_em', 'info' => '<em>' . $name . '</em>' . __(': Add vertical padding to Desktop menu bar and submenus (Default: 0.6em)', 'weaver-xtreme')), array('name' => '<span class="i-left dashicons dashicons-align-none"></span><small>' . __('Menu Top Margin', 'weaver-xtreme') . '</small>', 'id' => $id . '_top_margin_dec', 'type' => 'val_px', 'info' => '<em>' . $name . '</em>' . __(': Top margin for menu bar.', 'weaver-xtreme')), array('name' => '<span class="i-left dashicons dashicons-align-none"></span><small>' . __('Menu Bottom Margin', 'weaver-xtreme') . '</small>', 'id' => $id . '_bottom_margin_dec', 'type' => 'val_px', 'info' => '<em>' . $name . '</em>' . __(': Bottom margin for menu bar.', 'weaver-xtreme')), array('name' => '<span class="i-left" style="font-size:150%;">&harr;</span><small>' . __('Desktop Menu Spacing. (not on Smart Menus)', 'weaver-xtreme') . '</small>', 'id' => $id . '_right_padding_dec', 'type' => 'val_em', 'info' => '<em>' . $name . '</em>' . __(': Add space between desktop menu bar items (Use value &gt; 1.0)', 'weaver-xtreme')), array('name' => '<span class="i-left">{ }</span> <small>' . __('Add Classes', 'weaver-xtreme') . '</small>', 'id' => $id . '_add_class', 'type' => '+widetext', 'info' => '<em>' . $name . '</em>' . __(': Space separated class names to add to this area (<em>Advanced option</em>) (&starf;Plus)', 'weaver-xtreme')), array('name' => '<span class="i-left dashicons dashicons-editor-code"></span><small>' . __('Left HTML', 'weaver-xtreme') . '</small>', 'id' => $id . '_html_left', 'type' => '+textarea', 'placeholder' => __('Any HTML, including shortcodes.', 'weaver-xtreme'), 'info' => __('Add HTML Left (Works best with Centered Menu) (&diams;)(&starf;Plus)', 'weaver-xtreme')), array('name' => '<span class="i-left dashicons dashicons-visibility"></span><small>' . __('Hide Area', 'weaver-xtreme') . '</small>', 'id' => $id . '_hide_left', 'type' => '+select_hide', 'info' => '<em>' . $name . '</em>' . __(': Hide Left HTML', 'weaver-xtreme')), array('name' => '<span class="i-left dashicons dashicons-editor-code"></span><small>' . __('Right HTML', 'weaver-xtreme') . '</small>', 'id' => $id . '_html_right', 'type' => '+textarea', 'placeholder' => __('Any HTML, including shortcodes.', 'weaver-xtreme'), 'info' => __('Add HTML to Menu on Right (Works best with Centered Menu) (&diams;)(&starf;Plus)', 'weaver-xtreme')), array('name' => '<span class="i-left dashicons dashicons-visibility"></span><small>' . __('Hide Area', 'weaver-xtreme') . '</small>', 'id' => $id . '_hide_right', 'type' => '+select_hide', 'info' => '<em>' . $name . '</em>' . __(': Hide Right HTML', 'weaver-xtreme')), array('name' => '<small>' . __('HTML: Text Color', 'weaver-xtreme') . '</small>', 'id' => $id . '_html_color', 'type' => 'ctext', 'info' => '<em>' . $name . '</em>' . __(': Text Color for Left/Right Menu Bar HTML', 'weaver-xtreme')), array('name' => '<span class="i-left dashicons dashicons-align-none"></span><small>' . __('HTML: Top Margin', 'weaver-xtreme') . '</small>', 'id' => $id . '_html_margin_dec', 'type' => 'val_em', 'info' => '<em>' . $name . '</em>' . __(': Margin above Added Menu HTML (Used to adjust for Desktop menu. Negative values can help.)', 'weaver-xtreme')));
    weaverx_form_show_options($opts2, false, false);
    if ($submit) {
        weaverx_form_submit('');
    }
}
function weaverx_form_widget_area($value, $submit = false)
{
    /* build the rows for area settings
    	 * Defined Areas:
    	 *  'container' => '0', 'header' => '0', 'header_html' => '0', 'header_sb' => '0',
    		'infobar' => '5px', 'content' => 'T:4px, B:8px', 'post' => '0', 'footer' => '0',
    		'footer_sb' => '0', 'footer_html' => '0', 'widget' => '0', 'primary' => '0',
    		'secondary' => '0', 'extra' => '0', 'top' => '0', 'bottom' => '0', 'wrapper' => '0'
    	 */
    // defaults - these are determined by the =Padding section of style-weaverx.css
    $default_tb = array('infobar' => '5px', 'content' => 'T:4px, B:8px', 'footer' => '8px', 'footer_sb' => '8px', 'primary' => '8px', 'secondary' => '8px', 'extra' => '8px', 'top' => '8px', 'bottom' => '8px');
    $default_lr = array('infobar' => '5px', 'content' => '2%', 'post' => '0', 'footer' => '8px', 'footer_sb' => '8px', 'primary' => '8px', 'secondary' => '8px', 'extra' => '8px', 'top' => '8px', 'bottom' => '8px');
    $default_margins = array('infobar' => '5px', 'content' => 'T:0, B:0', 'footer' => 'T:0, B:0', 'footer_sb' => 'T:0, B:10', 'primary' => 'T:0, B:10', 'widget' => '0, Auto - First: T:0, Last: B:0', 'secondary' => 'T:0, B:10', 'extra' => 'T:0, B:10', 'top' => 'T:10, B:10', 'bottom' => 'T:10, B:10', 'wrapper' => 'T:0, B:0', 'post' => 'T:0, B:15');
    $id = $value['id'];
    $def_tb = '0';
    $def_lr = '0';
    $def_marg = '0';
    if (isset($default_tb[$id])) {
        $def_tb = $default_tb[$id];
    }
    if (isset($default_lr[$id])) {
        $def_lr = $default_lr[$id];
    }
    if (isset($default_margins[$id])) {
        $def_marg = $default_margins[$id];
    }
    $use_percent = array('content', 'post');
    //echo '<table><tr><td>';
    $name = $value['name'];
    $lr_type = in_array($id, $use_percent) ? 'text_lr_percent' : 'text_lr';
    $opts = array(array('name' => $name, 'id' => '-welcome-widgets-menus', 'type' => 'header_area', 'info' => $value['info']), array('name' => $name, 'id' => $id, 'type' => 'titles_area', 'info' => $name), array('name' => '<span class="i-left dashicons dashicons-align-none"></span>' . __('Padding', 'weaver-xtreme'), 'id' => $id . '_padding', 'type' => 'text_tb', 'info' => '<em>' . $name . '</em>' . __(': Top/Bottom Inner padding [Default: ', 'weaver-xtreme') . $def_tb . ']'), array('name' => '', 'id' => $id . '_padding', 'type' => $lr_type, 'info' => '<em>' . $name . '</em>' . __(': Left/Right Inner padding [Default: ', 'weaver-xtreme') . $def_lr . ']'), array('name' => '<span class="i-left dashicons dashicons-align-none"></span>' . __('Top/Bottom Margins', 'weaver-xtreme'), 'id' => $id . '_margin', 'type' => 'text_tb', 'info' => '<em>' . $name . '</em>' . __(': Top/Bottom margins. <em>Side margins auto-generated.</em> [Default: ', 'weaver-xtreme') . $def_marg . ']'));
    weaverx_form_show_options($opts, false, false);
    $no_lr_margins = array('primary', 'secondary', 'content', 'post', 'widget');
    $no_widgets = array('widget', 'content', 'post', 'wrapper', 'container', 'header', 'header_html', 'footer_html', 'footer', 'infobar');
    $no_hide = array('wrapper', 'container', 'content', 'widget', 'post');
    $default_auto = array('top', 'bottom', 'footer_sb', 'header_sb');
    if (in_array($id, $no_lr_margins)) {
        if ($id != 'widget') {
            weaverx_form_checkbox(array('name' => '<span class="i-left dashicons dashicons-align-none"></span>' . __('Add Side Margin(s)', 'weaver-xtreme'), 'id' => $id . '_smartmargin', 'type' => '', 'info' => '<em>' . $name . '</em>' . __(': Automatically add left/right "smart" margins for separation of areas (sidebar/content).', 'weaver-xtreme')));
        }
        weaverx_form_note(array('name' => '<strong>' . __('Width', 'weaver-xtreme') . '</strong>', 'info' => __('The width of this area is automatically determined by the enclosing area', 'weaver-xtreme')));
    } else {
        if ($id != 'wrapper') {
            if (in_array($id, $default_auto)) {
                weaverx_form_val(array('name' => '<span class="i-left" style="font-size:150%;">&harr;</span> ' . __('Width', 'weaver-xtreme'), 'id' => $id . '_width_int', 'type' => '', 'info' => '<em>' . $name . '</em>' . __(': Width of Area in % of enclosing area on desktop and small tablet. Hint: use with Center align. Use 0 to force auto width. (Default if blank: auto)', 'weaver-xtreme'), 'value' => array()), '%');
            } else {
                weaverx_form_val(array('name' => '<span class="i-left" style="font-size:150%;">&harr;</span> ' . __('Width', 'weaver-xtreme'), 'id' => $id . '_width_int', 'type' => '', 'info' => '<em>' . $name . '</em>' . __(': Width of Area in % of enclosing area on desktop and small tablet. Hint: use with Center align. Use 0 to force auto width. (Default if blank: 100%)', 'weaver-xtreme'), 'value' => array()), '%');
            }
            weaverx_form_align(array('name' => '<span class="i-left dashicons dashicons-editor-alignleft"></span><small>' . __('Align Area', 'weaver-xtreme') . '</small>', 'id' => $id . '_align', 'type' => '', 'info' => '<em>' . $name . '</em>' . __(': How to align this area (Default: Left Align)', 'weaver-xtreme')));
            if ($id == 'header_html' || $id == 'footer_html') {
                weaverx_form_checkbox(array('name' => '<span class="i-left dashicons dashicons-align-none"></span><small>' . __('Center Content', 'weaver-xtreme') . '</small>', 'id' => $id . '_center_content', 'type' => '', 'info' => '<em>' . $name . '</em>' . __(': Center Content within HTML Area content within the area.', 'weaver-xtreme')));
            }
        }
    }
    if ($id == 'wrapper') {
        // setting #wrapper sets theme width.
        $info = __('<em>Change Theme Width.</em> Standard width is 1100px. Use the options on the "Full Width" tab for full width designs, but leave this value set. Widths less than 768px may give unexpected results on mobile devices. Weaver Xtreme can not create a fixed-width site.', 'weaver-xtreme');
        weaverx_form_val(array('name' => '<span class="i-left" style="font-size:150%;">&harr;</span><em style="color:red;">' . __('Theme Width', 'weaver-xtreme') . '</em>', 'id' => 'theme_width_int', 'type' => '', 'info' => $info, 'value' => array()), 'px');
    }
    if (in_array($id, array('container', 'header', 'footer'))) {
        $opts_max = array(array('name' => '<span class="i-left" style="font-size:150%;">&harr;</span><small>' . __('Max Width', 'weaver-xtreme') . '</small>', 'id' => $id . '_max_width_int', 'type' => '+val_px', 'info' => '<em>' . $name . '</em>' . __(': Set Max Width of Area for Desktop View. Advanced Option. (&starf;Plus)', 'weaver-xtreme'), 'value' => array()));
        weaverx_form_show_options($opts_max, false, false);
    }
    if (!in_array($id, $no_widgets)) {
        $opts02 = array(array('name' => '<span class="i-left" style="font-size:120%;">&nbsp;&#9783;</span>' . __('Columns', 'weaver-xtreme'), 'id' => $id . '_cols_int', 'type' => 'val_num', 'info' => '<em>' . $name . '</em>' . __(': Equal width columns of widgets (Default: 1; max: 8)', 'weaver-xtreme')), array('name' => '<span class="i-left dashicons dashicons-align-none"></span><small>' . __('No Smart Widget Margins', 'weaver-xtreme') . '</small>', 'id' => $id . '_no_widget_margins', 'type' => 'checkbox', 'info' => '<em>' . $name . '</em>' . __(': Do not use "smart margins" between widgets on rows.', 'weaver-xtreme')), array('name' => '<span class="i-left" style="font-size:140%;">&nbsp;=</span><small>' . __('Equal Height Widget Rows', 'weaver-xtreme') . '</small>', 'id' => $id . '_eq_widgets', 'type' => '+checkbox', 'info' => '<em>' . $name . '</em>' . __(': Make widgets equal height rows if &gt; 1 column (&starf;Plus)', 'weaver-xtreme')));
        weaverx_form_show_options($opts02, false, false);
        $custom_widths = array('header_sb', 'footer_sb', 'primary', 'secondary', 'top', 'bottom');
        if (in_array($id, $custom_widths)) {
            /* if ( $id == 'header_sb' || $id == 'footer_sb' ) { */
            ?>
	<tr><th scope="row" align="right"><span class="i-left" style="font-size:120%;">&nbsp;&#9783;</span><small><?php 
            _e('Custom Widget Widths:', 'weaver-xtreme');
            ?>
</small></th><td colspan="2" style="padding-left:20px;">
		<small><?php 
            _e('You can optionally specify widget widths, including for specific devices. Please read the help entry!', 'weaver-xtreme');
            ?>
		<?php 
            weaverx_help_link('help.html#CustomWidgetWidth', __('Help on Custom Widget Widths', 'weaver-xtreme'));
            ?>
		<?php 
            _e('(&starf;Plus) (&diams;)', 'weaver-xtreme');
            ?>
</small></td>
	</tr>
		 <?php 
            $opts2 = array(array('name' => '<span class="i-left dashicons dashicons-desktop"></span><small>' . __('Desktop', 'weaver-xtreme') . '</small>', 'id' => '_' . $id . '_lw_cols_list', 'type' => '+textarea', 'placeholder' => __('25,25,50; 60,40; - for example', 'weaver-xtreme'), 'info' => __('List of widths separated by comma. Use semi-colon (;) for end of each row.  (&starf;Plus) (&diams;)', 'weaver-xtreme')), array('name' => '<span class="i-left dashicons dashicons-tablet"></span><small>' . __('Small Tablet', 'weaver-xtreme') . '</small>', 'id' => '_' . $id . '_mw_cols_list', 'type' => '+textarea', 'info' => __('List of widget widths. (&starf;Plus) (&diams;)', 'weaver-xtreme')), array('name' => '<span class="i-left dashicons dashicons-smartphone"></span><small>' . __('Phone', 'weaver-xtreme') . '</small>', 'id' => '_' . $id . '_sw_cols_list', 'type' => '+textarea', 'info' => __('List of widget widths. (&starf;Plus) (&diams;)', 'weaver-xtreme')));
            weaverx_form_show_options($opts2, false, false);
        }
    }
    $opts3 = array(array('name' => '<span class="i-left" style="font-size:200%;margin-left:4px;">&#x25a1;</span><small>' . __('Add Border', 'weaver-xtreme') . '</small>', 'id' => $id . '_border', 'type' => 'checkbox', 'info' => '<em>' . $name . '</em>' . __(': Add the "standard" border (as set on Custom tab)', 'weaver-xtreme')), array('name' => '<span class="i-left dashicons dashicons-admin-page"></span><small>' . __('Shadow', 'weaver-xtreme') . '</small>', 'id' => $id . '_shadow', 'type' => 'shadows', 'info' => '<em>' . $name . '</em>' . __(': Wrap Area with Shadow.', 'weaver-xtreme')), array('name' => '<span class="i-left dashicons dashicons-marker"></span><small>' . __('Rounded Corners', 'weaver-xtreme') . '</small>', 'id' => $id . '_rounded', 'type' => 'rounded', 'info' => '<em>' . $name . '</em>' . __(': Rounded corners. Needs bg color or borders to show. <em>You might need to set overlapping corners for parent/child areas also!</em>', 'weaver-xtreme')));
    weaverx_form_show_options($opts3, false, false);
    if (!in_array($id, $no_hide)) {
        weaverx_form_select_hide(array('name' => '<span class="i-left dashicons dashicons-visibility"></span><small>' . __('Hide Area', 'weaver-xtreme') . '</small>', 'id' => $id . '_hide', 'info' => '<em>' . $name . '</em>' . __(': Hide area on different display devices', 'weaver-xtreme'), 'value' => ''));
    }
    // class names
    $opts4 = array(array('name' => '<span class="i-left">{ }</span> <small>' . __('Add Classes', 'weaver-xtreme') . '</small>', 'id' => $id . '_add_class', 'type' => '+widetext', 'info' => '<em>' . $name . '</em>' . __(': Space separated class names to add to this area (<em>Advanced option</em>) (&starf;Plus)', 'weaver-xtreme')));
    weaverx_form_show_options($opts4, false, false);
    if ($submit) {
        weaverx_form_submit('');
    }
    //echo '</td></tr></table>';
}
function weaverx_form_show_options($weaverx_olist, $begin_table = true, $end_table = true)
{
    /* output a list of options - this really does the layout for the options defined in an array */
    if ($begin_table) {
        ?>
<div>
<table class="optiontable" style="margin-top:6px;">
<?php 
    }
    foreach ($weaverx_olist as $value) {
        $value['type'] = weaverx_fix_type($value['type']);
        switch ($value['type']) {
            case 'align':
                weaverx_form_align($value);
                break;
            case 'break':
                weaverx_form_break($value);
                break;
            case 'checkbox':
                weaverx_form_checkbox($value);
                break;
            case 'ctext':
                weaverx_form_ctext($value);
                break;
            case 'color':
                weaverx_form_color($value);
                break;
            case 'custom_css':
                weaverx_custom_css($value);
                break;
            case 'endheader':
                echo '<!-- end header -->';
                break;
            case 'fi_align':
                weaverx_form_fi_align($value);
                break;
            case 'fi_location':
                weaverx_from_fi_location($value);
                break;
            case 'fi_location_post':
                weaverx_from_fi_location($value, true);
                break;
            case 'fixedtop':
                weaverx_form_fixedtop($value);
                break;
            case 'header':
                weaverx_form_header($value);
                break;
            case 'header_area':
                weaverx_form_header_area($value);
                break;
            case 'header0':
                weaverx_form_header($value, true);
                break;
            case 'inactive':
                weaverx_form_inactive($value);
                break;
            case 'link':
                weaverx_form_link($value);
                break;
            case 'menu_opts':
                weaverx_form_menu_opts($value, false);
                break;
            case 'menu_opts_submit':
                weaverx_form_menu_opts($value, true);
                break;
            case 'note':
                weaverx_form_note($value);
                break;
            case 'radio':
                weaverx_form_radio($value);
                break;
            case 'rounded':
                weaverx_form_rounded($value);
                break;
            case 'select_hide':
                weaverx_form_select_hide($value);
                break;
            case 'select_id':
                weaverx_form_select_id($value);
                break;
            case 'select_layout':
                weaverx_form_select_layout($value);
                break;
            case 'shadows':
                weaverx_form_shadows($value);
                break;
            case 'subheader':
                weaverx_form_subheader($value);
                break;
            case 'subheader_alt':
                weaverx_form_subheader_alt($value);
                break;
            case 'submit':
                weaverx_form_submit($value);
                break;
            case 'text':
            case 'widetext':
                weaverx_form_text($value);
                break;
            case 'text_xy':
                weaverx_form_text_xy($value);
                break;
            case 'text_xy_em':
                weaverx_form_text_xy($value, 'X', 'Y', 'em');
                break;
            case 'text_xy_percent':
                weaverx_form_text_xy($value, 'X', 'Y', '%');
                break;
            case 'text_tb':
                weaverx_form_text_xy($value, 'T', 'B');
                break;
            case 'text_lr':
                weaverx_form_text_xy($value, 'L', 'R');
                break;
            case 'text_lr_em':
                weaverx_form_text_xy($value, 'L', 'R', 'em');
                break;
            case 'text_lr_percent':
                weaverx_form_text_xy($value, 'L', 'R', '%');
                break;
            case 'textarea':
                weaverx_form_textarea($value);
                break;
            case 'titles':
                weaverx_form_text_props($value, 'titles');
                break;
            case 'titles_area':
                weaverx_form_text_props($value, 'area');
                break;
            case 'titles_content':
                weaverx_form_text_props($value, 'content');
                break;
            case 'titles_menu':
                weaverx_form_text_props($value, 'menu');
                break;
            case 'titles_text':
                weaverx_form_text_props($value, 'text');
                break;
            case 'val_num':
                weaverx_form_val($value, '');
                break;
            case 'val_percent':
                weaverx_form_val($value, '%');
                break;
            case 'val_px':
                weaverx_form_val($value, 'px');
                break;
            case 'val_em':
                weaverx_form_val($value, 'em');
                break;
            case 'widget_area':
                weaverx_form_widget_area($value, false);
                break;
            case 'widget_area_submit':
                weaverx_form_widget_area($value, true);
                break;
            default:
                weaverx_form_subheader_alt($value);
                break;
        }
    }
    if ($end_table) {
        ?>
</table></div> <!-- close previous tab div -->
	<br />
<?php 
    }
}