var loc_url	=	location.href;
var url_arr	=	loc_url.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 topdomain = window.location.host.match(/[^.]*\.(com|cn|net|org)(\.[^.]*)?/ig);
if(topdomain) topdomain = topdomain[0];
else topdomain = document.domain;
if(domain_arr[(domain_arr.length-1)]	==	'')
{
	var add	=	1;
}
else
{
	var add	=	0;
}
var mydomain		=	'love21cn.msn.com.cn';
var im_userInfo = new Object(); 

function _foot_gbid(e_id)
{
	return document.getElementById(e_id);
}

function _foot_wr(str)
{
	document.writeln(str);
}

function readCookie(name)
{
  var cookieValue = "";
  var search = name + "=";
  if(document.cookie.length > 0)
  { 
    offset = document.cookie.indexOf(search);
    if (offset != -1)
    { 
      offset += search.length;
      end = document.cookie.indexOf(";", offset);
      if (end == -1) end = document.cookie.length;
      cookieValue = decodeURIComponent(document.cookie.substring(offset, end))
    }
  }
  return cookieValue;
}

function writeCookie(name, value, hours)
{
  var expire = "";
  if(hours != null)
  {
    expire = new Date((new Date()).getTime() + hours * 3600000);
    expire = "; expires=" + expire.toGMTString();
  }
  document.cookie = name + "=" + escape(value) + expire + ";domain="+mydomain+";path=/";
}

var V_LINK = "";
function getPvlink(){
	if(V_LINK==""){
		var myloc=readCookie('myloc');
		var mysex=readCookie('mysex');
		var myage=readCookie('myage');
		var myuid=readCookie('myuid');
		V_LINK="http://59.151.18.14/call/v.gif?m=1&location="+ myloc+"&sex="+mysex+"&age="+myage+"&uid="+myuid;
	}
	
	return V_LINK+"&rd="+Math.random();
}

var FOOT_IMAGE_URL = 'http://images.jiayuan.com/m3/global/';

_foot_wr('<style type=text/css>');

/* footer */
_foot_wr('.msnjiayuan_foot{');
_foot_wr('	width: 950px;');
_foot_wr('	float: left;');
_foot_wr('	background: #0071b3;');
_foot_wr('	padding: 10px 0;');
_foot_wr('	margin-top: 10px;');
_foot_wr('	font-weight: bolder;');
_foot_wr('	color: white;');
_foot_wr('	text-align:center');
_foot_wr('}');
_foot_wr('.msnjiayuan_foot input{');
_foot_wr('	vertical-align: middle;');
_foot_wr('}');
_foot_wr('.sub_msn{');
_foot_wr('      width: 52px;');
_foot_wr('      height: 20px;');
_foot_wr('      background: url(http://images.jiayuan.com/m3/global/i/msntopbn.jpg) no-repeat;');
_foot_wr('      border: none;');
_foot_wr('      line-height: 21px;');
_foot_wr('      overflow: hidden;');
_foot_wr('      color: white;');
_foot_wr('      font-weight: bolder;');
_foot_wr('}');
        _foot_wr('.msn_jiayuanheadersrinput01{');
        _foot_wr('      width: 250px;');
        _foot_wr('      height: 18px;');
        _foot_wr('      border: 1px solid #AACCEF;');
        _foot_wr('}');
_foot_wr('.msnjiayuan_copyright{');
_foot_wr('	width: 950px;');
_foot_wr('	float: left;');
_foot_wr('	line-height: 24px;');
_foot_wr('	font-family: Arial, Helvetica, sans-serif;');
_foot_wr('	margin-top: 10px;');
_foot_wr('	text-align:center');
_foot_wr('}');
_foot_wr('.msnjiayuan_copyright a{');
_foot_wr('	color: #004499;');
_foot_wr('}');
/* IE hack */
_foot_wr('.clearline {');
_foot_wr('	clear: both;');
_foot_wr('	height: 0;');
_foot_wr('	overflow: hidden;');
_foot_wr('}');
_foot_wr('.hackbox{');
_foot_wr('	display: table;');
_foot_wr('}');
/* center_wapper */
_foot_wr('.index_centerwapper{');
_foot_wr('	width: 1000px;');
_foot_wr('	margin: 0 auto;');
_foot_wr('}');
_foot_wr('.index_centerwapper_c{');
_foot_wr('	width: 950px;');
_foot_wr('	padding: 0 25px;');
_foot_wr('	float: left;');
_foot_wr('	background: white;');
_foot_wr('	color: #393939;');
_foot_wr('}');

_foot_wr('</style>');

_foot_wr('<div class="index_centerwapper">');
_foot_wr('<div class="index_centerwapper_c">');

_foot_wr('<div class="msnjiayuan_foot">');
_foot_wr('<form action="http://cnweb.search.live.com/results.aspx" method="get" target="_blank">');
_foot_wr('<label for="q">网页</label> <input type="text" id="q" name="q" maxlength="150" class="msn_jiayuanheadersrinput01" /><input type="hidden" name="FORM" value="MOCHHT" /><input type="hidden" name="srch_type" value="0" /><input type="submit" class="sub_msn" value="搜索" />');
_foot_wr('</form>');
_foot_wr('</div>');

