<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');?>
<!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 $site_title;?></Title>
<?php if(isset($page_keyword)&&$page_keyword!=''){?>
<meta Name="keywords"  Content="<?php echo $page_keyword;?>"/>
<?php }else{?>
<meta Name="keywords"  Content="<?php echo $this->config->item("sys_site_keyword");?>"/>
<?php }?>
<?php if(isset($page_description)&&$page_description!=''){?>
<meta name="description" content="<?php echo $page_description;?>"/>
<?php }else{?>
<meta name="description" content="<?php echo $this->config->item("sys_site_description");?>"/>
<?php }?>
<script language="javascript">window.onerror = function(){return true;}</script>
<link rel="stylesheet" type="text/css" href="{tpl_path}style/style.css" />
<link rel="stylesheet" type="text/css" href="{tpl_path}style/common.css" />
<script type="text/javascript" src="{root_path}js/jquery/jquery.js"></script>
<script type="text/javascript" src="{tpl_path}js/function.js"></script>
<script type="text/javascript" src="{root_path}js/validator.js"></script>
<script language="javascript">
var onerror_pic_path="{tpl_path}images/common/none.gif";
var pic_loading_path="{tpl_path}images/common/loading.gif";
var js_root_path="<?php echo site_url('/');?>";
var d_width = 0;
function get_tb_catalog(s)
{
	if( ! s) return;
	$.ajax({
		 type: "POST",
		 url: js_root_path+"<?php echo CTL_FOLDER;?>shop/get_catalog",
		 data: "stype="+s,
		 dataType:'json',
		 success: function(msg){
			$('#cid').empty();
			$('<option value="">选择行业类目</option>').appendTo('#cid');	
			$.each(msg,function(k,v){
				$('<option value="'+k+'">'+v+'</option>').appendTo('#cid');			
			});
		 }
	});
}
</script>
</head>

<body>
<div class=top>
  <div class=topc>
    <div class=topl><a href="javascript:void(0)" onclick="SetHome(this,'<?php echo base_url();?>')"><img src="{tpl_path}images/top_ioc_index.gif" align="absmiddle" alt="设为主页"> 设为主页</a> <a title="加入收藏" href="javascript:void(0);" onclick="AddFavorite('<?php echo base_url();?>','<?php echo $this->config->item("sys_site_name");?>')"> <img src="{tpl_path}images/favorite.gif" align=absmiddle alt="收藏本站"> 收藏本站</a> </div>
    <div class=topr><a href="<?php echo site_url(CTL_FOLDER.'shop/sitemap');?>" title="商品分类">商品分类</a>-
      <?php 
	$i = 1;
	foreach($cat_url as $row){?>
      <a href="<?php echo $row['url'];?>" target="_blank" title="<?php echo $row['title'];?>"<?php if($row['title_color']) {?> style="color:<?php echo $row['title_color'];?>"<?php }?>><?php echo $row['title'];?></a>-
      <?php 
	if($i >= 15) break;
	$i++;
	}?>
    </div>
  </div>
</div>
<div class=toplogo>
  <div class=logo>
    <div class=logof><a href="<?php echo base_url();?>"><img alt="<?php echo $this->config->item('sys_site_name');?>" src="<?php echo get_real_path($this->config->item('sys_site_logo'));?>" /></a></div>
  </div>
  <div class=search>
    <div class=search_form>
      <form name="tb_search_form" action="<?php echo site_url(CTL_FOLDER.'search');?>">
          <div class=search_form_l>
            <select name="stype" id="stype" onChange="get_tb_catalog(this.value)">
              <option value="goods">搜索商品</option>
              <option value="shop">搜索店铺</option>
            </select>
            <input type="text" name="keyword" class="ui-tx-input" style="width:200px" maxlength="50" />
            <select name="cid" id="cid" style="width:210px">
            <option value="">选择行业类目</option>
              <?php foreach($industry_catalog as $v){?>
              <option value="<?php echo $v['cid'];?>"><?php echo $v['cat_name'];?></option>
              <?php }?>
            </select>
            <img style="margin-left:5px;cursor:pointer" src="{tpl_path}images/top_search_submit.gif" id="sub_btn" align="absmiddle" />
            </div>
      </form>
      <div class=search_hot>
        <ul>
          <li><b>热门搜索：</b> </li>
          <?php 
		  $i = 1;
		  foreach($hot_keyword as $row){?>
          <li><a href="<?php echo site_url(CTL_FOLDER.'search');?>?keyword=<?php echo urlencode($row['sword']);?>&cid=<?php echo $row['cid'];?>" title="<?php echo $row['sword'];?>"<?php if($row['title_color']) {?> style="color:<?php echo $row['title_color'];?>"<?php }?>><?php echo $row['title'];?></a></li>
          <?php 
		  if($i >= 15) break;
		  $i++;
		  }?>
        </ul>
      </div>
    </div>
  </div>
</div>
<div id="mall-nav">
  <div class="con">
    <ul class="main">
      <li><a href="<?php echo base_url();?>" style="border-left:none" >首页</a></li>
      <?php 
		  $i = 1;
		  foreach($top_nav as $row){?>
      <li id="cid=<?php echo $row['cid'];?>"><a href="<?php echo site_url(CTL_FOLDER.'search');?>?cid=<?php echo $row['cid'];?>" title="<?php echo $row['title'];?>"><?php echo $row['title'];?></a></li>
      <?php 
		  if($i >= 11) break;
		  $i++;
		  }?>
    </ul>
  </div>
</div>
