var sLoDID = ',', sDate = '';

function editlastrelated() {
    var elements = $(".ulBottomNewsThird").children();
    $(elements[elements.length - 1]).attr("class", "last");
}

function ShowVideoHD(){
    document.writeln('<div class="DefaultVideoHD">');
    document.writeln('  <div class="header"></div>');
    document.writeln('  <div class="header-text">&nbsp;&nbsp;Video&nbsp;<span><i>HD</i>&nbsp;Video</span></div>');
	//document.writeln('  <div class="header-title-video" id="VideoTitle">&nbsp;</div>');
    document.writeln('  <div class="body-media" id="MediaVideoHD"></div>');
    document.writeln('  <div class="list-media" id="MediaList"></div>');
    document.writeln('</div>');
    ShowVideo(0);
}

function ShowVideoHD1(){
    document.writeln('<div class="DefaultVideoHD">');
    document.writeln('  <div class="header"></div>');
    document.writeln('  <div class="header-text">&nbsp;&nbsp;Video&nbsp;<span><i>HD</i>&nbsp;Video</span></div>');
	document.writeln('  <div class="header-title-video" id="VideoTitle">&nbsp;</div>');
    document.writeln('  <div class="body-media" id="MediaVideoHD"></div>');
    document.writeln('  <div class="list-media" id="MediaList"></div>');
    document.writeln('</div>');
    ShowVideo(0);
}

function displayid(id, add) {
    if (typeof (add) == 'undefined') add = true;
    if (sLoDID.indexOf(id) <= 0) {
        if (add) sLoDID = sLoDID.concat(id).concat(',');
        return true;
    }
    else {
        return false;
    }
}

function ShowVideo(VideoId) {
    var vVideo='';
    var sLink = '';
    var iMaxItem = 5;
    sLink = '/ListFile/Video/tv0.xml';
    AjaxRequest.get(
		{
		  'url': sLink
		, 'onSuccess': function(req) {
		   vVideo = vVideo.concat('<ul>');
		    var iCount = 0;
			var count = 0;
		    if (VideoId == 0) {
		        for (var i = 0; i < req.responseXML.getElementsByTagName('I').length; i++) {
		            if (req.responseXML.getElementsByTagName('I')[i].getElementsByTagName('I').length > 0) {
		                with (req.responseXML.getElementsByTagName('I').item(i)) {
		                    if (iCount < iMaxItem) {
		                        if (i == 0) {
		                            ShowVideoObject(getNodeValue(getElementsByTagName('T')), getNodeValue(getElementsByTagName('P')), getNodeValue(getElementsByTagName('IP')));
									vVideo = vVideo.concat('<li class="active odd"><div class="div_video_in"><a class="LinkColor" title="'+ getNodeValue(getElementsByTagName('T')) +'" href="javascript:ShowVideo(');
									vVideo = vVideo.concat(getNodeValue(getElementsByTagName('I')));
									vVideo = vVideo.concat(');">');
									vVideo = vVideo.concat(getNodeValue(getElementsByTagName('T')));
									vVideo = vVideo.concat('</a></div></li>');										
								}
		                        else {
									//alert(i);
									if (count%2==1) {
			                            vVideo = vVideo.concat('<li class="even ' + count + '"><div class="div_video_in"><a class="LinkColor" title="'+ getNodeValue(getElementsByTagName('T')) +'" href="javascript:ShowVideo(');
			                            vVideo = vVideo.concat(getNodeValue(getElementsByTagName('I')));
			                            vVideo = vVideo.concat(');">');
			                            vVideo = vVideo.concat(getNodeValue(getElementsByTagName('T')));
			                            vVideo = vVideo.concat('</a></div></li>');									
									}
									else {
			                            vVideo = vVideo.concat('<li class="odd ' + count + '"><div class="div_video_in"><a class="LinkColor" title="'+ getNodeValue(getElementsByTagName('T')) +'" href="javascript:ShowVideo(');
			                            vVideo = vVideo.concat(getNodeValue(getElementsByTagName('I')));
			                            vVideo = vVideo.concat(');">');
			                            vVideo = vVideo.concat(getNodeValue(getElementsByTagName('T')));
			                            vVideo = vVideo.concat('</a></div></li>');									
									}
		                        }
		                        iCount++;
		                    }
		                    else {
		                        break;
		                    }
		                }
						count = count + 1;
		            }
		        }
		    }
		    else {
		        for (var i = 0; i < req.responseXML.getElementsByTagName('I').length; i++) {
		            if (req.responseXML.getElementsByTagName('I')[i].getElementsByTagName('I').length > 0) {
		                with (req.responseXML.getElementsByTagName('I').item(i)) {
		                    if (iCount < iMaxItem) {
		                        if (parseInt(getNodeValue(getElementsByTagName('I'))) == VideoId) {
		                            ShowVideoObject(getNodeValue(getElementsByTagName('T')), getNodeValue(getElementsByTagName('P')), getNodeValue(getElementsByTagName('IP')));
									if (count%2==0) {
										vVideo = vVideo.concat('<li class="active odd"><div class="div_video_in"><a class="LinkColor" title="'+ getNodeValue(getElementsByTagName('T')) +'" href="javascript:ShowVideo(');
										vVideo = vVideo.concat(getNodeValue(getElementsByTagName('I')));
										vVideo = vVideo.concat(');">');
										vVideo = vVideo.concat(getNodeValue(getElementsByTagName('T')));
										vVideo = vVideo.concat('</a></div></li>');										
									}
									else {
										vVideo = vVideo.concat('<li class="active even"><div class="div_video_in"><a class="LinkColor" title="'+ getNodeValue(getElementsByTagName('T')) +'" href="javascript:ShowVideo(');
										vVideo = vVideo.concat(getNodeValue(getElementsByTagName('I')));
										vVideo = vVideo.concat(');">');
										vVideo = vVideo.concat(getNodeValue(getElementsByTagName('T')));
										vVideo = vVideo.concat('</a></div></li>');										
									}
									
								}
		                        else {
									//alert(i);
									if (count%2==1) {
			                           vVideo = vVideo.concat('<li class="even ' + count + '"><div class="div_video_in"><a class="LinkColor" title="'+ getNodeValue(getElementsByTagName('T')) +'" href="javascript:ShowVideo(');
			                           vVideo = vVideo.concat(getNodeValue(getElementsByTagName('I')));
			                           vVideo = vVideo.concat(');">');
			                           vVideo = vVideo.concat(getNodeValue(getElementsByTagName('T')));
			                           vVideo = vVideo.concat('</a></li>');									
									}
									else {
			                           vVideo = vVideo.concat('<li class="odd ' + count + '"><div class="div_video_in"><a class="LinkColor" title="'+ getNodeValue(getElementsByTagName('T')) +'" href="javascript:ShowVideo(');
			                           vVideo = vVideo.concat(getNodeValue(getElementsByTagName('I')));
			                           vVideo = vVideo.concat(');">');
			                           vVideo = vVideo.concat(getNodeValue(getElementsByTagName('T')));
			                           vVideo = vVideo.concat('</a></li>');
									}
		                        }
		                        iCount++;
		                    }
		                    else {
		                        break;
		                    }
		                }
						count = count + 1;
		            }
		        }
		    }
		    vVideo = vVideo.concat('</ul>');
		    try {
		        gmobj('MediaList').innerHTML = vVideo;
		    }
		    catch (Error) {
		        return;
		    }
		}
		, 'onError': function(req) {
		    //alert(req.statusText);
		    }
		}
	)
}

function ShowVideo1(VideoId) {
    var vVideo='';
    var sLink = '';
    var iMaxItem = 5;
    sLink = '/ListFile/Video/tv0.xml';
    AjaxRequest.get(
		{
		  'url': sLink
		, 'onSuccess': function(req) {
		   vVideo = vVideo.concat('<ul>');
		    var iCount = 0;
		    if (VideoId == 0) {
		        for (var i = 0; i < req.responseXML.getElementsByTagName('I').length; i++) {
		            if (req.responseXML.getElementsByTagName('I')[i].getElementsByTagName('I').length > 0) {
		                with (req.responseXML.getElementsByTagName('I').item(i)) {
		                    if (iCount < iMaxItem) {
		                        if (i == 0) {
		                            ShowVideoObject(getNodeValue(getElementsByTagName('T')), getNodeValue(getElementsByTagName('P')), getNodeValue(getElementsByTagName('IP')));
								}
		                        else {
		                            vVideo = vVideo.concat('<li><a class="LinkColor" title="'+ getNodeValue(getElementsByTagName('T')) +'" href="javascript:ShowVideo(');
		                            vVideo = vVideo.concat(getNodeValue(getElementsByTagName('I')));
		                            vVideo = vVideo.concat(');">');
		                            vVideo = vVideo.concat(getNodeValue(getElementsByTagName('T')));
		                            vVideo = vVideo.concat('</a></li>');
		                        }
		                        iCount++;
		                    }
		                    else {
		                        break;
		                    }
		                }
		            }
		        }
		    }
		    else {
		        for (var i = 0; i < req.responseXML.getElementsByTagName('I').length; i++) {
		            if (req.responseXML.getElementsByTagName('I')[i].getElementsByTagName('I').length > 0) {
		                with (req.responseXML.getElementsByTagName('I').item(i)) {
		                    if (iCount < iMaxItem) {
		                        if (parseInt(getNodeValue(getElementsByTagName('I'))) == VideoId) {
		                            ShowVideoObject(getNodeValue(getElementsByTagName('T')), getNodeValue(getElementsByTagName('P')), getNodeValue(getElementsByTagName('IP')));
		                        }
		                        else {
		                           vVideo = vVideo.concat('<li><a class="LinkColor" title="'+ getNodeValue(getElementsByTagName('T')) +'" href="javascript:ShowVideo(');
		                           vVideo = vVideo.concat(getNodeValue(getElementsByTagName('I')));
		                           vVideo = vVideo.concat(');">');
		                           vVideo = vVideo.concat(getNodeValue(getElementsByTagName('T')));
		                           vVideo = vVideo.concat('</a></li>');
		                        }
		                        iCount++;
		                    }
		                    else {
		                        break;
		                    }
		                }
		            }
		        }
		    }
		    vVideo = vVideo.concat('</ul>');
		    try {
		        gmobj('MediaList').innerHTML = vVideo;
		    }
		    catch (Error) {
		        return;
		    }
		}
		, 'onError': function(req) {
		    //alert(req.statusText);
		    }
		}
	)
}

function ShowVideoObject(title, path, imagepath) {
    var so = new SWFObject('/Library/Player/mediaplayer.swf', 'MediaPlayer', '300', '240', '8');
    so.addParam('allowscriptaccess', 'always');
    so.addParam('allowfullscreen', 'true');
    so.addVariable('width', '300');
    so.addVariable('height', '240');
    so.addVariable('file', 'http://media.vnexpress.net/MediaStore/Video/' + path);
    if (imagepath == '') {
        so.addVariable('image', '/Images/video-gt.jpg');
    }
    else {
        so.addVariable('image', 'http://media.vnexpress.net/MediaStore/' + imagepath);
    }
    so.write('MediaVideoHD');
	//gmobj("VideoTitle").innerHTML = title;
}

function ShowVideoObject1(title, path, imagepath) {
    var so = new SWFObject('/Library/Player/mediaplayer.swf', 'MediaPlayer', '300', '240', '8');
    so.addParam('allowscriptaccess', 'always');
    so.addParam('allowfullscreen', 'true');
    so.addVariable('width', '300');
    so.addVariable('height', '240');
    so.addVariable('file', 'http://media.vnexpress.net/MediaStore/Video/' + path);
    if (imagepath == '') {
        so.addVariable('image', '/Images/video-gt.jpg');
    }
    else {
        so.addVariable('image', 'http://media.vnexpress.net/MediaStore/' + imagepath);
    }
    so.write('MediaVideoHD');
	gmobj("VideoTitle").innerHTML = title;
}

function ShowForum(){
    if (PAGE_FOLDER==1) {
        var sLink = '/ListFile/Forum/tf0.xml';
        var sForum = '';
        document.writeln('<div class="ForumOrVote" id="ForumInfo"></div>');
        AjaxRequest.get(
		    {
		      'url': sLink
		    , 'onSuccess': function(req) {
		        sForum = sForum.concat('<div class="ForumOrVote_header">Thông tin diễn đàn</div>');
		        sForum = sForum.concat('<div class="ForumOrVote_top"></div>');
		        sForum = sForum.concat('<div class="ForumOrVoteBgOut">');
		        sForum = sForum.concat('<div class="ForumOrVoteBgIn">');
		        sForum = sForum.concat('  <a href="http://fgt.vnexpress.net/" target="_blank" class="ForumHomeImg"><img src="/Images/ForumAndVote/anh.gif" /></a>');
		        for (var i = 0; i < req.responseXML.getElementsByTagName('I').length; i++) {
		            if (req.responseXML.getElementsByTagName('I')[i].getElementsByTagName('I').length > 0) {
	                    with (req.responseXML.getElementsByTagName('I').item(i)) {
	                        sForum = sForum.concat('<p class="ForumOrVote_new"><a href="'+ getNodeValue(getElementsByTagName('P')) +'" target="_blank">'+ getNodeValue(getElementsByTagName('T')) +'</a></p>');
	                    }
		            }        
		        }
		        sForum = sForum.concat('</div>');
		        sForum = sForum.concat('</div>');
		        sForum = sForum.concat('<div class="ForumOrVote_bottom"></div>');
                try {
		            gmobj('ForumInfo').innerHTML = sForum;
		        }
		        catch (Error) {
		            return;
		        }       	     	    
		    }
		    , 'onError': function(req) {
		        //alert(req.statusText);
		    }
		    }
	    )
    }
    else{
        document.writeln('<div class="InfoForum_page2" id="GameThuForumInfo" style="display:none">');
        document.writeln('  <p class="pInfoForum_page2">Thông tin diễn đàn</p>');
        document.writeln('  <div class="InfoForum_pageCT">');
        document.writeln('      <div class="IFpage2_Top"></div>');
        document.writeln('      <div class="IFpage2_contentOut">');
        document.writeln('          <div class="IFpage2_contentIn">');
        document.writeln('          <div class="IFpage2_logo"><a href="'+ GetForumInfo.vForum +'"><img alt="Forum" src="/Images/Level2/ThongTinForum/LogoGT_Forum.gif" /></a></div>');
        document.writeln('              <ul class="ulInfoForum_page2" id="GtForum"></u>');
        document.writeln('          </div>');
        document.writeln('      </div>');
        document.writeln('      <div class="IFpage2_Bottom"></div>');
        document.writeln('  </div>');
        document.writeln('</div>');
        var a;
        var sForumInfo='';
        try{
            if (threads.length<5){
			    document.getElementById("GameThuForumInfo").style.display = "none";
		    }else{
			    document.getElementById("GameThuForumInfo").style.display = "";
		    }
            if (threads.length>5){
		        a=5;
	        }else{
		        a = threads.length;
	        }
	        for(var i=0; i<a; i++){
		        var vID = threads[i].threadid;
		        var vTitle = threads[i].title;
		        var vDate = threads[i].threaddate
		        vDate = vDate.substring(0,5)
		        vDate = vDate.replace("-","/")
		        sForumInfo=sForumInfo.concat('<li><a href="http://fgt.vnexpress.net/showthread.php?t='+ vID +'&goto=newpost" target="_blank">'+ vTitle +'</a> '+ vDate +'</li>');
	        }
	        gmobj('GtForum').innerHTML = sForumInfo;
        }
        catch (Error) {
            return;
        }
    }
}

function GetForumInfo()
{
    var vJsUrl='';
    var vForum='';
    switch(PAGE_FOLDER)
    {
        case 2://Diem tin
            vJsUrl='http://fgt.vnexpress.net/external.php?type=js&forumids=67&lastpost=true';
            vForum='http://fgt.vnexpress.net/forumdisplay.php?f=67';
            break;
        case 3://Sap choi
            vJsUrl='http://fgt.vnexpress.net/external.php?type=js&forumids=84,88.86,230,231,233,89,336,387,332,81&lastpost=true';
            vForum='http://fgt.vnexpress.net/forumdisplay.php?f=96';
            break;
        case 4://Dang choi
            vJsUrl='http://fgt.vnexpress.net/external.php?type=js&forumids=71,72,62,339,144,275,393,263,401,193,158,322,325,73,341,169&lastpost=true';
            vForum='http://fgt.vnexpress.net/forumdisplay.php?f=63';
            break;
        case 5://Alo game
            vJsUrl='http://fgt.vnexpress.net/external.php?type=js&forumids=387&lastpost=true';
            vForum='http://fgt.vnexpress.net/forumdisplay.php?f=387';
            break;
        case 10://Chuyen lang game
            vJsUrl='http://fgt.vnexpress.net/external.php?type=js&forumids=71&lastpost=true';
            vForum='http://fgt.vnexpress.net/forumdisplay.php?f=71';
            break;
        case 11://Flash Game
            vJsUrl='http://fgt.vnexpress.net/external.php?type=js&forumids=336&lastpost=true';
            vForum='http://fgt.vnexpress.net/forumdisplay.php?f=336';
            break;
        case 13://Cong nghe
            vJsUrl='http://fgt.vnexpress.net/external.php?type=js&forumids=95,308,234,396,399&lastpost=true';
            vForum='http://fgt.vnexpress.net/forumdisplay.php?f=75';
            break;
        case 14://Trac nghiem
            vJsUrl='http://fgt.vnexpress.net/external.php?type=js&forumids=97&lastpost=true';
            vForum='http://fgt.vnexpress.net/forumdisplay.php?f=97';
            break;
        case 17://Tu lieu
            vJsUrl='http://fgt.vnexpress.net/external.php?type=js&forumids=66&lastpost=true';
            vForum='http://fgt.vnexpress.net/forumdisplay.php?f=66';
            break;
        case 18://Hinh anh
            vJsUrl='http://fgt.vnexpress.net/external.php?type=js&forumids=101,373,400,333,361,102,334,335,83&lastpost=true';
            vForum='http://fgt.vnexpress.nett/forumdisplay.php?f=99';
            break;                                 
    }
    GetForumInfo.vForum=vForum;
    document.write('<scr' + 'ipt type="text/javascript" src="' + vJsUrl + '"><\/scr' + 'ipt>');
}

