<?php
/**
 * The Header for the template.
 *
 * @package WordPress
 */

if ( ! isset( $content_width ) ) $content_width = 960;

if(session_id() == '') {
	session_start();
}
 
?><!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<?php
$pp_advance_responsive = get_option('pp_advance_responsive');

if(!empty($pp_advance_responsive))
{
?>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
<?php
}
?>

<?php
$pp_seo_enable = get_option('pp_seo_enable');

if(!empty($pp_seo_enable))
{
	if(is_home())
	{
		$pp_seo_home_title = get_option('pp_seo_home_title');
	}
	else if(is_single())
	{
		$page = get_page($post->ID);
		$current_page_id = $page->ID;
		
		$pp_seo_home_title = get_post_meta($current_page_id, 'post_seo_title', true);
	}
}
else
{
	$pp_seo_home_title = '';
}

if(empty($pp_seo_home_title))
{
?>
<title><?php wp_title('&lsaquo;', true, 'right'); ?><?php bloginfo('name'); ?></title>
<?php
} else {
?>
<title><?php echo $pp_seo_home_title; ?></title>
<?php
}
?>

<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />


<?php
if(!empty($pp_seo_enable))
{
	if(is_single())
	{
		$page = get_page($post->ID);
		$current_page_id = $page->ID;
		
		$pp_seo_meta_desc = get_post_meta($current_page_id, 'post_seo_desc', true);
	}
	else
	{
		$pp_seo_meta_desc = get_option('pp_seo_meta_desc');
	}
}
else
{
	$pp_seo_meta_desc = '';
}

if(!empty($pp_seo_meta_desc))
{
?>
<meta name="description" content="<?php echo stripslashes($pp_seo_meta_desc); ?>" />
<?php
}
?>
<?php
if(!empty($pp_seo_enable))
{
	if(is_single())
	{
		$page = get_page($post->ID);
		$current_page_id = $page->ID;
		
		$pp_seo_meta_key = get_post_meta($current_page_id, 'post_seo_keyword', true);
	}
	else
	{
		$pp_seo_meta_key = get_option('pp_seo_meta_key');
	}
}
else
{
	$pp_seo_meta_key = '';
}

if(!empty($pp_seo_meta_key))
{
?>
<meta name="keywords" content="<?php echo stripslashes($pp_seo_meta_key); ?>" />
<?php
}
?>

<?php
	/**
	*	Get favicon URL
	**/
	$pp_favicon = get_option('pp_favicon');
	
	if(!empty($pp_favicon))
	{
?>
		<link rel="shortcut icon" href="<?php echo $pp_favicon; ?>" />
<?php
	}
?>

