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://'+mydomain+'/'+cookie_uid+'">'+cookie_nickname+'</a>&nbsp;&nbsp;<a href="http://'+mydomain+'/login/logout2.php">退出登录</a></strong></span>';

}
else
{
	var pre_url=document.location.href;
	var loginstr='<div id="login"><span><strong><a href="http://'+mydomain+'/login/?pre_url=';
	loginstr=loginstr+pre_url;
	loginstr=loginstr+'">&gt;&gt;登录</a>&nbsp;&nbsp;<a href="http://'+mydomain+'/register">&gt;&gt;注册</a></strong></span></div>';
}


_head_wr('<style>');
_head_wr('@charset "utf-8";');
_head_wr('/* CSS Document */');
_head_wr('*{margin:0px; padding:0px}');
_head_wr('fieldset,img{border:0px;}');
_head_wr('ul,ol{list-style-type:none}');
_head_wr('html,body{ width: 100%; height: 100%; font-size: 12px; font-family:Verdana, Arial, Helvetica, sans-serif; }');
_head_wr('input,img{ vertical-align:middle; margin:0px; padding:0px;}');
_head_wr('.index-clear{clear:both}');
_head_wr('address, caption, cite, code, dfn, em, th, var, i{ font-style: normal;font-weight: normal;}');
_head_wr('div, td { word-wrap: break-word; word-break: break-all; }');

_head_wr('/* ==头尾== */');
_head_wr('.zt_head{width:980px;margin:0px auto;height:43px;overflow:hidden;}');
_head_wr('.zt_head_table{background:url(http://images1.jyimg.com/w4/profile_new/i/bodytop_bg.jpg) repeat-x left top; margin:0 auto; height:50px;width:100%;}');
_head_wr('.zt_head_table li{border:0; font-size:12px;float:left;margin-top:12px;padding-left:4px;padding-right:3px;*padding-left:3px;*padding-right:0;}');
_head_wr('.zt_head_table a{color:#666;text-decoration:none;}');
_head_wr('.zt_head_table a:hover{color:#666;;text-decoration:underline;}');
_head_wr('.zt_head ul{width:790px;float:left;list-style:none;height:43px;}');
_head_wr('.zt_head li {padding:0 5px; margin-top:16px; white-space:nowrap;}');
_head_wr('.zt_head li.first{border:none;margin-top:0px;}');
_head_wr('.zt_head li.end{border:none;}');
_head_wr('.zt_head span{margin:15px 0 0 0;float:right;max-width:208px;height:26px;overflow:hidden;color:#666;}');
_head_wr('</style>');

_head_wr('<div class="zt_head_table">');
_head_wr('<div class="zt_head">');
_head_wr('<ul>');
if(logo_url=='null'){
	_head_wr('<li class="first"><a href="http://'+mydomain+'/" target="_blank"><img src="http://images.jiayuan.com/w4/profile_new/i/logo.jpg" /></a></li>');
}else{
	_head_wr('<li class="first"><a href="http://'+mydomain+'/" target="_blank" onfocus="this.blur()"><img src="'+logo_url+'" /></a></li>');
}
if(js_site == 'w4'){
	_head_wr('<li><a href="http://'+mydomain+'/" target="_blank" onfocus="this.blur()">佳缘首页</a></li>');
	_head_wr('<li><a href="http://usercp.jiayuan.com/" target="_blank" onfocus="this.blur()">我的佳缘</a></li>');
	_head_wr('<li><a href="http://search.jiayuan.com/" target="_blank" onfocus="this.blur()">搜索会员</a></li>');
	_head_wr('<li><a href="http://search.jiayuan.com/new.php" target="_blank" onfocus="this.blur()">最新会员</a></li>');
	_head_wr('<li><a href="http://search.jiayuan.com/online.php" target="_blank" onfocus="this.blur()">在线聊天</a></li>');
	_head_wr('<li><a href="http://party.jiayuan.com/" target="_blank" onfocus="this.blur()">交友活动</a></li>');
	_head_wr('<li><a href="http://diary.jiayuan.com/" target="_blank" onfocus="this.blur()">情感博客</a></li>');
	_head_wr('<li><a href="http://xingfu.jiayuan.com/" 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>');
}else{
	_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+'/search/new.php" target="_blank" onfocus="this.blur()">最新会员</a></li>');
	_head_wr('<li><a href="http://'+mydomain+'/search/online.php" 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);
_head_wr('</div>');
_head_wr('</div>');
//弹窗部分
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()
	}
}

