<?php
/*
----------------------------------------------------------------------------------------
Public function

创建产品分类菜单标签 
	1)纵向竖排主菜单  $s_pro_cate
	2)侧面竖排产品菜单—-鼠标悬停展开$s_pro_cate
	3)大类横向，中小类下拉产品菜单 $pro_cate
	4)主题图标产品菜单 $icon_main_pro_cate


创建主菜单标签变量 
	1)横向主菜单 $menu
	2)纵向竖排主菜单 $menu
	
创建分类新闻单标签变量 $ls_newsdongtai

首页热点产品展示标签变量 $ls_hotpro

获得标签变量：底部信息 $ls_designby，$ls_title，$ls_keywords，$ls_description，$foot

菜单生成文件图片和样式
	1) 引导图片  大类引导图cate.gif， 中类引导图midcate.gif，小类引导图subcate.gif
	2) 侧面竖排产品菜单样式  大类菜单样式cate_list，  中类菜单样式midcate_list，  小类菜单样式subcate_list
	3) 大类横向，中小类下拉产品菜单 大类样式1 menu2(变换颜色样式menu1)和menu22 (变换颜色样式menu12)

----------------------------------------------------------------------------------------
*/
	$opendb=new mydb();
	require_once('char_set.php');
	require_once('constant.php');
	require_once('ls_syscode.php');

	$tem_sql="select * from ls_config order by ID";
	$tem_query=$opendb->query($tem_sql);
	$row=mysql_fetch_array($tem_query);
	$templates_var = $row['templates'];
	//echo $templates_var;

