﻿var bzt_curUrl = window.location.href; 
function bzt_getHeadType(url){
	if(url != null){
		if(url.indexOf("http://profile.baihe.com/new/") == 0){
			if(url.indexOf("http://profile.baihe.com/new/Login.action") == 0){
				return 0;
			}
			if(url.indexOf("http://profile.baihe.com/new/deepMatchResultList.action") == 0){
				return 2;
			}
			return 1;
		}

		if(url.indexOf("http://www.baihe.com/") == 0 || url.indexOf("http://baihe.com/") == 0){
			return 0;
		}
		
		if(url.indexOf("http://58.83.185.213/") == 0 || url.indexOf("http://58.83.185.213/") == 0){
			return 0;
		}

		return 2;
	}

	return 0;
}

var realAdvertInfo = "<div style='padding:5px 10px;text-align:center; color:#ff6600; height:14px; border:1px solid #ffe2b7; background:#fffef5; overflow:hidden;'>温馨提示：百合网自2011年12月15日起全站推行实名认证制度，请您尽快完成实名认证，享受真实的交友环境。让我们一起努力，共同创建一个诚信的交友平台！<a href='http://act.baihe.com/event/1112reg/' target='_blank' style='color:#ff6600; text-decoration:underline;'>查看详情</a></div>" ;


var meta_ie7=document.createElement('meta');  
meta_ie7.setAttribute("http-equiv", "X-UA-Compatible");
meta_ie7.setAttribute("content", "IE=EmulateIE7");
document.getElementsByTagName("head")[0].appendChild(meta_ie7);

var bzt_headType = bzt_getHeadType(bzt_curUrl+"");
if(bzt_curUrl.indexOf("http://ichat.baihe.com/w/")>-1&&bzt_curUrl.indexOf("http://ichat.baihe.com/w/lastuser")<0){
	 if(typeof(window.opener)=='undefined'||window.opener==null||window.opener==''){
		 /*	var browser=navigator.appName;
		 	var browserName_ = navigator.userAgent ;
			if(browser=='Netscape'&&browserName_.indexOf("Firefox")>-1){
				try{
					netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserWrite');
				}catch(e){
				}
			} 
	 	  window.opener = null ;
	 		window.close();*/
	 		window.open('','_self','');
      window.close();
	 }
}
if(bzt_headType==0){
	var browserName_ = navigator.userAgent ;
	if(browserName_.indexOf("iPad")<0&&browserName_.indexOf("Windows NT")<0&&browserName_.indexOf("Macintosh")<0){
			if(browserName_.indexOf("Linux")>0){
				if(browserName_.indexOf("Mobile")>0||browserName_.indexOf("U;")>0){
					 location.href="http://3g.baihe.com/";
				}
			}
			else{
				location.href="http://3g.baihe.com/";
			}
	} else{
	   if(browserName_.indexOf("baidu Transcoder")>0){
	  		 location.href="http://3g.baihe.com/";
	   }
	} 
}
var mtstr_head=new Array();mtstr_head['8611']=['东城|861101','西城|861102','崇文|861103','宣武|861104','朝阳|861105','丰台|861106','石景山|861107','海淀|861108','门头沟|861109','房山|861110','通州|861111','顺义|861112','昌平|861113','大兴|861114','怀柔|861115','平谷|861116','密云|861117','延庆|861118'];mtstr_head['8612']=['和平|861201','河东|861202','河西|861203','南开|861204','河北|861205','红桥|861206','塘沽|861207','汉沽|861208','大港|861209','东丽|861210','西青|861211','津南|861212','北辰|861213','武清|861214','宝坻|861215','宁河|861216','静海|861217','蓟县|861218'];mtstr_head['8613']=['石家庄|861301','唐山|861302','秦皇岛|861303','邯郸|861304','邢台|861305','保定|861306','张家口|861307','承德|861308','沧州|861309','廊坊|861310','衡水|861311'];mtstr_head['8614']=['太原|861401','大同|861402','阳泉|861403','长治|861404','晋城|861405','朔州|861406','晋中|861407','运城|861408','忻州|861409','临汾市|861410','吕梁|861411'];mtstr_head['8615']=['呼和浩特|861501','包头|861502','乌海|861503','赤峰|861504','通辽|861505','鄂尔多斯|861506','呼伦贝尔|861507','巴彦淖尔|861508','乌兰察布|861509','兴安|861522','锡林郭勒|861525','阿拉善|861529'];mtstr_head['8621']=['沈阳|862101','大连|862102','鞍山|862103','抚顺|862104','本溪|862105','丹东|862106','锦州|862107','营口|862108','阜新|862109','辽阳|862110','盘锦|862111','铁岭|862112','朝阳|862113','葫芦岛|862114'];mtstr_head['8622']=['长春|862201','吉林|862202','四平|862203','辽源|862204','通化|862205','白山|862206','松原|862207','白城|862208','延边|862224'];mtstr_head['8623']=['哈尔滨市|862301','齐齐哈尔|862302','鸡西|862303','鹤岗|862304','双鸭山|862305','大庆|862306','伊春|862307','佳木斯|862308','七台河|862309','牡丹江|862310','黑河|862311','绥化|862312','大兴安岭|862327'];mtstr_head['8631']=['黄浦|863101','卢湾|863102','徐汇|863103','长宁|863104','静安|863105','普陀|863106','闸北|863107','虹口|863108','杨浦|863109','闵行|863110','宝山|863111','嘉定|863112','浦东新区|863113','金山|863114','松江|863115','青浦|863116','南汇|863117','奉贤|863118','崇明|863119'];mtstr_head['8632']=['南京|863201','无锡|863202','徐州|863203','常州|863204','苏州|863205','南通|863206','连云港|863207','淮安|863208','盐城|863209','扬州|863210','镇江|863211','泰州|863212','宿迁|863213'];mtstr_head['8633']=['杭州|863301','宁波|863302','温州|863303','嘉兴|863304','湖州|863305','绍兴|863306','金华|863307','衢州|863308','舟山|863309','台州|863310','丽水|863311'];mtstr_head['8634']=['合肥|863401','芜湖|863402','蚌埠|863403','淮南|863404','马鞍山|863405','淮北|863406','铜陵|863407','安庆|863408','黄山|863410','滁州|863411','阜阳|863412','宿州|863413','巢湖|863414','六安|863415','亳州|863416','池州|863417','宣城|863418'];mtstr_head['8635']=['福州|863501','厦门|863502','莆田|863503','三明|863504','泉州|863505','漳州|863506','南平|863507','龙岩|863508','宁德|863509'];mtstr_head['8636']=['南昌|863601','景德镇|863602','萍乡|863603','九江|863604','新余|863605','鹰潭|863606','赣州|863607','吉安|863608','宜春|863609','抚州|863610','上饶|863611'];mtstr_head['8637']=['济南|863701','青岛|863702','淄博|863703','枣庄|863704','东营|863705','烟台|863706','潍坊|863707','济宁|863708','泰安|863709','威海|863710','日照|863711','莱芜|863712','临沂|863713','德州|863714','聊城|863715','滨州|863716','荷泽|863717'];mtstr_head['8641']=['郑州|864101','开封|864102','洛阳|864103','平顶山|864104','安阳|864105','鹤壁|864106','新乡|864107','焦作|864108','濮阳|864109','许昌|864110','漯河|864111','三门峡|864112','南阳|864113','商丘|864114','信阳|864115','周口|864116','驻马店|864117'];mtstr_head['8642']=['武汉|864201','黄石|864202','十堰|864203','宜昌|864205','襄樊|864206','鄂州|864207','荆门|864208','孝感|864209','荆州|864210','黄冈|864211','咸宁|864212','随州|864213','恩施|864228','其他|864290'];mtstr_head['8643']=['长沙|864301','株洲|864302','湘潭|864303','衡阳|864304','邵阳|864305','岳阳|864306','常德|864307','张家界|864308','益阳|864309','郴州|864310','永州|864311','怀化|864312','娄底|864313','湘西|864331'];mtstr_head['8644']=['广州|864401','韶关|864402','深圳|864403','珠海|864404','汕头|864405','佛山|864406','江门|864407','湛江|864408','茂名|864409','肇庆|864412','惠州|864413','梅州|864414','汕尾|864415','河源|864416','阳江|864417','清远|864418','东莞|864419','中山|864420','潮州|864451','揭阳|864452','云浮|864453'];mtstr_head['8645']=['南宁|864501','柳州|864502','桂林|864503','梧州|864504','北海|864505','防城港|864506','钦州|864507','贵港|864508','玉林|864509','百色|864510','贺州|864511','河池|864512','来宾|864513','崇左|864514'];mtstr_head['8646']=['海口|864601','三亚|864602','其他|864690'];mtstr_head['8650']=['万州|865001','涪陵|865002','渝中|865003','大渡口|865004','江北|865005','沙坪坝|865006','九龙坡|865007','南岸|865008','北碚|865009','万盛|865010','双桥|865011','渝北|865012','巴南|865013','黔江|865014','长寿|865015','綦江|865016','潼南|865017','铜梁|865018','大足|865019','荣昌|865020','璧山|865021','梁平|865022','城口|865023','丰都|865024','垫江|865025','武隆|865026','忠县|865027','开县|865028','云阳|865029','奉节|865030','巫山|865031','巫溪|865032','石柱|865033','秀山|865034','酉阳|865035','彭水|865036','江津|865037','合川|865038','永川|865039','南川|865040'];mtstr_head['8651']=['成都|865101','自贡|865103','攀枝花|865104','泸州|865105','德阳|865106','绵阳|865107','广元|865108','遂宁|865109','内江|865110','乐山|865111','南充|865113','眉山|865114','宜宾|865115','广安|865116','达州|865117','雅安|865118','巴中|865119','资阳|865120','阿坝|865132','甘孜|865133','凉山|865134'];mtstr_head['8652']=['贵阳|865201','六盘水|865202','遵义|865203','安顺|865204','铜仁|865222','黔西南|865223','毕节|865224','黔东南|865226','黔南|865227'];mtstr_head['8653']=['昆明|865301','曲靖|865303','玉溪|865304','保山|865305','昭通|865306','丽江|865307','思茅|865308','临沧|865309','楚雄|865323','红河|865325','文山|865326','西双版纳|865328','大理|865329','德宏|865331','怒江傈|865333','迪庆|865334'];mtstr_head['8654']=['拉萨|865401','昌都|865421','山南|865422','日喀则|865423','那曲|865424','阿里|865425','林芝|865426'];mtstr_head['8661']=['西安|866101','铜川|866102','宝鸡|866103','咸阳|866104','渭南|866105','延安|866106','汉中|866107','榆林|866108','安康|866109','商洛|866110'];mtstr_head['8662']=['兰州|866201','嘉峪关|866202','金昌|866203','白银|866204','天水|866205','武威|866206','张掖|866207','平凉|866208','酒泉|866209','庆阳|866210','定西|866211','陇南|866212','临夏|866229','甘南|866230'];mtstr_head['8663']=['西宁|866301','海东|866321','海北|866322','黄南|866323','海南|866325','果洛|866326','玉树|866327','海西|866328'];mtstr_head['8664']=['银川|866401','石嘴山|866402','吴忠|866403','固原|866404','中卫|866405'];mtstr_head['8665']=['乌鲁木齐|866501','克拉玛依|866502','吐鲁番|866521','哈密|866522','昌吉|866523','博尔塔拉|866527','巴音郭楞|866528','阿克苏|866529','克孜勒苏|866530','喀什|866531','和田|866532','伊犁|866540','塔城|866542','阿勒泰|866543','其他|866590'];mtstr_head['8671']=['新竹|867101','高雄|867102','基隆|867103','台中|867104','台南|867105','台北|867106','桃园|867107','云林|867108'];
function getCity_head(){var prov=$("#Srh_Province_head").val();var dropMyCity=document.getElementById("Srh_City_head");var i;var j=1;dropMyCity.length=0;dropMyCity[0]=new Option("任意","-1");var _citys=mtstr_head[prov];if(_citys){for(var i=0;i<_citys.length;i++){var _cityInfoArr=_citys[i].split("|");dropMyCity.options[j]=new Option(_cityInfoArr[0],_cityInfoArr[1]);j++;}}}
function sy_search_head(){
	
	var url_  = "http://search.baihe.com/advanceSearch.action?pageId=1&&criteria.change=0&&ord=1&&criteria.gender="+$("#criteriaGender").val();
	url_+="&&criteria.match_minage="+$("#minAge_head").val()+"&&criteria.match_maxage="+$("#maxAge_head").val() ;
	url_+="&&criteria.provinceId="+$("#Srh_Province_head").val()+"&&criteria.districtId="+$("#Srh_City_head").val() ;
	if($("#hasPhoto_head").attr("checked")){
			 url_+="&&criteria.havingpic="+$("#hasPhoto_head").val() ;
	}
	window.open(url_);
}
function bzt_getCookieVal(offset) {
    var endstr = document.cookie.indexOf (";", offset);
    if (endstr == -1) {
        endstr = document.cookie.length;
    }
    return unescape(document.cookie.substring(offset, endstr));
}