function ShowDownload(){
    document.writeln('<div class="rightBox fl">');
    document.writeln('  <div class="headerRightBox">Download</div>');
    document.writeln('  <div class="bodyRightBox">');
    document.writeln('      <div class="downloadRightBox">');
    document.writeln('          <ul id="Download"></ul>');
//    if (PAGE_FOLDER!=1)
//    {
//    document.writeln('      </div>');
//    document.writeln('  </div>');
//    document.writeln('</div>');
//    }
    
    var sLink = '/ListFile/Download/td0.xml';
    var sDownload = '';
    
    AjaxRequest.get(
	    {
	      'url': sLink
	    , 'onSuccess': function(req) {
	        for (var i = 0; i < req.responseXML.getElementsByTagName('I').length; i++) {
	            if (req.responseXML.getElementsByTagName('I')[i].getElementsByTagName('I').length > 0) {
                    with (req.responseXML.getElementsByTagName('I').item(i)) {
                        sDownload = sDownload.concat('<li><div><a class="RightColor" href="'+ getNodeValue(getElementsByTagName('P')) +'" title="'+ getNodeValue(getElementsByTagName('T')) +'" target="_blank">'+ getNodeValue(getElementsByTagName('T')) +'</a></div></li>');
                    }
	            }        
	        }
	        
            try {
	            gmobj('Download').innerHTML = sDownload;
	        }
	        catch (Error) {
	            return;
	        }       	     	    
	    }
	    , 'onError': function(req) {
	        //alert(req.statusText);
	    }
	    }
    )
    document.writeln('      </div>');
    document.writeln('  </div>');
    document.writeln('</div>');
}



//DisplayHotNews

function DisplayHotNews(template, id, sListItems, divID) {
    var sId, sName, sPath, sTime;
    var arItem = new Array();
    var sLink = "";
    var sHTML;
    var iMaxItem;
    iMaxItem = sListItems;
	//alert(sLink);
	//divID="div" + id + "_" + template;
	
	 switch (parseInt(template)) {
	 
        case 0: sLink ="/ListFile/HotNews/00/" + id + ".xml";
            break;
        case 1: sLink ="/ListFile/TopView/00/" + id + ".xml";
            break;
        case 2: sLink ="/ListFile/TopComment/00/" + id + ".xml";
            break;
        case 3: sLink ="/ListFile/TopPoint/00/" + id + ".xml";
            break;
	 }
	    
	document.writeln('<div id="div'+ id +'_' +  template +'"></div>');
	
    AjaxRequest.get(
		{
		    'url': sLink
	    , 'onSuccess': function(req) {
	        if (req.responseXML.getElementsByTagName('F').length > 0) {
	            with (req.responseXML.getElementsByTagName('F').item(0)) {
	                sId = getNodeValue(getElementsByTagName('I'));
	                sName = getNodeValue(getElementsByTagName('N'));
	                sPath = getNodeValue(getElementsByTagName('P'));
	                sTime = getNodeValue(getElementsByTagName('T'));
	            }
	        }

	        var iCount = 0;
	        for (var i = 0; i < req.responseXML.getElementsByTagName('I').length; i++) {
	            with (req.responseXML.getElementsByTagName('I').item(i)) {
	                if (iCount < iMaxItem) {
	                    var sTemp = getNodeValue(getElementsByTagName('I'));
						var isDuplicate = displayid(sTemp);
						
						//if (sLink.toString().substring(0,20) == "/ListFile/HotNews/00/" || sLink.toString().substring(0,21) == "/ListFile/TopView/00/" || sLink.toString().substring(0,21) == "/ListFile/TopPoint/00/" || sLink.toString().substring(0,21) == "/ListFile/TopComment/00/") {
						if (sLink.toString().substring(0,20) == "/ListFile/HotNews/00" || sLink.toString().substring(0,21) == "/ListFile/TopView/00" || sLink.toString().substring(0,22) == "/ListFile/TopPoint/00" || sLink.toString().substring(0,24) == "/ListFile/TopComment/00") {
							isDuplicate = true;
						}
						
						if (sTemp != '' && isDuplicate) {
	                        arItem[iCount] = new Array(19);
	                        arItem[iCount][0] = getNodeValue(getElementsByTagName('I'));
	                        arItem[iCount][1] = getNodeValue(getElementsByTagName('P')) + '/';
	                        arItem[iCount][2] = getNodeValue(getElementsByTagName('T'));
	                        arItem[iCount][3] = getNodeValue(getElementsByTagName('L'));
	                        arItem[iCount][4] = getNodeValue(getElementsByTagName('TI'));
	                        arItem[iCount][5] = getNodeValue(getElementsByTagName('TW'));
	                        arItem[iCount][6] = getNodeValue(getElementsByTagName('TH'));
	                        arItem[iCount][7] = getNodeValue(getElementsByTagName('SI'));
	                        arItem[iCount][8] = getNodeValue(getElementsByTagName('SW'));
	                        arItem[iCount][9] = getNodeValue(getElementsByTagName('SH'));
	                        arItem[iCount][10] = getNodeValue(getElementsByTagName('LI'));
	                        arItem[iCount][11] = getNodeValue(getElementsByTagName('LW'));
	                        arItem[iCount][12] = getNodeValue(getElementsByTagName('LH'));
	                        arItem[iCount][13] = getNodeValue(getElementsByTagName('HV'));
	                        arItem[iCount][14] = getNodeValue(getElementsByTagName('HI'));
	                        arItem[iCount][15] = getNodeValue(getElementsByTagName('HS'));
	                        arItem[iCount][16] = getNodeValue(getElementsByTagName('OI'));
	                        arItem[iCount][17] = getNodeValue(getElementsByTagName('OW'));
	                        arItem[iCount][18] = getNodeValue(getElementsByTagName('OH'));
	                        iCount++;
	                    }
	                }
	            }
	        }
	        WriteTemplateHotNews(template, arItem, sName, sPath, sTime, divID);
	    }
	    , 'onError': function(req) {
	    }
		}
	)
}

function getimages(Id, FileName) {
    var number = new Number(Id);
    var hexId = Hexa(number);
    return '/Files/Subject/'.concat(hexId.substring(0, 2)).concat('/').concat(hexId.substring(2, 4)).concat('/').concat(hexId.substring(4, 6)).concat('/').concat(hexId.substring(6, 8)).concat('/').concat(FileName);
}

function WriteTemplateHotNews(template, ItemArray, CatTitle, CatLink, sTime, divID) {
    var strWrite = "";
    var strTitle="";
    switch (parseInt(template)) {
        case 0: strTitle="Tiêu điểm";
            break;
        case 1: strTitle="Bài viết được xem nhiều nhất";
            break;
        case 2: strTitle="Bài có nhiều comment nhất";
            break;
        case 3: strTitle="Game được quan tâm nhất";
            break;
    }
     try 
     {
            var i = 1;
            strWrite +='<div class="rightBox fl">';
            strWrite +='    <div class="headerRightBox">' + strTitle + '</div>';

            strWrite +='    <div class="bodyRightBox">';
	        strWrite +='        <div class="leftImg">';
		    strWrite +='            <a  href="' + ItemArray[0][1] + '" title="' + ItemArray[0][2] + '"><img alt="' + ItemArray[0][2] + '" src="' + getimages(ItemArray[0][0], ItemArray[0][7]) +  '.thumb81x60.ns.jpg" /></a>';
	        strWrite +='        </div>';
	        //strWrite +='        <div class="rightCnt">';
		    strWrite +='            <div class="LinkTitleGamthuRight"><a class="RightColor aRightCnt" href="' + ItemArray[0][1] + '" title="' + ItemArray[0][2] + '">' + ItemArray[0][2] + '</a></div>';

		    strWrite +='            <div class="RightColor TextGameThuRight" >' + ItemArray[0][3] + '</div>';

	        //strWrite +='        </div>';
            strWrite +='    </div>';
            strWrite +='    <div class="bottomRightBox">';
            
	        strWrite +='        <ul>';
	        while (i < ItemArray.length) 
	        {
		        strWrite +='            <li><div><a class="RightColor" href="' + ItemArray[i][1] + '" title="' + ItemArray[i][2] + '">' + ItemArray[i][2] + '</a></div></li>';
		        i++;
		    }
	        strWrite +='        </ul>';

            strWrite +='    </div>';
            strWrite +='</div>	';	
            }
                  
     catch (err) { return ""; }
    document.getElementById(divID).innerHTML += strWrite;
}


//DisplayHotNews

//DisplayListItem
function DisplayListItems(template, id, sListItems, divID) {
    var sId, sName, sPath, sTime;
    var arItem = new Array();
    var sLink = "";
    var sHTML;
    var iMaxItem;
    iMaxItem = sListItems;


    sLink = sLink ="/ListFile/subject/00/" + id + ".xml";
	    
	document.writeln('<div id="DisplayListItem'+ id +'_' +  template +'" style="float:left"></div>');
	
    AjaxRequest.get(
		{
		    'url': sLink
	    , 'onSuccess': function(req) {
	        if (req.responseXML.getElementsByTagName('F').length > 0) {
	            with (req.responseXML.getElementsByTagName('F').item(0)) {
	                sId = getNodeValue(getElementsByTagName('I'));
	                sName = getNodeValue(getElementsByTagName('N'));
	                sPath = getNodeValue(getElementsByTagName('P'));
	                sTime = getNodeValue(getElementsByTagName('T'));
	            }
	        }

	        var iCount = 0;
	        for (var i = 0; i < req.responseXML.getElementsByTagName('I').length; i++) {
	            with (req.responseXML.getElementsByTagName('I').item(i)) {
	                if (iCount < iMaxItem) {
	                    var sTemp = getNodeValue(getElementsByTagName('I'));
						var isDuplicate = displayid(sTemp);
						
						if (sLink.toString().substring(0,20) == "/ListFile/HotNews/00" || sLink.toString().substring(0,21) == "/ListFile/TopView/00" || sLink.toString().substring(0,22) == "/ListFile/TopPoint/00" || sLink.toString().substring(0,24) == "/ListFile/TopComment/00") {
							isDuplicate = true;
						}
						
						if (sTemp != '' && isDuplicate) {
	                        arItem[iCount] = new Array(19);
	                        arItem[iCount][0] = getNodeValue(getElementsByTagName('I'));
	                        arItem[iCount][1] = getNodeValue(getElementsByTagName('P')) + '/';
	                        arItem[iCount][2] = getNodeValue(getElementsByTagName('T'));
	                        arItem[iCount][3] = getNodeValue(getElementsByTagName('L'));
	                        arItem[iCount][4] = getNodeValue(getElementsByTagName('TI'));
	                        arItem[iCount][5] = getNodeValue(getElementsByTagName('TW'));
	                        arItem[iCount][6] = getNodeValue(getElementsByTagName('TH'));
	                        arItem[iCount][7] = getNodeValue(getElementsByTagName('SI'));
	                        arItem[iCount][8] = getNodeValue(getElementsByTagName('SW'));
	                        arItem[iCount][9] = getNodeValue(getElementsByTagName('SH'));
	                        arItem[iCount][10] = getNodeValue(getElementsByTagName('LI'));
	                        arItem[iCount][11] = getNodeValue(getElementsByTagName('LW'));
	                        arItem[iCount][12] = getNodeValue(getElementsByTagName('LH'));
	                        arItem[iCount][13] = getNodeValue(getElementsByTagName('HV'));
	                        arItem[iCount][14] = getNodeValue(getElementsByTagName('HI'));
	                        arItem[iCount][15] = getNodeValue(getElementsByTagName('HS'));
	                        arItem[iCount][16] = getNodeValue(getElementsByTagName('OI'));
	                        arItem[iCount][17] = getNodeValue(getElementsByTagName('OW'));
	                        arItem[iCount][18] = getNodeValue(getElementsByTagName('OH'));
	                        iCount++;
	                    }
	                }
	            }
	        }
	        WriteTemplateItem(template, arItem, sName, sPath, sTime, divID,id);
	    }
	    , 'onError': function(req) {
	    }
		}
	)
}


function WriteTemplateItem(template, ItemArray, CatTitle, CatLink, sTime, divID,id) {
    var strWrite = "";
    var strTitle="";
     try 
     {
     if (parseInt(id)==21)
     {
        var i = 1;
            strWrite +='<div class="rightBox fl">';
            strWrite +='	<div class="headerRightBox"><a href="'+ CatLink +'"> '+ CatTitle +' </a></div>';

            strWrite +='	<div class="bodyRightBox">	';	
            strWrite +='		<div class="leftImg2">';
            strWrite +='			<a onfocus="this.blur();" hidefocus="" class="LinkColor"  href="' + ItemArray[0][1] + '" title="' + ItemArray[0][2] + '"><img src="' + getimages(ItemArray[0][0], ItemArray[0][10]) +  '.thumb120x78.ns.jpg"  alt="'+ ItemArray[0][2] +'" /></a><br />';
            strWrite +='			<a class="LinkColor"  href="' + ItemArray[0][1] + '" title="' + ItemArray[0][2] + '">'+ ItemArray[0][2] +'</a>';
            strWrite +='		</div>';

            strWrite +='		<div class="rightCnt2">';
            strWrite +='			<ul>';
            //strWrite +='				<li><div><a class="RightColor" href="/GT/Ban-doc-viet/2009/05/3B9AFE8C/" title="Final Fantasy XIII - Cuộc thánh chiến">Final Fantasy XIII - Cuộc thánh chiến</a></div></li>';
            while (i < ItemArray.length) 
	        {
		        strWrite +='            <li><div><a class="RightColor" href="' + ItemArray[i][1] + '" title="' + ItemArray[i][2] + '">' + ItemArray[i][2] + '</a></div></li>';
		        i++;
		    }
            

            strWrite +='			</ul>';
            strWrite +='		</div>';
            strWrite +='	</div>';
            strWrite +='</div>';




     }
     else
     {
            var i = 1;
            strWrite +='<div class="NewsSubPage">';

			strWrite +='		<div class="NewsSubPage_Header LinkColorTitle"><a href="'+ CatLink +'"> '+ CatTitle +' </a></div>';
			strWrite +='		<div class="GameVR_Content">';
			strWrite +='			<div class="GameVR_Content_up">';
			strWrite +='				<div class="GameVR_ContentImg">';
			strWrite +='					<a href="' + ItemArray[0][1] + '" title="' + ItemArray[0][2] + '"><img alt="' + ItemArray[0][2] + '" src="' + getimages(ItemArray[0][0], ItemArray[0][10]) +  '.thumb120x78.ns.jpg" /></a>';
			strWrite +='				</div>';
			//strWrite +='				<div class="GameVR_ContentRight">';
			strWrite +='					<a class="aGameVR_ContentRight" href="' + ItemArray[0][1] + '" title="' + ItemArray[0][2] + '">' + ItemArray[0][2] + '</a>';

			strWrite +='					<p class="pGameVR_ContentRight">'+ ItemArray[0][3]  +'</p>';
			//strWrite +='				</div>';
			strWrite +='				<ul class="ulGameVR_ContentRight">';
			
			while (i < ItemArray.length) 
	        {
		        strWrite +='            <li><a href="' + ItemArray[i][1] + '" title="' + ItemArray[i][2] + '">' + ItemArray[i][2] + '</a></li>';
		        i++;
		    }
		
			strWrite +='				</ul>';
			strWrite +='			</div>';

			strWrite +='		</div>';
			strWrite +='	</div>	';
            }
        }
                  
     catch (err) { return ""; }
    document.getElementById(divID).innerHTML += strWrite;
}

//DisplayListItem

/*Write Social JS*/
function writeSociable(vLink, vTitle, vDescription, vId, SubjectID) {
	vTitle = vTitle.replace("'", "");
	vDescription = vDescription.replace("'", "");
	var strOut = "";
	strOut += "<div class=\"sociable\">";
	strOut += "<ul>";
	strOut += "<li class=\"sociablefirst\"><a title=\"Facebook\" onfocus=\"this.blur();\" href=\"/Service/Share/?sjid=" + SubjectID + "&sid=1&myurl=" + Url.encode("http://www.facebook.com/share.php%3fu=" + vLink + "") + "\" target=\"_blank\" id=\"facebook\" rel=\"nofollow\"><img class=\"sociable-hovers\" alt=\"Facebook\" title=\"Facebook\" src=\"/images/facebook.gif\"  /></a></li>";
	strOut += "<li><a title=\"Google Bookmarks\" onfocus=\"this.blur();\" href=\"/Service/Share/?sjid=" + SubjectID + "&sid=2&myurl=" + Url.encode("http://www.google.com/bookmarks/mark%3fop=edit%26amp;bkmk=" + vLink + "&amp;title=" + vTitle + "&amp;annotation=" + vDescription + "") + "\" target=\"_blank\" id=\"google\" rel=\"nofollow\"><img class=\"sociable-hovers\" alt=\"Google Bookmarks\" title=\"Google Bookmarks\" src=\"/images/google.gif\"/></a></li>";
	strOut += "<li class=\"sociablelast\" class=\"sociablelast\"><a onfocus=\"this.blur();\" title=\"Twitter\" href=\"/Service/Share/?sjid=" + SubjectID + "&sid=3&myurl=" + Url.encode("http://twitter.com/home%3fstatus=" + vTitle + " - " + vLink + "") + "\" target=\"_blank\" id=\"twitter\" rel=\"nofollow\"><img class=\"sociable-hovers\" alt=\"Twitter\" title=\"Twitter\" src=\"/images/twitter.gif\"/></a></li>";
	strOut += "</ul>";
	strOut += "</div>";
	gmobj(vId).innerHTML = strOut + gmobj(vId).innerHTML;
}

/**
*
*  URL encode / decode
*  http://www.webtoolkit.info/
*
**/