_foot_wr('<div class="msnjiayuan_copyright">');
_foot_wr('内容提供：世纪佳缘 ICP证书：沪B2-20100074 Copyright © 2003-2011 版权所有   <br />');
_foot_wr('</div>');

_foot_wr('</div>');
_foot_wr('</div>');

var _head_profile	=	readCookie('PROFILE');

var str_login	=	'';

if(document.getElementById('show_login'))
{
	if (_head_profile)
	{
		str_login	=	'<a href="/login/logout.php">退出登录</a>';
	}
	else
	{
		str_login	=	'您好，请&nbsp;<a href="/login/index.php?pre_url='+location.href.replace('&',',')+'">登录</a>&nbsp;或&nbsp;<a href="/register/">免费注册</a>&nbsp;';
	}
	
	document.getElementById('show_login').innerHTML	=	str_login;
}


//标准尾结束


//for pop

_foot_wr('<style type=text/css>');

///* global css */'
_foot_wr('*{');
_foot_wr('	margin: 0;');
_foot_wr('	padding: 0;');
_foot_wr('}');
_foot_wr('div, td, table, ul, li, ol, dd, dl,dt {');
_foot_wr('	margin: 0;');
_foot_wr('	padding: 0;');
_foot_wr('}');
_foot_wr('html {');
_foot_wr('	width: 100%;');
_foot_wr('	margin: auto;');
_foot_wr('}');
/*_foot_wr('body{');
_foot_wr('	margin: 0;');
_foot_wr('	padding: 0;');
_foot_wr('	text-align: center;');
_foot_wr('	font: 12px/1.5  "宋体",Verdana;');
_foot_wr('}');*/
_foot_wr('table{');
_foot_wr('	border: none;');
_foot_wr('	border-collapse: collapse;');
_foot_wr('}');
_foot_wr('div, td {');
_foot_wr('	word-wrap: break-word;');
_foot_wr('	word-break: break-all;');
_foot_wr('	font-size: 12px;');
_foot_wr('}');
_foot_wr('img, img a, img a:hover{');
_foot_wr('	border: none;');
_foot_wr('}');
_foot_wr('h1,h2,h3,h4,h5,h6{');
_foot_wr('	font-size: 12px;');
_foot_wr('	font-weight: normal;');
_foot_wr('}');
_foot_wr('a {');
_foot_wr('	color: #393939;');
_foot_wr('	text-decoration: none;');
_foot_wr('}');
_foot_wr('a:hover{');
_foot_wr('	color: #F60;');
_foot_wr('	text-decoration: underline;');
_foot_wr('}');
_foot_wr('ul, ol{');
_foot_wr('	list-style: none;');
_foot_wr('}');
_foot_wr('marquee{');
_foot_wr('	font: 12px/1.5  "宋体",Verdana;');
_foot_wr('}');
_foot_wr('em, i{');
_foot_wr('	font-style: normal;');
_foot_wr('}');

// IE hack */');
_foot_wr('.clearline {');
_foot_wr('	clear: both;');
_foot_wr('	height: 0;');
_foot_wr('	overflow: hidden;');
_foot_wr('}');
_foot_wr('.hackbox{');
_foot_wr('	display: table;');
_foot_wr('}');
_foot_wr('');
_foot_wr('.windowprompt{');
_foot_wr('	width: 280px;');
_foot_wr('	float: left;');
_foot_wr('}');
_foot_wr('.windowprompt h2{');
_foot_wr('	width: 254px;');
_foot_wr('	float: left;');
_foot_wr('	background: url('+FOOT_IMAGE_URL+'/i/prompttitlebg.jpg) no-repeat;');
_foot_wr('	height: 29px;');
_foot_wr('	overflow: hidden;');
_foot_wr('	padding-left: 26px;');
_foot_wr('}');
_foot_wr('.windowprompt h2 em{');
_foot_wr('	width: 70px;');
_foot_wr('	float: left;');
_foot_wr('	text-align: center;');
_foot_wr('	line-height: 30px;');
_foot_wr('	font-weight: bolder;');
_foot_wr('}');
_foot_wr('.windowprompt h2 em.windowpromptover a{');
_foot_wr('	color: white;');
_foot_wr('	width: 70px;');
_foot_wr('	height: 30px;');
_foot_wr('	display: block;');
_foot_wr('}');
_foot_wr('.windowprompt h2 em.windowpromptover a:hover{');
_foot_wr('	text-decoration: none;');
_foot_wr('}');
_foot_wr('.windowprompt h2 em.windowprompton{');
_foot_wr('	width: 70px;');
_foot_wr('	float: left;');
_foot_wr('	background: url('+FOOT_IMAGE_URL+'/i/prompttitleon.jpg) no-repeat right;');
_foot_wr('}');
_foot_wr('.windowprompt h2 em.windowprompton a{');
_foot_wr('	color: black;');
_foot_wr('}');
_foot_wr('.windowprompt h2 em.windowprompton a:hover{');
_foot_wr('	text-decoration: none;');
_foot_wr('}');
_foot_wr('.windowprompt h2 span{');
_foot_wr('	float: left;');
_foot_wr('	width: 40px;');
_foot_wr('	margin: 5px 0 0 0;');
_foot_wr('}');
_foot_wr('.windowpromptin{');
_foot_wr('	background: url('+FOOT_IMAGE_URL+'/i/promptwinbg.jpg) no-repeat right;');
_foot_wr('	width: 280px;');
_foot_wr('	height: 175px;');
_foot_wr('	float: left;');
_foot_wr('}');
_foot_wr('.windowpromptin dl{');
_foot_wr('	width: 210px;');
_foot_wr('	height: 110px;');
_foot_wr('	float: left;');
_foot_wr('	margin: 35px 0 0 47px;');
_foot_wr('	display: inline;');
_foot_wr('	overflow: hidden;');
_foot_wr('}');
_foot_wr('.windowpromptin dd{');
_foot_wr('	width: 210px;');
_foot_wr('	float: left;');
_foot_wr('	text-align: left;');
_foot_wr('}');
_foot_wr('.windowpromptin dd span{');
_foot_wr('	float: right;');
_foot_wr('}');
_foot_wr('.windowpromptin dd em{');
_foot_wr('	color: #1A66B3;');
_foot_wr('}');
_foot_wr('.windowpromptin dd a{');
_foot_wr('	color: #1A66B3;');
_foot_wr('	text-decoration: underline;');
_foot_wr('}');
_foot_wr('</style>');





