<!--
function filterSubmit(){
	var brand = document.getElementById('f_brand').value;
	var category = document.getElementById('f_category').value;
	var condition = document.getElementById('f_condition').value;
	var material = document.getElementById('f_material').value;
	var gender = document.getElementById('f_gender').value;
	var url = window.location.protocol + '//' + window.location.hostname + '/';

	if (condition != 'any-condition' || material != 'any-material' || gender != 'any-gender'){
		url = url + brand + "/" + category + "/" + condition + "/" + material  + "/" + gender;		
	} else if (brand != 'any-brand' && category != 'any-category') {
		url = url + brand + "/" + category;
	} else if (brand != 'any-brand'){
		url = url + brand;
	} else {
		alert('You must select more filter options.');
		return false;
	}

	location.href = url;
}
//-->

function SearchFieldsUpd()	{

	var cat = document.getElementById('f_category');
	var selectedBrand = document.getElementById('f_brand').value;
	
	if (selectedBrand == 'any-brand')	{

		var newCat = cat.cloneNode(false);
		cat.parentNode.insertBefore(newCat, cat);
		cat.parentNode.removeChild(cat);

		var op = document.createElement('option');
		if(navigator.appName == "Microsoft Internet Explorer"){
			op.value = 'any-category';
		}
		else	{
			op.setAttribute('value', 'any-category');
		}
		op.appendChild(document.createTextNode("Any Style / Category"));
		newCat.appendChild(op);
		
		return;
	}

	var newCat = cat.cloneNode(false);
	cat.parentNode.insertBefore(newCat, cat);

	var op = document.createElement('option');
	op.value = 'any-category';
	op.appendChild(document.createTextNode("Any Style / Category"));
	newCat.appendChild(op);
	cat.parentNode.removeChild(cat);

	var brandData = FormArray();
	if(brandData[selectedBrand] != undefined){
		var brandCat = brandData[selectedBrand];
		// agregamos las opciones nuevas a los selects ya vacios.
		for (var idCat in brandCat)	{

			if (brandCat[idCat] != undefined)	{
				var option3 = document.createElement('option');
				if(navigator.appName == "Microsoft Internet Explorer"){
					option3.value = idCat;
				}
				else	{
					option3.setAttribute('value', idCat);
				}
				var txt3 = document.createTextNode(brandCat[idCat]);
				option3.appendChild(txt3);
				newCat.appendChild(option3);
			}
		}
	}
}