<!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">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title><?php echo $head_title; ?></title>
  <?php echo $heads; ?>
  <?php echo $styles; ?>
  <?php echo $scripts; ?>
</head>
<body class="sidebar-left">
	<div id="wrapper"><div class="<?php echo $args_id;?>">
		<div id="header">
      <div class="menu"><?php echo $menu; ?></div>
			<div class="searchbox"><?php $box = dd_get_form('front_search_form');echo $box;?></div>
      <a href="<?php echo $base_path?>" title="回到 <?php echo $site_global->name; ?> 首页" class="logo" alt="<?php echo $site_global->name; ?>">
        <img src="<?php echo $site_global->logo; ?>" />
      </a>
    </div>
		<div id="banner">
														<div id="play">
														 <div id="play_bg"></div>
														 <div id="play_text">
															<ul>
															<?php $data = ggad_list();if($data){$i = 0;foreach($data as $val){$i++;?>
															 <li><?php echo $i;?></li>
															<?php }};?>
															</ul>
														 </div>
														 <div id="play_list">
														<?php $data = ggad_list();if($data){$i = 0;foreach($data as $val){$i++;?>
														 <a href="#" target="_blank">
															<img src="<?php echo get_litpic($val,'1002x300');?>" title="banner" alt="banner" /> </a>
														<?php }};?>
														 </div>
														</div>			
		</div>
		<div id="main"> 
		 <div id="content">
				<div id="center">
				  <?php echo $breadcrumb; ?>
					<div class="contop">
					  <?php if ($contop) : ?>
							<?php echo $contop; ?>
						<?php endif;?>
					</div>
					<div class="column">
            <?php echo $tabs; ?>
            <?php echo $sub_tabs; ?>
            <?php echo $messages; ?>
            <?php echo $help; ?>
            <?php echo $content; ?>
					</div>
				</div>
				<?php if ($right) : ?>
					<div id="sidebar-right" class="sidebar">
						<div class="column">
							<?php echo $right; ?>
						</div>
					</div>
				<?php endif; ?>
			</div>
			
				<div id="sidebar-left" class="sidebar">
					<div class="column">
					  <?php include 'left.tpl.php';?>
						<?php $lianxi = block_box_load(2);?>
						<div class="block block_module_block" id="block_block_boxes_<?php echo $lianxi->bid;?>"> 
									<h3 class="block_title"><?php echo $lianxi->title;?></h3> 
								<div class="block_content"> 
									<?php echo $lianxi->body;?>
								</div> 
						</div> 
						<?php echo $leftbottom;?>
					</div>
				</div>
		</div>
		<div id="footer"><div id="foottop"><?php $dibu = block_box_load(3);echo $dibu->body;?><?php echo $bottom;?></div><?php echo $site_global->footer; ?><?php echo $footer; ?><?php echo $debug; ?></div>
	</div></div>
	<?php echo $closure; ?>
	<!--这段是轮播的主要实现JS可以提取为一个外部Js文件-->
<script type="text/javascript">
var t = n = 0, count = $("#play_list a").size();
$(function(){
 $("#play_list a:not(:first-child)").hide();
 $("#play_info").html($("#play_list a:first-child").find("img").attr('alt'));
 $("#play_text li:first-child").css({"background":"#fff",'color':'#000'});
 $("#play_info").click(function(){window.open($("#play_list a:first-child").attr('href'), "_blank")});
 $("#play_text li").click(function() {
  var i = $(this).text() - 1;
  n = i;
  if (i >= count) return;
  $("#play_info").html($("#play_list a").eq(i).find("img").attr('alt'));
  $("#play_info").unbind().click(function(){window.open($("#play_list a").eq(i).attr('href'), "_blank")})
  $("#play_list a").filter(":visible").fadeOut(500).parent().children().eq(i).fadeIn(1000);
  $(this).css({"background":"#fff",'color':'#000'}).siblings().css({"background":"#000",'color':'#fff'});
 });
 t = setInterval("showAuto()", 5000);
 $("#play").hover(function(){clearInterval(t)}, function(){t = setInterval("showAuto()", 3000);});
})
function showAuto()
{
 n = n >= (count - 1) ? 0 : ++n;
 $("#play_text li").eq(n).trigger('click');
}
</script>
</body>
</html>