var loadstatustext="Loading ...";
var prodid;

//---------------------------------------------------------------------------------

function esetkain2(prodid)
{
  operacija=95;
  con1a = prodid;
  con2a = document.getElementById('kiek2').value;
  if (con2a>4) {
    if (con1a==81) con1a=82;
    if (con1a==91) con1a=92;
  }
  con3a = document.getElementById('laikas2').value;
  urla='http://b2b.nodbaltic.com/esetlt_2.php?go=1&pro='+con1a+'&ksk='+con2a+'&lai='+con3a;
  //alert(url);
  loadXMLDocEK2(urla);
}

function loadXMLDocEK2(url) {
    // branch for native XMLHttpRequest object
    if (window.XMLHttpRequest) {
        req = new XMLHttpRequest();
        req.onreadystatechange = processReqChangeEK2;
        req.open("GET", url, true);
        req.send(null);
    // branch for IE/Windows ActiveX version
    } else if (window.ActiveXObject) {
        req = new ActiveXObject("Microsoft.XMLHTTP");
        if (req) {
            req.onreadystatechange = processReqChangeEK2;
            req.open("GET", url, true);
            req.send();
        }
    }
}

function processReqChangeEK2()
{
    // only if req shows "complete"
    if (req.readyState == 4) {
        // only if "OK"
        if (req.status == 200) {
           result = req.responseText;
	       message2a   = document.getElementById('uzs2');
           CheckNum = parseInt(result);
           ok = 1;
           if(isNaN(CheckNum)) {
            ok = 0;result='0.00';
           }
           if (ok==1) message2a.disabled = false;
           if (ok==0) message2a.disabled = true;
	       message1a   = document.getElementById('kaina2');
           message1a.innerHTML=result;
        } else {
         alert("There was a problem retrieving the XML data:\n" + req.statusText+" "+req.readyState+" "+req.status);
        }
    }
}