switch($proCateStytle){
	
case "Popup Expanded Vertical":

	
case "Full Expanded Vertical":

//==================================================
//		 1) 侧面竖排产品菜单 $s_pro_cate
//==================================================

	$pro_cate_sql="select * from ls_products where midcateName is null and subcateName is null and subcateFolders is null and subcateBrief is null and subcateID is null and productPic is null and productItemNo is null and productName is null and productSpecification is null and productID is null and enable=1 order by Num asc";
	$pro_cate_query=$opendb->query($pro_cate_sql);
	//$s_pro_cate="\n <div class=\"cate_list\">\n"; //大类菜单样式，div css:cate_list
	$pro_num=mysql_num_rows($pro_cate_query);
	
	$s_pro_cate="<ul class=\"protit dropdown-menu\">";
	$x = $pro_num;
	$y = 0;
	while($pro_cate_rows=mysql_fetch_assoc($pro_cate_query))
	{
	  $y++;
	  $pro_midcate_sql="select * from ls_products where productID=".$pro_cate_rows['ID']." order by Num asc";
	  
	  $pro_midcate_query=$opendb->query($pro_midcate_sql);
	  $pro_midcate_num=mysql_num_rows($pro_midcate_query);
	  
	  if($pro_midcate_num==0)//大类
	  {
		//$s_pro_cate.="&nbsp;<img src='../Templates/images/cate.gif' border='0'> \n";
		//$s_pro_cate.="\n<dt>".$pro_cate_rows['cateName']."</dt>";
		if($pro_cate_rows['addNewProLink'] == 1){
		  $pro_id_sql="select * from ls_products where productID = ".$pro_cate_rows['ID']." order by Num asc";
		  $pro_id_query=$opendb->query($pro_id_sql);
		  $pro_id_rows=mysql_fetch_assoc($pro_id_query);

		  $s_pro_cate.="<li><a href='../".$pro_cate_rows['cateFolders']."/".$showproductsFolders."/".substr($pro_id_rows['productPic'], 0, (strlen($pro_id_rows['productPic']) - 4)).".html'><span class=\"glyphicon glyphicon-play\"></span> ".$pro_cate_rows['cateName']."</a></li>";
		}else{
		  $s_pro_cate.="<li><a href='../".$pro_cate_rows['cateFolders']."/".$pro_cate_rows['cateFolders'].".html'><span class=\"glyphicon glyphicon-play\"></span> ".$pro_cate_rows['cateName']."</a></li>";
		}
		// $s_pro_cate.="\n <div class=\"cate_list\">\n"; //大类菜单样式，div css:cate_list
	  } 
	  else//大类中类
	  {
		//$s_pro_cate.="&nbsp;<img src='../Templates/".$templates_var."/images/cate.gif' border='0'> \n";  //大类引导图
		$detailsfile="../".$pro_cate_rows['cateFolders']."/".$pro_cate_rows['cateFolders'].".html";
		$detailsfile2="../".$templates_var."1/catedetail.html";
		if(file_exists($detailsfile2))
		{$s_pro_cate.="\n<li><a href='".$detailsfile."'><span class=\"glyphicon glyphicon-play\"></span> ".$pro_cate_rows['cateName']."</a><ul class=\"list-unstyled\" >";
		}else{
			$s_pro_cate.="\n<li><a href='../".$pro_cate_rows['cateFolders']."/".$pro_cate_rows['cateFolders'].".html'><span class=\"glyphicon glyphicon-play\"></span> ".$pro_cate_rows['cateName']."</a><ul class=\"list-unstyled\" id=\"content".$pro_cate_rows['ID']."\" >";
		}
		
		//？ 不应该有$s_pro_cate.="\n <div class=\"cate_list\">\n";
		while($pro_midcate_rows=mysql_fetch_assoc($pro_midcate_query))
		{
			$s_pro_cate.="\n<li><a href='../".$pro_cate_rows['cateFolders']."/".pathProName($pro_midcate_rows['productName'])."-".$pro_midcate_rows['ID'].".html' ><span class=\"glyphicon glyphicon-name\"></span> ".$pro_midcate_rows['productItemNo']."</a></li>";
		}
		$s_pro_cate.="</ul>";
	  }//if($pro_midcate_num==0)//dalei
	
	}
	$s_pro_cate.="\n </ul>";
	//echo $s_pro_cate;
	$s_cate=str_replace("../","",$s_pro_cate);//cate
	$s_pro2_cate=str_replace("../","../../",$s_pro_cate);//pro2_cate
	$s_pro3_cate=str_replace("../","../../../",$s_pro_cate);//pro3_cate
	$s_pro4_cate=str_replace("../","../../../../",$s_pro_cate);//pro4_cate

	//echo $s_pro_cate;

//侧面竖排产品菜单end
	break;

case "Hover Expended Vertical":

//======================================================
//	  2)侧面竖排产品菜单—-鼠标悬停展开$s_pro_cate
//======================================================

	$s_pro_cate="";
	$pro_cate_sql="select * from ls_products where midcateName is null and subcateName is null and subcateFolders is null and subcateBrief is null and subcateID is null and productPic is null and productItemNo is null and productName is null and productSpecification is null and productID is null and enable=1 order by Num asc";
	$pro_cate_query=$opendb->query($pro_cate_sql);
	$pro_cate_num=mysql_num_rows($pro_cate_query);
	$j=1;
	//$s_pro_cate="\n <div class=\"cate_list\">\n";
	$s_pro_cate.="\n";
	
	while($pro_cate_rows=mysql_fetch_assoc($pro_cate_query))
	{
	  $pro_midcate_sql="select * from ls_products where cateName is null and subcateName is null and subcateFolders is null and subcateBrief is null and subcateID is null and productPic is null and productItemNo is null and productName is null and productSpecification is null and productID is null and enable=1 and midcateID=".$pro_cate_rows['ID']." order by Num asc";
	  $pro_midcate_query=$opendb->query($pro_midcate_sql);
	  $pro_midcate_num=mysql_num_rows($pro_midcate_query);
	  
	  if($pro_midcate_num==0)//大类
	  {
		//$s_pro_cate.="&nbsp;<img src='../Templates/".$templates_var."/images/cate.gif' border='0'> \n";	//大类前导图

		$s_pro_cate.="<li><a href='../".$pro_cate_rows['cateFolders']."/".$pro_cate_rows['cateFolders'].".html' >  \n".$pro_cate_rows['cateName']."</a></li>";	//大类菜单链接
		//$s_pro_cate.="\n <div class=\"cate_list\">\n";
	  }
	  else//大类中类
	  {
		$detailsfile="../".$pro_cate_rows['cateFolders']."/indexdetails.html";
		if(file_exists($detailsfile)){
			$a_links="\"../".$pro_cate_rows['cateFolders']."/indexdetails.html\"";
		}else{
			$a_links="\"javascript:void(0);\"";
		}
		//$s_pro_cate.="&nbsp;<img src='../Templates/".$templates_var."/images/cate.gif' border='0'> \n";		//大类前导图
			if($j == 1){
				$s_pro_cate.="\n<div class=\"dtClass\" ><a href=".$a_links.">".$pro_cate_rows['cateName']."&nbsp;</a>\n</div>";	//大类菜单链接
			}else{
				$s_pro_cate.="\n<div class=\"dtClass\" ><a href=".$a_links.">".$pro_cate_rows['cateName']."&nbsp;</a>\n</div>";	//大类菜单链接
			}
		
		//$s_pro_cate.="\n <div class=\"cate_list\">\n";
		$num_i = 0;
		while($pro_midcate_rows=mysql_fetch_assoc($pro_midcate_query))	//中类获取
		{
			$num_i ++;
			$pro_subcate_sql="select * from ls_products where midcateName is null and cateName is null and cateFolders is null and catePagePic is null and catePagePicWidth is null and catePagePicHeight is null and cateBrief is null and productPic is null and productItemNo is null and productName is null and productSpecification is null and productID is null and enable=1 and subcateID=".$pro_midcate_rows['ID']." order by Num asc";
			$pro_subcate_query=$opendb->query($pro_subcate_sql);
			$pro_subcate_num=mysql_num_rows($pro_subcate_query); 

			//$s_pro_cate.="<div class=\"catelist\">";
			if($pro_subcate_num==0)//没小类
			{
				if($num_i == $pro_midcate_num){
					$className = "ddClass_footer_no";
					$last = 10;
				}else{
					$className = "ddClass_no";
					$last = 11;
				}
			//$s_pro_cate.="    		    <img src='../Templates/".$templates_var."/images/midcate.gif' border='0'> \n";	//无小类的中类前导图
			$s_pro_cate.="\n<div class=\"".$className."\"><a href='../".$pro_cate_rows['cateFolders']."/".$pro_midcate_rows['midcateFolders']."/".$pro_midcate_rows['midcateFolders'].".html' >\n".$pro_midcate_rows['midcateName']."</a>\n</div>\n";	//中类菜单链接
			}
			else//有小类
			{
				if($num_i == $pro_midcate_num){
					$className = "ddClass_footer_last";
					$last = 10;
				}else{
					$className = "ddClass";
					$last = 11;
				}
				$detailsfile="../".$pro_cate_rows['cateFolders']."/".$pro_midcate_rows['midcateName']."/indexdetails.html";
				if(file_exists($detailsfile)){
					$a_sublinks="\"../".rawurlencode($pro_cate_rows['cateFolders'])."/".rawurlencode($pro_midcate_rows['midcateFolders'])."/indexdetails.html\"";
				}else{
					$a_sublinks="\"javascript:void(0);\"";
				}
				
			//$s_pro_cate.="    		    <img src='../Templates/".$templates_var."/images/midcate.gif' border='0'> \n";	//有小类的中类前导图
			$s_pro_cate.="\n<div class=\"".$className."\"><a href=".$a_sublinks.">".$pro_midcate_rows['midcateName']."</a></div>\n";
			}
			
			$num_ii = 0;
			$pro_subcate_num=mysql_num_rows($pro_subcate_query);
			while($pro_subcate_rows=mysql_fetch_assoc($pro_subcate_query))
			{
				$num_ii ++;
				
				if($num_ii == $pro_subcate_num){
					if($last == 10){
						$subclassName = "liClass_footer_last_no";
					}else{
						$subclassName = "liClass_footer_no";
					}
				}else{
					if($last == 10){
						$subclassName = "liClass_last";
					}else{
						$subclassName = "liClass";
					}

				}
				//$s_pro_cate.="    		    <img src='../Templates/".$templates_var."/images/subcate.gif' border='0' >&nbsp; \n";	//小类前导图
				$s_pro_cate.="<div class=\"".$subclassName."\"><a href=\"../".$pro_cate_rows['cateFolders']."/".$pro_midcate_rows['midcateFolders']."/".$pro_subcate_rows['subcateFolders']."/".$pro_subcate_rows['subcateFolders'].".html\" >".$pro_subcate_rows['subcateName']."</a><br></div>\n";	//小类菜单链接
			 }
		} 
		$j++;
		$s_pro_cate.="";
	  }//if($pro_midcate_num==0)//dalei
	//$s_pro_cate.="</div>\n ";
	}

	$s_cate=str_replace("../","",$s_pro_cate);//cate
	$s_pro2_cate=str_replace("../","../../",$s_pro_cate);//pro2_cate
	$s_pro3_cate=str_replace("../","../../../",$s_pro_cate);//pro3_cate
	$s_pro4_cate=str_replace("../","../../../../",$s_pro_cate);//pro4_cate

//侧面竖排产品菜单—-鼠标悬停展开 end

	break;


case "Hover Drawer Horizontal":

//==================================================
//	  3) 大类横向，中小类下拉产品菜单 $pro_cate
//==================================================

	$pro_cate_sql="select * from ls_products where midcateName is null and subcateName is null and subcateFolders is null and subcateBrief is null and subcateID is null and productPic is null and productItemNo is null and productName is null and productSpecification is null and productID is null and enable=1 order by Num asc";
	$pro_cate_query=$opendb->query($pro_cate_sql);
	$cateclass="2";
	$pro_cate.="\n		<ul>";
	while($pro_cate_rows=mysql_fetch_assoc($pro_cate_query))
	{
	  if($cateclass=="2")
	 	 {$cateclass="";}
	  else
	 	 {$cateclass="2";}
	  
	  $pro_midcate_sql="select * from ls_products where cateName is null and subcateName is null and subcateFolders is null and subcateBrief is null and subcateID is null and productPic is null and productItemNo is null and productName is null and productSpecification is null and productID is null and enable=1 and midcateID=".$pro_cate_rows['ID']." order by Num asc";
	  $pro_midcate_query=$opendb->query($pro_midcate_sql);
	  $pro_midcate_num=mysql_num_rows($pro_midcate_query);
	  
	  if($pro_midcate_num==0)//大类
	  {
		$pro_cate.="	 				<li class=\"menu2".$cateclass."\" onMouseOver=\"this.className='menu1".$cateclass."'\" onMouseOut=\"this.className='menu2".$cateclass."'\"> \n <a class=\"cate_menu\" href='../".rawurlencode($pro_cate_rows['cateFolders'])."/index.html' > \n".$CateMenuPrefix.$pro_cate_rows['cateName']."</a><br/>";		//仅大类菜单项，li css:menu2; a css:cate_menu
		$pro_cate.="\n	 				<div class=\"cate_list\">\n";
	  }
	  else//大类中类
	  {
		$pro_cate.="	 				<li class=\"menu2".$cateclass."\" onMouseOver=\"this.className='menu1".$cateclass."'\" onMouseOut=\"this.className='menu2".$cateclass."'\"> \n <a class=\"cate_menu\" href='../search.php?cateid=".$pro_cate_rows['ID']."&catename=".$pro_cate_rows['cateName']."&brief=".substr($pro_cate_rows['cateBrief'],0,$CateLength)."' > \n".$CateMenuPrefix.$pro_cate_rows['cateName']."</a><br/>";		//含中类大类菜单项， li css:menu2; a css:cate_menu
		$pro_cate.="\n	 				<div class=\"cate_list\">\n";
		while($pro_midcate_rows=mysql_fetch_assoc($pro_midcate_query))
		{
			$pro_subcate_sql="select * from ls_products where midcateName is null and cateName is null and cateFolders is null and catePagePic is null and catePagePicWidth is null and catePagePicHeight is null and cateBrief is null and productPic is null and productItemNo is null and productName is null and productSpecification is null and productID is null and enable=1 and subcateID=".$pro_midcate_rows['ID']." order by Num asc";
			$pro_subcate_query=$opendb->query($pro_subcate_sql);
			$pro_subcate_num=mysql_num_rows($pro_subcate_query); 
		
			if($pro_subcate_num==0)//没小类
			{
			//$pro_cate.="&nbsp;<img src='../Templates/".$templates_var."/images/cate.gif' border='0'> \n";	//中类前导图，下无小类
			$pro_cate.="	 				<a class=\"cate_menu".$cateclass."\" href='../".rawurlencode($pro_cate_rows['cateFolders'])."/".rawurlencode($pro_midcate_rows['midcateFolders'])."/index.html' >\n".$midCateMenuPrefix.$pro_midcate_rows['midcateName']."</a><br>\n";	//中类菜单项，css：cate_menu2
			}
			else//有小类
			{
			//$pro_cate.="&nbsp;<img src='../Templates/".$templates_var."/images/cate2.gif' border='0'> \n";	//中类前导图，下有小类
			$pro_cate.="	 				<a class=\"cate_menu".$cateclass."\" href='../search.php?cateid=".$pro_cate_rows['ID']."&midcatename=".$pro_midcate_rows['midcateName']."&midcateid=".$pro_midcate_rows['ID']."&brief=".substr($pro_midcate_rows['midcateBrief'],0,$CateLength)."' >\n".$midCateMenuPrefix.$pro_midcate_rows['midcateName']."</a><br>\n";	//中类菜单项，css：cate_menu2
			}
		
			while($pro_subcate_rows=mysql_fetch_assoc($pro_subcate_query))
			 {
				//$pro_cate.="&nbsp;<img src='../Templates/".$templates_var."/images/subcate.gif' border='0' > \n";	//小类前导图
				$pro_cate.="	 				<a class=\"cate_menu".$cateclass."\" href=\"../".rawurlencode($pro_cate_rows['cateFolders'])."/".rawurlencode($pro_midcate_rows['midcateFolders'])."/".rawurlencode($pro_subcate_rows['subcateFolders'])."/index.html\" >\n ".$SubCateMenuPrefix.$pro_subcate_rows['subcateName']."</a><br>\n";	//小类菜单项，css：cate_menu2
			 }
		} 
	  }//if($pro_midcate_num==0)//dalei
	$pro_cate.="	 			</div>\n </li>\n";
	}
	$pro_cate.="		</ul>\n ";
		
	$cate=str_replace("../","",$pro_cate);//cate
	$pro2_cate=str_replace("../","../../",$pro_cate);//pro2_cate
	$pro3_cate=str_replace("../","../../../",$pro_cate);//pro3_cate
	$pro4_cate=str_replace("../","../../../../",$pro_cate);//pro4_cate


//大类横向，中小类下拉产品菜单 End
	break;

case "Icon List":

//==================================================
//	  4)主题图标产品菜单 $icon_main_pro_cate
//==================================================

	$pro_cate_sql="select * from ls_products where midcateName is null and subcateName is null and subcateFolders is null and subcateBrief is null and subcateID is null and productPic is null and productItemNo is null and productName is null and productSpecification is null and productID is null and enable=1 order by Num asc";
	$pro_cate_query=$opendb->query($pro_cate_sql);
	//$icon_main_pro_cate="\n <div class=\"cate_list\">\n";
	$icon_main_pro_cate.="\n		<ul class=\"smenu\">";
	while($pro_cate_rows=mysql_fetch_assoc($pro_cate_query))
	{
	  $pro_midcate_sql="select * from ls_products where cateName is null and subcateName is null and subcateFolders is null and subcateBrief is null and subcateID is null and productPic is null and productItemNo is null and productName is null and productSpecification is null and productID is null and enable=1 and midcateID=".$pro_cate_rows['ID']." order by Num asc";
	  $pro_midcate_query=$opendb->query($pro_midcate_sql);
	  $pro_midcate_num=mysql_num_rows($pro_midcate_query);
	  
	  if($pro_midcate_num==0)//大类
	  {
		//$icon_main_pro_cate.="<a class=\"scatemenu\" href='../search.php?cateid=".$pro_cate_rows['ID']."&catename=".$pro_cate_rows['cateName']."&brief=".substr($pro_cate_rows['cateBrief'],0,$CateLength)."' > \n<img src='../".$pro_cate_rows['cateFolders']."/".$pro_cate_rows['cateIconPic']."' border='0'></a><br/> \n";	//无中类大类菜单项图片链接，css：scatemenu
		$icon_main_pro_cate.="	 				<a href='../".$pro_cate_rows['cateFolders']."/index.html' > \n".$pro_cate_rows['cateName']."</a><br/><br/></li>\n";	//大类文字链接，css：smenu
		//$icon_main_pro_cate.="\n <div class=\"cate_list\">\n";
	  }
	  else//大类中类
	  {
		//$icon_main_pro_cate.="<a class=\"scatemenu\" href='../search.php?cateid=".$pro_cate_rows['ID']."&catename=".$pro_cate_rows['cateName']."&brief=".substr($pro_cate_rows['cateBrief'],0,$CateLength)."' > \n <img src='../".$pro_cate_rows['cateFolders']."/".$pro_cate_rows['cateIconPic']."' border='0'></a><br/>  \n";		//带中类大类菜单项图片链接，css：scatemenu
		//$icon_main_pro_cate.=" <a class=\"scatemenu\" href='../search.php?cateid=".$pro_cate_rows['ID']."&catename=".$pro_cate_rows['cateName']."&brief=".substr($pro_cate_rows['cateBrief'],0,$CateLength)."' > \n".$pro_cate_rows['cateName']."</a><br/><br/>";		//大类简要介绍，css：scatemenu
		//$icon_main_pro_cate.="\n <div class=\"cate_list\">\n";
		while($pro_midcate_rows=mysql_fetch_assoc($pro_midcate_query))
		{
			$pro_subcate_sql="select * from ls_products where midcateName is null and cateName is null and cateFolders is null and catePagePic is null and catePagePicWidth is null and catePagePicHeight is null and cateBrief is null and productPic is null and productItemNo is null and productName is null and productSpecification is null and productID is null and enable=1 and subcateID=".$pro_midcate_rows['ID']." order by Num asc";
			$pro_subcate_query=$opendb->query($pro_subcate_sql);
			$pro_subcate_num=mysql_num_rows($pro_subcate_query); 

			//$icon_main_pro_cate.="<div class=\"catelist\">";
	
			if($pro_subcate_num==0)//没小类
			{
			$icon_main_pro_cate.="	 				<img src='../Templates/".$templates_var."/images/midcate.gif' border='0'> \n";		//无小类中类前导图
			$icon_main_pro_cate.="	 				<a href='../".$pro_cate_rows['cateFolders']."/".$pro_midcate_rows['midcateFolders']."/index.html' >\n".$pro_midcate_rows['midcateName']."</a><br>\n";	//无小类中类菜单链接
			}
			else//有小类
			{
			$icon_main_pro_cate.="	 				<img src='../Templates/".$templates_var."/images/midcate.gif' border='0'> \n";		//有小类中类前导图
			$icon_main_pro_cate.="	 				<a class=\"ssubcatemenu\" href='../search.php?cateid=".$pro_cate_rows['ID']."&midcatename=".$pro_midcate_rows['midcateName']."&midcateid=".$pro_midcate_rows['ID']."&brief=".substr($pro_midcate_rows['midcateBrief'],0,$CateLength)."' >\n".$pro_midcate_rows['midcateName']."</a><br>\n";		//有小类中类菜单链接，css：subcatemenu
			}
		
			while($pro_subcate_rows=mysql_fetch_assoc($pro_subcate_query))
			 {
				$icon_main_pro_cate.="	 				;<img src='../Templates/".$templates_var."/images/subcate.gif' border='0' >&nbsp; \n";		//小类前导图
				$icon_main_pro_cate.="	 				<a class=\"ssubcatemenu\" href=\"../".$pro_cate_rows['cateFolders']."/".$pro_midcate_rows['midcateFolders']."/".$pro_subcate_rows['subcateFolders']."/index.html\" >\n".$pro_subcate_rows['subcateName']."</a><br>\n";		//小类文字链接，css：ssubcatemenu
			 }
		} 
	  }//if($pro_midcate_num==0)//dalei
	//$icon_main_pro_cate.="</div>\n ";
	}
	$icon_main_pro_cate.="		</ul>\n ";
	//echo $icon_main_pro_cate;
	$icon_main_cate=str_replace("../","",$icon_main_pro_cate);//cate
	$icon_main_pro2_cate=str_replace("../","../../",$icon_main_pro_cate);//pro2_cate
	$icon_main_pro3_cate=str_replace("../","../../../",$icon_main_pro_cate);//pro3_cate
	$icon_main_pro4_cate=str_replace("../","../../../../",$icon_main_pro_cate);//pro4_cate

	//echo $icon_main_pro_cate;
	//主体图标产品菜单end
	break;

}

