<?php
 //公用底部模板
 function getFooterTpl($channel){
      global $core_letters_foot,$core_city_sell,$core_city_rent;
	 if($channel == 'sell'){
		$channelInfo = "365淘房 -<a href='".GB_SELL_URL."/' target='_blank'>".$core_city_sell[GB_CITY]['name']."二手房</a>   ".GB_SELL_URL." &copy;2006-".date('Y')."　 苏 B2-20110162";
	 }elseif($channel == 'rent'){
		$channelInfo = "365淘房 -<a href='".GB_RENT_URL."/' target='_blank'>".$core_city_sell[GB_CITY]['name']."租房</a>   ".GB_RENT_URL." &copy;2006-".date('Y')."　 苏 B2-20110162";
	 }

     //获取底部首字母检索列表(用于网站地图)
	 $footSpellList = getFootSpellList(GB_CITY,$core_letters_foot);
     //获取二手房列表
	 $footSellList = getFootSellList($core_city_sell);
	 //获取租房房列表
	 $footRentList = getFootRentList($core_city_rent);
      $conf_city=GB_CITY;
	  $wzdt=GB_CITY=='nj'?'http://nj.house365.com/sitemap.html':'http://'.GB_CITY.'.house365.com/sitemap.html';
	$footer = <<<FOOTER
<div class="w960" style="clear:both;">
	<div class="foot">
		<p class="link"> <a href="http://www.house365.com/about/aboutus.php" target="_blank" rel="nofollow" >关于我们</a> | <a href="http://www.house365.com/about/contactus.php?city=$conf_city" target="_blank" rel="nofollow" >联系我们</a> | <a href="http://www.house365.com/about/joinus.php?pid=1&city=$conf_city" target="_blank" rel="nofollow" >招聘信息</a> | <a id='show_fen_sell' href="javascript:void(0)">各地二手房</a> | <a id='show_fen_rent' href="javascript:void(0)">各地租房</a> |<a href="http://www.house365.com/about/friendlink.php?city=$conf_city" target="_blank" rel="nofollow" >友情链接</a> | <a href="http://www.house365.com/about/partner.php?city=$conf_city" target="_blank" rel="nofollow"  >合作伙伴</a> | <a href="http://www.house365.com/about/statement.php" target="_blank" rel="nofollow" >法律声明</a> | <a href="$wzdt" target="_blank" rel="nofollow" >网站地图</a> </p>
		<p>$footSpellList</p>
		<p>$channelInfo</p>
	</div>
	 <div class="fenzhan" >
        <div class="fenzhantc"  id='fen_sell_tc'>
            <ul class="clearfix">$footSellList</ul>
        </div>
    </div>
	 <div class="fenzhan" >
        <div class="fenzhantc" id='fen_rent_tc'>
            <ul class="clearfix">$footRentList</ul>
        </div>
    </div>
</div>
<script>

//底部二手房分站显示
$(function(){
	$("#show_fen_sell").bind("mouseover",function(){
		$("#fen_sell_tc").show();
	}).bind("mouseout",function(){
		$("#fen_sell_tc").hide();
	});
	$("#fen_sell_tc").bind("mouseover",function(){
		$(this).show();
	}).bind("mouseout",function(){
		$(this).hide();
	});
	$("#show_fen_rent").bind("mouseover",function(){
		$("#fen_rent_tc").show();
	}).bind("mouseout",function(){
		$("#fen_rent_tc").hide();
	});
	$("#fen_rent_tc").bind("mouseover",function(){
		$(this).show();
	}).bind("mouseout",function(){
		$(this).hide();
	});
});
</script>
FOOTER;
	return $footer;
}

 //获取底部首字母检索列表(用于网站地图)
 function getFootSpellList($conf_city,$letters){
	if(!is_array($letters)) return '';
	$result = '';
	foreach($letters as $key=>$val){
		$result .= "<a href='".GB_SELL_URL."/sitemap_q".$val.".html' target='_blank'>".$val."</a> ";
	}
    return $result;
 }
 //获取二手房列表
 function getFootSellList($sellCitys){
	if(!is_array($sellCitys)) return '';
	$result = '';
	foreach($sellCitys as $key=>$val){
		$result .= "<li><a href='".$val['url']."' target='_blank'>".$val['name']."二手房</a></li>";
	}
    return $result;
 }
 //获取租房列表
  function getFootRentList($rentCitys){
	if(!is_array($rentCitys)) return '';
	$result = '';
	foreach($rentCitys as $key=>$val){
		$result .= "<li><a href='".$val['url']."' target='_blank'>".$val['name']."租房</a></li>";
	}
    return $result;
 }


 //公用头部模板
function getheaderTplNew($type,$channel){
    global $core_city_sell;
    $cityList = getCityList($type);
	$siteNav = getTopNavi($type);
	$topLogo = getLogo($type);
	$navi = getNavi($type,$channel);
	$siteNavRight = siteNavRight($type);
    $city = GB_CITY;
    $cityname = $core_city_sell[$city]['name'];
	$header = <<<HEADERSTR
<div class="siteNavBox">
	<div class="w960 siteNavInner">
		<div class="siteNavLeft">
			<div id="jsChangeCity" class="changeCity left">
				<div id="jsCurrentCity" class="current">$cityname</div>
				<div id="jsCity" class="list hide">
					<dl class="i_list_dl">
	                  $cityList
					</dl>
				</div>
			</div>
			<dl class="siteNav left">
	             $siteNav
			</dl>
		</div>
		<div class="siteNavRight">
	$siteNavRight
		</div>
	</div>
</div>
<div class="header">
	$topLogo
</div>
<div class="nav w960">
	$navi
</div>
<!--头部结束-->

HEADERSTR;
	return $header;
}