// primary function to retrieve cookie by name
function bzt_getCookie(name) {
    var arg = name + "=";
    var alen = arg.length;
    var clen = document.cookie.length;
    var i = 0;
    while (i < clen) {
        var j = i + alen;
        if (document.cookie.substring(i, j) == arg) {
            return bzt_getCookieVal(j);
        }
        i = document.cookie.indexOf(" ", i) + 1;
        if (i == 0) break; 
    }
    return "";
}

// store cookie value with optional details as needed
function bzt_setCookie(name, value, expires, path, domain, secure) {
    document.cookie = name + "=" + escape (value) +
        ((expires) ? "; expires=" + expires : "") +
        ((path) ? "; path=" + path : "") +
        ((domain) ? "; domain=" + domain : "") +
        ((secure) ? "; secure" : "");
}

// remove the cookie by setting ancient expiration date
function bzt_deleteCookie(name,path,domain) {
    if (bzt_getCookie(name)) {
        document.cookie = name + "=" +
            ((path) ? "; path=" + path : "") +
            ((domain) ? "; domain=" + domain : "") +
            "; expires=Thu, 01-Jan-70 00:00:01 GMT";
    }
}

// utility function to retrieve an expiration date in proper
// format; pass three integer parameters for the number of days, hours,
// and minutes from now you want the cookie to expire (or negative
// values for a past date); all three parameters are required,
// so use zeros where appropriate
function bzt_getExpDate(days, hours, minutes) {
    var expDate = new Date( );
    if (typeof days == "number" && typeof hours == "number" && 
        typeof hours == "number") {
        expDate.setDate(expDate.getDate( ) + parseInt(days));
        expDate.setHours(expDate.getHours( ) + parseInt(hours));
        expDate.setMinutes(expDate.getMinutes( ) + parseInt(minutes));
        return expDate.toGMTString( );
    }
}
var bzt_loginUserId = bzt_getCookie("GCUserID");
if(bzt_loginUserId == ""){
	bzt_loginUserId = 0;
}else{
	bzt_loginUserId = bzt_loginUserId * 1;
}
 

if(bzt_headType==0&&bzt_loginUserId<=0){

	var num=bzt_curUrl.indexOf("?");
	var policy_f = "" ;
	var Channel_f = "" ;
	var Code_f = "" ;
	var paras = "" ;                  
	var bzt_curUrl_para = "" ;
	if(num > 0 && num < bzt_curUrl.length){	
		  bzt_curUrl_para =  bzt_curUrl.substring(num+1);
		  paras = bzt_curUrl_para;
		  
			var arr = bzt_curUrl_para.split("&");
			for(var i = 0 ; i < arr.length ; i ++){
				var p = arr[i];
				var arr1 = p.split("=");
				if(arr1[0] == "policy"){
					policy_f = arr1[1];
				}else if(arr1[0] == "Channel"){
					Channel_f = arr1[1];;
				}else if(arr1[0] == "Code"){
					Code_f = arr1[1] ;
				}
			}
	}
	//Channel=2345&Code=140021
	//Channel=2345&Code=140021-k 
	/*if(Channel_f=='2345'){
		if(Code_f=='140021'){
			window.location.href="http://www.baihe.com/index2345.shtml?"+paras ;
		}
		if(Code_f=='140021-k'){
			window.location.href="http://www.baihe.com/index2345.shtml?"+paras ;
		}
	}*/
}


/*if(bzt_headType==0&&bzt_loginUserId<1){
	var isBaiduLogon_ = bzt_getCookie("BAIDUID");
	if(typeof(isBaiduLogon_)!='undefined'&&isBaiduLogon_!=null&&isBaiduLogon_!=''){
		location.href="http://open.baihe.com/connector/t/baiduAuthorize.action";	
	}
}*/
function isQzoneUser(){
     var qquser = bzt_getCookie("qzoneUser");
     if(qquser!=null&&qquser!=''){
     		return true;
     }else{
    	 return false ; 
     }
}
function isAlipayUser(){
     var aliuser = bzt_getCookie("alipayUser");
     if(aliuser!=null&&aliuser!=''){
     		return true;
     }else{
    	 return false ; 
     }
}

function isBaiduUser(){
     var aliuser = bzt_getCookie("baiduUser_baiheUserId");
     if(aliuser!=null&&aliuser!=''){
     		return true;
     }else{
    	 return false ; 
     }
}
function isRenRenUser(){
     var aliuser = bzt_getCookie("renrenUser");
     if(aliuser!=null&&aliuser!=''){
     		return true;
     }else{
    	 return false ; 
     }
}
function isSinaWbUser(){
     var aliuser = bzt_getCookie("sinaWbUser");
     if(aliuser!=null&&aliuser!=''){
     		return true;
     }else{
    	 return false ; 
     }
}
function isKaixinUser(){
     var aliuser = bzt_getCookie("kaixinUser");
     if(aliuser!=null&&aliuser!=''){
     		return true;
     }else{
    	 return false ; 
     }
}
var alipayuser_boolean = isAlipayUser();
var qquser_boolean = isQzoneUser();
var baiduuser_boolean = isBaiduUser();
var renrenuser_boolean = isRenRenUser();
var sinawbuser_boolean = isSinaWbUser();
var kaixinuser_boolean = isKaixinUser();

function bzt_getCurrentFileName(){
	var l = "";
	if(bzt_curUrl.indexOf("?")==-1){
		l=bzt_curUrl.length;
	}else{
		l=bzt_curUrl.indexOf("?");
	}   
	return bzt_curUrl.substring(bzt_curUrl.lastIndexOf("/")+1,l);
}
var ChristmasFlash = "百合网.心灵匹配成就幸福婚姻" ;
/* ChristmasFlash = '<object width="225" height="78" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="FlashID"><param value="http://images1.baihe.com/images/baihe_new/images/header_new/Christmas_logo.swf" name="movie">';
ChristmasFlash+='<param value="high" name="quality"><param value="opaque" name="wmode"><param value="9.0.45.0" name="swfversion"><param value="Scripts/expressInstall.swf" name="expressinstall">' ;
ChristmasFlash+='	<!--[if !IE]>-->	<object width="225" height="78" data="http://images1.baihe.com/images/baihe_new/images/header_new/Christmas_logo.swf" type="application/x-shockwave-flash"><!--<![endif]-->' ;
ChristmasFlash+='	<param value="high" name="quality"><param value="opaque" name="wmode"><param value="9.0.45.0" name="swfversion"><param value="Scripts/expressInstall.swf" name="expressinstall">' ;
ChristmasFlash+='<div style="display:none;">	<h4>此页面上的内容需要较新版本的 Adobe Flash Player。</h4>	<p><a href="http://www.adobe.com/go/getflashplayer"><img width="112" height="33" alt="获取 Adobe Flash Player" src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif"></a></p></div>' ;
ChristmasFlash+='<!--[if !IE]>--></object><!--<![endif]-->	</object>' ;*/



