<!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" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<meta name="keywords" content="{echo: $header['keywords'];/}" />
<meta name="description" content="{echo: $header['description'];/}" />
<base href="{echo: $baseUrl;/}" />
<link href="skin/{echo: $SYSINFO['templates'];/}/css/import.css" type="text/css" rel="stylesheet" />
<link href="skin/{echo: $SYSINFO['templates'];/}/css/index.css" rel="stylesheet" type="text/css" />
<link href="skin/{echo: $SYSINFO['templates'];/}/css/parts.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="skin/{echo: $SYSINFO['templates'];/}/js/changeStyle.js"></script>

<title>{echo: $header['title'];/}</title>
</head>
<body>
<!-- wrapper -->
<div id="wrapper">
  <!-- header -->
  {inc: include("shop/index_header.php");/}
  <!-- /header -->
  <!-- contents -->
  <div id="contents" class="clearfix" >
<div id="sub_channel">
    <ul class="clearfix">
      <li >
        <h3><img onmouseover="show_obj('category_box')" onmouseout="hidden_obj('category_box')" src="skin/{echo: $SYSINFO['templates'];/}/images/part/ttl_channel_all.gif" alt="{echo:lp{i_all_category2};/}"  onerror="this.src='skin/default/images/nopic.gif'"/></h3>
      </li>
      {sta:foreach($sub_category as $value)[loop]}
      <li><a href="{echo:$value['url'];/}">{echo:$value['cat_name'];/}</a></li>
      {end:foreach/}
    </ul>
    </div>
	    <div id="category_box" class="allMerchan" style="display:none" onmouseover="show_obj(this)"  onmouseout="hidden_obj(this)">
        <ul >
        {sta: foreach(array_slice ($CATEGORY[0], 0) as $key=>$cat)[loop]}
        	<li class="clearfix">
            <h3><a href="{echo: category_url($cat['cat_id']);/}" title="{echo: $cat['cat_name'];/}">{echo: $cat['cat_name'];/}</a></h3>
            {sta:if(isset($CATEGORY[$cat['cat_id']]) && $CATEGORY[$cat['cat_id']])[exc]}
            <p>
                {sta: foreach(array_slice ($CATEGORY[$cat['cat_id']], 0, 8) as $subcat)[loop]}
                    <a href="{echo: category_url($subcat['cat_id']);/}" title="{echo: $cat['cat_name'];/}">{echo: $subcat['cat_name'];/}</a>|
                {end:foreach/}
             </p>
             {end:if/}
            </li>
		{end:foreach/}
        </ul>
    </div>
    <!-- leftColumn -->
    <div id="leftColumn">
      <div class="SubCategoryBox mg12b">
        <h3>{echo:$this_catinfo['cat_name'];/}-{echo:lp{i_shop_filter};/}</h3>
        <ul>
          <li><span>{echo:lp{i_brand};/}：</span>
          	{sta:foreach($brand_list as $value)[loop]}
          		{sta:if(!empty($value['brand_name'])) [exc]}
          		{sta:if($brand_id==$value['brand_id']) [exc]}
	                <a class="active" >{echo: $value['brand_name'];/}</a>
	            {sta:}else[exc]}
	                <a title="{echo: $value['brand_name'];/}" href="{echo:$value['url'];/}">{echo: $value['brand_name'];/}</a>
	            {end:if/}
	            {end:if/}
          	{end:foreach/}
          </li>
          <!--<li> <span>价格：</span> <a class="active" href="">全部</a> <a href="">1-999</a> <a href="">999-4500</a> <a href="">4500-9999</a> <a href="">10000以上</a> </li>-->
          {sta: foreach($attr_info as $key => $value)[loop]}
		    <li>
		        <span>{echo: $value['attr_name'];/}:</span>
	                {sta:if(get_args('attr'.$value['attr_id'])) [exc]}
	                    <a href={echo:preg_replace("/&attr".$value['attr_id']."=([^&]+)/","",$url_this);/}>{echo:lp{i_all};/}</a>
	                {sta:}else[exc]}
	                    <font class="active">{echo:lp{i_all};/}</font>
	                {end:if/}
		        {sta: foreach($value['attr_values'] as $k => $v)[loop]}
		            {sta:if(get_args('attr'.$value['attr_id'])) [exc]}
		            {sta:$url = preg_replace("/attr".$value['attr_id']."=([^&]+)/","attr".$value['attr_id']."=".urlencode($v),$url_this);/}
		            {sta:}else [exc]}
		            {sta:$url = $url_this."&attr".$value['attr_id']."=".urlencode($v);/}
		            {end:if/}
		            {sta:if(get_args('attr'.$value['attr_id'])==$v) [exc]}
		                <a class="active" >{echo: $v;/}</a>
		            {sta:}else[exc]}
		                <a title="{echo: $v;/}" href="{echo:$url;/}">{echo: $v;/}</a>
		            {end:if/}
	            {end:foreach/}
		    </li>
    	{end:foreach/}
        <li><span>{echo:lp{i_keywords};/}：</span>{echo:$kk;/}</li>
		</ul>
      </div>
      <div id="leftMian">
        <div class="top clearfix">
          <h3 class="ttlm_selitems">{echo:lp{i_choice_good};/}</h3>
          <ul class="toolbar">
            <a id="list" class="selected"  hidefocus="true" href="javascript:void(0);" onclick="changeStyle2('list',this)">{echo:lp{i_list};/}</a>
            <a id="window" hidefocus="true" href="javascript:void(0);" onclick="changeStyle2('window',this)">{echo:lp{i_show_window};/}</a>
          </ul>
        </div>
        <div id="listItems" class="c_m" style="{echo: $viewlist;/}; position:relative">
          <ul class="list_title clearfix">
            <li class="summary">{echo:lp{i_goods_infos};/}</li>
            <li class="price">{echo:lp{i_price};/}</li>
            <li class="address">{echo:lp{i_in_area};/}</li>
            <li class="operating">{echo:lp{i_handle};/}</li>
          </ul>
          <ul class="list_view">
         {sta:foreach($goods_list as $k=>$v)[loop]}
            <li id="showli_{echo:$v['goods_id'];/}" class="clearfix">
              <div class="photo"><a target="_blank" href="{echo: goods_url($v['goods_id']);/}"><img onmouseout="hidebox({echo:$v['goods_id'];/})" onmouseover="showbox({echo:$v['goods_id'];/})" src="{echo: $v['is_set_image'] ? $v['goods_thumb'] : 'skin/default/images/nopic.gif';/}"  width="{echo:$SYSINFO['width1'];/}" height="{echo:$SYSINFO['height1'];/}"  alt="{echo:$v['goods_name'];/}"  onerror="this.src='skin/default/images/nopic.gif'" /></a></div>
              <div class="smmery">
                <h4><a href="{echo: goods_url($v['goods_id']);/}">{echo: sub_str($v['goods_name'],40);/}</a></h4>
                <p class="des">[{echo:lp{i_description};/}]{echo: sub_str($v['goods_name'],30);/}</p>
                <p class="shopinfo">{echo:lp{i_shop};/}:<a class="seller" href="{echo: shop_url($v['shop_id']);/}">{echo: $v['shop_name'];/}</a> {echo: $v['rank_name'];/}</p>
              </div>
              <div class="price"> <em>{echo:lp{i_money_sign};/}{echo: $v['goods_price']=='0.00' ? $i_langpackage->i_price_discuss : $v['goods_price'];/}</em>
                <p class="ship">{echo:lp{i_freight};/}：{echo:$v['transport_price']>0?$v['transport_price']:$v['transport_template_price'];/}</p>
              </div>
              <div class="address">
                <p>{echo: $areainfo[$v['shop_province']];/}.{echo: $areainfo[$v['shop_city']];/}</p>
              </div>
              <div class="operating"> <a class="addfavorite" title="{echo:lp{i_collection};/}" href="javascript:addFavorite({echo: $v['goods_id'];/},{echo: $v['shop_id'];/},{echo:$USER['user_id']!=''?$USER['user_id']:'0';/});"></a> 
              {sta:if($v['goods_price']=='0.00') [exc]}
	               <a class="ask" title="{echo:lp{i_inquiry};/}" href="inquiry.php?gid={echo: $v['goods_id'];/}"></a>
	            {sta:}else[exc]}
	                <a class="itembuy" title="{echo:lp{i_buy};/}" href="modules.php?app=user_order_adress&gid={echo:$v['goods_id'];/}&v=1"></a>
	            {end:if/}
               <a class="compare" title="对比" href="javascript:;" onclick="initFloatTips('{echo:$v['goods_id'];/}','{echo:sub_str($v['goods_name'],10);/}',1,'{echo:$v['cat_id'];/}')"></a> </div>
              <div style="display: none;" id="showbox_{echo:$v['goods_id'];/}" class="showbox">
				<div class="subbox"><img id="showimg_{echo:$v['goods_id'];/}" src="{echo: $v['is_set_image'] ? $v['goods_thumb'] : 'skin/default/images/nopic.gif';/}" width="234" height="234" alt="{echo:lp{i_loading_img};/}"   onerror="this.src='skin/default/images/nopic.gif'"/></div>
			  </div>
            </li>
             {end:foreach/}
          </ul>
        </div>
        <!-- 橱窗 -->
			<div id="windowItems" class="window_type" style="{echo: $viewwindow;/}">
				<ul class="list_view">
					{sta:foreach($goods_list as $k=>$v)[loop]}
					<li id="showli_{echo:$v['goods_id'];/}" class="clearfix">
						<div class="photo"><a target="_blank" href="{echo: goods_url($v['goods_id']);/}"><img onmouseout="hidebox({echo:$v['goods_id'];/})" onmouseover="showbox({echo:$v['goods_id'];/})" src="{echo: $v['is_set_image'] ? str_replace('thumb_','',$v['goods_thumb']) : 'skin/default/images/nopic.gif';/}"  width="190" height="190"  alt="{echo:$v['goods_name'];/}"   onerror="this.src='skin/default/images/nopic.gif'"/></a></div>
						<div class="smmery">
							<h4><a href="{echo: goods_url($v['goods_id']);/}">{echo: sub_str($v['goods_name'],40);/}</a></h4>
							<p class="des">[{echo:lp{i_description};/}]{echo: sub_str($v['goods_name'],30);/}</p>
							<p class="shopinfo">{echo:lp{i_shop};/}：<a class="seller" href="{echo: shop_url($v['shop_id']);/}">{echo: $v['shop_name'];/}</a> {echo: $v['rank_name'];/}</p>
						</div>
						<div class="price"> <em>{echo:lp{i_money_sign};/}{echo: $v['goods_price']=='0.00' ? $i_langpackage->i_price_discuss : $v['goods_price'];/}</em>
							<p class="ship">{echo:lp{i_freight};/}：{echo:$v['transport_price']>0?$v['transport_price']:$v['transport_template_price'];/}</p>
						</div>
						<div class="address">
							<p>{echo: $areainfo[$v['shop_province']];/}.{echo: $areainfo[$v['shop_city']];/}</p>
						</div>
						<div class="operating">
							<ul class="clearfix">
								<li><a class="addfavorite" title="{echo:lp{i_collection};/}" href="javascript:addFavorite({echo: $v['goods_id'];/},{echo: $v['shop_id'];/},{echo:$USER['user_id']!=''?$USER['user_id']:'0';/});"></a></li>
								{sta:if($v['goods_price']=='0.00') [exc]}
					               <li><a class="ask" title="{echo:lp{i_inquiry};/}" href="inquiry.php?gid={echo: $v['goods_id'];/}"></a></li>
					            {sta:}else[exc]}
					                <li><a class="itembuy" title="{echo:lp{i_buy};/}" href="modules.php?app=user_order_adress&gid={echo:$v['goods_id'];/}&v=1"></a></li>
					            {end:if/}
								<li><a class="compare" title="{echo:lp{i_contrast};/}" href="javascript:;" onclick="initFloatTips('{echo:$v['goods_id'];/}','{echo:sub_str($v['goods_name'],10);/}',1,'{echo:$v['cat_id'];/}')"></a></li>
							</ul>
						</div>
						<div style="display: none;" id="showbox_{echo:$v['goods_id'];/}" class="showbox">
							<div class="subbox"><img id="showimg_{echo:$v['goods_id'];/}" src="{echo: $v['is_set_image'] ? $v['goods_thumb'] : 'skin/default/images/nopic.gif';/}" width="234" height="234" alt="{echo:lp{i_loading_img};/}"   onerror="this.src='skin/default/images/nopic.gif'"/></div>
						</div>
					</li>
					{end:foreach/}
				</ul>
				<!-- 橱窗 -->
			</div>
        <div class="clearfix"></div>
        <div class="pagenav clearfix">
        	{sta:if($result['countpage']>0)[exc]}
        	{inc: include("modules/page.php");/}
            {sta: } else [exc]}
            {echo:lp{i_no_product};/}！
            {end:if/}
          </div>
      </div>
      <!-- leftColumn -->
    </div>
    <!-- rightColumn -->
    <div id="rightColumn">
    <div class="tagSet bg_gary mg12b">
        <h3 class="ttlm_hottag">{echo:lp{i_hot_label};/}</h3>
        <div class="tags">
        	{sta:foreach($tag_list as $value)[loop]}
        	<a href="{echo:$value['url'];/}" style="color:{echo:$value['tag_color'];/};{sta:if($value['is_blod'])[exc]}font-weight:bold;{end:if/}">{echo:$value['tag_name'];/}</a>
        	{end:foreach/}
		</div>
      </div>
       <div class="hotgoods bg_gary mg12b">
        <h3 class="ttlm_hotgoods">{echo:lp{i_goods_commend};/}</h3>
        <ul>
        {sta:foreach($goods_hot as $key => $v)[loop]}
        	<li {sta:if($key%2!=0)[loop]} class="doublenum"{end:if/}>
	         	 <p class="photo"><a href="{echo: goods_url($v['goods_id']);/}" target="_blank"><img src="{echo: $v['is_set_image'] ? $v['goods_thumb'] : 'skin/default/images/nopic.gif';/}" alt="" width="58" height="58"  onerror="this.src='skin/default/images/nopic.gif'"/></a></p>
	           <h4><a href="{echo: goods_url($v['goods_id']);/}" target="_blank">{echo: sub_str($v['goods_name'],38);/}</a></h4>
	           <p class="price">{echo:lp{i_money_sign};/}{echo:$v['goods_price'];/}</p>
	         </li>
         {end:foreach/}
        </ul>
        </div>
        <div class="viewrecord bg_gary mg12b">
        <h3 class="ttlm_viewrecord">{echo:lp{i_brower_register};/}</h3>
        <ul class="clearfix">
        {sta:foreach($goodshistory as $k=> $v)[loop]}
	    	<li {sta:if($k%2!=0)[exc]}class="lst"{end:if/}>
	         	<p class="photo"><a href="{echo: goods_url($v['goods_id']);/}" target="_blank"><img src="{echo: $v['is_set_image'] ? $v['goods_thumb'] : 'skin/default/images/nopic.gif';/}" alt="" width="58" height="58"  onerror="this.src='skin/default/images/nopic.gif'"/></a></p>
	          	<p class="price">{echo:lp{i_money_sign};/}{echo:$v['goods_price'];/}</p>
	       </li>
         {end:foreach/}
        </ul>
        </div>
    <!-- /rightColumn -->
    </div>
    <!-- /contents -->