var IE = (navigator.appName == "Microsoft Internet Explorer");
var x,y,popx,popy;
var pop_height	=	201;
var pop_mini_h	=	30;
var pop_running	=	0;
var bulletin_div;
var _ope	=	'up';
var	time_hdl;

function _mini()
{
	if(_ope	==	'mini')
	{
		sBtn.title	=	"最小化";
		sBtn.style.backgroundImage	=	'url("'+FOOT_IMAGE_URL+'/i/min_icon.gif")';
		_ope	=	'max';
	}
	else
	{
		sBtn.title	=	"最大化";
		sBtn.style.backgroundImage	=	'url("'+FOOT_IMAGE_URL+'/i/max_icon.gif")';
		_ope	=	'mini';
	}
}

function _max()
{
	sBtn.title	=	"最小化";
	sBtn.style.backgroundImage	=	'url("'+FOOT_IMAGE_URL+'/i/min_icon.gif")';
	_ope	=	'max';
}

function _close()
{
	_ope	=	'close';
}

function setSize(elmt,x,y)
{
	if (IE)
	{
		elmt.style.width=x;
		elmt.style.height=y;
	}
	else
	{
		var l=elmt.offsetWidth;
		elmt.style.borderLeftWidth="0px";
		l-=elmt.offsetWidth;

		var l=elmt.offsetWidth;
		elmt.style.borderLeftWidth="0px";
		l-=elmt.offsetWidth;
		
		var r=elmt.offsetWidth;
		elmt.style.borderRightWidth="0px";
		r-=elmt.offsetWidth;
		
		var o=elmt.offsetHeight;
		elmt.style.borderTopWidth="0px";
		o-=elmt.offsetHeight;
		
		var b=elmt.offsetHeight;
		elmt.style.borderBottomWidth="0px";
		b-=elmt.offsetHeight;

		var dx=l+r;
		var dy=o+b;
		elmt.style.width=x-dx+"px";
		elmt.style.height=y-dy+"px";
	}
}

function setPosition(elmt,x,y)
{
	//alert(x);
	//alert(y);
	elmt.style.left=x+"px";
	elmt.style.top=y+"px";
}


var loc_tmp	=	location.href;
var k=0;
var loc_res='';
for(i=(loc_tmp.length-1);i>=0;i--)
{
	loc_res	=	loc_tmp.substr(i,1)+loc_res;
	k++;
	if(k	>=	7)
	{
		break;
	}
}

function run()
{
	if(_ope	==	'up' || _ope	==	'max')
	{
		if(y < pop_height)
		{
			if(y	>=	200)
			{
				y+=2;
			}
			else
			{
				y+=10;
			}
		}
	}
	
	if(_ope	==	'start')
	{
		if(loc_res	==	'usercp/'	||	loc_res	==	'/usercp')
		{
			if(y < pop_mini_h)
			{
				y+=10;
			}
			else
			{
				_ope	=	'mini';
			}
		}
		else
		{
			_ope	=	'mini';
		}
	}
	
	if(_ope	==	'mini')
	{
		if(y > pop_mini_h)
		{
			if(y	==	202)
			{
				y	=	200;
			}
			y-=10;
		}
	}
	
	if(_ope	==	'close')
	{
		if(y > 0)
		{
			if(y	==	202)
			{
				y	=	200;
			}
			y-=10;
		}
		/*if(y	<=	0)
		{
			bulletin_div.style.display	=	'none';
			pop_running	=	0;
			clearTimeout(time_hdl);
			return;
		}*/
	}


	var standardCompat = document.compatMode.toLowerCase();
	//alert(standardCompat);
	if (standardCompat == "css1compat")
	{
		popy = document.documentElement.scrollTop;
	}
	else if (standardCompat == "backcompat" || standardCompat == "quirksmode" )
	{
		popy = document.body.scrollTop;
	}
	
	if(im_userInfo.isshowtoolbar)
		popy	+=	document.documentElement.clientHeight-y-27;
	else
		popy	+=	document.documentElement.clientHeight-y;
	
	popx	=	document.documentElement.clientWidth-x;
	setSize(bulletin_div,x,y);
	setPosition(bulletin_div,popx,popy);
	time_hdl	=	setTimeout('run()',50);
}