//头部城市列表
function getCityList($type){
	if($type == 'sell'){
        global $core_city_sell_center;
	    $core_city = $core_city_sell_center;
	}elseif($type == 'rent'){
		global $core_city_rent;
	    $core_city = $core_city_rent;
	}
    if(!is_array($core_city)) return '';
	$result = '';
	foreach($core_city as $key=>$value){
		$result .= "<dd class='item'><a href='".$value['url']."' class='link' rel='nofollow'>".$value['name']."</a></dd>";
	}
    return $result;

}

//头部整站导航
function getTopNavi($type){
	if($type == 'sell'){
	   $result = '
		   <dd class="item fg">|</dd>
				<dd class="item"><a class="link" href="'.GB_SITE_HOME.'" target="_blank">首页</a></dd>
				<dd class="item fg">|</dd>
				<dd class="item"><a class="link" href="'.GB_NEWHOUSE_URL.'" target="_blank">新房</a></dd>
				<dd class="item fg">|</dd>
				<dd class="item"><a class="link" href="'.GB_SELL_URL.'" target="_blank">二手房</a></dd>
				<dd class="item fg">|</dd>
				<dd class="item"><a class="link" href="'.GB_RENT_URL.'" target="_blank">租房</a></dd>
				<dd class="item fg">|</dd>
				
				
				<dd class="item"><a class="link" href="'.GB_BBS_URL.'" rel="nofollow" target="_blank">茶坊</a></dd>';
	}elseif($type == 'rent'){
	   $result = '';
	}
	return $result;
}

//头部logo
function getLogo($type){
	if($type == 'sell'){

              $logo = '
			<h1 class="logo"><a href="'.GB_SELL_URL.'" target="_blank"><img alt="365二手房网" src="http://nj.sell.house365.com/images/v201312/2015-7-9/logo_135_40.png" width="135px" height="40px"/></a></h1>
';


		$result = '
				<div class="headerInner w960">
			   '.$logo.'
		<div class="logoText"><img alt="买好房，上365二手房" width="215px" height="40px" src="http://nj.sell.house365.com/images/v201312/logoTextNew.png" /></div>
		<div class="topPic"><a href="'.GB_MOBLIE_URL.'" target="_blank" rel="nofollow"><img alt="" src="http://nj.sell.house365.com/images/v201312/topAD.png" width="180px" height="50px"/></a></div>
	</div>
';

	}elseif($type == 'rent'){
	    $result = '';
	}
	return $result;

}

//头部频道导航
function getNavi($type,$channel){

    if($type == 'sell'){

		$channelCurrentSell = $channel == 'sell' ? 'current' : '';
		$channelCurrentRent = $channel == 'rent' ? 'current' : '';
		$channelCurrentBlock = $channel == 'block' ? 'current' : '';
		$channelCurrentNews = $channel == 'news' ? 'current' : '';
		$channelCurrentBroker = $channel == 'broker' ? 'current' : '';
		$channelCurrentSp = $channel == 'sp' ? 'current' : '';
		$channelCurrentXzl = $channel == 'xzl' ? 'current' : '';
		$channelCurrentBbs = $channel == 'bbs' ? 'current' : '';
		$channelCurrentAsk = $channel == 'ask' ? 'current' : '';
		if($channelCurrentSell||$channelCurrentRent||$channelCurrentBlock||$channelCurrentNews||$channelCurrentBroker||$channelCurrentSp||$channelCurrentXzl||$channelCurrentBbs||$channelCurrentAsk)
		{
		}else{ $channelCurrentSell = 'current';
		}

		$result = '
				<div class="navInner">
		<dl class="list">
            <dd class="item"><a class="link '.$channelCurrentSell.'" href="'.GB_SELL_URL.'" target="_blank">二手房</a></dd>
			<dd class="item"><a class="link '.$channelCurrentRent.'" href="'.GB_RENT_URL.'" target="_blank">租房</a></dd>
			<dd class="item"><a class="link '.$channelCurrentBlock.'" href="'.GB_XIAOQU_URL.'" target="_blank">小区</a></dd>
			<dd class="item"><a class="link '.$channelCurrentNews.'" href="'.GB_NEWS_URL.'" target="_blank">资讯</a></dd>
			<!--<dd class="item"><a class="link '.$channelCurrentBroker.'" href="'.GB_BROKER_URL.'" target="_blank">经纪人</a></dd>-->
            <dd class="item more" id="jsNavMore2"><a class="link linkMore '.$channelCurrentSp.'" href="'.GB_CITY_SELL_SP.'" target="_blank"><span class="link">商铺</span></a>
				<div id="jsMoreList2" class="moreList hide">
					<dl class="m_list">

						<dd class="m_item"><a class="m_link" href="'.GB_CITY_SELL_SP.'" target="_blank">商铺出售</a></dd>
                        <dd class="m_item"><a class="m_link" href="'.GB_CITY_RENT_SP.'" target="_blank">商铺出租</a></dd>
					</dl>
				</div>
			</dd>


            <dd class="item more" id="jsNavMore3"><a class="link linkMore $channelCurrentXzl" href="'.GB_CITY_SELL_XZL.'" target="_blank"><span class="link">写字楼</span></a>
				<div id="jsMoreList3" class="moreList moreList2 hide">
					<dl class="m_list">
                		<dd class="m_item"><a class="m_link" href="'.GB_CITY_SELL_XZL.'" target="_blank">写字楼出售</a></dd>
						<dd class="m_item"><a class="m_link" href="'.GB_CITY_RENT_XZL.'" target="_blank">写字楼出租</a></dd>

					</dl>
				</div>

			</dd>';
			if(defined('GB_ASK_URL'))
			{
			$result .= '<dd class="item"><a class="link $channelCurrentAsk" href="'.GB_ASK_URL.'" target="_blank">问答</a></dd>';
			}
		    if(GB_CITY=='nj')
			{		
			$result .= '<dd class="item more" id="jsNavMore"><span class="link">更多</span>
				<div id="jsMoreList" class="moreList hide">
					<dl class="m_list">

                        <!--<dd class="m_item"><a class="m_link" href="'.GB_DANBAO_URL.'/" target="_blank" rel="nofollow">投资担保</a></dd>-->
						<dd class="m_item"><a class="m_link" href="'.GB_LOAN_URL.'"   target="_blank" rel="nofollow">贷款服务</a></dd>
	                    <dd class="m_item"><a class="m_link" href="'.GB_BBS_SELL_URL.'" target="_blank" rel="nofollow">论坛</a></dd>					
					</dl>
				</div>
			</dd>
		</dl>
        <a href="'.GB_SELL_URL.'/module/login/login_judge.php?kind=5" target="_blank" class="right deleteInfoLink"><span class="infoLinkInner">修改/删除信息</span></a>
		<a href="'.GB_SELL_URL.'/module/login/login_judge.php?kind=1" target="_blank" class="right releaseInfoLink"><span class="infoLinkInner">免费发布信息</span></a>
	</div>
	';
	}else{
		$result .= '<dd class="item"><a class="link '.$channelCurrentBroker.'" href="'.GB_BBS_URL.'" target="_blank">论坛</a></dd></dl>
        <a href="'.USER_CENTER.'/login/login_judge?kind=5" target="_blank" class="right deleteInfoLink"><span class="infoLinkInner">修改/删除信息</span></a>
		<a href="'.USER_CENTER.'/login/login_judge?kind=1" target="_blank" class="right releaseInfoLink"><span class="infoLinkInner">免费发布信息</span></a>
	</div>
	';	
	
	}
	}elseif($type == 'rent'){
	     $result ="";
	}
	return $result;

}

