			
			function loadFilters()
			{
				var categorie0 = ArgGet( window.document.location.href, 'categorie0');
				if( categorie0 && categorie0.length )
				{
					
					categorie0 += '0';
					var categorieValue0 = ArgGet( window.document.location.href, 'categorie_value0' );
					var categorieNot0 = ArgGet( window.document.location.href, 'categorie_not0' );
	
					loadSelects( 0, categorie0, categorieValue0, categorieNot0, '' );
					/*
					if( categorie0 && categorie0.length )
						toggleCategorieRow( 0, true );	
					*/
				}
				
				var categorie1 = ArgGet( window.document.location.href, 'categorie1');
				if( categorie1 && categorie1.length )
				{
					
					categorie1 += '1';
					var categorieValue1 = ArgGet( window.document.location.href, 'categorie_value1' );
					var categorieNot1 = ArgGet( window.document.location.href, 'categorie_not1' );
	
					loadSelects( 1, categorie1, categorieValue1, categorieNot1, '' );
					/*
					if( categorie1 && categorie1.length )
						toggleCategorieRow( 1, true );	
					*/
				}		
				/*
				var categorie2 = ArgGet( window.document.location.href, 'categorie2');
				if( categorie2 && categorie2.length )
				{
					
					categorie2 += '2';
					var categorieValue2 = ArgGet( window.document.location.href, 'categorie_value2' );
					var categorieNot2 = ArgGet( window.document.location.href, 'categorie_not2' );
	
					loadSelects( 2, categorie2, categorieValue2, categorieNot2, '' );
					
					// if( categorie2 && categorie2.length )
					// 	toggleCategorieRow( 2, true );	
					
				}
				*/
						
			}
			
			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 )
				{
					if( categorieObj.type.indexOf( 'select' ) >= 0 )
						setSelectedOption( categorieObj, categorie, '' );
					else
					{
						// do nothing
					}
				}
			
				categorie_value = categorie_value.replace( '%20', ' ' );
				
				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 && ( valuesObj.type.indexOf( 'select' ) >= 0 ) )
						{
							setSelectedOption( valuesObj, categorie_value, categorie_not );
						}
					} 
				}
				else
				{
					DisableValues( num );
					// goSearch();
				}
				
			}
			
			function setSelectedOption( selectObj, option_value, option_not )
			{
				if( selectObj )
				{
					var count_options = 0;
					
					for( count_options = 0; count_options < selectObj.options.length; count_options++ )
					{
						
						if( selectObj.options[count_options].value == option_value )
						{
							selectObj.selectedIndex = count_options;
							if( option_not == 'true' )
							selectObj.options[count_options].innerHTML = 'is niet ' + selectObj.options[count_options].innerHTML;
							
						}
					}
				}
			}
			
			function resetTextFilter()
			{
				var textFilterObj = GetElementById( window.document, 'text_filter' );
							
				if( textFilterObj )
					textFilterObj.value = '';
			}
			
			function goSearch()
			{
				
				var textFilterObj = GetElementById( window.document, 'text_filter' );
				var searchFilter = '';
				
				searchFilter += getCategorieSearchFilter( 0 );
				searchFilter += getCategorieSearchFilter( 1 );
				searchFilter += getCategorieSearchFilter( 2 );
				searchFilter += getCategorieSearchFilter( 10 );
				
				textFilter = '';
				if( textFilterObj )
					textFilter = textFilterObj.value;
				
				if( textFilter.length )
					searchFilter += '&text_filter=' + textFilter;
				var url = "project.php?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 ) )
						{
							// console.log("DisableValues, num: " + num );
							// 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( 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 );
			}
