
index4 = '';
index5 = '';
index6 = '';
    
    function nav_select_init( )
      {
        var box1    = getObject( 'br1' );
        var box2    = getObject( 'br2' );
        var box3    = getObject( 'br3' );
	var box4    = getObject( 'br4' );
        var box5    = getObject( 'br5' );
        var box6    = getObject( 'br6' );

        if( !box1 ) return 0;
        optionTest = true;

        lgth = box1.options.length - 1;
        box1.options[lgth] = null;

        if( box1.options[lgth] ) { optionTest = false; }
        loadOptions2( box1, base1, 'init', index1 );
        if (!optionTest) return;

        box1.onchange = function( ) {
            loadOptions2( box2, base2, this.options[this.selectedIndex].value, index2 );
            if( box2.options.length ) {
                loadOptions2( box3, base3, box2.options[box2.selectedIndex].value, index3 );
            }
	    box4.value = this.value;
	    if (box4.value != this.value) {
	    	box4.value = '';
	    }
            loadOptions2( box5, base5, this.options[this.selectedIndex].value, index5 );
            if( box5.options.length ) {
                loadOptions2( box6, base6, box5.options[box5.selectedIndex].value, index6 );
            }
        }
        box2.onchange = function( ) { loadOptions2( box3, base3, this.options[this.selectedIndex].value, index3 ); }

        if( box1.options[box1.selectedIndex].value ) { loadOptions2( box2, base2, box1.options[box1.selectedIndex].value, index2 ); }
        if( box2.options[box2.selectedIndex].value ) { loadOptions2( box3, base3, box2.options[box2.selectedIndex].value, index3 ); }
      }

    function nav_select_init_d( )
      {
        var box1    = getObject( 'br1' );
        var box2    = getObject( 'br2' );
        var box3    = getObject( 'br3' );
        var box4    = getObject( 'br4' );
        var box5    = getObject( 'br5' );
        var box6    = getObject( 'br6' );

        if( !box4 ) return 0;
        optionTest = true;

        lgth = box4.options.length - 1;
        box4.options[lgth] = null;

        if( box4.options[lgth] ) { optionTest = false; }
        loadOptions2( box4, base4, 'init', index4 );
        if (!optionTest) return;

        box4.onchange = function( ) {
            loadOptions2( box5, base5, this.options[this.selectedIndex].value, index5 );
            if( box5.options.length ) {
                loadOptions2( box6, base6, box5.options[box5.selectedIndex].value, index6 );
            }
	    box1.value = this.value;
	    if (box1.value != this.value) {
	    	box1.value = '';
	    }
            loadOptions2( box2, base2, this.options[this.selectedIndex].value, index2 );
            if( box2.options.length ) {
                loadOptions2( box3, base3, box2.options[box2.selectedIndex].value, index3 );
            }
        }
        box5.onchange = function( ) { loadOptions2( box6, base6, this.options[this.selectedIndex].value, index6 ); }

        if( box4.options[box4.selectedIndex].value ) { loadOptions2( box5, base5, box4.options[box4.selectedIndex].value, index5 ); }
        if( box5.options[box5.selectedIndex].value ) { loadOptions2( box6, base6, box5.options[box5.selectedIndex].value, index6 ); }
      }
      
    function loadOptions2( object, opts, index, sel_index )
      {
      if (!object) {
      	return;
	}
        for (var i=object.options.length; i >= 0 ;i-- ) { object.options[i] = null; }
        object.selectedIndex = -1;

        for( i=0; i < opts.length ;i+=1 ) {
            test = opts[i][0];
            test2 = opts[i][1];
            if( index == 'init' ) {
                object.options[object.options.length] = new Option( opts[i][2], opts[i][1] );
                if( test2 == sel_index ) { object.options[(object.options.length-1)].selected = true; }
            } else if( !test ) {
                object.options[object.options.length] = new Option( opts[i][2], opts[i][1] );
            } else if( index ) {
                if( test == index || test == '' ) {
                    object.options[object.options.length] = new Option( opts[i][2], opts[i][1] );
                    if( test2 == sel_index ) { object.options[(object.options.length-1)].selected = true; }
                }
            }
        }
      }

    function selchange(el) 
    {
    	if (el.value != 'G') {
	    enableClass = 'benzin';
	    disabledClass = 'diesel';
	    document.getElementById('br1').disabled=false;
	    document.getElementById('br2').disabled=false;
	    document.getElementById('br4').disabled=true;
	    document.getElementById('br5').disabled=true;
	}
	else {
	    enableClass = 'diesel';
	    disabledClass = 'benzin';
	    document.getElementById('br1').disabled=true;
	    document.getElementById('br2').disabled=true;
	    document.getElementById('br4').disabled=false;
	    document.getElementById('br5').disabled=false;
	}
        var rows = document.getElementsByTagName('TR');
        var cnt = rows.length;
	
        for (var i = 0; i < cnt; i++) {
            if (rows[i].className == enableClass) {
                rows[i].style.display = 'table-row';
                rows[i].style.visibility = 'visible';
            }
            else if (rows[i].className == disabledClass) {
                rows[i].style.display = 'none';
                rows[i].style.visibility = 'hidden';
            }
        }
    }

    window.onload = function() {
    	nav_select_init();
    	nav_select_init_d();
    }
	


