function collectValues(){
	collectLanguages();
	collectLibraries();
	collectCountries();
}

function collectLanguages()
{
	var langList = document.getElementById('langList');
	var hidLang = document.getElementById('filter.lang');
	// Patikrinam ar tokie laukai egzistuoja, nes ne visos paieskos juos turi 
	if ((null != langList) && (null != hidLang)){
		if (langList.selectedIndex >= 0){
			hidLang.value = "";
			for (var i = 0; i < langList.length; i++){
				if (langList.options[i] != null){
					if (langList.options[i].selected){
						if (hidLang.value != ""){
							hidLang.value = hidLang.value + ' , ';
						}
						hidLang.value = hidLang.value + langList.options[i].value;
					}
				}
			}
		}
	}
}

function collectCountries()	
{
	var publCountryList = document.getElementById('publCountryList');
	var hidPublCountry = document.getElementById('filter.country');
	if ( (null != publCountryList) && (null != hidPublCountry) )
	{
		if (publCountryList.selectedIndex >= 0)
		{
			hidPublCountry.value = "";
			for (var i = 0; i < publCountryList.length; i++)
			{
				if (publCountryList.options[i] != null)
				{
					if (publCountryList.options[i].selected)
					{
						if (hidPublCountry.value != "")
						{
							hidPublCountry.value = hidPublCountry.value + ' , ';
						}
						hidPublCountry.value += publCountryList.options[i].value;
					}
				}
			}
		}
	}
}

function collectLibraries()
{
	var libChkBox = document.getElementById("exeptLnb");
	var libs = document.getElementById("libraryList");
	var hidLibrary = document.getElementById("filter.libis.library");
	// Patikrinam ar tokie laukai egzistuoja, nes ne visos paieskos juos turi 
	if ((null != libChkBox) && (null != libs) && (null != hidLibrary)){
		hidLibrary.value = "";	// issivalom kad nebutu nereikalingu reiksmiu
		if (false == libs.disabled){	// jeigu nedisablintas
			if (libs.selectedIndex >= 0){
				for (var i = 0; i < libs.length; i++){
					if (libs.options[i] != null){
						if (libs.options[i].selected){
							if (hidLibrary.value != ""){
								hidLibrary.value = hidLibrary.value + ' , ';
							}
							hidLibrary.value = hidLibrary.value + libs.options[i].value;
						}
					}
				}
			}
		}
	}
}
