var loadstatustext="Loading ...";
var kod;

//FOTO REITINGAS

function kodstrany()
{
  messag   = document.getElementById('skod');
  ida=messag.value;
  url='kodstr.php?kodas='+ida;
  //alert(url);
  loadXMLDocFR(url);
}



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

function processReqChangeFR()
{
    // only if req shows "complete"
    if (req.readyState == 4) {
        // only if "OK"
        if (req.status == 200) {
         result = req.responseText;
	     message   = document.getElementById('Telefon');
   	     message.value=result;
        } else {
         alert("There was a problem retrieving the XML data:\n" + req.statusText+" "+req.readyState+" "+req.status);
        }
    }
}