switch($mainMenuStyle)
{
	case "Horizontal":

//==================================================
//		  横向主菜单 $menu
//==================================================

	$menu_pro_h_sql="select * from ls_menu where enable=1 order by menuNum asc";
	$menu_pro_h_query=$opendb->query($menu_pro_h_sql);
	$menu_pro_h="";
	$i=1;
	while ($menu_pro_h_rows=mysql_fetch_assoc($menu_pro_h_query))
	{
	  if($i==1)
	  {
	  	$menu_pro_h.="	 				<a href=\"../".$menu_pro_h_rows['menuLink']."\">".$menu_pro_h_rows['menuName']."</a>";		//菜单链接第一项
	  }
	  else
	  {	
		$menu_pro_h.=$mainMenuSpliter."	 				<a href=\"../".$menu_pro_h_rows['menuLink']."\">".$menu_pro_h_rows['menuName']."</a>";		//菜单链接第二项与其后项
	  }	
	  $i++;
	}
	$menu_pro=$menu_pro_h;
	
//横排主菜单 end  
	break;
	
	case "Vertical":
	

//==================================================
//		  纵向竖排主菜单 $menu
//==================================================

	$cate_start_sql="select * from ls_products where cateName!='' order by Num asc";
	$cate_start_query=$opendb->query($cate_start_sql);	
	$cate_start_rows=mysql_fetch_assoc($cate_start_query);
	$cate_start_num=mysql_num_rows($cate_start_query);

	$midcate_start_sql="select * from ls_products where midcateName!='' order by Num asc";
	$midcate_start_query=$opendb->query($midcate_start_sql);	
	$midcate_start_rows=mysql_fetch_assoc($midcate_start_query);
	$midcate_start_num=mysql_num_rows($midcate_start_query);

	$subcate_start_sql="select * from ls_products where subcateName!='' order by Num asc";
	$subcate_start_query=$opendb->query($subcate_start_sql);	
	$subcate_start_rows=mysql_fetch_assoc($subcate_start_query);
	$subcate_start_num=mysql_num_rows($subcate_start_query);

	if($cate_start_num==0)
	{
		die("没有产品类别，请先设置产品类别！");
	}else{
		if($cate_start_rows['ID']!=$midcate_start_rows['midcateID'])
		{$product_link="../".$cate_start_rows['cateFolders']."/index.html";}
		else
		{
			if($midcate_start_rows['ID']!=$subcate_start_rows['subcateID'])
			{$product_link="../".$cate_start_rows['cateFolders']."/".$midcate_start_rows['midcateFolders']."/index.html";}		//中类下产品列表页链接
			else
			{
				$product_link="../".$cate_start_rows['cateFolders']."/".$midcate_start_rows['midcateFolders']."/".$subcate_start_rows['subcateFolders']."/index.html";
			}		//小类下产品列表页链接
		}
	
	}
	//end $product_link;
	
	$menu_pro_sql="select * from ls_menu where enable=1 order by menuNum asc";
	$menu_pro_query=$opendb->query($menu_pro_sql);
	$i=1;
	$menu_pro="\n		<ul>";
	while ($menu_pro_rows=mysql_fetch_assoc($menu_pro_query))
	{
	  if($i==1)
	  {
	  	
	  		$menu_pro.="\n	 				<li> <a  href=\"../".$menu_pro_rows['menuLink']."\">".$menu_pro_rows['menuName']."</a></li><br/>";		//菜单项首项
	  }
	  else
	  {	
	  	if($menu_pro_rows['menuLink']=="products.html")
	  	{
	  		$menu_pro.="\n	 				<li><a href=\"".$product_link."\">".$menu_pro_rows['menuName']."</a></li><br/>";		//菜单项为产品列表页面链接项
	  	}
	  	else
	  	{
			$menu_pro.="\n	 				<li><a  href=\"../".$menu_pro_rows['menuLink']."\">".$menu_pro_rows['menuName']."</a></li><br/>";		//菜单项为非产品类别页面链接项
	  	}
	  }	
	  $i++;
	}

	//echo $menu_pro;
	$menu_pro.="\n		</ul>";



	$menu=str_replace("../","",$menu_pro);//menu
	$menu_pro2=str_replace("../","../../",$menu_pro);//menu2_cate
	$menu_pro3=str_replace("../","../../../",$menu_pro);//menu3_cate
	$menu_pro4=str_replace("../","../../../../",$menu_pro);//menu4_cate
	//echo $menu_pro;

//纵向竖排主菜单 end

	break;
}


