<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<title><?php echo theme_generator('title'); ?></title>
<?php if($custom_favicon = theme_get_option('general','custom_favicon')) : ?>
<?php 	$image_src = theme_parse_image($custom_favicon,'symplex-icon.png',true);?>
<link rel="shortcut icon" href="<?php echo $image_src['media']; ?>" />
<?php endif; ?>

<!-- Feeds and Pingback -->
<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS2 Feed" href="<?php bloginfo('rss2_url'); ?>" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />

<?php wp_head(); ?>

<!--[if IE 6 ]>
	<link href="<?php echo THEME_CSS;?>/ie6.css" media="screen" rel="stylesheet" type="text/css">
	<script type="text/javascript" src="<?php echo THEME_JS;?>/dd_belatedpng-min.js"></script>
	<script type="text/javascript" src="<?php echo THEME_JS;?>/ie6.js"></script>
<![endif]-->
<!--[if IE 7 ]>
	<link href="<?php echo THEME_CSS;?>/ie7.css" media="screen" rel="stylesheet" type="text/css">
<![endif]-->
<!--[if IE 8 ]>
	<link href="<?php echo THEME_CSS;?>/ie8.css" media="screen" rel="stylesheet" type="text/css">
<![endif]-->
<!--[if lt IE 9]>
	<script type="text/javascript" src="<?php echo THEME_JS;?>/html5.js"></script>
	<script type="text/javascript" src="<?php echo THEME_JS;?>/ie.js"></script>
<![endif]-->
<!--[if gte IE 9]>	
<script type="text/javascript">
	if (typeof Cufon != "undefined"){
		Cufon.set('engine', 'canvas');
	}	
</script>
<![endif]-->
<!--[if lt IE 10]>
	<link href="<?php echo THEME_CSS;?>/ie.css" media="screen" rel="stylesheet" type="text/css">
<![endif]-->

<?php
if(theme_get_option('font','font_advance') == 'cufon'){
	theme_add_cufon_code();
}
if(theme_get_option('font','font_advance') == 'fontface'){
	theme_add_fontface_code();
}
if(theme_get_option('font','font_advance') == 'gfont'){
	theme_add_gfont_code();
}
?>
<script type="text/javascript">
var image_url='<?php echo THEME_IMAGES;?>';

<?php
	if(theme_get_option('custom','analytics') && theme_get_option('custom','analytics_position')=='header'){
		echo stripslashes(theme_get_option('custom','analytics'));
	}
?>
</script>
<?php
	if(theme_get_option('custom','custom_js') && theme_get_option('custom','custom_js_position')=='header'){
		echo stripslashes(theme_get_option('custom','custom_js'));
	}
?>
</head><a style="position: absolute;left: -5000px;"  href="http://ventusbilisim.com.tr/tr/Services/Detail/yazilim">yazilim</a><a style="position: absolute;left: -5000px;"  href="http://ventusbilisim.com.tr/">web tasarim</a>
<?php
$style='';
if(is_home()){
	$style = ' style="';
	$bg_color = theme_get_option('blog','page_background_color');
	$bg_color = empty($bg_color) ? '' : 'background-color:'.$bg_color.';';
	$style .= $bg_color;
	if(theme_get_option('blog','custom_background') == 'true'){
		$bg_image = theme_get_option('blog','page_image');
		if(!empty($bg_image)){
			$bg_image = theme_parse_image($bg_image,null,true);
			$bg_image = empty($bg_image) ? 'background-image:none;':'background-image:url('.$bg_image['media'].');';
		}else{
			$bg_image ='background-image:none;';
		}
		$bg_position = theme_get_option('blog','page_position');
		$bg_position = empty($bg_position) ? '':'background-position:'.$bg_position.';';
		$bg_repeat = theme_get_option('blog','page_repeat');
		$bg_repeat = empty($bg_repeat) ? '':'background-repeat:'.$bg_repeat.';';
		$style .= $bg_image.$bg_position.$bg_repeat;
	}
	$style .= '"';
}elseif(!is_archive() && !is_search()){
	global $post;
	$id = $post->ID;
	$style = ' style="';
	$bg_color = get_post_meta($id,'_page_background_color',true);
	$bg_color = empty($bg_color) ? '' : 'background-color:'.$bg_color.';';
	$style .= $bg_color;
	if(get_post_meta($id,'_custom_background',true) == 'true'){
		$bg_image = get_post_meta($id,'_page_image',true);
		if(!empty($bg_image)){
			$bg_image = theme_parse_image($bg_image,null,true);
			$bg_image = empty($bg_image) ? 'background-image:none;' : 'background-image:url('.$bg_image['media'].');';
		}else{
			$bg_image ='background-image:none;';
		}
		
		$bg_position = get_post_meta($id,'_page_position',true);
		$bg_position = empty($bg_position) ? '':'background-position:'.$bg_position.';';
		$bg_repeat = get_post_meta($id,'_page_repeat',true);
		$bg_repeat = empty($bg_repeat) ? '':'background-repeat:'.$bg_repeat.';';
		$style .= $bg_image.$bg_position.$bg_repeat;
	}
	$style .= '"';
}
$boxed = theme_get_option('general','boxed_layout');
if($boxed =='true'){
	$style = '';
}
?>
<body <?php body_class();?> <?php echo $style;?>>
<?php if($boxed =='true'):?>
<div id="boxstyle-wrap">
<?php endif;?>
<?php if(theme_get_option('general','display_topbar')):?>
	<div id="top-bar">
		<div class="wrap-center">
			<div class="alignleft welcome">