var bzt_adArr = new Array();
bzt_adArr["http://search.baihe.com"] = "http://bhtg.baihe.com/place_169.html";
bzt_adArr["http://profile.baihe.com/new/BasicInfo"] = "http://bhtg.baihe.com/place_175.html";
bzt_adArr["http://top.baihe.com"] = "http://bhtg.baihe.com/place_170.html";
bzt_adArr["http://user.baihe.com"] = "http://bhtg.baihe.com/place_168.html";//"http://bhtg.baihe.com/stat.html?ggCode=mybaiheadvert_0#http://news.baihe.com/bhtg/mybaihetop_advert.html";
bzt_adArr["http://msg.baihe.com"] = "http://bhtg.baihe.com/place_168.html";
bzt_adArr["http://score.baihe.com"] = "http://bhtg.baihe.com/place_168.html";
bzt_adArr["http://user1.baihe.com/MyBaihe"] = "http://bhtg.baihe.com/place_168.html";
bzt_adArr["http://blog.baihe.com"] = "http://bhtg.baihe.com/place_168.html";
bzt_adArr["http://invite.baihe.com"] = "http://bhtg.baihe.com/place_168.html";
bzt_adArr["http://payment.baihe.com"] = "http://bhtg.baihe.com/place_168.html";
bzt_adArr["http://coin.baihe.com"] = "http://bhtg.baihe.com/place_168.html";
bzt_adArr["http://userinfo.baihe.com"] = "http://bhtg.baihe.com/place_168.html";
bzt_adArr["http://auth.baihe.com"] = "http://bhtg.baihe.com/place_168.html";
bzt_adArr["http://photograph.baihe.com"] = "http://bhtg.baihe.com/place_168.html";
bzt_adArr["http://priv.baihe.com"] = "http://bhtg.baihe.com/place_168.html";
bzt_adArr["http://profile.baihe.com/new/SupplyInfo"] = "http://bhtg.baihe.com/place_176.html";
bzt_adArr["http://profile.baihe.com/new/AlbumInfo"] = "http://bhtg.baihe.com/place_177.html";
bzt_adArr["http://profile.baihe.com/new/BlogInfo"] = "http://bhtg.baihe.com/place_178.html";
bzt_adArr["http://profile.baihe.com/new/OuterInfo"] = "http://bhtg.baihe.com/place_179.html";
bzt_adArr["http://profile.baihe.com/new/InnerInfo"] = "http://bhtg.baihe.com/place_180.html";      
bzt_adArr["http://profile.baihe.com/new/Video"] = "http://bhtg.baihe.com/place_232.html";
bzt_adArr["http://psymatch.baihe.com"] = "http://bhtg.baihe.com/place_181.html";
bzt_adArr["http://safe.baihe.com"] = "http://bhtg.baihe.com/place_182.html";
bzt_adArr["http://story.baihe.com"] = "http://bhtg.baihe.com/place_172.html";
bzt_adArr["http://media.baihe.com"] = "http://bhtg.baihe.com/place_173.html";
bzt_adArr["http://event.baihe.com"] = "http://bhtg.baihe.com/place_171.html";
bzt_adArr["http://video.baihe.com"] = "http://bhtg.baihe.com/place_168.html";
bzt_adArr["http://cityonline.baihe.com"] = "http://bhtg.baihe.com/place_168.html";
bzt_adArr["http://profile.baihe.com/new/deepMatchResultList.action"] = "http://bhtg.baihe.com/place_168.html";
bzt_adArr["http://impress.baihe.com/Impress"] = "http://bhtg.baihe.com/place_180.html";    
bzt_adArr["http://app.baihe.com/star"] = "http://bhtg.baihe.com/place_180.html";
bzt_adArr["http://app.baihe.com/love"] = "http://bhtg.baihe.com/place_180.html";
bzt_adArr["http://app.baihe.com/firstsight"] = "http://bhtg.baihe.com/place_180.html";
bzt_adArr["http://party.baihe.com"] = "http://bhtg.baihe.com/place_180.html";
function bzt_getadHtml(){
	/*if(bzt_curUrl.indexOf("http://top.baihe.com") == 0){
		return "<script type=\"text/javascript\">"+
						"ac_as_id = 69839;"+
						"ac_click_track_url = \"\";ac_format = 0;ac_mode = 1;"+
						"ac_width = 950;ac_height = 70;"+
						"</script>"+
						"<script type=\"text/javascript\" src=\"http://static.acs86.com/g.js\"></script>"+
						"<script type=\"text/javascript\">"+
						"(function(){"+
						"		if(typeof(_ACS86_ENABLE_69839_)!=\"undefined\" && _ACS86_ENABLE_69839_ == false){"+
						"			$(\"#_header_ad\").html(\"<iframe width='468' height='60' marginheight='0' marginwidth='0' frameborder='0' scrolling='no' id='iframe_src' src='\"+bzt_getad()+\"'></iframe>\");"+
						"		}else{"+
						"			setTimeout(arguments.callee,10);"+
						"}"+
						"})();"+
						"</script>";
						
	}else{
		return "<iframe width='468' height='60' marginheight='0' marginwidth='0' frameborder='0' scrolling='no' id='iframe_src' src='"+bzt_getad()+"'></iframe>";
	}*/
	return "<iframe width='468' height='60' marginheight='0' marginwidth='0' frameborder='0' scrolling='no' id='iframe_src' src='"+bzt_getad()+"'></iframe>";
}

function bzt_getad(){
	var _adurl = "http://bhtg.baihe.com/place_169.html";
	for(var ele in bzt_adArr){
		if(bzt_curUrl.indexOf(ele) == 0){
			_adurl =  bzt_adArr[ele];
			break;
		}
	}

	return _adurl;
}

var _bzt_adurl = bzt_getad();

function bzt_showad(){
		$("#iframe_src").attr("src", bzt_getad());
}
var newmsg_all_inHead = 0 ;
function bzt_showMsgInfo(msgInfo,isFirstPage){
	 
	
	var _userName = msgInfo.userName;
	var _gender  = msgInfo.gender;
	$("#criteriaGender > option").each(function(){
			if($(this).val()== _gender){
				$(this).attr("selected",false);
			}else{
				$(this).attr("selected",true);
			}
	});
	if(isFirstPage){
		_userName = index_split(_userName,10);

		$("#sy_UserName").html(_userName+"&nbsp;");
	
		$("#sy_newMsg").html(msgInfo.newMsg);
		
		
		$("#sy_CityName").html(msgInfo.cityChn);
		
		var p = msgInfo.mainPhoto ;
		if(typeof(p)!='undefined'&&p!=null){
			p = p.replace("120_150","36_45");
			var photohtml = "<img src=\""+p+"\" id=\"sy_photo\" width=\"36\" height=\"45\"   />" ;
			$("#sy_profile_url").html(photohtml);
		}
		var cityCode = msgInfo.cityCode;

		if(cityCode && cityCode.length >= 2){
			index_yjss_CountryId = cityCode.substring(0,2);	
		}
		if(cityCode && cityCode.length >= 3){
			index_yjss_provinceId = cityCode.substring(0,4);
		}		
	}else{
		//if(_userName.length > 6){
		//	_userName = _userName.substring(0,6);
		//}
		if(qquser_boolean){       
			$("#bzt_userNameA").removeClass(); 
		  $("#bzt_userNameA").addClass("QQIcon");
		}
		if(alipayuser_boolean){     
		 $("#bzt_userNameA").removeClass();               
		 $("#bzt_userNameA").addClass("payIcon");
		}
		if(baiduuser_boolean){     
		 $("#bzt_userNameA").removeClass();               
		 $("#bzt_userNameA").addClass("baiduIcon");
		}
		if(renrenuser_boolean){     
		 $("#bzt_userNameA").removeClass();               
		 $("#bzt_userNameA").addClass("renrenIcon");
		}
		if(sinawbuser_boolean){     
		 $("#bzt_userNameA").removeClass();               
		 $("#bzt_userNameA").addClass("sinaIcon");
		}
		if(kaixinuser_boolean){     
		 $("#bzt_userNameA").removeClass();               
		 $("#bzt_userNameA").addClass("kaixinIcon");
		}
		$("#bzt_userNameA").html(_userName);
		$("#bzt_userNameA").attr("href","http://profile.baihe.com/new/BasicInfo.action?oppId="+bzt_loginUserId);
		  
		var newmsg_ =  msgInfo.newMsg ;
		$("#bzt_msgSpan").html(newmsg_);
		if(!isNaN(newmsg_)&&parseInt(newmsg_)>0){
			 $("#mymsg_id").removeClass("msggrayIcon");
		   $("#mymsg_id").addClass("msgIcon");
		   newmsg_all_inHead = newmsg_ ;
		}else{
			 $("#mymsg_id").removeClass("msgIcon");
		   $("#mymsg_id").addClass("msggrayIcon");
		   newmsg_all_inHead = 0 ;
		}
		$("#bzt_systemMsgSpan").html(msgInfo.newSystemMsg);

		
	}

	
//	$("#bzt_giftSpan").html(msgInfo.newGift);
}

var msgInfoFromCookie = null;
var msgInfo_bzt_ck = null;


function addOverlay(){
//	alert(i);
	if(newmsg_all_inHead>0){
		$.pinify.addOverlay({
			title:"new msg",
			icon:"http://images.baihe.com/images/baihe_new/images/icon/ico/letter.ico"
		});
		$.pinify.flashTaskbar();
	}else{
		clearOverlayIcon();
	}
}

function clearOverlayIcon(){
	try {
		if (window.external.msIsSiteMode()) {
			window.external.msSiteModeClearIconOverlay();
		}
	}
	catch (e) {
		// Fail silently.
	}
}
function setIe9Info(){
	if(ie9()){
		loadjscssfile("http://images.baihe.com/js/jquery.pinify.min.js","js");
		loadjscssfile("http://images.baihe.com/images/baihe_new/images/icon/ico/baihe.ico","ico");
	//	createMeta("","百合网","application-name");
	//	createMeta("","百合网","msapplication-tooltip");
		createMeta("","width=1024;height=768","msapplication-window");
		createMeta("","name=我的百合;action-uri=http://user.baihe.com/User/member.jsp;icon-uri=http://images.baihe.com/images/baihe_new/images/icon/ico/smile.ico","msapplication-task");
		createMeta("","name=我的消息;action-uri=http://msg.baihe.com/;icon-uri=http://images.baihe.com/images/baihe_new/images/icon/ico/msg.ico","msapplication-task");
		createMeta("","name=我的邂逅;action-uri=http://user1.baihe.com/MyBaihe/get_myMatcher.action?comefrom=1;icon-uri=http://images.baihe.com/images/baihe_new/images/icon/ico/match.ico","msapplication-task");
		createMeta("","name=我的红豆;action-uri=http://coin.baihe.com/User/myLovePea.html;icon-uri=http://images.baihe.com/images/baihe_new/images/icon/ico/redbean.ico","msapplication-task");
		createMeta("","name=爱情搜索;action-uri=http://search.baihe.com/advanceSearch.action;icon-uri=http://images.baihe.com/images/baihe_new/images/icon/ico/search.ico","msapplication-task");
		window.setInterval("addOverlay()", 90000);
	}
}
function ie9(){
		var browser=navigator.appName 
		var b_version=navigator.appVersion 
		var version=b_version.split(";"); 
		if(version!=null&&version.length>=2){
				var trim_Version=version[1].replace(/[ ]/g,""); 
				if(browser=="Microsoft Internet Explorer" && trim_Version=="MSIE6.0") 
				{ 
					//alert("IE 6.0"); 
					return false;
				} 
				else if(browser=="Microsoft Internet Explorer" && trim_Version=="MSIE7.0") 
				{ 
					//alert("IE 7.0"); 
					return false;
				} 
				else if(browser=="Microsoft Internet Explorer" && trim_Version=="MSIE8.0") 
				{ 
					//alert("IE 8.0"); 
					return false;
				} 
				else if(browser=="Microsoft Internet Explorer" && trim_Version=="MSIE9.0") 
				{ 
					//alert("IE 9.0"); 
					return true;
				}
		 }else{
		 		return false;
		 	}
	}