$p_cate_sql="select * from ls_products where midcateName is null and subcateName is null and subcateFolders is null and subcateBrief is null and subcateID is null and productPic is null and productItemNo is null and productName is null and productSpecification is null and productID is null and enable=1 order by Num asc";
	$p_cate_query=$opendb->query($p_cate_sql);
	//$s_p_cate="\n <div class=\"cate_list\">\n"; //大类菜单样式，div css:cate_list
	$p_num=mysql_num_rows($p_cate_query);
	
	$s_p_cate="<ul class=\"list-group\">";
	$x = $p_num;
	$y = 0;
	while($p_cate_rows=mysql_fetch_assoc($p_cate_query))
	{
	  $y++;
	  $p_midcate_sql="select * from ls_products where productID=".$p_cate_rows['ID']." order by Num asc";
	  $p_midcate_query=$opendb->query($p_midcate_sql);
	  $p_midcate_num=mysql_num_rows($p_midcate_query);
	  
	  if($p_midcate_num==0)//大类
	  {
		//$s_p_cate.="&nbsp;<img src='../Templates/images/cate.gif' border='0'> \n";
		//$s_p_cate.="\n<dt>".$p_cate_rows['cateName']."</dt>";
		if($p_cate_rows['addNewProLink'] == 1){
		  $p_id_sql="select * from ls_products where productID = ".$p_cate_rows['ID']." order by Num asc";
		  $p_id_query=$opendb->query($p_id_sql);
		  $p_id_rows=mysql_fetch_assoc($p_id_query);

		  $s_p_cate.="<li class=\"list-group-item side-pro-list-item\"><a href='../".$p_cate_rows['cateFolders']."/".$showproductsFolders."/".substr($p_id_rows['productPic'], 0, (strlen($p_id_rows['productPic']) - 4)).".html'> ".$p_cate_rows['cateName']."</a></li>";
		}else{
		  $s_p_cate.="<li class=\"list-group-item side-pro-list-item\"><a href='../".$p_cate_rows['cateFolders']."/".$p_cate_rows['cateFolders'].".html'> ".$p_cate_rows['cateName']."</a></li>";
		}
		// $s_p_cate.="\n <div class=\"cate_list\">\n"; //大类菜单样式，div css:cate_list
	  } 
	  else//大类中类
	  {
		//$s_p_cate.="&nbsp;<img src='../Templates/".$templates_var."/images/cate.gif' border='0'> \n";  //大类引导图
		$detailsfile="../".$p_cate_rows['cateFolders']."/".$p_cate_rows['cateFolders'].".html";
		$detailsfile2="../".$templates_var."1/catedetail.html";
		if(file_exists($detailsfile2))
		{$s_p_cate.="\n<li class=\"list-group-item side-pro-list-item\"><a href='".$detailsfile."'> ".$p_cate_rows['cateName']."</a><ul>";}
		else
		{
			$s_p_cate.="\n<li class=\"list-group-item side-pro-list-item\"><a href='../".$p_cate_rows['cateFolders']."/".$p_cate_rows['cateFolders'].".html'> ".$p_cate_rows['cateName']."</a><ul class=\"list-unstyled\" id=\"content".$p_cate_rows['ID']."\" >";
		}
		
		while($p_midcate_rows=mysql_fetch_assoc($p_midcate_query))
		{
			$s_p_cate.="\n<li><a href='../".$p_cate_rows['cateFolders']."/".pathProName($p_midcate_rows['productName'])."-".$p_midcate_rows['ID'].".html' > ".$p_midcate_rows['productItemNo']."</a></li>";
		}
		$s_p_cate.="</ul>";
	  }//if($p_midcate_num==0)//dalei
	
	}
	$s_p_cate.="\n </ul>";
	//echo $s_p_cate;
	$s_p0_cate = $s_p_cate;
	$s_p1_cate=str_replace("../","",$s_p_cate);//cate
	$s_p2_cate=str_replace("../","../../",$s_p_cate);//pro2_cate
	$s_p3_cate=str_replace("../","../../../",$s_p_cate);//pro3_cate
	$s_p4_cate=str_replace("../","../../../../",$s_p_cate);//pro4_cate


