
/* peter machner. pm */

function MM_openBrWindow(theURL,winName,features) {
  window.open(theURL,winName,features);
}

/* ajax. pm */

var variabel='';

function createRequestObject() { 
    var ro; 
    if (window.XMLHttpRequest) {
            ro = new XMLHttpRequest();
        } else if (window.ActiveXObject) {
            try {
                ro = new ActiveXObject("Msxml2.XMLHTTP");
            } catch (e) {
                try {
                    ro = new ActiveXObject("Microsoft.XMLHTTP");
                } catch (e) {}
            }
        }
    return ro; 
} 

var http = createRequestObject(); 

function sndReq(action,x) {
    http.open('get', '/_ajax/_ajax.php?action='+action+'&x='+x); 
    http.onreadystatechange = handleResponse; 
    http.send(null); 
} 

function handleResponse() { 
    if(http.readyState == 4){ 
        var response = http.responseText; 
        var update = new Array(); 

        if(response.indexOf('|' != -1)) { 
            update = response.split('|');
            text=''; 
            for(i=0;i<update.length;i++)
            {
              text+=update[i]; 
            }
                document.getElementById(variabel).innerHTML = text;
        } 
    } 
}

function updateField(x,y)
{
    document.getElementById(x).setAttribute("autocomplete","off");
    variabel=y;
    sndReq(document.getElementById(x).value,x);
    
}


function writeField(z,zz)
{
    document.getElementById(variabel).innerHTML = '';
    document.getElementById(zz).value = z;
}

function clearFoos()
{
    document.getElementById('foo1').innerHTML = '';
}

function setField(z,zz)
{
    document.getElementById(zz).value = z; 
}