</div>
  <!-- footer -->
 {inc: require("shop/index_footer.php");/}
    <!-- /footer -->
  </div>
  <!-- /wrapper -->
</div>
</body>
<div id="contrastbox" style="z-index:999;position:absolute;right:0;border:1px solid #ccc; background:#FFF; display:none; width:188px;">
	<form action="modules.php?app=contrast" method="post" target="_blank" id="contrastform">
		<input type="hidden" name="contrast_goods_num" id="contrast_goods_num" value="0" />
		<input type="hidden" name="contrast_goods_id" id="contrast_goods_id" value="" />
		<input type="hidden" name="contrast_cid" id="contrast_cid" value="" />
		<input type="hidden" name="contrast_goods_name" id="contrast_goods_name" value="" />
		<div style="padding-bottom:12px;">
  <h2 style="padding:6px 10px;display:block;background:url(skin/default/images/ttlm_01_bg.gif) repeat-x left top;font-size:14px;font-weight:bolder;color:#F77A07;border-bottom:1px solid #ccc">{echo:lp{i_contract_goods};/}</h2> <a onclick="clearItems()" style="float:right; position:relative; top:-23px;right:10px" href="javascript:void(0);">{echo:lp{i_close};/}</a>
  <div id="contrast_goods_name_show"></div>
  </div>
		<!--<input type="submit" name="sub" value="对比" /> -->
        <a onclick="document.getElementById('contrastform').submit();return false;" href="javascript:;" class="button_4" style=" position:relative;top:25px;display:block;margin-left:100px; width:76px;height:24px;"><img src="skin/default/images/icon_contrast.gif" alt="{echo:lp{i_start_compare};/}"   onerror="this.src='skin/default/images/nopic.gif'"/></a>
	</form>
