function CreateHead(uid, uname, avatar, account, credit, grade)
{
	CreatePopMenu();
	CreateWindows();
    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.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_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="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="#AC98D5" align="center"><table cellspacing="0" cellpadding="0" border="0" class="outline"><tr>';
    str += '<td width="205" 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>';
	if (uid > 0)
	{
		str += '<td style="position:relative;color:#FFFFFF;padding-top:4px">' + BuildAvatars(uid, avatar, 'avatarh') + 'Y币:' + account + ' 积分:' + credit + ' 等级:' + grade + '</td>';
		str += '<td align="right" style="padding-right:24px"><table cellspacing="0" cellpadding="0" border="0"><tr><td>' + SnsMenuBuild() + '</td>';
		str += '<td style="padding:1px 0px 0px 10px"><div class="floatl"><input type="text" id="userNickname" style="width:100px;border:1px solid #8064AD;font-size:12px;padding:1px 1px 0px 1px" value="查找好友..." onfocus="if (this.value==\'查找好友...\') this.value=\'\';"></div>';
		str += '<div class="floatl" style="padding-top:1px"><img src="http://image.yydd.net/music/images/user_bt_search.gif" width="20" height="18" class="btimg" onclick="SearchUser()"></div></td></tr></table></td>';
	}
    str += '</tr></table></td></tr><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 CreatePopHead(t)
{
	var str = '<tr><td height="30" background="http://image.yydd.net/music/images/pop_bg_top.gif">';
	str += '&nbsp;';
	str += '</td></tr>';
    document.write(str);		
}
function ShowMenu(m)
{
	var obj = Obj('menu' + m);
    obj.style.display = obj.style.display == 'none' ? '' : 'none';	
}