<!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" lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php if (is_home() ) {?><?php bloginfo('name'); ?> - <?php bloginfo('description'); ?><?php } else {?><?php wp_title('-', true, 'right'); ?> <?php bloginfo('name'); ?> <?php } ?></title>
    <?php if (is_home())
    {
    $description = get_option('swt_description');
    $keywords = get_option('swt_keywords');
    }
    elseif (is_category())
    {
    $description = category_description();
    $keywords = single_cat_title('', false);
    }
    elseif (is_tag())
    {
    $description = tag_description();
    $keywords = single_tag_title('', false);
    }
    elseif (is_single())
    {
     if ($post->post_excerpt) {$description = $post->post_excerpt;} 
     else {$description = substr(strip_tags($post->post_content),0,240);}
    $keywords = "";
    $tags = wp_get_post_tags($post->ID);
    foreach ($tags as $tag ) {$keywords = $keywords . $tag->name . ", ";}
    }
    ?>
    <meta name="keywords" content="<?php echo $keywords ?>" />
    <meta name="description" content="<?php echo $description?>" />
<link href="<?php bloginfo( 'stylesheet_url' ); ?>" rel="stylesheet" type="text/css" />
<?php if(is_home()) { ?>
    <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/myfocus-2.0.4.min.js"></script>
    <script type="text/javascript">
    //设置
    myFocus.set({
        id:'myFocus',//ID
        pattern:'mF_fancy'//风格
    });
    </script>
<?php } ?>
<?php if(is_page()) { ?>
     <script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/js/jquery.min.js" ></script>
     <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/guidang.js"></script>
<?php } ?>
<?php if(is_single()) { ?>
    <script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/js/jquery.min.js" ></script>
    <script type="text/javascript" src="<?php bloginfo('template_directory'); ?>/js/pirobox.min.js"></script>
    <script type="text/javascript">
    $(document).ready(function() {
    $().piroBox({
    my_speed: 400, //animation speed
    bg_alpha: 0.3, //background opacity
    slideShow : true, // true == slideshow on, false == slideshow off
    slideSpeed : 4, //slideshow duration in seconds(3 to 6 Recommended)
    close_all : '.piro_close,.piro_overlay'// add class .piro_overlay(with comma)if you want overlay click close piroBox
    });
    });
    </script>
<?php } ?>
</head>
    <body>  	
    	<div id="header_top">
    		<div id="header">
    			<h1><a href="<?php bloginfo('url'); ?>"><?php bloginfo('name'); ?></a></h1>
    			<div id="nav">
	    			<ul>
	    				 <?php wp_nav_menu('container_id=navmenu'); ?>
	    			</ul>
    			</div>
    			<div id="search">
                    <form name="formsearch" method="get" action="<?php bloginfo('home'); ?>">
        				<input type="text" id="go" name="s" class="search-keyword" style="background-color: #000000;
                            padding-left: 10px; font-size: 12px; font-family: 'Microsoft Yahei'; color: #999999;
                            height: 29px; width: 160px; border: solid 1px #666666; line-height: 28px;" maxlength="10" onblur="if (this.value == '') {this.value = '搜索你感兴趣的文章';}" onfocus="if (this.value == '搜索你感兴趣的文章') {this.value = '';}" value="搜索你感兴趣的文章">
                         <input id="sub" type="submit" value="" />  
                    </form>                  
    			</div>
    			<div id="login">
    				<img style="vertical-align: top; margin-top: 3px;" src="<?php bloginfo('template_directory'); ?>/images/account-avatar.png" />
    				<a href="<?php bloginfo('url'); ?>/wp-admin">登录</a>
    			</div>
    		</div>
    	</div>