<?php
/*
Template Name: Amazon Page
*/
if ( ! defined( 'ABSPATH' ) ) {
    exit; // Exit if accessed directly.
}
?>
<?php get_header(); ?>
<div id="wrap" class="clearfix template-fullwidth">
	<section id="content-full" class="clearfix" role="main">
	  <div <?php post_class(); ?>>
		<div class="entry clearfix">
			<?php $options = get_option( 'pmthemes_ads' ); 
			if ( isset( $options['amazon_astore_enable'] ) and $options['amazon_astore_enable'] == 'custom' ) :	?>
			<?php $options = get_option( 'pmthemes_ads' ); echo $options['amazon_custom_adcode']; ?>	
			<?php else: ?> 
			<script type="text/javascript">
            amzn_assoc_placement = "adunit0";
            amzn_assoc_search_bar = "true";
            amzn_assoc_tracking_id = "<?php $options = get_option( 'pmthemes_ads' ); echo $options['amazon_id']; ?>";
            amzn_assoc_search_bar_position = "bottom";
            amzn_assoc_ad_mode = "search";
            amzn_assoc_ad_type = "smart";
            amzn_assoc_marketplace = "amazon";
            amzn_assoc_region = "<?php $options = get_option( 'pmthemes_ads' ); echo $options['amazon_country_loc']; ?>";
            amzn_assoc_title = "<?php $options = get_option( 'pmthemes_ads' ); echo $options['amazon_store_title']; ?>";
            amzn_assoc_default_search_phrase = "<?php $options = get_option( 'pmthemes_ads' ); echo $options['amazon_keyword']; ?>";
            amzn_assoc_default_category = "<?php $options = get_option( 'pmthemes_ads' ); echo $options['amazon_category']; ?>";
            amzn_assoc_linkid = "";
            </script>
            <script src="//z-na.amazon-adsystem.com/widgets/onejs?MarketPlace=US"></script>
			<?php endif; ?>
		</div>
	  </div>
	</section>
</div>
<?php get_footer(); ?>	