<?php
	//Get Google Webfont
	$pp_font = get_option('pp_font_family');
	$pp_font = urlencode($pp_font);

	if(!empty($pp_font) && $pp_font != 'Open+Sans')
	{
		wp_enqueue_style('google_fonts', "http://fonts.googleapis.com/css?family=".$pp_font."&subset=latin,cyrillic-ext,greek-ext,cyrillic", false, "", "all");
	}
	//End Get Google Webfont

    $pp_advance_combine_css = get_option('pp_advance_combine_css');
	
	//If compress CSS files
	if(!empty($pp_advance_combine_css))
	{	
		if(!file_exists(get_stylesheet_directory_uri()."/cache/combined.css"))
		{
			$cssmin = new CSSMin();
    		
			$css_arr = array(
			    get_template_directory().'/css/jqueryui/custom.css',
			    get_template_directory().'/js/flexslider/flexslider.css',
			    get_template_directory().'/css/screen.css',
			    get_template_directory().'/js/fancybox/jquery.fancybox.css',
			    get_template_directory().'/js/fancybox/jquery.fancybox-thumbs.css',
			    get_template_directory().'/js/mediaelement/mediaelementplayer.css',
			    get_template_directory().'/css/tipsy.css',
			);
			
   			$cssmin->addFiles($css_arr);
 			
    		// Set original CSS from all files
    		$cssmin->setOriginalCSS();
    		$cssmin->compressCSS();
 			
    		$css = $cssmin->printCompressedCSS();
    		
    		file_put_contents(get_template_directory()."/cache/combined.css", $css);
    	}
    	
		wp_enqueue_style("combined_css", get_stylesheet_directory_uri()."/cache/combined.css", false, THEMEVERSION);
	}
	else
	{
		wp_enqueue_style("jqueryui", get_stylesheet_directory_uri()."/css/jqueryui/custom.css", false, THEMEVERSION, "all");
		wp_enqueue_style("flexslider", get_stylesheet_directory_uri()."/js/flexslider/flexslider.css", false, THEMEVERSION, "all");
		wp_enqueue_style("slider-style", get_stylesheet_directory_uri()."/css/slider-style.css", false, THEMEVERSION, "all");
		wp_enqueue_style("screen", get_stylesheet_directory_uri()."/css/screen.css", false, THEMEVERSION, "all");
		wp_enqueue_style("fancybox", get_stylesheet_directory_uri()."/js/fancybox/jquery.fancybox.css", false, THEMEVERSION, "all");
		wp_enqueue_style("fancybox_thumb", get_stylesheet_directory_uri()."/js/fancybox/jquery.fancybox-thumbs.css", false, THEMEVERSION, "all");
		wp_enqueue_style("mediaelementplayer", get_stylesheet_directory_uri()."/js/mediaelement/mediaelementplayer.css", false, THEMEVERSION, "all");
		wp_enqueue_style("tipsy", get_stylesheet_directory_uri()."/css/tipsy.css", false, THEMEVERSION, "all");
	}
	
	//Check slider type
	$pp_slider_type = get_option('pp_slider_type');
	if($pp_slider_type=='cute')
	{
		wp_enqueue_style("cute_slider-style", get_stylesheet_directory_uri()."/css/slider-style.css", false, THEMEVERSION, "all");
		wp_enqueue_style("cute_caption", get_stylesheet_directory_uri()."/templates/custom-caption-css.php", false, THEMEVERSION, "all");
	}
	
	//Get Theme Layout
	if(isset($_SESSION['pp_theme_layout']))
	{
		$pp_theme_layout = $_SESSION['pp_theme_layout'];
	}
	else
	{
		$pp_theme_layout = get_option('pp_theme_layout');
	}
	
	//If enable boxed layout
	if($pp_theme_layout == 'boxed')
	{
		if(!empty($pp_advance_combine_css))
		{
			if(!file_exists(get_stylesheet_directory_uri()."/cache/combined_boxed.css"))
			{
				$cssmin = new CSSMin();
	    		
				$css_arr = array(
				    get_template_directory().'/css/boxed.css',
				);
				
	   			$cssmin->addFiles($css_arr);
	 			
	    		// Set original CSS from all files
	    		$cssmin->setOriginalCSS();
	    		$cssmin->compressCSS();
	 			
	    		$css = $cssmin->printCompressedCSS();
	    		
	    		file_put_contents(get_template_directory()."/cache/combined_boxed.css", $css);
	    	}
	    	
			wp_enqueue_style("combined_boxed_css", get_stylesheet_directory_uri()."/cache/combined_boxed.css", false, THEMEVERSION);
		}
		else
		{
			wp_enqueue_style('boxed', get_stylesheet_directory_uri()."/css/boxed.css", false, "", "all");
		}
	}
	else
	{
		$pp_advance_enable_switcher = get_option('pp_advance_enable_switcher');
		
		if(!empty($pp_advance_enable_switcher))
		{
			wp_enqueue_style('boxed', get_stylesheet_directory_uri()."/css/empty.css", false, "", "all");
		}
	}
	//End Get Theme Layout
	
	//Add custom colors and fonts
	if(isset($_SESSION['pp_skin']) && !empty($_SESSION['pp_skin']))
	{
		wp_enqueue_style("custom_skins", get_stylesheet_directory_uri()."/templates/custom-skins.php", false, THEMEVERSION, "all");
	}
	else
	{
		$pp_advance_enable_custom = get_option('pp_advance_enable_custom');
	
		if(!empty($pp_advance_enable_custom))
		{
			wp_enqueue_style("custom_css", get_stylesheet_directory_uri()."/templates/custom-css.php", false, THEMEVERSION, "all");
		}
	}
	
	//If enable responsive layout
	if(!empty($pp_advance_responsive))
	{
		if(!empty($pp_advance_combine_css))
		{
			if(!file_exists(get_stylesheet_directory_uri()."/cache/combined_grid.css"))
			{
				$cssmin = new CSSMin();
	    		
				$css_arr = array(
				    get_template_directory().'/css/grid.css',
				);
				
	   			$cssmin->addFiles($css_arr);
	 			
	    		// Set original CSS from all files
	    		$cssmin->setOriginalCSS();
	    		$cssmin->compressCSS();
	 			
	    		$css = $cssmin->printCompressedCSS();
	    		
	    		file_put_contents(get_template_directory()."/cache/combined_grid.css", $css);
	    	}
	    	
			wp_enqueue_style("combined_grid_css", get_stylesheet_directory_uri()."/cache/combined_grid.css", false, THEMEVERSION);
		}
		else
		{
			wp_enqueue_style('grid', get_stylesheet_directory_uri()."/css/grid.css", false, "", "all");
		}
	}
	
	//if IE
	if(ae_detect_ie())
	{
		wp_enqueue_style('ie', get_stylesheet_directory_uri()."/css/ie.css", false, THEMEVERSION, "all");
	}
	
	//if IE8
	if(preg_match('/(?i)msie [1-8]/',$_SERVER['HTTP_USER_AGENT']))
	{
		wp_enqueue_style('ie8', get_stylesheet_directory_uri()."/css/ie8.css", false, THEMEVERSION, "all");
    }