function _mini_it()
{
	if(_ope	!=	'mini' && _ope	!=	'close')
	{
		_mini();
	}
}

_foot_wr('<div id="bulletin" style="display:none;position:absolute;z-index:3" onclick="stop_flash(\'1\');stop_flash(\'2\');stop_flash(\'3\');">');
_foot_wr('<div id="bull_fra" style="position:absolute;z-index:1;width;280px;height:201px;left:0">');
_foot_wr('<iframe src="" width=280 height=28 frameborder=0 scrolling=no></iframe>');
_foot_wr('<iframe src="" width=226 height=171 frameborder=0 scrolling=no></iframe>');
_foot_wr('</div>');
_foot_wr('<div id="pop_div" style="position:absolute;z-index:2;left:0" class="windowprompt">');
_foot_wr('<h2>');
_foot_wr('<em class="windowprompton" id="div_1"><a style="CURSOR:pointer" onclick="javascript:show_div(\'1\',1);"><font id="link_1">互动消息</font></a></em>');
_foot_wr('<em class="windowpromptover" id="div_2"><a style="CURSOR:pointer" onclick="javascript:show_div(\'2\',1);"><font id="link_2">鹊桥传情</font></a></em>');
_foot_wr('<em class="windowpromptover" id="div_3"><a style="CURSOR:pointer" onclick="javascript:show_div(\'3\',1);"><font id="link_3">网站动态</font></a></em>');
_foot_wr('<span><a id="switchButton" onclick="_mini();" title="最小化"></a><a id="closeButton" onclick="_close();" title="关闭"></a></span>');
_foot_wr('</h2>');

_foot_wr('<div class="windowpromptin">');
_foot_wr('<dl style="margin-top:10px; height:160px;">');
_foot_wr('<dd id="con_1" style="margin-top:0px"><p><img src="'+FOOT_IMAGE_URL+'i/logo_prompt.jpg" /></p></dd>');
_foot_wr('<dd id="con_2" style="margin-top:25px;display:none;"><p><img src="'+FOOT_IMAGE_URL+'i/logo_prompt.jpg" /></p></dd>');
_foot_wr('<dd id="con_3" style="margin-top:25px;display:none;"><p><img src="'+FOOT_IMAGE_URL+'i/logo_prompt.jpg" /></p></dd>');
_foot_wr('</dl>');
_foot_wr('<iframe id="run_fra" name="run_fra" src="" width=0 height=0></iframe>');
_foot_wr('</div>');

_foot_wr('</div>');
_foot_wr('</div>');

function show_div(show_id,max_it)
{
	for(i=1;i<=3;i++)
	{
		var div_obj	=	document.getElementById("div_"+i);
		var con_obj	=	document.getElementById("con_"+i);
		if(i	==	show_id)
		{
			div_obj.className	=	"windowprompton";
			con_obj.style.display	=	'';
		}
		else
		{
			div_obj.className	=	"windowpromptover";
			con_obj.style.display	=	'none';
		}
	}
	if(max_it)
	{
		_max();
	}
	stop_flash(show_id);
}

function run_pop()
{
	if(pop_running	>	0)
	{
		return;
	}
	_ope	=	'start';
	pop_running	=	1;

	bulletin_div	=	document.getElementById('bulletin');
	bulletin_div.style.display	=	'';
	bulletin_div.style.cssText="position:absolute;\
						z-index:1;\
						overflow:hidden;";
	
	sBtn	=	document.getElementById('switchButton');
	sBtn.title	=	"最大化";
	sBtn.style.cssText='position:absolute;\
						z-index:2;\
						\
						font-size:0px;\
						line-height:0px;\
						\
						left:240px;\
						top:8px;\
						width:14px;\
						height:14px;\
						\
						CURSOR:pointer;\
						background-image:url("'+FOOT_IMAGE_URL+'/i/max_icon.gif");';
	
	
	var btn	=	document.getElementById('closeButton');
	
	btn.style.cssText='position:absolute;\
						z-index:2;\
						\
						font-size:0px;\
						line-Height:0px;\
						\
						left:256px;\
						top:8px;\
						width:14px;\
						height:14px;\
						\
						CURSOR:pointer;\
						background-image:url("'+FOOT_IMAGE_URL+'/i/close_icon.gif");';
	
	
	var standardCompat = document.compatMode.toLowerCase();
	//alert(standardCompat);
	if (standardCompat == "css1compat")
	{
		popy = document.documentElement.scrollTop;
	}
	else if (standardCompat == "backcompat" || standardCompat == "quirksmode" )
	{
		popy = document.body.scrollTop;
	}
	
	x=280;y=0;

	run();
	//setTimeout('_mini_it()',10000);
}


