function toggleLayer(whichLayer) {
	if (document.getElementById) {
		// this is the way the standards work
		var style2 = document.getElementById(whichLayer).style;
		style2.display = style2.display? "":"block";
	} else if (document.all) {
		// this is the way old msie versions work
		var style2 = document.all[whichLayer].style;
		style2.display = style2.display? "":"block";
	} else if (document.layers) {
		// this is the way nn4 works
		var style2 = document.layers[whichLayer].style;
		style2.display = style2.display? "":"block";
	}
}

function next() {
	page++;
	addOldFilters();
	document.searchForm.submit();
}

function last() {
	page--;
	addOldFilters();
	document.searchForm.submit();
}

function addOldFilters() {
	document.searchForm.filter.value = filter;
	document.searchForm.filter_country.value = filter_country;
	document.searchForm.page.value = page;
	document.searchForm.category.value = category;
	document.searchForm.price_range.value = rangePrice;
}

function savePrefs() {
	document.searchForm.lingua.value = document.prefs.lingua.value;
	document.searchForm.window.value = document.prefs.window.value;
}

function addFilter(filter, value) {
	page = 1;
	addOldFilters();
	document.searchForm.filter.value = value;
	document.searchForm.submit();
}

function addCountryFilter(filter, value) {
	page = 1;
	addOldFilters();
	document.searchForm.filter_country.value = value;
	document.searchForm.submit();
}

function addCategoryFilter(value) {
	page=1;
	addOldFilters();
	document.searchForm.category.value=value;
	document.searchForm.submit();
}

function addPriceRangeFilter(value) {
	page = 1;
	addOldFilters();
	document.searchForm.price_range.value=value;
	document.searchForm.submit();
}

function clearAll(value) {
	document.searchForm.filter.value = '';
	document.searchForm.filter_country.value = '';
	document.searchForm.page.value = '';
	document.searchForm.category.value = '';
	document.searchForm.price_range.value = '';
	document.searchForm.submit();
}