var profile = get_head_cookie('PROFILE');
function _head_wr(str)
{
	document.writeln(str);
}
function get_head_cookie(c_name)
{
	if (document.cookie.length>0)
  {
		c_start=document.cookie.indexOf(c_name + "=");
		if (c_start!=-1)
		{ 
			c_start=c_start + c_name.length+1;
			c_end=document.cookie.indexOf(";",c_start);
			if (c_end==-1)
				c_end=document.cookie.length;
			return decodeURIComponent(document.cookie.substring(c_start,c_end));
		}
	}
	return null;
}


if(profile)
{
	array_of_profile = profile.split(':');
	cookie_uid = array_of_profile[0];
	cookie_nickname_en = array_of_profile[1];
	cookie_nickname = decodeURIComponent(cookie_nickname_en);
	var loginstr='<span><strong>欢迎您：<a href="http://www.jiayuan.com/'+cookie_uid+'">'+cookie_nickname+'</a>&nbsp;&nbsp;<a href="/login/logout2.php">退出登录</a></strong></span>';

}
else
{
	var loginstr='<div id="login"><span><strong><a href="/login">&gt;&gt;登录</a>&nbsp;&nbsp;<a href="/register">&gt;&gt;注册</a></strong></span></div>';
}
_head_wr('<ul>');
_head_wr('<li class="first"><a href="/" target="_blank"></a></li>');
_head_wr('<li><a href="http://'+mydomain+'/" target="_blank" onfocus="this.blur()">佳缘首页</a></li>');
_head_wr('<li><a href="http://'+mydomain+'/usercp/" target="_blank" onfocus="this.blur()">我的佳缘</a></li>');
_head_wr('<li><a href="http://'+mydomain+'/search/" target="_blank" onfocus="this.blur()">搜索会员</a></li>');
_head_wr('<li><a href="http://'+mydomain+'/newmember/" target="_blank" onfocus="this.blur()">最新会员</a></li>');
_head_wr('<li><a href="http://'+mydomain+'/online" target="_blank" onfocus="this.blur()">在线聊天</a></li>');
_head_wr('<li><a href="http://'+mydomain+'/party" target="_blank" onfocus="this.blur()">交友活动</a></li>');
_head_wr('<li><a href="http://'+mydomain+'/article" target="_blank" onfocus="this.blur()">情感博客</a></li>');
_head_wr('<li><a href="http://'+mydomain+'/story" target="_blank" onfocus="this.blur()">成功故事</a></li>');
_head_wr('<li><a href="http://'+mydomain+'/paper/" target="_blank" onfocus="this.blur()">爱情测试</a></li>');
_head_wr('<li><a href="http://'+mydomain+'/master/" target="_blank" onfocus="this.blur()">斑竹小龙女</a></li>');
_head_wr('<li class="end"><a href="http://'+mydomain+'/vip/" target="_blank" onfocus="this.blur()">婚姻猎头</a></li>');
_head_wr('</ul>');
_head_wr(loginstr);


//弹窗部分
var docEle = function()	{ return document.getElementById(arguments[0]) || false; }
function openNewDiv(_id)
{
    var m = "mask";
    if (docEle(m)) document.body.removeChild(docEle(m));
    //
    var newMask = document.createElement("div");
    newMask.id = m;
    newMask.style.position = "absolute";
    newMask.style.zIndex = "1";
    var _scrollWidth = Math.max(document.body.scrollWidth,document.documentElement.scrollWidth);
    var _scrollHeight = Math.max(document.body.scrollHeight,document.documentElement.scrollHeight);
    newMask.style.width = _scrollWidth + "px";
    newMask.style.height = _scrollHeight + "px";
    newMask.style.top = "0px";
    newMask.style.left = "0px";
    newMask.style.background = "#33393C";
    newMask.style.filter = "alpha(opacity=40)";
    newMask.style.opacity = "0.40";
    document.body.appendChild(newMask);
    //
    var newDiv = docEle(_id);
    newDiv.style.position = "absolute";
    newDiv.style.zIndex = "9999";
	newDiv.style.display = "";
    newDiv.style.top = (document.documentElement.scrollTop + document.documentElement.clientHeight/2 - newDiv.scrollHeight/2) + "px";
    newDiv.style.left = (document.documentElement.scrollLeft + document.documentElement.clientWidth/2 - newDiv.scrollWidth/2) + "px";
}
function closeFloatDiv(_id,type)
{
	document.getElementById(_id).style.display = "none";
	document.body.removeChild(docEle('mask'));
	if(type)
	{
		location.reload()
	}
}
