window.onload = function() { initComment(1); }
function initComment(pageIndex)
{
getDataComment(pageIndex);
}
function ProcessLayoutComment()
{
var wallSong = document.getElementById("PanelComment");
if (wallSong)
{
wallSong.innerHTML = '
';
}
}
function GetXmlHttpObject()
{
var objXMLHttp=null
if (window.XMLHttpRequest)
{
objXMLHttp=new XMLHttpRequest()
}
else if (window.ActiveXObject)
{
objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP")
}
return objXMLHttp
}
function getDataComment(pageIndex)
{
var xmlHttp;
ProcessLayoutComment();
xmlHttp=GetXmlHttpObject();
if (xmlHttp==null)
{
alert ("Browser does not support HTTP Request")
return
}
var rnd = Math.random()*5;
var url= "http://nhipsongso.tuoitre.vn/Ajax/Comment.aspx?pIndex=" + pageIndex+"&ArticleID=" + 416903;
xmlHttp.onreadystatechange = function(){
if(xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
{
//div chua du lieu load ve
var wallSong = document.getElementById("PanelComment");
if (wallSong)
{
wallSong.innerHTML = xmlHttp.responseText;
}
}
};
if(BrowserDetect.browser == "Firefox")
{
xmlHttp.open("GET",url,true)
}
else
{
xmlHttp.open("POST",url,true)
}
xmlHttp.send(null)
}
var BrowserDetect = {
init: function () {
this.browser = this.searchString(this.dataBrowser) || "An unknown browser";
this.version = this.searchVersion(navigator.userAgent)
|| this.searchVersion(navigator.appVersion)
|| "an unknown version";
this.OS = this.searchString(this.dataOS) || "an unknown OS";
},
searchString: function (data) {
for (var i=0;i