function CreateHead(uid, uname)
{
	CreatePopMenu();
    var str = '<table width="100%" border="0" cellspacing="0" cellpadding="0" class="mb10">';
    str += '<tr><td align="center"><table cellspacing="0" cellpadding="0" border="0" class="outline">';
    str += '<tr><td width="150" height="58"><a href="http://www.yydd.net"><img src="http://image.yydd.net/global/images/logo.gif" border="0" width="150" height="52"></a></td>';
    str += '<td align="right"><table height="100%" border="0" cellspacing="0" cellpadding="0"><tr><td height="23">';
	str += '<div style="height:23px;float:right;background:url(http://image.yydd.net/global/images/top_bg_pass.gif);padding:5px 10px 0px 25px">';
	if (uid > 0)
	{
		str += '·<a href="#" onclick="GoLogout();return false;"><b>退出</b></a> ·<a href="#" class="high" onclick="OpenHompy(' + uid + ');return false;"><b>我的小窝</b></a>';
	}
    else
	{
		str += '·<a href="#" onclick="GoLogin();return false;"><b>登录</b></a> ·<a href="#" onclick="GoRegister();return false;"><b>注册</b></a>';
	}
	str += ' ·<a href="#" onclick="this.style.behavior=\'url(#default#homepage)\';this.setHomePage(\'http://www.yydd.net\');return false;">设为首页</a> ·帮助</td>';
    str += '</div></td></tr><tr><td valign="bottom"><table border="0" cellspacing="0" cellpadding="0"><tr>';
	str += '<td width="91" align="center"><a href="http://home.yydd.net"><img src="http://image.yydd.net/global/images/menu_home.gif" width="77" height="24" border="0"></a></td>';  
	str += '<td width="2" height="30"><img src="http://image.yydd.net/global/images/menu_sep.gif" width="2" height="30"></td>';
    str += '<td width="63" align="center"><a href="http://hompy.yydd.net"><img src="http://image.yydd.net/global/images/menu_hompy.gif" width="49" height="24" border="0"></a></td>'; 
    str += '<td width="2" height="30"><img src="http://image.yydd.net/global/images/menu_sep.gif" width="2" height="30"></td>';
    str += '<td width="63" align="center"><a href="http://bbs.yydd.net"><img src="http://image.yydd.net/global/images/menu_bbs.gif" width="49" height="24" border="0"></a></td>';  
    str += '<td width="2" height="30"><img src="http://image.yydd.net/global/images/menu_sep.gif" width="2" height="30"></td>';
    str += '<td width="63" align="center"><a href="http://friend.yydd.net"><img src="http://image.yydd.net/global/images/menu_friend_on.gif" width="49" height="24" border="0"></a></td>';
    str += '<td width="2" height="30"><img src="http://image.yydd.net/global/images/menu_sep.gif" width="2" height="30"></td>';
    str += '<td width="63" align="center"><a href="http://star.yydd.net"><img src="http://image.yydd.net/global/images/menu_star.gif" width="49" height="24" border="0"></a></td>';
    str += '<td width="2" height="30"><img src="http://image.yydd.net/global/images/menu_sep.gif" width="2" height="30"></td>';
    str += '<td width="63" align="center"><a href="http://music.yydd.net"><img src="http://image.yydd.net/global/images/menu_music.gif" width="49" height="24" border="0"></a></td>'; 
    str += '<td width="2" height="30"><img src="http://image.yydd.net/global/images/menu_sep.gif" width="2" height="30"></td>';     
    str += '<td width="77" align="center"><a href="http://mall.yydd.net"><img src="http://image.yydd.net/global/images/menu_mall.gif" width="63" height="24" border="0"></a></td>';
  	str += '</tr></table></td></tr></table></td></tr></table></td></tr>';
    str += '<tr><td height="23" bgcolor="#FE82A7" align="center"><table cellspacing="0" cellpadding="0" border="0" class="outline"><tr>';
    str += '<td style="padding:4px 0px 0px 30px;color:#FFFFFF;font-weight:bold">';
	var d = new Date();
	var h = d.getHours();
	if (h < 5)
		str += '凌晨好';
    else if (h>=5 && h<11)
		str += '早上好';
    else if (h>=11 && h<13)
        str += '中午好';
    else if (h>=13 && h<18)
        str += '下午好';
    else 
        str += '晚上好';
	str += '，' + uname + '</td>';
    str += '<td align="right" style="padding-top:1px;padding-right:24px"><table cellspacing="0" cellpadding="0" border="0"><tr><td><input type="text" id="userNickname" style="width:130px;border:1px solid #FA497E;font-size:12px" value="搜索用户昵称"></td>';
	str += '<td><img src="http://image.yydd.net/friend/images/user_bt_search.gif" class="btimg" onclick="SearchUser()"></td></tr></table></td></tr></table></td></tr>';
    str += '<tr><td height="2" bgcolor="#E9E9E9"></td></tr></table>';
    document.write(str);
}
function CreateTail()
{
    var str = '<table cellspacing="0" cellpadding="0" border="0" class="outline">';
    str += '<tr><td bgcolor="#d7d7d7" height="1"></td></tr>';
    str += '<tr><td height="8" align="center"></td></tr>';
    str += '<tr><td align="center" style="line-height:18px">关于我们 | 意见建议 | 联系我们 | 友情连接 | 广告服务 | 资费说明<br>AgNO3工作室版权所有 浙ICP备05042321号</td></tr>';
    str += '<tr><td height="20">&nbsp;</td></tr>';
    str += '</table>';
    document.write(str);
    CreateSiteCensus();
}
function Menu(id, pid, title, link, last)
{
    this.id = id;
    this.pid = pid;
    this.title = title;
    this.link = link;
    this.last = last;
}
function ShowMenu(m)
{
	  var obj = Obj('topmenu' + m);
    obj.style.display = obj.style.display == 'none' ? '' : 'none';	
}
function CreateMenu(m)
{
	  var sep = '<tr><td height="1" bgcolor="FEADC6"></td></tr><tr><td height="1" bgcolor="#FFFFFF"></td></tr>';
    var str = '<table width="100%" border="0" cellspacing="0" cellpadding="0">';
    for (var i=0; i<cMenus.length; i++)
    {
        if (cMenus[i].pid == 0)
        {
        	  var tmp = '';
        	  var tmp2 = '';
        	  var str2 = '';
        	  var active = false;
            for (var j=0; j<cMenus.length; j++)
            {
                if (cMenus[j].pid == cMenus[i].id)
                {
                    str2	+= '·<a href="' + cMenus[j].link + '"';
                    if (cMenus[j].id == m)
                    {
                    	  str2 += ' class="high"';
                        active = true;
                    }
                    str2 += '>' + cMenus[j].title + '</a><br>';
                }
            }
        	  str += '<tr><td height="26"><img src="http://image.yydd.net/friend/images/arr_title.gif" width="15" height="11" align="absmiddle">';
        	  str += '<a href="#" class="high" onclick="ShowMenu(' + cMenus[i].id + ');return false;"><b>' + cMenus[i].title + '</b></a></td></tr>';
        	  if (cMenus[i].last == null)
        	      tmp = sep;
        	  else
        	  	  tmp2 = sep;
        	  str += tmp;
        	  if (str2 != '')
        	  {
        	  	  str += '<tbody id="topMenu' + cMenus[i].id + '" style="display:' + (active?'':'none') + '">' + tmp2;
        	      str += '<tr><td bgcolor="#FFFFFF" style="padding:2px 2px 2px 5px;line-height:20px">' + str2 + '</td></tr>';
        	      str += '<tr><td height="1" bgcolor="FEADC6"></td></tr>';
        	      str += '</tbody>';
        	  }
        }
    }   
    str += '</table>';
    document.write(str);	
}
function ShowUserDetail(u)
{
    OpenHompy(u, 'profile', 0, 1);	
}
function ManagePhoto()
{
    OpenHompy(userid, 'photo');	
}


cMenus = new Array(
    new Menu(1, 0, '工具箱'), 
    new Menu(2, 0, '个人资料'), 
    new Menu(3, 0, '会员排行榜', '', true),
    new Menu(10, 1, '我的追求者', 'pursuer.php'),
    new Menu(11, 1, '追求名单', 'mylover.php'),
    new Menu(12, 1, '速配意中人', 'match.php'),
    new Menu(20, 2, '基本资料', 'join.php'),
    new Menu(25, 2, '详细资料', 'detail.php'),
    new Menu(21, 2, '联系方式', 'address.php'),
    new Menu(22, 2, '照片管理', 'javascript:ManagePhoto()'),
    new Menu(23, 2, '理想对象', 'myideal.php'),
    new Menu(30, 3, '大众情人榜', 'bestlover.php'),
    new Menu(31, 3, '最新上传照片女会员', 'new_picfemale.php'),
    new Menu(32, 3, '最新上传照片男会员', 'new_picmale.php')
);


document.oncontextmenu = function () 
{
    //return false;
};
document.onselectstart = function ()
{
    //return false;	
};