﻿
var _d = document;

function elemId(id) {
    if (_d.getElementById) {
        return _d.getElementById(id);
    }
    else {
        return _d.all[id];
    }
}

function getNews(cat, id) {
    var xRequest = new XAjaxRequest;
    xRequest.method = "GET";
    xRequest.fileRequest = "News.aspx";
    xRequest.strTargetLoading = "mainContent";
    if (typeof cat == "undefined" || cat < 0) {
        xRequest.arrNameVarsSend = new Array("action");
        xRequest.arrValueVarsSend = new Array("all");
    }
    else if(typeof id == "undefined" || id < 0) {
        xRequest.arrNameVarsSend = new Array("action");
        xRequest.arrValueVarsSend = new Array(cat);
    }
    else {
        xRequest.arrNameVarsSend = new Array("action", "id");
        xRequest.arrValueVarsSend = new Array(cat, id);
    }
    xRequest.sendRequest();
}
