﻿function GetXMLHttpRequest() 
{
    var ajo = null;
    if (typeof XMLHttpRequest != "undefined") {
    ajo = new XMLHttpRequest();
        } else {
    try {
        ajo = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
        try {
            ajo = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {
        }
    }
 }
 return ajo;
}

function getNews(id)
{
    var ajo = GetXMLHttpRequest();
    var url = "/news/ajaxnews"+id+".aspx";
    ajo.open("POST", url, true);
    ajo.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    ajo.onreadystatechange = function() { 
        if (ajo.readyState == 4) {SetNewsBody(ajo.responseText);
        }
    }
    ajo.send(url);
    delete ajo;
}

function SetNewsBody(body)
{
    document.getElementById('ContentBodyHtml').innerHTML = body;
}