// JavaScript Document


function ajax_data (type,id,url_add,section_type) {
	
	switch (type) {
		case "woj":
		Element.update('typy', '&nbsp;');
		Element.update('jezyki', '&nbsp;');		
		container='miasta';
		container_hd='Miejscowość:<br />';
		url='wojewodztwo='+parseInt(id)+'&ajax_type='+type;
		break;
		case "miejsc":
		Element.update('jezyki', '&nbsp;');			
		container='typy';
		container_hd='Typ:<br />';		
		url='miejscowosc='+id+'&'+url_add+'&ajax_type='+type;
		break;
		case "typ":
		container='jezyki';
		container_hd='Język:<br />';		
		url='typ='+id+'&'+url_add+'&ajax_type='+type;
		break;		
		}
	url+='&type='+section_type;
	
	Element.update(container, '<div class=\"loader\">'+'<img src=\"images/loading.gif\" alt=\"loading\" />'+'</div>');
	
	new Ajax.Request('ajax_simple_search.php?'+url, {
		method:'get',
		postBody:'',
		onSuccess: function(transport){			
			var response = transport.responseText || "";
			if (response=="") {
				response='&nbsp;';
				}
			Element.update(container, container_hd+response);
			},
		onFailure: function(){ alert('Something went wrong...') }
		});
		
	}
	
function ajax_data_other_show (obj) {

	$(obj).setStyle({'display': 'block'});	
	$(obj+'_').setStyle({'display': 'none'});		
	
	}