?>

<?php
	wp_enqueue_script("jquery");
	wp_enqueue_script("google_maps", "http://maps.google.com/maps/api/js?sensor=false", false, THEMEVERSION, true);
	
	//Check slider engine
	$pp_slider_type = get_option('pp_slider_type');
	if($pp_slider_type=='cute')
	{
		wp_enqueue_script('modernizr', get_stylesheet_directory_uri()."/js/cute/modernizr.js", false, THEMEVERSION, true);
		wp_enqueue_script('cute.slider', get_stylesheet_directory_uri()."/js/cute/cute.slider.js", false, THEMEVERSION, true);
		wp_enqueue_script('cute.transitions.all', get_stylesheet_directory_uri()."/js/cute/cute.transitions.all.js", false, THEMEVERSION, true);
		wp_enqueue_script('respond.min', get_stylesheet_directory_uri()."/js/cute/respond.min.js", false, THEMEVERSION, true);
	}
	
	//Get all theme javascripts
	$js_path = get_template_directory()."/js/";
	$js_arr = array(
	    'fancybox/jquery.fancybox.pack.js',
	    'fancybox/jquery.fancybox-thumbs.js',
	    'jquery.easing.js',
	    'gmap.js',
	    'jquery.tipsy.js',
	    'jquery.validate.js',
	    'browser.js',
	    'jquery.isotope.js',
	    'flexslider/jquery.flexslider-min.js',
	    'reflection.js',
	    'jwplayer.js',
	    'hint.js',
	    'mediaelement/mediaelement-and-player.min.js',
	    'custom.js',
	);
	$js = "";

	$pp_advance_combine_js = get_option('pp_advance_combine_js');
	
	if(!empty($pp_advance_combine_js))
	{	
		if(!file_exists(get_template_directory()."/cache/combined.js"))
		{
			foreach($js_arr as $file) {
				if($file != 'jquery.js' && $file != 'jquery-ui.js')
				{
    				$js .= JSMin::minify(file_get_contents($js_path.$file));
    			}
			}
			
			file_put_contents(get_template_directory()."/cache/combined.js", $js);
		}

		wp_enqueue_script("combined_js", get_stylesheet_directory_uri()."/cache/combined.js", false, THEMEVERSION, true);
	}
	else
	{
		foreach($js_arr as $file) {
			if($file != 'jquery.js' && $file != 'jquery-ui.js')
			{
				wp_enqueue_script($file, get_stylesheet_directory_uri()."/js/".$file, false, THEMEVERSION, true);
			}
		}
	}
?>

<?php
	/* Always have wp_head() just before the closing </head>
	 * tag of your theme, or you will break many plugins, which
	 * generally use this hook to add elements to <head> such
	 * as styles, scripts, and meta tags.
	 */
	wp_head();
?>
</head>

<?php

/**
*	Get Current page object
**/
if(!is_null($post))
{
	$page = get_page($post->ID);
}


/**
*	Get current page id
**/
$current_page_id = '';

if(isset($page->ID))
{
    $current_page_id = $page->ID;
}
?>

