function BrowserCheck() {
	var b = navigator.appName
	if (b=="Netscape") this.b = "ns"
	else if (b=="Microsoft Internet Explorer") this.b = "ie"
	else this.b = b
	this.v = parseInt(navigator.appVersion)
	this.ns = (this.b=="ns" && this.v>=4)
	this.ns4 = (this.b=="ns" && this.v==4)
	this.ns5 = (this.b=="ns" && this.v==5)
	this.ie = (this.b=="ie" && this.v>=4)
	this.ie4 = (navigator.userAgent.indexOf('MSIE 4')>0)
	this.ie5 = (navigator.userAgent.indexOf('MSIE 5')>0)
	if (this.ie5) this.v = 5
	this.min = (this.ns||this.ie)
}
is = new BrowserCheck() ;


//wypełnia selecta listą opcji zawartą w tablicy 'tablica opcji', stworzoną no tak:
//  colorArray1 = new Array("Red", "Blue", "Yellow", "Green") ;
//  colorArray2 = new Array("color_Red", "color_Blue", "color_Yellow", "color_Green")    
//  var kolory = new Array() ;
//  for( i=0; i<4; i++ )
//      {
//      kolory[i] = new Option( colorArray1[i], colorArray2[i] ) ;
//      }

function wypelnij_selecta( nazwa_form, nazwa_select, nazwa_tablica_opcji )
    {
    var dlugosc_tablicy = eval( nazwa_tablica_opcji + ".length" );
    for( var i=0; i<dlugosc_tablicy; i++ )
        eval( "document." + nazwa_form + "." + nazwa_select + "." + "options[ i ] =" + nazwa_tablica_opcji + "[ i ]" ) ;
    if( is.ns4 )
        history.go(0) ;      
    }


function wyczysc_selecta( nazwa_form, nazwa_select )
    {
    eval( "dlugosc_selecta = document." + nazwa_form + "." + nazwa_select + ".length") ;
    for( var i=dlugosc_selecta-1; i>=0; i-- )
        eval( "document." + nazwa_form + "." + nazwa_select + ".options[ i ] = null" ) ;
    //if( is.ns4 )
    //    history.go(0) ; 
    }    

//funkcja zwraca nr opcji wybranej w formularzu
     
function wez_nr_opcji( nazwa_form, nazwa_select ) 
    {
    eval( "var dlugosc_selecta = document." + nazwa_form + "." + nazwa_select + ".length" ) ;
    for( var i = 0; i < dlugosc_selecta; i++ ) 
        {
        eval( "var spr_option_tmp = document." + nazwa_form + "." + nazwa_select + ".options[i].selected" ) ;
        if( spr_option_tmp == true ) 
            {
            eval( "var nr_opcji = document." + nazwa_form + "." + nazwa_select + ".options[i].index" ) ;
            return nr_opcji ;
            }
        }
        return null
    }    
