<?php 
	$homepage_slider_title = get_option(THEME_NAME."_homepage_title_position");
	$homepage_slider_direction = get_option(THEME_NAME."_homepage_slide_direction");
	$homepage_slider_effect = get_option(THEME_NAME."_homepage_slide_effect");
	$homepage_slider_delay = get_option(THEME_NAME."_homepage_slide_delay");
	$homepage_slider_strips = get_option(THEME_NAME."_homepage_slide_strip_count");
	$homepage_slider_strip_speed = get_option(THEME_NAME."_homepage_slide_strip_speed");
	$homepage_slider_title_speed = get_option(THEME_NAME."_homepage_slide_title_speed");	
	
	$blog_slider_direction = get_option(THEME_NAME."_blog_slide_direction");
	$blog_slider_effect = get_option(THEME_NAME."_blog_slide_effect");
	$blog_slider_delay = get_option(THEME_NAME."_blog_slide_delay");
	$blog_slider_strips = get_option(THEME_NAME."_blog_slide_strip_count");
	$blog_slider_strip_speed = get_option(THEME_NAME."_blog_slide_strip_speed");
	$blog_slider_title_speed = get_option(THEME_NAME."_blog_slide_title_speed");

	if($cufon=="on" || !$cufon){
		$cufon_on=",";
	}

	$banner_type = get_option ( THEME_NAME."_banner_type" );
	
	$banner_fly_in = get_option ( THEME_NAME."_banner_fly_in" );
	$banner_fly_out = get_option ( THEME_NAME."_banner_fly_out" );
	$banner_start = get_option ( THEME_NAME."_banner_start" );
	$banner_close = get_option ( THEME_NAME."_banner_close" );
	$banner_overlay = get_option ( THEME_NAME."_banner_overlay" );
	$banner_views = get_option ( THEME_NAME."_banner_views" );
	$banner_timeout = get_option ( THEME_NAME."_banner_timeout" );
	
	$banner_text_image_img = get_option ( THEME_NAME."_banner_text_image_img" ) ;
	$banner_image = get_option ( THEME_NAME."_banner_image" );
	$banner_text = stripslashes ( get_option ( THEME_NAME."_banner_text" ) );
	
	if ( $banner_type == "image" ) {
	//Image Banner
		$cookie_name = substr ( md5 ( $banner_image ), 1,6 );
	} else if ( $banner_type == "text" ) { 
	//Text Banner
		$cookie_name = substr ( md5 ( $banner_text ), 1,6 );
	} else if ( $banner_type == "text_image" ) { 
	//Image And Text Banner
		$cookie_name = substr ( md5 ( $banner_text_image_img ), 1,6 );
	} else {
		$cookie_name = "popup";
	}

	if ( !$banner_start) {
		$banner_start = 0;
	}
	
	if ( !$banner_close) {
		$banner_close = 0;
	}
	
	if ( $banner_overlay == "on") {
		$banner_overlay = "true";
	} else {
		$banner_overlay = "false";
	}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- BEGIN html -->
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
	<!-- BEGIN head -->
	<head>
		<!-- Title -->
		<title>
		<?php
                 if ( is_single() ) { single_post_title(); print ' - '; bloginfo('name'); }      
                 elseif ( is_home() || is_front_page() ) { bloginfo('name'); print ' - '; bloginfo('description'); }
                 elseif ( is_page() ) { single_post_title(''); print ' - '; bloginfo('description'); }
                 elseif ( is_search() ) { bloginfo('name'); print ' - Search results ' . esc_html($s); }
                 elseif ( is_404() ) { bloginfo('name'); print ' - Page not found'; }
                 else { bloginfo('name'); wp_title('-'); }
		?>
		</title>

		<!-- Meta Tags -->
		<meta http-equiv="content-type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
		
		<!-- Favicon -->
		<link rel="shortcut icon" href="<?php echo get_template_directory_uri(); ?>/images/favicon.ico" type="image/x-icon" />
       <link rel="alternate" type="application/rss+xml" href="<?php bloginfo('rss2_url'); ?>" title="<?php printf( __( '%s latest posts'), esc_html( get_bloginfo('name'), 1 ) ); ?>" />
       <link rel="alternate" type="application/rss+xml" href="<?php bloginfo('comments_rss2_url') ?>" title="<?php printf( __( '%s latest comments'), esc_html( get_bloginfo('name'), 1 ) ); ?>" />
       <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
		<?php 
			wp_enqueue_style("style", get_template_directory_uri()."/style.css", Array());
			wp_enqueue_style("main-stylesheet", get_template_directory_uri()."/css/main-stylesheet.css", Array());
			wp_enqueue_style("shortcodes", get_template_directory_uri()."/css/shortcodes.css", Array());
			wp_enqueue_style("sexy-slider", get_template_directory_uri()."/css/sexy-slider.css", Array());
			wp_enqueue_style("fancybox", get_template_directory_uri()."/css/jquery.fancybox.css", Array());
		?>
		<?php wp_head(); ?>	

		<script type="text/javascript">
			jQuery(document).ready(function($){
				$("#homepage-slider").SexySlider({
					autopause  : true,
					auto       : true,
					<?php if($homepage_slider_strips && $homepage_slider_strips!="default") { echo "strips : ".$homepage_slider_strips.","; }?>
					<?php if($homepage_slider_delay && $homepage_slider_delay!="default") { echo "delay : ".$homepage_slider_delay.","; }?>
					<?php if($homepage_slider_strip_speed && $homepage_slider_strip_speed!="default") { echo "stripSpeed : ".$homepage_slider_strip_speed.","; }?> 
					<?php if($homepage_slider_title_speed && $homepage_slider_title_speed!="default") { echo "titleSpeed : ".$homepage_slider_title_speed.","; }?> 
					<?php if($homepage_slider_title && $homepage_slider_title!="default") { echo "titlePosition : '".$homepage_slider_title."',"; }?> 
					<?php if($homepage_slider_direction && $homepage_slider_direction!="default") { echo "direction : '".$homepage_slider_direction."',"; }?> 
					<?php if($homepage_slider_effect && $homepage_slider_effect!="default") { echo "effect : '".$homepage_slider_effect."'".$cufon_on.""; }?> 
					<?php if($cufon=="on" || !$cufon){ ?> onTitleHide     : function() { Cufon.replace('.sexyslider-title a', { textShadow: '#3e0000 0 1px', hover: 'true' } ); } <?php } ?>
				});
			});
		</script>
		<script type="text/javascript">
			jQuery(document).ready(function($){
				$("#blog-slider").SexySlider({
					autopause  : true,
					auto       : true,
					<?php if($blog_slider_strips && $blog_slider_strips!="default") { echo "strips : ".$blog_slider_strips.","; }?>
					<?php if($blog_slider_delay && $blog_slider_delay!="default") { echo "delay : ".$blog_slider_delay.","; }?>
					<?php if($blog_slider_strip_speed && $blog_slider_strip_speed!="default") { echo "stripSpeed : ".$blog_slider_strip_speed.","; }?> 
					<?php if($blog_slider_title_speed && $blog_slider_title_speed!="default") { echo "titleSpeed : ".$blog_slider_title_speed.","; }?> 
					<?php if($blog_slider_direction && $blog_slider_direction!="default") { echo "direction : '".$blog_slider_direction."',"; }?> 
					<?php if($blog_slider_effect && $blog_slider_effect!="default") { echo "effect : '".$blog_slider_effect."'".$cufon_on.""; }?> 
					<?php if($cufon=="on" || !$cufon){ ?> onTitleHide     : function() { Cufon.replace('.sexyslider-title a', { textShadow: '#3e0000 0 1px', hover: 'true' } ); } <?php } ?>
				});
			});
		</script>
		<?php
			if ( $banner_type != "off" ) {
		?>

		<script type="text/javascript">
		<!--
		jQuery(document).ready(function($){
			$('#popup_content').popup( {
				starttime 			 : <?php echo $banner_start; ?>,
				selfclose			 : <?php echo $banner_close; ?>,
				popup_div			 : 'popup',
				overlay_div	 		 : 'overlay',
				close_id			 : 'baner_close',
				overlay				 : <?php echo $banner_overlay; ?>,
				opacity_level		 : 0.7,
				overlay_cc			 : false,
				centered			 : true,
				top	 		   		 : 130,
				left	 			 : 130,
				setcookie 			 : true,
				cookie_name	 		 : '<?php echo $cookie_name;?>',
				cookie_timeout 	 	 : <?php echo $banner_timeout; ?>,
				cookie_views 		 : <?php echo $banner_views ; ?>,
				floating	 		 : true,
				floating_reaction	 : 700,
				floating_speed 		 : 12,
				<?php 
					if ( $banner_fly_in != "off") { 
						echo "fly_in : true,
						fly_from : '".$banner_fly_in."', "; 
					} else {
						echo "fly_in : false,";
					}
				?>
				<?php 
					if ( $banner_fly_out != "off") { 
						echo "fly_out : true,
						fly_to : '".$banner_fly_out."', "; 
					} else {
						echo "fly_out : false,";
					}
				?>
				popup_appear  		 : 'show',
				popup_appear_time 	 : 0,
				confirm_close	 	 : false,
				confirm_close_text 	 : 'Do you really want to close?'
			} );
		});
		-->
		</script>
		<?php } ?>

		<?php
			if ( $banner_type == "image" ) {
			//Image Banner
		?>
			<style type="text/css">
				#overlay { width:100%; height:100%; position:fixed;  _position:absolute; top:0; left:0; z-index:1001; background-color:#000000; overflow: hidden;  }
				#popup { display: none; position:absolute; width:auto; height:auto; z-index:1002; color: #000; font-family: Tahoma,sans-serif;font-size: 14px; }
				#baner_close { width: 22px; height: 25px; background: url(<?php echo get_template_directory_uri(); ?>/images/close.png) 0 0 repeat; text-indent: -5000px; position: absolute; right: -10px; top: -10px; }
			</style>
		<?php
			} else if ( $banner_type == "text" ) {
			//Text Banner
		?>
			<style type="text/css">
				#overlay { width:100%; height:100%; position:fixed;  _position:absolute; top:0; left:0; z-index:1001; background-color:#000000; overflow: hidden;  }
				#popup { display: none; position:absolute; width:auto; height:auto; max-width:700px; z-index:1002; border: 1px solid #000; background: #e5e5e5 url(<?php echo get_template_directory_uri(); ?>/images/dotted-bg-6.png) 0 0 repeat; color: #000; font-family: Tahoma,sans-serif;font-size: 14px; line-height: 24px; border: 1px solid #cccccc; -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; text-shadow: #fff 0 1px 0; }
				#popup center { display: block; padding: 20px 20px 20px 20px; }
				#baner_close { width: 22px; height: 25px; background: url(<?php echo get_template_directory_uri(); ?>/images/close.png) 0 0 repeat; text-indent: -5000px; position: absolute; right: -12px; top: -12px; }
			</style>
		<?php 
			} else if ( $banner_type == "text_image" ) {
			//Image And Text Banner
		?>
			<style type="text/css">
				#overlay { width:100%; height:100%; position:fixed;  _position:absolute; top:0; left:0; z-index:1001; background-color:#000000; overflow: hidden;  }
				#popup { display: none; position:absolute; width:auto; z-index:1002; color: #000; font-size: 11px; font-weight: bold; }
				#popup center { padding: 15px 0 0 0; }
				#baner_close { width: 22px; height: 25px; background: url(<?php echo get_template_directory_uri(); ?>/images/close.png) 0 0 repeat; text-indent: -5000px; position: absolute; right: -10px; top: -10px; }
			</style>
		<?php } ?>
		

	<!-- END head -->
	</head>
	
	<!-- BEGIN body -->
	<body <?php body_class("top"); ?>>
		
		<?php get_template_part(THEME_INCLUDES."banners");?>