//==================================================
//	   新闻列表 动态新闻 $ls_newsdongtai 等
//==================================================

$news_cate_sql2="select * from `ls_functioncates` where functionName='新闻分类' and enable=1 order by Num asc ";
//$opendb->query("SET character_set_client = gb2312");
//$opendb->query("SET character_set_results = gb2312");
//$opendb->query("SET character_set_connection = gb2312");

$result_cate_pub=$opendb->query($news_cate_sql2);
$num_cate_pub=mysql_num_rows($result_cate_pub);
$i_news_pub=1;

while(true)//遍历所有分类
{
	  if($num_cate_pub==0)
	  {
		 $hotLines=8;
		 $hotWords=16;

		 $news_sql2_pub="select * from ls_news where enable=1 order by Num,newsDate desc limit 0,".$hotLines."  ";
		 $suffix_str="_all";
	  }
	  else
	  {
		 $catenews_pub = mysql_fetch_assoc($result_cate_pub);
		 $hotLines=$catenews_pub['hotLines'];
		 $hotWords=$catenews_pub['hotWords'];

		 $news_sql2_pub="select * from ls_news where enable=1 and cate='".$catenews_pub['cateName']."' order by Num,newsDate desc limit 0,".$hotLines." ";
 		 $suffix_str=$catenews_pub['suffStr'];
	  }

	$news_query_sql2=$opendb->query($news_sql2_pub);
	$news_="<ul>";

	$i=1;
	while($news_rows_pub=mysql_fetch_assoc($news_query_sql2))
	{
		$news_.="<li> <a href=\"../".$newsshowFolders."/news".$suffix_str.$news_rows_pub['ID'].".html\">".substr($news_rows_pub['newsTitle'],0,$hotWords)."  (".substr($news_rows_pub['newsDate'],-5).")</a>";		//新闻分类链接

		$news_.="</li>";
//		if($i==$news_Num)
//		{
//		$news_.="<div align=\"right\"><a href=\"news_.php\">more..</a></div>";
//		}
		
		$i++;
	}
	$news_.="</ul>";

	$news_2=$news_;					// 子目录下新闻菜单
	$news_=str_replace("../","",$news_2);  //根目录下新闻菜单
	$news_3=str_replace("../","../../",$news_2);  //2级子目录下新闻菜单
	$news_4=str_replace("../","../../../",$news_2);  //3级子目录下新闻菜单

	switch($suffix_str)
	{
		case "_dongtai":
		$ls_newsdongtai=$news_;				//globle News动态
		$ls_newsdongtai2=$news_2;				//globle News动态
		$ls_newsdongtai3=$news_3;				//globle News动态
		$ls_newsdongtai4=$news_4;				//globle News动态

		break;
		case "_gonggao":
		$ls_newsgonggao=$news_;				//globle News公告
		$ls_newsgonggao2=$news_2;	
		$ls_newsgonggao3=$news_3;	
		$ls_newsgonggao4=$news_4;	
		break;

		case "_tieshi":
		$ls_newstieshi=$news_;				//globle News贴士
		$ls_newstieshi2=$news_2;
		$ls_newstieshi3=$news_3;
		$ls_newstieshi4=$news_4;
		break;

		case "_all":
		$ls_newsall=$news_;				//globle News全部
		$ls_newsall2=$news_2;
		$ls_newsall3=$news_3;
		$ls_newsall4=$news_4;
		break;
	}	
//	echo $suffix_str."<br/>".$news_;
	
		if($num_cate_pub==0 || $i_news_pub==$num_cate_pub)		//没有新闻分类 循环一遍退出， 如有新闻分类 循环所有分类
		{break;}
		else
		{
			$i_news_pub++;
		}
		
}
	
//新闻列表 End	


