/*
*       $Header: /repos/portalcasp/site/page/menu.js,v 1.2 2006/02/27 10:16:28 piotrj Exp $
*/

        /**
         * SWFObject v1.4: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
         *
         * SWFObject is (c) 2006 Geoff Stearns and is released under the MIT License:
         * http://www.opensource.org/licenses/mit-license.php
         *
         * **SWFObject is the SWF embed script formerly known as FlashObject. The name was changed for
         *   legal reasons.
         */
        if( typeof deconcept == "undefined" )
        {
                var deconcept = new Object();
        }
        if( typeof deconcept.util == "undefined" )
        {
                deconcept.util = new Object();
        }
        if( typeof deconcept.SWFObjectUtil == "undefined" )
        {
                deconcept.SWFObjectUtil = new Object();
        }
        deconcept.SWFObject = function( _1, id, w, h, _5, c, _7, _8, _9, _a, _b )
        {
                if( !document.createElement || !document.getElementById )
                {
                        return;
                }
                this.DETECT_KEY = _b ? _b : "detectflash";
                this.skipDetect = deconcept.util.getRequestParameter( this.DETECT_KEY );
                this.params = new Object();
                this.variables = new Object();
                this.attributes = new Array();
                if( _1 )
                {
                        this.setAttribute( "swf", _1 );
                }
                if( id )
                {
                        this.setAttribute( "id", id );
                }
                if( w )
                {
                        this.setAttribute( "width", w );
                }
                if( h )
                {
                        this.setAttribute( "height", h);
                }
                if( _5 )
                {
                        this.setAttribute( "version", new deconcept.PlayerVersion( _5.toString().split( "." ) ) );
                }
                this.installedVer = deconcept.SWFObjectUtil.getPlayerVersion( this.getAttribute( "version" ), _7 );
                if( c )
                {
                        this.addParam( "bgcolor", c );
                }
                var q = _8 ? _8 : "high";
                this.addParam( "quality", q );
                this.setAttribute( "useExpressInstall", _7 );
                this.setAttribute( "doExpressInstall", false );
                var _d = ( _9 ) ? _9 : window.location;
                this.setAttribute( "xiRedirectUrl", _d );
                this.setAttribute( "redirectUrl", "" );
                if( _a )
                {
                        this.setAttribute( "redirectUrl", _a );
                }
        };
        deconcept.SWFObject.prototype = { 
                setAttribute:function( _e, _f )
                {
                        this.attributes[_e] = _f;
                }
                , getAttribute:function( _10 )
                {
                        return this.attributes[_10];
                }
                , addParam:function( _11, _12)
                {
                        this.params[_11]=_12;
                }
                , getParams:function()
                {
                        return this.params;
                }
                , addVariable:function( _13, _14 )
                {
                        this.variables[_13] = _14;
                }
                , getVariable:function( _15 )
                {
                        return this.variables[_15];
                }
                , getVariables:function()
                {
                        return this.variables;
                }
                , getVariablePairs:function()
                {
                        var _16 = new Array();
                        var key;
                        var _18 = this.getVariables();
                        for( key in _18 )
                        {
                                _16.push( key + "=" + _18[key] );
                        }
                        return _16;
                }
                , getSWFHTML:function()
                {
                        var _19 = "";
                        if( navigator.plugins && navigator.mimeTypes && navigator.mimeTypes.length )
                        {
                                if( this.getAttribute( "doExpressInstall" ) )
                                {
                                        this.addVariable( "MMplayerType", "PlugIn" );
                                }
                                _19 = "<embed type=\"application/x-shockwave-flash\" src=\"" + this.getAttribute( "swf" ) + "\" width=\"" + this.getAttribute( "width" ) + "\" height=\"" + this.getAttribute( "height" ) + "\"";
                                _19 += " id=\"" + this.getAttribute( "id" ) + "\" name=\"" + this.getAttribute( "id" ) + "\" ";
                                var _1a = this.getParams();
                                for( var key in _1a )
                                {
                                        _19 += [key] + "=\"" + _1a[key] + "\" ";
                                }
                                var _1c = this.getVariablePairs().join( "&" );
                                if( _1c.length > 0 )
                                {
                                        _19 += "flashvars=\"" + _1c + "\"";
                                }
                                _19 += "/>";
                        }
                        else
                        {
                                if( this.getAttribute( "doExpressInstall" ) )
                                {
                                        this.addVariable( "MMplayerType", "ActiveX" );
                                }
                                _19 = "<object id=\"" + this.getAttribute( "id" ) + "\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\"" + this.getAttribute( "width" ) + "\" height=\"" + this.getAttribute( "height" ) + "\">";
                                _19 += "<param name=\"movie\" value=\"" + this.getAttribute( "swf" ) + "\" />";
                                var _1d = this.getParams();
                                for( var key in _1d )
                                {
                                        _19 += "<param name=\"" + key + "\" value=\"" + _1d[key] + "\" />";
                                }
                                var _1f = this.getVariablePairs().join( "&" );
                                if( _1f.length > 0 )
                                {
                                        _19 += "<param name=\"flashvars\" value=\"" + _1f + "\" />";
                                }
                                _19 += "</object>";
                        }
                        return _19;
                }
                , write:function( _20 )
                {
                        if( this.getAttribute( "useExpressInstall" ) )
                        {
                                var _21 = new deconcept.PlayerVersion( [6, 0, 65] );
                                if( this.installedVer.versionIsValid( _21 ) && !this.installedVer.versionIsValid( this.getAttribute( "version" ) ) )
                                {
                                        this.setAttribute( "doExpressInstall", true );
                                        this.addVariable( "MMredirectURL", escape( this.getAttribute( "xiRedirectUrl" ) ) );
                                        document.title = document.title.slice( 0, 47 ) + " - Flash Player Installation";
                                        this.addVariable( "MMdoctitle", document.title );
                                }
                        }
                        if( this.skipDetect || this.getAttribute( "doExpressInstall" ) || this.installedVer.versionIsValid( this.getAttribute( "version" ) ) )
                        {
                                var n = ( typeof _20 == "string" ) ? document.getElementById( _20 ) : _20;
                                n.innerHTML = this.getSWFHTML();
                                return true;
                        }
                        else
                        {
                                if( this.getAttribute( "redirectUrl" ) != "" )
                                {
                                        document.location.replace( this.getAttribute( "redirectUrl" ) );
                                }
                        }
                        return false;
                }
        };
        deconcept.SWFObjectUtil.getPlayerVersion = function( _23, _24 )
        {
                var _25 = new deconcept.PlayerVersion( [0, 0, 0] );
                if( navigator.plugins && navigator.mimeTypes.length )
                {
                        var x = navigator.plugins[ "Shockwave Flash" ];
                        if( x && x.description )
                        {
                                _25 = new deconcept.PlayerVersion( x.description.replace( /([a-z]|[A-Z]|\s)+/, "" ).replace( /(\s+r|\s+b[0-9]+)/, "." ).split( "." ) );
                        }
                }
                else
                {
                        try
                        {
                                var axo = new ActiveXObject( "ShockwaveFlash.ShockwaveFlash" );
                                for( var i = 3; axo != null; i++ )
                                {
                                        axo = new ActiveXObject( "ShockwaveFlash.ShockwaveFlash." + i );
                                        _25 = new deconcept.PlayerVersion( [i, 0, 0] );
                                }
                        }
                        catch( e ){}
                        if( _23 && _25.major > _23.major )
                        {
                                return _25;
                        }
                        if( !_23 || ( ( _23.minor != 0 || _23.rev != 0 ) && _25.major == _23.major ) || _25.major != 6 || _24 )
                        {
                                try
                                {
                                        _25 = new deconcept.PlayerVersion( axo.GetVariable( "$version" ).split( " " )[1].split( "," ) );
                                }
                                catch( e ){}
                        }
                }
                return _25;
        };
        deconcept.PlayerVersion = function( _29 )
        {
                this.major = parseInt( _29[0] ) != null ? parseInt( _29[0] ) : 0;
                this.minor = parseInt( _29[1] ) || 0;
                this.rev = parseInt( _29[2] ) || 0;
        };
        deconcept.PlayerVersion.prototype.versionIsValid = function( fv )
        {
                if( this.major < fv.major )
                {
                        return false;
                }
                if( this.major > fv.major )
                {
                        return true;
                }
                if( this.minor < fv.minor )
                {
                        return false;
                }
                if( this.minor > fv.minor )
                {
                        return true;
                }
                if( this.rev < fv.rev )
                {
                        return false;
                }
                return true;
        };
        deconcept.util = {
                getRequestParameter:function( _2b )
                {
                        var q = document.location.search || document.location.hash;
                        if( q )
                        {
                                var _2d = q.indexOf( _2b + "=" );
                                var _2e = ( q.indexOf( "&", _2d ) >- 1 ) ? q.indexOf( "&", _2d ) : q.length;
                                if( q.length > 1 && _2d >- 1 )
                                {
                                        return q.substring( q.indexOf( "=", _2d ) + 1, _2e );
                                }
                        }
                        return "";
                }
        };
        if( Array.prototype.push == null )
        {
                Array.prototype.push = function( _2f )
                {
                        this[this.length] = _2f;
                        return this.length;
                };
        }
        var getQueryParamValue = deconcept.util.getRequestParameter;
        var FlashObject = deconcept.SWFObject; // for backwards compatibility
        var SWFObject = deconcept.SWFObject;

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: funkcja zalatwia problem z wstawianiem flashy do IE
        //
        function drawFlash( path, param, quality, bgcolor, width, height, name, flashDiv )
        {
		var so = new SWFObject( path, name, width, height, "8", bgcolor );
		so.addParam( "quality", quality );
                var par = param.split( "&" );
                for( var i = 0; i < par.length; i++ )
                {
                        var p = par[i].split( "=" );
                        so.addVariable( p[0], p[1] );
                }
                so.addParam( "wmode", "transparent" );
		so.write( flashDiv );
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: funkcja zalatwia problem z wstawianiem flashy do IE
        //
        function drawFlashOld( path, param, quality, bgcolor, width, height, name )
        {
                document.write( '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="'+width+'" height="'+height+'" id="mainElem" align="middle">' );
                document.write( '<param name="allowScriptAccess" value="sameDomain" />' );
                document.write( '<param name="movie" value="'+path+'" />' );
                document.write( '<param name="quality" value="'+quality+'" />' );
                document.write( '<param name="bgcolor" value="'+bgcolor+'" />' );
                document.write( '<param name="wmode" value="transparent" >' );
                document.write( '<param name="FlashVars" value="'+param+'" >' );
                document.write( '<embed src="'+path+'?'+param+'" quality="'+quality+'" bgcolor="'+bgcolor+'" width="'+width+'" height="'+height+'" name="'+name+'" wmode="transparent" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />' );
                document.write( '</object>' );
        }

        //global object that contains popup image data
        var popupImageObj;
        
        /**
         * Global array PARAM_ARRAY that contains all param data MUST be provided!
         * Global variable EMPTY_OPTION_VALUE that contains first element name in param select MUST be provided!
         */

        //global array that contains product data
        var products = new Array();

        /**
         * Class used for managing parameter data
         * 
         * @param paramId       parameter id 
         * @param name          parameter name
         */
        function ParameterObj( paramId, name )
        {
                this.id = paramId;              //parameter id
                this.valueCount = 0;            //number of parameter values
                this.valueId = new Array();     //array that contains specified parameter value ids
                this.valueIdIndex = new Array();
                this.useValues = 'undefined';   //determines using all values in parameter or any value in product search
                this.name = name;
                this.isParamVisible = true;
        }

        /**
         * Function used to add parameter value id
         * 
         * @param valueId       id of parameter value
         */
        function ParameterObj_addValueId( valueId )
        {
                this.valueId[this.valueCount] = valueId;
                this.valueIdIndex[valueId] = valueId;
                this.valueCount++;
        }

        /**
         * Function used to get parameter name
         * 
         * @return string that contains parameter name
         */
        function ParameterObj_getName( name )
        {
                return this.name;
        }

        /**
         * Function used to get parameter id
         * 
         * @return string that contains parameter id
         */
        function ParameterObj_getId()
        {
                return this.id;
        }

        /**
         * Function used to check if parameter is visible
         * 
         * @return boolean true - if parameter is visible, false - otherwise
         */
        function ParameterObj_isVisible()
        {
                return this.isParamVisible;
        }

        /**
         * Function sets parameter visible state
         * 
         * @param state         boolean that is true if parameter is visible, false - otherwise
         */
        function ParameterObj_setVisible( state )
        {
                this.isParamVisible = state;
        }

        /**
         * Function checks if specified parameter fullfill search conditions specified by input parameter
         * Checks if parameters have same id, and compares parameters values.
         * If specified parameter must have all values provided by input parameter function checks if parameters have same values
         * If specified parameter must have any of inputed parameter values even only one value is enought to fullfill search conditions
         *
         * @param parameter     ParameterObj that contains search conditions
         *
         * @return boolean      true - specified parameter fullfills search conditions
         *                      false - specified parameter does not fullfill search conditions
         */
        function ParameterObj_fullfill( parameter )
        {
                if( this.id != parameter.id ) return false;
                if( parameter.useValues == 'all' )
                {
                        var id = null;
                        for( var i=0; i < parameter.valueId.length; i++ )
                        {
                                id = parameter.valueId[i];
                                
                                if( this.valueIdIndex.length <= id ) return false;
                                
                                if( this.valueIdIndex[id] != id ) return false;
                        }
                
                        return true;
                }
                
                if( parameter.useValues == 'any' )
                {
                        for( var i=0; i < parameter.valueId.length; i++ )
                        {
                                id = parameter.valueId[i];
                                
                                if( this.valueIdIndex.length <= id ) continue;
                                
                                if( this.valueIdIndex[id] == id ) return true;
                        }
                        
                        return false;
                }
        }

        /**
         * Function used for debug purposes.
         * Function shows parameter data in alert window
         *
         * @param title         string that contains popup window title
         */
        function ParameterObj_showData( title )
        {
                var text = 'Param id = ' + this.id + '\nValues:\n';
                
                for( var i = 0; i < this.valueId.length; i++ )
                {
                        text += this.valueId[i] + ', ';
                
                }
                
                text += '\nUse values: ' + this.useValues;
                if( ( title != '' ) && ( title != 'undefined' ) && ( title != null ) ) text += '\nTitle: ' + title;
                
                alert(text);
        }

        //adding functions to prototype
        ParameterObj.prototype.addValueId = ParameterObj_addValueId;
        ParameterObj.prototype.isVisible = ParameterObj_isVisible;
        ParameterObj.prototype.setVisible = ParameterObj_setVisible;
        ParameterObj.prototype.getId = ParameterObj_getId;
        ParameterObj.prototype.getName = ParameterObj_getName;
        ParameterObj.prototype.fullfill = ParameterObj_fullfill;
        ParameterObj.prototype.showData = ParameterObj_showData;

        /**
         * Class used for managing product data
         * 
         * @param prodId       product id
         */
        function ProductObj( prodId )
        {
                this.id = prodId;               //product id
                this.params = new Array();      //contains product parameters object
                this.paramCount = 0;            //parameters number
                this.found = true;              //determines if product fullfills search conditions
        }

        /**
         * Function used to add ParameterObj object to product
         * 
         * @param param instance of ParameterObj class
         */
        function ProductObj_addParam( param )
        {
                this.params[param.id] = param;
                this.paramCount++;
        }

        /**
         * Function used to check if product fullfills search conditions defined by parameter paramToCheck
         * 
         * @param paramToCheck  instance of ParameterObj that contains search conditions
         */
        function ProductObj_checkParam( paramToCheck )
        {
                var position = paramToCheck.id
                if( this.params.length >= position )
                {
                        var param = this.params[position];
                        if( typeof( param ) == 'object' )
                        {
                                if( param.fullfill( paramToCheck ) ) return;
                        }
                }
                
                this.found = false;
        }

        /**
         * Function checks if product fullfills search conditions.
         * Function checks only actual product state. State can change after parameters check
         * 
         * @return boolean      true - if product fullfills search conditions
         *                      false - if product does not fullfill search conditions
         */
        function ProductObj_isFound()
        {
                return this.found;
        }

        /**
         * Function reset product state to start state
         */
        function ProductObj_resetFound()
        {
                this.found = true;
        }

        //adding functions to prototype
        ProductObj.prototype.addParam = ProductObj_addParam;
        ProductObj.prototype.checkParam = ProductObj_checkParam;
        ProductObj.prototype.isFound = ProductObj_isFound;
        ProductObj.prototype.resetFound = ProductObj_resetFound;

        /**
         * Function used to copy search parameter div defined by id like 'paramSearchDiv_PARAMID_prototype' prototypes MUST be provided.
         * Function manages parameter select html object data
         *
         * @param paramId       contains parameter id
         */
        function showSearchParam( paramId )
        {
                var paramDiv = document.getElementById( 'paramSearchDiv_' + paramId + '_prototype' ).cloneNode(true);
                paramDiv.id = 'paramSearchDiv_' + paramId;
                paramDiv.name = 'paramSearchDiv_' + paramId;
                paramDiv.style.display = 'block';
                
                document.getElementById( 'paramSearchPanelDiv' ).appendChild( paramDiv );
                
                manageParamSelect( paramId, true );
                countProducts();
        }

        /**
         * Function hides search parameter div defined by id like 'paramSearchDiv_PARAM_ID'.
         * Function manages parameter select html object data
         *
         * @param paramId       contains parameter id
         */
        function hideSearchParam( paramId )
        {
                var paramDiv = document.getElementById( 'paramSearchDiv_' + paramId );
                paramDiv.parentNode.removeChild( paramDiv );
                
                manageParamSelect( paramId, false );
                
                countProducts();
        }

        /**
         * Function manages html select object state that contains parameter data.
         * Id and name attribute of this object MUST be 'paramSearchSelect'
         * Document MUST contain summary div html object 'paramSearchSummaryDiv1' and 'paramSearchSummaryDiv2'
         *
         * @param paramId       string id of parameter in select
         * @param isReduced     boolean determines action on parameter describbed by id
         *                      true - parameter must be added to select object
         *                      false - parameter must be removed from select object
         */
        function manageParamSelect( paramId, isReduced )
        {
                var paramSelect = document.getElementById( 'paramSearchSelect' );
                
                //updating global parameters visibility
                for( var i = 0; i < PARAM_ARRAY.length; i++ )
                {
                        if( PARAM_ARRAY[i].getId() == paramId )
                        {
                                PARAM_ARRAY[i].setVisible( !isReduced );
                                break;
                        }
                }
                
                //cleaning paramSelect
                for( var i = 0; i < paramSelect.options.length; i++ )
                {
                        paramSelect.options[i] = null;
                }
                
                //generating paramSelect parameter options
                var optionEl = null;
                paramSelect.options[0] = new Option( EMPTY_OPTION_VALUE, '' );
                var optionCounter = 1;
                for( var i = 0; i < PARAM_ARRAY.length; i++ )
                {
                        if( PARAM_ARRAY[i].isVisible() )
                        {
                                paramSelect.options[optionCounter] = new Option( PARAM_ARRAY[i].getName(), PARAM_ARRAY[i].getId() );
                                optionCounter++;
                        }
                        
                }
                
                paramSelect.selectedIndex = 0;
                
                var hiddenOptionCount = 0;
                
                if( isReduced )
                {
                        if( paramSelect.options.length == 1 ) paramSelect.style.display = 'none';
                        document.getElementById( 'paramSearchSummaryDiv1' ).style.display = 'block';
                        document.getElementById( 'paramSearchSummaryDiv2' ).style.display = 'block';
                }
                else
                {
                        paramSelect.style.display = 'block';
                        if( paramSelect.options.length == PARAM_ARRAY.length + 1 ) 
                        {
                                document.getElementById( 'paramSearchSummaryDiv1' ).style.display = 'none';
                                document.getElementById( 'paramSearchSummaryDiv2' ).style.display = 'none';
                        }
                }
        }

        /**
         * Function counts products that fullfill search conditions
         * Search conditions must be defined in 'paramSearchForm' html form
         *
         * Search conditions MUST be defined as elements with name and id as:
         *
         * checkboxes - 'paramSearchParameter_PARAMETERID_VALUEID' where PARAMETERID - is parameter id and VALUEID is id of specified parameter value
         *
         * radios - 'paramSearchAllowedValues_PARAMETERID' determines if product must contain all checked values (element value 'all') or only one of them (element value 'any')
         *
         * Function sets html object values:
         * 'productNumber1' - number of products that fullfill search criteria
         * 'productNumber2' - number of products that fullfill search criteria
         * 'selectedProduct' - id of products that fillfill search criteria separated by comma
         * Those elements MUST be provided.
         */
        function countProducts()
        {
                var form = document.getElementById( 'paramSearchForm' );
                
                var params = new Array();
                
                var inputs = form.getElementsByTagName( 'input' );
                for( var i = 0; i < inputs.length; i++ )
                {
                        //searching checked values
                        if( ( inputs[i].type == 'checkbox' ) && ( inputs[i].name.match( /^paramSearchParameter_[0-9]+_[0-9]+$/ ) != null ) )
                        {
                                if( inputs[i].checked )
                                {
                                        var paramString = new String( inputs[i].name ).replace( /^paramSearchParameter_/, '' );
                                        var paramId = paramString.replace( /_[0-9]+$/, '' );
                                        var valueId = paramString.replace( /^[0-9]+_/, '' );
                                
                                        if( params[paramId] == null )
                                        {
                                                params[paramId] = new ParameterObj( paramId );
                                        }
                                        params[paramId].addValueId( valueId );
                                }
                        }
                        
                        //searching all or any param criteria
                        if( ( inputs[i].type == 'radio' ) && ( inputs[i].name.match( /^paramSearchAllowedValues_[0-9]+$/ ) != null ) )
                        {
                                if( inputs[i].checked )
                                {
                                        inputs[i].focus();
                                        
                                        var paramId = new String( inputs[i].name ).replace( /^paramSearchAllowedValues_/, '' );
                                
                                        if( params[paramId] == null )
                                        {
                                                params[paramId] = new ParameterObj( paramId );
                                        }
                                        
                                        params[paramId].useValues = inputs[i].value;
                                        
                                }
                        }
                }
                
                var i,j;
                var searchInProducts = true;
                
                //reseting product found status
                for( i = 0; i < products.length; i++ )
                {
                        products[i].resetFound();
                }
                
                //checking if products fillfill search criteria
                for( i = 0; i < params.length; i++ )
                {
                        if( ( typeof( params[i] ) == 'object' ) && ( params[i] != null ) )
                        {
                                if( params[i].valueCount == 0 )
                                {
                                        searchInProducts = false;
                                        break;
                                }
                                
                                for( j = 0; j < products.length; j++ )
                                {
                                        if( products[j].isFound() )
                                        {
                                                products[j].checkParam( params[i] )
                                        }
                                }
                        }
                
                }
                
                //generating selectedProduct value
                var searchCount = 0;
                var searchProductId = '';
                for( i = 0; i < products.length && searchInProducts; i++ )
                {
                        if( products[i].isFound() )
                        {
                                searchCount++;
                                searchProductId += products[i].id + ';';
                        }
                }
                
                document.getElementById( 'productNumber1' ).innerHTML = searchCount;
                document.getElementById( 'productNumber2' ).innerHTML = searchCount;
                //document.getElementById( 'selectedProduct' ).value = searchProductId;
                document.getElementById( 'checked_product' ).value = searchProductId;
        }

        function submitParamSearchForm( formName, inputName, errorMessage )
        {
                var element = document.getElementById( inputName );
                if( ( typeof( element ) == 'object' ) && ( element != null ) )
                {
                        if( element.value != '' ) 
                        {
                                var form = document.getElementById( formName );
                                if( ( typeof( form ) == 'object' ) && ( form != null ) )
                                {
                                        form.submit();
                                        return;
                                }
                        }
                        alert( errorMessage );
                }
        }
        
//------------------------------------------------------------------------------------------------------------

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: sprawdza, czy w wyszukiwarce dla katalogu 
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function checkCatalogWords( a_txt, a_txt2, a_loc )
        {
                //alert(document.getElementById( "katname" ).checked);
                /*if( ( document.getElementById( "katname" ).checked != true ) && ( document.getElementById( "katdesc" ).checked != true ) && ( document.getElementById( "katcode" ).checked != true ) )
                {
                        alert( a_txt2 );
                }
                else
                {*/
                        words_container = document.getElementById( "catalog_words2" );
                        send_text = words_container.value;
                        newstr = "";
                        len = send_text.length;
                        i = 0;
                        while( ( send_text.charAt(i) != "" ) && ( i < len ) )
                        {
                                if( send_text.charAt(i) == " " )
                                {
                                        i++;
                                }
                                else
                                {
                                        while( ( send_text.charAt(i) != "" ) && ( send_text.charAt(i) != " " ) && ( i < len ) )
                                        {
                                                newstr = newstr + send_text.charAt(i);
                                                i++;
                                        }
                                        newstr = newstr + " ";
                                        i++;
                                }
                        }
                        len = newstr.length;
                        if( newstr.charAt(len-1) == " " )
                        {
                                newstr = newstr.substr( 0, len-1 );
                        }
                        if( newstr != "" )
                        {
                                document.getElementById( "catalog_words" ).value = newstr;
                                document.forms.catalog_words_search.action = a_loc;
                                document.forms.catalog_words_search.submit();
                        }
                        else
                        {
                                words_container.value = "";
                                document.getElementById( "catalog_words" ).value = "";
                                alert( a_txt );
                        }
                //}
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: wysyla zamowienie
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function sendOrder( a_text, a_type, a_text2, a_logged )
        {
                if( a_logged == 1 )
                {
                        if( document.getElementById( "regulamin" ).checked == true )
                        {
                                ok = 1;
                        }
                        else
                        {
                                ok = 0;
                        }
                }
                else
                {
                        ok = 1;
                }
                if( ok == 1 )
                {
                        if( ( a_type == 1 ) || ( ( document.getElementById( "exname" ).value != "" ) && ( document.getElementById( "exsurname" ).value != "" ) && ( document.getElementById( "exmail" ).value != "" ) && ( document.getElementById( "exphone" ).value != "" ) ) )
                        {
                                document.getElementById( "ordzamow" ).value = 1;
                                setOrder( 0, 0 );
                        }
                        else
                        {
                                alert( a_text );
                        }
                }
                else
                {
                        alert( a_text2 );
                }
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: dodaje produkt do koszyka
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function setOrder( a_id, a_del )
        {
                if( a_del == 1 )
                {
                        todel = a_id;
                }
                else
                {
                        todel = -1;
                }
                num = 0;
                name = "ordcode"+num;
                dName = "orddescr"+num;
                fullcode = "";
                fulldesc = "";
                while( l_code = document.getElementById( name ) )
                {
                        descr = document.getElementById( dName ).value;
                        descr2 = descr.replace( /\|/, " " );
                        if( num != todel )
                        {
                                ilosc = document.getElementById( "kpr"+num ).value;
                                fullcode += l_code.value+"+"+ilosc+"|";
                                fulldesc += descr2+"|";
                        }
                        num++;
                        name = "ordcode"+num;
                        dName = "orddescr"+num;
                }
                document.getElementById( "setfull" ).value = 1;
                document.getElementById( "fullorder" ).value = fullcode;
                document.getElementById( "fulldescr" ).value = fulldesc;
                document.forms.orderform.submit();
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: dodaje produkt do koszyka
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function addToBasket( a_id, a_txt )
        {
                numer = 1;
                chks = "chks" + numer;
                ok = 1;
                oktmp = 0;
                oldname = "";
                while( ( checks = document.getElementById( chks ) ) )
                {
                        name = checks.name;
                        if( oldname != name )
                        {
                                if( ( oktmp == 0 ) && ( oldname != "" ) )
                                {
                                        ok = 0;
                                }
                                oldname = name;
                                oktmp = 0;
                        }
                        if( checks.checked )
                        {
                                oktmp = 1;
                        }
                        numer++;
                        chks = "chks" + numer;
                }
                if( ( oktmp == 0 ) && ( oldname != "" ) )
                {
                        ok = 0;
                }
                if( ok == 1 )
                {
                        l_cena = document.getElementById( "cena" ).value;
                        l_kod = document.getElementById( "kod" ).value;
                        l_zam = a_id+"+"+l_kod+"+"+l_cena+"+1|";
                        document.getElementById( "koszykadd" ).value = l_zam;
                        document.forms.koszykmem.submit();
                }
                else
                {
                        alert( a_txt );
                }
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: sprawdza, czy e-mail i haslo do rejestracji nie sa puste
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function sendPassword( a_txt, a_adr )
        {
                if( document.getElementById( "exemail" ).value != "" )
                {
                        document.forms.exlogin.action = a_adr;
                        document.forms.exlogin.submit();
                }
                else
                {
                        alert( a_txt );
                }
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: sprawdza, czy e-mail i haslo do rejestracji nie sa puste
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function sendPassword2( a_txt, a_adr, a_email )
        {
                if( ( document.getElementById( "exemail" ).value != "" ) && ( document.getElementById( "exemail" ).value != a_email ) )
                {
                        document.forms.exlogin.action = a_adr;
                        document.forms.exlogin.submit();
                }
                else
                {
                        alert( a_txt );
                }
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: przelacza pomiedzy wyborem polskich wojewodztw, a zmiana kraju
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function changeCountry( a_id )
        {
                adiv = document.getElementById( a_id );
                ainp = document.getElementById( "exkraj" );
                asel = document.getElementById( "exprovince" );
                if( document.getElementById( "exinny" ).checked == true )
                {
                        adiv.style.color = "#cccccc";
                        ainp.style.borderColor = "#7c94a5";
                        ainp.disabled = false;
                        asel.disabled = true;
                        asel.value = 0;
                }
                else
                {
                        adiv.style.color = "#666666";
                        ainp.value = "";
                        ainp.style.borderColor = "#cccccc";
                        ainp.disabled = true;
                        asel.disabled = false;
                }
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: sprawdza, czy e-mail i haslo do rejestracji nie sa puste
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function checkRegistrationForm( a_text, a_pass_text, a_type, a_adr )
        {
                if( ( document.getElementById( "exname" ).value != "" ) && ( document.getElementById( "exsurname" ).value != "" ) && ( document.getElementById( "exmail" ).value != "" ) && ( document.getElementById( "exstreet" ).value != "" ) && ( document.getElementById( "expostcode" ).value != "" ) && ( document.getElementById( "excity" ).value != "" ) && ( document.getElementById( "exphone" ).value != "" ) && ( ( ( document.getElementById( "expass" ).value != "" ) && ( document.getElementById( "expass2" ).value != "" ) ) || ( a_type == 2 ) ) )
                {
                        if( document.getElementById( "expass" ).value == document.getElementById( "expass2" ).value )
                        {
                                if( a_type == 2 )
                                {
                                        document.getElementById( "exloginform" ).action = a_adr;
                                        //document.forms.exlogin.action = a_adr;
                                }
                                document.getElementById( "exloginform" ).submit();
                                //document.forms.exlogin.submit();
                        }
                        else
                        {
                                alert( a_pass_text );
                        }
                }
                else
                {
                        alert( a_text );
                }
        }



        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: sprawdza, czy e-mail i haslo do rejestracji nie sa puste
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function checkLogin( a_text )
        {
                if( ( document.getElementById( "exemail" ).value != "" ) && ( document.getElementById( "exhaslo" ).value != "" ) )
                {
                        try
                        {
                                document.getElementById( "exloginform" ).submit();
                                //document.forms.exlogin.submit();
                        }
                        catch( e )
                        {
                                alert( e );
                        }
                }
                else
                {
                        alert( a_text );
                }
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: sprawdza, czy e-mail i haslo do rejestracji nie sa puste
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function checkLogin2( a_text, a_email, a_pass )
        {
                if( ( document.getElementById( "exemail2" ).value != "" ) && ( document.getElementById( "exemail2" ).value != a_email ) && ( document.getElementById( "exhaslo2" ).value != "" ) && ( document.getElementById( "exhaslo2" ).value != a_pass ) )
                {
                        document.getElementById( "exlogin2" ).submit();
                        //document.forms.exlogin.submit();
                }
                else
                {
                        alert( a_text );
                }
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: sprawdza, czy zaznaczony jest przynajmniej jeden produkt
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function unCheck( a_id, a_mem_id )
        {
                a_num = "chks"+a_id
                check = document.getElementById( a_num );
                memory = "mem"+a_mem_id;
                chk = document.getElementById( memory );
                if( chk.value == a_id )
                {
                        check.checked = false;
                        chk.value = 0;
                }
                else
                {
                        chk.value = a_id;
                }
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: sprawdza, czy zaznaczony jest przynajmniej jeden produkt
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function isProductChecked( a_tekst )
        {
                jest = 0;
                numer = 0;
                chk = "chk" + numer;
                while( ( check = document.getElementById( chk ) ) && ( jest == 0 ) )
                {
                        if( check.checked == true )
                        {
                                jest = 1;
                        }
                        numer++;
                        chk = "chk" + numer;
                }
                if( jest == 1 )
                {
                        document.forms.check_prod.submit();
                }
                else
                {
                        alert( a_tekst );
                }
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: sprawdza, czy zaznaczony jest przynajmniej jeden parametr
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function isParamChecked( a_tekst )
        {
                jest = 0;
                numer = 0;
                chk = "chk" + numer;
                while( ( check = document.getElementById( chk ) ) && ( jest == 0 ) )
                {
                        if( check.checked == true )
                        {
                                jest = 1;
                        }
                        numer++;
                        chk = "chk" + numer;
                }
                if( jest == 1 )
                {
                        document.forms.check_param.submit();
                }
                else
                {
                        alert( a_tekst );
                }
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: zaznacza wszystkie checkboxy
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function check_all()
        {
                numer = 0;
                chk = "chk" + numer;
                while( ( check = document.getElementById( chk ) ) )
                {
                        check.checked = true;
                        numer++;
                        chk = "chk" + numer;
                }
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: odznacza wszystkie checkboxy
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function check_none()
        {
                numer = 0;
                chk = "chk" + numer;
                while( ( check = document.getElementById( chk ) ) )
                {
                        check.checked = false;
                        numer++;
                        chk = "chk" + numer;
                }
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: obsluguje kody produktow
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function zmien_kod()
        {
                vkod = document.getElementById( "kod" );
                vdkod = document.getElementById( "dkod" );
                vkod.value = vdkod.value;
                vcena = document.getElementById( "cena" );
                vdcena = document.getElementById( "dcena" );
                vcena.value = vdcena.value;
                vcenavat = document.getElementById( "cenavat" );
                vvat = document.getElementById( "dvat" );
                numer = 1;
                chks = "chks" + numer;
                chkc = "chkc" + numer;
                while( ( checks = document.getElementById( chks ) ) )
                {
                        if( checks.checked )
                        {
                                vkod.value = vkod.value + checks.value;
                                checkc = document.getElementById( chkc );
                                new_valuec = parseFloat( checkc.value );
                                old_value_plus = parseFloat( vcena.value );
                                vcena.value = old_value_plus + new_valuec;
                        }
                        numer++;
                        chks = "chks" + numer;
                        chkc = "chkc" + numer;
                }
                cena_float = vcena.value;
                pos_cena = cena_float.indexOf( "." );
                if( pos_cena < 0 )
                {
                        pos_cena = cena_float.indexOf( "," );
                        if( pos_cena < 0 )
                        {
                                cena_float = cena_float + ".00";
                        }
                        else
                        {
                                s1 = cena_float.substring( 0, pos_cena );
                                s1 = parseInt( s1 );
                                s2 = cena_float.substring( pos_cena+1, pos_cena+2 );
                                s2 = parseInt( s2 );
                                v1 = cena_float.substring( pos_cena+2, pos_cena+3 );
                                v1 = parseInt( v1 );
                                v2 = cena_float.substring( pos_cena+3, pos_cena+4 );
                                v2 = parseInt( v2 );
                                if( v2 > 5 )
                                {
                                        v1++;
                                        if( v1 > 9 )
                                        {
                                                v1 = 0;
                                                s2++;
                                                if( s2 > 9 )
                                                {
                                                        s2 = 0;
                                                        s1++;
                                                }
                                        }
                                }
                                cena_float = s1 + "." + s2 + v1;
                        }
                }
                //vcena.value = cena_float;
                vcenaval = cena_float;
                somelen = vcenaval.length;
                dotpos = vcenaval.indexOf( "." ) + 3;
                if( dotpos < somelen )
                {
                        vcenaval = vcenaval.substring( 0, dotpos )
                }
                vcena.value = vcenaval;
                new_vat = parseFloat( vvat.value );
                vcenavatval = vcena.value * new_vat;
                vcenavat.value = vcenavatval;
                new_vcenavat = vcenavat.value;
                pos = new_vcenavat.indexOf( "." );
                if( pos >= 0  )
                {
                        ns1 = new_vcenavat.substring( 0, pos );
                        ns1 = parseInt( ns1 );
                        ns2 = new_vcenavat.substring( pos+1, pos+2 );
                        ns2 = parseInt( ns2 );
                        nv1 = new_vcenavat.substring( pos+2, pos+3 );
                        if( nv1 != "" )
                        {
                                nv1 = parseInt( nv1 );
                        }
                        else
                        {
                                nv1 = 0;
                        }
                        nv2 = new_vcenavat.substring( pos+3, pos+4 );
                        if( nv2 != "" )
                        {
                                nv2 = parseInt( nv2 );
                        }
                        else
                        {
                                nv2 = 0;
                        }
                        if( nv2 > 5 )
                        {
                                nv1++;
                                if( nv1 > 9 )
                                {
                                        nv1 = 0;
                                        ns2++;
                                        if( ns2 > 9 )
                                        {
                                                ns2 = 0;
                                                ns1++;
                                        }
                                }
                        }
                        someval = ns1 + "." + ns2 + nv1
                        somelen = someval.length;
                        dotpos = someval.indexOf( "." ) + 3;
                        if( dotpos < somelen )
                        {
                                someval = someval.substring( 0, dotpos )
                        }
                        vcenavat.value = someval;
                }
                else
                {
                        vcenavat.value = new_vcenavat + ".00";
                }
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: funkcja podswietla tabbed panel
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function lightTabbed( a_name, on )
        {
                iname = a_name+"div";
                obj = document.getElementById( iname );
                //if( ( obj.style.fontWeight == 'normal' ) || ( obj.style.fontWeight == '400' ) )
                //if( ( obj.style.color == '#3e505d' ) || ( obj.style.color == 'rgb(62, 80, 93)' ) || ( obj.style.color == '#3e505e' ) || ( obj.style.color == 'rgb(62, 80, 94)' ) )
                if( !( ( obj.style.color == '#3e505c' ) || ( obj.style.color == 'rgb(62, 80, 92)' ) ) )
                {
                        if( on == 1 )
                        {
                                obj.style.color = '#3e505e';
                                obj.style.backgroundColor = '#e0e0e0';
                                idiva = iname+"a";
                                document.getElementById( idiva ).style.display = "none"
                                idivb = iname+"b";
                                document.getElementById( idivb ).style.display = "block"
                        }
                        else
                        {
                                obj.style.color = '#3e505d';
                                obj.style.background = 'none';
                                idiva = iname+"a";
                                document.getElementById( idiva ).style.display = "block"
                                idivb = iname+"b";
                                document.getElementById( idivb ).style.display = "none"
                        }
                        
                }
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: funkcja zarzadza przelaczaniem tabbed panel
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function showTabbed( a_name, a_num, a_id ) 
        {
                // a_name to nazwa wspolna dla grupy paneli
                // a_num to ilosc paneli w grupie [ 1..n ]
                // a_id to numer panelu w grupie [ 0..n-1 ]
                for( i = 0; i < a_num; i++ )
                {
                        l_tab = ''+a_name+''+i+'';
                        obj = document.getElementById( l_tab );
                        obj.style.display = 'none';
                        l_tabtop = ''+a_name+''+i+'topdiv';
                        if( objtop = document.getElementById( l_tabtop ) )
                        {
                                objtop.style.color = '#3e505d';
                                objtop.style.background = 'none';
                                //objtop.style.fontWeight = 'normal';
                                idiva = l_tabtop+"a";
                                document.getElementById( idiva ).style.background = "none"
                                document.getElementById( idiva ).style.display = "block"
                                idivb = l_tabtop+"b";
                                document.getElementById( idivb ).style.display = "none"
                        }
                }
                l_tab = ''+a_name+''+a_id+'';
                obj = document.getElementById( l_tab );
                obj.style.display = 'block';
                l_tabtop = ''+a_name+''+a_id+'topdiv';
                objtop = document.getElementById( l_tabtop );
                objtop.style.color = '#3e505c';
                objtop.style.backgroundColor = '#e0e0e0';
                //objtop.style.fontWeight = 'bold';
                idiva = l_tabtop+"a";
                document.getElementById( idiva ).style.backgroundColor = "#e0e0e0"
                document.getElementById( idiva ).style.display = "none"
                idivb = l_tabtop+"b";
                document.getElementById( idivb ).style.display = "block"
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: funkcja wyswietla diva z tekstem 
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function showSearchDiv( a_type )
        {
                oDiv = document.getElementById( "searchwait" );
                oDiv.style.display = 'block';
                if( a_type != 1 )
                {
                        oDiv.scrollIntoView( true );
                }
                oDiv.style.top = 200;
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: sprawdza, czy sa wypelnione wszystkie pola w formularzu aplikacyjnym
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-26 10:57  piotrj     stworzenie
        //
        function checkIsEmpty( a_req, a_vis, a_text )
        {
                nazwypol = Array( "address", "birth", "education", "motivation", "experience", "skills", "info", "cv_file", "letter_file", "wk_refer" );
                l_error = 0;
                l_name = document.getElementById( "name" );
                l_surname = document.getElementById( "surname" );
                l_phone = document.getElementById( "phone" );
                l_e_mail = document.getElementById( "e_mail_work" );
                if( l_name.value == "" )
                {
                        l_error = 1;
                }
                if( l_surname.value == "" )
                {
                        l_error = 1;
                }
                if( l_phone.value == "" )
                {
                        l_error = 1;
                }
                if( l_e_mail.value == "" )
                {
                        l_error = 1;
                }
                for( i = 0; i <= 9; i++ )
                {
                        if( ( a_req.charAt(i) == "1" ) && ( a_vis.charAt(i) == "1" ) )
                        {
                                if( ( i != 1 ) && ( i != 0 ) )
                                {
                                        l_pole = document.getElementById( nazwypol[i] );
                                        if( l_pole.value == "" )
                                        {
                                                l_error = 1;
                                        }
                                }
                                else if( i == 0 )
                                {
                                        l_street = document.getElementById( "street" );
                                        l_postcode = document.getElementById( "postcode" );
                                        l_city = document.getElementById( "city" );
                                        if( ( l_street.value == "" ) || (  l_postcode.value == ""  ) || (  l_city.value == ""  ) )
                                        {
                                                l_error = 1;
                                        }
                                }
                        }
                }
                if( l_error == 0 )
                {
                        document.forms.aplication_form.submit();
                }
                else
                {
                        alert( a_text );
                }
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: funkcja zmienia odpowiednio ilosc dni w kalendarzu ze wzgledu na wybrany rok i miesiac
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function checkCallendar( aday, amonth, ayear )
        {
                var newopt;
                selyear = document.getElementById( "year" );
                year = selyear.value;
                selmonth = document.getElementById( "month" );
                month = selmonth.value;
                selday = document.getElementById( "day" );
                day = selday.value;
                numdays = selday.length;
                if( ( year >= ayear ) && ( month >= amonth ) )
                {
                        month = amonth;
                        selmonth.value = month;
                        if( day >= aday )
                        {
                                day = aday;
                                selday.value = day;
                        }
                }
                if( month == 2 )
                {
                        przestepny = ( year % 4 );
                        if( przestepny == 0 )
                        {
                                maxday = 29;
                        }
                        else
                        {
                                maxday = 28;
                        }
                }
                else
                {
                        if( ( month == 1 ) || ( month == 3 ) || ( month == 5 ) || ( month == 7 ) || ( month == 8 ) || ( month == 10 ) || ( month == 12 ) )
                        {
                                maxday = 31;
                        }
                        else
                        {
                                maxday = 30;
                        }
                }
                if( day > maxday )
                {
                        selday.value = maxday;
                        
                }
                if( maxday <= numdays )
                {
                        num = maxday;
                        for( i = maxday+1; i <= numdays; i++ )
                        {
                                selday.remove( maxday );
                        }
                }
                else
                {
                        for( i = numdays+1; i <= maxday; i++ )
                        {
                                newopt = document.createElement( "option" );
                                newopt.value = i;
                                //to dla IE
                                newopt.innerText = ""+i+"";
                                //to dla mozilli
                                newopt.text = ""+i+"";
                                selday.appendChild( newopt );
                        }
                }
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: funkcja otwiera nowe okno z zawartoscia do wydruku
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function checkTourForm( a_text )
        {
                if( ( document.getElementById( "imnaz" ).value != "" ) && ( document.getElementById( "email" ).value != "" ) && ( document.getElementById( "okres" ).value != "" ) && ( document.getElementById( "jezyk" ).value != "" ) && ( document.getElementById( "kraj" ).value != "" ) && ( document.getElementById( "rodzaj" ).value != "" ) && ( document.getElementById( "kwatera" ).value != "" ) )
                {
                        document.forms.tourform.submit();
                }
                else
                {
                        alert( a_text );
                }
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: funkcja otwiera nowe okno z zawartoscia do wydruku
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function checkContactForm( a_text )
        {
                if( ( document.getElementById( "imnaz" ).value != "" ) && ( document.getElementById( "email" ).value != "" ) )
                {
                        document.forms.kontaktform.submit();
                }
                else
                {
                        alert( a_text );
                }
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: funkcja otwiera nowe okno z zawartoscia do wydruku
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function docPrinter( a_url )
        {
                a_text = ""+document.getElementById( "pagecontent" ).value+"";
                winObj = window.open( a_url, "_blank", "channelmode=no, toolbar=yes, location=yes, directories=yes, status=yes, menubar=yes, scrollbars=yes, resizable=yes, titlebar=yes, fullscreen=yes" );
                winObj.document.open();
                winObj.document.write( a_text );
                winObj.document.close();
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: funkcja chowa lub pokazuje to co ukryte/odkryte
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function showHideAll( a_name, a_nr, a_ilosc )
        {
                for( i = 0; i < a_ilosc; i++ )
                {
                        if( i != a_nr )
                        {
                                docid = a_name+""+i+"";
                                document.getElementById( docid ).style.display = 'none';
                        }
                }
                docid = a_name+""+a_nr+"";
                obj = document.getElementById( docid );
                if( obj.style.display == 'none' )
                {
                        obj.style.display = 'block';
                }
                else
                {
                        obj.style.display = 'none';
                }
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  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: zmienia rozmiar okna
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function resizeImageWindow( imageObj, winObj )
        {
                if( imageObj.complete == true )
                {
                        l_width = imageObj.width+30;
                        l_height = imageObj.height+90;
                        winObj.resizeTo( l_width, l_height );
                }
                else
                {
                        setTimeout( "resizeImageWindow( imageObj, winObj )", 10 );
                }
        }

        /**
         * Function is used to show image popup window.
         * Window is created after complete image loading
         *
         * @param popupImageObj global variable - image to show object
         */
        function showImagePopupWindow()
        {
                if( popupImageObj.complete == true )
                {
                        windowWidth = popupImageObj.width + 20;
                        windowHeight = popupImageObj.height + 30;
                        
                        verticalPosition = (document.body.clientWidth - windowWidth) / 2;
                        if(verticalPosition < 0) verticalPosition = 0;
                        
                        horizontalPosition = (document.body.clientHeight - windowHeight) / 2;
                        if(horizontalPosition < 0) horizontalPosition = 0;
                        
                        popupWindowObj = window.open(   popupImageObj.src, 
                                                        "image_window", 
                                                        "channelmode=no, toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, titlebar=no, \
                                                        width="+ windowWidth +", height="+ windowHeight +", \
                                                        left="+ verticalPosition +", top="+ horizontalPosition +"" );
                        popupWindowObj.focus();
                }
                else
                {
                        setTimeout( "showImagePopupWindow()", 10 );
                }
        }
        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: pokazuje obrazek w nowym dopasowanym oknie
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function showImage( pathToImage )
        {
                popupImageObj = new Image();
                popupImageObj.src = pathToImage;
                
                showImagePopupWindow( popupImageObj );
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: zmienia lokacje na podany adres
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function go_to_location( a_location )
        {
                window.location = a_location;
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  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 sprawdza, czy grafika jest aktywna, czy nie
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function checkIsOn( a_id )
        {
                oButton = document.getElementById( a_id );
                sSrc = oButton.src;
                iLen = sSrc.length;
                sRoz = sSrc.substr( iLen-6, 2 );
                if( sRoz == "_a" )
                {
                        return 1;
                }
                else
                {
                        return 0;
                }
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  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 ) 
        {
                old_img = document.getElementById( a_name );
                old_src = old_img.src;
                len = old_src.length;
                roz = old_src.substr( len-4, len );
                new_src = old_src;
                if( on_off == 1 )
                {
                        if( checkIsOn( a_name ) == 0 )
                        {
                                new_src = old_src.substr( 0, len-4 ) + "_a" + roz;
                        }
                }
                else
                {
                        if( checkIsOn( a_name ) == 1 )
                        {
                                new_src = old_src.substr( 0, len-6 ) + roz;
                        }
                }
                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_alert1, text_to_alert2, a_type )
        {
                //check_forbidden_chars( a_id, text_to_alert );
                word_container = document.getElementById( a_id );
                words = word_container.value;
                if( words != "" )
                {
                        words = words.toLocaleLowerCase();
                        re = /(\+)/g;
                        words = words.replace( re, "d7d18cfb3a0d8293e2f5d94ea30e04d2" );
                        words = erase_space( words );
                        is_ok = checkWordsLength( words );
                        if( is_ok == 1 )
                        {
                                words = encodeURI(words);
                                re = /(\%25+)/g;
                                words2 = words.replace( re, "e1e4faf650b9178c832fd6ce887e11d4" );
                                re = /(\/)/g;
                                words2 = words2.replace( re, "9fbbaa4cc515bc46e0c12e82a31df736" );
                                //alert( words+" --> "+words2 );
                                adres = a_host + "/wyszukiwanie/slowa/" + words2;
                                if( a_type == 1 )
                                {
                                        document.forms.searchmod.action = adres;
                                        document.forms.searchmod.submit();
                                }
                                else if( a_type == 2 )
                                {
                                        document.forms.searchtop.action = adres;
                                        document.forms.searchtop.submit();
                                }
                                else
                                {
                                        window.location = adres;
                                }
                        }
                        else
                        {
                                alert( text_to_alert1 );
                        }
                }
                else
                {
                        alert( text_to_alert2 );
                }
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  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 zaznaczona jest przynajmniej jedna opcja danego parametru
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function tryParamCheckbox( a_tekst, a_par_num, a_check_num )
        {
                l_selpar = "sel" + a_par_num + "par" + a_check_num;
                a_value = document.getElementById( l_selpar ).checked;
                jest = 1;
                if( a_check_num == 2 )
                {
                        numselpar = 3;
                }
                else
                {
                        numselpar = 2;
                }
                l_selpar = "sel" + a_par_num + "par" + numselpar;
                jestselpar = 0;
                while( selpar = document.getElementById( l_selpar ) )
                {
                        if( selpar.checked == true )
                        {
                                jestselpar = 1;
                        }
                        numselpar++;
                        if( numselpar == a_check_num )
                        {
                                numselpar++;
                        }
                        l_selpar = "sel" + a_par_num + "par" + numselpar;
                }
                if( jestselpar == 0 )
                {
                        jest = 0;
                }
                kontrol = document.getElementById( "kontrol" );
                kontrol.value = "0";
                if( jest == 1 )
                {
                        l_selpar = "sel" + a_par_num + "par" + a_check_num;
                        if( a_value == true )
                        {
                                document.getElementById( l_selpar ).checked = false;
                        }
                        else
                        {
                                document.getElementById( l_selpar ).checked = true;
                        }
                        l_src = document.forms.product_search_param.action;
                        document.forms.product_search_param.action = "" + l_src + "#dolstrony";
                        document.forms.product_search_param.submit();
                }
                else
                {
                        l_selpar = "sel" + a_par_num + "par" + a_check_num;
                        if( a_value == true )
                        {
                                oDiv = document.getElementById( "searchwait" );
                                oDiv.style.display = 'none';
                                alert( a_tekst );
                                document.getElementById( l_selpar ).checked = true;
                        }
                        else
                        {
                                document.getElementById( l_selpar ).checked = true;
                                l_src = document.forms.product_search_param.action;
                                document.forms.product_search_param.action = "" + l_src + "#dolstrony";
                                document.forms.product_search_param.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, search_on, box_num )
        {
                jest = 1;
                for( numsel = 0; numsel <= box_num+1; numsel++ )
                {
                        l_sel = "sel" + numsel;
                        if( sel = document.getElementById( l_sel ) )
                        {
                                selval = sel.value;
                                if( selval != "" )
                                {
                                        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 = box_num+1;
                                        }
                                }
                        }
                }
                kontrol = document.getElementById( "kontrol" );
                kontrol.value = "" + search_on + "";
                if( jest == 1 )
                {
                        if( search_on == 0 )
                        {
                                l_src = document.forms.product_search_param.action;
                                document.forms.product_search_param.action = "" + l_src + "#dolstrony";
                        }
                        document.forms.product_search_param.submit();
                }
                else
                {
                        oDiv = document.getElementById( "searchwait" );
                        oDiv.style.display = 'none';
                        alert( text_to_alert );
                        l_sel = "selopt";
                        if( select = document.getElementById( l_sel ) )
                        {
                                select.value = "";
                        }
                }
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: usowa wybrany parametr ze strony
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function usun_wybrany_parametr( wiersz, kolejnosc )
        {
                selnum = "sel" + wiersz;
                l_param = document.getElementById( selnum );
                l_param.value = "";
                document.getElementById( "kontrol" ).value = 0;
                document.getElementById( "usun_kolejnosc" ).value = kolejnosc;
                l_src = document.forms.product_search_param.action;
                document.forms.product_search_param.action = "" + l_src + "#dolstrony";
                document.forms.product_search_param.submit();
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: odsyla do wyszukiwania ze stronicowania
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function sendPaging( a_adres )
        {
                document.forms.searchmod.action = a_adres;
                document.forms.searchmod.submit();
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: odsyla do wyszukiwania ze stronicowania
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function sendModuleSearch( a_adres )
        {
                document.getElementById( "moduleSearch1" ).value = 0;
                document.forms.searchmod.action = a_adres;
                document.forms.searchmod.submit();
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: odsyla do wyszukiwania ze stronicowania
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function dropFilters()
        {
                document.getElementById( "dropFilters" ).value = 1;
                document.forms.paramFilterForm.submit();
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: odsyla do wyszukiwania ze stronicowania
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        var lastmenuOn = -1;
        var lastmenuOff = -1;
        function menuOnOff( on, id )
        {
                if( lastmenuOn != -1 )
                {
                        document.getElementById( "menu"+lastmenuOn+"a0" ).style.display = "block";
                        document.getElementById( "menu"+lastmenuOn+"b0" ).style.display = "none";
                        document.getElementById( "topMenu"+lastmenuOn ).style.cursor = "default";
                        lastmenuOff = lastmenuOn;
                }
                if( on == 1 )
                {
                        document.getElementById( "menu"+id+"a0" ).style.display = "none";
                        document.getElementById( "menu"+id+"b0" ).style.display = "block";
                        document.getElementById( "topMenu"+id ).style.cursor = "pointer";
                        lastmenuOn = id;
                }
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: funkcja chowa lub pokazuje to co ukryte/odkryte
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function showHideFaq( a_docid )
        {
                obj = document.getElementById( a_docid );
                objA = document.getElementById( a_docid+"a" );
                objB = document.getElementById( a_docid+"b" );
                if( objA.style.display == 'none' )
                {
                        objA.style.display = 'block';
                        objB.style.display = 'none';
                        obj.style.borderColor = '#ffffff';
                        obj.style.backgroundColor = '#ffffff';
                }
                else
                {
                        objA.style.display = 'none';
                        objB.style.display = 'block';
                        obj.style.borderColor = '#e0e0e0';
                        obj.style.backgroundColor = '#f9f9f9';
                }
        }

//-------------------------------------------------------------------------------
//
//      ponizej kod dla czatu
//
//-------------------------------------------------------------------------------

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: funkcja otwiera nowe okno z zawartoscia do wydruku
        //
        //  Historia zmian:
        //  data              Kto        Opis
        //  ---------------------------------------------------------------------
        //  2004-08-20 13:19  piotrj     stworzenie
        //
        function openChat( a_url )
        {
                //a_text = ""+document.getElementById( "pagecontent" ).value+"";
                winObj = window.open( a_url, "_blank", "channelmode=no, toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, titlebar=yes, fullscreen=no, width=420, height=423, left=200, top=100" );
                //winObj.document.open();
                //winObj.document.write( a_text );
                //winObj.document.close();
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: dodaje produkt do koszyka
        //
        function setSort( sortBy, sortType )
        {
                document.getElementById( "catalogSortBy" ).value = sortBy;
                document.getElementById( "catalogSortType" ).value = sortType;
                document.forms.catalogsortform.submit();
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: dodaje produkt do koszyka
        //
        function addToBasket2( a_id, a_price, a_code )
        {
                l_zam = a_id+"+"+a_code+"+"+a_price+"+1|";
                document.getElementById( "koszykadd" ).value = l_zam;
                document.forms.koszykmem.submit();
        }

        /////////////////////////////////////////////////////////////////////////
        //
        //  Opis: odsyla do wyszukiwania ze stronicowania
        //
        function dropGroupFilters()
        {
                document.getElementById( "dropGroupFilters" ).value = 1;
                document.forms.paramGroupFilterForm.submit();
        }

