  function ChangeType() {
        JsHttpRequest.query(
            '/view/js/ff.php', // backend
            {
                'pid': document.getElementById('fftype').value,
                'load': 'producers'
            },
            function(result, errors) {

                document.getElementById('ffmodel').innerHTML = "";
                                        var option = document.createElement("option");
                                        var optionText = document.createTextNode("модель >");
                                        option.appendChild(optionText);
                                        document.getElementById('ffmodel').appendChild(option);

                document.getElementById('ffproducer').innerHTML = "";
                                        var option = document.createElement("option");
                                        var optionText = document.createTextNode("производитель >");
                                        option.appendChild(optionText);
                                        document.getElementById('ffproducer').appendChild(option);

                for(var i in result)
                                {
                                        var option = document.createElement("option");
                                        var optionText = document.createTextNode(result[i]);
                                        option.appendChild(optionText);
                                        option.setAttribute("value",i);
                                        document.getElementById('ffproducer').appendChild(option);
                                }

                        },
            false  // do not disable caching
        );
    }

  function ChangeProducer() {
        JsHttpRequest.query(
            '/view/js/ff.php', // backend
            {
                'pid': document.getElementById('fftype').value,
                'prid': document.getElementById('ffproducer').value,
                'load': 'models'           
            },
            function(result, errors) {
                document.getElementById('ffmodel').innerHTML = "";
                                        var option = document.createElement("option");
                                        var optionText = document.createTextNode("модель >");
                                        option.appendChild(optionText);
                                        document.getElementById('ffmodel').appendChild(option);
                for(var i in result)
                                {
                                        var option = document.createElement("option");
                                        var optionText = document.createTextNode(result[i]);
                                        option.appendChild(optionText);
                                        option.setAttribute("value",i);
                                        document.getElementById('ffmodel').appendChild(option);
                                }

                        },
            false  // do not disable caching
        );
    }