function mypop(displayMode,minu,cookieName)
{
	if(cookieName	!=	'')
	{
		var n=readCookie(cookieName);
		if(!n)
		{
			n=0;
		}
		if (displayMode=="once")
		{
			var tm=new Date().getTime();
			if (tm<n)
			{
				show_div('3',false);
				return;
			}
		}
		
		var tm=new Date().getTime();
		var nextTime	=	parseInt(tm)+minu*60*1000;
		writeCookie(cookieName, nextTime,  24*30);
	}
	
	////////////////统计
		var con_3 = document.getElementById('con_3');
				var pop_huodong=con_3.innerHTML;
				var huodong_len_l=pop_huodong.indexOf('pid=');
				
				var pid=pop_huodong.substr(huodong_len_l+4,4);
				var pvurl = getPvlink();
				con_3.innerHTML	=	pop_huodong +"<img src='"+pvurl+"&pv=huodong&pid="+pid+"&' width='0' height='0'  style='display:none'>"; //img统计 活动弹窗
/////////////////////
	
	show_div('3',1);
	sl_pv(con_3);
	//_max();
}

function pop_content(content)
{
	var con_obj	=	document.getElementById("con_1");
	if(content.indexOf("div") == 1) {	
	 		con_obj.innerHTML = content;
			show_div('1',1);
			poped   =   true;
			sl_pv(con_obj);
	} else {
		con_obj.innerHTML   =   '<p><img src="http://images.jiayuan.com/w/global/i/logo_prompt.jpg" /></p>';
	}
}

function pop_relation(pop_str)
{
	var _head_profile_arr	=	_head_profile.split(':');
	if(_head_profile_arr[2]	==	'm')
	{
		var show_sex	=	'她';
		var show_type	=	20;
	}
	else
	{
		var show_sex	=	'他';
		var show_type	=	10;
	}
	var con_arr	=	pop_str.split('|');
	var con_obj	=	document.getElementById("con_1");
	
	if(pop_str )
  {
      var pvurl = getPvlink();

      var myxml   =   getXMLHttpRequest();
      myxml.open("GET","/pop/popinfo.php?popstr="+encodeURIComponent(pop_str));
      myxml.send(null);
      myxml.onreadystatechange=function()
      {
          if(myxml.readyState==4)
          {
              var myxml_text  =   myxml.responseText;
              //if(myxml_text   !=  'none'  &&  myxml_text  !=  '')
              if(myxml_text.indexOf("div") == 1)
              {	
				 			var parr = content.match(/\s+poptype\s*=\s*(\d+)/); 
							if(parr && parr[1]==2){
								document.domain = topdomain ;
								setTimeout("popup_bgdiv_foot('/dating/showhello.php','',592,346)",2000);
								setTimeout("close_popup_foot(false)",180000);
							}else{
				 				 con_obj.innerHTML   =   myxml_text  +"<img src='"+pvurl+"&pv=hudong&type="+con_arr[2]+"&' width='0' height='0'  style='display:none'>"; //img 统计
                  show_div('1',1);
                  writeCookie('pop_str', '', -1);
                  poped   =   true;
                  sl_pv(con_obj);
								}
              }
              else
              {
                  con_obj.innerHTML   =   '<p><img src="http://images.jiayuan.com/w/global/i/logo_prompt.jpg" /></p>';
              }
          }
      }
  }
  else
  {
      con_obj.innerHTML   =   '<p><img src="http://images.jiayuan.com/w/global/i/logo_prompt.jpg" /></p>';
  }
}


function insert_con()		//弹出活动等公告信息
{
	var myloc	=	readCookie('myloc');
	var myloc_arr	=	false;
	if(myloc)
	{
		myloc_arr	=	myloc.split('|');
	}

	var mod;
	var _url	=	location.href;
	_url	=	_url.replace('http://','');
	//alert(_url);
	var _url_arr	=	_url.split('/');
	//alert(_url_arr);
	mod	=	_url_arr[1];
	
	switch (mod)
	{
		case 'usercp':
			mod_code	=	2;
			break;
		case 'ques':
			mod_code	=	2;
			break;
		case 'msg':
			mod_code	=	2;
			break;
		case 'charge':
			mod_code	=	2;
			break;
		case 'search':
			mod_code	=	3;
			break;
		case 'party':
			mod_code	=	10;
			break;
		case 'parties':
			mod_code	=	10;
			break;
		case 'article':
			mod_code	=	4;
			break;
		case 'diary':
			mod_code	=	4;
			break;
		case 'online':
			mod_code	=	5;
			break;
		case 'story':
			mod_code	=	7;
			break;
		case 'love':
			mod_code	=	7;
			break;
		case 'my':
			mod_code	=	6;
			break;
		case 'profile':
			mod_code	=	6;
			break;
		case 'student':
			mod_code	=	8;
			break;
		case 'master':
			mod_code	=	9;
			break;
		default:
			mod_code	=	1;
			break;
	}

	var	dopop	=	false;
	for(i=(pop_arr.length-1);i>=0;i--)
	{
		var page_arr	=	pop_arr[i][3].split(',');
		for(k=0;k<page_arr.length;k++)
		{
			if(dopop)
			{
				break;
			}
			if(page_arr[k]	>	0)
			{
				if(mod_code	==	page_arr[k])
				{
					if(pop_arr[i][4]	>	0)
					{
						if(_head_profile	&&	myloc_arr)
						{
							if((pop_arr[i][4]	+	'00')	==	pop_arr[i][5])
							{
								if(myloc_arr[0]	==	pop_arr[i][4])
								{
									dopop	=	true;
								}
							}
							else
							{
								if(myloc_arr[1]	==	pop_arr[i][5])
								{
									dopop	=	true;
								}
							}
						}
					}
					else
					{
						dopop	=	true;
						break;
					}
				}
			}
		}

		if(dopop)
		{
			document.getElementById('con_3').innerHTML	=	pop_arr[i][6];
			if(!poped)
			{
				mypop(pop_arr[i][0],pop_arr[i][1],pop_arr[i][7]);
			}
			return;
		}
	}
}