//头部登录
function siteNavRight($type){
    global $top_telphone;
	if($type == 'sell'){
		$result = '
			<dl class="list left">
                <script src="'.USER_CENTER.'login/login_js" language="javascript"></script>
				<dd class="item fg" >|</dd>
				<dd id="jsLogin" class="item i_relative" >
					<div id="jsLoginIn" class="downList">中介登录注册</div>
					<div id="jsLoginList" class="i_list hide">
						<dl class="i_list_dl">
							<dd class="i_item"><a class="link" href="'.GB_WO_URL.'" target="_blank" rel="nofollow"><span class="tex">经纪人登录</span></a></dd>
							<dd class="i_item"><a class="link" href="'.GB_WS_URL.'" target="_blank" rel="nofollow"><span class="tex">门店版登录</span></a></dd>
							<dd class="i_item"><a class="link" href="'.GB_BROKER_REGISTER_URL.'" target="_blank" rel="nofollow"><span class="tex texLast">经纪人注册</span></a></dd>
						</dl>
					</div>
				</dd>
				<dd class="item fg">|</dd>
				<dd class="item">个人热线：<span class="tel">'.TEL.'</span></dd>
			</dl>

';

	}elseif($type == 'rent'){
	     $result = '';
	}
	return $result;

}

    /**
    * 伪静态的uri链接地址
    *
    * @author cxf updatetime 2013-12-05
    * @param int
    * @param int
    * @return mixed
    */
    function page_uri($page,$pages,$url){
        $ss="";
        if($pages <= 1 || !is_numeric($page)){
                return '';
        } else{
                $pre = $page==1?$page:$page-1;
                $end = $page==$pages?$pages:$page+1;
                if($page == 1 ){
                        $ss .='<a class="p-prev">首页</a>';

                } else {
                        $ss .='<a href="'.$url.'/1" class="p-prev">首页</a>  <a class="p-prev" href="'.$url.'/'.$pre.'">上一页</a>';
                }
                for($i=$page-3;$i<=$page-1;$i++){
                        if($i<1) continue;
                        $ss .='<a href="'.$url.'/'.$i.'">'.$i.'</a>';
                }

                $ss .= '<a href="#" class="on">'.$page.'</a>';
                if($page < $pages){
                        $flag = 0;
                        for($i=$page+1;$i<=$pages;$i++){
                                $ss .= '<a href="'.$url.'/'.$i.'">'.$i.'</a>';
                                $flag++;
                                if($page>4)
                                {
                                if($flag==6) break;
                                }else{
                                if($flag+$page==8) break;
                                }

                        }
                }

                if( ($page == $pages) || ($pages == 0) ){
                         $ss .= '<a class="p-next">下一页</a>';
                } else {
                          $ss .= '<a href="'.$url.'/'.$end.'" class="p-next">下一页</a><a href="'.$url.'/'.$pages.'" class="p-prev">尾页</a> ';
                }
        }
        $ss.="";
        return $ss;
    }



