<?php
/**
 * Theme Header
 *
 */

global $e404_options;
if($post) {
	$e404_options['post_id'] = $post->ID;
	$e404_options['post_parent'] = $post->post_parent;
}

?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
<head>
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<title><?php wp_title('&laquo;', true, 'right'); ?><?php bloginfo('name'); ?></title>
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo('stylesheet_url'); ?>" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<?php
	if ( is_singular() && get_option( 'thread_comments' ) )
		wp_enqueue_script( 'comment-reply' );
	wp_head();
?>
</head>

<body>
<?php do_action('after_body'); ?>
<div id="main_wrapper">
<div id="header">
	<div class="leftside" id="logo"><a href="<?php echo home_url(); ?>"><img src="<?php echo $e404_options['logo_url']; ?>" alt="<?php echo esc_attr(get_bloginfo('name', 'display')); ?>" /></a></div>
	<div id="header_nav" class="rightside">
		<?php if(!$e404_options['remove_top_contact_box']) : ?>
		<div id="header_info" class="leftside">
			<?php echo $e404_options['top_contact_box']; ?>
		</div>
		<?php endif; ?>
		<div id="social_icons" class="leftside">
			<?php e404_show_header_social_icons(); ?>
		</div>
		<br class="clear" />
	</div>
	<br class="clear" />
</div>

<div id="navigation_wrapper">
	<div id="navigation">
		<?php wp_nav_menu(array('theme_location' => 'header-menu', 'container' => false, 'menu_class' => 'sf-menu', 'link_before' => '<span class="menu-btn">', 'link_after' => '</span>')); ?>
		<br class="clear" />
	</div>
</div>

<div id="content_wrapper">
	<div id="tools_wrapper">
		<?php if(!$e404_options['remove_search_form']) : ?>
		<div id="search_btn" class="tools">
			<a href="#">Search</a>
		</div>
		<div id="search_wrapper">
			<div id="search">
				<form action="<?php echo home_url(); ?>" method="get">
					<input type="text" name="s" value="<?php _e('Search...', 'ice'); ?>" onfocus="if (this.value == '<?php _e('Search...', 'ice'); ?>') {this.value = '';}" onblur="if (this.value == '') {this.value = '<?php _e('Search...', 'ice'); ?>';}" />
				</form>
			</div>
		</div>
		<?php endif; ?>
		<?php if(!$e404_options['remove_rss_ribbon']) : ?>
		<div id="rss_btn" class="tools">
			<a href="<?php bloginfo('rss2_url'); ?>">RSS</a>
		</div>
		<?php endif; ?>
	</div>