function bzt_showMsgInfoNew_loop(){	
	var isFpage = bzt_headType==0?true:false;
	bzt_showMsgInfoNew(isFpage);
}
var loopMsgInfoTask ;
var loopMsgTimes = 70000 ;//毫秒
function bzt_showMsgInfoNew(isFirstPage){
	
	clearInterval(loopMsgInfoTask);
	msgInfoFromCookie = "";
//	msgInfoFromCookie = bzt_getCookie("ck_msgInfo_bzt_"+bzt_loginUserId);
	
	if(msgInfoFromCookie != ""){
		msgInfoFromCookie = decodeURI(msgInfoFromCookie);
		var msgInfoFromCookie_arr = msgInfoFromCookie.split("|");
		msgInfo_bzt_ck = {"userName":msgInfoFromCookie_arr[2],"newMsg":msgInfoFromCookie_arr[0],"cityCode":msgInfoFromCookie_arr[1],"groupID":msgInfoFromCookie_arr[3]};
		bzt_showMsgInfo(msgInfo_bzt_ck,isFirstPage);
	  loopMsgInfoTask = setInterval(bzt_showMsgInfoNew_loop,loopMsgTimes);
	}else{
		
//		if(location.href.toString().indexOf("http://msg.baihe.com") < 0){
			$.getScript("http://m4h.baihe.com",function(){	
				if(isFirstPage&&baiduuser_boolean&&typeof(msgInfo)=='undefined'){
					  location.href="http://user.baihe.com/User/member.jsp";
					  return ;
				}
				var userNoResultCount = msgInfo.userNoResultCount;//not swap info
				if(typeof(userNoResultCount)!='undefined'&&userNoResultCount!='' && !isNaN(userNoResultCount)){
							 if(userNoResultCount>99){
							 			userNoResultCount = "99+" ;
							 }
							 if(userNoResultCount>0||userNoResultCount=='99+'){
									$("#leftmenu_smrz").html(userNoResultCount);
									$("#leftmenu_smrz").show();
						  }
				}
				
				msgInfo_bzt_ck = msgInfo;

				bzt_showMsgInfo(msgInfo,isFirstPage);

				bzt_ck_msgInfo(msgInfo);
        
        checkGroupid(msgInfo);
    	  loopMsgInfoTask = setInterval(bzt_showMsgInfoNew_loop,loopMsgTimes);
				
			});
//		}else{
//			$.get("http://m4h.baihe.com/getMsgCount.php",function(data){
//				eval(data);
//				msgInfo_bzt_ck = msgInfo;
//
//				bzt_showMsgInfo(msgInfo,isFirstPage);
//				
//				bzt_ck_msgInfo(msgInfo);
//
				
//			});
//		}
	}
}

function bzt_ck_msgInfo(msgInfo){
	var _msgInfoFromCookie = encodeURI(msgInfo.newMsg+"|"+msgInfo.cityCode+"|"+msgInfo.userName+"|"+msgInfo.groupID);
	bzt_setCookie("ck_msgInfo_bzt_"+bzt_loginUserId,_msgInfoFromCookie,bzt_getExpDate(0,0,1),"/","baihe.com");
}
var _baiheHead_start_time = new Date();

function clkMoreLink(){
	$("#morelinkLi").addClass("now");
	$("#morelinkLi").removeClass("arrow");
	$("#morelinkDiv").show();
	DivSetVisible(true);
}

function hiddenMoreLink(){
	$("#morelinkLi").removeClass("now");
	$("#morelinkLi").addClass("arrow");
	$("#morelinkDiv").hide();
	DivSetVisible(false);
}

var isie =( navigator.appName == "Microsoft Internet Explorer"); 

function DivSetVisible(state)
{
	var DivRef = document.getElementById('morelinkDiv');
	var IfrRef = $('#DivShim');
	
	if(state)
	{
		if(isie){
			IfrRef.css("width",DivRef.offsetWidth);
			IfrRef.css("height",DivRef.offsetHeight);
		}else{
			IfrRef.css("width","0px");
			IfrRef.css("height","0px");
		}
		
		IfrRef.show();
	}
	else{
		IfrRef.hide();
	}
}

function showHello(){
	var _helloCont = '';
	var _hour = new Date().getHours();

	switch (_hour){
	case 0:
	case 1:
	case 2:
	case 3:
	case 4:
	case 5:
		_helloCont = '凌晨好!';
		break;
	case 6:
	case 7:
	case 8:
		_helloCont = '早上好!';
		break;
	case 9:
	case 10:
	case 11:
		_helloCont = '上午好!';
		break;
	case 12:
	case 13:
		_helloCont = '中午好!';
		break;
	case 14:
	case 15:
	case 16:
	case 17:
	case 18:
		_helloCont = '下午好!';
		break;
	case 19:
	case 20:
	case 21:
	case 22:
	case 23:
		_helloCont = '晚上好!';
	}
	return _helloCont;
}
function writeGoogleCode_indexPage(){
		
	
	  document.write("	<!-- Google Code for &#20027;&#39029; Remarketing List --><script type=\"text/javascript\"> ");
		document.write("	/* <![CDATA[ */ ");
		document.write("	var google_conversion_id = 1003452191; ");
	  document.write("	var google_conversion_language = \"en\"; ");
    document.write("	var google_conversion_format = \"3\"; ");
 	  document.write("	var google_conversion_color = \"666666\"; "); 
	  document.write("	var google_conversion_label = \"NHtNCKnb3AEQn-693gM\"; "); 
    document.write("	var google_conversion_value = 0; "); 
    document.write("	/* ]]> */ "); 
    document.write("	</script> "); 
    document.write("  <div style='display:none;' id='googleCodeSpan'> ");
	  document.write("	<script type=\"text/javascript\" src=\"http://www.googleadservices.com/pagead/conversion.js\"> "); 
	  document.write("	</script> "); 
	  document.write("	</div> "); 
   
	 // document.write("	<noscript> "); 
	 // document.write("	\< div style=\"display:inline;\" \> "); 
	 // document.write("	\< img height='1' width='1' style='border-style:none;' alt='' src='http://www.googleadservices.com/pagead/conversion/1003452191/?label=NHtNCKnb3AEQn-693gM&amp;guid=ON&amp;script=0'/ \> "); 
	 // document.write("	\</div \> "); 
   // document.write("	</noscript> "); 

}
function checkGroupid(msg){
	  
	  if(typeof(msg)=='undefined'){
	  	return ;
	  }
	  var gid = parseInt(msg.groupID);
	  if(gid<100){
  	    gid = 1 ; 
    }else{
	  	if(gid==114||gid==115||gid==121||gid==126){
	  		gid = 2 ;
	  	}
	    else{
	    	gid = 0 ;
	    }
    }
		if(gid ==1){
		   $("#upgrade_crystal_li").show();
		}
		if(gid ==2){
			  if(bzt_headType==2){
			 	 	$("#upgrade_crystal_li").html("<a href='http://bhtg.baihe.com/stat.html?ggCode=vip-profilebutton_1#http://vip.baihe.com/' target='_blank'>升级VIP</a>");
			  }else if(bzt_headType==1){
			  	$("#upgrade_crystal_li").html("<a class='p' href='http://bhtg.baihe.com/stat.html?ggCode=vip-profilebutton_1#http://vip.baihe.com/' target='_blank'>升级VIP</a>");
			  }
				$("#upgrade_crystal_li").show();
				$("#upgrade_crystal_li").removeClass("upgrade");
				$("#upgrade_crystal_li").removeClass("upgrade_crystal");
				$("#upgrade_crystal_li").addClass("vip_upgrade");
		}
}

