function weaverx_admin_mainopts()
{
    if (!function_exists('weaverx_get_wp_custom_logo_url')) {
        weaverx_alert(__('    ****  WARNING!  ****\\r\\n\\r\\nYou are using a new Version 3 of the Weaver Xtreme Theme Support Plugin with an older version of the Weaver Xtreme Theme. Please update to the latest Version 3 of the Weaver Xtreme Theme.\\r\\n\\r\\nTHIS VERSION DOES NOT WORK WITH OLD VERSIONS OF WEAVER XTREME!'));
    }
    ?>
<div id="tabwrap_main" style="padding-left:4px;">

<div id="tab-container-main" class='yetiisub'>
	<ul id="tab-container-main-nav" class='yetiisub'>
	<?php 
    weaverx_elink('#asp_genappear', __('Wrapping background colors, rounded corners, borders, fade, shadow', 'weaver-xtreme'), __('Wrapping Areas', 'weaver-xtreme'), '<li>', '</li>');
    weaverx_elink('#asp_widgets', __('Settings for Sidebars and Sidebar Layout', 'weaver-xtreme'), __('Sidebars &amp; Layout', 'weaver-xtreme'), '<li>', '</li>');
    weaverx_elink('#asp_full', __('Settings to create full width sites', 'weaver-xtreme'), __('Full Width', 'weaver-xtreme'), '<li>', '</li>');
    weaverx_elink('#asp_headeropts', __('Site Title/Tagline properties, Header Image', 'weaver-xtreme'), __('Header', 'weaver-xtreme'), '<li>', '</li>');
    weaverx_elink('#asp_menus', __('Menu text and bg colors and other properties; Info Bar properties', 'weaver-xtreme'), __('Menus', 'weaver-xtreme'), '<li>', '</li>');
    weaverx_elink('#asp_content', __('Text colors and bg, image borders, featured image, other properties related to all content', 'weaver-xtreme'), __('Content Areas', 'weaver-xtreme'), '<li>', '</li>');
    weaverx_elink('#asp_postspecific', __('Properties related to posts: titles, meta info, navigation, excerpts, featured images, and more', 'weaver-xtreme'), __('Post Specifics', 'weaver-xtreme'), '<li>', '</li>');
    weaverx_elink('#asp_footer', __('Footer options: bg color, borders, more. Site Copyright', 'weaver-xtreme'), __('Footer', 'weaver-xtreme'), '<li>', '</li>');
    weaverx_elink('#asp_custom', __('Font settings &amp; Custom Settings', 'weaver-xtreme'), __('Fonts &amp; Custom', 'weaver-xtreme'), '<li>', '</li>');
    ?>
	</ul>

	<?php 
    weaverx_tab_title(__('Main Options', 'weaver-xtreme'), 'help.html#MainOptions', __('Help for Main Options', 'weaver-xtreme'));
    ?>

	<div id="asp_genappear" class="tab_mainopt" >
		<?php 
    weaverx_mainopts_general();
    ?>
	</div>

	<div id="asp_widgets" class="tab_mainopt" >
		<?php 
    weaverx_mainopts_layout();
    weaverx_mainopts_widgets();
    ?>
	</div>

	<div id="asp_full" class="tab_mainopt" >
		<?php 
    weaverx_mainopts_fullwidth();
    ?>
	</div>

	<div id="asp_headeropts" class="tab_mainopt" >
	<?php 
    weaverx_mainopts_header();
    ?>
	</div>

	<div id="asp_menus" class="tab_mainopt" >
	<?php 
    weaverx_mainopts_menus();
    ?>
	</div>

	<div id="asp_content" class="tab_mainopt" >
	<?php 
    weaverx_mainopts_content();
    ?>
	</div>

	<div id="asp_postspecific" class="tab_mainopt" >
	<?php 
    weaverx_mainopts_posts();
    ?>
	</div>

	<div id="asp_footer" class="tab_mainopt" >
		<?php 
    weaverx_mainopts_footer();
    ?>
	</div>


	<div id="asp_links" class="tab_mainopt" >
	<?php 
    weaverx_mainopts_custom();
    ?>
	</div>

</div> <!-- #tab-container-main -->
<?php 
    weaverx_sapi_submit();
    ?>
</div>	<!-- #tabwrap_main -->
   <script type="text/javascript">
	var tabberMainOpts = new Yetii({
	id: 'tab-container-main',
	tabclass: 'tab_mainopt',
	persist: true
	});
</script>
<?php 
}
function weaverx_admin_mainopts()
{
    ?>
<div id="tabwrap_main" style="padding-left:4px;">

<div id="tab-container-main" class='yetiisub'>
	<ul id="tab-container-main-nav" class='yetiisub'>
	<?php 
    weaverx_elink('#asp_genappear', __('Wrapping background colors, rounded corners, borders, fade, shadow', 'weaver-xtreme'), __('Wrapping Areas', 'weaver-xtreme'), '<li>', '</li>');
    weaverx_elink('#asp_widgets', __('Settings for Sidebars and Sidebar Layout', 'weaver-xtreme'), __('Sidebars &amp; Layout', 'weaver-xtreme'), '<li>', '</li>');
    weaverx_elink('#asp_headeropts', __('Site Title/Tagline properties, Header Image', 'weaver-xtreme'), __('Header', 'weaver-xtreme'), '<li>', '</li>');
    weaverx_elink('#asp_menus', __('Menu text and bg colors and other properties; Info Bar properties', 'weaver-xtreme'), __('Menus', 'weaver-xtreme'), '<li>', '</li>');
    weaverx_elink('#asp_content', __('Text colors and bg, image borders, featured image, other properties related to all content', 'weaver-xtreme'), __('Content Areas', 'weaver-xtreme'), '<li>', '</li>');
    weaverx_elink('#asp_postspecific', __('Properties related to posts: titles, meta info, navigation, excerpts, featured images, and more', 'weaver-xtreme'), __('Post Specifics', 'weaver-xtreme'), '<li>', '</li>');
    weaverx_elink('#asp_footer', __('Footer options: bg color, borders, more. Site Copyright', 'weaver-xtreme'), __('Footer', 'weaver-xtreme'), '<li>', '</li>');
    weaverx_elink('#asp_custom', __('Font settings &amp; Custom Settings', 'weaver-xtreme'), __('Fonts &amp; Custom', 'weaver-xtreme'), '<li>', '</li>');
    ?>
	</ul>

	<?php 
    weaverx_tab_title(__('Main Options', 'weaver-xtreme'), 'help.html#MainOptions', __('Help for Main Options', 'weaver-xtreme'));
    ?>

	<div id="asp_genappear" class="tab_mainopt" >
		<?php 
    weaverx_mainopts_general();
    ?>
	</div>

	<div id="asp_widgets" class="tab_mainopt" >
		<?php 
    weaverx_mainopts_layout();
    weaverx_mainopts_widgets();
    ?>
	</div>

	<div id="asp_headeropts" class="tab_mainopt" >
	<?php 
    weaverx_mainopts_header();
    ?>
	</div>

	<div id="asp_menus" class="tab_mainopt" >
	<?php 
    weaverx_mainopts_menus();
    ?>
	</div>

	<div id="asp_content" class="tab_mainopt" >
	<?php 
    weaverx_mainopts_content();
    ?>
	</div>

	<div id="asp_postspecific" class="tab_mainopt" >
	<?php 
    weaverx_mainopts_posts();
    ?>
	</div>

	<div id="asp_footer" class="tab_mainopt" >
		<?php 
    weaverx_mainopts_footer();
    ?>
	</div>


	<div id="asp_links" class="tab_mainopt" >
	<?php 
    weaverx_mainopts_custom();
    ?>
	</div>

</div> <!-- #tab-container-main -->
<?php 
    weaverx_sapi_submit();
    ?>
</div>	<!-- #tabwrap_main -->
   <script type="text/javascript">
	var tabberMainOpts = new Yetii({
	id: 'tab-container-main',
	tabclass: 'tab_mainopt',
	persist: true
	});
</script>
<?php 
}
function weaverx_do_admin()
{
    /* theme admin page */
    /* This generates the startup script calls, etc, for the admin page */
    global $weaverx_opts_cache, $weaverx_main_options, $weaverx_main_opts_list;
    if (!current_user_can('edit_theme_options')) {
        wp_die(__('No permission to access that page.', 'weaver-xtreme'));
    }
    weaverx_admin_page_process_options();
    // Process non-sapi options
    echo '<div class="wrap">';
    ?>
<div style="float:left;"><h2><?php 
    echo WEAVERX_THEMEVERSION;
    ?>
 Options
<?php 
    if (function_exists('weaverxplus_plugin_installed')) {
        echo '<span style="font-size:smaller;"> - ' . __('Plus', 'weaver-xtreme') . '</span><span style="font-size:small;"> (';
        echo WEAVER_XPLUS_VERSION;
        echo ')</span>';
    }
    ?>

<?php 
    if (is_child_theme()) {
        echo " &mdash; " . wp_get_theme();
    }
    ?>


</h2>
	<a name="top_main" id="top_main"></a></div>
<?php 
    weaverx_donate_button();
    //weaverx_check_theme();
    weaverx_clear_messages();
    weaverx_check_version();
    // check version RSS
    weaverx_clear_both();
    $site_url = get_admin_url();
    $site_url = str_replace('http://', '//', $site_url);
    $site_url = str_replace('https://', '//', $site_url);
    //$site_url = '';
    $ret_url = str_replace('/', '%2F', $site_url);
    $customizer_link = $site_url . '/customize.php?return=' . $ret_url . 'themes.php%3Fpage%3DWeaverX';
    if (!weaverx_getopt('_disable_customizer')) {
        ?>
<a href="<?php 
        echo $customizer_link;
        ?>
" title="Switch to Customizer" style="text-decoration:none;font-weight:bold; border:1px solid blue;padding-left:5px; padding-right:5px; background-color:yellow;">Switch to Customizer</a>
<?php 
    }
    ?>

<div id="tabwrap">
  <div id="taba-admin" class='yetii'>
	<ul id="taba-admin-nav" class='yetii'>
	<?php 
    weaverx_elink('#tab_help', __('Table of Content links to Weaver Xtreme Help files', 'weaver-xtreme'), __('Theme Help', 'weaver-xtreme'), $before = '<li>', $after = '</li>');
    weaverx_elink('#tab_themes', __('Select from pre-defined subthemes', 'weaver-xtreme'), __('Weaver Xtreme Subthemes', 'weaver-xtreme'), $before = '<li>', $after = '</li>');
    weaverx_elink('#tab_main', __('Main options for most theme elements: site appearance, layout, header, menus, content, footer, fonts, more', 'weaver-xtreme'), __('Main Options', 'weaver-xtreme'), $before = '<li>', $after = '</li>');
    if (has_action('weaverx_admin_advancedopts')) {
        weaverx_elink('#tab_advanced', __('Advanced options: HTML, code, CSS insertion; page templates, background images, SEO, site options', 'weaver-xtreme'), __('Advanced Options', 'weaver-xtreme'), $before = '<li>', $after = '</li>');
    }
    weaverx_elink('#tab_pro', __('Weaver Xtreme Theme Add-ons', 'weaver-xtreme'), __('Add-ons', 'weaver-xtreme'), $before = '<li>', $after = '</li>');
    weaverx_elink('#tab_saverestore', __('Save and Restore theme settings', 'weaver-xtreme'), __('Save/Restore', 'weaver-xtreme'), $before = '<li>', $after = '</li>');
    ?>
	</ul>

<?php 
    //  list is order specific - above and below must match
    ?>

	<div id="tab_help" class="tab" >
	<?php 
    weaverx_admin_help();
    ?>
	</div>


	<div id="tab_themes" class="tab" >
	<?php 
    do_weaverx_admin_subthemes();
    ?>
	</div>

<?php 
    // ====================== Begin the big form here =====================
    weaverx_sapi_form_top('weaverx_settings_group', 'weaverx_options_form');
    ?>
	<div id="tab_main" class="tab" >
<?php 
    do_weaverx_admin_mainopts();
    ?>
	</div>

	<?php 
    if (has_action('weaverx_admin_advancedopts')) {
        ?>

	<div id="tab_advanced" class="tab" >
<?php 
        do_weaverx_admin_advancedopts();
        ?>
	</div>
<?php 
    }
    weaverx_sapi_form_bottom();
    // end of SAPI opts here. Can't cross <div>s! Non-sapi forms follow
    // ===================== end of big form  =====================
    ?>

	  <div id="tab_pro" class="tab" >
<?php 
    weaverx_admin_pro();
    ?>
	  </div>

	<div id="tab_saverestore" class="tab" >
	<?php 
    do_weaverx_admin_saverestore();
    ?>
	</div>

   </div> <!-- #tab-saverestore -->
</div> <!-- #tabwrap -->

<?php 
    weaverx_end_of_section('Options');
    ?>

<script type="text/javascript">
	var tabberAdmin = new Yetii({
	id: 'taba-admin',
	tabclass: 'tab',
	persist: true
	});
</script>

<?php 
}
function weaverx_admin_advancedopts()
{
    ?>
<div id="tabwrap_adv" style="padding-left:5px;">
	<div id="tab-container-adv" class='yetiisub'>
	<ul id="tab-container-adv-nav" class='yetiisub'>
<?php 
    if (weaverx_allow_multisite()) {
        weaverx_elink('#asptab0', __('Insert custom HTML, scripts, and CSS into &lt;HEAD&gt; section', 'weaver-xtreme'), __('&lt;HEAD&gt; Section', 'weaver-xtreme'), '<li>', '</li>');
        weaverx_elink('#asptab1', __('Insert custom HTML into several different page areas', 'weaver-xtreme'), __('HTML Insertion', 'weaver-xtreme'), '<li>', '</li>');
    }
    weaverx_elink('#asptab3', __('Options related to this site: FavIcon, Home Page, more', 'weaver-xtreme'), __('Site Options', 'weaver-xtreme'), '<li>', '</li>');
    weaverx_elink('#asp_tab_admin', __('Basic Administrative Options', 'weaver-xtreme'), __('Admin Options', 'weaver-xtreme'), '<li>', '</li>');
    ?>
		</ul>
	<?php 
    weaverx_tab_title(__('Advanced Options', 'weaver-xtreme'), 'help.html#AdvancedOptions', __('Help for Advanced Options', 'weaver-xtreme'));
    ?>

<?php 
    weaverx_sapi_submit('', '<br /><br />');
    ?>

<!-- ***************************************************** -->
<?php 
    if (weaverx_allow_multisite()) {
        ?>
<div id="asptab0" class="tab_adv" >
	<?php 
        weaverx_adv_head_section();
        ?>
</div> <!-- adtab 0 -->

<!-- ***************************************************** -->

<div id="asptab1" class="tab_adv" >
	<?php 
        weaverx_adv_html_insert();
        ?>
</div> <!-- asptab1 -->
<?php 
    }
    // end of major section of not allowed on multisite
    ?>


<!-- ***************************************************** -->
<div id="asptab3" class="tab_adv" >
	<?php 
    weaverx_adv_site_opts();
    ?>
</div> <!-- site options -->


<!-- ***************************************************** -->

<div id="asp_tab_admin" class="tab_adv" >
<?php 
    weaverx_admin_admin_ts();
    ?>
</div>

</div> <!-- tab-container-adv -->

<?php 
    weaverx_sapi_submit();
    ?>
</div> <!-- #tabwrap_adv-->

<script type="text/javascript">
	var tabberAdv = new Yetii({
	id: 'tab-container-adv',
	tabclass: 'tab_adv',
	persist: true
	});
</script>
<?php 
}