//======================================================
//	  2)手机产品分类—$p_pro_cate
//======================================================

	$pro_cate_sql="select * from ls_products where midcateName is null and subcateName is null and subcateFolders is null and subcateBrief is null and subcateID is null and productPic is null and productItemNo is null and productName is null and productSpecification is null and productID is null and enable=1 order by Num asc";
	$pro_cate_query=$opendb->query($pro_cate_sql);
	//$ls_m_cate="\n <div class=\"cate_list\">\n"; //大类菜单样式，div css:cate_list
	$ls_m_cate = "<div class=\"tab-hd\">";
	$i1=0;
	while($pro_cate_rows2=mysql_fetch_assoc($pro_cate_query)){
		$i1++;
		$pro_midcate_sql="select * from ls_products where cateName is null and subcateName is null and subcateFolders is null and subcateBrief is null and subcateID is null and productPic is null and productItemNo is null and productName is null and productSpecification is null and productID is null and enable=1 and midcateID=".$pro_cate_rows2['ID']." order by Num asc";
	  $pro_midcate_query=$opendb->query($pro_midcate_sql);
	  $pro_midcate_num=mysql_num_rows($pro_midcate_query);
		if($i1==1){
			if($pro_midcate_num==0){//大类
				$ls_m_cate.="<span  class=\"tab-hd-con\" id=\"green\"><a href='../".$mobi_path.$pro_cate_rows2['cateFolders']."/index.html'>".$pro_cate_rows2['cateName']."</a></span>";
			}else{//大类中类
				$detailsfile="../".$pro_cate_rows2['cateFolders']."/indexdetails.html";
				if(file_exists($detailsfile)){
					$ls_m_cate.="\n<span  class=\"tab-hd-con\" id=\"green\"><a href='javascript:void(0)'>".$pro_cate_rows2['cateName']."</a></span>";
				}else{
					$ls_m_cate.="\n<span  class=\"tab-hd-con\" id=\"green\"><a href='javascript:void(0)'>".$pro_cate_rows2['cateName']."</a></span>";
				}
			}
		}elseif($i1==2){
			if($pro_midcate_num==0){//大类
				$ls_m_cate.="<span  class=\"tab-hd-con\" id=\"orange\"><a href='../".$mobi_path.$pro_cate_rows2['cateFolders']."/index.html'>".$pro_cate_rows2['cateName']."</a></span>";
			}else{//大类中类
				$detailsfile="../".$pro_cate_rows2['cateFolders']."/indexdetails.html";
				if(file_exists($detailsfile)){
					$ls_m_cate.="\n<span  class=\"tab-hd-con\" id=\"orange\"><a href='javascript:void(0)'>".$pro_cate_rows2['cateName']."</a></span>";
				}else{
					$ls_m_cate.="\n<span  class=\"tab-hd-con\" id=\"orange\"><a href='javascript:void(0)'>".$pro_cate_rows2['cateName']."</a></span>";
				}
			}
		}else{
			if($pro_midcate_num==0){//大类
				$ls_m_cate.="<span  class=\"tab-hd-con\" id=\"blue\"><a href='../".$mobi_path.$pro_cate_rows2['cateFolders']."/index.html'>".$pro_cate_rows2['cateName']."</a></span>";
			}else{//大类中类
				$detailsfile="../".$pro_cate_rows2['cateFolders']."/indexdetails.html";
				if(file_exists($detailsfile)){
					$ls_m_cate.="\n<span  class=\"tab-hd-con\" id=\"blue\"><a href='javascript:void(0)'>".$pro_cate_rows2['cateName']."</a></span>";
				}else{
					$ls_m_cate.="\n<span  class=\"tab-hd-con\" id=\"blue\"><a href='javascript:void(0)'>".$pro_cate_rows2['cateName']."</a></span>";
				}
			}	
		}
	}
	$ls_m_cate.="</div>
	<div class=\"tab-bd dom-display\">";
	$pro_cate_query2=$opendb->query($pro_cate_sql);
	$ii = 0;
	while($pro_cate_rows=mysql_fetch_assoc($pro_cate_query2))
	{
	  $ii++;
	  $pro_midcate_sql="select * from ls_products where cateName is null and subcateName is null and subcateFolders is null and subcateBrief is null and subcateID is null and productPic is null and productItemNo is null and productName is null and productSpecification is null and productID is null and enable=1 and midcateID=".$pro_cate_rows['ID']." order by Num asc";
	  $pro_midcate_query=$opendb->query($pro_midcate_sql);
	  $pro_midcate_num=mysql_num_rows($pro_midcate_query);
	  
	  if($pro_midcate_num!=0)//大类
	  {
		if($ii == 1){
			$ls_m_cate.="<div class=\"tab-bd-con current\">
                <div class=\"p_center\">
                    <ul>";
		}else{
			$ls_m_cate.="<div class=\"tab-bd-con\">
                <div class=\"p_center\">
                    <ul>";
		}
		
		while($pro_midcate_rows=mysql_fetch_assoc($pro_midcate_query))
		{
			$pro_subcate_sql="select * from ls_products where midcateName is null and cateName is null and cateFolders is null and catePagePic is null and catePagePicWidth is null and catePagePicHeight is null and cateBrief is null and productPic is null and productItemNo is null and productName is null and productSpecification is null and productID is null and enable=1 and subcateID=".$pro_midcate_rows['ID']." order by Num asc";
			$pro_subcate_query=$opendb->query($pro_subcate_sql);
			$pro_subcate_num=mysql_num_rows($pro_subcate_query); 
	
			if($pro_subcate_num==0)//没小类
			{
				//$ls_m_cate.="&nbsp;<img src='../Templates/".$templates_var."/images/midcate.gif' border='0'> \n";  //中类引导图
				$ls_m_cate.="\n<li><a href='../".$mobi_path.$pro_cate_rows['cateFolders']."/".$pro_midcate_rows['midcateFolders']."/index.html' >".$pro_midcate_rows['midcateName']."</a></li>";
			}
			else//有小类
			{
			//$ls_m_cate.="&nbsp;<img src='../Templates/".$templates_var."/images/midcate.gif' border='0'> \n"; //中类引导图
			$detailsfile="../".$mobi_path.$pro_cate_rows['cateFolders']."/".$pro_midcate_rows['midcateName']."/indexdetails.html";
			if(file_exists($detailsfile))
			{$ls_m_cate.="<a href='".$detailsfile."'>".$pro_midcate_rows['midcateName']."</a>";}
			else
			{$ls_m_cate.="\n<li> <a href='javascript:void(0)'>".$pro_midcate_rows['midcateName']."</a><ul>\n";}
			//$ls_m_cate.="<div class=\"subcate_list\">";//小类菜单样式
			while($pro_subcate_rows=mysql_fetch_assoc($pro_subcate_query))		//小类生成
			 {
				$ls_m_cate.="<li><a href=\"../".$mobi_path.$pro_cate_rows['cateFolders']."/".$pro_midcate_rows['midcateFolders']."/".$pro_subcate_rows['subcateFolders']."/index.html\" >".$pro_subcate_rows['subcateName']."</a></li>\n";
			 }
			$ls_m_cate.="</ul></li>\n"; 
			} 
		}
		$ls_m_cate.="</ul>
                </div>
          </div>";
	  }//if($pro_midcate_num==0)//dalei
	}
	$ls_m_cate.="</div>";
	
	$m_cate=str_replace("../","",$ls_m_cate);//cate
	$p_m_cate=str_replace("../","../",$ls_m_cate);//pro2_cate
	$p_m_cate1=str_replace("../","../../",$ls_m_cate);//pro2_cate
	$p_m_cate2=str_replace("../","../../../",$ls_m_cate);//pro3_cate
	$p_m_cate3=str_replace("../","../../../../",$ls_m_cate);//pro4_cate
	
	//footer产品菜单—-鼠标悬停展开 end