function getheadCityGlobalVariable($conf_cityname)
{
	global $core_city_sell,$core_city_rent;

	$core_city_sell['bb']=array('url'=>'http://bb.sell.house365.com','name'=>'蚌埠');
	$core_city_sell['cd']=array('url'=>'http://cd.sell.house365.com','name'=>'成都');
	$core_city_sell['cc']=array('url'=>'http://cc.sell.house365.com','name'=>'长春');
	$core_city_sell['chuzhou']=array('url'=>'http://chuzhou.sell.house365.com','name'=>'滁州');
	$core_city_sell['dl']=array('url'=>'http://dl.sell.house365.com','name'=>'大连');
	$core_city_sell['dz']=array('url'=>'http://dz.sell.house365.com','name'=>'德州');
	
	$core_city_sell['bd']=array('url'=>'http://bd.sell.house365.com','name'=>'保定');
	$core_city_sell['fy']=array('url'=>'http://fy.sell.house365.com','name'=>'阜阳');
	$core_city_sell['enshi']=array('url'=>'http://enshi.sell.house365.com','name'=>'恩施');
	$core_city_sell['cs']=array('url'=>'http://cs.sell.house365.com','name'=>'常熟');

	$core_city_sell['jx']=array('url'=>'http://jx.sell.house365.com','name'=>'嘉兴');
	$core_city_sell['hb']=array('url'=>'http://hb.sell.house365.com','name'=>'淮北');
	$core_city_sell['hrb']=array('url'=>'http://hrb.sell.house365.com','name'=>'哈尔滨');
	
	$core_city_sell['jh']=array('url'=>'http://jh.sell.house365.com','name'=>'金华');
	$core_city_sell['hrb']=array('url'=>'http://hrb.sell.house365.com','name'=>'句容');
	$core_city_sell['hs']=array('url'=>'http://hs.sell.house365.com','name'=>'衡水');
	
	$core_city_sell['hd']=array('url'=>'http://hd.sell.house365.com','name'=>'邯郸');
	$core_city_sell['jy']=array('url'=>'http://jy.sell.house365.com','name'=>'江阴');
	$core_city_sell['nt']=array('url'=>'http://nt.sell.house365.com','name'=>'南通');
	$core_city_sell['mas']=array('url'=>'http://mas.sell.house365.com','name'=>'马鞍山');
	$core_city_sell['ly']=array('url'=>'http://ly.sell.house365.com','name'=>'临沂');
	$core_city_sell['nb']=array('url'=>'http://nb.sell.house365.com','name'=>'宁波');
	$core_city_sell['lh']=array('url'=>'http://lh.sell.house365.com','name'=>'六合');
	$core_city_sell['lz']=array('url'=>'http://lz.sell.house365.com','name'=>'兰州');
	$core_city_sell['ls']=array('url'=>'http://ls.sell.house365.com','name'=>'溧水');
	$core_city_sell['la']=array('url'=>'http://la.sell.house365.com','name'=>'六安');
	$core_city_sell['lyg']=array('url'=>'http://lyg.sell.house365.com','name'=>'连云港');
	$core_city_sell['km']=array('url'=>'http://km.sell.house365.com','name'=>'昆明');
	$core_city_sell['ks']=array('url'=>'http://ks.sell.house365.com','name'=>'昆山');
	$core_city_sell['tj']=array('url'=>'http://tj.sell.house365.com','name'=>'天津');
	$core_city_sell['tz']=array('url'=>'http://tz.sell.house365.com','name'=>'泰州');
	$core_city_sell['suzhou']=array('url'=>'http://suzhou.sell.house365.com','name'=>'宿州');

	$core_city_sell['wuhan']=array('url'=>'http://wuhan.sell.house365.com','name'=>'武汉');
	$core_city_sell['sjz']=array('url'=>'http://sjz.sell.house365.com','name'=>'石家庄');
	$core_city_sell['st']=array('url'=>'http://st.sell.house365.com','name'=>'汕头');
	$core_city_sell['qz']=array('url'=>'http://qz.sell.house365.com','name'=>'泉州');
	$core_city_sell['wz']=array('url'=>'http://wz.sell.house365.com','name'=>'温州');
	$core_city_sell['yz']=array('url'=>'http://yz.sell.house365.com','name'=>'扬州');
	$core_city_sell['yx']=array('url'=>'http://yx.sell.house365.com','name'=>'宜兴');
	$core_city_sell['zhuzhou']=array('url'=>'http://zhuzhou.sell.house365.com','name'=>'株洲');
	$core_city_sell['xz']=array('url'=>'http://xz.sell.house365.com','name'=>'徐州');
	$core_city_sell['zs']=array('url'=>'http://zs.sell.house365.com','name'=>'中山');
	$core_city_sell['zh']=array('url'=>'http://zh.sell.house365.com','name'=>'珠海');
	$core_city_sell['zunyi']=array('url'=>'http://zunyi.sell.house365.com','name'=>'遵义');
	$core_city_sell['xx']=array('url'=>'http://xx.sell.house365.com','name'=>'新乡');
	$core_city_sell['yt']=array('url'=>'http://yt.sell.house365.com','name'=>'烟台');
	$core_city_sell['fjzz']=array('url'=>'http://fjzz.sell.house365.com','name'=>'漳州');
	$core_city_sell['xt']=array('url'=>'http://xt.sell.house365.com','name'=>'邢台');

		$core_city_sell['sz']=array('url'=>'http://sz.sell.house365.com','name'=>'苏州');
	$core_city_sell['wx']=array('url'=>'http://wx.sell.house365.com','name'=>'无锡');
	$core_city_sell['cz']=array('url'=>'http://cz.sell.house365.com','name'=>'常州');
	$core_city_sell['sz']=array('url'=>'http://sz.sell.house365.com','name'=>'苏州');
	$core_city_sell['wh']=array('url'=>'http://wh.sell.house365.com','name'=>'芜湖');
	$core_city_sell['hz']=array('url'=>'http://hz.sell.house365.com','name'=>'杭州');
	$core_city_sell['xa']=array('url'=>'http://xa.sell.house365.com','name'=>'西安');
	$core_city_sell['cq']=array('url'=>'http://cq.sell.house365.com','name'=>'重庆');
	$core_city_sell['sy']=array('url'=>'http://sy.sell.house365.com','name'=>'沈阳');
	$core_city_sell['ks']=array('url'=>'http://ks.sell.house365.com','name'=>'昆山');
		$core_city_sell['nj']=array('url'=>'http://nj.sell.house365.com','name'=>'南京');
	$core_city_sell['hf']=array('url'=>'http://hf.sell.house365.com','name'=>'合肥');
	

	$a1='';
	$a2='';
	$a3='';
	$a4='';
	$a5='';
	$city_arr=array();
	if($core_city_sell){
	$city_arr = $core_city_sell;
	}elseif($core_city_rent){
	$city_arr=$core_city_rent;
	}
	
	foreach($city_arr as $key=>$val){
		if($key=='fjzz')
		{
			$a5.="<a target='_blank' href='{$val[url]}'>{$val[name]}</a> ";
		}
		else
		{
			$val['name'] = str_replace("　","",$val['name']);
			if(in_array(substr($key,0,1),array('a','b','c','d','e','f'))){
				$a1.="<a target='_blank' href='{$val[url]}'>{$val[name]}</a> ";
			}
			if(in_array(substr($key,0,1),array('g','h','i','j'))){
				$a2.="<a target='_blank' href='{$val[url]}'>{$val[name]}</a> ";
			}
			if(in_array(substr($key,0,1),array('k','l','m','n'))){
				$a3.="<a target='_blank' href='{$val[url]}'>{$val[name]}</a> ";
			}
			if(in_array(substr($key,0,1),array('p','q','r','s','t','u','v','w'))){
				$a4.="<a target='_blank' href='{$val[url]}'>{$val[name]}</a> ";
			}
			if(in_array(substr($key,0,1),array('x','y','z'))){
				$a5.="<a target='_blank' href='{$val[url]}'>{$val[name]}</a> ";
			}
		}
	}
	
	$data =array('a1'=>$a1,'a2'=>$a2,'a3'=>$a3,'a4'=>$a4,'a5'=>$a5);
	return $data;
}