var bzt_isMainUser = bzt_loginUserId > 0;
var isLogonMainUser = bzt_isMainUser;
createRenRenMeta();
function topSmallClose(){
	$("#TopSmall").hide();
}
function  updateBaiheService(){
	 $("#baiheServiceA").toggleClass("now"); 
	 $("#baiheServices").toggle();
	 $("#baiheServicesIframe").toggle();
}
if(bzt_headType == 0){//home page

/*
if(bzt_isMainUser){
	document.write("<div class='bhLoginText'>");
	document.write("	<div class='bhLoginTop fixfloat'>");
	document.write("		<div class='loginFun'><a href='http://passport.baihe.com/logout.jsp'>登出</a>|<a  target='_blank' href='http://help.baihe.com/'>帮助</a></div>");
	document.write("		<ul>")
	document.write("			<li><span id='bzt_showHelloLi'></span>&nbsp;&nbsp;<a target='_blank' id='bzt_userNameA'></a>　<a class='msggrayIcon' id='mymsg_id' href='http://msg.baihe.com'>新消息 <strong id='bzt_msgSpan'>0</strong></a></li>");
	document.write("			<li><a href='http://msg.baihe.com/sys.jsp'>新通知 <strong id='bzt_systemMsgSpan'>0</strong></a></li>");
	document.write("			<li><a style='cursor:pointer' class='chatIcon'>聊天 <strong id='bzt_systemWebImSpan'>0</strong></a></li>");
	document.write("			<li class='arrow'>");
	document.write("				<a class='arrowIcon' id='baiheServiceA' style='cursor:pointer' onclick='javascript:$(\"#baiheServiceA\").toggleClass(\"now\"); $(\"#baiheServices\").toggle(); $(\"#baiheServicesIframe\").toggle();'>百合服务</a> ");
	document.write("				<a class='mobileIcon' href='http://news.baihe.com/3g.baihe.html'>手机百合</a>");
	document.write("				<iframe  id='baiheServicesIframe' style='position:absolute; border:0; top:19px; left:0px; width:114px; height:168px; z-index:1;filter:alpha(opacity=0,Style=0);display:none;'></iframe>");
	document.write("				<div class='servieCont' id='baiheServices' style='display:none;z-index:100;'>");
	document.write("					<a href='http://coin.baihe.com/User/myLovePea.html'>> 红豆充值</a>");
	document.write("					<a href='http://payment.baihe.com/product/crystal/index.jsp'>> 水晶百合</a>");
	document.write("					<a href='http://payment.baihe.com/product/99bh/index.jsp'>> 电话红娘</a>");
	document.write("					<a href='http://payment.baihe.com/product/goldbh/index.jsp'>> 金百合服务</a>");
	document.write("					<a href='http://vip.baihe.com/'>> 顾问服务</a>");
	document.write("				</div>");
	document.write("			</li>");
	document.write("			<li><iframe src='http://open.qzone.qq.com/like?url=http%3A%2F%2Fuser.qzone.qq.com%2F1532773876&type=button_num&width=400&height=30' allowtransparency='true' scrolling='no' border='0' frameborder='0' style=' width:110px; height:21px;border:none;overflow:hidden;'></iframe></li>");
	document.write("			<li class='last'><iframe scrolling='no' frameborder='0' allowtransparency='true' src='http://www.connect.renren.com/like?url=http%3A%2F%2Fpage.renren.com%2F600875529&showfaces=false' style=' width:115px; height:22px;border:none;overflow:hidden;'></iframe></li>");
	document.write("		</ul>");
	document.write("	</div>");
	document.write("</div>");
}*/
document.write(realAdvertInfo);
document.write("<div id='TopBig'><img src='http://images1.baihe.com/images/baihe_new/images/skin_index/AdTop_b.jpg' width='980' height='90' /></div>");
document.write("<div id='TopSmall'><a class='close' href='javascript:topSmallClose()'>关闭</a><img src='http://images1.baihe.com/images/baihe_new/images/skin_index/AdTop_s.jpg' width='980' height='30' /></div>");
document.write("<div class='bhHeader'>");
document.write("	<h1><a href='http://www.baihe.com/'>"+ChristmasFlash+"</a></h1>");
document.write("	<div class='bhHomeNav fixfloat'>");
document.write("		<div class='bhTel fixfloat'>");
document.write("			<ul>");
document.write("				<li class='tel01'>猎婚专线：<strong style='cursor:pointer;'onclick='javascript:window.open(\"http://bhtg.baihe.com/stat.html?ggCode=vip-profiletop_1#http://vip.baihe.com/\")'>4008-800-520</strong></li>");
document.write("				<li class='tel02'>咨询专线：<strong style='cursor:pointer;'onclick='javascript:window.open(\"http://bhtg.baihe.com/stat.html?ggCode=vip-profiletop_1#http://vip.baihe.com/\")'>4000-299-520</strong></li>");
document.write("			</ul>");

if(!bzt_isMainUser){
	document.write("			<div class='login'>");
	document.write("				<a class='reg' href='http://love.baihe.com/' target='_blank'>免费注册</a><a class='btn' id='bhLoginA' style='cursor:pointer;' onclick=' $(\"#bhLoginA\").toggleClass(\"btn\"); $(\"#bhLoginA\").toggleClass(\"current\"); $(\"#bhLoginDiv\").toggle();'>请登录</a>");
	document.write("				<div class='bhLoginCont' style='display:none;' id='bhLoginDiv'>");
	document.write("		    <div class='errorPoint' id='errorLogininfo' style='display:none;'></div> ");
	document.write("					<dl>");
	document.write("						<dt>登录帐户：</dt>");
	document.write("						<dd>");
	document.write("							<input class='inputbox' name='txtLoginEMail' id='txtEmailAddress' type='text' onfocus='if(this.value==\"邮箱或手机号\"){this.value=\"\";} $(\"#errMsg_span\").html(\"\")' onblur='if(this.value==\"\"){this.value=\"邮箱或手机号\"}' value='邮箱或手机号' onkeydown='return keyDownOfEmail(event)' />");
	document.write("						</dd>");
	document.write("					</dl>");
	document.write("					<dl>");
	document.write("						<dt>密码：</dt>");
	document.write("						<dd><input class='inputbox' type='password' name='txtLoginPwd' id='txtPassword' class='password'  onfocus='$(\"#errMsg_span\").html(\"\");' onkeydown='return keyDownOfPasswd(event)' /></dd>");
	document.write("					</dl>");
	document.write("					<div class='btnCont'>");
	document.write("						<a class='loginBtn' href='javascript:syLogin()'>登 录</a>");
	document.write("					<span>");
	document.write("							<input type='checkbox' value='Yes' name='chkRememberMe' id='chkRemmberPwd' class='checkbox'>");
	document.write("							<label>自动登录</label>");
	document.write("							<a href='http://passport.baihe.com/forgotPwd.html' target='_blank'>忘记密码?</a>");
	document.write("						</span>");
	document.write("					</div>");
	document.write("					<div class='loginMode'><ul>");
	//document.write("						<a class='QQ' style='cursor:pointer;' onclick='javascript:window.open(\"http://open.baihe.com/connector/t/qzoneRequestTokenQuire.action\",\"TencentLogin\",\"width=450,height=320,menubar=0,scrollbars=0,status=1,titlebar=0,toolbar=0,location=1\")'>QQ登录</a>|<a class='alipay' style='cursor:pointer;' onclick='javascript:window.open(\"http://alipay.baihe.com/baiheAlipay/alipay!alipayLink.action\")'>支付宝登录</a>");
	document.write("<li class='QQ'><a  style='cursor:pointer;' href='http://open.baihe.com/connector/t/qzoneRequestTokenQuire.action'>QQ登录</a><span>|</span></li><li class='sina'><a  style='cursor:pointer;' href='http://open.baihe.com/connector/t/sinaWbAuthorize.action'>微博登录</a><span>|</span></li>");
	document.write("<li class='baidu'><a  style='cursor:pointer;' href='http://open.baihe.com/connector/t/baiduAuthorize.action'>百度登录</a></li><li class='renren'><a  style='cursor:pointer;' href='http://open.baihe.com/connector/t/renRenAuthorize.action'>人人登录</a><span>|</span></li>");
	document.write("<li class='kaixin'><a  style='cursor:pointer;' href='http://open.baihe.com/connector/t/kaixinAuthorize.action'>开心登录</a><span>|</span></li><li class='alipay'><a  style='cursor:pointer;' href='http://alipay.baihe.com/baiheAlipay/alipay!alipayLink.action'>支付宝登录</a></li>");
 

	document.write("					</ul></div>");
	document.write("				</div>");
	document.write("			</div>");
}
document.write("		</div>");
document.write("		<div class='bhNav fixfloat'>");
document.write("			<div class='homeNav'>");
document.write("				<a href='http://user.baihe.com/User/member.jsp'>我的百合</a>| ");
document.write("				<a href='http://search.baihe.com/'>爱情搜索</a>| ");
document.write("				<a href='http://cityonline.baihe.com/showOnlineList.action'>在线会员</a>| ");
document.write("				<a href='http://top.baihe.com/'>最新会员</a>| ");
document.write("				<a href='http://vip.baihe.com/'>顾问服务</a>| ");
document.write("				<a href='http://story.baihe.com/'>成功故事</a>| ");
document.write("				<a href='http://video.baihe.com/html/index.shtml'>精彩视频</a>| ");
//document.write("				<a href='http://shop.baihe.com/topics/topicsall_01/area/index.html'>商城</a>| ");
document.write("				<a href='http://emotion.baihe.com/'>情感工坊</a>");
document.write("			</div>");

document.write("			<div class='homeCity'>");
document.write("				<span class='intro' id='sy_curarea'></span>");
document.write("				<span onmouseout='hideSyArea()' onmouseover='showSyArea()' ><a href='javascript:showSyArea()'>其他分站</a>");
document.write("					<ul style='display: none;' id='sy_area_span'>	</ul>		");				
document.write("			  </span>");

document.write("			</div>");
document.write("		</div>");
document.write("	</div>");
document.write("</div>");

}else if (bzt_headType == 1){

document.write("<div class='bhLoginText'>");
document.write("	<div class='bhLoginTop fixfloat'>");
 if(bzt_isMainUser){
	document.write("		<div class='loginFun'><a  target='_blank' href='http://safe.baihe.com/'>安全中心</a>|<a  target='_blank' href='http://help.baihe.com/'>帮助</a>|<a   onclick='logOut()' style='cursor:pointer;'>退出</a></div>");
	document.write("		<ul>")
	document.write("			<li><span id='bzt_showHelloLi'></span>&nbsp;&nbsp;<a target='_blank' id='bzt_userNameA'></a>　<a class='msggrayIcon' id='mymsg_id' href='http://msg.baihe.com'>新消息 <strong id='bzt_msgSpan'>0</strong></a></li>");
	document.write("			<li><a href='http://msg.baihe.com/sys.jsp'>新通知 <strong id='bzt_systemMsgSpan'>0</strong></a></li>");
	document.write("			<li id='bzt_systemWebImLi' style='display:none;' class='chatCont'><a  id='bzt_systemWebImA' style='cursor:pointer' class='chatIcon' onclick='openBaiheChat_()'>聊天 <strong id='bzt_systemWebImSpan'>0</strong></a></li>");
 }else{
	document.write("		<div class='loginFun'><span id='bzt_showHelloLi'></span> 请<a href='http://passport.baihe.com/login.jsp'>登录</a>|<a  target='_blank' href='http://love.baihe.com/'>免费注册</a></div>");
	document.write("		<ul>")
 }
if(bzt_isMainUser){
		document.write("			<li class='arrow last'>");
}else{
		document.write("			<li class='arrow last' style='margin-left: 0px;'>");
}
document.write("				<span ><a class='arrowIcon' id='baiheServiceA' style='cursor:pointer' onclick='updateBaiheService()'>百合服务</a> ");
document.write("				<a class='mobileIcon' href='http://news.baihe.com/3g.baihe.html'>手机百合</a>");
document.write("				<iframe id='baiheServicesIframe' style='position:absolute; border:0; top:19px; left:0px; width:114px; height:168px; z-index:1;filter:alpha(opacity=0,Style=0);display:none;'></iframe>");
document.write("				<div class='servieCont' id='baiheServices' style='display:none;z-index:100;'>");
document.write("					<a href='http://coin.baihe.com/User/myLovePea.html'>> 红豆充值</a>");
document.write("					<a href='http://payment.baihe.com/product/crystal/index.jsp'>> 水晶百合</a>");
document.write("					<a href='http://payment.baihe.com/product/99bh/index.jsp'>> 电话红娘</a>");
//document.write("					<a href='http://payment.baihe.com/product/goldbh/index.jsp'>> 金百合服务</a>");
document.write("					<a href='http://vip.baihe.com/'>> 顾问服务</a>");
document.write("				</div></span>");
document.write("			</li>");
//document.write("			<li ><iframe scrolling='no' frameborder='0' allowtransparency='true' src='http://www.connect.renren.com/like?url=http%3A%2F%2Fpage.renren.com%2F600875529&showfaces=false' style=' width:70px; height:22px;border:none;overflow:hidden;'></iframe></li>");
//document.write("			<li class='last'><iframe src='http://open.qzone.qq.com/like?url=http%3A%2F%2Fuser.qzone.qq.com%2F1532773876&type=button_num&width=400&height=30' allowtransparency='true' scrolling='no' border='0' frameborder='0' style=' width:110px; height:21px;border:none;overflow:hidden;'></iframe></li>");
document.write("		</ul>");
document.write("	</div>");
document.write("</div>");          
document.write("<div class='bhHeader'>");  
document.write("	<h1><a href='http://www.baihe.com/'>"+ChristmasFlash+"</a></h1>");
document.write("	<div class='bhHomeNav fixfloat'>");
document.write(" <div class='userAD'> ");
if(_bzt_adurl != ""){
	//	document.write("				<iframe width='468' height='60' marginheight='0' marginwidth='0' frameborder='0' scrolling='no' id='iframe_src' src='"+_bzt_adurl+"'></iframe>");
		document.write(bzt_getadHtml());
}
document.write("		</div><div class='userTel'>");
document.write("				<a  class='telIcon01'>猎婚热线：<strong>400-8800-520</strong></a>");
document.write("				<a  class='telIcon02'>咨询专线：<strong>4000-299-520</strong></a>");
document.write("		</div></div></div>");
document.write("	<div class='nav'>");
document.write("			<ul>");
	if(bzt_isMainUser){
	//document.write("				<li class='baiheReport'><a href='http://bhtg.baihe.com/stat.html?ggCode=Navigation-sj_2#http://act.baihe.com/survey/1003survey/' target='_blank'><img src='http://images.baihe.com/images/baihe_new/images/baiheReport_btn01.gif' title='百合满意度调查' /></a></li>");
	//注释掉升级水晶百合 2011-04-13
 	  document.write("				<li id='upgrade_crystal_li' class='upgrade_crystal' style='display:none'><a class='p' href='http://bhtg.baihe.com/stat.html?ggCode=Navigation-sj_1#http://payment.baihe.com/product/crystal/index.jsp' target='_blank'>升级水晶百合</a></li>");
	}
	document.write("				<li id='BasicInfoLi'><a href='#' onclick='viewProfilePage(0);'>基本资料</a></li>");
	document.write("				<li id='SupplyInfoLi'><a href='#'  onclick='viewProfilePage(1);'>高级资料</a></li>");
	document.write("				<li id='AlbumInfoLi'><a href='#' onclick='viewProfilePage(2);'>个人相册</a></li>");
	document.write("				<li id='BlogInfoLi'><a href='#' onclick='viewProfilePage(3);'>个人博客</a></li>");
	document.write("				<li id='OuterInfoLi'><a href='#' onclick='viewProfilePage(4);'>外在匹配</a></li>");
	document.write("				<li id='InnerInfoLi'><a href='#' onclick='viewProfilePage(5);'>心灵匹配</a></li>");
	document.write("				<li id='VideoLi' ><a href='#' onclick='viewProfilePage(6);'>个人视频</a></li>");
document.write("			</ul>");
if(bzt_isMainUser){
	// to lixm : 修改此处的链接地址和参数
	//	document.write("				<li class='baiheReport'><a href='http://bhtg.baihe.com/stat.html?ggCode=Navigation-sj_2#http://act.baihe.com/survey/1003survey/' target='_blank'><img src='http://images.baihe.com/images/baihe_new/images/baiheReport_btn.gif' title='百合满意度调查' /></a></li>");
	document.write("			<div   id='upgrade_crystal_li' class='upgrade' style='display:none'><a href='http://bhtg.baihe.com/stat.html?ggCode=Navigation-sj_1#http://payment.baihe.com/product/crystal/index.jsp' target='_blank'>升级水晶百合</a></div>");
}
document.write("		</div>");
	var _profile_url = bzt_getCurrentFileName();
	_profile_url = _profile_url.substring(0,_profile_url.indexOf("."));
	if(_profile_url == "BlogList" || _profile_url == "BlogDetail"){
		_profile_url = "BlogInfo";
	}
	$("#"+_profile_url+"Li").addClass("current");	
	 
}else{

document.write("<div class='bhLoginText'>");
document.write("	<div class='bhLoginTop fixfloat'>");
 if(bzt_isMainUser){
	document.write("		<div class='loginFun'><a  target='_blank' href='http://safe.baihe.com/'>安全中心</a>|<a  target='_blank' href='http://help.baihe.com/'>帮助</a>|<a   style='cursor:pointer;' onclick='logOut()' >退出</a></div>");
	document.write("		<ul>")
	document.write("			<li><span id='bzt_showHelloLi'></span>&nbsp;&nbsp;<a target='_blank' id='bzt_userNameA'></a>　<a class='msggrayIcon' id='mymsg_id' href='http://msg.baihe.com'>新消息 <strong id='bzt_msgSpan'>0</strong></a></li>");
	document.write("			<li><a href='http://msg.baihe.com/sys.jsp'>新通知 <strong id='bzt_systemMsgSpan'>0</strong></a></li>");
	document.write("			<li id='bzt_systemWebImLi' style='display:none;' class='chatCont'><a id='bzt_systemWebImA' style='cursor:pointer' class='chatIcon' onclick='openBaiheChat_()'>聊天 <strong id='bzt_systemWebImSpan'>0</strong></a></li>");
 }else{
	document.write("		<div class='loginFun'><span id='bzt_showHelloLi'></span> 请<a href='http://passport.baihe.com/login.jsp'>登录</a>|<a  target='_blank' href='http://love.baihe.com/'>免费注册</a></div>");
	document.write("		<ul>")
 }
 if(bzt_isMainUser){
		document.write("			<li class='arrow last'>");
}else{
		document.write("			<li class='arrow last' style='margin-left: 0px;'>");
}

document.write("				<span  ><a class='arrowIcon' id='baiheServiceA' style='cursor:pointer'  onclick='updateBaiheService()'>百合服务</a> ");
document.write("				<a class='mobileIcon' href='http://news.baihe.com/3g.baihe.html'>手机百合</a>");
document.write("				<iframe id='baiheServicesIframe' style='position:absolute; border:0; top:19px; left:0px; width:114px; height:168px; z-index:1;filter:alpha(opacity=0,Style=0);display:none;'></iframe>");
document.write("				<div class='servieCont' id='baiheServices' style='display:none;z-index:100;'>");
document.write("					<a href='http://coin.baihe.com/User/myLovePea.html'>> 红豆充值</a>");
document.write("					<a href='http://payment.baihe.com/product/crystal/index.jsp'>> 水晶百合</a>");
document.write("					<a href='http://payment.baihe.com/product/99bh/index.jsp'>> 电话红娘</a>");
//document.write("					<a href='http://payment.baihe.com/product/goldbh/index.jsp'>> 金百合服务</a>");
document.write("					<a href='http://vip.baihe.com/'>> 顾问服务</a>");
document.write("				</div></span>");
document.write("			</li>");
//document.write("			<li><iframe scrolling='no' frameborder='0' allowtransparency='true' src='http://www.connect.renren.com/like?url=http%3A%2F%2Fpage.renren.com%2F600875529&showfaces=false' style=' width:70px; height:22px;border:none;overflow:hidden;'></iframe></li>");
//document.write("			<li  class='last'><iframe src='http://open.qzone.qq.com/like?url=http%3A%2F%2Fuser.qzone.qq.com%2F1532773876&type=button_num&width=400&height=30' allowtransparency='true' scrolling='no' border='0' frameborder='0' style=' width:110px; height:21px;border:none;overflow:hidden;'></iframe></li>");
document.write("		</ul>");
document.write("	</div>");
document.write("</div>");
if(bzt_curUrl.indexOf("http://ichat.baihe.com/w/")>-1&&bzt_curUrl.indexOf("http://ichat.baihe.com/w/lastuser")<0){
	 document.write("<div class='topBg' id='baihe_header'><div class='head'><h1><a href='http://www.baihe.com/'>百合在线</a></h1></div></div>");  
  document.write("<div class='bhHeader' style='display:none;'>");  
}else{
  document.write("<div class='bhHeader'>");  
}
document.write("	<h1><a href='http://www.baihe.com/'>"+ChristmasFlash+"</a></h1>");
document.write("	<div class='bhHomeNav fixfloat'>");
document.write(" <div class='userAD'> ");
if(_bzt_adurl != ""){
	//	document.write("				<iframe width='468' height='60' marginheight='0' marginwidth='0' frameborder='0' scrolling='no' id='iframe_src' src='"+_bzt_adurl+"'></iframe>");
		document.write(bzt_getadHtml());
}
document.write("		</div><div class='userTel'>");
document.write("				<a  class='telIcon01' href='http://bhtg.baihe.com/stat.html?ggCode=vip-profiletop_1#http://vip.baihe.com/' target='_blank'>猎婚热线：<strong>4008-800-520</strong></a>");
document.write("				<a  class='telIcon02' href='http://bhtg.baihe.com/stat.html?ggCode=vip-profiletop_1#http://vip.baihe.com/' target='_blank'>咨询专线：<strong>4000-299-520</strong></a>");
document.write("		</div></div></div>");
if(bzt_curUrl.indexOf("http://ichat.baihe.com/w/")>-1&&bzt_curUrl.indexOf("http://ichat.baihe.com/w/lastuser")<0){
  document.write("	<div class='userNavcont' style='display:none;'>");
}else{
 document.write("	<div class='userNavcont'>");
}
document.write("			<ul>");
document.write("				<li><a href='http://www.baihe.com/' class='home'>首页</a></li>");
document.write("				<li><a href='http://user.baihe.com/User/member.jsp' id='bzt_dh_mybaihe'>我的百合</a></li>");
document.write("				<li><a href='http://search.baihe.com/' id='bzt_dh_search'>爱情搜索</a></li>");
document.write("				<li><a href='http://cityonline.baihe.com/showOnlineList.action' id='bzt_dh_cityonline'>在线会员</a></li>");
document.write("				<li><a href='http://top.baihe.com/' id='bzt_dh_top'>最新会员</a></li>");
document.write("				<li><a href='http://vip.baihe.com/forward.jsp?policy=1&Channel=mainsite&Code=000000-01' target='_blank' id='bzt_dh_vip'>顾问服务</a></li>");
document.write("				<li><a href='http://story.baihe.com/' id='bzt_dh_cggs'>成功故事</a></li>");
document.write("				<li><a href='http://video.baihe.com/html/index.shtml' id='bzt_dh_video'>精彩视频</a></li>");
//document.write("				<li><a href='http://shop.baihe.com/topics/topicsall_01/area/index.html' target='_blank' id='bzt_dh_cggs'>商城</a></li>");
document.write("				<li><a href='http://emotion.baihe.com/' id='bzt_dh_zhidao'>情感工坊</a></li>");
document.write("			</ul>");
if(bzt_isMainUser){
	// to lixm : 修改此处的链接地址和参数
	//	document.write("				<li class='baiheReport'><a href='http://bhtg.baihe.com/stat.html?ggCode=Navigation-sj_2#http://act.baihe.com/survey/1003survey/' target='_blank'><img src='http://images.baihe.com/images/baihe_new/images/baiheReport_btn.gif' title='百合满意度调查' /></a></li>");
	document.write("			<div   id='upgrade_crystal_li' class='upgrade' style='display:none'><a href='http://bhtg.baihe.com/stat.html?ggCode=Navigation-sj_1#http://payment.baihe.com/product/crystal/index.jsp' target='_blank'>升级水晶百合</a></div>");
}
document.write("		</div>");
}