//==================================================
//		 1) sitemap 站点地图 $s_site_cate
//==================================================

	$p_site_cate_sql="select * from ls_products where midcateName is null and subcateName is null and subcateFolders is null and subcateBrief is null and subcateID is null and productPic is null and productItemNo is null and productName is null and productSpecification is null and productID is null and enable=1 order by Num asc";
	$p_site_cate_query=$opendb->query($p_site_cate_sql);
	//$s_pro_cate="\n <div class=\"cate_list\">\n"; //大类菜单样式，div css:cate_list
	$s_site_cate.="<div class=\"ls_sitemap\">";
	while($pro_cate_rows=mysql_fetch_assoc($p_site_cate_query))
	{
	  $pro_midcate_sql="select * from ls_products where cateName is null and subcateName is null and subcateFolders is null and subcateBrief is null and subcateID is null and productPic is null and productItemNo is null and productName is null and productSpecification is null and productID is null and enable=1 and midcateID=".$pro_cate_rows['ID']." order by Num asc";
	  $pro_midcate_query=$opendb->query($pro_midcate_sql);
	  $pro_midcate_num=mysql_num_rows($pro_midcate_query);
	  
	  if($pro_midcate_num==0)//大类
	  {
		//$s_site_cate.="&nbsp;<img src='../Templates/images/cate.gif' border='0'> \n";
		//$s_site_cate.="\n<dt>".$pro_cate_rows['cateName']."</dt>";
		$s_site_cate.="<div class='cate'><a href='../".$pro_cate_rows['cateFolders']."/index.html'>".$pro_cate_rows['cateName']."</a></div>";
		// $s_site_cate.="\n <div class=\"cate_list\">\n"; //大类菜单样式，div css:cate_list
	  } 
	  else//大类中类
	  {
		//$s_site_cate.="&nbsp;<img src='../Templates/".$templates_var."/images/cate.gif' border='0'> \n";  //大类引导图
		$detailsfile="../".$pro_cate_rows['cateFolders']."/indexdetails.html";
		if(file_exists($detailsfile))
		{$s_site_cate.="\n<div class='cate'><a href='".$detailsfile."'>".$pro_cate_rows['cateName']."</a></div><div class='midcate'>";}
		else
		{$s_site_cate.="\n<div class='cate'><a href='javascript:void(0)'>".$pro_cate_rows['cateName']."</a></div><div class='midcate'>";}
		
		//？ 不应该有$s_site_cate.="\n <div class=\"cate_list\">\n";
		while($pro_midcate_rows=mysql_fetch_assoc($pro_midcate_query))
		{
			$pro_subcate_sql="select * from ls_products where midcateName is null and cateName is null and cateFolders is null and catePagePic is null and catePagePicWidth is null and catePagePicHeight is null and cateBrief is null and productPic is null and productItemNo is null and productName is null and productSpecification is null and productID is null and enable=1 and subcateID=".$pro_midcate_rows['ID']." order by Num asc";
			$pro_subcate_query=$opendb->query($pro_subcate_sql);
			$pro_subcate_num=mysql_num_rows($pro_subcate_query); 

			//$s_site_cate.="<div class=\"midcate_list\">"; //中类菜单样式
	
			if($pro_subcate_num==0)//没小类
			{
				//$s_site_cate.="&nbsp;<img src='../Templates/".$templates_var."/images/midcate.gif' border='0'> \n";  //中类引导图
				$s_site_cate.="\n<a href='../".$pro_cate_rows['cateFolders']."/".$pro_midcate_rows['midcateFolders']."/index.html'>".$pro_midcate_rows['midcateName']."</a>, &nbsp; ";
			}
			else//有小类
			{
			//$s_site_cate.="&nbsp;<img src='../Templates/".$templates_var."/images/midcate.gif' border='0'> \n"; //中类引导图
			$detailsfile="../".$pro_cate_rows['cateFolders']."/".$pro_midcate_rows['midcateName']."/indexdetails.html";
			if(file_exists($detailsfile))
			{$s_site_cate.="<div><a href='".$detailsfile."'>".$pro_midcate_rows['midcateName']."</a></div><div class='subcate'>";}
			else
			{$s_site_cate.="\n<div><a href='javascript:void(0)'>".$pro_midcate_rows['midcateName']."</a></div><div class='subcate'>\n";}
			//$s_site_cate.="<div class=\"subcate_list\">";//小类菜单样式
			while($pro_subcate_rows=mysql_fetch_assoc($pro_subcate_query))		//小类生成
			 {
				$s_site_cate.="<a href=\"../".$pro_cate_rows['cateFolders']."/".$pro_midcate_rows['midcateFolders']."/".$pro_subcate_rows['subcateFolders']."/index.html\" >".$pro_subcate_rows['subcateName']."</a>, &nbsp; \n";
			 }
			$s_site_cate.="</div>\n"; 
			}
			$s_site_cate.="\n";
		}
		$s_site_cate.="</div>";
	  }//if($pro_midcate_num==0)//dalei
	
	}
	$s_site_cate.="</div>\n ";
	//echo $s_site_cate;
	$site_cate1=str_replace("../","",$s_site_cate);//cate
	$s_site2_cate=str_replace("../","../../",$s_site_cate);//pro2_cate
	$s_site3_cate=str_replace("../","../../../",$s_site_cate);//pro3_cate
	$s_site4_cate=str_replace("../","../../../../",$s_site_cate);//pro4_cate
	
	// End

//====================================================================================================
//		 首页热点产品展示 $ls_hotpro 首页产品展示已经转移至temp_index.php
//====================================================================================================
	/*
			
	$ls_hotpro="";
	$hotpro='';

	$products_sql="select * from ls_products where midcateName is null and cateName is null and cateFolders is null and catePagePic is null and catePagePicWidth is null and catePagePicHeight is null and cateBrief is null and subcateName is null and subcateFolders is null and subcateBrief is null and subcateID is null and AdditionalAttributes&1 and enable=1";
	$products_sql.=" order by Num asc limit 0,".$proNum." ";
	$products_query=$opendb->query($products_sql);
	while($products_rows=mysql_fetch_assoc($products_query))
	{
		$pro_i++;
		$profile=getproductfolder($products_rows['productID']);
		$prosrc=$profile."/".$SmallFoldersProducts."/".$products_rows['productPic'];
		$prolink=$profile."/".$showproductsFolders."/".trim(str_replace(substr($products_rows['productPic'],-4),"",$products_rows['productPic'])).".html";


		$hotpro.="<div class=\"hotpro2\">";
		$hotpro.="<div class=\"hotpro\" >";
		$hotpro.="<a href=\"".$prolink."\" target=\"_ablank\"><img src=".$prosrc." border=\"0\" alt=\"".$products_rows['productName']."\"></a>";	//图片链接，css：hotpro
		$hotpro.="</div>";
		$hotpro.="<div class=\"hotpro3\" ><a href=\"".$prolink."\">".$products_rows['productItemNo']."</a></div>";		//文字链接，css：hotpro3
		$hotpro.="</div>";
		
	}		
	$ls_hotpro	=$hotpro;	
	//echo 		$ls_hotpro;												

//首页产品展示 End
	*/
	