function jmz_add_core_city(){
    $jmz_city_sell = array();
    $jmzList = scandir(CORE_CONF.'/jmz');
    if($jmzList){
        foreach ($jmzList as $file){
            if(!in_array($file,array('.','..')) && preg_match('/^conf_(.*).php$/',$file,$match)){
                require CORE_CONF.'/jmz/'.$file;
                if(isset($conf_cityname) && isset($match[1])){
                    $jmz_city_sell[$match[1]] = array('url'=>'http://user.house365.com/user/changecity?city='.$match[1],'name'=>$conf_cityname);
                }
            }
        } 
    }
    return $jmz_city_sell;
}

function getheadCityGlobalVariableNew($conf_cityname)
{
	global $core_city_sell,$core_city_rent;

	$core_city_sell['bb']=array('url'=>'http://user.house365.com/user/changecity?city=bb','name'=>'蚌埠');
	$core_city_sell['tx']=array('url'=>'http://user.house365.com/user/changecity?city=tx','name'=>'桐乡');
	$core_city_sell['ph']=array('url'=>'http://user.house365.com/user/changecity?city=ph','name'=>'平湖');
	$core_city_sell['wlmq']=array('url'=>'http://user.house365.com/user/changecity?city=wlmq','name'=>'乌鲁木齐');
	$core_city_sell['dz']=array('url'=>'http://user.house365.com/user/changecity?city=dz','name'=>'德州');
	$core_city_sell['dz']=array('url'=>'http://user.house365.com/user/changecity?city=jx','name'=>'嘉兴');
	$core_city_sell['dz']=array('url'=>'http://user.house365.com/user/changecity?city=mianyang','name'=>'绵阳');
	$core_city_sell['dz']=array('url'=>'http://user.house365.com/user/changecity?city=dz','name'=>'德州');
	$core_city_sell['wx']=array('url'=>'http://user.house365.com/user/changecity?city=wx','name'=>'无锡');
	$core_city_sell['cz']=array('url'=>'http://user.house365.com/user/changecity?city=cz','name'=>'常州');
	$core_city_sell['sz']=array('url'=>'http://user.house365.com/user/changecity?city=sz','name'=>'苏州');
	$core_city_sell['wh']=array('url'=>'http://user.house365.com/user/changecity?city=wh','name'=>'芜湖');
	$core_city_sell['hz']=array('url'=>'http://user.house365.com/user/changecity?city=hz','name'=>'杭州');
	$core_city_sell['xa']=array('url'=>'http://user.house365.com/user/changecity?city=xa','name'=>'西安');
	$core_city_sell['cq']=array('url'=>'http://user.house365.com/user/changecity?city=cq','name'=>'重庆');
	$core_city_sell['sy']=array('url'=>'http://user.house365.com/user/changecity?city=sy','name'=>'沈阳');
	$core_city_sell['ks']=array('url'=>'http://user.house365.com/user/changecity?city=ks','name'=>'昆山');
	$core_city_sell['nj']=array('url'=>'http://user.house365.com/user/changecity?city=nj','name'=>'南京');
	$core_city_sell['hf']=array('url'=>'http://user.house365.com/user/changecity?city=hf','name'=>'合肥');
    $core_city_sell['gy']=array('url'=>'http://user.house365.com/user/changecity?city=gy','name'=>'贵阳');
    $core_city_sell['sh']=array('url'=>'http://user.house365.com/user/changecity?city=sh','name'=>'上海');
    $core_city_sell['bh']=array('url'=>'http://user.house365.com/user/changecity?city=bh','name'=>'北海');
    $core_city_sell['lyg']=array('url'=>'http://user.house365.com/user/changecity?city=lyg','name'=>'连云港');
    $core_city_sell['fcg']=array('url'=>'http://user.house365.com/user/changecity?city=fcg','name'=>'防城港');
    $core_city_sell['ty']=array('url'=>'http://user.house365.com/user/changecity?city=ty','name'=>'太原');
    $core_city_sell['aq']=array('url'=>'http://user.house365.com/user/changecity?city=aq','name'=>'安庆');
	$core_city_sell['tl']=array('url'=>'http://user.house365.com/user/changecity?city=tl','name'=>'铜陵');
    $core_city_sell['xc']=array('url'=>'http://user.house365.com/user/changecity?city=xc','name'=>'宣城');
    $core_city_sell['bd']=array('url'=>'http://user.house365.com/user/changecity?city=bd','name'=>'保定');
    $core_city_sell['nt']=array('url'=>'http://user.house365.com/user/changecity?city=nt','name'=>'南通');
    $core_city_sell['nn']=array('url'=>'http://user.house365.com/user/changecity?city=nn','name'=>'南宁');

    $core_city_sell = array_merge($core_city_sell,jmz_add_core_city());

	$a1='';
	$a2='';
	$a3='';
	$a4='';
	$a5='';
	$city_arr=array();
	if($core_city_sell){
	$city_arr = $core_city_sell;
	}elseif($core_city_rent){
	$city_arr=$core_city_rent;
	}
	
	foreach($city_arr as $key=>$val){
		if($key=='fjzz')
		{
			$a5.="<a target='_blank' href='{$val[url]}'>{$val[name]}</a> ";
		}
		else
		{
			$val['name'] = str_replace("　","",$val['name']);
			if(in_array(substr($key,0,1),array('a','b','c','d','e','f'))){
				$a1.="<a target='_blank' href='{$val[url]}'>{$val[name]}</a> ";
			}
			if(in_array(substr($key,0,1),array('g','h','i','j'))){
				$a2.="<a target='_blank' href='{$val[url]}'>{$val[name]}</a> ";
			}
			if(in_array(substr($key,0,1),array('k','l','m','n'))){
				$a3.="<a target='_blank' href='{$val[url]}'>{$val[name]}</a> ";
			}
			if(in_array(substr($key,0,1),array('p','q','r','s','t','u','v','w'))){
				$a4.="<a target='_blank' href='{$val[url]}'>{$val[name]}</a> ";
			}
			if(in_array(substr($key,0,1),array('x','y','z'))){
				$a5.="<a target='_blank' href='{$val[url]}'>{$val[name]}</a> ";
			}
		}
	}
	
	$data =array('a1'=>$a1,'a2'=>$a2,'a3'=>$a3,'a4'=>$a4,'a5'=>$a5);
	return $data;
}

