var WebSearchByParameters = {
	changeCommandParameter: function(obj) {
		var idv=obj.options[obj.selectedIndex].value;
		if (!(idv>0)) return;
/*		var l = document.getElementById('RegistrationByICO_loading');
		if (l) l.style.display = 'block';
		var captcha = document.getElementById('RegistrationByICO_captcha').value;*/
		if(window.XMLHttpRequest) this.response = new XMLHttpRequest();
		else if(window.ActiveXObject) {
			try { this.response = new ActiveXObject("Msxml2.XMLHTTP"); } 
			catch(e) { this.response = new ActiveXObject("Microsoft.XMLHTTP"); }
		}
		this.response.onreadystatechange = function() { WebSearchByParameters.receive(); };		
		this.response.open('GET', '/_Actions/WebSearchByParameters.php?action=getDependentValuesOptions&idv='+idv, true);
		this.response.send(null);
	},
	receive: function () {
		var response=WebSearchByParameters.response;
		if(response.readyState == 4) {
			if(response.status == 200) {
				var rs = eval('(' + response.responseText + ')');
				if (rs.actionResultStatus==1) {
					var PV=rs.result.htmlOptions;
					for (var idP in PV) {
						var theS=document.getElementById('P'+idP);
						var theSL=document.getElementById('P'+idP+'_Label');
						if (theS && theSL) {
							theSL.innerHTML='<select id="'+theS.id+'" name="'+theS.name+'" class="'+theS.className+'">'+PV[idP]+'</select>';
						}
					}
				}
			} else {
				alert('Omlouváme se, ale bohužel došlo k chybě při vykonávání akce.');
			}
		}
	}	
};