View file cat - skor/3/img/ajax.js

File size: 1.31Kb
function opennews(url,section)
{
    var oXmlHttp = zXmlHttp.createRequest();
    oXmlHttp.open("GET", 'handler.php?section=' + section + '&id=' + url , true);
    oXmlHttp.onreadystatechange = function ()
    {
    if (oXmlHttp.readyState < 4)
    {
    	html.innerHTML = '<img src="./templates/img/ajax-loader.gif" border="0">';
    }
    if (oXmlHttp.readyState == 4)
    {
    	if (oXmlHttp.status == 200)
    	{
    		print(oXmlHttp.responseText);
        } else
        {
        	print("An error occurred: " + oXmlHttp.statusText);
        }
    }
    };
    oXmlHttp.send(null);
}
function opensection(section,page)
{
    var oXmlHttp = zXmlHttp.createRequest();
    oXmlHttp.open("GET", 'handler.php?section=' + section + '&p=' + page , true);
    oXmlHttp.onreadystatechange = function ()
    {
    if (oXmlHttp.readyState < 4)
    {
    	html.innerHTML = '<img src="./templates/img/ajax-loader.gif" border="0">';
    }
    if (oXmlHttp.readyState == 4)
    {
    	if (oXmlHttp.status == 200)
    	{
    		print(oXmlHttp.responseText);
        } else
        {
        	print("An error occurred: " + oXmlHttp.statusText);
        }
    }
    };
    oXmlHttp.send(null);
}
function print(sMessage)
{
    var divStatus = document.getElementById("html");
    html.innerHTML = sMessage;
}