//获得头部城市下拉导航---20150827
function getheadCityBrokerNav($conf_cityname){
	global $core_city_sell,$core_city_rent;

	$data =getheadCityGlobalVariable($conf_cityname);
	$a1   =$data['a1'];
	$a2   =$data['a2'];
	$a3   =$data['a3'];
	$a4   =$data['a4'];
	$a5   =$data['a5'];

	$nav = <<<HEADERSTR
			<div id="jsChangeCity" class="changeCity left">
			<div id="jsCurrentCity" class="current">南京</div>
			<div id="jsCity" class="citylist clearfix smcom_ch_drop" style="display: none;">
					      <p class="smcom_ch_hot_city">            <strong>热门城市：</strong>           
					            <a target="_blank" href="http://nj.sell.house365.com">南京</a>            
					            <a target="_blank" href="http://hf.sell.house365.com">合肥</a>           
					            <a target="_blank" href="http://wh.sell.house365.com">芜湖</a>    
					        </p> 
							<dl class="smcom_clearfix">                
					         	<dt>A-F：</dt>                
					         	<dd>{$a1} </dd>
								<dt>G-J：</dt>                
					         	<dd>{$a2} </dd>

								  <dt>K-N：</dt>                
					         	<dd>{$a3}</dd>

								  <dt>P-W：</dt>                
					         	<dd>{$a4}</dd>
								  <dt>X-Z：</dt>                
					         	<dd>{$a5}</dd>
					           </dl>
			</div>
		</div>

HEADERSTR;
	return $nav;
}


//获得头部城市下拉导航---20150827
function getheadCityBrokerNavAsk($conf_cityname){
	global $core_city_sell,$core_city_rent;

	$data =getheadCityGlobalVariable($conf_cityname);
	$a1   =$data['a1'];
	$a2   =$data['a2'];
	$a3   =$data['a3'];
	$a4   =$data['a4'];
	$a5   =$data['a5'];

	$nav = <<<HEADERSTR
			<div id="jsChangeCity" class="left citychange">
			<p class="currentcity"><b></b>南京</p>
			<div id="jsCity" class="citylist clearfix smcom_ch_drop" style="display: none;">
					      <p class="smcom_ch_hot_city">            <strong>热门城市：</strong>           
					            <a target="_blank" href="http://nj.sell.house365.com">南京</a>            
					            <a target="_blank" href="http://hf.sell.house365.com">合肥</a>           
					            <a target="_blank" href="http://wh.sell.house365.com">芜湖</a>    
					        </p> 
							<dl class="smcom_clearfix">                
					         	<dt>A-F：</dt>                
					         	<dd>{$a1} </dd>
								<dt>G-J：</dt>                
					         	<dd>{$a2} </dd>

								  <dt>K-N：</dt>                
					         	<dd>{$a3}</dd>

								  <dt>P-W：</dt>                
					         	<dd>{$a4}</dd>
								  <dt>X-Z：</dt>                
					         	<dd>{$a5}</dd>
					           </dl>
			</div>
		</div>

HEADERSTR;
	return $nav;
}