if(bzt_headType!=1&& bzt_curUrl.indexOf("http://search.baihe.com/") <0 &&  bzt_curUrl.indexOf("http://cityonline.baihe.com/") <0 ){
	 
	if(bzt_curUrl.indexOf("http://ichat.baihe.com/")<0||(bzt_curUrl.indexOf("http://ichat.baihe.com/") >-1&&bzt_curUrl.indexOf("lastuser")>-1)){
	if(bzt_headType==0){
		document.write("<div class='bhSearch'>");
	}else{
		document.write("<div class='userSearch'>");
	}
	//document.write("<form id='searchkeyform' name='searchkeyform' method='post' action='http://search.baihe.com/advanceSearch.action' enctype='application/x-www-form-urlencoded' target='_blank'>");
	//document.write("<input type='hidden' name='pageId' value='1' ></input>");
	//document.write("<input type='hidden' name='criteria.change' value='0' ></input>");
//	document.write("<input type='hidden' name='ord' value='1' ></input> ");
	document.write("	<div class='searchCont fixfloat'>");
	document.write("		<ul>");
	document.write("			<li>");
	document.write("				我要找");
	document.write("				<select name='criteria.gender' id='criteriaGender'><option value='0'>女朋友</option><option value='1'>男朋友</option></select>");
	document.write("			</li>");
	document.write("			<li>");
	document.write("				年龄");
	document.write("				<select name='criteria.match_minage' id='minAge_head'>");
	for(var bi=18;bi<66;bi++){
		 
		if(bi==22){
				document.write("		<option value='"+bi+"'  selected='selected'>"+bi+"</option> ");
		}else{
			document.write("		<option value='"+bi+"'>"+bi+"</option> ");
		}
	}
	document.write("	</select>岁 至 <select name='criteria.match_maxage' id='maxAge_head'>");
	for(var bj=18;bj<66;bj++){
		if(bj==30){
			document.write("		<option value='"+bj+"'  selected='selected' >"+bj+"</option> ");
		}else{
			document.write("		<option value='"+bj+"'>"+bj+"</option> ");
		}
	}
	document.write("	</select>岁 ");
	document.write("			</li>");
	document.write("			<li>");
	document.write("				地区");
	document.write("			<select name='criteria.provinceId' id='Srh_Province_head' onchange='getCity_head();' style='width:60px;'>	<option value='-1'>任意</option><option value='8611' selected>北京</option><option value='8612'>天津</option><option value='8613'>河北</option><option value='8614'>山西</option><option value='8615'>内蒙古</option><option value='8621'>辽宁</option><option value='8622'>吉林</option><option value='8623'>黑龙江</option><option value='8631'>上海</option><option value='8632'>江苏</option><option value='8633'>浙江</option><option value='8634'>安徽</option><option value='8635'>福建</option><option value='8636'>江西</option><option value='8637'>山东</option><option value='8641'>河南</option><option value='8642'>湖北</option><option value='8643'>湖南</option><option value='8644'>广东</option><option value='8645'>广西</option><option value='8646'>海南</option><option value='8650'>重庆</option><option value='8651'>四川</option><option value='8652'>贵州</option><option value='8653'>云南</option><option value='8654'>西藏</option><option value='8661'>陕西</option><option value='8662'>甘肃</option><option value='8663'>青海</option><option value='8664'>宁夏</option><option value='8665'>新疆</option><option value='8671'>台湾</option><option value='8681'>香港</option><option value='8682'>澳门</option></select>");
	document.write("		 <select style='width:60px;' name='criteria.districtId' id='Srh_City_head'><option value='-1'>任意</option><option value='861101'>东城区</option><option value='861102'>西城区</option><option value='861103'>崇文区</option><option value='861104'>宣武区</option><option value='861105'>朝阳区</option><option value='861106'>丰台区</option><option value='861107'>石景山区</option><option value='861108'>海淀区</option><option value='861109'>门头沟区</option><option value='861110'>房山区</option><option value='861111'>通州区</option><option value='861112'>顺义区</option><option value='861113'>昌平区</option><option value='861114'>大兴区</option><option value='861115'>怀柔区</option><option value='861116'>平谷区</option><option value='861117'>密云县</option><option value='861118'>延庆县</option></select>");
	document.write("			</li>");
	document.write("			<li><input name='criteria.havingpic' type='checkbox' value='1' id='hasPhoto_head' checked  />有照片</li>");
	document.write("			<li><a class='searchBtn' onclick='sy_search_head()' style='cursor:pointer;'>搜索</a></li>");
	document.write("			<li class='link'><a href='http://bhtg.baihe.com/stat.html?ggCode=header-search_1#http://search.baihe.com/searchUI.action' target='_blank'>高级搜索</a>    <a href='http://bhtg.baihe.com/stat.html?ggCode=header-search_2#http://lovemap.baihe.com/LoveMap/toSearchPage.action' target='_blank'>地图搜索</a>  <a href='http://bhtg.baihe.com/stat.html?ggCode=header-search_3#http://top.baihe.com/new/NewReg.jsp' target='_blank'>最新会员</a> <a href='http://bhtg.baihe.com/stat.html?ggCode=header-search_4#http://top.baihe.com/new/NewCrystal.jsp'  target='_blank'>新水晶百合会员</a></li>");
	document.write("		</ul>");
	document.write("	</div>	");
	document.write("</div>");
	}
}
if(bzt_headType>0){
$("#baihe_page").before(realAdvertInfo);
}


