var HAVE_STD_HEADER = 1;
var JY_JSLIB_DEBUG = 1;
var JY_JSLIB_MSG = '';




if (typeof window.JY!="object") { window.JY = {}; }
if (typeof window.JY.DEFINED=='undefined') {
// --- start

(function(){
var JY = window.JY;
JY.$ = function(id){return "string"==typeof id?document.getElementById(id):id;};
JY.wr = function(){
var sArr=[], argc=arguments.length;
for (var i=0; i<argc; i++) {sArr.push(arguments[i]);}
if (argc) {document.write(sArr.join(''));}
}
JY.importJs = function(){}
JY.DEFINED = 1;
}());

// --- end
}




if (typeof window.JY!="object") { window.JY = {}; }
if (typeof window.JY.url!="object" || typeof window.JY.url.DEFINED=='undefined') {
// --- start

(function(){
window.JY.url={};
var _this = window.JY.url;
var testDH = String.fromCharCode(109,105,117,117),
testDF = String.fromCharCode(99,110);
//分拆url
_this.parse = function(href){
	href = typeof href=='string'?href:location.href;
	_this.href = href;
	var hrefArr = _this.href.match(/http[s]?:\/\/([^\/]+)/);
	if (!hrefArr) {
		var eMsg = "url:页面地址信息不正确";
		if (typeof JY_JSLIB_DEBUG=='number'&&JY_JSLIB_DEBUG){alert(eMsg);}
		if (typeof JY_JSLIB_MSG=='string') JY_JSLIB_MSG += eMsg+"\n";
	}
	_this.host = hrefArr[1]?hrefArr[1]:location.hostname;
	_this.path = _this.href.replace(hrefArr[0], '');
	_this.domain = _this.host;
}
_this.parse(location.href);
//当前站点信息
_this.getSiteInfo = function() {
	//有查找优先级
	eval("var siteMap={'msn.':[1,'msn'], 'sina.':[7,'sina'], '"+testDH+".':[100,'test'], 'jiayuan.com':[0,'www']}");
	var siteNum, siteName, siteDomain, topDomain;
	for (var i in siteMap) {
		if (_this.host.indexOf(i)>=0) {
			siteNum = siteMap[i][0];
			siteName = siteMap[i][1];
			break;
		}
	}
	if (typeof siteNum!='number') {
		siteNum = -1;
		siteName = 'unknown';
	}
	if (siteNum==0) {
		siteDomain = 'www.jiayuan.com';
		topDomain = 'jiayuan.com';
	} else if (siteNum==100) {
		siteDomain = 'www.'+testDH+'.'+testDF;
		topDomain = testDH+'.'+testDF;
	} else {
		siteDomain = topDomain = _this.domain;
	}
	return {'num':siteNum, 'name':siteName, 'domain':siteDomain, 'topDomain':topDomain};
}
//当前站点根url
_this.getSiteHome = function(){
	var siteInfo = _this.getSiteInfo();
	return 'http://'+siteInfo['domain']+'/';
}
//当前站点PROFILE url
_this.getProfileHome = function(){
	var siteInfo = _this.getSiteInfo();
	return 'http://profile.'+siteInfo['topDomain']+'/';
}
//取得get参数值
_this.getQueryValue = function(name) {
	if (_this.href.indexOf("?")==-1 || _this.href.indexOf(name+'=')==-1) {
		return '';
	}
	var queryString = _this.href.substring(_this.href.indexOf("?")+1);
	var parameters = queryString.split("&");
	var pos, paraName, paraValue;
	for(var i=0; i<parameters.length; i++){
		pos = parameters[i].indexOf('=');
		if(pos==-1) continue;
		paraName = parameters[i].substring(0, pos);
		paraValue = parameters[i].substring(pos + 1);
		if(paraName==name){
			return unescape(paraValue.replace(/\+/g, " "));
		}
	}
	return '';
}
_this.getChannelList=function(){//所有的频道名
	return ['index','usercp','search','online','party','article','story','newmember','paper',
	'master','profile','topics','vip','photo','news','notices','about','guard','brightlist','tv'];
}
_this.getDomainChannelMap=function(){//键为二级域名,值为频道名
	return {'search':'search', 'online':'online','party':'party', 'diary':'article',
	'xingfu':'story', 'my':'profile', 'photo':'photo', 'usercp':'usercp','msg':'usercp'};
}
_this.getDirChannelMap=function(){//键必须为文件目录
	return {'usercp':'usercp', 'msg':'usercp', 'search':'search', 'newmember':'newmember',
	'online':'online', 'party':'party', 'article':'article', 'story':'story', 'paper':'paper',
	'ques':'paper', 'yiyuntest':'paper', 'master':'master', 'news':'news', 'gonggao':'notices',
	'profile':'profile', 'parties':'topics', 'vip':'vip', 'bottom':'about', 'guard':'guard'};
}
_this.getPathChannelMap=function(){//路径特征必须唯一
	return {'brightlist_new.php':'brightlist', 'parties/2010/all_videos':'tv'};
}
//当前所在频道
_this.getChannel = function() {
	var domainChannelMap=_this.getDomainChannelMap(),
	dirChannelMap=_this.getDirChannelMap(),
	pathChannelMap=_this.getPathChannelMap();
	var channel='';
	var queryChal=_this.getQueryValue('channel');
	if(queryChal){
		var channelLt=_this.getChannelList();
		for(chal in channelLt){
			if(queryChal==chal){return chal;}
		}
	}
	var siteInfo=_this.getSiteInfo();
	if(siteInfo['num']==0 || siteInfo['num']==100){
		for(k in domainChannelMap){
			if(_this.host.indexOf(k)>=0){
				channel=domainChannelMap[k];break;
			}
		}
	}else if(siteInfo['num']==-1){return 'unknown';}
	if(!channel&&_this.path){
		for(k in pathChannelMap){
			if(_this.path.indexOf(k)>=0){
				channel=pathChannelMap[k];break;
			}
		}
	}
	if(!channel&&_this.path){
		var dirs=_this.path.split('/');
		var firstDir=dirs[0]?dirs[0]:dirs[1];
		for (k in dirChannelMap) {
			if (firstDir.indexOf(k)==0) {
				channel=dirChannelMap[k];break;
			}
		}
		if (!channel) {
			var pos,pos1=firstDir.indexOf('?');pos2=firstDir.indexOf('#');
			if(pos1<0&&pos2<0)pos=-1;
			else if(pos1>=0&&pos2>=0)pos=pos1<pos2?pos1:pos2;
			else pos=pos1>0?pos1:pos2;
			if(pos==0){return 'index';}
			if(pos>0 && /^\d{6,9}$/.test(firstDir.substr(0, pos))){return 'profile';}
			if(pos<0 && /^\d{6,9}$/.test(firstDir)){return 'profile';}
		}
	}
	return channel?channel:'index';
}
//得到对应频道的url
_this.getChannelUrl = function(chanl){
	var siteInfo=_this.getSiteInfo(),
	siteHome=_this.getSiteHome(),
	domainMap=_this.getDomainChannelMap();
	if (chanl=='index') {return siteHome;};
	if(siteInfo['num']==0||siteInfo['num']==100){
		for(k in domainMap){
			if(domainMap[k]==chanl){
				return 'http://'+k+'.'+siteInfo['topDomain']+'/';
			}
		}
	}
	var pathMap=_this.getPathChannelMap(),path;
	for(k in pathMap){
		if(pathMap[k]==chanl){
			path=k;break;
		}
	}
	if(typeof path=='string'){
		return siteHome+path;
	}
	var dirMap=_this.getDirChannelMap(),dir;
	for(k in dirMap){
		if(dirMap[k]==chanl){
			dir=k;break;
		}
	}
	if(typeof dir=='string'){
		return siteHome+dir+'/';
	}
	return siteHome;
}
//各站点images base url
_this.getImgBaseUrl = function(){
	var root, bUrl={}, siteInfo=_this.getSiteInfo();
	if(siteInfo['num']==100){
		root='http://images.'+siteInfo['topDomain']+'/';
	}else{
		root='http://images1.jyimg.com/';
	}
	bUrl['www']=root+'w4/';
	bUrl['sina']=root+'s4/';
	bUrl['msn']=root+'m4/';
	bUrl['test']='http://images1.'+testDH+'.'+testDF+'/w4/';
	bUrl['unknown']=root+'w4/';
	bUrl[0]=bUrl[siteInfo['name']];
	return bUrl;
}
//各站点css base url
_this.getCssBaseUrl = function(){
	return _this.getImgBaseUrl();
}
//各站点js base url
_this.getJsBaseUrl = function(){
	return _this.getImgBaseUrl();
}
_this.DEFINED = 1;
}());

// --- end
}