//====================================================================================================
//		除产品页之外的所有$ls_designby，$ls_title，$ls_keywords，$ls_description，$foot标签内容
//====================================================================================================

	$ls_designby="<a href=\"http://www.lanscend.com/\" target=\"_blank\">Designed by lanscend</a>"; //Designed by lanscend
	$config_sql="SELECT * FROM ls_config";
	$config_query=$opendb->query($config_sql);
	$config_rows=mysql_fetch_assoc($config_query);

	$ls_title=$config_rows['siteKeywords']." - ".$config_rows['companyName'];	//首页title
	$ls_keywords=$config_rows['siteKeywords'];	//首页Keywords关键词
	$ls_description=$config_rows['siteDescription'];//首页Description描述

	$foot="Address:".$config_rows['address']."<br>";
	$foot.="Tel:".$config_rows['tel']."&nbsp;";
	$foot.="&nbsp;Fax:".$config_rows['fax']."&nbsp;";
	$foot.="&nbsp;E-Mail:<a href=\"mailto:".$config_rows['email']."\">".$config_rows['email']."</a>&nbsp;";

	
	//ls_addprolink标签
	$addprolink_sql = 'SELECT * FROM `ls_products` WHERE `addProLink`=1';
	$addprolink_query = $opendb->query($addprolink_sql);
	$addprolink_row = mysql_fetch_array($addprolink_query);
	if($addprolink_row['cateFolders']!=''){
		$addprolink_str = $addprolink_row['cateFolders'].'/'.$addprolink_row['cateFolders'].".html";//大类地址
	}elseif($addprolink_row['midcateFolders']!=''){
		$addpro2 =  $addprolink_row['midcateFolders'];//中类地址
		$addprolink_str = $addprolink_row['midcateFolders'];//中类地址
		$addprolink_sql = 'SELECT `cateFolders` FROM `ls_products` WHERE `ID`='.$addprolink_row['midcateID'];
		$addprolink_query = $opendb->query($addprolink_sql);
		$addprolink_row = mysql_fetch_array($addprolink_query);
		$addprolink_str = $addprolink_row['cateFolders'].'/'.$addprolink_str."/".$addpro2.".html";//大类地址加上中类地址
	}elseif($addprolink_row['subcateFolders']!=''){
		$addprolink_str = $addprolink_row['subcateFolders'].'/';//小类地址
		$addprolink_sql = 'SELECT `midcateFolders`,`midcateID` FROM `ls_products` WHERE `ID`='.$addprolink_row['subcateID'];
		$addprolink_query = $opendb->query($addprolink_sql);
		$addprolink_row = mysql_fetch_array($addprolink_query);
		$addprolink_str = $addprolink_row['midcateFolders'].'/'.$addprolink_str;//中类加上小类地址
		$addprolink_sql = 'SELECT `cateFolders` FROM `ls_products` WHERE `ID`='.$addprolink_row['midcateID'];
		$addprolink_query = $opendb->query($addprolink_sql);
		$addprolink_row = mysql_fetch_array($addprolink_query);
		$addprolink_str = $addprolink_row['cateFolders'].'/'.$addprolink_str."/".$addprolink_row['subcateFolders'].".html";//大类加上中类加上小类地址
	}
	$ls_addprolink = $addprolink_str;
	
	//ls_addnewprolink标签
	$addnewprolink_sql = 'SELECT * FROM `ls_products` WHERE `addNewProLink`=1';
	$addnewprolink_query = $opendb->query($addnewprolink_sql);
	$addnewprolink_row = mysql_fetch_array($addnewprolink_query);
	if($addnewprolink_row['cateFolders']!=''){
		$addnewprolink_str = '/'.$addnewprolink_row['cateFolders'].'/';//大类地址
	}elseif($addnewprolink_row['midcateFolders']!=''){
		$addnewprolink_str = $addnewprolink_row['midcateFolders'].'/';//中类地址
		$addnewprolink_sql = 'SELECT `cateFolders` FROM `ls_products` WHERE `ID`='.$addnewprolink_row['midcateID'];
		$addnewprolink_query = $opendb->query($addnewprolink_sql);
		$addnewprolink_row = mysql_fetch_array($addnewprolink_query);
		$addnewprolink_str = '/'.$addnewprolink_row['cateFolders'].'/'.$addnewprolink_str;//大类地址加上中类地址
	}elseif($addnewprolink_row['subcateFolders']!=''){
		$addnewprolink_str = $addnewprolink_row['subcateFolders'].'/';//小类地址
		$addnewprolink_sql = 'SELECT `midcateFolders`,`midcateID` FROM `ls_products` WHERE `ID`='.$addnewprolink_row['subcateID'];
		$addnewprolink_query = $opendb->query($addnewprolink_sql);
		$addnewprolink_row = mysql_fetch_array($addnewprolink_query);
		$addnewprolink_str = $addnewprolink_row['midcateFolders'].'/'.$addnewprolink_str;//中类加上小类地址
		$addnewprolink_sql = 'SELECT `cateFolders` FROM `ls_products` WHERE `ID`='.$addnewprolink_row['midcateID'];
		$addnewprolink_query = $opendb->query($addnewprolink_sql);
		$addnewprolink_row = mysql_fetch_array($addnewprolink_query);
		$addnewprolink_str = '/'.$addnewprolink_row['cateFolders'].'/'.$addnewprolink_str;//大类加上中类加上小类地址
	}
	$ls_addnewprolink = $addnewprolink_str;
	
	
	//友情链接
	$link_sql="select * from ls_links where enable=1 order by linkNum asc";
	$link_query=$opendb->query($link_sql);
	$link_num=mysql_num_rows($link_query);	
	$link="";
  	while ($link_rows=mysql_fetch_assoc($link_query)){ 
		$pro_link.="<a href=\"".$link_rows['linkURL']."\"> <img src=\"../ls_admin/uploadfiles/".$link_rows['linkIconPic']."\" alt=\"".$link_rows['linkTitle']."\" border='0' width=\"".$linkIconPicWidth."\" height=\"".$linkIconPicHeight."\" /></a>";					
    }
	$link=str_replace("../","",$pro_link);
	$pro2_link=str_replace("../","../../",$pro_link);
	$pro3_link=str_replace("../","../../../",$pro_link);
	$pro4_link=str_replace("../","../../../../",$pro_link);

	//主题图流动图片
	$revo_sql="select * from ls_revolvingpics where enable=1 order by Num asc";
	$revo_query=$opendb->query($revo_sql);
	$revo_num=mysql_num_rows($revo_query);	
	$revo="";
  	while ($revo_rows=mysql_fetch_assoc($revo_query)){ 
		$pro_revo.="<img src=\"../revolvingpics/thumbnails/".$revo_rows['Pic']."\" alt=\"".$revo_rows['Text']."\" border='0' width=\"".$revolvingPicW."\" height=\"".$revolvingPicH."\" />";					
    }
	$revo=str_replace("../","",$pro_revo);
	$pro2_revo=str_replace("../","../../",$pro_revo);
	$pro3_revo=str_replace("../","../../../",$pro_revo);
	$pro4_revo=str_replace("../","../../../../",$pro_revo);
	
	//echo $pro_revo;
	
	//生成手机 产品类的菜单
	$sql ="select * from ls_products where midcateName is null and subcateName is null and subcateFolders is null and subcateBrief is null and subcateID is null and productPic is null and productItemNo is null and productName is null and productSpecification is null and productID is null and enable=1 order by Num asc";
	$query=$opendb->query($sql);
	$procate_m="";
  	while ($revo_rows=mysql_fetch_assoc($query)){ 
		$procate_m.="<li><a  target= '_self' href='/products_list/&amp;pmcId=.html'><strong>".$revo_rows['cateName']."</strong></a></li>";					
    }



 			

?>
<!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">
</head>
