<?php

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

?>
<style type="text/css">
    .nav-tabcontent-active {
        display: block;
    }

    .nav-tabcontent-inactive {
        display: none;
    }
</style>
<script type="text/javascript">
    jQuery(document).ready(function () {
        var sHash = window.location.hash.substr(1);
		<?php
		if ( isset( $_GET['jumpTo'] ) && ! empty( $_GET['jumpTo'] ) ) {
			echo '	sHash = "' . urlencode( $_GET['jumpTo'] ) . '";' . "\n";
		}
		?>
        if (sHash != '') {
            amazilonToTab(sHash);
        }
    });

    amazilonToTab = function (activate) {
        jQuery('.amazilon-tabs .nav-tab-active').removeClass('nav-tab-active');
        jQuery('.amazilon-tabs #amazilon-tab-' + activate).addClass('nav-tab-active').blur();

        jQuery('.amazilon-tabcontent.nav-tabcontent-active').removeClass('nav-tabcontent-active').addClass('nav-tabcontent-inactive');
        jQuery('.amazilon-tabcontent#amazilon-tabcontent-' + activate).addClass('nav-tabcontent-active').removeClass('nav-tabcontent-inactive');

        window.location.hash = '#' + activate;
        return false;
    }
</script>
<div class="block">
    <h2 class="nav-tab-wrapper">
        <p class="amazilon-tabs">
            <a class="nav-tab nav-tab-active" id="amazilon-tab-help" href="#help-1"
               onclick="return amazilonToTab('help-1');"><?php _e( 'Help for use', 'amazilon' ); ?></a>
            <a class="nav-tab nav-tab-small" href="https://amazilon.com/demo/" target="_blank" onclick="this.blur();"
               style="margin-left: 5em;"><?php _e( 'Examples of use', 'amazilon' ); ?> <span
                        class="dashicons dashicons-external"></span></a>
            <a class="nav-tab" href="https://amazilon.com/faq/" target="_blank" onclick="this.blur();"><?php _e( 'FAQ',
					'amazilon' ); ?> <span class="dashicons dashicons-external"></span></a>
            <a class="nav-tab" href="https://amazilon.com/support/" target="_blank"
               onclick="this.blur();"><?php _e( 'Support', 'amazilon' ); ?> <span
                        class="dashicons dashicons-external"></span></a>
        </p>
    </h2>
    <div class="amazilon-tabcontent nav-tabcontent-active"
         id="amazilon-tabcontent-help-1"><?php require dirname( __FILE__ ) . '/../help.php'; ?></div>
</div>