//获得头部城市下拉导航---20150827
function getheadCityBrokerNavRent($conf_cityname){
	global $core_city_sell,$core_city_rent;

	$data =getheadCityGlobalVariable($conf_cityname);
	$a1   =$data['a1'];
	$a2   =$data['a2'];
	$a3   =$data['a3'];
	$a4   =$data['a4'];
	$a5   =$data['a5'];

	$nav = <<<HEADERSTR
			<div id="JS_citychange" class="citychange">
			<p  class="currentcity">{$conf_cityname}
			<b class="icoCss"><b class="three"></b><b class="two"></b><b class="one"></b></b>
			</p>
			<div id="jsCity" class="citylist clearfix smcom_ch_drop" style="display: none;">
					      <p class="smcom_ch_hot_city">            <strong>热门城市：</strong>           
					            <a target="_blank" href="http://nj.sell.house365.com">南京</a>            
					            <a target="_blank" href="http://hf.sell.house365.com">合肥</a>           
					            <a target="_blank" href="http://wh.sell.house365.com">芜湖</a>    
					        </p> 
							<dl class="smcom_clearfix">                
					         	<dt>A-F：</dt>                
					         	<dd>{$a1} </dd>
								<dt>G-J：</dt>                
					         	<dd>{$a2} </dd>

								  <dt>K-N：</dt>                
					         	<dd>{$a3}</dd>

								  <dt>P-W：</dt>                
					         	<dd>{$a4}</dd>
								  <dt>X-Z：</dt>                
					         	<dd>{$a5}</dd>
					           </dl>
			</div>
		</div>

HEADERSTR;
	return $nav;
}


//获得头部城市下拉导航---20150827
function getheadCityBrokerNavKS($conf_cityname){
	global $core_city_sell,$core_city_rent;

	$data =getheadCityGlobalVariable($conf_cityname);
	$a1   =$data['a1'];
	$a2   =$data['a2'];
	$a3   =$data['a3'];
	$a4   =$data['a4'];
	$a5   =$data['a5'];

	$nav = <<<HEADERSTR
		
		
			<div id="loginFldselectop" class="citylist clearfix smcom_ch_drop" style="display: none;" >
					      <p class="smcom_ch_hot_city">            <strong>热门城市：</strong>           
					            <a target="_blank" href="http://nj.sell.house365.com">南京</a>            
					            <a target="_blank" href="http://hf.sell.house365.com">合肥</a>           
					            <a target="_blank" href="http://wh.sell.house365.com">芜湖</a>    
					        </p> 
							<dl class="smcom_clearfix">                
					         	<dt>A-F：</dt>                
					         	<dd>{$a1} </dd>
								<dt>G-J：</dt>                
					         	<dd>{$a2} </dd>

								  <dt>K-N：</dt>                
					         	<dd>{$a3}</dd>

								  <dt>P-W：</dt>                
					         	<dd>{$a4}</dd>
								  <dt>X-Z：</dt>                
					         	<dd>{$a5}</dd>
					           </dl>
			</div>
		

HEADERSTR;
	return $nav;
}

//获取资讯城市头部HTML
function getNewsCityHeaderHtml($conf_cityname){
	global $core_city_sell,$core_city_rent;
	
	$data =getheadCityGlobalVariable($conf_cityname);
	$a1   =$data['a1'];
	$a2   =$data['a2'];
	$a3   =$data['a3'];
	$a4   =$data['a4'];
	$a5   =$data['a5'];
	

	$nav =  '<div id="cutCity"  style="float:left"> 
			
			<h3>南京</h3>
			<a href="javascript:;" style="color:#666">[切换城市]</a>
			 <div  class="cityList clearfix smcom_ch_drop" style="display:none;" >
				  <p class="smcom_ch_hot_city">            
				      <strong>热门城市：</strong>           
				      <a target="_blank" href="http://nj.sell.house365.com">南京</a>            
					  <a target="_blank" href="http://hf.sell.house365.com">合肥</a>           
					  <a target="_blank" href="http://wh.sell.house365.com">芜湖</a>    
				  </p>  
				  <dl class="smcom_clearfix">                
						<dt>A-F：</dt>                
						<dd>'.$a1.'</dd>

						<dt>G-J：</dt>                
						<dd>'.$a2.'</dd>

						<dt>K-N：</dt>                
						<dd>'.$a3.'</dd>

						<dt>P-W：</dt>                
						<dd>'.$a4.'</dd>

						<dt>X-Z：</dt>                
						<dd>'.$a5.'</dd>
				   </dl>
			</div></div>';
	//echo $nav;
	return $nav;
}




//二手房首页公用头部模板20150828
function getheaderTplEsfIndex($type,$channel){
	global $conf_cityname,$core_city_sell;
	//$channel = 'rent';
	//$topAd = topAd();
    $cityList = getCityList($type);
	$siteNav = getTopNavi($type);
	$topLogo = getLogo($type);
	$navi = getNavi($type,$channel);	
	$siteNavRight = siteNavRight($type);
	$nav = getheadCityBrokerNav($conf_cityname);
	$header = <<<HEADERSTR
<div class="siteNavBox">
	<div class="w960 siteNavInner">
		<div class="siteNavLeft">
	{$nav}
			<dl class="siteNav left">
	             {$siteNav}
			</dl>
		</div>
		<div class="siteNavRight">
	{$siteNavRight}
		</div>
	</div>
</div>
<div class="header">
	{$topLogo}
</div>
<div class="nav w960">
	{$navi}
</div>
<!--头部结束-->

HEADERSTR;
	echo $header;
}