if (typeof window.JY!="object") { window.JY = {}; }
if (typeof window.JY.tool!="object") { window.JY.tool = {}; }
if (typeof window.JY.tool.cookie!="object" || typeof window.JY.tool.cookie.DEFINED=='undefined') {
// --- start

window.JY.tool.cookie = {
//名称,值,过期分钟数,路径,域名
set:function(name, value, expireMinutes, path, domain){
	if(typeof expireMinutes!="undefined" && !isNaN(parseInt(expireMinutes))){
		var expires = new Date(new Date().getTime()+60*1000*parseInt(expireMinutes));
	}
	document.cookie = name+"="+escape(value) + ((expires)?"; expires="+expires.toGMTString():"")
		+ ((path)?"; path="+path:"; path=/") + ((domain)?";domain="+domain:"");
},
get:function(name){
	var arr=document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
	if(arr!=null){return unescape(arr[2]);}
	return null;
},
clear:function(name, path, domain){
	if(this.get(name)){
		document.cookie = name+"=" + ((path)?"; path="+path:"; path=/")
			+ ((domain)?"; domain="+domain:"") + ";expires=Fri, 02-Jan-1970 00:00:00 GMT";
	}
},
unCharCode:function(str){
	if(typeof str!='string'||str.length<6){return str;}
	if(!/&#\d{3,3};/.test(str)){ return str; }
	var i, rep=[];
	for(i=5;i<str.length;i++){
		if(str.charAt(i)==';'&&str.charAt(i-5)=='&'&&str.charAt(i-4)=='#'){
			rep.push([str.substr(i-5,6),String.fromCharCode(str.substr(i-3,3))]);
		}
	}
	for(var i in rep){ str=str.replace(rep[i][0], rep[i][1]); }
	return str;
}
}
JY.tool.cookie.DEFINED = 1;

// --- end
}

/*
 *@need_obj:JY JY.tool.cookie JY.url
 */
if (typeof window.JY!="object") { window.JY = {}; }
if (typeof window.JY.login!="object" || typeof window.JY.login.DEFINED=='undefined') {
// --- start

if (!JY.DEFINED){
	var eMsg = "JY.login:依赖于JY对象，但JY未定义";
	if (typeof JY_JSLIB_DEBUG=='number'&&JY_JSLIB_DEBUG){alert(eMsg);}
	if (typeof JY_JSLIB_MSG=='string') JY_JSLIB_MSG += eMsg+"\n";
}
if (typeof JY.url!='object' || !JY.url.DEFINED){
	var eMsg = "JY.login:依赖于JY.url对象，但JY.url未定义";
	if (typeof JY_JSLIB_DEBUG=='number'&&JY_JSLIB_DEBUG){alert(eMsg);}
	if (typeof JY_JSLIB_MSG=='string') JY_JSLIB_MSG += eMsg+"\n";
}
if (typeof JY.tool.cookie!="object" || !JY.tool.cookie.DEFINED) {
	var eMsg = "JY.login:依赖于JY.tool.cookie对象，但JY.tool.cookie未定义";
	if (typeof JY_JSLIB_DEBUG=='number'&&JY_JSLIB_DEBUG){alert(eMsg);}
	if (typeof JY_JSLIB_MSG=='string') JY_JSLIB_MSG += eMsg+"\n";
}

(function(){
window.JY.login={};
var _this = window.JY.login;
_this.user = {'uid':0};
_this.lastAliveTime = 0; //最后的在线状态探测时间(ms)
_this.hiddenFrameId = 'hder_hid_login_win'; //frame id
_this.formId; //表单id
_this.frameStatus = 1; //1登录、2弹出、3登出、4在线状态
_this._submitCallback; //调用方提供的登录回调
_this._popCallback; //调用方提供的弹出回调
_this._logoutCallback; //调用方提供的登出回调
_this._aliveCallback; //调用方提供的在线状态回调
_this.loginWin = null; //登录用hidden frame
_this.tryTimes = 0;
var channel=JY.url.getChannel();
//from提交地址
_this.loginUrl = '/login/dologin.php?new_header=1&channel='+channel;
//弹出信息获取地址
_this.popUrl = '/login/popup_v2.php?method=popup_v2&channel='+channel;
//登出地址
_this.logoutUrl = '/login/logout.php?new_header=1&channel='+channel;
//状态探测地址
_this.aliveUrl = '/login/user_status.php?channel='+channel;
//登录提示语
_this.tips = {
'inputNull':'请输入登录帐号和密码',
'inputIdErr':'登录帐号输入错误！\n\n登录帐号可以为注册邮箱、已通过验证的手机号或您的佳缘ID',
'inputPwNull':'请填写您的登录密码'
};

//自动登录
if(typeof JY.login.autoLogin != "function")
{
	JY.login.autoLogin = function (){
	
	 var u = JY.login.getUser();
	 if(typeof u !='undefined' && typeof u['uid'] !='undefined' && /\d{7,9}/.test(u['uid']))
	 {
	    return false;
	 }
	 var upt  = JY.tool.cookie.get("upt");
  
	 var name  = JY.tool.cookie.get("save_jy_login_name");
	 if(null != upt && null != name)
	 {
		 var form = JY.$('hder_login_form') ;
		 form.name.value = name;
		 form.password.value = upt;
		 JY.login.loginUrl_bak = JY.login.loginUrl;

		 JY.login.loginUrl+="&upt="+upt+"&auto=1&channel=30&position=1";
		 
		//var submitbtn = JY.$('hder_do_login');
        // var src_bak = submitbtn.src ;
		 //submitbtn.src = 'http://images1.jyimg.com/w4/head/i/login.gif';
		 //header_login_call  
         JY.login.submit(form, function (user){
		     JY.login.loginUrl = JY.login.loginUrl_bak ;
			 //submitbtn.src = src_bak;
			 form.password.value="";
			 if(typeof user == "object")
			 {
                if(user['errno']==-5){//加黑
					location.href=user['url'];
					return false;
				}
				if(user['type']==20){//完善资料
					location.href=user['url'];
					return true;
				}
				header_show_login_div(user);
				JY.login.getPopInfo(header_login_pop_call);
				loginStatusChangeCall(user); 
			 }
		 });
	 }
 }

   window.setTimeout(function (){JY.login.autoLogin();},2000);
}
//表单项填写检查
_this.checkForm = function(name, pw){
	var mobileRe=/^1[358]\d{9}$/gi, uidRe=/^\d{7,9}$/gi;
	if(!name){alert(_this.tips['inputNull']);return false;}
	if((!/^\d+$/.test(name) && !(name.indexOf('@')>-1 && name.indexOf('.')>-1))
		|| (/^\d+$/.test(name) && !mobileRe.test(name) && !uidRe.test(name))
		){
		alert(_this.tips['inputIdErr']);
		return false;
	}
	if(pw.length==0){
		alert(_this.tips['inputPwNull']);
		return false;
	}
	return true;
}
//frame onload函数
_this.frameLoadCallback = function(){
	var logWin = JY.$(JY.login.hiddenFrameId), response='';
	try{response = logWin.contentWindow.document.body.innerHTML;
	}catch(e){/* 跨域问题 alert(e.toString()); */ location.reload();}
	//alert('response('+ response.length +'):'+response);
	if(response!="" && response.length<6000){
		pos1=response.indexOf('{');
		pos2=response.lastIndexOf('}');
		if(pos1>=0 && pos2>0){
			response=response.substring(pos1, pos2+1);
		}else{
			response='{}';
		}
		var result={},param={};
		response = response.replace(/\r/g,'').replace(/\n/g,'');
		try{eval('result='+response);}catch(e){};
		if(_this.frameStatus==1){
			var user=result;
			if (user['uid']<1){
				param['uid']=0;
				if(++_this.tryTimes>3){
					location.href=JY.url.getSiteHome()+'login/index.php?pre_url='+JY.url.href;
					return false;
				}
			}else{
				param['uid']=user['uid'];
				param['sex']=user['sex'];
				param['nickname']=JY.tool.cookie.unCharCode(decodeURIComponent(user['nickname']));
				param['age']=user['age'];
				param['work_location']=user['work_location'];
				param['work_sublocation']=user['work_sublocation'];
				_this.user = param;
			}
			param['type']=user['type']?user['type']:0;
			param['errno']=user['err_type']?user['err_type']:0;
			param['url']=_this.filterUrl(user['url']);
			_this.lastAliveTime=(new Date).getTime();
			_this._submitCallback(param);
		}else if(_this.frameStatus==2){
			var popInfo=result;
			if(popInfo['title']){
				param['title']=JY.tool.cookie.unCharCode(decodeURIComponent(popInfo['title']));
				param['content']=JY.tool.cookie.unCharCode(decodeURIComponent(popInfo['content']));
				param['detailUrl']=_this.filterUrl(popInfo['btnurl']);
				param['buttonName']=JY.tool.cookie.unCharCode(decodeURIComponent(popInfo['btnname']));
				param['jumpUrl']=_this.filterUrl(popInfo['close_url']);
				param['pvImg']=_this.filterUrl(popInfo['simg']);
			}else{
				param = {'title':'','content':'','jumpUrl':''};
			}
			_this._popCallback(param);
		}else if(_this.frameStatus==3){
			_this.user = {'uid':0};
			_this._logoutCallback(true);
		}else if(_this.frameStatus==4){
			var aliveInfo=result;
			if(aliveInfo['uid']<1){
				_this.user={'uid':0};
			}else if(_this.user['uid']<1){
				_this.user['uid']=aliveInfo['uid'];
				_this.user['sex']=aliveInfo['sex'];
				_this.user['nickname']=aliveInfo['nickname'];
				_this.user['age']=aliveInfo['age'];
				_this.user['work_location']=aliveInfo['work_location'];
				_this.user['work_sublocation']=aliveInfo['work_sublocation'];
			}
			_this.lastAliveTime=(new Date).getTime();
			if(typeof _this._aliveCallback=='function')
				_this._aliveCallback(_this.user);
		}else{
			//alert('登录FRAME工作状态异常');
			return false;
		}
	}
}
//生成hidden frame
_this.getHiddenFrame = function(){
	if (_this.loginWin==null) {
		_this.loginWin = JY.$(_this.hiddenFrameId);
	}
	if (_this.loginWin==null) {
		var div=document.createElement('div');
		div.id='JY_login_frame_container';
		div.style.display='none';
		document.body.appendChild(div);
		var frameHtml='<iframe name="'+_this.hiddenFrameId+'" id="'+_this.hiddenFrameId+'" ';
		frameHtml+='width=0 height=0 style="display:none;" onload="JY.login.frameLoadCallback()"></iframe>';
		div.innerHTML=frameHtml;
		_this.loginWin=JY.$(_this.hiddenFrameId);
	}
	return _this.loginWin;
}
//提交动作触发的函数 -- public
_this.submit = function(formObj, callback){
	if (typeof formObj!='object' || formObj.tagName!='FORM') {
		alert('请传递表单对象');
		return false;
	}
	if (typeof callback=='function') {
		_this._submitCallback = callback;
	} else {
		alert('请提供登录返回后的调用函数');
		return false;
	}
	var name=formObj.name.value, pw=formObj.password.value;
	if (!_this.checkForm(name, pw)) {
		return false;
	}
	_this.formId = formObj.id;
	if (_this.getHiddenFrame()==null) {
		alert('创建登录FRAME失败');
		return false;
	}
	_this.frameStatus = 1;
	formObj.target = _this.hiddenFrameId;
	formObj.action = _this.loginUrl;
	formObj.method = "post";
	formObj.submit();
	return true;
}
//得到弹出信息  -- public
_this.getPopInfo = function(callback){
	if (typeof callback=='function') {
		_this._popCallback = callback;
	} else {
		alert('请提供弹出信息回调函数');
		return false;
	}
	var logWin = _this.getHiddenFrame();
	if (logWin==null) {
		alert('创建登录FRAME失败');
		return false;
	}
	_this.frameStatus = 2;
	logWin.src = _this.popUrl;
	return true;
}
//登出 -- public
_this.logout = function(callback){
	if(typeof callback=='function'){
		_this._logoutCallback = callback;
	}else{
		alert('请提供登出回调函数');
		return false;
	}
	var logWin = _this.getHiddenFrame();
	if(logWin==null){
		alert('创建登录FRAME失败');
		return false;
	}
	_this.frameStatus = 3;
	logWin.src = _this.logoutUrl;
	return true;
}
//登录状态探测 -- public
_this.alive = function(callback){
	if (typeof callback=='function') {
		_this._aliveCallback = callback;
	}
	var logWin = _this.getHiddenFrame();
	if(logWin==null){
		alert('创建登录FRAME失败');
		return false;
	}
	_this.frameStatus = 4;
	logWin.src = _this.aliveUrl;
	return true;
}
//当前用户信息 -- public
_this.getUser = function(){
	var profile=JY.tool.cookie.get('PROFILE');
	if(profile && profile.length>10){
		var arr=profile.split(':');
		if(/^\d{7,10}$/.test(arr[0])){
			_this.user['uid']=arr[0];
		}
		_this.user['nickname']=JY.tool.cookie.unCharCode(decodeURIComponent(arr[1]));
		_this.user['sex']=arr[2];
		_this.user['avatar']=(arr[5]==1)?'http://'+arr[3]+'/avatar.jpg':arr[7];
		_this.user['certify']=arr[5];
		var loc=JY.tool.cookie.get('myloc');
		if(loc && loc.length>3){
			loc=loc.split('|');
			_this.user['work_location']=loc[0];
			_this.user['work_sublocation']=loc[1];
		}
	}
	if(_this.user['uid']>0){ //是否依然在线
		var time=JY.tool.cookie.get('last_login_time');
		if(time>0) _this.lastAliveTime=time*1000;
		if((new Date).getTime() - _this.lastAliveTime > 3600000){//1000*60*60
			//_this.alive();
		}
	}
	return _this.user;
}
_this.filterUrl = function(url){
	if(!url) return '';
	url=decodeURIComponent(url);
	return url.replace(/&amp;/g,'&');
}
_this.DEFINED = 1;
}());

// --- end
}


//~~~ import jsLib end ~~~//


//头部自用变量与函数
var i,chan,hder={};
hder.siteInfo = JY.url.getSiteInfo();
hder.siteHome = JY.url.getSiteHome();
hder.channel = JY.url.getChannel();
hder.path = JY.url.path;
hder.imgUrl = JY.url.getImgBaseUrl();
hder.chanList = ['index','usercp','search','newmember','online','party','article','story','paper','master','vip'];
hder.chanUrlList={}; hder.chanClassList={};
for(i=0;i<hder.chanList.length;i++){
	chan = hder.chanList[i];
	hder.chanClassList[chan] = chan==hder.channel ? 'on':'';
	hder.chanUrlList[chan] = JY.url.getChannelUrl(chan);
}
hder.myImgPath = hder.imgUrl['www']+'global/i/';
hder.indexImgPath = hder.imgUrl['www']+'index/i/';
hder.user = JY.login.getUser();
function free_hder(){window.hder=null;}
//>>


//登录状态变更需要通知的函数列表
var loginStatusChangeCallList=[];
function loginStatusChangeCall(param)
{
	if(loginStatusChangeCallList.length<1){
		return false;
	}
	for(var i in loginStatusChangeCallList){
		if(typeof loginStatusChangeCallList[i]=='function'){
			loginStatusChangeCallList[i](param);
		}
	}
}


//兼容旧版
var _head_wr = function(str){JY.wr(str);}
var SITE_MOD = mod=iframe=hder.channel;
var url_arr = JY.url.href.split('http://');
var url_dom_arr = url_arr[1].split('/');
var loc_domain = url_dom_arr[0];
var domain_arr = loc_domain.split('.');
var dom_length = domain_arr.length;
var mydomain = hder.siteInfo['domain'];
var SITE_HOST = hder.siteInfo['num'];
var profile = JY.tool.cookie.get('PROFILE');
var cookie_uid = hder.user['uid'];
var isSigned = cookie_uid>0?1:0;
var cookie_nickname = hder.user['nickname'];
var array_of_profile = [cookie_uid,cookie_nickname,hder.user['sex']];
var get_request_head_value = JY.url.getQueryValue;
var get_head_cookie = JY.tool.cookie.get;
var HEAD_IMAGE_URL = hder.imgUrl[0]+'global/';
var HEAD_FRA_URL = hder.imgUrl[0]+'html/';
var current_url = hder.channel=='index'?'':JY.url.href;
var loc_referrer = document.referrer;
var AddFav = function(title,url){
	if (typeof window.sidebar=='object' && typeof window.sidebar.addPanel=='function'){
		window.sidebar.addPanel(title,url,'');
	}else{
		window.external.AddFavorite(url,title);
	}
}
var mycopy_head = function(){
	var board='';
	board+=JY.$('head_url').innerHTML;
	try{window.clipboardData.setData("Text",board);
	alert('复制成功，您可以转发给您QQ或MSN上好友！');}catch(e){}
}
var setHomePage = function(obj, url){
	try{obj.style.behavior='url(#default#homepage)'; obj.setHomePage(url);
	}catch(e){
		if(window.netscape){
			try{ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
			}catch(e){
			var msg='抱歉，此操作被浏览器拒绝！\n\n请在浏览器地址栏输入"about:config"';
			msg+='并回车然后将[signed.applets.codebase_principal_support]设置为"true"';
			alert(msg);
			};
		}else{alert("抱歉，您所使用的浏览器无法完成此操作。\n\n您需要手动将'"+url+"'设置为首页。");};
	};
}
//>>



//html output
if(hder.siteHome.indexOf('love21cn.com')>-1){location.href='http://www.jiayuan.com';STD_HEADER_NO_OUT=1;}
if(typeof STD_HEADER_NO_OUT!='number' || !STD_HEADER_NO_OUT){
	if(hder.siteInfo['name']=='www'){//主站
		if(hder.channel=='story'){
			if(hder.path.indexOf('space_create.php')>=0 || hder.path.indexOf('story_update.php')>=0){
				JY.wr('<scr'+'ipt src="'+HEAD_IMAGE_URL+'j/head/www/header_html.js"></scr'+'ipt>');
			}else{JY.wr('<scr'+'ipt src="'+HEAD_IMAGE_URL+'j/head/www/header_html_story.js"></scr'+'ipt>');}
		}else{
			JY.wr('<scr'+'ipt src="'+HEAD_IMAGE_URL+'j/head/www/header_html.js"></scr'+'ipt>');
		}
	}else{//默认
		if(hder.channel=='story'){
			if(hder.path.indexOf('space_create.php')>=0 || hder.path.indexOf('story_update.php')>=0){
				JY.wr('<scr'+'ipt src="'+HEAD_IMAGE_URL+'j/head/www/header_html.js"></scr'+'ipt>');
			}else{JY.wr('<scr'+'ipt src="'+HEAD_IMAGE_URL+'j/head/www/header_html_story.js"></scr'+'ipt>');}
		}else{
			JY.wr('<scr'+'ipt src="'+HEAD_IMAGE_URL+'j/head/www/header_html.js"></scr'+'ipt>');
		}
	}
}




try{
//仅主站
if(typeof SITE_HOST=='number' && (SITE_HOST==0 || SITE_HOST==100)){
//全站搜索条
var commonSearchBar = {
'mods':['index.html','usercp','party','diary','article','love',/*'story',*/'paper','master'],
'domains':['www.jiayuan.com','jiayuan.com','www.miuu.'+'cn','miuu.'+'cn','usercp.jiayuan.com','usercp.miuu.'+'cn'],
'indexs':['index.html','index_qf.html'],
'barJs':HEAD_IMAGE_URL+'j/commonSearchBar.js',
'getIsShow':function(mod, urlPathArray){
	var isShow=0,isDomain=0,isIndex=0,i;
	if(typeof urlPathArray!='object' || urlPathArray.length<2){return 0;}
	for(i=0;i<this.mods.length;i++){
		if(mod==this.mods[i]){isShow=1;}
	}
	for(i=0;i<this.domains.length;i++){
		if(urlPathArray[0]==this.domains[i]){isDomain=1;}
	}
	for(i=0;i<this.indexs.length;i++){
		if(urlPathArray[1]=='' || urlPathArray[1].indexOf(this.indexs[i])>-1){isIndex=1;}
	}
	if(isDomain && isIndex) {return 1;}
	if(isShow==1 && urlPathArray.length>2 && urlPathArray[1]=='usercp' && urlPathArray[2]!=''
		&& urlPathArray[2]!='index.php'&& urlPathArray[2].substr(0,1)!='?'
		&& urlPathArray[2].substr(9,1)!='?' && urlPathArray[2].substr(0,1)!='#'
		&& urlPathArray[2].substr(9,1)!='#'){
		isShow=0;
	}
	return isShow;
	},
'show':function(){
	document.writeln('<script src="'+this.barJs+'"></script>');
	},
'start':function(mod, urlPathArray){
	var isShow = this.getIsShow(mod, urlPathArray);
	if (isShow) {this.show();}
	}
}
//调用
if(typeof(SITE_MOD)!='undefined' && typeof(url_dom_arr)!='undefined' && (typeof STD_HEADER_NO_OUT!='number'||!STD_HEADER_NO_OUT)){
	commonSearchBar.start(SITE_MOD, url_dom_arr);
}
commonSearchBar=null;
//
}
}catch(e){};