var Url = {

    // public method for url encoding
    encode: function(string) {
        return escape(this._utf8_encode(string));
    },

    // public method for url decoding
    decode: function(string) {
        return this._utf8_decode(unescape(string));
    },

    // private method for UTF-8 encoding
    _utf8_encode: function(string) {
        string = string.replace(/\r\n/g, "\n");
        var utftext = "";

        for (var n = 0; n < string.length; n++) {

            var c = string.charCodeAt(n);

            if (c < 128) {
                utftext += String.fromCharCode(c);
            }
            else if ((c > 127) && (c < 2048)) {
                utftext += String.fromCharCode((c >> 6) | 192);
                utftext += String.fromCharCode((c & 63) | 128);
            }
            else {
                utftext += String.fromCharCode((c >> 12) | 224);
                utftext += String.fromCharCode(((c >> 6) & 63) | 128);
                utftext += String.fromCharCode((c & 63) | 128);
            }

        }

        return utftext;
    },

    // private method for UTF-8 decoding
    _utf8_decode: function(utftext) {
        var string = "";
        var i = 0;
        var c = c1 = c2 = 0;

        while (i < utftext.length) {

            c = utftext.charCodeAt(i);

            if (c < 128) {
                string += String.fromCharCode(c);
                i++;
            }
            else if ((c > 191) && (c < 224)) {
                c2 = utftext.charCodeAt(i + 1);
                string += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
                i += 2;
            }
            else {
                c2 = utftext.charCodeAt(i + 1);
                c3 = utftext.charCodeAt(i + 2);
                string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
                i += 3;
            }

        }

        return string;
    }

}// ===================================================================
// Author: Matt Kruse <matt@ajaxtoolbox.com>
// WWW: http://www.AjaxToolbox.com/
//
// NOTICE: You may use this code for any purpose, commercial or
// private, without any further permission from the author. You may
// remove this notice from your final code if you wish, however it is
// appreciated by the author if at least my web site address is kept.
//
// You may *NOT* re-distribute this code in any way except through its
// use. That means, you can include it in your product, or your web
// site, or any other form where the code is actually being used. You
// may not put the plain javascript up on your site for download or
// include it in your javascript libraries for download. 
// If you wish to share this code with others, please just point them
// to the URL instead.
// Please DO NOT link directly to my .js files from your site. Copy
// the files to your server and use them there. Thank you.
// ===================================================================

