function loadXMLDoc(url,cfunc) {
    if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari
        xmlhttp=new XMLHttpRequest();
    } else {// code for IE6, IE5
        xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }

    xmlhttp.onreadystatechange = cfunc;
    xmlhttp.open("POST",url ,true);
    xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
    xmlhttp.send();
}

function yearChange(year) {
    loadXMLDoc("modules/magsearchbyvehicule/fillMake.php?year=" + year,function() {
        if (xmlhttp.readyState==4 && xmlhttp.status==200) {           
            document.getElementById("comboMake").innerHTML=xmlhttp.responseText;
        }
    });
}

function makeChange(make) {
    var year = document.getElementById("year").options[document.getElementById("year").selectedIndex].value;
    loadXMLDoc("modules/magsearchbyvehicule/fillModel.php?make=" + make + "&year=" + year,function() {
        if (xmlhttp.readyState==4 && xmlhttp.status==200) {
            document.getElementById("comboModel").innerHTML=xmlhttp.responseText;
        }
    });
}

function modelChange() {
    if (document.getElementById("submitWheels") != null)
        document.getElementById("submitWheels").disabled = false;
    if (document.getElementById("submitTires") != null)
        document.getElementById("submitTires").disabled = false;
}