</div>
<script language="JavaScript" src="servtools/ajax_client/ajax.js"></script>
<script language="JavaScript">
function clearItems(){
	document.getElementById('contrast_goods_id').value ="";
	document.getElementById('contrast_goods_name').value="";
	document.getElementById("contrastbox").style.display='none';
	document.getElementById("contrast_goods_name_show").innerHTML='';
	document.getElementById('contrast_cid').value = '';
}
function delNow(linkitem){
	linkitem.parentNode.parentNode.removeChild(linkitem.parentNode);
	}
function showbox(id) {
	document.getElementById("showbox_"+id).style.display = '';
	var showimg = document.getElementById("showimg_"+id);
	if(showimg.alt=='{echo:lp{i_loading_img};/}') {
		ajax("do.php?act=goods_get_imgurl","POST","id="+id,function(data){
			if(data) {
				showimg.src = data;
				showimg.alt = '';
			}
		});
	}
}
function hidebox(id) {
	document.getElementById("showbox_"+id).style.display = 'none';
}
function addFavorite(id,sid,uid) {
	if(uid=='0'){
		alert("{echo: lp{i_g_addfailed};/}");
		return;
		}
	if (sid == uid){
		alert('{echo:lp{i_mygoods_error};/}');
	}else {
		ajax("do.php?act=goods_add_favorite","POST","id="+id,function(data){
			if(data == 1) {
				alert("{echo: lp{i_g_addedfavorite};/}");
			} else if(data == -1) {
				alert("{echo: lp{i_g_stayfavorite};/}");
			} else {
				alert("{echo: lp{i_g_addfailed};/}");
			}
		});
	}
}
</script>
<script language="JavaScript" type="text/javascript">
var tips; var theTop = 145/*这是默认高度,越大越往下*/;
var old = theTop;
function initFloatTips(goodsid,goodsname,action,cid) {
	tips = document.getElementById('contrastbox');
	document.getElementById('contrastbox').style.display="";
	var goods_cid = document.getElementById('contrast_cid').value;
	if(goods_cid!=''&& goods_cid!=cid&&action==1){
		alert("{echo:lp{i_compare_error1};/}");
		return;
	}else{
		document.getElementById('contrast_cid').value=cid;
	}
	var goods_num = parseInt(document.getElementById('contrast_goods_num').value);
	var goods_id = document.getElementById('contrast_goods_id').value;
	var goods_name= document.getElementById('contrast_goods_name').value;
	var goods_name_show= document.getElementById('contrast_goods_name_show');
	var goods_id_arr = goods_id.split(",");
	var goods_name_arr = goods_name.split(",");
	if(action==1){
		if(goods_num<5){
			var same_num=0;
			for(i=0;i<goods_id_arr.length;i++){
				if(goods_id_arr[i]==goodsid){
					same_num++;
				}
			}
			if(same_num>0){
				alert("{echo:lp{i_compare_error2};/}");
			}else{
				document.getElementById('contrast_goods_id').value+=goodsid+",";
				document.getElementById('contrast_goods_name').value+=goodsname+",";
				document.getElementById('contrast_goods_num').value=parseInt(goods_num+1);
			}
		}else{
			alert("{echo:lp{i_compare_error3};/}");
		}
	}
	if(action==0){
		var str="";
		var namestr="";
		for(i=0;i<goods_id_arr.length;i++){
			if(goods_id_arr[i]!=goodsid&&goods_id_arr[i]!=''){
				str+=goods_id_arr[i]+",";
				namestr+=goods_name_arr[i]+",";
			}
		}
		document.getElementById('contrast_goods_id').value=str;
		document.getElementById('contrast_goods_name').value=namestr;
	}

	var goods_id_arr = document.getElementById('contrast_goods_id').value.split(",");
	var goods_name_arr = document.getElementById('contrast_goods_name').value.split(",");
	goods_name_show.innerHTML="";
	for(i=0;i<goods_id_arr.length-1;i++){
		goods_name_show.innerHTML+="<li style='padding:8px 0 5px 10px; _padding:8px 0 5px;position:relative;border-bottom:1px solid #f1f1f1;margin-right:10px'>"+"<a href='javascript:;' style='position:absolute;right:0;_right:10px;top:8px;' onclick=\"initFloatTips('"+goods_id_arr[i]+"','"+goods_name_arr[i]+"',0)\">{echo:lp{i_remove};/}</a>" + goods_name_arr[i]+"</li>";
	}
	document.getElementById('contrast_goods_num').value=goods_id_arr.length-1;
	if(document.getElementById('contrast_goods_num').value==0){
		document.getElementById('contrastbox').style.display="none";
		document.getElementById('contrast_cid').value="";
	}
	moveTips();
}
function moveTips() {
	var tt=55;
	if (window.innerHeight) {
		pos = window.pageYOffset
	}else if (document.documentElement && document.documentElement.scrollTop) {
		pos = document.documentElement.scrollTop
	}else if (document.body) {
		pos = document.body.scrollTop;
	}
	pos=pos-tips.offsetTop+theTop;
	pos=tips.offsetTop+pos/10;
	if (pos < theTop) {
		pos = theTop
	}
	if (pos != old) {
		tips.style.top = pos+"px";
		tt=10;
	}
	old = pos;
	setTimeout(moveTips,tt);
}
</script>
</html>
