<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes('xhtml'); ?>>
<head profile="http://gmpg.org/xfn/11">

<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />

<title><?php if(!is_home() && get_post_meta($post->ID, "_seo_title", true)) { echo get_post_meta($post->ID, "_seo_title", true); } else { wp_title(':', true, 'right'); bloginfo('name'); } ?></title>
<?php if( get_post_meta($post->ID, "_seo_description", true) ): ?>
<meta name="description" content="<?php echo get_custom_field('_seo_description'); ?>" /><?php else: ?><?php endif; ?>	
<?php if( get_post_meta($post->ID, "_seo_keywords", true) ): ?><meta name="keywords" content="<?php echo get_custom_field('_seo_keywords'); ?>" /><?php else: ?><?php endif; ?>
	
<link rel="Shortcut Icon" href="<?php echo bloginfo('template_url'); ?>/images/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
<link rel="alternate" type="application/atom+xml" title="<?php bloginfo('name'); ?> Atom Feed" href="<?php bloginfo('atom_url'); ?>" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />

<?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>
<?php wp_head(); ?>

<script src="<?php bloginfo('template_url'); ?>/tools/js/dropdown.js" type="text/javascript"></script>

</head>

<body><div><a id="top"></a></div>

<div id="headerbg">
    <div id="header">
    <?php if(get_theme_mod('header_blog_title') == 'Image') { ?>
        <div class="headerleft" id="imageheader">
            <?php
                if (is_home()) {
                    echo '<h1><a href="'.get_option('home').'/">'.get_bloginfo('name').'</a></h1>';
                } else {
                    echo '<h4><a href="'.get_option('home').'/">'.get_bloginfo('name').'</a></h4>';
                }
            ?>
           <p><?php bloginfo('description'); ?></p>
        </div>
    <?php } else { ?>
        <div class="headerleft">
            <div class="headertext">       
                <?php if (is_home()) { ?>
                <h1><a href="<?php echo get_settings('home'); ?>/"><?php bloginfo('name'); ?></a></h1>
                <?php } else { ?>
                <h4><a href="<?php echo get_settings('home'); ?>/"><?php bloginfo('name'); ?></a></h4>
                <?php } ?> 
                <p><?php bloginfo('description'); ?></p>  
            </div>
        </div>
    <?php } ?>
        <div class="headerright">
			<form id="searchform-header" method="get" action="<?php echo get_option('home') ?>/">
			<input type="text" value="<?php _e("Search our website...", 'studiopress'); ?>" name="s" id="s-header" onfocus="if (this.value == '<?php _e("Search our website...", 'studiopress'); ?>') {this.value = '';}" onblur="if (this.value == '') {this.value = '<?php _e("Search our website...", 'studiopress'); ?>';}" /></form>
        </div>
    </div>
</div>

<div id="navbarbg">
    <div id="navbar">
        <div class="navbarleft">
            <ul id="nav">
                <li><a rel="nofollow" href="<?php echo get_option('home'); ?>"><?php _e("Home", 'studiopress'); ?></a></li>
                <?php wp_list_pages('title_li=&sort_column=menu_order'); ?>
            </ul>
        </div>  
        <div class="navbarright">
            <a class="rsslink" rel="nofollow" href="<?php bloginfo('rss_url'); ?>"><?php _e("Subscribe", 'studiopress'); ?></a>
        </div>
        <div class="clear"></div>
    </div>
</div>

<?php if (is_home()) { ?>
<div id="wrap-home">
<?php } else { ?>
<div id="wrap">
<?php } ?> 