function changeKraj(value,id_pp,mode,mapa_flag,link) {
	var val_array = value.split(';_;');
	if (mapa_flag) reloadMap(val_array[1],val_array[2],val_array[3],'aices');
	document.getElementById('module_data__' + id_pp + '__kraj').value = value;
	get_ajax_data_aices(id_pp,'firmy_aices',val_array[0] + ';_;0',mode,link);
}
function changeCity(value,id_pp,mode,link) {
	var val_array = document.getElementById('module_data__' + id_pp + '__kraj').value.split(';_;');
	get_ajax_data_aices(id_pp,'firmy_aices',val_array[0] + ';_;' + value,mode,link);
}
function get_ajax_data_aices(id,separator,id_item,next,link) {
	var navrat = '';
	var url = 'ajax_data_sender.php?separator=' + separator + '&id_item=' + id_item + '&link=' + link + '&id_pp=' + id;
	if (next != null) url += '&next=' + next;
/*	window.prompt('',url); */
	if (window.ActiveXObject) httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
	else httpRequest = new XMLHttpRequest();
	httpRequest.open("GET", url, true);
	httpRequest.onreadystatechange= function () {processRequest_ajax(id,link); } ;
	httpRequest.send(null);
}
function processRequest_ajax(id,link) {
	var data = '';
	if (httpRequest.readyState == 4) {
		if (httpRequest.status == 200) data = httpRequest.responseText;
		parseIC(data,id,link);
		/*document.getElementById(id).innerHTML = data;*/
	}
}
function parseIC(data,id,link) {
	if (data != '') {
		var data_array = data.split(';blok_separator;');
		var city_sel = document.getElementById('module_data__' + id + '__city');
		while (city_sel.childNodes.length) city_sel.removeChild(city_sel.firstChild);
		var city_array = data_array[0].split(';-row-;');
		var actual = 0;
		for (var x in city_array) {
			ca = city_array[x].split(';-;');
			opt = document.createElement('option');
			opt.setAttribute('value',ca[0]);
			opt.innerHTML = ca[1];
			if (ca[2] == 1) actual = ca[0];
			city_sel.appendChild(opt);
		}
		city_sel.value = actual;
		//document.getElementById('module_data__' + id + '__city').innerHTML = data_array[0];
		document.getElementById('aices_firm_list').innerHTML = data_array[1];
		document.getElementById('aices_firm_list_download').innerHTML = '<a href="get_list_of_ics.php?sep=' + data_array[2] + '" title="Uložiť zoznam do súboru" alt="Uložiť zoznam do súboru" rel="nofollow">Uložiť zoznam do súboru</a>';
	}
}