$("#bzt_showHelloLi").html(showHello());	
if(bzt_isMainUser){
	var isFpage = bzt_headType==0?true:false;
	bzt_showMsgInfoNew(isFpage);
}

//index page login 2011-7-21

var _html_login_pop="";
_html_login_pop+="<div class='pop_bg' style='width:488px; margin:-124px 0 0 -244px; text-align:left; z-index:10;' id='loginDiv'>";
_html_login_pop+="	<div class='popLogin'>";
_html_login_pop+="		<div><a class='close01' href='#' onclick='loginDivClose();'>关闭</a></div>";
_html_login_pop+="		<div class='fl'>";
_html_login_pop+="			<h5>已有百合帐号，可直接登录</h5>";
_html_login_pop+="			<dl>";
_html_login_pop+="				<dt>登录帐号：</dt>";
_html_login_pop+="				<dd><input type='text' onkeydown='return keyDownOfEmailPop(event)' value='邮箱或手机号' onblur='if(this.value==&quot;&quot;){this.value=&quot;邮箱或手机号&quot;}' onfocus='if(this.value==&quot;邮箱或手机号&quot;){this.value=&quot;&quot;;} $(&quot;#emailError&quot;).html(&quot;&quot;)' id='txtEmailAddressPop' name='txtLoginEMailPop' class='inputbox'><br><span style='color:red' id='emailError'></span></dd>";
_html_login_pop+="			</dl>";
_html_login_pop+="			<dl>";
_html_login_pop+="				<dt>密　　码：</dt>";
_html_login_pop+="				<dd><input class='inputbox'  type='password' onkeydown='return keyDownOfPasswdPop(event)' onfocus='$(&quot;#pwdError&quot;).html(&quot;&quot;);' class='password' id='txtPasswordPop' name='txtLoginPwdPop'><br><span style='color:red' id='pwdError'></span></dd>";
_html_login_pop+="			</dl>";
_html_login_pop+="			<div class='code'><input class='inputbox01' type='checkbox' value='Yes' name='chkRememberMePop' id='chkRemmberPwdPop' />自动登录</div>";
_html_login_pop+="			<div class='btn'><a class='loginBtn' href='#' onclick='javascript:syLoginPop();'>登录</a>";
_html_login_pop+="			<a href='http://passport.baihe.com/forgotPwd.html' target='_blank' class='codeBtn'>忘记密码</a></div>";

_html_login_pop+="<div class='share'>你也可以用其它方式登录：<br/><ul><li class='QQ'><a style='cursor:pointer;' href='http://open.baihe.com/connector/t/qzoneRequestTokenQuire.action'>QQ登录</a><span>|</span></li>";
_html_login_pop+="<li class='sina'><a  style='cursor:pointer;' href='http://open.baihe.com/connector/t/sinaWbAuthorize.action'>微博登录</a><span>|</span></li>";
_html_login_pop+="<li class='baidu'><a  style='cursor:pointer;' href='http://open.baihe.com/connector/t/baiduAuthorize.action'>百度登录</a></li>";
_html_login_pop+="<li class='renren'><a  style='cursor:pointer;' href='http://open.baihe.com/connector/t/renRenAuthorize.action'>人人登录</a><span>|</span></li>";
_html_login_pop+="<li class='kaixin'><a  style='cursor:pointer;' href='http://open.baihe.com/connector/t/kaixinAuthorize.action'>开心登录</a><span>|</span></li>";
_html_login_pop+="<li class='alipay'><a  style='cursor:pointer;' href='http://alipay.baihe.com/baiheAlipay/alipay!alipayLink.action'>支付宝登录</a></li></ul>";

_html_login_pop+="		</div></div>";
_html_login_pop+="		<div class='fr'>";
_html_login_pop+="			<h5>还没有百合帐号？<br/>赶快注册一个吧</h5>";
_html_login_pop+="			<a class='regBtn' href='http://bhtg.baihe.com/stat.html?ggCode=indexRegPop_1#http://love.baihe.com/Reg.action'>立即注册</a>";
_html_login_pop+="		</div>";
_html_login_pop+="	</div>";
_html_login_pop+="</div>";

var displayFlag = true;

//显示登陆框
function showLoginDiv(){
	var cookieLoginEmail = bzt_getCookie("LoginEmail");
	
	if(cookieLoginEmail!=""){
		return;
	}
	var cookieGCEmail = bzt_getCookie("GCEmail");
	if(cookieGCEmail!=""){
		return;
	}
	var GCUserID = bzt_getCookie("GCUserID");
	if(GCUserID > 0){
		return;
	}
	var loginClassName = $("#bhLoginA").attr("class");
	if(typeof(loginClassName)!='undefined'&&loginClassName!=null && loginClassName=='current'){
				displayFlag = false ;
	}
	if(displayFlag){
		if(bzt_headType == 0){//home page
			$.blockUI(_html_login_pop);
			var img = new Image();                                                                                   
			img.src="http://bhtg.baihe.com/stat.html?ggCode=indexPopDisplay_1";
			topToolsFlag=false;
			$("#topTools").hide();
		}
	}
}

//登陆框关闭方法
function loginDivClose(){
	if(document.getElementById("loginDiv") != null){
		$.unblockUI();
		topToolsFlag=true;
	}
}

if(isLogonMainUser){
	topToolsFlag = false;
}

setTimeout(showLoginDiv, "10000");