//二手房首页公用头部模板20150828
function getheaderTplEsfIndexXa($type,$channel){
	global $conf_cityname,$core_city_sell;
	//$channel = 'rent';
	//$topAd = topAd();
    $cityList = getCityList($type);
	$siteNav = getTopNavi($type);
	$topLogo = getLogo($type);
	$navi = getNavi($type,$channel);	
	$siteNavRight = siteNavRight($type);
	$nav = getheadCityBrokerNavxa($conf_cityname);
	$header = <<<HEADERSTR
<div class="siteNavBox">
	<div class="w960 siteNavInner">
		<div class="siteNavLeft">
	{$nav}
			<dl class="siteNav left">
	             {$siteNav}
			</dl>
		</div>
		<div class="siteNavRight">
	{$siteNavRight}
		</div>
	</div>
</div>
<div class="header">
	{$topLogo}
</div>
<div class="nav w960">
	{$navi}
</div>
<!--头部结束-->

HEADERSTR;
	echo $header;
}


//获得头部城市下拉导航---20150827
function getheadCityBrokerNavxa($conf_cityname){
	global $core_city_sell,$core_city_rent;

	$data =getheadCityGlobalVariable($conf_cityname);
	$a1   =$data['a1'];
	$a2   =$data['a2'];
	$a3   =$data['a3'];
	$a4   =$data['a4'];
	$a5   =$data['a5'];

	$nav = <<<HEADERSTR
			<div id="JS_citychange" class="citychange">
			<p class="currentcity"><span class="btn cityBg">{$conf_cityname}</span></p>
			
			<div id="jsCity" class="citylist clearfix smcom_ch_drop" style="display: none;">
					      <p class="smcom_ch_hot_city">            <strong>热门城市：</strong>           
					            <a target="_blank" href="http://nj.sell.house365.com">南京</a>            
					            <a target="_blank" href="http://hf.sell.house365.com">合肥</a>           
					            <a target="_blank" href="http://wh.sell.house365.com">芜湖</a>    
					        </p> 
							<dl class="smcom_clearfix">                
					         	<dt>A-F：</dt>                
					         	<dd>{$a1} </dd>
								<dt>G-J：</dt>                
					         	<dd>{$a2} </dd>

								  <dt>K-N：</dt>                
					         	<dd>{$a3}</dd>

								  <dt>P-W：</dt>                
					         	<dd>{$a4}</dd>
								  <dt>X-Z：</dt>                
					         	<dd>{$a5}</dd>
					           </dl>
			</div>
		</div>

HEADERSTR;
	return $nav;
}

//获取学区房城市头部HTML
function getShoolHouseCityHeaderHtml($conf_cityname,$type = 1){
	global $core_city_sell,$core_city_rent;

	$data =getheadCityGlobalVariable($conf_cityname);
	$a1   =$data['a1'];
	$a2   =$data['a2'];
	$a3   =$data['a3'];
	$a4   =$data['a4'];
	$a5   =$data['a5'];
	
	if($type == 1)
	{
		$color = '#ffb34a';
	}
	elseif($type == 2)
	{
		$color = '#11c76f';
	}

	$style = '<style>
 .smcom_ch_drop{ font-family: "Microsoft Yahei";z-index: 900;position: absolute;background-color: #fff;top:28px;left:0;padding: 10px;width: 255px;border:1px solid '.$color.';}
.smcom_ch_drop a{text-decoration: none;color:#666;}
.smcom_ch_drop a:hover{color: #ff4400;}
.smcom_ch_top .smcom_ch_city{float: left;margin-left: 5px;width: 80px;display: inline-block;position: relative;}
.smcom_ch_drop dl{line-height: 30px;border-top:1px #cdcdcd dotted;padding: 2px 0;}
.smcom_ch_drop dl dt{float: left;width: 48px;text-align: left;color:#ff5600;font-weight: bold;}
.smcom_ch_drop dl dd{float: left;width: 205px;}
.smcom_clearfix{clear:both;}
.smcom_ch_hot_city{color:#ff5600;padding: 5px 0 10px 0;}
 .smcom_ch_hot_city a{color:#ff5600;margin:0 4px 0 5px;}</style>';

	$nav =  '<div class="citychange" id="JS_citychange">
		        <p class="currentcity"><span class="btn cityBg">'.$conf_cityname.'</span></p>
				<div  class=" citylist clearfix smcom_ch_drop" style="display:none">
				<p class="smcom_ch_hot_city">            
					<strong>热门城市：</strong>           
					<a target="_blank" href="http://nj.sell.house365.com">南京</a>            
					<a target="_blank" href="http://hf.sell.house365.com">合肥</a>           
					<a target="_blank" href="http://wh.sell.house365.com">芜湖</a>    
				</p>  
				<dl class="smcom_clearfix">                
					<dt>A-F：</dt>                
					<dd>'.$a1.'</dd>

					<dt>G-J：</dt>                
					<dd>'.$a2.'</dd>

					<dt>K-N：</dt>                
					<dd>'.$a3.'</dd>

					<dt>P-W：</dt>                
					<dd>'.$a4.'</dd>

					<dt>X-Z：</dt>                
					<dd>'.$a5.'</dd>
				</dl>
			</div></div>';

	return $style.$nav;
}
?>