var globalmanf;
function CahngeManufactor(str,manf) {

    globalmanf = manf;
    if (str > 0) {
        xmlHttp = GetXmlHttpObject();
        if (xmlHttp == null) {
            alert("Your browser does not support AJAX!");
            return;
        }
        var url = "globalinc/GetManufactor.asp";
        url = url + "?AreaId=" + str;
        url = url + "&sid=" + Math.random();
        xmlHttp.onreadystatechange = GetManufactor;

        xmlHttp.open("GET", url, true);
        xmlHttp.send(null);
    }
}
function GetManufactor() {
    if (xmlHttp.readyState == 4) {
        with (document.all) {
            tmp = m.length;
            for (i = 0; i < tmp; i++)
                m.remove(0);
         
            var xmlDoc = xmlHttp.responseXML.documentElement;
            m.options[0] = new Option('הכל', '');

            for (i = 1; xmlDoc.getElementsByTagName('Items').length - 1; i++) {
                try {
                    m.options[i] = new Option(xmlDoc.getElementsByTagName("ManufacturerName")[i-1].childNodes[0].nodeValue, xmlDoc.getElementsByTagName("ManufacturerId")[i-1].childNodes[0].nodeValue);
                    if (globalmanf == xmlDoc.getElementsByTagName("ManufacturerId")[i - 1].childNodes[0].nodeValue) m.options[i].selected=true;
                }
                catch (e) {
                    return;
                }

            }
        } //end with


    }
}

function GetXmlHttpObject() {
    var xmlHttp = null;
    try {
        // Firefox, Opera 8.0+, Safari
        xmlHttp = new XMLHttpRequest();
    }
    catch (e) {
        // Internet Explorer
        try {
            xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
        }
        catch (e) {
            xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
        }
    }
    return xmlHttp;
}