			
			function loadFilters()
			{
				// console.log("loadFilters");
				
				var countFilters = 0;
				for( ; countFilters <= 10 ; countFilters++ )
				{
					var categorieX = ArgGet( window.document.location.href, 'categorie' + countFilters );
					if( categorieX && categorieX.length )
					{
						var categorieValueX = ArgGet( window.document.location.href, 'categorie_value' + countFilters );
						var categorieNotX = ArgGet( window.document.location.href, 'categorie_not' + countFilters );
		
						loadSelects( countFilters, categorieX, categorieValueX, categorieNotX, '' );
						/*
						if( categorieX && categorieX.length )
							toggleCategorieRow( countFilters, true );	
						*/
					}
				}
				var filtersObj = document.getElementById( "filters_dummy" );
				if( filtersObj )
				{
					filtersObj.fire( "tg:filtersready", {} );
				}
			}
			
			function loadSelects( num, categorie, categorie_value, categorie_not, text_filter )
			{
				var categorieObjName = getCategorieName( num, 'categorie' );
				var categorieObj = GetElementById( window.document, categorieObjName );
				
				if( categorieObj && categorieObj.type )
				{
					categorie_value = unescape(categorie_value);
					if( categorieObj.type.indexOf( 'select' ) >= 0 )
					{
						setSelectedOption( categorieObj, categorie, '' );
					}
					else
					{
						// categorieObj.value = categorie_value;
					}
					showSelectValues( num, categorie, categorie_value, categorie_not );
				}
						
				if( text_filter.length )
				{
					text_filter = text_filter.replace( '%20', ' ' );
					var textFilterObj = GetElementById( window.document, 'text_filter' );
					if( textFilterObj )
						textFilterObj.value = text_filter;
				}
			}
			
			function toggleCategorieRow( num, onoff )
			{
				var categorieObjName = getCategorieName( num, 'categorieRow' );
				var categorieRowObj = GetElementById( window.document, categorieObjName );
				var addSearchObj = GetElementById( window.document, 'addSearch' );
					
				
				if( categorieRowObj && addSearchObj )
				{
					if( onoff )
					{
						categorieRowObj.style.display = '';
						addSearchObj.style.display = 'none';		
					}
					else
					{
						categorieRowObj.style.display = 'none';
						addSearchObj.style.display = '';
					}		
				}
			}
			
			/*
			function changeClass( thisObj, class_name )
			{
				thisObj.className = class_name;
			}
			*/
			
			function showSelectValues( num, categorie_name, categorie_value, categorie_not )
			{
				if( categorie_name )
				{
					var valuesObj = GetElementById( window.document, categorie_name );
					if( valuesObj )
					{
						DisableValues( num );
						// valuesObj.style.display = '';
						//if( num == categorieNumber( categorie_name ) )
						//{
							if( categorie_value && categorie_value.length )
							{
								if( valuesObj.type.indexOf( 'select' ) >= 0 )
								{
									setSelectedOption( valuesObj, categorie_value, categorie_not );
								}
								else
								{
									if( valuesObj )
										valuesObj.value = categorie_value;
								}
							}
						//}
					} 
				}
				else
				{
					DisableValues( num );
				}
			}
			
			function resetTextFilter()
			{
				var textFilterObj = GetElementById( window.document, 'text_filter' );
							
				if( textFilterObj )
					textFilterObj.value = '';
			}
			
			function goSearch()
			{
				
				var textFilterObj = GetElementById( window.document, 'text_filter' );
				var searchFilter = '';
				
				var countFilters = 0;
				for( ; countFilters <= 10 ; countFilters++ )
				{
					searchFilter += getCategorieSearchFilter( countFilters );	
				}
				
				textFilter = '';
				if( textFilterObj )
					textFilter = textFilterObj.value;
				
				if( textFilter.length )
					searchFilter += '&text_filter=' + textFilter;
				var url = document.location.pathname + "?action=viewlist";
				url += searchFilter;
				window.document.location.href = url;			
			}
			
			function DisableValues( num )
			{
				selectObjs = window.document.getElementsByTagName("select");
				if( selectObjs && selectObjs.length )
				{
					var count_selects = 0;
					for( count_selects = 0; count_selects < selectObjs.length; count_selects++ )
					{
						
						if( selectObjs[count_selects].id != 'categorie0' )
						if( selectObjs[count_selects].id != 'categorie1' )
						if( selectObjs[count_selects].id != 'categorie2' )
						if( num == categorieNumber( selectObjs[count_selects].id ) )
						{
							// selectObjs[count_selects].style.display = 'none';
						}
					}
				}
			}
			
			function categorieNumber( name )
			{
				num = parseInt( name.charAt( name.length - 1 ), 10);
				return( num );
			}
			
			function getCategorieName( num, prefix )
			{
				var categorieObjName = '';
				categorieObjName = prefix + num;
				return( categorieObjName );
			}
			
			function getCategorieObjectValue( categorieObj )
			{
				var value = '';
				if( categorieObj.type.indexOf( 'select' ) >= 0 )
				{
					value = categorieObj.options[categorieObj.selectedIndex].value;
				}
				else
				{
					value = categorieObj.value;
				}
				return( escape(value) );
			}
			
			function getCategorieSearchFilter( num )
			{
				var searchFilter = '';
				var categorieObjName = getCategorieName( num, 'categorie' );
				var categorieObj = GetElementById( window.document, categorieObjName );
				var valueObj = null;

				if( categorieObj )
					valueObj = GetElementById( window.document, getCategorieObjectValue( categorieObj ) );	

				if( categorieObj && valueObj /*&& valueObj.length*/ )
				{
					var catNameValue = getCategorieObjectValue( categorieObj );
					// catNameValue = catNameValue.slice( 0, catNameValue.length - 1 );

					searchFilter = '&' + getCategorieName( num, 'categorie' )+ '=' + catNameValue + '&' + getCategorieName( num, 'categorie_value' )+ '=' + getCategorieObjectValue( valueObj );
				}
				return( searchFilter );
			}
