var centerWidth=document.documentElement.clientWidth/2;
	
var title=Array();
var link=Array();

function loadXML()
{
    if (window.XMLHttpRequest)
    {// code for IE7+, Firefox, Chrome, Opera, Safari
        xmlhttp=new XMLHttpRequest();
    }
    else
    {// code for IE6, IE5
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    xmlhttp.open("GET","asheader/xml.aspx",false);
    xmlhttp.send();
    xmlDoc=xmlhttp.responseXML;

    var root = xmlDoc.getElementsByTagName("news");
    var i;
    
    for(i=0;i<root.length;i++)
    {
        title[i]=root[i].getElementsByTagName("titlenews")[0].childNodes[0].nodeValue;
        link[i]=root[i].getElementsByTagName("linknews")[0].childNodes[0].nodeValue;
    }
}

function OverRPG()
{
	document.getElementById("tdRPG").style.backgroundImage="url(asheader/rpg/as_header_rpg_1.png)";
	document.getElementById("dvRPG").style.display="block";
	document.getElementById("dvRPG").style.left=centerWidth-510 + "px";
}

function OutRPG()
{
	document.getElementById("tdRPG").style.backgroundImage="none";
	document.getElementById("dvRPG").style.display="none";
}

function OverCasual()
{
	document.getElementById("tdCasual").style.backgroundImage="url(asheader/casual/as_header_casuasl_1.png)";
	document.getElementById("dvCasual").style.display="block";
	document.getElementById("dvCasual").style.left=centerWidth-500 + "px";
}

function OutCasual()
{
	document.getElementById("tdCasual").style.backgroundImage="none";
	document.getElementById("dvCasual").style.display="none";
}
function OverForum()
{
	document.getElementById("tdForum").style.backgroundImage="url(asheader/forum/as_header_forum_1.png)";
	document.getElementById("dvForum").style.display="block";
	document.getElementById("dvForum").style.left=centerWidth+170 + "px";
}

function OutForum()
{
	document.getElementById("tdForum").style.backgroundImage="none";
	document.getElementById("dvForum").style.display="none";
}

function ShowMsg()
{
	var pos=parseInt(Math.random()*5);
	document.getElementById("dvMsg").innerHTML= '<a href="' + link[pos] + '" target="_blank" class="title">' + title[pos] + '</a>';
	setTimeout("ShowMsg()",5000);
}

function WriteHtml()
{
    document.write('<table width="100%" border="0" cellspacing="0" cellpadding="0" style="font-family:Tahoma; font-size:11px; color:#122a62"> <tr> <td height="29" align="center" background="asheader/as_header_bg.gif"> <table width="1000" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="179" height="29" align="center" valign="middle"><img src="asheader/as_header_as.gif" width="179" height="29" /></td> <td id="tdRPG" width="82" align="center" valign="middle" style="background-repeat:no-repeat; background-position:center;font-family:Tahoma; font-size:11px; color:#122a62;cursor:pointer" onmouseover="OverRPG()" onmouseout="OutRPG()">Game RPG</td> <td width="1" align="center" valign="middle"><img src="asheader/as_header_break.gif" width="1" height="29" /></td> <td id="tdCasual" width="152" align="center" valign="middle" style="background-repeat:no-repeat; background-position:center;font-family:Tahoma; font-size:11px; color:#122a62; cursor:pointer" onmouseover="OverCasual()" onmouseout="OutCasual()">Game Casual &amp; Webgame</td> <td width="1" align="center" valign="middle"><img src="asheader/as_header_break.gif" width="1" height="29" /></td> <td width="335" align="center" valign="middle" style="color:#F00; font-weight:bold"><div id="dvMsg"></div></td> <td width="1" align="center" valign="middle"><img src="asheader/as_header_break.gif" width="1" height="29" /></td> <td id="tdForum" width="73" align="center" valign="middle" style="background-repeat:no-repeat; background-position:center;font-family:Tahoma; font-size:11px; color:#122a62; cursor:pointer" onmouseover="OverForum()" onmouseout="OutForum()">Diễn Đàn</td> <td width="1" align="center" valign="middle"><img src="asheader/as_header_break.gif" width="1" height="29" /></td> <td width="108" align="center" valign="middle" style="cursor:pointer"><a href="https://secure.playpark.vn/member/which/refill.asp" target="_blank"><img src="asheader/as_header_cash.gif" width="108" height="29" border="0" /></a></td> <td width="1" align="center" valign="middle"><img src="asheader/as_header_break.gif" width="1" height="29" /></td> <td width="66" align="center" valign="middle" style="cursor:pointer;font-family:Tahoma; font-size:11px; color:#122a62;"><a href="http://hotro.asiasoft.net.vn/" class="forum" target="_blank">Hỗ Trợ</a></td> </tr> </table> </td> </tr> </table> <div id="dvRPG" style="width:679px; position:absolute; display:none; top:25px; left:0px; z-index:999" onmouseover="OverRPG()" onmouseout="OutRPG()"> <table width="679" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="5" rowspan="2"><img src="asheader/rpg/as_header_rpg_left.png" width="5" height="113" /></td> <td width="669" height="108"> <table width="669" border="0" cellspacing="0" cellpadding="0" style="font-family:Tahoma; font-size:11px; color:#122a62"> <tr> <td height="22" colspan="11" style="background-image:url(asheader/rpg/as_header_rpg_2.png); font-family:Verdana; color:#FFF" align="center">Để có thể chơi được những game online RPG - Nhập vai dưới đây, bạn cần đăng ký tài khoản <b>@PassPort</b></td> </tr> <tr> <td width="169" height="65" align="center" valign="bottom" style="background-image:url(asheader/rpg/as_header_rpg_30.png)"><a href="https://asiasoftpassport.asiasoft.net.vn/member/register/register.aspx" target="_blank" class="register">Đăng ký</a> | <a href="https://asiasoftpassport.asiasoft.net.vn/member/Login.aspx" target="_blank" class="register">Đăng nhập</a><br> <a href="https://asiasoftpassport.asiasoft.net.vn/ap/FindPassword.asp" target="_blank" class="register">Quên mật khẩu</a></td> <td width="100"><a href="http://tt.playpark.vn/" target="_blank"><img src="asheader/rpg/as_header_rpg_32.png" width="100" height="65" border="0" /></a></td> <td width="100"><a href="http://db.playpark.vn/" target="_blank"><img src="asheader/rpg/as_header_rpg_33.png" width="100" height="65" border="0" /></a></td> <td width="100"><a href="http://ro.playpark.vn/" target="_blank"><img src="asheader/rpg/as_header_rpg_34.png" width="100" height="65" border="0" /></a></td> <td width="100"><a href="http://3k.playpark.vn/" target="_blank"><img src="asheader/rpg/as_header_rpg_35.png" width="100" height="65" border="0" /></a></td> <td width="100"><a href="http://hy.playpark.vn/" target="_blank"><img src="asheader/rpg/as_header_rpg_36.png" width="100" height="65" border="0" /></a></td> </tr> <tr> <td width="169" height="21" style="background-image:url(asheader/rpg/as_header_rpg_31.png)"></td> <td width="100" align="center" valign="middle" style="background-image:url(asheader/rpg/as_header_rpg_40.png)">Thiên tử</td> <td width="100" align="center" valign="middle" style="background-image:url(asheader/rpg/as_header_rpg_40.png)">Độc bá</td> <td width="100" align="center" valign="middle" style="background-image:url(asheader/rpg/as_header_rpg_40.png)">Ragnarok</td> <td width="100" align="center" valign="middle" style="background-image:url(asheader/rpg/as_header_rpg_40.png)">Tam quốc chí</td> <td width="100" align="center" valign="middle" style="background-image:url(asheader/rpg/as_header_rpg_40.png)">Cổ máy thời gian</td> </tr> </table> </td> <td width="5" rowspan="2"><img src="asheader/rpg/as_header_rpg_right.png" width="5" height="113" /></td> </tr> <tr> <td height="5"><img src="asheader/rpg/as_header_rpg_bottom.png" width="669" height="5" /></td> </tr> </table> </div> <div id="dvCasual" style="width:579px; position:absolute; display:none; top:25px; left:0px; z-index:999" onmouseover="OverCasual()" onmouseout="OutCasual()"> <table width="579" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="5" rowspan="2"><img src="asheader/casual/as_header_casuasl_left.png" width="5" height="113" /></td> <td width="569" height="108"> <table width="569" border="0" cellspacing="0" cellpadding="0" style="font-family:Tahoma; font-size:11px; color:#122a62"> <tr> <td colspan="5" height="22" style="background-image:url(asheader/casual/as_header_casuasl_2.png); font-family:Verdana; color:#FFF" align="center">Để có thể chơi được những game online Casual & Webgame, bạn cần đăng ký tài khoản <b>@PlayID</b></td> </tr> <tr> <td width="169" align="center" valign="bottom" style="background-image:url(asheader/casual/as_header_casuasl_30.png)"><a href="https://secure.playpark.vn/member/disclaimer.asp" target="_blank" class="register">Đăng ký</a> | <a href="http://member.playpark.vn/member/dangnhap.asp" target="_blank" class="register">Đăng nhập</a><br> <a href="https://secure.playpark.vn/member/forgetpwd/quenmatkhau.asp" target="_blank" class="register">Quên mật khẩu</a></td> <td width="100"><a href="http://gaw.playpark.vn/" target="_blank"><img src="asheader/casual/as_header_casuasl_32.png" width="100" height="65" border="0" /></a></td> <td width="100"><a href="http://lt.playpark.vn/" target="_blank"><img src="asheader/casual/as_header_casuasl_34.png" width="100" height="65" border="0" /></a></td> <td width="100"><a href="http://rm.playpark.vn/" target="_blank"><img src="asheader/casual/as_header_casuasl_35.png" width="100" height="65" border="0" /></a></td> <td width="100"><a href="http://dv.playpark.vn/" target="_blank"><img src="asheader/casual/as_header_casuasl_36.png" width="100" height="65" border="0" /></a></td> </tr> <tr> <td width="169" height="21" style="background-image:url(asheader/casual/as_header_casuasl_31.png)"></td> <td width="100" align="center" valign="middle" style="background-image:url(asheader/casual/as_header_casuasl_40.png)">Thế Giới Bá Vương</td> <td width="100" align="center" valign="middle" style="background-image:url(asheader/casual/as_header_casuasl_40.png)">Linh Thú</td> <td width="100" align="center" valign="middle" style="background-image:url(asheader/casual/as_header_casuasl_40.png)">Tỷ Phú</td> <td width="100" align="center" valign="middle" style="background-image:url(asheader/casual/as_header_casuasl_40.png)">Đế Vương</td> </tr> </table> </td> <td width="5" rowspan="2"><img src="asheader/casual/as_header_casuasl_right.png" width="5" height="113" /></td> </tr> <tr> <td height="5"><img src="asheader/casual/as_header_casuasl_bottom.png" width="569" height="5" /></td> </tr> </table> </div> <div id="dvForum" style="width:274px; position:absolute; display:none; top:25px; left:0px; z-index:999" onmouseover="OverForum()" onmouseout="OutForum()"> <table width="274" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="5" rowspan="2"><img src="asheader/forum/as_header_forum_left.png" width="5" height="127" /></td> <td width="264" height="122"> <table width="264" border="0" cellspacing="0" cellpadding="0" style="font-family:Tahoma; font-size:11px; color:#122a62; background-color:#FFF"> <tr> <td colspan="2" height="26" style="background-image:url(asheader/forum/as_header_forum_2.png)" align="center"><a href="http://forum.playpark.vn" class="register" target="_blank">Diễn đàn chính</a></td> </tr> <tr> <td width="132" valign="top" height="90"> <ul style="list-style-image:url(asheader/forum/as_header_forum_bullet.gif);margin-left:10px; padding:15px; line-height:15px; margin-top:-10px; margin-bottom:0px"> <li><a href="http://forum.playpark.vn/forumdisplay.php?f=961" target="_blank" class="forum">Thiên tử</a></li> <li><a href="http://forum.playpark.vn/forumdisplay.php?f=682" target="_blank" class="forum">Độc bá</a></li> <li><a href="http://forum.playpark.vn/forumdisplay.php?f=144" target="_blank" class="forum">Tam quốc chí</a></li> <li><a href="http://forum.playpark.vn/forumdisplay.php?f=495" target="_blank" class="forum">Ragnarok</a></li> <li><a href="http://forum.playpark.vn/forumdisplay.php?f=377" target="_blank" class="forum">Cổ máy thời gian</a></li> </ul> </td> <td width="132" valign="top"> <ul style="list-style-image:url(asheader/forum/as_header_forum_bullet.gif);margin-left:5px; padding:15px; line-height:15px; margin-top:-10px; margin-bottom:0px"> <li><a href="http://forum.playpark.vn/forumdisplay.php?f=823" target="_blank" class="forum">Thế Giới Bá Vương</a></li> <li><a href="http://forum.playpark.vn/forumdisplay.php?f=759" target="_blank" class="forum">Linh Thú</a></li> <li><a href="http://forum.playpark.vn/forumdisplay.php?f=286" target="_blank" class="forum">Tỷ Phú</a></li> <li><a href="http://forum.playpark.vn/forumdisplay.php?f=867" target="_blank" class="forum">Đế Vương</a></li> </ul> </td> </tr> </table> </td> <td width="5" rowspan="2"><img src="asheader/forum/as_header_forum_right.png" width="5" height="127" /></td> </tr> <tr> <td height="5"><img src="asheader/forum/as_header_forum_bottom.png" width="264" height="5" /></td> </tr> </table> </div>');
}
function hidedivtag() {
    document.getElementById("dvRPG").style.display = "none";
    document.getElementById("dvCasual").style.display = "none";
    document.getElementById("dvForum").style.display = "none";
}
loadXML();
WriteHtml();
ShowMsg();