function AjaxRequest(){var req =new Object();
req.timeout =null;
req.generateUniqueUrl =true;
req.url =window.location.href;
req.method ="GET";
req.async =true;
req.username =null;
req.password =null;
req.parameters =new Object();
req.requestIndex =AjaxRequest.numAjaxRequests++;
req.responseReceived =false;
req.groupName =null;
req.queryString ="";
req.responseText =null;
req.responseXML =null;
req.status =null;
req.statusText =null;
req.aborted =false;
req.xmlHttpRequest =null;
req.onTimeout=null;
req.onLoading=null;
req.onLoaded=null;
req.onInteractive=null;
req.onComplete=null;
req.onSuccess=null;
req.onError=null;
req.onGroupBegin=null;
req.onGroupEnd=null;
req.xmlHttpRequest =AjaxRequest.getXmlHttpRequest();
if(req.xmlHttpRequest==null){return null;}req.xmlHttpRequest.onreadystatechange =
function(){if(req==null || req.xmlHttpRequest==null){return;}if(req.xmlHttpRequest.readyState==1){req.onLoadingInternal(req);}if(req.xmlHttpRequest.readyState==2){req.onLoadedInternal(req);}if(req.xmlHttpRequest.readyState==3){req.onInteractiveInternal(req);}if(req.xmlHttpRequest.readyState==4){req.onCompleteInternal(req);}};
req.onLoadingInternalHandled=false;
req.onLoadedInternalHandled=false;
req.onInteractiveInternalHandled=false;
req.onCompleteInternalHandled=false;
req.onLoadingInternal=
function(){if(req.onLoadingInternalHandled){return;}AjaxRequest.numActiveAjaxRequests++;
if(AjaxRequest.numActiveAjaxRequests==1 && typeof(window['AjaxRequestBegin'])=="function"){AjaxRequestBegin();}if(req.groupName!=null){if(typeof(AjaxRequest.numActiveAjaxGroupRequests[req.groupName])=="undefined"){AjaxRequest.numActiveAjaxGroupRequests[req.groupName] =0;}AjaxRequest.numActiveAjaxGroupRequests[req.groupName]++;
if(AjaxRequest.numActiveAjaxGroupRequests[req.groupName]==1 && typeof(req.onGroupBegin)=="function"){req.onGroupBegin(req.groupName);}}if(typeof(req.onLoading)=="function"){req.onLoading(req);}req.onLoadingInternalHandled=true;};
req.onLoadedInternal=
function(){if(req.onLoadedInternalHandled){return;}if(typeof(req.onLoaded)=="function"){req.onLoaded(req);}req.onLoadedInternalHandled=true;};
req.onInteractiveInternal=
function(){if(req.onInteractiveInternalHandled){return;}if(typeof(req.onInteractive)=="function"){req.onInteractive(req);}req.onInteractiveInternalHandled=true;};
req.onCompleteInternal=
function(){if(req.onCompleteInternalHandled || req.aborted){return;}req.onCompleteInternalHandled=true;
AjaxRequest.numActiveAjaxRequests--;
if(AjaxRequest.numActiveAjaxRequests==0 && typeof(window['AjaxRequestEnd'])=="function"){AjaxRequestEnd(req.groupName);}if(req.groupName!=null){AjaxRequest.numActiveAjaxGroupRequests[req.groupName]--;
if(AjaxRequest.numActiveAjaxGroupRequests[req.groupName]==0 && typeof(req.onGroupEnd)=="function"){req.onGroupEnd(req.groupName);}}req.responseReceived =true;
req.status =req.xmlHttpRequest.status;
req.statusText =req.xmlHttpRequest.statusText;
req.responseText =req.xmlHttpRequest.responseText;
req.responseXML =req.xmlHttpRequest.responseXML;
if(typeof(req.onComplete)=="function"){req.onComplete(req);}if(req.xmlHttpRequest.status==200 && typeof(req.onSuccess)=="function"){req.onSuccess(req);}else if(typeof(req.onError)=="function"){req.onError(req);}delete req.xmlHttpRequest['onreadystatechange'];
req.xmlHttpRequest =null;};
req.onTimeoutInternal=
function(){if(req!=null && req.xmlHttpRequest!=null && !req.onCompleteInternalHandled){req.aborted =true;
req.xmlHttpRequest.abort();
AjaxRequest.numActiveAjaxRequests--;
if(AjaxRequest.numActiveAjaxRequests==0 && typeof(window['AjaxRequestEnd'])=="function"){AjaxRequestEnd(req.groupName);}if(req.groupName!=null){AjaxRequest.numActiveAjaxGroupRequests[req.groupName]--;
if(AjaxRequest.numActiveAjaxGroupRequests[req.groupName]==0 && typeof(req.onGroupEnd)=="function"){req.onGroupEnd(req.groupName);}}if(typeof(req.onTimeout)=="function"){req.onTimeout(req);}delete req.xmlHttpRequest['onreadystatechange'];
req.xmlHttpRequest =null;}};
req.process =
function(){if(req.xmlHttpRequest!=null){if(req.generateUniqueUrl && req.method=="GET"){req.parameters["AjaxRequestUniqueId"] =new Date().getTime() + "" + req.requestIndex;}var content =null;
for(var i in req.parameters){if(req.queryString.length>0){req.queryString +="&";}req.queryString +=encodeURIComponent(i) + "=" + encodeURIComponent(req.parameters[i]);}if(req.method=="GET"){if(req.queryString.length>0){req.url +=((req.url.indexOf("?")>-1)?"&":"?") + req.queryString;}}req.xmlHttpRequest.open(req.method,req.url,req.async,req.username,req.password);
if(req.method=="POST"){if(typeof(req.xmlHttpRequest.setRequestHeader)!="undefined"){req.xmlHttpRequest.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');}content =req.queryString;}if(req.timeout>0){setTimeout(req.onTimeoutInternal,req.timeout);}req.xmlHttpRequest.send(content);}};
req.handleArguments =
function(args){for(var i in args){if(typeof(req[i])=="undefined"){req.parameters[i] =args[i];}else{req[i] =args[i];}}};
req.getAllResponseHeaders =
function(){if(req.xmlHttpRequest!=null){if(req.responseReceived){return req.xmlHttpRequest.getAllResponseHeaders();}alert("Cannot getAllResponseHeaders because a response has not yet been received");}};
req.getResponseHeader =
function(headerName){if(req.xmlHttpRequest!=null){if(req.responseReceived){return req.xmlHttpRequest.getResponseHeader(headerName);}alert("Cannot getResponseHeader because a response has not yet been received");}};
return req;}AjaxRequest.getXmlHttpRequest =function(){if(window.XMLHttpRequest){return new XMLHttpRequest();}else if(window.ActiveXObject){/*@cc_on @*/
/*@if(@_jscript_version >=5)
try{return new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{return new ActiveXObject("Microsoft.XMLHTTP");}catch(E){return null;}}@end @*/}else{return null;}};
AjaxRequest.isActive =function(){return(AjaxRequest.numActiveAjaxRequests>0);};
AjaxRequest.get =function(args){AjaxRequest.doRequest("GET",args);};
AjaxRequest.post =function(args){AjaxRequest.doRequest("POST",args);};
AjaxRequest.doRequest =function(method,args){if(typeof(args)!="undefined" && args!=null){var myRequest =new AjaxRequest();
myRequest.method =method;
myRequest.handleArguments(args);
myRequest.process();}};
AjaxRequest.submit =function(theform, args){var myRequest =new AjaxRequest();
if(myRequest==null){return false;}var serializedForm =AjaxRequest.serializeForm(theform);
myRequest.method =theform.method.toUpperCase();
myRequest.url =theform.action;
myRequest.handleArguments(args);
myRequest.queryString =serializedForm;
myRequest.process();
return true;};
AjaxRequest.serializeForm =function(theform){var els =theform.elements;
var len =els.length;
var queryString ="";
this.addField =
function(name,value){if(queryString.length>0){queryString +="&";}queryString +=encodeURIComponent(name) + "=" + encodeURIComponent(value);};
for(var i=0;i<len;i++){var el =els[i];
if(!el.disabled){switch(el.type){case 'text': case 'password': case 'hidden': case 'textarea':
this.addField(el.name,el.value);
break;
case 'select-one':
if(el.selectedIndex>=0){this.addField(el.name,el.options[el.selectedIndex].value);}break;
case 'select-multiple':
for(var j=0;j<el.options.length;j++){if(el.options[j].selected){this.addField(el.name,el.options[j].value);}}break;
case 'checkbox': case 'radio':
if(el.checked){this.addField(el.name,el.value);}break;}}}return queryString;};
AjaxRequest.numActiveAjaxRequests =0;
AjaxRequest.numActiveAjaxGroupRequests =new Object();
AjaxRequest.numAjaxRequests =0;

/*vietuni8.js - R.19.10.01 @JOTREQFA@P*Veni*Vidi*Vici*
* by Tran Anh Tuan [tuan@physik.hu-berlin.de] 
* Copyright (c) 2001, 2002 AVYS e.V.. All Rights Reserved.
*
* Originally published and documented at http://www.avys.de/
* You may use this code without fee on noncommercial web sites. 
* You may NOT alter the code and then call it another name and/or resell it.
* The copyright notice must remain intact on srcipts.
*/

// interface for HTML:
         
var supported = (document.all || document.getElementById);
var disabled = false;
var charmapid = 1;
var keymodeid = 0;
var linebreak = 0;
var theTyper = null;

//--------------Added by BV.HUNG-----
var	Kbrd = 'telex';
function ChangeLinkHref(name) {
	name.href =	name.href +	'&Kbrd=' + Kbrd;
}

function initVietTyper(mode,font){
  setTypingMode(mode);
  switch (font)	{
	 case 'utf8'  :	charmapid = 1; break;
	 case 'vni'	  :	charmapid = 5; break;
	 case 'tcvn'  :	charmapid = 6; break;
	 case 'viscii':	charmapid = 7; break;
	 case 'vps'	  :	charmapid = 8; break;
	 case 'viqr'  : charmapid = 9; break;
	 default	  :	charmapid = 6;
 }
}
//---------------End BV.HUNG---------
reset = function(){}
telexingVietUC = initTyper;

function setTypingMode(mode) {
  keymodeid = mode;
  if (theTyper) theTyper.keymode= initKeys();
  if (!supported && !disabled) {
    disabled = true;  
  }
}
initCharMap = function() { return new CVietUniCodeMap(); }
initKeys = function() {
  switch (keymodeid) {
    case 1: return new CTelexKeys();
    case 2: return new CVniKeys();
    case 3: return new CViqrKeys();
    default: return new CVKOff();
  }
}
function initTyper(txtarea) {
  txtarea.vietarea= true;
  txtarea.onkeyup= null;
  if (!supported) return;
  txtarea.onkeypress= vietTyping;
  txtarea.getCurrentWord= getCurrentWord;
  txtarea.replaceWord= replaceWord;
  txtarea.onkeydown= onKeyDown;
  txtarea.onmousedown= onMouseDown;
}

function getEvt(evt) {
  return document.all? event.keyCode: (evt && evt.which)? evt.which: 0;
}

function onKeyDown(evt) {
  var c= getEvt(evt);
  if ((c==10) || (c==13)) { reset(1); linebreak= 1; }
  else if ((c<49) && (c!=16) && (c!=20)) { linebreak= 0; reset(c==32); }
  return true;
}

function onMouseDown(evt) { reset(0); linebreak= 0; return true; }

function vietTyping(evt) {
  var c= getEvt(evt);
  if(theTyper) theTyper.value= this.getCurrentWord();
  else theTyper= new CVietString(this.getCurrentWord());
  var changed= (c>32) && theTyper.typing(c);
  if (changed) this.replaceWord(theTyper.value);
  return !changed; 
}

function getCurrentWord() {
  if(!document.all) return this.value;
  var caret = this.document.selection.createRange();
  var backward = -10;
  do {
    var caret2 = caret.duplicate();
    caret2.moveStart("character", backward++);
  } while (caret2.parentElement() != this && backward <0);
  this.curword = caret2.duplicate();
  return caret2.text;
}

function replaceWord(newword) {
  if(!document.all) { this.value= newword; return; }
  this.curword.text = newword;
  this.curword.collapse(false);
}
// end interface

// "class": CVietString
//
function CVietString(str) {
  this.value= str;
  this.keymode= initKeys();
  this.charmap= initCharMap();
  this.ctrlchar= '-';
  this.changed= 0;

  this.typing= typing;
  this.Compose= Compose;
  this.findCharToChange= findCharToChange;
  return this;
}

function typing(ctrl) {
  this.changed = 0;
  this.ctrlchar = String.fromCharCode(ctrl);
  if (linebreak) linebreak= 0; else this.keymode.getAction(this);
  return this.changed;
}

function Compose(type) {
  var info = this.findCharToChange(type);
  if (!info) return;
  var telex;
  if (info[0]=='\\') telex= [1,this.ctrlchar,1];
  else if (type>6) telex= this.charmap.getAEOWD(info[0], type, info[3]);
  else telex= this.charmap.getDau(info[0], type);
  if (!(this.changed = telex[0])) return;
  this.value = this.value.replaceAt(info[1],telex[1],info[2]);
  if (!telex[2]) { spellerror= 1; this.value+= this.ctrlchar; }
}

function findCharToChange(type) {
  var lastchars= this.charmap.lastCharsOf(this.value, 5);
  var i= 0, c=lastchars[0][0], chr=0;
  if (c=='\\') return [c,this.value.length-1,1];
  if (type==15) while (!(chr=this.charmap.isVD(c))) {
    if ((c < 'A') || (i>=4) || !(c=lastchars[++i][0])) return null;
  }
  else while( "cghmnpt".indexOf(c)>=0) {
    if ((c < 'A') || (i>=2) || !(c=lastchars[++i][0])) return null;
  }
  c = lastchars[0][0].toLowerCase();
  var pc = lastchars[1][0].toLowerCase();
  var ppc = lastchars[2][0].toLowerCase();
  if (i==2 && type<6) {
    var tmp = pc + c;
    if ((tmp!="ng") && (tmp!="ch") && (tmp!="nh")) return null;
    if (tmp=="ch" && type!=1 && type!=3) return null; 
  }
  else if (i==1 && type<6) {
    if((c=='g') || (c=="h")) return null;
    if ("cpt".indexOf(c) >=0 && type!=1 && type!=3) return null; 
  }
  else if (i==0 && type!=15) {
    if ( (chr=this.charmap.isVowel(lastchars[1][0]))
      && ("uyoia".indexOf(c)>=0) && !this.charmap.isUO(pc,c)
      && !((pc=='o' && c=='a') || (pc=='u' && c=='y'))
      && !((ppc=='q' && pc=='u') || (ppc=='g' && pc=='i')) ) ++i;
    if (c=='a' && (type==9 || type==7)) i= 0;
  }
  c= lastchars[i][0];
  if ((i==0 || chr==0) && type!=15) chr= this.charmap.isVowel(c);
  if (!chr) return null;
  var clen= lastchars[i][1], isuo=0;
  if ((i>0) && (type==7 || type==8 || type==11)) {
    isuo=this.charmap.isUO(lastchars[i+1][0],c);
    if (isuo) { chr=isuo; clen+=lastchars[++i][1]; isuo=1; }
  }
  var pos= this.value.length;
  for (var j=0; j<= i; j++) pos -= lastchars[j][1];
  return [chr, pos, clen, isuo];
}
// end CVietString


// character-map template
//
function CVietCharMap() {
this.vietchars = null;
this.length = 149;
return this; 
}

CVietCharMap.prototype.charAt = function(ind) { 
  var chrcode = this.vietchars[ind];
  return chrcode ? String.fromCharCode(chrcode) : null; 
}

CVietCharMap.prototype.isVowel = function(chr) {
  var ind = this.length-5;
  while ((chr != this.charAt(ind)) && ind) --ind;
  return ind;
}

CVietCharMap.prototype.isVD = function (chr) {
  var ind = this.length-5;
  while ((chr != this.charAt(ind)) && (ind < this.length)) ++ind;
  return (ind<this.length)? ind: 0;
}
                         
CVietCharMap.prototype.isCol = function (col, chr){
  var i=12, ind=col+1;
  while (i>=0 && (this.charAt(i*12+ind)!=chr)) --i; 
  return (i>=0)? i*12+ind : 0;
}

CVietCharMap.prototype.isUO = function (c1, c2) {
  if (!c1 || !c2) return 0;
  var ind1= this.isCol(9, c1);
  if (!ind1) ind1= this.isCol(10, c1);
  if (!ind1) return 0;
  var ind2= this.isCol(6, c2);
  if (!ind2) ind2= this.isCol(7, c2);
  if (!ind2) ind2= this.isCol(8, c2);
  if (!ind2) return 0;
  return [ind1,ind2];
}

CVietCharMap.prototype.getDau = function (ind, type) {
  var accented= (ind < 25)? 0: 1;
  var ind_i= (ind-1) % 24 +1;
  var charset= (type == 6)? 0 : type;
  if ((type== 6) && !accented) return [0];
  var newind= charset*24 + ind_i;
  if (newind == ind) newind= ind_i;
  return [1, this.charAt(newind), newind>24 || type==6];
}

var map=[
[7,7,7,8,8, 8,9,10,11,15],
[0,3,6,0,6, 9,0, 3, 6, 0],
[1,4,7,2,8,10,1, 4, 7, 1]
];
CVietCharMap.prototype.getAEOWD = function (ind, type, isuo) {
  var c=0, i1=isuo? ind[0]: ind;
  var vc1= (type==15)? (i1-1)%2 : (i1-1)%12;
  if (isuo) {
    base= ind[1]-(ind[1]-1)%12;
    if (type==7 || type==11) c= this.charAt(i1-vc1+9)+this.charAt(base+7);
    else if (type==8) c= this.charAt(i1-vc1+10)+this.charAt(base+8);
    return [c!=0, c, 1];
  }
  var i= -1, shift= 0, del= 0;
  while (shift==0 && ++i<map[0].length) {
    if (map[0][i]==type) {
      if(map[1][i]==vc1) shift= map[2][i]-vc1;
      else if(map[2][i]==vc1) shift= map[1][i]-vc1;
    }
  }
  if (shift==0) {
    if (type==7 && (vc1==2 || vc1==8)) shift=-1;
    else if ((type==9 && vc1==2) || (type==11 && vc1==8)) shift=-1;
    else if (type==8 && (vc1==1 || vc1==7)) shift=1;
    del= 1;
  } else del=(shift>0);
  return [shift!=0, this.charAt(i1+shift), del];
}

CVietCharMap.prototype.lastCharsOf = function (str, num) {
  if (!num) return [str.charAt(str.length-1),1];
  var vchars = new Array(num);
  for (var i=0; i< num; i++) vchars[i]= [str.charAt(str.length-i-1),1];
  return vchars;
}
// end CVietCharMap prototype


String.prototype.replaceAt= function(i,newchr,clen) {
  return this.substring(0,i)+ newchr + this.substring(i+clen);
}

// output map: class CVietUniCodeMap
// 
function CVietUniCodeMap(){ var map = new CVietCharMap();
map.vietchars = new Array(
"UNICODE",
97, 226, 259, 101, 234, 105, 111, 244, 417, 117, 432, 121,
65, 194, 258, 69, 202, 73, 79, 212, 416, 85, 431, 89,
225, 7845, 7855, 233, 7871, 237, 243, 7889, 7899, 250, 7913, 253,
193, 7844, 7854, 201, 7870, 205, 211, 7888, 7898, 218, 7912, 221,
224, 7847, 7857, 232, 7873, 236, 242, 7891, 7901, 249, 7915, 7923,
192, 7846, 7856, 200, 7872, 204, 210, 7890, 7900, 217, 7914, 7922,
7841, 7853, 7863, 7865, 7879, 7883, 7885, 7897, 7907, 7909, 7921, 7925,
7840, 7852, 7862, 7864, 7878, 7882, 7884, 7896, 7906, 7908, 7920, 7924,
7843, 7849, 7859, 7867, 7875, 7881, 7887, 7893, 7903, 7911, 7917, 7927,
7842, 7848, 7858, 7866, 7874, 7880, 7886, 7892, 7902, 7910, 7916, 7926,
227, 7851, 7861, 7869, 7877, 297, 245, 7895, 7905, 361, 7919, 7929,
195, 7850, 7860, 7868, 7876, 296, 213, 7894, 7904, 360, 7918, 7928,
100, 273, 68, 272);
return map;
}

// input methods: class C...Keys
function CVietKeys() {
  this.getAction= function(typer) { 
    var i= this.keys.indexOf(typer.ctrlchar.toLowerCase());
    if(i>=0) typer.Compose(this.actions[i]);
  }
  return this;
}

function CVKOff() {
  this.off = true;
  this.getAction= function(){};
  return this;
}

function CTelexKeys() {
  var k= new CVietKeys();
  k.keys= "sfjrxzaeowd";
  k.actions= [1,2,3,4,5,6,9,10,11,8,15];
  k.istelex= true;
  return k;
}
             
function CVniKeys() {
  var k= new CVietKeys();
  k.keys= "0123456789";
  k.actions= [6,1,2,4,5,3,7,8,8,15];
  return k;
}

function CViqrKeys() {
  var k= new CVietKeys();
  k.keys= "\xB4/'`.?~-^(*+d";
  k.actions= [1,1,1,2,3,4,5,6,7,8,8,8,15];
  return k;
}

// end vietuni8.js

/*vumaps.js [optional]
* this file is part of the VIETUNI typing tool 
* by Tran Anh Tuan [tuan@physik.hu-berlin.de]
* Copyright (c) 2001, 2002 AVYS e.V.. All Rights Reserved.
*/

if (typeof(initCharMap) != 'undefined') {
  initCharMap = selectMap;
  if (theTyper) theTyper.charmap = initCharMap();
  vumaps = 1;
}
                        
function selectMap(id) {	
  var map = id? id: charmapid;
  switch (map) {
     case 1: return new CVietUniCodeMap();
     case 5: return new CVietVniMap();
     case 6: return new CVietTCVNMap();
     case 7: return new CVietVISCIIMap();
     case 8: return new CVietVPSMap();
     case 9: return new CVietViqrMap();
     default: return new CVietUniCodeMap();
  }
}

///////////////////////////

CVietCharMap.prototype.lowerCaseOf = function (chr, ind) {
  var i = ind? ind: this.isVowel(chr);
  if(i) return (i && ((i-1)%24 >= 12))? this.charAt(i-12): this.charAt(i); 
  if(!result[1]) result[1]= this.lowerCaseOf(0,charset*24 + ind_i); 
}

CVietCharMap.prototype.indexOf = function (chr,isnumber) {
  var c = isnumber? String.fromcharCode(chr) : chr;
  var ind = this.length-1;
  while ((c != this.charAt(ind)) && (ind > 0)) --ind;
  return ind;
}

CVietCharMap.prototype.regExpAt = function (i) {
  var c=this.charAt(i);
  return c? new RegExp(c,'g') : 0;
}

CVietCharMap.prototype.convertTxtTo = function (txt, newmap) {
  var i, regexp, res;
  for (i=this.length-1; i>0; i--) {
    if(regexp=this.regExpAt(i)) txt= txt.replace(regexp, "::"+i+"::");
  }
  while (res = /::(\d+)::/gi.exec(txt)) {
    regexp = new RegExp("::"+res[1]+"::",'g');
    txt= txt.replace(regexp, newmap.charAt(parseInt(res[1],10)));
  }
  return txt;
}

function CVietTCVNMap() { var map = new CVietCharMap();
map.vietchars = new Array(
 "TCVN-3",
 97, 169, 168, 101, 170, 105, 111, 171, 172, 117, 173, 121, 
 65, 162, 161, 69, 163, 73, 79, 164, 165, 85, 166, 89,
 184, 202, 190, 208, 213, 221, 227, 232, 237, 243, 248, 253,
 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 181, 199, 187, 204, 210, 215, 223, 229, 234, 239, 245, 250,
 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 185, 203, 198, 209, 214, 222, 228, 233, 238, 244, 249, 254,
 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 182, 200, 188, 206, 211, 216, 225, 230, 235, 241, 246, 251,
 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 183, 201, 189, 207, 212, 220, 226, 231, 236, 242, 247, 252,
 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
 100, 174, 68, 167);
return map;
}

function CVietVISCIIMap() { var map = new CVietCharMap();
map.vietchars = new Array(
"VISCII",
97, 226, 229, 101, 234, 105, 111, 244, 189, 117, 223, 121,
65, 194, 197, 69, 202, 73, 79, 212, 180, 85, 191, 89,
225, 164, 237, 233, 170, 237, 243, 175, 190, 250, 209, 253,
193, 8222, 129, 201, 352, 205, 211, 143, 8226, 218, 186, 221,
224, 165, 162, 232, 171, 236, 242, 176, 182, 249, 215, 207,
192, 8230, 8218, 200, 8249, 204, 210, 144, 8211, 217, 187, 376,
213, 167, 163, 169, 174, 184, 247, 181, 254, 248, 241, 220,
8364, 8225, 402, 8240, 381, 732, 353, 8220, 8221, 382, 185, 0,
228, 166, 198, 235, 172, 239, 246, 177, 183, 252, 216, 214,
196, 8224, 0, 203, 338, 8250, 8482, 8216, 8212, 339, 188, 0,
227, 231, 199, 168, 173, 238, 245, 178, 222, 251, 230, 219,
195, 0, 0, 710, 141, 206, 0, 8217, 179, 157, 255, 0,
100, 240, 68, 208);
return map;
}


function CVietVPSMap() { var map = new CVietCharMap();
map.vietchars = new Array(
"VPS-Win",
97, 226, 230, 101, 234, 105, 111, 244, 214, 117, 220, 121,
65, 194, 710, 69, 202, 73, 79, 212, 247, 85, 208, 89,
225, 195, 161, 233, 8240, 237, 243, 211, 167, 250, 217, 353,
193, 402, 141, 201, 144, 180, 185, 8211, 157, 218, 173, 221,
224, 192, 162, 232, 352, 236, 242, 210, 169, 249, 216, 255,
0, 8222, 0, 215, 8220, 181, 188, 8212, 0, 168, 175, 178,
229, 198, 165, 203, 338, 206, 8224, 182, 174, 248, 191, 339,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
228, 196, 163, 200, 8249, 204, 213, 176, 170, 251, 186, 8250,
129, 8230, 0, 222, 8221, 183, 189, 732, 376, 209, 177, 0,
227, 197, 164, 235, 205, 239, 245, 8225, 171, 219, 187, 207,
8218, 0, 0, 254, 8226, 184, 0, 8482, 166, 172, 0, 0,
100, 199, 68, 241);
return map;
}


function CVietMultibyteMap(superior) { 
var map= superior? superior: new CVietCharMap();

map.maxchrlen = 3;

map.charAt = function (ind) { 
  return this.vietchars[ind];
}

// return an array of num vietchars with variable length: [[chr,len][]..]
// extracted from str in reversed order
//
map.lastCharsOf = function (str, num) {
  var vchar = null;
  var i= this.maxchrlen;
  var mystr = str;
  while (!vchar && (i > 1)) {
    var c = mystr.substring(mystr.length-i);
    if (this.indexOf(c)) vchar=[c, i]; 
    --i;
  }
  if (!vchar) vchar=[mystr.charAt(mystr.length-1), 1]; 
  if (!num) return vchar;
  var vchars = new Array(num);
  vchars[0]= vchar; 
  for ( i=1; i< num; i++) {
    mystr= mystr.substring(0,mystr.length-vchars[i-1][1]);  
    vchars[i]= this.lastCharsOf(mystr);
  }
  return vchars;
}

return map;
}

function CVietVniMap() { var map = new CVietMultibyteMap();
map.maxchrlen = 2;    
map.vietchars = new Array(
"VNI-WIN",
"a","a\xe2","a\xea","e","e\xe2","i","o","o\xe2","\xf4","u","\xf6","y",
"A","A\xc2","A\xca","E","E\xc2","I","O","O\xc2","\xd4","U","\xd6","Y",
"a\xf9","a\xe1","a\xe9","e\xf9","e\xe1","\xed","o\xf9","o\xe1","\xf4\xf9","u\xf9","\xf6\xf9","y\xf9",
"A\xd9","A\xc1","A\xc9","E\xd9","E\xc1","\xcd","O\xd9","O\xc1","\xd4\xd9","U\xd9","\xd6\xd9","Y\xd9",
"a\xf8","a\xe0","a\xe8","e\xf8","e\xe0","\xec","o\xf8","o\xe0","\xf4\xf8","u\xf8","\xf6\xf8","y\xf8",
"A\xd8","A\xc0","A\xc8","E\xd8","E\xc0","\xcc","O\xd8","O\xc0","\xd4\xd8","U\xd8","\xd6\xd8","Y\xd8",
"a\xef","a\xe4","a\xeb","e\xef","e\xe4","\xf2","o\xef","o\xe4","\xf4\xef","u\xef","\xf6\xef","\xee",
"A\xcf","A\xc4","A\xcb","E\xcf","E\xc4","\xd2","O\xcf","O\xc4","\xd4\xcf","U\xcf","\xd6\xcf","\xce",
"a\xfb","a\xe5","a\xfa","e\xfb","e\xe5","\xe6","o\xfb","o\xe5","\xf4\xfb","u\xfb","\xf6\xfb","y\xfb",
"A\xdb","A\xc5","A\xda","E\xdb","E\xc5","\xc6","O\xdb","O\xc5","\xd4\xdb","U\xdb","\xd6\xdb","Y\xdb",
"a\xf5","a\xe3","a\xfc","e\xf5","e\xe3","\xf3","o\xf5","o\xe3","\xf4\xf5","u\xf5","\xf6\xf5","y\xf5",
"A\xd5","A\xc3","A\xdc","E\xd5","E\xc3","\xd3","O\xd5","O\xc3","\xd4\xd5","U\xd5","\xd6\xd5","Y\xd5",
"d","\xf1","D","\xd1");  
return map;
}

function CVietViqrMap() { var map = new CVietMultibyteMap();
map.vietchars = new Array(
 "VIQR",
 "a","a^","a(","e","e^","i","o","o^","o+","u","u+","y",
 "A","A^","A(","E","E^","I","O","O^","O+","U","U+", "Y",
 "a'","a^'","a('","e'","e^'","i'","o'","o^'","o+'","u'","u+'","y'", 
 "A'","A^'","A('","E'","E^'","I'","O'","O^'","O+'","U'","U+'","Y'", 
 "a`","a^`","a(`","e`","e^`","i`","o`","o^`","o+`","u`","u+`","y`", 
 "A`","A^`","A(`","E`","E^`","I`","O`","O^`","O+`","U`","U+`","Y`", 
 "a.","a^.","a(.","e.","e^.","i.","o.","o^.","o+.","u.","u+.","y.", 
 "A.","A^.","A(.","E.","E^.","I.","O.","O^.","O+.","U.","U+.","Y.", 
 "a?","a^?","a(?","e?","e^?","i?","o?","o^?","o+?","u?","u+?","y?", 
 "A?","A^?","A(?","E?","E^?","I?","O?","O^?","O+?","U?","U+?","Y?", 
 "a~","a^~","a(~","e~","e^~","i~","o~","o^~","o+~","u~","u+~","y~", 
 "A~","A^~","A(~","E~","E^~","I~","O~","O^~","O+~","U~","U+~","Y~",
 "d","dd","D","DD");

map.regExpAt = function(ind) {
  var c=this.charAt(ind);
  if (!c) return null;
  c = c.replace(/\+/g, "[\\+\\*]");
  c = c.replace(/'/g, "[']");
  c = c.replace(/([\-\?\.\(\^])/g, "\\$1");
  c = c.replace(/(d)d/gi, "$1$1|\\-$1|$1\\-");
  return new RegExp(c,'g');
}

map.convertTxtTo = function (txt, newmap) {
  var i, regexp, res, tmp;
//  txt= txt.replace(/([\.\?]\s+[A-Z])/g, ";;;$1");
  txt= txt.replace(/(\.\.+|\?\?+)/g, ";;;$1");
//  txt= txt.replace(/([\.\?])(\s*[\n\r])/g, ";;;$1$2");
  while (res=/(\.[\w\@\-\.\/\\][\w\@\-\.\/\\][\w\@\-\.\/\\]+\s*)/g.exec(txt)){
    regexp= res[1].replace(/([\.\?\+\-\(\^\*\@\\)\]\}])/g,"\\$1");
    tmp= res[1].replace(/\./g,";;;.;;;");
    txt= txt.replace(new RegExp(regexp,'g'), tmp);
  }
  for (i=this.length-1; i>0; i--) {
    if(regexp=this.regExpAt(i)) txt= txt.replace(regexp, "::"+i+"::");
  }
  while (res = /::(\d+)::/gi.exec(txt)) {
    regexp = new RegExp("::"+res[1]+"::",'g');
    txt= txt.replace(regexp, newmap.charAt(parseInt(res[1],10)));
  }
  txt= txt.replace(/;;;/g,"");
  return txt;
}

return map;
}
// Combined Unicode (somewhat like VNI): character + ton mark
//
function CVietCombUCMap() { var map = new CVietMultibyteMap(new CVietUniCodeMap());
  map.maxchrlen = 2;
  var viettm = new Array("UNICODE-C", 769, 768, 803, 777, 771); // ('`.?~)

  for (var i = 1; i < map.length-4; i++ ) {
    var i_char = (i-1)%24;
    var i_tm = (i - i_char - 1)/24;
    var base_c = map.vietchars[i_char+1];
    if (i<25) base_c = String.fromCharCode(base_c);
    var tonmark = String.fromCharCode(viettm[i_tm]);
    map.vietchars[i] = i_tm? base_c + tonmark : base_c;
  }
  for (var i = map.length-4; i < map.length; i++ ) {
    map.vietchars[i] = String.fromCharCode(map.vietchars[i]);
  }
  return map;
}

var gt_J;gt_J='';function adlistshow(gt_A,gt_B,gt_E,gt_W,gt_L,gt_N,gt_M,gt_V,gt_K){this.gt_aX=gt_B;this.gt_ah=gt_E;this.gt_aU=gt_N;this.gt_aT=gt_M;this.gt_bl=gt_W;this.face=gt_L;this.gt_aj=20000;this.gt_ak=100;if(typeof(gt_V)=='undefined'){this.gt_bg=true;}else{this.gt_bg=gt_V;};if(typeof(gt_K)=='undefined'){this.direction=0;}else{this.direction=gt_K;};switch(gt_W){case 0:case 4:case 5:case 6:case 9:case 10:case 12:case 13:case 14:case 15:this.gt_bf=0;break;case 8:this.gt_bf=2;break;default:this.gt_bf=1;break;}var gt_Z=new Array();var gt_aa=new Array();var i,j,k,no,gt_aL,gt_bk;i=0;j=-1;k=0;no=-1;gt_aL=0;gt_bk=1;if(this.gt_bf==0){for(i=0,j=0;i<gt_A.length;i++){if(this.gt_af(gt_A[i])){gt_Z[j]=gt_A[i];j++;}}gt_Z.sort(gt_x);this.gt_aP=j+1;this.gt_aV=gt_Z;}else if(this.gt_bf==1){gt_Z[0]=new Array();gt_Z[1]=new Array();for(i=0;i<gt_A.length;i++){if(gt_A[i][5]<=100){if(gt_A[i][5]!=no){no=gt_A[i][5];gt_aL=0;j++;k=0;}else{k++;}}else{if(gt_A[i][5]!=no||gt_A.length<=10){if(no<=100)j=-1;no=gt_A[i][5];gt_aL=1;j++;k=0;gt_bk=0;}else{if(gt_bk>=no-100){j++;k=0;gt_bk=0;}else{k++;}}}if(this.gt_af(gt_A[i])){if(k==0)gt_Z[gt_aL][j]=new Array();gt_Z[gt_aL][j][k]=gt_A[i];gt_bk++;}}for(i=0;i<gt_Z.length;i++){if(i==1){gt_Z[i].sort(gt_x)};for(j=0;j<gt_Z[i].length;j++){gt_Z[i][j].sort(gt_x);}}k=0;for(i=0;i<gt_Z.length;i++){for(j=0;j<gt_Z[i].length;j++){gt_aa[k]=gt_Z[i][j];k++;}}this.gt_aV=gt_aa;this.gt_aP=k;}else if(this.gt_bf==2){for(i=0,j=0;i<gt_A.length;i++){if(this.gt_af(gt_A[i])){gt_Z[j]=new Array();gt_Z[j][0]=new Array();gt_Z[j][0][0]=gt_A[i][0];gt_Z[j][0][1]=gt_A[i][2];gt_Z[j][0][2]=gt_A[i][3];gt_Z[j][0][3]=gt_A[i][4];gt_Z[j][0][4]=gt_A[i][5];gt_Z[j][1]=new Array();gt_Z[j][1][0]=gt_A[i][1];gt_Z[j][1][1]=gt_A[i][2];gt_Z[j][1][2]=gt_A[i][3];gt_Z[j][1][3]=gt_A[i][6];gt_Z[j][1][4]=gt_A[i][7];j++;}}gt_Z.sort(gt_x);this.gt_aP=j+1;this.gt_aV=gt_Z;}this.gt_aO();};adlistshow.prototype.gt_aO=function(){switch(this.gt_bl){case 0:this.gt_at();break;case 1:case 7:case 11:this.gt_ar();break;case 2:this.gt_ap(0);break;case 3:this.gt_ap(1);break;case 4:this.gt_ap(2);break;case 5:this.gt_as(false);break;case 6:this.gt_as(true);break;case 8:this.gt_an();break;case 9:this.gt_au();break;case 10:this.gt_aq();break;case 12:this.gt_ao(0);break;case 13:this.gt_ao(1);break;case 14:this.gt_ao(2);break;case 15:this.gt_ao(3);break;default:break;}};adlistshow.prototype.gt_ad=function(index){if(this.gt_bf==0){return true;}else{if(this.gt_aV.length==index+1){return true;}else{return false;}}};adlistshow.prototype.gt_at=function(){document.write('<table ',(this.gt_aU>0)?'width='.concat(this.gt_aU):'',' cellspacing=0 cellpadding=0 border=0 align=center>');this.gt_bV(this.gt_aV,0);document.write('</table>');};adlistshow.prototype.gt_ar=function(){if(this.face==0||this.face==3){document.write('<table ',(this.gt_aU>0)?'width='.concat(this.gt_aU):'',' cellspacing=0 cellpadding=0 border=0 align=center>');}else if(this.face==2){document.write('<table ',(this.gt_aU>0)?'width='.concat(this.gt_aU):'',' cellspacing=0 cellpadding=0 border=0 align=center><tr>');}for(var i=0;i<this.gt_aV.length;i++){this.gt_bV(this.gt_aV[i],i,this.gt_ad(i));if(this.face==0||this.face==3){document.write('<tr><td height="3"></td></tr>');}else if(this.face==2){document.write('<td width="3"></td>');}if(this.face==1&&(!this.gt_ad(i))){document.write('<tr><td height="1" bgcolor="#808080"></td></tr>');}}if(this.face==0||this.face==3){document.write('</table>');}else if(this.face==2){document.write('</tr></table>');}};adlistshow.prototype.gt_ap=function(type){if(type==2){document.write('<DIV id="floatdiv',this.gt_aX,'" style="position:absolute;overflow:hidden;top:0;left:-200;',(this.gt_aT>0)?'height:'.concat(this.gt_aT):'180',';',(this.gt_aU>0)?'width:'.concat(this.gt_aU):'115',';">');this.gt_bO(this.gt_aV);}else{document.write('<DIV id="floatdiv',this.gt_aX,'" style="position:absolute;top:0;left:-200;',(this.gt_aU>0)?'width:'.concat(this.gt_aU):'115',';">');this.gt_ar();}document.write('</DIV>');if(this.gt_aV.length>0){gt_b('floatdiv'.concat(this.gt_aX),type);}};adlistshow.prototype.gt_ao=function(type){switch(type){case 0:case 1:document.write('<DIV id="fixfloatdiv',this.gt_aX,'" style="position:absolute;z-index:200;top:0;left:-200;',(this.gt_aU>0)?'width:'.concat(this.gt_aU):'120',';">');break;case 2:case 3:document.write('<DIV id="fixfloatdiv',this.gt_aX,'" style="position:absolute;z-index:200;top:0;left:-200;',(this.gt_aT>0)?'height:'.concat(this.gt_aT):'150',';',(this.gt_aU>0)?'width:'.concat(this.gt_aU):'120',';">');break;}this.gt_bQ(this.gt_aV,0);document.write('</DIV>');if(this.gt_aV.length>0){gt_a('fixfloatdiv'.concat(this.gt_aX),type);}};adlistshow.prototype.gt_as=function(type){gt_bB=this.gt_aV[0][2].lastIndexOf(',');gt_bz=this.gt_aV[0][2].substr(gt_bB+2);gt_bi=gt_g(gt_bz,this.gt_aV[0][1],true);var gt_ab=this.gt_aV[0][2].split(",");gt_w(this.gt_aV[0][0],gt_bi,'Advertisment',gt_ab[2],gt_ab[9],gt_ab[8],screen.height-gt_ab[9]-80,(screen.width-770)/2+410-5,type);};adlistshow.prototype.gt_an=function(){document.write('<table align=center ',(this.gt_aU>0)?'width='.concat(this.gt_aU):'',' cellspacing=0 cellpadding=0 border=0>');this.gt_bP(this.gt_aV,0);document.write('</table>');};adlistshow.prototype.gt_au=function(){document.write('<table align=center ',(this.gt_aU>0)?'width='.concat(this.gt_aU):'',' cellspacing=0 cellpadding=0 border=0>');this.gt_bW(this.gt_aV,0);document.write('</table>');};adlistshow.prototype.gt_aq=function(){document.write('<table align=center ',(this.gt_aU>0)?'width='.concat(this.gt_aU):'',' cellspacing=0 cellpadding=0 border=0>');this.gt_bS(this.gt_aV,0);document.write('</table>');};adlistshow.prototype.gt_bV=function(gt_bb,index,gt_aQ){if(this.face==1){document.write('<tr><td id="',this.gt_aX,'_',index,'" style="padding:4px;">');}else if(this.face==2){document.write('<td id="',this.gt_aX,'_',index,'" style="padding:4px;">');}else{document.write('<tr><td id="',this.gt_aX,'_',index,'">');}document.write(gt_h(gt_bb[0],this.gt_aU,this.gt_aT));if(gt_bb.length>1){var gt_aK=''.concat(this.gt_aX).concat('_').concat(index);var gt_al=this.gt_aj;var gt_am=this.gt_ak;var gt_aU=this.gt_aU;var gt_aT=this.gt_aT;if(this.gt_bl==11){if(this.gt_bg){var gt_ai=0;setTimeout(function(){changebannerWC(gt_bb,gt_aK,gt_am,gt_aU,gt_aT,0)},0);setTimeout(function(){checkFlagWC(gt_bb,gt_aK,gt_am,gt_aU,gt_aT,gt_ai,0)},0);}}else{if(this.gt_bg)setTimeout(function(){gt_i(gt_bb,0,gt_aK,gt_al,gt_aU,gt_aT)},gt_al);}}if(this.face==2){document.write('</td>');}else{if(gt_bb.length>1&&this.gt_bl==11){document.write('</td></tr>');document.write('<tr><td>');document.write('	<input type="hidden" value="0" id="hidFlag_'+gt_aK+'" name="hidFlag_'+gt_aK+'" />');document.write('	<input type="hidden" value="0" id="hidLoop_'+gt_aK+'" name="hidLoop_'+gt_aK+'" />');document.write('	<div style="position:relative;width:160px;height:30px;background-color:#0066cc;">');document.write('		<div style="float:left;width:130px;">');for(var i=0;i<gt_bb.length;i++){document.write('<div id="numb'+gt_aK+i+'" style="float:left;width:20px;font-family:arial;font-size:12px;height:17px;text-align:center;margin:2px 0px 0px 0px;cursor:pointer;" onclick="gt_t(\'hidLoop_'+gt_aK+'\').value ='+i+'; gt_t(\'hidFlag_'+gt_aK+'\').value = 100;">'+(i+1)+'</div>');}document.write('		</div>');document.write('	<div class="divArrowL" onmouseover="gt_t(\'divArrowL_'+gt_aK+'\').className = \'divArrowL_Active\';" onmouseout="gmobj(\'divArrowL_'+gt_aK+'\').className = \'divArrowL\';" onclick="gmobj(\'hidFlag_'+gt_aK+'\').value = -1;" id="divArrowL_'+gt_aK+'">&nbsp;</div>');document.write('	<div style="float:left;width:4px;">&nbsp;</div>');document.write('	<div class="divArrowR" onmouseover="gt_t(\'divArrowR_'+gt_aK+'\').className = \'divArrowR_Active\';" onmouseout="gmobj(\'divArrowR_'+gt_aK+'\').className = \'divArrowR\';" onclick="gmobj(\'hidFlag_'+gt_aK+'\').value = 1;" id="divArrowR_'+gt_aK+'">&nbsp;</div>');document.write('</td></tr>');}}};adlistshow.prototype.gt_bU=function(gt_bb,gt_aQ){for(var i=0;i<gt_bb.length;i++){if(this.face==1){document.write('<tr><td style="padding:4px;">');}else if(this.face==2){document.write('<td style="padding:4px;">');}else{document.write('<tr><td>');}document.write(gt_h(gt_bb[i],this.gt_aU,this.gt_aT));if(this.face==2){document.write('</td>');}else{document.write('</td></tr>');}if(this.face==0){document.write('<tr><td height="3"></td></tr>');}else if(this.face==0){document.write('<td width="3"></td>');}if(this.face==1&&(i<gt_bb.length-1)){document.write('<tr><td height="1" bgcolor="#808080"></td></tr>');}}};adlistshow.prototype.gt_bO=function(gt_bb){document.write('<DIV id="subdiv',this.gt_aX,'" style="position:absolute;',(this.gt_aT>0)?'top:'.concat(this.gt_aT):'180',';',(this.gt_aU>0)?'width:'.concat(this.gt_aU):'115',';',(this.gt_aT>0)?'height:'.concat(this.gt_aT):'180',';">');document.write(gt_h(gt_bb[0],this.gt_aU,this.gt_aT));var gt_aK='subdiv'.concat(this.gt_aX);var gt_al=this.gt_aj;var gt_aU=this.gt_aU;var gt_aT=this.gt_aT;setTimeout(function(){gt_y(gt_bb,0,gt_aK,gt_al,gt_aU,gt_aT)},500);document.write('</DIV>');};adlistshow.prototype.gt_bP=function(gt_bb){if(gt_bb.length<=0)return;var gt_aU=this.gt_aU;var gt_aT=this.gt_aT;var gt_aK=''.concat(this.gt_aX);var gt_al=this.gt_aj;document.write('<tr><td>');document.write('<DIV id="',gt_aK,'" style="position:related;overflow:hidden;width:'.concat(gt_bb[0][0][3]),';height:'.concat(gt_bb[0][0][4]),';">');document.write(gt_h(gt_bb[0][0],this.gt_aU,this.gt_aT));if(gt_bb.length>1){}document.write('</DIV></td></tr>');document.write('<tr><td align=center id="',gt_aK,'_extend"><font face="Arial" size="1"><b>');document.write('<span id="',gt_aK,'_expandcollap" style="cursor:pointer;">M&#7903; r&#7897;ng</span>&nbsp;-&nbsp;');document.write('<span id="',gt_aK,'_close" style="cursor:pointer;">&#272;&#243;ng</span>');document.write('<input type="hidden" id="',this.gt_aX,'_hidden">');document.write('</td></tr>');gt_t(gt_aK+'_hidden').value=0;gt_t(gt_aK).onmouseover=function(){gt_q(gt_bb,gt_aK,gt_aU,gt_aT)};gt_t(gt_aK+'_expandcollap').onclick=function(){gt_q(gt_bb,gt_aK,gt_aU,gt_aT)};gt_t(gt_aK+'_close').onclick=function(){gt_m(gt_aK)};};function gt_q(gt_bb,gt_ac,gt_aU,gt_aT){var index=gt_t(gt_ac+'_hidden').value;if(parseInt(gt_t(gt_ac).offsetHeight)<gt_bb[index][1][4]){gt_t(gt_ac).style.height=parseInt(gt_t(gt_ac).offsetHeight)+10;setTimeout(function(){gt_q(gt_bb,gt_ac,gt_aU,gt_aT)},5);return;}gt_t(gt_ac).onmouseover='undefine';gt_t(gt_ac+'_expandcollap').innerHTML='Thu nh&#7887;';gt_t(gt_ac+'_expandcollap').onclick=function(){gt_n(gt_bb,gt_ac,gt_aU,gt_aT)};gt_t(gt_ac).innerHTML=gt_h(gt_bb[index][1],gt_aU,gt_aT);};function gt_n(gt_bb,gt_ac,gt_aU,gt_aT){var index=gt_t(gt_ac+'_hidden').value;if(parseInt(gt_t(gt_ac).offsetHeight)>gt_bb[index][0][4]){gt_t(gt_ac).style.height=parseInt(gt_t(gt_ac).offsetHeight)-10;setTimeout(function(){gt_n(gt_bb,gt_ac,gt_aU,gt_aT)},5);return;}gt_t(gt_ac).onmouseover=function(){gt_q(gt_bb,gt_ac,gt_aU,gt_aT)};gt_t(gt_ac+'_expandcollap').innerHTML='M&#7903; r&#7897;ng';gt_t(gt_ac+'_expandcollap').onclick=function(){gt_q(gt_bb,gt_ac,gt_aU,gt_aT)};gt_t(gt_ac).innerHTML=gt_h(gt_bb[index][0],gt_aU,gt_aT);};function gt_m(gt_ac){gt_t(gt_ac).style.display='none';gt_t(gt_ac+'_extend').style.display='none';};function gt_i(gt_bb,index,gt_ac,gt_al,gt_aU,gt_aT){if(index==gt_bb.length-1){index=0;}else{index++;}gt_t(gt_ac).innerHTML=gt_h(gt_bb[index],gt_aU,gt_aT);setTimeout(function(){gt_i(gt_bb,index,gt_ac,gt_al,gt_aU,gt_aT)},gt_al);};function checkFlagWC(gt_bb,gt_ac,gt_am,gt_aU,gt_aT,gt_ai,loop){var gt_aE;gt_aE=gt_t("hidFlag_"+gt_ac).value;if(gt_aE==0){if(gt_ai==gt_am){loop++;setTimeout(function(){changebannerWC(gt_bb,gt_ac,gt_am,gt_aU,gt_aT,loop)},0);}}else if(gt_aE==1){loop++;setTimeout(function(){changebannerWC(gt_bb,gt_ac,gt_am,gt_aU,gt_aT,loop)},0);gt_t("hidFlag_"+gt_ac).value=0;gt_ai=0;}else if(gt_aE==-1){loop--;setTimeout(function(){changebannerWC(gt_bb,gt_ac,gt_am,gt_aU,gt_aT,loop)},0);gt_t("hidFlag_"+gt_ac).value=0;gt_ai=0;}else{loop=gt_t('hidLoop_'+gt_ac).value;setTimeout(function(){changebannerWC(gt_bb,gt_ac,gt_am,gt_aU,gt_aT,loop)},0);gt_t("hidFlag_"+gt_ac).value=0;gt_t('hidLoop_'+gt_ac).value=0;gt_ai=0;}gt_ai++;if(gt_ai>gt_am){gt_ai=0;}if(loop==gt_bb.length){loop=0;}if(loop<0){loop=(gt_bb.length-1);}setTimeout(function(){checkFlagWC(gt_bb,gt_ac,gt_am,gt_aU,gt_aT,gt_ai,loop)},100);};function changebannerWC(gt_bb,gt_ac,gt_am,gt_aU,gt_aT,gt_aB){gt_t(gt_ac).innerHTML=gt_h(gt_bb[gt_aB],gt_aU,gt_aT);var k;for(k=0;k<gt_bb.length;k++){if(k==gt_aB){document.getElementById("numb"+gt_ac+k).style.backgroundColor="2879ca";document.getElementById("numb"+gt_ac+k).style.border="solid 2px #cccccc";}else{document.getElementById("numb"+gt_ac+k).style.backgroundColor="0066cc";document.getElementById("numb"+gt_ac+k).style.border="solid 2px #0066cc";}}};function gt_k(gt_bb,index,gt_ac,gt_al,gt_aU,gt_aT){if(gt_t(gt_ac+'_status').value=='0'){if(index==gt_bb.length-1){index=0;}else{index++;}var gt_bj='';gt_bj=gt_bj.concat('<DIV id="').concat(gt_ac).concat('_child" style="position:absolute;top:0px;left:0px;width:').concat(gt_bb[index][3]).concat('px;height:').concat(gt_bb[index][4]).concat('px;">');gt_bj=gt_bj.concat(gt_h(gt_bb[index],gt_aU,gt_aT,false,gt_ac));gt_bj=gt_bj.concat('</DIV>');gt_t(gt_ac).innerHTML=gt_bj;gt_s(gt_ac);}setTimeout(function(){gt_k(gt_bb,index,gt_ac,gt_al,gt_aU,gt_aT)},gt_al);};adlistshow.prototype.gt_bW=function(gt_bb){if(gt_bb.length<=0)return;var gt_aU=(this.gt_aU<gt_bb[0][3]&&this.gt_aU>0)?this.gt_aU:gt_bb[0][3];var gt_aT=(this.gt_aT<gt_bb[0][4]&&this.gt_aT>0)?this.gt_aT:gt_bb[0][4];var gt_aK=''.concat(this.gt_aX);var gt_al=this.gt_aj;document.write('<tr><td>');document.write('<DIV id="',gt_aK,'" style="position:relative;overflow:hidden;width:'.concat(gt_aU),'px;height:'.concat(gt_aT),'px;">');document.write(gt_h(gt_bb[0],this.gt_aU,this.gt_aT,false,gt_aK));document.write('</DIV>');document.write('<input type="hidden" id="',gt_aK,'_status" value="0">');document.write('</td></tr>');if(this.gt_bg)setTimeout(function(){gt_k(gt_bb,0,gt_aK,gt_al,gt_aU,gt_aT)},gt_al);};adlistshow.prototype.gt_bS=function(gt_bb){if(gt_bb.length<=0)return;var gt_aU=(this.gt_aU<gt_bb[0][3]&&this.gt_aU>0)?this.gt_aU:gt_bb[0][3];var gt_aT=(this.gt_aT<gt_bb[0][4]&&this.gt_aT>0)?this.gt_aT:gt_bb[0][4];var gt_aK=''.concat(this.gt_aX);var gt_al=this.gt_aj;document.write('<tr><td>');document.write('<DIV id="',gt_aK,'_position" style="position:relative;overflow:hidden;width:'.concat(gt_aU),'px;height:'.concat(gt_aT),'px;"></DIV>');document.write('<DIV id="',gt_aK,'" style="position:absolute;overflow:hidden;z-index:100;top:0px;left:-1000px;width:'.concat(gt_aU),'px;height:'.concat(gt_aT),'px;">');document.write('</DIV>');document.write('<input type="hidden" id="',gt_aK,'_direction" value="',this.direction,'">');document.write('<input type="hidden" id="',gt_aK,'_status" value="0">');document.write('</td></tr>');var gt_Y=this;if(window.addEventListener)window.addEventListener("load",function(){gt_Y.gt_bT(gt_bb)},false);else if(window.attachEvent)window.attachEvent("onload",function(){gt_Y.gt_bT(gt_bb)});else if(document.getElementById)setTimeout(function(){gt_Y.gt_bT(gt_bb)},500);};adlistshow.prototype.gt_bT=function(gt_bb){if(gt_bb.length<=0)return;var gt_aU=(this.gt_aU<gt_bb[0][3]&&this.gt_aU>0)?this.gt_aU:gt_bb[0][3];var gt_aT=(this.gt_aT<gt_bb[0][4]&&this.gt_aT>0)?this.gt_aT:gt_bb[0][4];var gt_aK=''.concat(this.gt_aX);var gt_al=this.gt_aj;var gt_bj='';gt_bj=gt_bj.concat('<DIV id="').concat(gt_aK).concat('_child" style="position:absolute;top:0px;left:0px;width:').concat(gt_bb[0][3]).concat('px;height:').concat(gt_bb[0][4]).concat('px;">');gt_bj=gt_bj.concat(gt_h(gt_bb[0],this.gt_aU,this.gt_aT,false,gt_aK));gt_bj=gt_bj.concat('</DIV>');gt_t(gt_aK).innerHTML=gt_bj;gt_z(gt_aK,true);if(this.gt_bg)setTimeout(function(){gt_k(gt_bb,0,gt_aK,gt_al,gt_aU,gt_aT)},gt_al);};adlistshow.prototype.gt_bQ=function(gt_bb){if(gt_bb.length<=0)return;var gt_aU=(this.gt_aU<gt_bb[0][3]&&this.gt_aU>0)?this.gt_aU:gt_bb[0][3];var gt_aT=(this.gt_aT<gt_bb[0][4]&&this.gt_aT>0)?this.gt_aT:gt_bb[0][4];var gt_aK=''.concat(this.gt_aX);var gt_al=this.gt_aj;document.write('<DIV id="',gt_aK,'_position" style="position:relative;overflow:hidden;width:'.concat(gt_aU),'px;height:'.concat(gt_aT),'px;"></DIV>');document.write('<DIV id="',gt_aK,'" style="position:absolute;overflow:hidden;z-index:100;top:0px;left:0px;width:'.concat(gt_aU),'px;height:'.concat(gt_aT),'px;">');document.write('</DIV>');document.write('<input type="hidden" id="',gt_aK,'_directionfix" value="',this.direction,'">');document.write('<input type="hidden" id="',gt_aK,'_status" value="0">');var gt_Y=this;setTimeout(function(){gt_Y.gt_bR(gt_bb)},300);};adlistshow.prototype.gt_bR=function(gt_bb){if(gt_bb.length<=0)return;var gt_aU=(this.gt_aU<gt_bb[0][3]&&this.gt_aU>0)?this.gt_aU:gt_bb[0][3];var gt_aT=(this.gt_aT<gt_bb[0][4]&&this.gt_aT>0)?this.gt_aT:gt_bb[0][4];var gt_aK=''.concat(this.gt_aX);var gt_al=this.gt_aj;var gt_bj='';gt_bj=gt_bj.concat('<DIV id="').concat(gt_aK).concat('_child" style="position:absolute;top:0px;left:0px;width:').concat(gt_bb[0][3]).concat('px;height:').concat(gt_bb[0][4]).concat('px;">');gt_bj=gt_bj.concat(gt_h(gt_bb[0],this.gt_aU,this.gt_aT,false,gt_aK));gt_bj=gt_bj.concat('</DIV>');gt_t(gt_aK).innerHTML=gt_bj;gt_z(gt_aK,true);if(gt_bb.length>1){if(this.gt_bg)setTimeout(function(){gt_k(gt_bb,0,gt_aK,gt_al,gt_aU,gt_aT,1)},gt_al);}};function gt_z(id,gt_aA){var gt_aC=true;if(gt_t(id+'_direction')){direction=gt_t(id+'_direction').value;}else if(gt_t(id+'_directionfix')){direction=gt_t(id+'_directionfix').value;gt_aC=false;}else{direction=0;}if(gt_t(id)&&gt_t(id+'_position')){if(gt_aC){var gt_R=gt_u(gt_t(id+'_position'))[1];var gt_Q=gt_u(gt_t(id+'_position'))[0];var gt_P=parseInt(gt_t(id+'_position').offsetHeight);var gt_S=parseInt(gt_t(id+'_position').offsetWidth);var gt_H=parseInt(gt_t(id).offsetHeight);var gt_I=parseInt(gt_t(id).offsetWidth);if(direction==0||direction==1){gt_t(id).style.top=gt_R+'px';}else{gt_t(id).style.top=gt_R-gt_H+gt_P+'px';}if(direction==0||direction==2){gt_t(id).style.left=gt_Q+'px';}else{gt_t(id).style.left=gt_Q-gt_I+gt_S+'px';}}else{}}if(gt_aA==true)gt_s(id);setTimeout(function(){gt_z(id)},100);};function gt_s(id){var gt_aC=true;if(gt_t(id+'_direction')){direction=gt_t(id+'_direction').value;}else if(gt_t(id+'_directionfix')){direction=gt_t(id+'_directionfix').value;gt_aC=false;}else{direction=0;}if(gt_t(id)&&gt_t(id+'_position')){var gt_F=parseInt(gt_t(id+'_child').offsetHeight);var gt_G=parseInt(gt_t(id+'_child').offsetWidth);var gt_T=parseInt(gt_t(id).offsetHeight);var gt_U=parseInt(gt_t(id).offsetWidth);if(direction==0||direction==1){gt_t(id+'_child').style.top=0+'px';}else{gt_t(id+'_child').style.top=gt_T-gt_F+'px';}if(direction==0||direction==2){gt_t(id+'_child').style.left=0+'px';}else{gt_t(id+'_child').style.left=gt_U-gt_G+'px';}}};function gt_a(gt_av,type,gt_az){if(typeof(gt_az)=='undefined'){gt_az=0};var gt_bm,gt_bn;if(type==1||type==3){gt_bm=document.body.clientWidth-178;}else{gt_bm=5;}if(type==2||type==3){gt_bn=document.body.clientHeight;}else{gt_bn=0;}if(document.body.clientWidth<1250){gt_bm=-183};window.gt_bo=function(gt_aD,type,gt_az){var gt_bm,gt_bn;var gt_aZ=(navigator.appName.indexOf("Netscape")!=-1);if(type==1||type==3){gt_bm=document.body.clientWidth-183;}else{gt_bm=5;}if(document.body.clientWidth<1250){gt_aD.style.display='none';}else{gt_aD.style.display='';if(document.documentElement&&document.documentElement.scrollTop)var gt_bd=gt_aZ?pageYOffset:document.documentElement.scrollTop;else if(document.body)var gt_bd=gt_aZ?pageYOffset:document.body.scrollTop;if(type==2||type==3){if(document.documentElement&&document.documentElement.clientHeight)gt_bn=document.documentElement.clientHeight-288;else if(document.body)gt_bn=document.body.clientHeight-288;}else{if(document.body.scrollTop>71){gt_bn=3}else{gt_bn=71-document.body.scrollTop};}gt_aD.y+=(gt_bd+gt_bn-gt_aD.y)/8;gt_aD.style.left=gt_bm+'px';gt_aD.style.top=gt_aD.y+gt_az+'px';}setTimeout(function(){gt_bo(gt_aD,type,gt_az)},15);};var gt_aD=gt_t(gt_av);if(!gt_aD)return;gt_aD.x=gt_bm;gt_aD.y=gt_bn;gt_bo(gt_aD,type,gt_az);};function expandselfbanner(gt_ac,gt_aU,gt_aT){gt_t(gt_ac).style.zIndex="120";gt_t(gt_ac+'_status').value=1;if(gt_t(gt_ac+'_directionfix')){var gt_bq=gt_t(gt_ac+'_child').style.top;var gt_aR=gt_t(gt_ac+'_child').style.left;gt_t(gt_ac).style.height=gt_aT+'px';gt_t(gt_ac).style.width=gt_aU+'px';gt_t(gt_ac).style.top=gt_bq;gt_t(gt_ac).style.left=gt_aR;gt_t(gt_ac+'_child').style.top='0px';gt_t(gt_ac+'_child').style.left='0px';}else{if(gt_t(gt_ac+'_position')){gt_t(gt_ac).style.height=gt_aT+'px';gt_t(gt_ac).style.width=gt_aU+'px';gt_z(gt_ac);gt_s(gt_ac);return;}var gt_C=parseInt(gt_t(gt_ac).offsetHeight);var gt_D=parseInt(gt_t(gt_ac).offsetWidth);if((gt_C<gt_aT-10)||(gt_D<gt_aU-10)){if(gt_C<gt_aT-10){gt_t(gt_ac).style.height=gt_C+10+'px';}else{gt_t(gt_ac).style.height=gt_aT+'px';}if(gt_D<gt_aU-10){gt_t(gt_ac).style.width=gt_D+10+'px';}else{gt_t(gt_ac).style.width=gt_aU+'px';}gt_z(gt_ac);gt_s(gt_ac);setTimeout(function(){expandselfbanner(gt_ac,gt_aU,gt_aT)},5);return;}else{gt_t(gt_ac).style.height=gt_aT+'px';gt_t(gt_ac).style.width=gt_aU+'px';gt_z(gt_ac);gt_s(gt_ac);}}};function collapselfbanner(gt_ac,gt_aU,gt_aT){gt_t(gt_ac).style.zIndex="100";if(gt_t(gt_ac+'_directionfix')){var gt_br=gt_t(gt_ac).style.top;var gt_aS=gt_t(gt_ac).style.left;gt_t(gt_ac).style.height=gt_aT+'px';gt_t(gt_ac).style.width=gt_aU+'px';gt_t(gt_ac).style.top='0px';gt_t(gt_ac).style.left='0px';gt_t(gt_ac+'_child').style.top=gt_br;gt_t(gt_ac+'_child').style.left=gt_aS;}else{if(gt_t(gt_ac+'_position')){gt_t(gt_ac).style.height=gt_aT+'px';gt_t(gt_ac).style.width=gt_aU+'px';gt_z(gt_ac);gt_s(gt_ac);return;}var gt_C=parseInt(gt_t(gt_ac).offsetHeight);var gt_D=parseInt(gt_t(gt_ac).offsetWidth);if((gt_C>gt_aT+10)||(gt_D>gt_aU+10)){if(gt_C>gt_aT+10){gt_t(gt_ac).style.height=gt_C-10+'px';}else{gt_t(gt_ac).style.height=gt_aT+'px';}if(gt_D>gt_aU+10){gt_t(gt_ac).style.width=gt_D-10+'px';}else{gt_t(gt_ac).style.width=gt_aU+'px';}gt_z(gt_ac);gt_s(gt_ac);setTimeout(function(){collapselfbanner(gt_ac,gt_aU,gt_aT)},5);return;}else{gt_t(gt_ac).style.height=gt_aT+'px';gt_t(gt_ac).style.width=gt_aU+'px';gt_z(gt_ac);gt_s(gt_ac);gt_t(gt_ac+'_status').value=0;}}};function gt_y(gt_bb,index,gt_ac,gt_al,gt_aU,gt_aT){var gt_aD=gt_t(gt_ac);if(!gt_aD)return;var gt_bd=parseInt(gt_aD.style.top);gt_bd=gt_bd-Math.round(parseInt(gt_aD.style.top)/8)-1;if(gt_bd>0){gt_aD.style.top=gt_bd;setTimeout(function(){gt_y(gt_bb,index,gt_ac,gt_al,gt_aU,gt_aT)},10);}else{gt_aD.style.top=0;setTimeout(function(){gt_p(gt_bb,index,gt_ac,gt_al,gt_aU,gt_aT)},gt_al);}};function gt_p(gt_bb,index,gt_ac,gt_al,gt_aU,gt_aT){var gt_aD=gt_t(gt_ac);if(!gt_aD)return;var gt_bd=parseInt(gt_aD.style.top);gt_bd=gt_bd+Math.round((gt_aT-parseInt(gt_aD.style.top))/8)+1;if(gt_bd<gt_aT){gt_aD.style.top=gt_bd;setTimeout(function(){gt_p(gt_bb,index,gt_ac,gt_al,gt_aU,gt_aT)},10);}else{gt_aD.style.top=gt_aT;if(index==gt_bb.length-1){index=0;}else{index++;}gt_t(gt_ac).innerHTML=gt_h(gt_bb[index],gt_aU,gt_aT);setTimeout(function(){gt_y(gt_bb,index,gt_ac,gt_al,gt_aU,gt_aT)},5000);}};function gt_h(gt_bb,gt_aU,gt_aT,gt_ag,zoneid){if(!gt_bb){return ''}var gt_bj='';var gt_bh=(gt_c(gt_bb[0],7).toLowerCase()=='http://')?gt_bb[0]:gt_J.concat(gt_bb[0]);if(typeof(gt_ag)=="undefined")gt_ag=true;var gt_aN=(gt_aU<gt_bb[3]&&gt_aU>0&&gt_ag)?gt_aU:gt_bb[3];var gt_aM=(gt_aT<gt_bb[4]&&gt_aT>0&&gt_ag)?gt_aT:gt_bb[4];if(gt_bb[0].toLowerCase().indexOf('ngoisao_extendbanner')>0&&gt_bb[1].toLowerCase()=='http://gamethu.net'){gt_bj=gt_bj.concat('<IFRAME MARGINWIDTH="0" MARGINHEIGHT="0" HSPACE="0" VSPACE="0" FRAMEBORDER="0" SCROLLING="no" ');gt_bj=gt_bj.concat(' WIDTH="').concat(gt_bb[3]).concat('" HEIGHT="').concat(gt_bb[4]).concat('" ');gt_bj=gt_bj.concat(' SRC="/Customize/ExtendBanner/').concat(Trim(gt_bb[2].split(',')[12])).concat('.htm"></IFRAME>');}else{if(gt_e(gt_bb[0],4).toLowerCase()=='.swf'){gt_bj=gt_bj.concat('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" border="0" width=').concat(gt_aN).concat(' height=').concat(gt_aM).concat('>');gt_bj=gt_bj.concat('<param name="movie" value="').concat(gt_bh).concat('?link=').concat(escape(gt_g(gt_bb[2].substring(gt_bb[2].lastIndexOf(',')+2),gt_bb[1],false))).concat('&zoneid=').concat(zoneid).concat('">');gt_bj=gt_bj.concat('<param name="AllowScriptAccess" value="always">');gt_bj=gt_bj.concat('<param name="quality" value="High">');gt_bj=gt_bj.concat('<param name="wmode" value="transparent">');gt_bj=gt_bj.concat('<embed src="').concat(gt_bh).concat('?link=').concat(escape(gt_g(gt_bb[2].substring(gt_bb[2].lastIndexOf(',')+2),gt_bb[1],false))).concat('&zoneid=').concat(zoneid).concat('" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" AllowScriptAccess="always" width=').concat(gt_aN).concat(' height=').concat(gt_aM).concat('>');gt_bj=gt_bj.concat('</object>');}else{if(gt_bb[1]!=''){gt_bj='<img src="'.concat(gt_bh).concat('" onClick="return gt_v(\'').concat(gt_bb[1]).concat('\', ').concat(gt_bb[2]).concat(', 1)" style="cursor:pointer;" border=0 width=').concat(gt_aN).concat(' height=').concat(gt_aM).concat('>');}else{gt_bj='<img src="'.concat(gt_bh).concat('" border=0 width=').concat(gt_aN).concat(' height=').concat(gt_aM).concat('>');}}}return gt_bj;};adlistshow.prototype.gt_af=function(gt_bb){var gt_ae=false;var gt_aF;if(this.gt_bl==8){gt_aF=gt_bb[9];}else{gt_aF=gt_bb[6];}if(gt_aF==3&&this.gt_ah<4)gt_ae=true;else if(gt_aF==this.gt_ah||gt_aF==0)gt_ae=true;if(gt_ae&&this.gt_bl==7){gt_ae=false;if(typeof(gt_ax)=='undefined')return;var gt_aw=new Date(gt_bb[7]);var gt_ay=new Date(gt_bb[8]);var gt_aG=(gt_ax.getTime()-gt_aw.getTime())/1000;var gt_aJ=(gt_ay.getTime()-gt_ax.getTime())/1000;if(gt_aG<5*86400&&gt_aG>=0&&gt_aJ>5*86400&&gt_aJ>=0){gt_ae=true;}}return gt_ae;};function gt_x(){return(Math.random()*10000)-5000;};function gt_w(gt_bA,vLink,gt_bI,gt_bG,gt_bM,gt_bx,gt_bL,gt_bC,gt_by){if(typeof(gt_by)=='undefined'){gt_by=false;}if(gt_by){var gt_be=open('/Library/PopupUnder.Aspx?gt_bA='.concat(escape(gt_bA)).concat('&vLink=').concat(escape(vLink)).concat('&gt_bI=').concat(escape(gt_bI)),'Popup_'.concat(gt_d(gt_bI,' ','_')),'status=no,resizable=no,scrollbars='.concat(gt_bG).concat(',toolbar=no,location=no,fullscreen=no,titlebar=no,height=').concat(gt_bx).concat(',').concat('width=').concat(gt_bM).concat(',').concat('top=').concat(0).concat(',').concat('left=').concat(0));var gt_O=vLink;window.focus();if(gt_be){gt_be.blur()};return gt_be;}else{return open('/Library/Popup.Aspx?gt_bA='.concat(escape(gt_bA)).concat('&vLink=').concat(escape(vLink)).concat('&gt_bI=').concat(escape(gt_bI)),'Popup_'.concat(gt_d(gt_bI,' ','_')),'status=no,resizable=no,scrollbars=no,toolbar=no,location=no,fullscreen=no,titlebar=yes,height='.concat(gt_bx).concat(',').concat('width=').concat(gt_bM).concat(',').concat('top=').concat(gt_bL).concat(',').concat('left=').concat(gt_bC));}};function gt_v(vLink,gt_bH,gt_bF,gt_bG,gt_bK,gt_bD,gt_bw,gt_bJ,gt_bu,gt_bx,gt_bM,gt_bL,gt_bC,gt_bz,gt_bv){var gt_bi=(typeof(vLink.href)=='undefined')?vLink:vLink.href;gt_bN='';gt_bN=gt_bN.concat('status=').concat((gt_bH)?'yes':'no').concat(',');gt_bN=gt_bN.concat('resizable=').concat((gt_bF)?'yes':'no').concat(',');gt_bN=gt_bN.concat('scrollbars=').concat((gt_bG)?'yes':'no').concat(',');gt_bN=gt_bN.concat('toolbar=').concat((gt_bK)?'yes':'no').concat(',');gt_bN=gt_bN.concat('location=').concat((gt_bD)?'yes':'no').concat(',');gt_bN=gt_bN.concat('fullscreen=').concat((gt_bw)?'yes':'no').concat(',');gt_bN=gt_bN.concat('titlebar=').concat((gt_bJ)?'yes':'no').concat(',');gt_bN=gt_bN.concat('height=').concat(gt_bx-140).concat(',');gt_bN=gt_bN.concat('width=').concat(gt_bM).concat(',');if(gt_bu){gt_bN=gt_bN.concat('top=').concat((screen.height-gt_bx)/2).concat(',');gt_bN=gt_bN.concat('left=').concat((screen.width-gt_bM)/2);}else{gt_bN=gt_bN.concat('top=').concat(gt_bL).concat(',');gt_bN=gt_bN.concat('left=').concat(gt_bC);}if(typeof(gt_bv)=='undefined'){gt_bv=0;}if(typeof(gt_bz)=='undefined'){gt_bz=0;}if(gt_bv){gt_bi=gt_g(gt_bz,gt_bi,true);}open(gt_bi,'_blank',gt_bN);if(typeof(vLink.href)!='undefined'){return false;}};function gt_g(gt_bz,vLink,gt_bE){if(gt_bE==true){return 'http://gamethu.vnexpress.net/Service/Counter/?n='.concat(gt_bz).concat('&u=').concat(escape(vLink)).concat('&r=').concat(Math.random());}else{return 'http://gamethu.vnexpress.net/Service/Counter/?n='.concat(gt_bz).concat('&u=').concat(escape(vLink));}};function gt_b(gt_av,type,gt_az){if(typeof(gt_az)=='undefined'){gt_az=0};var gt_bm,gt_bn;if(type==1){gt_bm=document.body.clientWidth-115;}else{gt_bm=5;}if(type==2){gt_bn=document.body.clientHeight;}else{gt_bn=0;}if(document.body.clientWidth<980){gt_bm=-115};window.gt_bo=function(gt_aD,type,gt_az){var gt_bm,gt_bn;var gt_aZ=(navigator.appName.indexOf("Netscape")!=-1);if(type==1){gt_bm=document.body.clientWidth-115;}else{gt_bm=5;}if(document.body.clientWidth<980){gt_aD.style.display='none';}else{gt_aD.style.display='';if(document.documentElement&&document.documentElement.scrollTop)var gt_bd=gt_aZ?pageYOffset:document.documentElement.scrollTop;else if(document.body)var gt_bd=gt_aZ?pageYOffset:document.body.scrollTop;if(type==2){gt_bn=document.body.clientHeight-183;}else{if(document.body.scrollTop>71){gt_bn=3}else{gt_bn=71-document.body.scrollTop};}gt_aD.y+=(gt_bd+gt_bn-gt_aD.y)/8;gt_aD.style.left=gt_bm;gt_aD.style.top=gt_aD.y+gt_az;}setTimeout(function(){gt_bo(gt_aD,type,gt_az)},15);};var gt_aD=gt_t(gt_av);if(!gt_aD)return;gt_aD.x=gt_bm;gt_aD.y=gt_bn;gt_bo(gt_aD,type,gt_az);};function gt_t(gt_aW){if(document.getElementById){m=document.getElementById(gt_aW)}else if(document.all){m=document.all[gt_aW]}else if(document.layers){m=document[gt_aW]}return m;};function gt_u(gt_bb,gt_bc){var p=gt_bc?gt_bc.slice(0):[0,0];while(gt_bb){p[0]+=gt_bb.offsetLeft;p[1]+=gt_bb.offsetTop;if(gt_bb.tagName.toUpperCase()=="BODY")break;gt_bb=gt_bb.offsetParent;}return p;};function gt_c(gt_bp,n){if(n<=0)return "";else if(n>String(gt_bp).length)return gt_bp;else return String(gt_bp).substring(0,n);};function gt_e(gt_bp,n){if(n<=0)return "";else if(n>String(gt_bp).length)return gt_bp;else{var gt_aH=String(gt_bp).length;return String(gt_bp).substring(gt_aH,gt_aH-n);}};function gt_d(gt_aI,gt_bs,gt_bt){var i=0,gt_ba='',j=gt_bs.length;while(i<gt_aI.length){if(gt_aI.substr(i,j)==gt_bs){gt_ba+=gt_bt;i+=j}else{gt_ba+=gt_aI.charAt(i);i++;}}return gt_ba;}/**
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;﻿//alert('');
function showpoint(subjectid, pageid, pointid, template) {
    var arItem = new Array();
    var hexId = Hexa(pointid)
    var sLink = ''
    sLink = '/ListFile/Point/'.concat(hexId.substring(0, 2)).concat('/').concat(hexId.substring(2, 4)).concat('/').concat(hexId.substring(4, 6)).concat('/').concat(hexId.substring(6, 8)).concat('/');
    sLink += Hexa(subjectid) + Right(Hexa(pageid), 4) + '.xml';
    AjaxRequest.get(
		{
		    'url': sLink
		, 'onSuccess': function(req) {
		    with (req.responseXML) {
		        arItem[0] = parseFloat(getNodeValue(getElementsByTagName('O'))).toFixed(1);
		        arItem[1] = parseInt(getNodeValue(getElementsByTagName('P1')));
		        arItem[2] = parseInt(getNodeValue(getElementsByTagName('P2')));
		        arItem[3] = parseInt(getNodeValue(getElementsByTagName('P3')));
		        arItem[4] = parseInt(getNodeValue(getElementsByTagName('P4')));
		        arItem[5] = parseInt(getNodeValue(getElementsByTagName('P5')));
		        arItem[6] = parseInt(getNodeValue(getElementsByTagName('P6')));
		        arItem[7] = parseInt(getNodeValue(getElementsByTagName('P7')));
		        arItem[8] = parseInt(getNodeValue(getElementsByTagName('P8')));
		        arItem[9] = parseInt(getNodeValue(getElementsByTagName('P9')));
		        arItem[10] = parseInt(getNodeValue(getElementsByTagName('P10')));
		        arItem[11] = parseInt(getNodeValue(getElementsByTagName('C')));
		    }
		    gmobj('PointContent' + pointid).innerHTML = getpoint(subjectid, pageid, pointid, arItem);
		    gmobj('PointContentMark' + pointid).innerHTML = getMark(subjectid, pageid, pointid, arItem);
		}
		, 'onError': function(req) {
		    arItem[0] = '0.0';
		    arItem[1] = 0;
		    arItem[2] = 0;
		    arItem[3] = 0;
		    arItem[4] = 0;
		    arItem[5] = 0;
		    arItem[6] = 0;
		    arItem[7] = 0;
		    arItem[8] = 0;
		    arItem[9] = 0;
		    arItem[10] = 0;
		    arItem[11] = 0;
		    gmobj('PointContent' + pointid).innerHTML = getpoint(subjectid, pageid, pointid, arItem);
		    gmobj('PointContentMark' + pointid).innerHTML = getMark(subjectid, pageid, pointid, arItem);
		}
		}
	)
}

function getpoint(subjectid, pageid, pointid, arItem) {

    var sHTML = '<div class="FontMesagePoint">Điểm Game</div>', iMax = 0, iHeight, iMaxHeight = 38;
    sHTML +='<div class="FontPont">';
    for (var i = 1; i <= 10; i++) {
        if (arItem[i] > iMax) { iMax = arItem[i] };
    }
    if (arItem[0] == '10.0') { arItem[0] = '10' };
    if (arItem[0] == '0.0') {
        sHTML += '0';
    }
    else {
        for (var i = 0; i < arItem[0].length; i++) {
            if (arItem[0].charAt(i) == '.') {
                sHTML += '.';
            }
            else {
                sHTML += arItem[0].charAt(i);
            }
            if (i < arItem[0].length - 1) sHTML += '';
        }
    }
    sHTML +='</div>';
    return sHTML;
}

function getMark(subjectid, pageid, pointid, arItem) {
    var sHTML = '', iMax = 0, iHeight, iMaxHeight = 38;
    var sHTML = '<div class="FontMesagePoint" style="padding-bottom:9px">Tổng số: '+ arItem[11] +' lượt</div>';
    for (var i = 1; i <= 10; i++) {
        if (arItem[i] > iMax) { iMax = arItem[i] };
    }
    if (arItem[0] == '10.0') { arItem[0] = '10' };
    sHTML = sHTML += '<div id="PointDetail' + pointid + '" style="text-align:center;">';
    sHTML = sHTML += '	<div style="width:91px;margin:auto;">';
    sHTML = sHTML += '	<div style="float:left;width:91px;">';
    for (var i = 1; i <= 10; i++) {
        if (iMax == 0 || arItem[i] == 0) {
            iHeight = 1;
        } else {
            iHeight = parseInt(iMaxHeight * arItem[i] / iMax);
            if (iHeight == 0) iHeight = 1;
        }
        sHTML = sHTML += '		<div style="width:8px;float:left;height:' + iHeight + 'px;margin-top:' + (iMaxHeight - iHeight) + 'px;background:#147611;overflow:hidden"></div>';
        if (i < 10) sHTML = sHTML += '		<div style="width:1px;float:left;height:' + iMaxHeight + 'px;"></div>';
    }
    sHTML = sHTML += '	</div>';
    sHTML = sHTML += '	<div style="float:left;width:91px;padding-top:0px;height:15px;overflow:hidden">';
    for (var i = 1; i <= 10; i++) {
        sHTML = sHTML += '		<div style="width:8px;float:left;color:#147611;font-weight:100;font-size:9px;">' + i + '</div>';
        if (i < 10) sHTML = sHTML += '		<div style="width:1px;float:left;overflow:hidden">&nbsp;</div>';
    }
    sHTML = sHTML += '	</div>';
    return sHTML;

}

function CheckMarkNumber(iNumber)
{
	for(var i=1;i<=10;i++)
	{
		if(i==iNumber)
		{
			document.getElementById("img"+i).src='/images/point/check1.gif';
		}
		else
		{
			document.getElementById("img"+i).src='/images/point/check.jpg';
		}
	}
	document.getElementById("fPointfor").value=iNumber;
}

/*function submitpoint(sform) {
    open('', sform.name, 'scrollbars=yes,resizeable=no,locationbar=no,width=500px,height=250px,left='.concat((screen.width - 500) / 2).concat(',top=').concat((screen.height - 250) / 2));
    sform.action = '/User/Point/Default.Aspx';
    sform.submit();
}*/
function submitpoint(sform) {
var status = AjaxRequest.submit(
sform,
{
'onSuccess':function(req){alert(req.responseText);},
'onError':function(req){alert(req.responseText);}});
return status; 


}

﻿// JavaScript Document
var menu_fid = new Array(
	1, 	//Home		/GT/Home
	2, 	//Diem tin		/GT/Diem-tin
	3, 	//Sap choi		/GT/Sap-choi
	4, 	//Dang choi		/GT/Dang-choi
	5, 	//Alo game		/GT/Alo-game
	6, 	//Chien Tranh	/GT/Game-moi/Chien-tranh
	7, 	//Hanh Dong	/GT/Game-moi/Hanh-dong
	8, 		//The thao		/GT/Game-moi/The-thao
	9, 		//Chien thuat	/GT/Game-moi/Chien-thuat
	10, 	//Chuyen lang game	/GT/Chuyen-game
	11, 	//Flash game	/GT/Flash-game
	12, 	//Game moi		/GT/Game-moi
	13, 	//Cong nghe		/GT/Cong-nghe
	14, 	//Trac nghiem	/GT/Trac-nghiem
	17, 	//Tu lieu		/GT/Tu-lieu
	18, 	//Hinh anh		/GT/Hinh-anh
	19, 	//Hinh game		/GT/Hinh-anh/Hinh-game
	20, 	//Hinh Game thu	/GT/Hinh-anh/Hinh-game-thu
	21, 	//Ban doc viet	/GT/Ban-doc-viet
	9997, 	//Phong van truc tuyen	/User/Interview
	9999, 	//Topic		/Topic
	10000, 	//Search		/Search
	10001, 	//Contact us	/ContactUs
	10002, 	//Advertisment	/Advertising
	10003	//RSS		/RSS
);
var menu_name = new Array(
	'Home',
	'Điểm tin',
	'Sắp chơi',
	'Đang chơi',
	'Alo Game',
	'Chiến tranh',
	'Hành Động',
	'Thể Thao',
	'Chiến thuật',
	'Chuyện làng game',
	'Flash Game',
	'Game mới',
	'Công nghệ',
	'Trắc nghiệm',
	'Tư liệu',
	'Hình ảnh',
	'Hình Game',
	'Hình Game thủ',
	'Bạn đọc viết',
	'Phóng vấn trực tuyến',
	'Topic',
	'Search',
	'Contact us',
	'Advertisment',
	'RSS'
);
var menu_uname = new Array(
	'HOME',
	'ĐIỂM TIN',
	'SẮP CHƠI',
	'ĐANG CHƠI',
	'ALO GAME',
	'CHIẾN TRANH',
	'HÀNH ĐỘNG',
	'THỂ THAO',
	'CHIẾN THUẬT',
	'CHUYỆN LÀNG GAME',
	'FLASH GAME',
	'GAME MỚI',
	'CÔNG NGHỆ',
	'TRẮC NGHIỆM',
	'TƯ LIỆU',
	'HÌNH ẢNH',
	'HÌNH GAME',
	'HÌNH GAME THỬ',
	'BẠN ĐỌC VIẾT',
	'PHÓNG VẤN TRỰC TUYẾN',
	'TOPIC',
	'SEARCH',
	'CONTACT US',
	'ADVERTISMENT',
	'RSS'
);
var menu_path = new Array(
	'/GT/Home/',
	'/GT/Diem-tin/',
	'/GT/Sap-choi/',
	'/GT/Dang-choi/',
	'/GT/Alo-game/',
	'/GT/Game-moi/Chien-tranh/',
	'/GT/Game-moi/Hanh-dong/',
	'/GT/Game-moi/The-thao/',
	'/GT/Game-moi/Chien-thuat/',
	'/GT/Chuyen-game/',
	'/GT/Flash-game/',
	'/GT/Game-moi/',
	'/GT/Cong-nghe/',
	'/GT/Trac-nghiem/',
	'/GT/Tu-lieu/',
	'/GT/Hinh-anh/',
	'/GT/Hinh-anh/Hinh-game/',
	'/GT/Hinh-anh/Hinh-game-thu/',
	'/GT/Ban-doc-viet/',
	'/User/Interview/',
	'/Topic/',
	'/Search/',
	'/ContactUs/',
	'/Advertising/',
	'/RSS/'
);
var menu_show = new Array(
	0, //Home		/GT/Home
	0, //Diem tin		/GT/Diem-tin
	0, //Sap choi		/GT/Sap-choi
	0, //Dang choi		/GT/Dang-choi
	0, //Alo game		/GT/Alo-game
	0, //Chien Tranh	/GT/Game-moi/Chien-tranh
	0, //Hanh Dong	/GT/Game-moi/Hanh-dong
	0, //The thao		/GT/Game-moi/The-thao
	0, //Chien thuat	/GT/Game-moi/Chien-thuat
	0, //Chuyen lang game	/GT/Chuyen-game
	0, //Flash game	/GT/Flash-game
	0, //Game moi		/GT/Game-moi
	0, //Cong nghe		/GT/Cong-nghe
	0, //Trac nghiem	/GT/Trac-nghiem
	0, //Tu lieu		/GT/Tu-lieu
	0, //Hinh anh		/GT/Hinh-anh
	0, //Hinh game		/GT/Hinh-anh/Hinh-game
	0, //Hinh Game thu	/GT/Hinh-anh/Hinh-game-thu
	0, //Ban doc viet	/GT/Ban-doc-viet
	0, //Phong van truc tuyen	/User/Interview
	0, //Topic		/Topic
	0, //Search		/Search
	0, //Contact us	/ContactUs
	0, //Advertisment	/Advertising
	0	//RSS		/RSS
);
var menu_pid = new Array(
	0, //Home		/GT/Home
	0, //Diem tin		/GT/Diem-tin
	0, //Sap choi		/GT/Sap-choi
	0, //Dang choi		/GT/Dang-choi
	0, //Alo game		/GT/Alo-game
	12, //Chien Tranh	/GT/Game-moi/Chien-tranh
	12, //Hanh Dong	/GT/Game-moi/Hanh-dong
	12, //The thao		/GT/Game-moi/The-thao
	12, //Chien thuat	/GT/Game-moi/Chien-thuat
	0, //Chuyen lang game	/GT/Chuyen-game
	0, //Flash game	/GT/Flash-game
	0, //Game moi		/GT/Game-moi
	0, //Cong nghe		/GT/Cong-nghe
	0, //Trac nghiem	/GT/Trac-nghiem
	0, //Tu lieu		/GT/Tu-lieu
	0, //Hinh anh		/GT/Hinh-anh
	18, //Hinh game		/GT/Hinh-anh/Hinh-game
	18, //Hinh Game thu	/GT/Hinh-anh/Hinh-game-thu
	0, //Ban doc viet	/GT/Ban-doc-viet
	0, //Phong van truc tuyen	/User/Interview
	0, //Topic		/Topic
	0, //Search		/Search
	0, //Contact us	/ContactUs
	0, //Advertisment	/Advertising
	0	//RSS		/RSS
);
var submenu = new Array(menu_pid.length);
var activeid;
var delay_hide = 500;
var menuobj;

function writeFolderTitle(i) {
    //alert(i);
    var j;
    var strTitle = '';
    for (j = 0; j < menu_pid.length; j++) {
        if (menu_fid[j] == i && menu_pid[j] == 0) {
            //strTitle = strTitle.concat('<span class="parentfolder-title fl">');
            strTitle = strTitle.concat('<a href="').concat(menu_path[j]).concat('" onFocus="this.blur()" style="color:#C1C1C1;text-decoration:none;">').concat(menu_uname[j]).concat('</a>');
            //strTitle = strTitle.concat('</span>');    
            break;
        }
        else if (menu_fid[j] == i && menu_pid[j] != 0) {
            var k;
            for (k = 0; k < menu_pid.length; k++) {
                if (menu_fid[k] == menu_pid[j]) {
                    //strTitle = strTitle.concat('<span class="parentfolder-title fl">');
                    strTitle = strTitle.concat('<a href="').concat(menu_path[k]).concat('" onFocus="this.blur()">').concat(menu_uname[k]).concat('</a>');
                    //strTitle = strTitle.concat('</span>');  
                    break;
                }
            }
            //strTitle = strTitle.concat('<span class="subfolder-title fl">');
            strTitle = strTitle.concat('&nbsp; > &nbsp;<a href="').concat(menu_path[j]).concat('" onFocus="this.blur()">').concat(menu_name[j]).concat('</a>');
            //strTitle = strTitle.concat('</span>'); 
            break;
        }
    }
    document.write(strTitle);
}

function Active() {
    var i, j;
    for (i = 0; i < menu_pid.length; i++) {
        if (menu_fid[i] == PAGE_FOLDER && menu_pid[i] == 0) {
            activeid = i;
            break;
        }
        else if (menu_fid[i] == PAGE_FOLDER && menu_pid[i] != 0) {
            for (j = 0; j < menu_pid.length; j++) {
                if (menu_fid[j] == menu_pid[i]) {
                    activeid = j;
                    break;
                }
            }
            break;
        }
    }
}

function writeParentMenu() {
    var strParent = '';
    var strSep = '<div class="fl" style="width:1px;font-size:1px"><img src="/Images/Menu/sep-pmenu.gif" alt="" /></div>';
    var i;
    var url = '';
    for (i = 0; i < menu_pid.length; i++) {
        url = (PAGE_FOLDER >= 9998 && PAGE_FOLDER != 10000 && PAGE_FOLDER != 10001) ? 'http://vnexpress.net' + menu_path[i] : menu_path[i];
        if (menu_pid[i] == 0) {
            if (menu_fid[i] == 1) {
                strParent = strParent.concat('<div class="fl"><img src="/Images/Menu/sep-pmenu.gif" alt="" /></div>');
                strParent = strParent.concat('<div class="pmenu-sep fl">&nbsp;</div>');
            }
            if (menu_fid[i] == PAGE_FOLDER) {
                strParent = strParent.concat('<div class="fl" onMouseover="activeMenu(').concat(i).concat(');showit(').concat(i).concat(',1);" onMouseout="deactiveMenu(').concat(i).concat(');reWriteMenu();" onClick=goTo("').concat(url).concat('")>');
                strParent = strParent.concat('<div id="mn').concat(i).concat('_l" class="pmenu-activeleft fl">&nbsp;</div>');
                strParent = strParent.concat('<div id="mn').concat(i).concat('" class="pmenu-active fl">').concat(menu_name[i]).concat('</div>');
                strParent = strParent.concat('<div id="mn').concat(i).concat('_r" class="pmenu-activeright fl">&nbsp;</div>');
                strParent = strParent.concat('</div>');
                strParent = strParent.concat(strSep);
            }
            else {
                strParent = strParent.concat('<div class="fl" onMouseover="activeMenu(').concat(i).concat(');showit(').concat(i).concat(',1);" onMouseout="deactiveMenu(').concat(i).concat(');reWriteMenu();" onClick=goTo("').concat(url).concat('")>');
                strParent = strParent.concat('<div id="mn').concat(i).concat('_l" class="pmenu-normalleft fl">&nbsp;</div>');
                strParent = strParent.concat('<div id="mn').concat(i).concat('" class="pmenu-normal fl">').concat(menu_name[i]).concat('</div>');
                strParent = strParent.concat('<div id="mn').concat(i).concat('_r" class="pmenu-normalright fl">&nbsp;</div>');
                strParent = strParent.concat('</div>');
                strParent = strParent.concat(strSep);
            }
            writeSubMenu(menu_fid[i], i);
        }
        else {
            break;
        }
    }
    strParent = strParent.substr(0, strParent.length - strSep.length);
    gmobj("parent-menu").innerHTML = strParent;
}

function writeSubMenu(p, k) {
    var strSubMenu = '';
    var strSep = '&nbsp;&nbsp;<img src="/Images/Menu/square.gif" alt=""/>&nbsp;&nbsp;';
    var i;
    var j = 0;
    var url = '';
    for (i = 0; i < menu_pid.length; i++) {
        url = (PAGE_FOLDER >= 9998 && PAGE_FOLDER != 10000 && PAGE_FOLDER != 10001) ? 'http://vnexpress.net' + menu_path[i] : menu_path[i];
        if (menu_pid[i] == p && menu_show[i] == 0) {
            if (j == 0) {
                strSubMenu = strSubMenu.concat('<img src="/Images/Menu/square.gif" border="0"/>&nbsp;&nbsp;');
                if (menu_fid[i] < 1000) {
                    strSubMenu = strSubMenu.concat('<a class="link-submenu" href="').concat(url).concat('">').concat(menu_name[i]).concat('</a>');
                }
                else {
                    strSubMenu = strSubMenu.concat('<a class="link-submenu" href="').concat(url).concat('" target="_blank"').concat(menu_name[i]).concat('</a>');
                }
                strSubMenu = strSubMenu.concat(strSep);
            }
            else {
                if (menu_fid[i] < 1000 && menu_fid[i] != 106 && menu_fid[i] != 148) {
                    strSubMenu = strSubMenu.concat('<a class="link-submenu" href="').concat(url).concat('">').concat(menu_name[i]).concat('</a>');
                    strSubMenu = strSubMenu.concat(strSep);
                }
                else if (menu_fid[i] >= 1000) {
                    strSubMenu = strSubMenu.concat('<a class="link-submenu" href="').concat(url).concat('" target="_blank">').concat(menu_name[i]).concat('</a>');
                    strSubMenu = strSubMenu.concat(strSep);
                }
            }
            j += 1;
        }
    }
    strSubMenu = strSubMenu.substr(0, strSubMenu.length - strSep.length);
    if (strSubMenu == '') { submenu[k] = '&nbsp;' }
    else { submenu[k] = strSubMenu; }
}

function writeCurrentMenu() {
    var strSubMenu = '';
    var i, j;
    for (i = 0; i < menu_pid.length; i++) {
        if (menu_fid[i] == PAGE_FOLDER && menu_pid[i] == 0) {
            activeMenu(i);
            //gmobj('submenu').innerHTML = submenu[i];
            showit(i, 0);
            break;
        }
        else if (menu_fid[i] == PAGE_FOLDER && menu_pid[i] != 0) {
            var flag = false;
            for (j = 0; j < menu_pid.length; j++) {
                if (menu_fid[j] == menu_pid[i]) {
                    activeMenu(j);
                    //gmobj('submenu').innerHTML = submenu[j];
                    showit(j, 0);
                    flag = true;
                    break;
                }
            }
            if (flag == true) break;
        }
        else {
            deactiveMenu(activeid);
            menuobj.innerHTML = '';
        }
    }
}

function writeFooterMenu() {
    var sHTML = '';
    var strSep = '&nbsp;&nbsp;|&nbsp;&nbsp;';
    var i;
    for (i = 0; i < menu_pid.length; i++) {
        if (menu_pid[i] == 0 && menu_fid[i] != 1) {
            sHTML = sHTML.concat('<a class="link-footermenu" href="').concat(menu_path[i]).concat('">').concat(menu_name[i]).concat('</a>');
            sHTML = sHTML.concat(strSep);
        }
        else {
            continue;
        }
    }
    sHTML = sHTML.substr(0, sHTML.length - strSep.length);
    document.write(sHTML);
}

function activeMenu(i) {
    if (i >= 0 && !isNaN(i)) {
        if (i != activeid && activeid != -1) {
            deactiveMenu(activeid);
            activeid = i;
        }
        gmobj('mn' + i).className = 'pmenu-active fl';
        gmobj('mn' + i + '_l').className = 'pmenu-activeleft fl';
        gmobj('mn' + i + '_r').className = 'pmenu-activeright fl';
    }
}

function deactiveMenu(i) {
    if (i >= 0 && !isNaN(i)) {
        gmobj('mn' + i).className = 'pmenu-normal fl';
        gmobj('mn' + i + '_l').className = 'pmenu-normalleft fl';
        gmobj('mn' + i + '_r').className = 'pmenu-normalright fl';
    }
}

function activeMenuParent() {
    activeMenu(activeid);
}

function showit(which, type) {
    clear_delayhide()
    thecontent = (which == -1) ? "" : submenu[which];

    switch (parseInt(which)) {
        case 5: menuobj.className = 'smenu-content fl'; thecontent = writeBlank(62).concat(thecontent); break;
        case 6: menuobj.className = 'smenu-content fl'; thecontent = writeBlank(88).concat(thecontent); break;
        case 7: menuobj.className = 'smenu-content fl'; thecontent = writeBlank(76).concat(thecontent); break;
        case 8: menuobj.className = 'smenu-content fl'; thecontent = writeBlank(108).concat(thecontent); break;
        case 9: menuobj.className = 'smenu-content fl'; thecontent = writeBlank(110).concat(thecontent); break;
        case 10: menuobj.className = 'smenu-content fl'; thecontent = writeBlank(188).concat(thecontent); break;
        case 11: case 14:
            if (type == 1) { menuobj.className = 'smenu-content2 fl txtr'; }
            else { menuobj.className = 'smenu-content fl txtr'; }
            break;
        default:
            menuobj.className = 'smenu-content fl';
            break;
    }
    if (document.getElementById || document.all)
        menuobj.innerHTML = thecontent
    else if (document.layers) {
        menuobj.document.write(thecontent)
        menuobj.document.close()
    }
}

function resetit() {
    delayhide = setTimeout("writeCurrentMenu()", delay_hide);
}

function clear_delayhide() {
    if (window.delayhide)
        clearTimeout(delayhide)
}

function reWriteMenu() {
    delayhide = setTimeout("writeCurrentMenu()", delay_hide);
}

function writeTabMenu(i, f) {
    var child = false;
    var j;
    var strTabMenu = '';
    var cname = '';
    var cpath = '';
    for (j = 0; j < menu_pid.length; j++) {
        if (menu_pid[j] == i) {
            child = true;
            break;
        }
    }
    for (j = 0; j < menu_pid.length; j++) {
        if (menu_fid[j] == i) {
            cname = menu_name[j];
            cpath = menu_path[j];
            break;
        }
    }
    if (f == 0) {
        if (child) {
            if (i != 105) {
                strTabMenu = strTabMenu.concat('<div class="folder-title">');
                strTabMenu = strTabMenu.concat('    <div class="fl"><img src="/Images/Background/folder-activeleft.gif" alt="" /></div>');
                strTabMenu = strTabMenu.concat('    <div class="folder-active fl"><a href="').concat(cpath).concat('" class="link-folder">').concat(cname).concat('</a></div>');
                strTabMenu = strTabMenu.concat('    <div class="fl"><img src="/Images/Background/folder-activeright.gif" alt="" /></div>');
                strTabMenu = strTabMenu.concat('    <div class="subfolder fl"><a href="#" class="link-subfolder">').concat(writeTabSubMenu(i)).concat('</a></div>');
                strTabMenu = strTabMenu.concat('    <div class="fr"><img src="/Images/Background/folder-titleright.gif" alt="" /></div>');
                strTabMenu = strTabMenu.concat('</div>');
            }
            else {
                strTabMenu = strTabMenu.concat('<div class="folder-title2">');
                strTabMenu = strTabMenu.concat('    <div class="fl"><img src="/Images/Background/folder-activeleft2.gif" alt="" /></div>');
                strTabMenu = strTabMenu.concat('    <div class="folder-active2 fl"><a href="').concat(cpath).concat('" class="link-folder">').concat(cname).concat('</a></div>');
                strTabMenu = strTabMenu.concat('    <div class="fl"><img src="/Images/Background/folder-activeright2.gif" alt="" /></div>');
                strTabMenu = strTabMenu.concat('    <div class="fr"><img src="/Images/Background/folder-topright.gif" alt="" /></div>');
                strTabMenu = strTabMenu.concat('</div>');
            }
        }
        else {
            if (i != 117) {
                strTabMenu = strTabMenu.concat('<div class="folder-title2">');
                strTabMenu = strTabMenu.concat('    <div class="fl"><img src="/Images/Background/folder-activeleft2.gif" alt="" /></div>');
                strTabMenu = strTabMenu.concat('    <div class="folder-active2 fl"><a href="').concat(cpath).concat('" class="link-folder">').concat(cname).concat('</a></div>');
                strTabMenu = strTabMenu.concat('    <div class="fl"><img src="/Images/Background/folder-activeright2.gif" alt="" /></div>');
                strTabMenu = strTabMenu.concat('    <div class="fr"><img src="/Images/Background/folder-topright.gif" alt="" /></div>');
                strTabMenu = strTabMenu.concat('</div>');
            }
        }
    }
    return strTabMenu;
}

function writeTabSubMenu(i) {
    var j;
    var strTabSubMenu = '';
    var strSep = '&nbsp;|&nbsp;';
    for (j = 0; j < menu_pid.length; j++) {
        if (menu_pid[j] == i) {
            if (menu_fid[j] < 10000 && menu_fid[j] != 106 && menu_fid[j] != 148) {
                if (i == 9) {
                    if (strTabSubMenu == '') {
                        strTabSubMenu = strTabSubMenu.concat('<a class="link-subfolder" href="').concat(menu_path[6]).concat('" >').concat(menu_name[6]).concat('</a>');
                        strTabSubMenu = strTabSubMenu.concat(strSep);
                    }
                    strTabSubMenu = strTabSubMenu.concat('<a class="link-subfolder" href="').concat(menu_path[j]).concat('" >').concat(menu_name[j]).concat('</a>');
                    strTabSubMenu = strTabSubMenu.concat(strSep);
                }
                else {
                    strTabSubMenu = strTabSubMenu.concat('<a class="link-subfolder" href="').concat(menu_path[j]).concat('" >').concat(menu_name[j]).concat('</a>');
                    strTabSubMenu = strTabSubMenu.concat(strSep);
                }
            }
            else if (menu_fid[j] >= 10000) {
                strTabSubMenu = strTabSubMenu.concat('<a class="link-subfolder" href="').concat(menu_path[j]).concat('"  target="_blank">').concat(menu_name[j]).concat('</a>');
                strTabSubMenu = strTabSubMenu.concat(strSep);
            }
        }
    }
    strTabSubMenu = strTabSubMenu.substr(0, strTabSubMenu.length - strSep.length);
    return strTabSubMenu;
}

function writeListItemTitle(i) {
    var j;
    var strListItemTitle = '';
    for (j = 0; j < menu_pid.length; j++) {
        if (menu_fid[j] == i) {
            strListItemTitle = strListItemTitle.concat('<a class="link-folder" href="').concat(menu_path[j]).concat('" >').concat(menu_name[j]).concat('</a>');
            break;
        }
    }
    document.write(strListItemTitle);
}

function writeBlank(i) {
    var strHTML = '';
    for (var j = 1; j <= i; j++) {
        strHTML = strHTML.concat('&nbsp;');
    }
    return strHTML;
}

function goTo(i) {
    document.location.href = i;
}