//login
function CheckLoginIdentPop(src){var mobile=/^(1[358]\d|0[1-9][0-9]{1,2})\d{8}$/;var email=/^(([_a-zA-Z0-9\-]+(\.[_a-zA-Z0-9\-]*)*@[a-zA-Z0-9\-]+([\.][a-zA-Z0-9\-]+)+)|([a-zA-Z0-9_]{6,16}))$/;if(mobile.test(src)||email.test(src)){return true;}return false;}
function keyDownOfPasswdPop(evt){evt=evt?evt:event;if(evt&&evt.keyCode==13){if(!isPopErr){syLoginPop();}return false;}}
function keyDownOfEmailPop(evt){evt=evt?evt:event;if(evt&&evt.keyCode==13){document.getElementById('txtPasswordPop').focus();return false;}}var isPopErr=false;function keyDownOfPasswdPop(evt){evt=evt?evt:event;if(evt&&evt.keyCode==13){if(!isPopErr){syLoginPop();}return false;}}
function syLoginPop()
{
 	var username=$("#txtEmailAddressPop").val();
 	var password=$("#txtPasswordPop").val();
 	var chkRememberMeChecked=$("#chkRemmberPwdPop").attr("checked");
 	var chkRememberMe=(chkRememberMeChecked?"Yes":"No");
 	var errMsg="";
 	var errType = 0 ;
 	if(username==""||username=="邮箱或手机号")
 	{	
 		errMsg+="请填写您的登录帐号";
 	}
 	else if(!CheckLoginIdentPop(username))
 	{
 		errMsg+="您填写的帐号格式不正确，请填写您注册时使用的E-mail地址或手机号！";
 	}
 	if((password==null||password=="")&&(errMsg==''))
 	{
 		errType = 1;
 		errMsg+="请填写您的登录密码！";
 	}
 	if(errMsg!='')
 	{
		if(errType==1){
			//document.getElementById('txtPassword').focus();
			$("#pwdError").html(errMsg);
		}else{
			$("#emailError").html(errMsg);
			//document.getElementById('txtEmailAddress').focus();
		}
		return ;
 	}
 	else{
 		var url="http://passport.baihe.com/loginForXs.jsp?txtLoginEMail="+username+"&txtLoginPwd="+escape(password)+"&chkRememberMe="+chkRememberMe+"&time="+new Date().getTime();
 		$("#txtEmailAddressPop").attr("readonly",true);
 		$("#txtPasswordPop").attr("readonly",true);
 		$.getScript(url,function(){
	 		if(isLogonMainUser){
	 			location.replace("http://bhtg.baihe.com/stat.html?ggCode=indexLoginPop_1#http://user.baihe.com/User/member.jsp");
	 		}
	 		else{
		 		if(logonUserId==undefined||!logonUserId||logonUserId<1)
		 		{
		 			 errMsg = loginErrMsg;
		 		   $("#txtEmailAddressPop").attr("readonly",false); 
		 		   $("#txtPasswordPop").attr("readonly",false);
		 		   $("#txtPasswordPop").val("");
		 		   if(errMsg.indexOf("密码")>-1){
		 			 	$("#pwdError").html(errMsg);
		 			 	 //document.getElementById('txtPassword').focus();
		 			 }else{
		 			 	$("#emailError").html(errMsg);
		 			 	 //document.getElementById('txtEmailAddress').focus();
		 			 }
		 		   return ;
		 		}
		 		else{
		 			location.replace("http://bhtg.baihe.com/stat.html?ggCode=indexLoginPop_1#http://love.baihe.com");
		 		}
	 		}
 		});
 	}
}
function  setLoginEmail(){
	//var isOldUser =  Cookie.getCookie("LoginEmail");
	var isOldUser =  bzt_getCookie("LoginEmail");
	if(typeof(isOldUser)!='undefined'&& isOldUser!=null && isOldUser!=''){
		$("#txtEmailAddressPop").val(isOldUser);
		//document.getElementById('txtPasswordPop').focus();
	}
}
function loadjscssfile(filename, filetype){
	 if (filetype=="js"){ //if filename is a external JavaScript file
	  var fileref=document.createElement('script');
	  fileref.setAttribute("type","text/javascript");
	  fileref.setAttribute("src", filename);
	 }
	 else if (filetype=="css"){ //if filename is an external CSS file
	 		var fileref=document.createElement("link");
	  	fileref.setAttribute("rel", "stylesheet");
	  	fileref.setAttribute("type", "text/css");
	  	fileref.setAttribute("href", filename);
	  
	 }else{
	 		var fileref=document.createElement("link");
	  	fileref.setAttribute("rel", "shortcut icon");
	  	fileref.setAttribute("type", "image/x-icon");
	  	fileref.setAttribute("href", filename);
	 }
	 if (typeof fileref!="undefined"){
	  document.getElementsByTagName("head")[0].appendChild(fileref)
	}
}
function createRenRenMeta(){
	 if(bzt_headType>0&&bzt_isMainUser){
		createMeta("og:site_name","百合网");
		createMeta("og:title","婚恋交友服务");
	  createMeta("og:description","百合网，以帮助中国人成就爱情、婚姻为己任。基于“心灵匹配”的全新婚介模式让数百万会员交友成功。近千万发布征婚信息的单身会员。超准爱情心理测试，突破了网络交友“知人知面不知心”的难题，让用户能够通过百合独有的匹配系统，找到幸福指数更高的伴侣。");
		createMeta("xn:page_id","600875529");
	}
}    
function createMeta(property_,content_,name_){
	  var fileref=document.createElement('meta');
	  if(typeof(property_)!='undefined'&&property_!=null&&property_!=''){
	   fileref.setAttribute("property",property_);
	  }
	  if(typeof(content_)!='undefined'&&content_!=null&&content_!=''){
	  	 fileref.setAttribute("content", content_);
	  }
	 if(typeof(name_)!='undefined'&&name_!=null&&name_!=''){
	  	 fileref.setAttribute("name", name_);
	  }
	  document.getElementsByTagName("head")[0].appendChild(fileref);
}
setIe9Info();
function logOut(){
	bzt_setCookie("GCUserID",-1,bzt_getExpDate(0,0,1),"/","baihe.com");
	bzt_setCookie("AuthCookie","",bzt_getExpDate(0,0,1),"/","baihe.com");
	bzt_setCookie("Token","",bzt_getExpDate(0,0,1),"/","baihe.com");
	bzt_setCookie("GCEmail","",bzt_getExpDate(0,0,1),"/","baihe.com");
	location.href=" http://passport.baihe.com/logout.jsp" ;
}
/*
*以下方法用于webim
*
*/
var loopWebimTask ;
var loopWebimTimer = 8000 ;
var loppWebimDomain = "http://online.baihe.com/opt/webimlive.action" ;
var title_ori = document.title;//当前域名标题
var scrollTitleTask_head ;
var scrollTitleContents_head="" ;
var msgnum_webim_head = 0 ;
var webim_hadMsg_div = "<div class='chatPop' id='webim_chatPop_div'><img width='17' height='7' alt='' src='http://images1.baihe.com/images/baihe_new/images/header_new/chatPop_arrow.gif' class='arrow'>" ;
webim_hadMsg_div+="<a style='cursor:pointer;'  onclick='javascript:$(\"#webim_chatPop_div\").hide();' class='close'>关闭</a><strong>{webim_chat_num}</strong>个新的聊天消息，<a style='cursor:pointer;'  onclick='openBaiheChat_()' class='link'>立即查看</a></div>" ;


function getWebimInfo(){
	if(!bzt_isMainUser){
		 return ;
	}
	var webim_info_ckname = "ck_webim_info_"+bzt_loginUserId ;
	var webim_num_ckname = "ck_webim_num_"+bzt_loginUserId ;
	var time_ = bzt_getCookie(webim_info_ckname);
	var num = bzt_getCookie(webim_num_ckname);
	if(time_!=null&&time_!=''){
		var ctime = new Date().getTime()-time_;
		if(ctime<loopWebimTimer){
			if(num!=null&&num!=''){
				clearInterval(loopWebimTask);
				setWebimInfo(num);
			}
			return ;
		}
	}
	clearInterval(loopWebimTask);
	bzt_setCookie(webim_info_ckname,new Date().getTime(),bzt_getExpDate(0,0,1),"/","baihe.com");
	$.getJSON(loppWebimDomain+"?jsoncallback=?",{},function(data){
		var msgnum = 0 ;
		if(typeof(data)!='undefined'&&data!=null&&data!=''){
			var msgnum_ = data.noreadinfo ;
			if(typeof(msgnum_)!='undefined'&&msgnum_!=null&&msgnum_!=''&&parseInt(msgnum_)>0){
				msgnum = msgnum_ ;
			}else{
				msgnum = 0 ;
			}
		}
		setWebimInfo(msgnum);
		bzt_setCookie(webim_num_ckname,msgnum,bzt_getExpDate(0,0,1),"/","baihe.com");
	});
}
function openBaiheChat_(){

	document.domain="baihe.com";
	var gWindow = window.open("http://ichat.baihe.com/w/?oid=0&time="+new Date().getTime(), "baiheChat","toolbar=yes,resizable=yes,left=0,top=0,scrollbars=yes,location=yes,status=yes,menubar=yes");
	gWindow.focus();
}


function createWebImStatus(){
	//1.闪烁
	$("#webim_chatPop_div").remove();
	if(msgnum_webim_head>0){
		beginScrollTitle_head();
		$("#bzt_systemWebImA").addClass("chatIcon");
		$("#bzt_systemWebImA").removeClass("chatgrayIcon");
		var webim_hadMsg_div_temp = webim_hadMsg_div.replace("{webim_chat_num}", msgnum_webim_head);
		$("#bzt_systemWebImLi").append(webim_hadMsg_div_temp);
	}else{
		endScrollTitle_head();
		$("#bzt_systemWebImA").addClass("chatgrayIcon");
		$("#bzt_systemWebImA").removeClass("chatIcon");
		
	}
	//2.设置数量
	$("#bzt_systemWebImSpan").html(""+msgnum_webim_head); 
	$("#bzt_systemWebImLi").show();	               
}
function setWebimInfo(msgnum){
	msgnum_webim_head = msgnum;
  createWebImStatus();
	loopWebimTask  = setInterval(getWebimInfo,loopWebimTimer);
}
//滚动标题
function scrollTitle_head(){
	   if(typeof(scrollTitleContents_head)!='undefined' &&scrollTitleContents_head !=null&& scrollTitleContents_head !=''){
		   scrollTitleContents_head =scrollTitleContents_head.substring(1,scrollTitleContents_head.length)+scrollTitleContents_head.substring(0,1)                                     
		   document.title=scrollTitleContents_head ;   
		   
	   }
}
//开始滚动标题
function beginScrollTitle_head(){
	var scrolltitle_ = "" ;
	if(msgnum_webim_head>0){
			scrolltitle_ = "您有"+msgnum_webim_head+"个用户的新未读聊天消息....." ;
			 
		}
	if(scrolltitle_!=""){
		scrollTitleContents_head = scrolltitle_ ;
		clearInterval(scrollTitleTask_head);
		scrollTitleTask_head  = setInterval(scrollTitle_head,300);
	}else{
		endScrollTitle_head();
	}
}
//停止滚动标题
function endScrollTitle_head(){
	scrollTitleContents_head="" ;
	clearInterval(scrollTitleTask_head);
	document.title = title_ori ;
}
getWebimInfo();
$(document).ready(function(){
	setLoginEmail();
});
document.write(unescape("%3Cscript src='http://images.baihe.com/js/realAuthHelper.js'  charset='utf-8'  type='text/javascript'   %3E%3C/script%3E"));
                                                                                                                     