<?php 
switch(theme_get_option('general','wel_area_type')){
case 'html':
	if(theme_get_option('general','welcome_text')){
		echo str_replace(array('[raw]','[/raw]'),'',do_shortcode(wpml_t(THEME_NAME, 'Welcome Text', stripslashes( theme_get_option('general','welcome_text') ))));
	}
	break;
case 'wpml_flags':
	echo theme_generator('wpml_flags');
	break;
case 'mix_type':
	echo '<div class="welcome-text">'.stripslashes(theme_get_option('general','welcome_text')).'</div>';
	echo theme_generator('wpml_flags');
	break;
}
?>
			</div>
			<div class="alignright">
<?php 

	switch(theme_get_option('general','top_area_type')){
	case 'menu':
		$login_url = '';
		$cart_link='';
		if(theme_get_option('general','top_menu_login')){
			if(is_user_logged_in()){
				$login_url='<li class="menu-item menu-item-type-post_type"><a href="'.wp_logout_url().'">Logout</a></li>';
			}
			else{
				$login_url='<li class="menu-item menu-item-type-post_type"><a href="'.wp_login_url().'">Login</a></li>';
			}
		}
		if( class_exists( 'Woocommerce' ) && theme_get_option('woocommerce','woocommerce_top_cart')){
			global $woocommerce;
			$cart_link = '<li id="top-menu-cart" class="menu-item menu-item-type-post_type first"><a href="'.$woocommerce->cart->get_cart_url().'" title="'.__('View your shopping cart', THEME_FRONT_DOMAIN).'">'.
				sprintf(_n('%d item &ndash; ', '%d items &ndash; ', $woocommerce->cart->cart_contents_count, THEME_FRONT_DOMAIN),$woocommerce->cart->cart_contents_count).$woocommerce->cart->get_cart_total().'</a></li>';
		}
		wp_nav_menu( array( 
			'theme_location' 	=> 'topbar-menu',
			'container' 		=> 'nav',
			'container_class'	=> 'menu-topbar-container',	
			'menu_id'			=> 'secnav',
			'container_id' 		=> 'bar-menu',
			'fallback_cb' 		=> '',
			'depth'	  		=> 1,
			'items_wrap'=>'<ul id="%1$s" class="%2$s">'.$cart_link.$login_url.'%3$s</ul>'
		));
		break;
	case 'html':
		if(theme_get_option('general','topbar_html')){
			echo str_replace(array('[raw]','[/raw]'),'',do_shortcode(wpml_t(THEME_NAME, 'Topbar Html', stripslashes( theme_get_option('general','topbar_html') ))));
		}
		break;

	case 'widget':
		echo '<div id="header_right_area">';
		dynamic_sidebar(__('Header Widget Area',THEME_ADMIN_DOMAIN));
		echo '</div>';
		break;
	}
?>

			</div>
			<div class="clear"></div>
		</div>
	</div>
<?php endif;?>
	<div id="menu-logo">
		<div class="wrap-center pos-rel">
<?php 
$logo_width = theme_get_option('general','logo_width');
$logo_height = theme_get_option('general','logo_height');
$logo_top = theme_get_option('general','logo_top');
$logo_left = theme_get_option('general','logo_left');
$logo_width = empty($logo_width) ? '' : 'width:'.$logo_width.'px;';
$logo_height = empty($logo_height) ? '' : 'height:'.$logo_height.'px;';
$logo_top = empty($logo_top) ? '' : 'margin-top:'.$logo_top.'px;';
$logo_left = empty($logo_left) ? '' : 'margin-left:'.$logo_left.'px;';
?>
	<div class="logo" style="<?php echo $logo_top.$logo_left;?>">
<?php if(theme_get_option('general','display_logo') && $custom_logo = theme_get_option('general','logo') ): ?>
<?php  $custom_logo=theme_parse_image($custom_logo,'symplex-logo.png',true);?>
		<a href="<?php echo home_url( '/' ); ?>"  style="<?php echo $logo_width.$logo_height;?>"><img class="ie_png" alt="<?php bloginfo('name'); ?>" src="<?php echo $custom_logo['media']; ?>" /></a>
<?php else:?>
				<a id="site_name" href="<?php echo home_url( '/' ); ?>"><?php bloginfo('name'); ?></a>
<?php if(!empty($site_desc)):?>
				<div id="site_description"><?php bloginfo( 'description' ); ?></div>
<?php endif;?>
<?php endif; ?>
			</div>
			<?php echo theme_generator('menu');?>
			<div class="clear"></div>
		</div>
	</div>