<body <?php body_class(); ?>>

	<?php
		$pp_slider_timer = get_option('pp_slider_timer'); 
				
		if(empty($pp_slider_timer))
		{
		    $pp_slider_timer = 5;
		}
	?>
	<input type="hidden" id="slider_timer" name="slider_timer" value="<?php echo $pp_slider_timer; ?>"/>
	
	<input type="hidden" id="pp_blogurl" name="pp_blogurl" value="<?php echo home_url(); ?>"/>
	
	<input type="hidden" id="pp_stylesheet_directory" name="pp_stylesheet_directory" value="<?php echo get_stylesheet_directory_uri(); ?>"/>
	<?php
		$pp_footer_style = get_option('pp_footer_style');
	?>
	<input type="hidden" id="pp_footer_style" name="pp_footer_style" value="<?php echo $pp_footer_style; ?>"/>
	<?php
		$pp_lightbox_padding = get_option('pp_lightbox_padding');
	?>
	<input type="hidden" id="pp_lightbox_padding" name="pp_lightbox_padding" value="<?php echo $pp_lightbox_padding; ?>"/>
	<?php
		$pp_lightbox_opacity = get_option('pp_lightbox_opacity');
		
		if(!empty($pp_lightbox_opacity))
		{
			$pp_lightbox_opacity = $pp_lightbox_opacity/100;
		}
		else
		{
			$pp_lightbox_opacity = 0;
		}
	?>
	<input type="hidden" id="pp_lightbox_opacity" name="pp_lightbox_opacity" value="<?php echo $pp_lightbox_opacity; ?>"/>
	<?php
		$pp_lightbox_open_effect = get_option('pp_lightbox_open_effect');
	?>
	<input type="hidden" id="pp_lightbox_open_effect" name="pp_lightbox_open_effect" value="<?php echo $pp_lightbox_open_effect; ?>"/>
	<?php
		$pp_lightbox_open_speed = get_option('pp_lightbox_open_speed');
	?>
	<input type="hidden" id="pp_lightbox_open_speed" name="pp_lightbox_open_speed" value="<?php echo $pp_lightbox_open_speed; ?>"/>
	<?php
		$pp_lightbox_autoplay = get_option('pp_lightbox_autoplay');
	?>
	<input type="hidden" id="pp_lightbox_autoplay" name="pp_lightbox_autoplay" value="<?php echo $pp_lightbox_autoplay; ?>"/>
	<?php
		$pp_lightbox_play_speed = get_option('pp_lightbox_play_speed');
		
		if(!empty($pp_lightbox_play_speed))
		{
			$pp_lightbox_play_speed = $pp_lightbox_play_speed*1000;
		}
		else
		{
			$pp_lightbox_play_speed = 0;
		}
	?>
	<input type="hidden" id="pp_lightbox_play_speed" name="pp_lightbox_play_speed" value="<?php echo $pp_lightbox_play_speed; ?>"/>
	
	<?php
	    //Check header layout
	    if(isset($_SESSION['pp_header_layout']))
	    {
	    	$pp_header_layout = $_SESSION['pp_header_layout'];
	    }
	    else
	    {
	    	$pp_header_layout = get_option('pp_header_layout');
	    }
	        		
	    if($pp_header_layout != 1)
	    {
	?>
	<!-- Begin top bar -->
	<div id="top_bar">
	    
	    <div id="top_bar_inner">
	    
	    <div class="top_bar_wrapper">
	    	<?php
	    		if($pp_header_layout==2 OR $pp_header_layout==3 OR $pp_header_layout==4 OR $pp_header_layout==5 OR $pp_header_layout==6 OR $pp_header_layout==7)
	    		{
	    	?>
	    	<div class="top_social">
	
	    		<ul class="social_wrapper">
	    	    	<?php
	    	    		$pp_flickr_username = get_option('pp_flickr_username');
	    	    		
	    	    		if(!empty($pp_flickr_username))
	    	    		{
	    	    	?>
	    	    	<li><a title="Flickr" href="http://flickr.com/people/<?php echo $pp_flickr_username; ?>"><img src="<?php echo get_stylesheet_directory_uri(); ?>/images/social_dark/flickr.png" alt=""/></a></li>
	    	    	<?php
	    	    		}
	    	    	?>
	    	    	<?php
	    	    		$pp_youtube_username = get_option('pp_youtube_username');
	    	    		
	    	    		if(!empty($pp_youtube_username))
	    	    		{
	    	    	?>
	    	    	<li><a title="Youtube" href="http://youtube.com/user/<?php echo $pp_youtube_username; ?>"><img src="<?php echo get_stylesheet_directory_uri(); ?>/images/social_dark/youtube.png" alt=""/></a></li>
	    	    	<?php
	    	    		}
	    	    	?>
	    	    	<?php
	    	    		$pp_vimeo_username = get_option('pp_vimeo_username');
	    	    		
	    	    		if(!empty($pp_vimeo_username))
	    	    		{
	    	    	?>
	    	    	<li><a title="Vimeo" href="http://vimeo.com/<?php echo $pp_vimeo_username; ?>"><img src="<?php echo get_stylesheet_directory_uri(); ?>/images/social_dark/vimeo.png" alt=""/></a></li>
	    	    	<?php
	    	    		}
	    	    	?>
	    	    	<?php
	    	    		$pp_tumblr_username = get_option('pp_tumblr_username');
	    	    		
	    	    		if(!empty($pp_tumblr_username))
	    	    		{
	    	    	?>
	    	    	<li><a title="Tumblr" href="http://<?php echo $pp_tumblr_username; ?>.tumblr.com"><img src="<?php echo get_stylesheet_directory_uri(); ?>/images/social_dark/tumblr.png" alt=""/></a></li>
	    	    	<?php
	    	    		}
	    	    	?>
	    	    	<?php
	    	    		$pp_google_username = get_option('pp_google_username');
	    	    		
	    	    		if(!empty($pp_google_username))
	    	    		{
	    	    	?>
	    	    	<li><a title="Google+" href="<?php echo $pp_google_username; ?>"><img src="<?php echo get_stylesheet_directory_uri(); ?>/images/social_dark/google.png" alt=""/></a></li>
	    	    	<?php
	    	    		}
	    	    	?>
	    	    	<?php
	    	    		$pp_dribbble_username = get_option('pp_dribbble_username');
	    	    		
	    	    		if(!empty($pp_dribbble_username))
	    	    		{
	    	    	?>
	    	    	<li><a title="Dribbble" href="http://dribbble.com/<?php echo $pp_dribbble_username; ?>"><img src="<?php echo get_stylesheet_directory_uri(); ?>/images/social_dark/dribbble.png" alt=""/></a></li>
	    	    	<?php
	    	    		}
	    	    	?>
	    	    	<?php
	    	    		$pp_digg_username = get_option('pp_digg_username');
	    	    		
	    	    		if(!empty($pp_digg_username))
	    	    		{
	    	    	?>
	    	    	<li><a title="Digg" href="http://digg.com/<?php echo $pp_digg_username; ?>"><img src="<?php echo get_stylesheet_directory_uri(); ?>/images/social_dark/digg.png" alt=""/></a></li>
	    	    	<?php
	    	    		}
	    	    	?>
	    	    	<?php
	    	    		$pp_linkedin_username = get_option('pp_linkedin_username');
	    	    		
	    	    		if(!empty($pp_linkedin_username))
	    	    		{
	    	    	?>
	    	    	<li><a title="Linkedin" href="<?php echo $pp_linkedin_username; ?>"><img src="<?php echo get_stylesheet_directory_uri(); ?>/images/social_dark/linkedin.png" alt=""/></a></li>
	    	    	<?php
	    	    		}
	    	    	?>
	    	    	<?php
	    	    		$pp_twitter_username = get_option('pp_twitter_username');
	    	    		
	    	    		if(!empty($pp_twitter_username))
	    	    		{
	    	    	?>
	    	    	<li><a title="Twitter" href="http://twitter.com/<?php echo $pp_twitter_username; ?>"><img src="<?php echo get_stylesheet_directory_uri(); ?>/images/social_dark/twitter.png" alt=""/></a></li>
	    	    	<?php
	    	    		}
	    	    	?>
	    	    	<?php
	    	    		$pp_facebook_username = get_option('pp_facebook_username');
	    	    		
	    	    		if(!empty($pp_facebook_username))
	    	    		{
	    	    	?>
	    	    	<li><a title="Facebook" href="http://facebook.com/<?php echo $pp_facebook_username; ?>"><img src="<?php echo get_stylesheet_directory_uri(); ?>/images/social_dark/facebook.png" alt=""/></a></li>
	    	    	<?php
	    	    		}
	    	    	?>
	    	    	<?php
	            		$pp_pinterest_username = get_option('pp_pinterest_username');
	            		
	            		if(!empty($pp_pinterest_username))
	            		{
	            	?>
	            	<li><a title="Pinterest" href="http://pinterest.com/<?php echo $pp_pinterest_username; ?>" target="_blank"><img src="<?php echo get_stylesheet_directory_uri(); ?>/images/social_dark/pinterest.png" alt=""/></a></li>
	            	<?php
	            		}
	            	?>
	            	<?php
	            		$pp_instagram_username = get_option('pp_instagram_username');
	            		
	            		if(!empty($pp_instagram_username))
	            		{
	            	?>
	            	<li><a title="Instagram" href="http://instagram.com/<?php echo $pp_instagram_username; ?>" target="_blank"><img src="<?php echo get_stylesheet_directory_uri(); ?>/images/social_dark/instagram.png" alt=""/></a></li>
	            	<?php
	            		}
	            	?>
	    	    </ul>
	    	
	    	</div>
	    	<?php
	    		}
	    	?>
	    	
	    </div>
	    	
	    <?php
	    	if($pp_header_layout==2 OR $pp_header_layout==5)
	    	{
	    ?>
	    <div class="top_contact_info">
	        <ul>
	        	<?php
	        		$pp_contact_phone = get_option('pp_contact_phone');
	        		
	        		if(!empty($pp_contact_phone))
	        		{
	        	?>
	        		<li><img src="<?php echo get_stylesheet_directory_uri()?>/images/grey_phone_icon.png" alt="" class="middle"><?php echo $pp_contact_phone; ?></li>
	        	<?php
	        		}
	        	?>
	        	<?php
	        		$pp_contact_email = get_option('pp_contact_email');
	        		
	        		if(!empty($pp_contact_email))
	        		{	
	        	?>
	        		<li><img src="<?php echo get_stylesheet_directory_uri()?>/images/grey_email_icon.png" alt="" class="middle"><?php echo $pp_contact_email; ?></li>
	        	<?php
	        		}
	        	?>
	        </ul>
	    </div>
	    <?php
	    	}
	    ?>
	    
	    <?php
	    	if($pp_header_layout==3 OR $pp_header_layout==6)
	    	{
	    ?>
	    <div class="top_search">
	        <form role="search" method="get" class="searchform" action="<?php echo home_url(); ?>">
	    		<input type="text" value="" name="s" id="s" title="To search type and hit enter" class="blur">
	    	</form>
	    </div>
	    <?php
	    	}
	    ?>
	    
	    <?php 	
	    if($pp_header_layout==4 OR $pp_header_layout==7)
	    {
	        if ( has_nav_menu( 'top-menu' ) ) 
	        {
	            //Get page nav
	            wp_nav_menu( 
	                	array( 
	                		'menu_id'			=> 'top_menu',
	                		'menu_class'		=> 'nav',
	                		'theme_location' 	=> 'top-menu',
	                		'container_class' 	=> 'menu-main-menu-container',
	                	) 
	            ); 
	        }
	        else
	        {
	         		echo '<div class="notice">Please setup "Top Menu" using Wordpress Dashboard > Appearance > Menus</div>';
	        }
	    }
	    ?>
	    
	    </div>
	    
	</div>
	<!-- End top bar -->
	<?php
	}
	?>
	
	<!-- Begin template wrapper -->
	<div id="wrapper">
			
		<div class="header_bg">	
		
			<!-- Begin header -->
			<div id="header_wrapper">
				
				<!-- Begin main nav -->
				<div id="menu_wrapper">
				
				    <div class="logo">
				    	<!-- Begin logo -->
				    
				    	<?php
				    		//get custom logo
				    		$pp_logo = get_option('pp_logo');
				    		
				    		if(empty($pp_logo))
				    		{
				    			$pp_logo = get_stylesheet_directory_uri().'/images/logo.png';
				    		}
				    
				    	?>
				    	
				    	<a id="custom_logo" href="<?php echo home_url(); ?>"><img src="<?php echo $pp_logo?>" alt=""/></a>
				    	
				    	<!-- End logo -->
				    	
				    </div>
				    
				    <img id="mobile_menu" src="<?php echo get_stylesheet_directory_uri(); ?>/images/mobile_menu.png" alt=""/>
				    
				    <div id="menu_border_wrapper">
				
				    	<?php 	
				    	if ( has_nav_menu( 'primary-menu' ) ) 
				    	{
				    		//Get page nav
				    		wp_nav_menu( 
				    		    	array( 
				    		    		'menu_id'			=> 'main_menu',
				    		    		'menu_class'		=> 'nav',
				    		    		'theme_location' 	=> 'primary-menu',
				    		    		'container_class' 	=> 'menu-main-menu-container',
				    		    	) 
				    		); 
				    	}
				        else
				        {
				         		echo '<div class="notice">Please setup "Primary Menu" using Wordpress Dashboard > Appearance > Menus</div>';
				        }
				    	?>
				    
				    </div>
				
				</div>
				<!-- End main nav -->
				
		</div>
		<hr class="content_divider mainmenu"/>
		
		<?php
			$pp_advance_enable_switcher = get_option('pp_advance_enable_switcher');
		
		    if(!empty($pp_advance_enable_switcher))
		    {
		    	$bg_patterns_arr = array(
					'' => '<div style="float:left;width:40px;height:40px;" class="pp_checkbox_wrapper"></div>',
					'ps_neutral_@2X.png' => '<div style="float:left;width:40px;height:40px;background:url('.get_bloginfo( 'stylesheet_directory' ).'/images/patterns/ps_neutral_@2X.png) repeat;" class="pp_checkbox_wrapper"></div>',
					'wavegrid_@2X.png' => '<div style="float:left;width:40px;height:40px;background:url('.get_bloginfo( 'stylesheet_directory' ).'/images/patterns/wavegrid_@2X.png) repeat;" class="pp_checkbox_wrapper"></div>',
					'fabric_of_squares_gray_@2X.png' => '<div style="float:left;width:40px;height:40px;background:url('.get_bloginfo( 'stylesheet_directory' ).'/images/patterns/fabric_of_squares_gray_@2X.png) repeat;" class="pp_checkbox_wrapper"></div>',
					'pw_maze_white_@2X.png' => '<div style="float:left;width:40px;height:40px;background:url('.get_bloginfo( 'stylesheet_directory' ).'/images/patterns/pw_maze_white_@2X.png) repeat;" class="pp_checkbox_wrapper"></div>',
					'straws_@2X.png' => '<div style="float:left;width:40px;height:40px;background:url('.get_bloginfo( 'stylesheet_directory' ).'/images/patterns/straws_@2X.png) repeat;" class="pp_checkbox_wrapper"></div>',
					'grey_@2X.png' => '<div style="float:left;width:40px;height:40px;background:url('.get_bloginfo( 'stylesheet_directory' ).'/images/patterns/grey_@2X.png) repeat;" class="pp_checkbox_wrapper"></div>',
					'shattered_@2X.png' => '<div style="float:left;width:40px;height:40px;background:url('.get_bloginfo( 'stylesheet_directory' ).'/images/patterns/shattered_@2X.png) repeat;" class="pp_checkbox_wrapper"></div>',
					'tiny_grid_@2X.png' => '<div style="float:left;width:40px;height:40px;background:url('.get_bloginfo( 'stylesheet_directory' ).'/images/patterns/tiny_grid_@2X.png) repeat;" class="pp_checkbox_wrapper"></div>',
					'norwegian_rose_@2X.png' => '<div style="float:left;width:40px;height:40px;background:url('.get_bloginfo( 'stylesheet_directory' ).'/images/patterns/norwegian_rose_@2X.png) repeat;" class="pp_checkbox_wrapper"></div>',
					'crisp_paper_ruffles.png' => '<div style="float:left;width:40px;height:40px;background:url('.get_bloginfo( 'stylesheet_directory' ).'/images/patterns/crisp_paper_ruffles.png) repeat;" class="pp_checkbox_wrapper"></div>',
					'nistri.png' => '<div style="float:left;width:40px;height:40px;background:url('.get_bloginfo( 'stylesheet_directory' ).'/images/patterns/nistri.png) repeat;" class="pp_checkbox_wrapper"></div>',
					'diamond_upholstery.png' => '<div style="float:left;width:40px;height:40px;background:url('.get_bloginfo( 'stylesheet_directory' ).'/images/patterns/diamond_upholstery.png) repeat;" class="pp_checkbox_wrapper"></div>',
					'scribble_light.png' => '<div style="float:left;width:40px;height:40px;background:url('.get_bloginfo( 'stylesheet_directory' ).'/images/patterns/scribble_light.png) repeat;" class="pp_checkbox_wrapper"></div>',
					'gplaypattern.png' => '<div style="float:left;width:40px;height:40px;background:url('.get_bloginfo( 'stylesheet_directory' ).'/images/patterns/gplaypattern.png) repeat;" class="pp_checkbox_wrapper"></div>',
					'arches.png' => '<div style="float:left;width:40px;height:40px;background:url('.get_bloginfo( 'stylesheet_directory' ).'/images/patterns/arches.png) repeat;" class="pp_checkbox_wrapper"></div>',
					'hexellence.png' => '<div style="float:left;width:40px;height:40px;background:url('.get_bloginfo( 'stylesheet_directory' ).'/images/patterns/hexellence.png) repeat;" class="pp_checkbox_wrapper"></div>',
					'diagonal_striped_brick.png' => '<div style="float:left;width:40px;height:40px;background:url('.get_bloginfo( 'stylesheet_directory' ).'/images/patterns/diagonal_striped_brick.png) repeat;" class="pp_checkbox_wrapper"></div>',
					'subtle_zebra_3d.png' => '<div style="float:left;width:40px;height:40px;background:url('.get_bloginfo( 'stylesheet_directory' ).'/images/patterns/subtle_zebra_3d.png) repeat;" class="pp_checkbox_wrapper"></div>',
					'graphy.png' => '<div style="float:left;width:40px;height:40px;background:url('.get_bloginfo( 'stylesheet_directory' ).'/images/patterns/graphy.png) repeat;" class="pp_checkbox_wrapper"></div>',
					'xv.png' => '<div style="float:left;width:40px;height:40px;background:url('.get_bloginfo( 'stylesheet_directory' ).'/images/patterns/xv.png) repeat;" class="pp_checkbox_wrapper"></div>',
					'bright_squares.png' => '<div style="float:left;width:40px;height:40px;background:url('.get_bloginfo( 'stylesheet_directory' ).'/images/patterns/bright_squares.png) repeat;" class="pp_checkbox_wrapper"></div>',
					'brushed_alu.png' => '<div style="float:left;width:40px;height:40px;background:url('.get_bloginfo( 'stylesheet_directory' ).'/images/patterns/brushed_alu.png) repeat;" class="pp_checkbox_wrapper"></div>',
					'cubes.png' => '<div style="float:left;width:40px;height:40px;background:url('.get_bloginfo( 'stylesheet_directory' ).'/images/patterns/cubes.png) repeat;" class="pp_checkbox_wrapper"></div>',
					
				);
		?>
		<form action="<?php echo get_stylesheet_directory_uri(); ?>/switcher.php" method="get" id="form_option" name="form_option">
		    <div id="option_wrapper">
		    <div class="inner">
		    	<h5>Style Selector</h5><br/>
		    	
		    	Which theme layout you want to used?<br/>
		    	<select name="pp_theme_layout" id="pp_theme_layout" style="margin-top:5px">
		    	    <option value="fullwidth" <?php if($pp_theme_layout == 'fullwidth') { ?>selected=selected<?php } ?>>Fullwidth</option>
		    	    <option value="boxed" <?php if($pp_theme_layout == 'boxed') { ?>selected=selected<?php } ?>>Boxed</option>
		    	</select>
				
				<br/><br/>
		    
		    	Which predefined skin colors you want to used?<br/>
		    	<a class="skin_box" href="<?php echo get_stylesheet_directory_uri(); ?>/switcher.php?pp_skin=ps_1364356619" title="Orange" style="background:#f39d12"></a>
		    	<a class="skin_box" href="<?php echo get_stylesheet_directory_uri(); ?>/switcher.php?pp_skin=ps_1364296182" title="Blue" style="background:#3498db"></a>
		    	<a class="skin_box" href="<?php echo get_stylesheet_directory_uri(); ?>/switcher.php?pp_skin=ps_1364459411" title="Concrete" style="background:#95a5a6"></a>
		    	<a class="skin_box" href="<?php echo get_stylesheet_directory_uri(); ?>/switcher.php?pp_skin=ps_1364472394" title="Green" style="background:#76bb2c"></a>
		    	<a class="skin_box" href="<?php echo get_stylesheet_directory_uri(); ?>/switcher.php?pp_skin=ps_1364458931" title="Red" style="background:#e74d3c"></a>
		    	<a class="skin_box" href="<?php echo get_stylesheet_directory_uri(); ?>/switcher.php?pp_skin=ps_1364459345" title="Pink" style="background:#ed6280"></a>
		    	<a class="skin_box" href="<?php echo get_stylesheet_directory_uri(); ?>/switcher.php?pp_skin=ps_1364459301" title="Ocean" style="background:#1abc9c"></a>
		    	<a class="skin_box" href="<?php echo get_stylesheet_directory_uri(); ?>/switcher.php?pp_skin=ps_1364459212" title="Asphalt" style="background:#34495e"></a>
		    	<a class="skin_box" href="<?php echo get_stylesheet_directory_uri(); ?>/switcher.php?pp_skin=ps_1364459084" title="Purple" style="background:#9c59b6"></a>
		    	<a class="skin_box" href="<?php echo get_stylesheet_directory_uri(); ?>/switcher.php?pp_skin=ps_1364459032" title="Purple Blue" style="background:#7dadff"></a>
		    	
		    	<br class="clear"/><br/>
		    	
		    	Background Patterns (Boxed Layout)<br/>
		    	<?php
		    		foreach($bg_patterns_arr as $key => $bg_pattern)
		    		{
			    ?>
			    		
			    		<a href="<?php echo get_stylesheet_directory_uri(); ?>/switcher.php?pp_boxed_bg_img_pattern=<?php echo $key; ?>"><?php echo $bg_pattern; ?></a>
			    		
			    <?php
		    		}
		    	?>
		    	
		    	<br class="clear"/><br/>
		    	<a class="button" href="<?php echo get_stylesheet_directory_uri(); ?>/switcher.php?reset=1" style="width:54px">Reset</a>
		    </div>
		    </div>
		    <div id="option_btn">
		    	<img src="<?php echo get_stylesheet_directory_uri(); ?>/images/color.png" alt=""/>
		    </div>
		</form>
		<?php
		    }
		?>