
var http_req = false;

function ajaxpost(url, inputs, report) {
http_req = false;

try{http_req = new ActiveXObject("Msxml2.XMLHTTP");}catch (e){ //ie
try{http_req = new ActiveXObject("Microsoft.XMLHTTP");}catch (e){ //ie
try{http_req = new XMLHttpRequest();}catch (e){ //ff, etc..
http_req = null;}}}

if (!http_req) {document.getElementById(report).innerHTML = 'Klaida';return false;}
document.specreport=report;
http_req.onreadystatechange = display;
http_req.open('POST', url, true);
http_req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http_req.send(inputs);
}

function ajaxget(url, inputs, report) {
http_req = false;

try{http_req = new ActiveXObject("Msxml2.XMLHTTP");}catch (e){ //ie
try{http_req = new ActiveXObject("Microsoft.XMLHTTP");}catch (e){ //ie
try{http_req = new XMLHttpRequest();}catch (e){ //ff, etc..
http_req = null;}}}

if (!http_req) {document.getElementById(report).innerHTML = 'Klaida';return false;}
document.specreport=report;
http_req.onreadystatechange = display;
http_req.open('GET', url+'?'+inputs, true);

http_req.send(null);
}

function display() {
if (http_req.readyState == 4) {
if (http_req.status == 200) {document.getElementById(document.specreport).innerHTML = http_req.responseText;
}
}}