var time_hdl_1,time_hdl_2,time_hdl_3;

function flash_title(flash_id,step)
{
	var flash_obj	=	document.getElementById('link_'+flash_id);
	if(step	==	'1')
	{
		flash_obj.style.color	=	"";
		var step_next	=	'0';
	}
	else
	{
		flash_obj.style.color	=	"#FF6600";
		var step_next	=	'1';
	}

	if(flash_id	==	'1')
	{
		clearTimeout(time_hdl_1);
		time_hdl_1	=	setTimeout('flash_title("'+flash_id+'","'+step_next+'")',330);
	}
	if(flash_id	==	'2')
	{
		clearTimeout(time_hdl_2);
		time_hdl_2	=	setTimeout('flash_title("'+flash_id+'","'+step_next+'")',330);
	}
	if(flash_id	==	'3')
	{
		clearTimeout(time_hdl_3);
		time_hdl_3	=	setTimeout('flash_title("'+flash_id+'","'+step_next+'")',330);
	}
}

function stop_flash(flash_id)
{
	if(flash_id	==	'1')
	{
		clearTimeout(time_hdl_1);
	}
	if(flash_id	==	'2')
	{
		clearTimeout(time_hdl_2);
	}
	if(flash_id	==	'3')
	{
		clearTimeout(time_hdl_3);
	}
	var flash_obj	=	document.getElementById('link_'+flash_id);
	flash_obj.style.color	=	"";
}

function clear_con(con_id)
{
	document.getElementById('con_'+con_id).innerHTML	=	'<p><img src="'+FOOT_IMAGE_URL+'i/logo_prompt.jpg" /></p>';
}



