function $(id) {
    return document.getElementById(id);
}

function kategorie(id){
    getRoot($(id).value);
}

function search_id(id){
    $('cat').value=$(id).value;
}


function getRoot(input) {
    var xmlhttp = null;
    // Mozilla
    if (window.XMLHttpRequest) {
        xmlhttp = new XMLHttpRequest();
    }
    // IE
    else if (window.ActiveXObject) {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    }
    
    xmlhttp.open("GET", 'product_cat_ajax.php?root='+ input, true);
    xmlhttp.onreadystatechange = function() {
        if(xmlhttp.readyState != 4) {
            $('ergebnis1').innerHTML = 'laden ...';
        }
        if(xmlhttp.readyState == 4 && xmlhttp.status == 200) {
            $('ergebnis1').innerHTML = xmlhttp.responseText;
            $('cat').value = input;
        }
    }
    xmlhttp.send(null);
}

