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

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

function esetkain1(prodid)
{
  operacija=95;
  con1 = prodid;
  con2 = document.getElementById('kiek1').value;
  if (con2>4) {
    if (con1==81) con1=82;
    if (con1==91) con1=92;
  }
  con3 = document.getElementById('laikas1').value;
  url='http://b2b.nodbaltic.com/esetlt_1.php?go=1&pro='+con1+'&ksk='+con2+'&lai='+con3;
  //alert(url);
  loadXMLDocEK1(url);
}

function loadXMLDocEK1(url) {
    // branch for native XMLHttpRequest object
    if (window.XMLHttpRequest) {
        req = new XMLHttpRequest();
        req.onreadystatechange = processReqChangeEK1;
        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 = processReqChangeEK1;
            req.open("GET", url, true);
            req.send();
        }
    }
}

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