/* AJAX loading data into selectbox */
    var selectbox_models_id = 'loaded_models';
    var selectbox_models_id1 = 'loaded_models1';
    var selectbox_models_id2 = 'loaded_models2';
    var selectbox_models_id3 = 'loaded_models3';
    var ajax_data_file = 'http://www.megacars.cz/ajax_get_selectbox_models.php?parent_id=';
    var ajax = new sack();
    
    function loadModelList (sel) {
        var parent_sel_id = sel.options[sel.selectedIndex].value;
        document.getElementById(selectbox_models_id).options.length = 0; // Empty select box
        if (parent_sel_id.length > 0) {
            ajax.requestFile = ajax_data_file+parent_sel_id; // Specifying which file to get
            ajax.onCompletion = createSelectboxModels; // Specify function that will be executed after file has been found
            ajax.runAJAX(); // Execute AJAX function
        }
    }

    function createSelectboxModels () {
        var obj = document.getElementById(selectbox_models_id);
        eval(ajax.response);	// Executing the response from Ajax as Javascript code	
    }
    
    
    function loadModelList1 (sel) {
        var parent_sel_id = sel.options[sel.selectedIndex].value;
        document.getElementById(selectbox_models_id1).options.length = 0; // Empty select box
        if (parent_sel_id.length > 0) {
            ajax.requestFile = ajax_data_file+parent_sel_id; // Specifying which file to get
            ajax.onCompletion = createSelectboxModels1; // Specify function that will be executed after file has been found
            ajax.runAJAX(); // Execute AJAX function
        }
    }

    function createSelectboxModels1 () {
        var obj = document.getElementById(selectbox_models_id1);
        eval(ajax.response);	// Executing the response from Ajax as Javascript code	
    }
    
    function loadModelList2 (sel) {
        var parent_sel_id = sel.options[sel.selectedIndex].value;
        document.getElementById(selectbox_models_id2).options.length = 0; // Empty select box
        if (parent_sel_id.length > 0) {
            ajax.requestFile = ajax_data_file+parent_sel_id; // Specifying which file to get
            ajax.onCompletion = createSelectboxModels2; // Specify function that will be executed after file has been found
            ajax.runAJAX(); // Execute AJAX function
        }
    }

    function createSelectboxModels2 () {
        var obj = document.getElementById(selectbox_models_id2);
        eval(ajax.response);	// Executing the response from Ajax as Javascript code	
    }
    
    function loadModelList3 (sel) {
        var parent_sel_id = sel.options[sel.selectedIndex].value;
        document.getElementById(selectbox_models_id3).options.length = 0; // Empty select box
        if (parent_sel_id.length > 0) {
            ajax.requestFile = ajax_data_file+parent_sel_id; // Specifying which file to get
            ajax.onCompletion = createSelectboxModels3; // Specify function that will be executed after file has been found
            ajax.runAJAX(); // Execute AJAX function
        }
    }

    function createSelectboxModels3 () {
        var obj = document.getElementById(selectbox_models_id3);
        eval(ajax.response);	// Executing the response from Ajax as Javascript code	
    }
