/*
*       $Header: /repos/habitaten/site/page/menu.js,v 1.1.1.1 2005/06/17 09:45:03 piotrj Exp $
*/
        var menu_timeout;
        var second_menu_timeout;
        var last_menu_on = -1;
        var current_menu = -1;
        var current_second_menu = "no_menu";
        var last_second_menu = "no_menu";
        var last_parent = "";

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: uaktywnia menu rozwijane
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function showMenu( num )
        {
                if( menu = document.getElementById( "m"+num ) )
                {
                        current_menu = num;
                        clearTimeout( menu_timeout );
                        menu.style.display = "block";
                        if( ( last_menu_on >= 0 ) && ( last_menu_on != num ) )
                        {
                                closeMenu( last_menu_on );
                        }
                        last_menu_on = num;
                }
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: chowa menu rozwijane
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function hideMenu( num )
        {
                lightParent( "#ff9933" );
                last_parent = "";
                closeAllSecondMenu( last_menu_on );
                current_menu = -1;
                menu_timeout = setTimeout( 'closeMenu('+num+')', 200 );
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: zamyka wszystkie menu
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function closeMenu( num )
        {
                if( current_menu != num )
                {
                        if( menu = document.getElementById( "m"+num ) )
                        {
                                menu.style.display = "none";
                        }
                }
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: podswietla wybrane menu
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function lightMenu( str, color )
        {
                num = 0;
                while( menu = document.getElementById( "m"+num ) )
                {
                        i = 0;
                        while( podm = document.getElementById( "m"+num+"p"+i ) )
                        {
                                podm.style.backgroundColor = "#ff9933";
                                j = 0;
                                while( boczne = document.getElementById( "m"+num+"p"+i+"b"+j ) )
                                {
                                        boczne.style.backgroundColor = "#ff9933";
                                        j++;
                                }
                                i++;
                        }
                        num++;
                }
                if( str.length > 4 )
                {
                        lightParent( "#ff6600" );
                }
                else
                {
                        lightParent( "#ff9933" );
                }
                if( pole = document.getElementById( str ) )
                {
                        pole.style.backgroundColor = color;
                }
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: podswietla wybrane menu
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function lightParent( color )
        {
                if( last_parent != "" )
                {
                        document.getElementById( last_parent ).style.backgroundColor = color;
                }
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: chowa menu rozwijane
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function showSecondMenu( id, parent )
        {
                last_parent = parent;
                lightParent( "#ff6600" );
                current_second_menu = id;
                clearTimeout( second_menu_timeout );
                len = parent.length;
                parent_par = parent.substr( 0, len-2 );
                page_pos = Math.round( (document.body.scrollWidth-750) / 2 ) + 750;
                scr_pos = document.getElementById( parent_par ).offsetLeft + 217;
                if( scr_pos > page_pos )
                {
                        przesun = -108;
                }
                else
                {
                        przesun = 108;
                }
                if( somemenu = document.getElementById( id ) )
                {
                        somemenu.style.display = "block";
                        par = document.getElementById( parent );
                        parleft = ( par.offsetLeft + przesun );
                        partop = par.offsetTop+5;
                        somemenu.style.left = ""+parleft+"px";
                        somemenu.style.top = ""+partop+"px";
                }
                if( ( last_second_menu != "no_menu" ) && ( last_second_menu != id ) )
                {
                        closeSecondMenu( last_second_menu );
                }
                last_second_menu = id;
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: chowa menu rozwijane
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function hideSecondMenu( id )
        {
                lightParent( "#ff9933" );
                last_parent = "";
                current_second_menu = "no_menu";
                second_menu_timeout = setTimeout( 'closeSecondMenu( "'+id+'" )', 1 );
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: zamyka wszystkie menu
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function closeSecondMenu( id )
        {
                if( current_second_menu != id )
                {
                        if( somemenu = document.getElementById( id ) )
                        {
                                somemenu.style.display = "none";
                        }
                }
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: zamyka wszystkie menu rozwijane boczne
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function closeAllSecondMenu( num )
        {
                lightParent( "#ff9933" );
                last_parent = "";
                i = 0;
                while( menu = document.getElementById( "m"+num+"p"+i+"b" ) )
                {
                        menu.style.display = "none";
                        i++;
                }
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: pokazuje obrazek w nowym dopasowanym oknie
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function showImage( a_sciezka )
        {
                imageObj = new Image();
                imageObj.src = a_sciezka;
                x = Math.round((document.body.clientWidth - 20)/10);
                y = Math.round((document.body.clientHeight - 100)/10);
                winObj = window.open( a_sciezka, "image_window", "channelmode=no, toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, titlebar=no, width=20, height=20, left="+x+", top="+y+"" );
                resizeImageWindow( imageObj, winObj );
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: odpala wybrany filmik
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-26 10:57  piotrj     stworzenie
        //
        function showFlash( a_width, a_height, a_url )
        {
                scr_width = document.body.clientWidth - 20;
                scr_height = document.body.clientHeight - 60;
                if( scr_width < a_width )
                {
                        a_height = Math.round( scr_height * a_width / scr_width );
                        a_width = scr_width;
                }
                if( scr_height < a_height )
                {
                        a_width = Math.round( scr_width * a_height / scr_height );
                        a_height = scr_height;
                }
                x = Math.round( ( scr_width - a_width ) / 2 );
                y = Math.round( ( scr_height ) / 10 );
                winObj = window.open( a_url, "flash_window", "channelmode=no, toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, titlebar=no, width="+a_width+", height="+a_height+", left="+x+", top="+y+"" );
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: sprawdza, czy podana data jest prawidłowa
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-26 10:57  piotrj     stworzenie
        //
        function CheckDate()
        {
                l_error = 0;
                l_year = document.getElementById( "year" );
                l_rok = l_year.value;
                l_month = document.getElementById( "month" );
                l_miesiac = l_month.value;
                l_day = document.getElementById( "day" );
                l_dzien = l_day.value;
                if( ( l_rok != "" ) || ( l_miesiac != "" ) || ( l_dzien != "" ) )
                {
                        l_error = 1;
                        l_d = new Date( l_rok, l_miesiac-1, l_dzien );
                        n_day = l_d.getDate();
                        n_month = l_d.getMonth()+1;
                        n_year = l_d.getFullYear();
                        if( ( n_year == l_rok ) && ( n_month == l_miesiac ) && ( n_day == l_dzien ) )
                        {
                                l_error = 0;
                        }
                }
                else
                {
                        l_error = 1;
                }
                return l_error;
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: kasuje wszystkie dane z formy aplikacja
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-26 10:57  piotrj     stworzenie
        //
        function KasujAplikacje( a_vis )
        {
                l_name = document.getElementById( "name" );
                l_name.value = "";
                l_surname = document.getElementById( "surname" );
                l_surname.value = "";
                l_phone = document.getElementById( "phone" );
                l_phone.value = "";
                l_e_mail = document.getElementById( "e_mail2" );
                l_e_mail.value = "";
                //alert( a_vis );
                if( a_vis.charAt(0) == "1" )
                {
                        l_address = document.getElementById( "address" );
                        l_address.value = "";
                }
                if( a_vis.charAt(1) == "1" )
                {
                        l_year = document.getElementById( "year" );
                        l_year.value = "";
                        l_month = document.getElementById( "month" );
                        l_month.value = "";
                        l_day = document.getElementById( "day" );
                        l_day.value = "";
                }
                if( a_vis.charAt(2) == "1" )
                {
                        l_education = document.getElementById( "education" );
                        l_education.value = "";
                }
                if( a_vis.charAt(3) == "1" )
                {
                        l_motivation = document.getElementById( "motivation" );
                        l_motivation.value = "";
                }
                if( a_vis.charAt(4) == "1" )
                {
                        l_experience = document.getElementById( "experience" );
                        l_experience.value = "";
                }
                if( a_vis.charAt(5) == "1" )
                {
                        l_skills = document.getElementById( "skills" );
                        l_skills.value = "";
                }
                if( a_vis.charAt(6) == "1" )
                {
                        l_info = document.getElementById( "info" );
                        l_info.value = "";
                }
                if( a_vis.charAt(9) == "1" )
                {
                        l_wk_refer = document.getElementById( "wk_refer" );
                        l_wk_refer.value = "";
                }
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: sprawdza, czy sa wypelnione wszystkie pola w aplikacji
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-26 10:57  piotrj     stworzenie
        //
        function CheckIsEmpty( a_req, a_vis )
        {
                txt = "Aby wysłać dane, musisz wypełnić poprawnie pola:"
                nazwypol = Array( "address", "birth", "education", "motivation", "experience", "skills", "info", "cv_file", "letter_file", "wk_refer" );
                nazwy = Array( " [Adres]", " [Data urodzenia]", " [Wykształcenie]", " [Motywacje]", " [Doświadczenie]", " [Umiejętności]", " [Informacje]", " [CV]", " [List motywacyjny]", " [Referencje]" );
                l_error = 0;
                l_name = document.getElementById( "name" );
                l_surname = document.getElementById( "surname" );
                l_phone = document.getElementById( "phone" );
                l_e_mail = document.getElementById( "e_mail2" );
                if( l_name.value == "" )
                {
                        txt = txt+" [Imie]";
                        l_error = 1;
                }
                if( l_surname.value == "" )
                {
                        txt = txt+" [Nazwisko]";
                        l_error = 1;
                }
                if( l_phone.value == "" )
                {
                        txt = txt+" [Telefon]";
                        l_error = 1;
                }
                if( l_e_mail.value == "" )
                {
                        txt = txt+" [E-mail]";
                        l_error = 1;
                }
                for( i = 0; i <= 9; i++ )
                {
                        if( ( a_req.charAt(i) == "1") && ( a_vis.charAt(i) == "1") )
                        {
                                if( i != 1 )
                                {
                                        l_pole = document.getElementById( nazwypol[i] );
                                        if( l_pole.value == "" )
                                        {
                                                l_error = 1;
                                                txt = txt+nazwy[i];
                                        }
                                }
                                else
                                {
                                        l_error = CheckDate();
                                        if( l_error == 1 )
                                        {
                                                txt = txt+" [Rok] [Miesiąc] [Dzień]";
                                        }
                                }
                        }
                }
                if( l_error == 0 )
                {
                        document.forms.aplication_form.submit();
                }
                else
                {
                        txt = txt+".";
                        alert( txt );
                }
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: funkcja chowa lub pokazuje to co ukryte/odkryte
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function showHide( a_docid ) 
        {
                obj = document.getElementById( a_docid );
                if( obj.style.display == 'none' )
                {
                        obj.style.display = 'block';
                }
                else
                {
                        obj.style.display = 'none';
                }
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: funkcja wczytuje obrazki do pamieci przy ladowaniu strony
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function imgPreloader( a_host, a_modul ) 
        {
                imageObj = new Image();
                images = new Array();
                images[0] = a_host + "/images/button_szukaj.gif";
                images[1] = a_host + "/images/button_szukaj_a.gif";
                images[2] = a_host + "/images/button_mail.gif";
                images[3] = a_host + "/images/button_mail_a.gif";
                num = 4;
                if( a_modul == "index" )
                {
                        images[num] = a_host + "/images/main_page/ic_atuty_01.gif";
                        images[num+1] = a_host + "/images/main_page/ic_atuty_01_a.gif";
                        images[num+2] = a_host + "/images/main_page/ic_atuty_02.gif";
                        images[num+3] = a_host + "/images/main_page/ic_atuty_02_a.gif";
                        images[num+4] = a_host + "/images/main_page/ic_atuty_03.gif";
                        images[num+5] = a_host + "/images/main_page/ic_atuty_03_a.gif";
                        images[num+6] = a_host + "/images/main_page/ic_uslugi_01.gif";
                        images[num+7] = a_host + "/images/main_page/ic_uslugi_01_a.gif";
                        images[num+8] = a_host + "/images/main_page/ic_uslugi_02.gif";
                        images[num+9] = a_host + "/images/main_page/ic_uslugi_02_a.gif";
                        images[num+10] = a_host + "/images/main_page/ic_uslugi_03.gif";
                        images[num+11] = a_host + "/images/main_page/ic_uslugi_03_a.gif";
                        images[num+12] = a_host + "/images/main_page/ic_uslugi_04.gif";
                        images[num+13] = a_host + "/images/main_page/ic_uslugi_04_a.gif";
                        images[num+14] = a_host + "/images/main_page/ic_uslugi_05.gif";
                        images[num+15] = a_host + "/images/main_page/ic_uslugi_05_a.gif";
                        images[num+16] = a_host + "/images/main_page/ic_uslugi_06.gif";
                        images[num+17] = a_host + "/images/main_page/ic_uslugi_06_a.gif";
                        num = num+18;
                }
                if( a_modul == "pressroom" )
                {
                        images[num] = a_host + "/images/ic_all.gif";
                        images[num+1] = a_host + "/images/ic_all_a.gif";
                        images[num+2] = a_host + "/images/ic_eps.gif";
                        images[num+3] = a_host + "/images/ic_eps_a.gif";
                        images[num+4] = a_host + "/images/ic_gif.gif";
                        images[num+5] = a_host + "/images/ic_gif_a.gif";
                        images[num+6] = a_host + "/images/ic_jpg.gif";
                        images[num+7] = a_host + "/images/ic_jpg_a.gif";
                        images[num+8] = a_host + "/images/ic_png.gif";
                        images[num+9] = a_host + "/images/ic_png_a.gif";
                        num = num+10;
                }
                for( i = 0; i < num; i++ )
                {
                        imageObj.src = images[i];
                }
        } 

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: przypisuje akcje do wykonania i robi submita
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-26 10:57  piotrj     stworzenie
        //
        function sendReferenceMail( a_text )
        {
                l_adresat = document.getElementById( "adresat" );
                l_nadawca = document.getElementById( "nadawca" );
                if( ( l_adresat.value == "" ) || ( l_nadawca.value == "" ) )
                {
                        alert( a_text );
                }
                else
                {
                        document.forms.polec_nas.submit();
                }
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: przypisuje akcje do wykonania i robi submita
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-26 10:57  piotrj     stworzenie
        //
        function SubscriptAction( a_akcja )
        {
                l_hidden_action = document.getElementById( "akcja" );
                l_hidden_action.value = a_akcja;
                document.forms.subskrypt_form.submit();
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: funkcja podmienia obrazki bez tekstu przy wywolaniu
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function changeImage2( a_name, on_off ) 
        {
                //alert( a_name );
                old_img = document.getElementById( a_name );
                old_src = old_img.src;
                len = old_src.length;
                roz = old_src.substr( len-4, len );
                if( on_off == 1 )
                {
                        new_src = old_src.substr( 0, len-4 ) + "_a" + roz;
                }
                else
                {
                        if( old_src.charAt(len-5) == "a" )
                        {
                                new_src = old_src.substr( 0, len-6 ) + roz;
                        }
                        else
                        {
                                new_src = old_src;
                        }
                }
                old_img.src = new_src
        } 

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: zmienia lokacje strony na podany adres
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function locationFromMenu( adres )
        {
                window.location = adres;
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: usowa nadmiarowe spacje ze stringa
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function erase_space( str )
        {
                newstr = "";
                i = 0;
                strlen = str.length;
                znak = str.charAt(i);
                while( ( znak != "" ) && ( i < strlen ) )
                {
                        if( znak == " " )
                        {
                                i++;
                        }
                        else
                        {
                                while( ( znak != "" ) && ( znak != " " ) && ( i < strlen ) )
                                {
                                        newstr = newstr + znak;
                                        i++;
                                        znak = str.charAt(i);
                                }
                                newstr = newstr + "+";
                                i++;
                        }
                        znak = str.charAt(i);
                }
                len = newstr.length;
                znak = newstr.charAt( len-1 );
                if( znak == "+" )
                {
                        newstr = newstr.substr( 0, len-1 );
                }
                return newstr;
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: sprawdza dlugosc wszystkich podanych slow
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function checkWordsLength( a_str )
        {
                l_ok = 1;
                l_str = "";
                l_index = 0;
                l_len = a_str.length;
                if( l_len > 1 )
                {
                        l_index = a_str.indexOf( "+" );
                        if( l_index > 0 )
                        {
                                l_str = a_str.substr( 0, l_index );
                                if( l_str.length > 1 )
                                {
                                        r_str = a_str.substr( l_index+1, l_len );
                                        l_ok = checkWordsLength( r_str );
                                }
                                else
                                {
                                        if( l_str.length > 0 )
                                        {
                                                l_ok = 0;
                                        }
                                }
                        }
                }
                else
                {
                        l_ok = 0;
                }
                return l_ok;
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: odsyla do wyszukiwania, jesli wpisano slowa
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function SendWords( a_host, a_id, text_to_alert )
        {
                check_forbidden_chars( a_id, text_to_alert );
                word_container = document.getElementById( a_id );
                words = word_container.value;
                if( words != "" )
                {
                        words = words.toLowerCase();
                        words = erase_space( words );
                        is_ok = checkWordsLength( words );
                        if( is_ok == 1 )
                        {
                                adres = a_host + "/wyszukiwanie/slowa/" + words;
                                window.location = adres;
                        }
                        else
                        {
                                alert( text_to_alert );
                        }
                }
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: inicjuje menu rozwijane listowe
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        startList = function()
        {
                if ( document.all && document.getElementById )
                {
                        navRoot = document.getElementById( "nav" );
                        for ( i=0; i < navRoot.childNodes.length; i++ )
                        {
                                node = navRoot.childNodes[i];
                                if ( node.nodeName == "LI" )
                                {
                                        node.onmouseover = function()
                                        {
                                                this.className += "over";
                                        }
                                        node.onmouseout = function()
                                        {
                                                this.className = this.className.replace( "over", "" );
                                        }
                                }
                        }
                }
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: sprawdza, czy w stringu nie ma zabronionych znakow
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function check_forbidden_chars( element_id, send, text_to_alert )
        {
                send_text_el = document.getElementById( element_id );
                send_text = send_text_el.value;
                pos = send_text.indexOf( "%" );
                pos2 = send_text.indexOf( "_" );
                if( ( pos >= 0 ) || ( pos2 >= 0 ) )
                {
                        send_text_el.value = "";
                        alert( text_to_alert );
                }
                if( send == 1 )
                {
                        if( send_text_el.value != "" )
                        {
                                document.forms.product_search.submit();
                        }
                }
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: sprawdza, czy zaznaczono parametry do wyszukiwania i robi submita
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function submit_param_search( text_to_alert)
        {
                numsel = 0;
                l_sel = "sel" + numsel;
                jest = 1;
                while( sel = document.getElementById( l_sel ) )
                {
                        if( sel.value != "" )
                        {
                                numselpar = 2;
                                l_selpar = "sel" + numsel + "par" + numselpar;
                                jestselpar = 0;
                                while( selpar = document.getElementById( l_selpar ) )
                                {
                                        if( selpar.checked )
                                        {
                                                jestselpar = 1;
                                        }
                                        numselpar++;
                                        l_selpar = "sel" + numsel + "par" + numselpar;
                                }
                                if( jestselpar == 0 )
                                {
                                        jest = 0;
                                }
                        }
                        numsel++;
                        l_sel = "sel" + numsel;
                }
                if( jest == 1 )
                {
                        kontrol = document.getElementById( "kontrol" );
                        kontrol.value = "1";
                        document.forms.product_search_param.submit();
                }
                else
                {
                        alert( text_to_alert );
                }
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: usowa wybrany parametr ze strony
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function usun_wybrany_parametr( wiersz )
        {
                selnum = "sel" + wiersz;
                l_param = document.getElementById( selnum );
                l_param.value = "";
                document.forms.product_search_param.submit();
        }