//声明xmlhttp
function getXMLHttpRequest()
{
	var xmlhttp;
//for ie
	try
	{
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP.4.0");
	}
	catch(E)
	{
		try
		{
			xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch(E)
		{
			try
			{
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(E)
			{
				xmlhttp = false;
			}
		}
	}
//for firefox
	if (!xmlhttp && typeof XMLHttpRequest != 'undefined')
	{
		xmlhttp = new XMLHttpRequest();
	}
	return xmlhttp;
}

function timepop(first_time)
{
	if(bulletin_div.style.display	==	'none')
	{
		return;
	}
	var now	=	new Date().getTime();
	var pop_time	=	readCookie('pop_time');
	
	if (_head_profile)
	{
		if(first_time || (now	-	pop_time)	>	600000)
		{
			if(!first_time) 
			{
	    expire = new Date((new Date()).getTime() + 36000000);
			document.cookie = "pop_time="+now+";expires=" +expire.toGMTString()+";path=/;domain="+mydomain;
			}
			var myxml	=	getXMLHttpRequest();
			var url = "/pop/pop.php?COMMON_HASH="+readCookie('COMMON_HASH')+"&RAW_HASH="+readCookie('RAW_HASH')+"&a="+Math.random();
			if(first_time) 
				url += "&ft=1";
			url += "&v=2";
			myxml.open("GET", url, true);
			myxml.send(null);
			myxml.onreadystatechange=function()
			{
				if(myxml.readyState==4)
				{
					var myxml_text	=	myxml.responseText;
					if(myxml_text	!=	'none'	&&	myxml_text	!=	'')
					{
					 if(myxml_text.indexOf("div") == 1) {	
								var parr = myxml_text.match(/\s+poptype\s*=\s*(\d+)/); 
								if(parr && parr[1]==2){
									document.domain = topdomain ;
									setTimeout("popup_bgdiv_foot('/dating/showhello.php','',592,346)",2000);
									setTimeout("close_popup_foot(false)",180000);
							  }else{
									pop_content(myxml_text);
									flash_title('1');
								}
								//window.focus(); 
						}
					}
				} 
			}
		}
	}
	setTimeout('timepop(false)',30000);
}
var login_pop_profile=getQueryString('lpph'); 
//得到弹出内容
if(login_pop_profile!=null&&login_pop_profile=='1'){
	var login_pop_button=readCookie('loginpopbutton');
	var login_pop_title=readCookie('loginpoptitle');
	var login_pop_content=readCookie('loginpopcontent');
	//del_login_pop_cookie('loginpopcontent');
	//del_login_pop_cookie('loginpoptitle');
	//del_login_pop_cookie('loginpopcontent'); 
	show_msg_profile(login_pop_title,login_pop_content,url_decode_pop(login_pop_button));
}
//删除cookie
function del_login_pop_cookie(name){
   var date = new Date();
   date.setTime(date.getTime() - 10000);
   document.cookie = name + "=a; expires=" + date.toGMTString();
}
//弹出窗口
function show_msg_profile(mytitle,mycontent,mybutton)
{
	document.getElementById('mytitle').innerHTML	=	mytitle;
	document.getElementById('mycontent').innerHTML	=	mycontent;
	document.getElementById('mybutton').innerHTML	=	mybutton;

	document.getElementById('bgdiv').style.height	=	document.body.clientHeight;
	document.getElementById('bgdiv').style.width	=	document.body.clientWidth;
	document.getElementById('bgdiv').style.display	=	'';
	document.getElementById('msgdiv').style.display	=	'';

	document.getElementById('msgdiv').style.left=document.body.clientWidth/2-200;  
	document.getElementById('msgdiv').style.top=screen.height/2-240;
	var selects = document.getElementsByTagName('select');

	for(i=0;i<selects.length;i++)
	{
		selects[i].style.visibility = 'hidden';
	}
	document.body.scroll="no";
}

//得到url中的值
function getQueryString(queryStringName){
	var returnValue="";
	var URLString=new String(document.location);
	var serachLocation=-1;
	var queryStringLength=queryStringName.length;
	do{
	   serachLocation=URLString.indexOf(queryStringName+"\=");
	   if (serachLocation!=-1)
	   {
	   if ((URLString.charAt(serachLocation-1)=='?') || (URLString.charAt(serachLocation-1)=='&'))
	   {
	     URLString=URLString.substr(serachLocation);
	     break;
	   }
	   URLString=URLString.substr(serachLocation+queryStringLength+1);
	   }
	  
	}
	while (serachLocation!=-1)
	if (serachLocation!=-1){
	   var seperatorLocation=URLString.indexOf("&");
	   if (seperatorLocation==-1)
	   {
	   returnValue=URLString.substr(queryStringLength+1);
	   }
	   else
	   {
	   returnValue=URLString.substring(queryStringLength+1,seperatorLocation);
	   } 
	}
	return returnValue;
}
function url_decode_pop(str) {
    var ret = "";
    for(var i=0;i<str.length;i++) {
        var chr = str.charAt(i);
        if(chr == "+") {
            ret += " ";
        }else if(chr=="%") {
            var asc = str.substring(i+1,i+3);
            if(parseInt("0x"+asc)>0x7f) {
                ret += decodeURI("%"+ str.substring(i+1,i+9));
                i += 8;
            }else {
                ret += String.fromCharCode(parseInt("0x"+asc));
                i += 2;
            }
        }else {
            ret += chr;
        }
    }
    return ret;
}

function sl_pv(obj){
	　　var elements = obj.getElementsByTagName('a');
	　　for (var i = 0, len = elements.length; i < len; ++i) {
	　　　　elements[i].onmousedown = function(){
				var pvurl = getPvlink();
				document.getElementById('run_fra').src=pvurl+'&sl=zd&click='+this.href+'&';
			};
	　　}
	}

var	poped	=	false;

run_pop();

var pop_str	=	readCookie('pop_str');
//pop_str	=	'最美的平凡|9a860d0b4cbae435d23efc56ffcc2c1e|88|31018633||';
if(pop_str)
{
	pop_relation(pop_str);
}
else
{
	timepop(true);
}

//jyim start
if(document.cookie.indexOf('COMMON_HASH') != -1 && !readCookie('webim_disable'))
{
	/*var im_switch = false;
	if(readCookie('webim_on')) im_switch = true;
	else if(document.location.href.slice(-9) == '#webim_on')
	{
		document.cookie = 'webim_on=1; path=/; domain=' + topdomain;
		im_switch = true;
	}*/
	var im_switch = true;
	var first_pop_msg = null;
	var old_pop_content = null;
	if(im_switch)
	{
		var realReadCookie = window.readCookie;
		window.readCookie = function(key)
		{
			if(!old_pop_content && typeof(pop_content)!='undefined')
			{
				old_pop_content = pop_content;
				pop_content = function(msg) {first_pop_msg = msg;}
				window.readCookie = realReadCookie;
			}
			return realReadCookie(key);
		};
	}
	var FOOT_IMG_BASE = (window.topdomain=="jiayuan.com"||window.topdomain=="msn.com.cn") ? "http://images1.jyimg.com" : "http://images1."+window.topdomain;
	//prototype fix
	if(Object.prototype.toJSONString) delete Object.prototype.toJSONString;
	nojQuery = false;
	if(typeof(jQuery) == 'undefined' || parseFloat(jQuery.fn.jquery) < 1.4)
	{
		nojQuery = true;
		document.write('<script src="'+FOOT_IMG_BASE+'/w4/webim/jquery-1.6.1.min.js"></script>');
	}
	document.write('<script src="http://webim.jiayuan.com/pop_template.php?v=14"></script>');
	document.write('<script src="'+FOOT_IMG_BASE+'/w4/webim/jyim.js?v=41"></script>');
}
//jyim stop

_foot_wr('<'+'script type="text/javascript" src="http://images1.jyimg.com/w3/global/j/pop_freq.js'+'"><'+'/script>');

//flash_title('1');

if(pop_str)
	setTimeout('timepop(false)',30000); 

function sl_jumper(){
				var myj=readCookie('sl_jumper');
				if(myj.length>0)
				{ 
					writeCookie('sl_jumper', '', -1);
					var pvurl = getPvlink();
					pvurl = pvurl + '&'+ myj+'&sl_jumper=1';
					document.getElementById('run_fra').src=pvurl;
				}
	}
sl_jumper();
var IM_URL = 'http://chatjs1.jiayuan.com/';
//var IM_URL = readCookie('im_host');
var im_tool_arr = ["/online","/online/","talktest.php"];

function OnIMReceiveChatInvite(destuid, destname, invitemessage){
//	alert(invitemessage);
	if(invitemessage.indexOf("##invite#!")>-1)
	{
//		arr_ = invitemessage.split('|');
	im_closeBuddyListWindow();
		pop_relation(destname+'|'+destuid+'|15|'+destuid+'|1');
	}
	else if(invitemessage=="##refuse#!")
	{
		im_closeBuddyListWindow();
		pop_relation(destname+'|'+destuid+'|16|'+destuid+'|0');
	}else if(invitemessage.indexOf("##accept#!")>-1)
	{
		im_closeBuddyListWindow();
		pop_relation(arr_[2]+'|'+destuid+'|17|'+destuid+'|0');
	}else if(invitemessage=="##dating_inv#!"){
			try{imRefreshBuddylist();im_closeBuddyListWindow();}catch(e){}
			pop_relation(destname+'|'+im_userInfo.userid+'|50|'+destuid+'|0');
		}
}

function refuse(destuid,destname){
	_mini();
	clear_con('1');
	im_sendChatInvite(destuid, destname, '##refuse#!');
}

var is_im_show = 0;
var im_sid = readCookie('im_sid');
if (_head_profile && im_sid)
{
	
	for(i=0; i<im_tool_arr.length; i++)
	{
		if(location.href.indexOf(im_tool_arr[i]) > -1) 
		{
			is_im_show = 1;
			break;
		}
	}
	
	var _head_profile_arr	=	_head_profile.split(':');

	im_userInfo.isshowtoolbar = false;
	im_userInfo.userid = _head_profile_arr[0];

	im_userInfo.username = _head_profile_arr[1];
	im_userInfo.sid = im_sid;
	im_userInfo.siteid = 'jiayuan';
	im_userInfo.rd = Math.ceil((new Date().getTime() - 1262164318867) / 100);
	if(is_im_show == 1)
		im_userInfo.isshowtoolbar = true;

	document.write('<'+'script type="text/javascript" src="'+IM_URL+'imfunction_utf8.js"><\/script>');

}else{
	im_userInfo.userid = '';
	im_userInfo.username = '';
	im_userInfo.sid ='';
	im_userInfo.siteid = 'jiayuan';
	im_userInfo.isshowtoolbar = false;
	
}
/////////////////div msg///////////////////////

//遮罩层
document.write('<div id="bgdiv_foot" style="position:absolute;display:none; left:0px; top:0px; width:100%; height:100%; filter:alpha(opacity=30); opacity:0.3; background-color:#000000; z-index:12000;"></div>');
//iframe容器
document.write(' <div class="dragdiv" id="bg_div_float_foot" style="z-index:12001;position:absolute;top:0px;left:0px;display:none"></div>');	

function all_select_display(flag)
{
	var sel = document.getElementsByTagName('select');
	for(i=0;i<sel.length;i++)
	{
		sel[i].style.display = flag;
	}
}

function popup_bgdiv_foot(url, msg, _width, _height)
{  

	if(!_width){
		_width = 435;
	}

	if(!_height){
		_height = 600;
	}

	all_select_display('none');

	//设定容器层高度居中
	var __scroll = (document.documentElement.scrollTop + 30) + "px";
	if(url != '')
	{
		document.getElementById('bg_div_float_foot').innerHTML = '<iframe id="bg_div_iframe_foot" scrolling="no" width="'+_width+'" height="'+_height+'" allowTransparency="true" frameborder="0"></iframe>';
		document.getElementById('bg_div_iframe_foot').src = url; 
	}
	else if(msg != '')
	{
		document.getElementById('bg_div_float_foot').innerHTML = msg;
	}
	else
	{
		alert('参数错误');
		return false;
	}
	document.getElementById('bgdiv_foot').style.display = '';
	//设定遮罩层高度
	document.getElementById('bgdiv_foot').style.height	=  Math.max(document.body.scrollHeight,document.documentElement.scrollHeight) + 'px';
	//设定遮罩层宽度
	document.getElementById('bgdiv_foot').style.width	= Math.max(document.body.scrollWidth,document.documentElement.scrollWidth) + 'px';


	document.getElementById('bg_div_float_foot').style.top	= __scroll; 
	document.getElementById('bg_div_float_foot').style.left = (document.body.clientWidth/2-_width/2) + "px";
	document.getElementById('bg_div_float_foot').style.display = '';

}

function close_popup_foot(flag)
{
	all_select_display('');
	document.getElementById('bgdiv_foot').style.display = 'none';	
	document.getElementById('bg_div_float_foot').style.display = 'none';
	if(!flag)
	{
		document.getElementById('bg_div_iframe_foot').src = ''; 
	}
}
