<?php 
	require_once 'admin/include/config.php';
	define("THIS_PAGE","index");
	if(!$hm_arr = get_seo(1)){
		$hm_title = $hm_key = $hm_des = hmcss_default_config(1);
	}
	else{
		$hm_title = $hm_arr[0][2];
		$hm_key = $hm_arr[0][3];
		$hm_des = $hm_arr[0][4];
	}
	if(!$hm_arr = get_config("com_intro"))
		$hm_intro = hmcss_default_config(2);
	else
		$hm_intro = $hm_arr[0][2];
	$filter[0] = array("2",1,false);
	$filter[1] = array("1","0,10",false);
	if(!$hm_arr_news = get_news($filter)){
		$hm_arr_news[0] = hmcss_default_config(3);
	}
	$config_arr = get_config("com_intro_pic");
	$intro_pic = trim($config_arr[0][2]) ? "upload_file/images/" . trim($config_arr[0][2]) : "upload_file/images/jj_pic.gif";
?>
<!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 $hm_title; ?></title>
<meta name="description" content="<?php echo $hm_des; ?>" />
<meta name="keywords" content="<?php echo $hm_key; ?>" />

<style type="text/css">
#flash_div{height:250px; width:1000px;}
#flash_left{width:600px; float:left;}
#flash_right{width:380px; margin:5px auto; margin-left:20px !important; height:240px; float:left;} 
	#flash_right ul{margin:0px; padding:0px; list-style:none;}
	#flash_right li{height:23px; line-height:23px; display:block; width:380px; border-bottom:1px #CCC solid; float:left;}
	#flash_right li a{color:#666; text-decoration:none;}
	#flash_right li a:hover{color:#F30; text-decoration:underline;}
.new_arr1{display:block; width:10px; height:10px; background-color:#FE8998; float:left; margin-top:10px; margin-right:10px;}
.new_arr2{display:block; width:10px; height:10px; background-color:#CCC; float:left; margin-top:10px; margin-right:10px;}
#qy_jj{margin-top:10px; padding:5px; width:988px; border:1px #CCC solid; height:auto; line-height:22px; word-wrap:break-word; 

overflow:hidden;}
#jj_pic{margin-right:5px; margin-bottom:5px; float:left;}
</style>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>

<body>
<?php require_once("top.php"); ?>
<div class="now_position"><span class="position_str">当前位置：首页</span><span class="im_notice">
<marquee direction="left" scrolldelay="100" onmouseout="this.start()" onmouseover="this.stop()" style="width:400px;">
<?php hmcss_notice(); ?>
</marquee></span></div>
<div id="flash_div">
	<div id="flash_left">
    	<object id="bcastr4" data="bcastr4.swf?xml=bcastr.xml" type="application/x-shockwave-flash" width="600" height="250">
        <param name="movie" value="bcastr4.swf?xml=bcastr.xml" />
</object>
    </div>
    <div id="flash_right">
    	<ul>
        <?php
        	foreach($hm_arr_news as $key => $val){
				$time_arr = explode(" ",$val[4]);
				if($key < 3)
					echo "<li><span class=\"new_arr1\"></span><span class=\"news_title\" title=\"$val[1]\"><a href=\"news.php?news_id=$val[0]\" target=\"_blank\">$val[1]</a></span><span class=\"news_time\">[$time_arr[0]]</span></li>";
				else
					echo "<li><span class=\"new_arr2\"></span><span class=\"news_title\" title=\"$val[1]\"><a href=\"news.php?news_id=$val[0]\" target=\"_blank\">$val[1]</a></span><span class=\"news_time\">[$time_arr[0]]</span></li>";
			}
			for($i=1; $i < (10-$key); $i++)
				echo "<li></li>";
		?>
        </ul>
    </div>
</div>
<!--热门产品开始-->
    <div class="hotSP">
      <div class="hotSPlist">
      <script type="text/javascript" src="include/product_gd.js"></script>
      <script type="text/javascript">
	  var marqueeContent1=new Array(); //滚动公告
<?php
	unset($filter);
	$filter[0] = array();
	if(!$hm_arr = get_product($filter))
		echo "marqueeContent1[0] = \"\";";
	else{
		//$rows = ceil(count($hm_arr)/4);
		$i = 0;
		$k = 1;
		$str = "";
		foreach($hm_arr as $key => $val){
			if($k ==5){
				$k = 1;
				echo "marqueeContent1[$i] = '" . $str . "';\n\r";
				$i++;
				$str = "";
				//if($i >= $rows)
					//break;
			}
			$val[7] = trim($val[7]) ? $val[7] : "1.gif";
			$str .="<li title=\"$val[3]\"><a href=\"product_show.php?p_id=$val[0]\" target=\"_blank\"><img src=\"product/small/$val[7]\" border=\"0\" /><span class=\"gd_span\">$val[3]</span></a></li>";
			$k++;
		}
		for($j = 0; $j <= 5-$k ; $j++)
			$str .="<li></li>";
		echo "marqueeContent1[$i] = '" . $str . "';\n\r";
	}
?>
	  initMarquee1();</script>
      <div class="clear"></div>
      </div>
    </div>
<!--热门产品结束-->
<div id="qy_jj">
	<?php echo "<img src=\"$intro_pic\" id=\"jj_pic\" />",$hm_intro; ?>
</div>
<div id="foot"><?php unset($hm_arr,$filter,$hm_arr_news,$config_arr); hmcss_foot(); ?></div>
</body>
</html>