var ajax_sent = false;

function zamena_mest() {
      r1 = document.list_element_.le_filter_vyber_hodnotu_mesto_odkud_select.options[document.list_element_.le_filter_vyber_hodnotu_mesto_odkud_select.selectedIndex].value;
      r2 = document.list_element_.le_filter_vyber_hodnotu_mesto_kam_select.options[document.list_element_.le_filter_vyber_hodnotu_mesto_kam_select.selectedIndex].value;
      with(document.list_element_) {
        le_filter_vyber_hodnotu_mesto_odkud_select.value = r2;
        le_filter_vyber_hodnotu_mesto_kam_select.value = r1;
      }
}

function rozbal(id) {		
	document.getElementById(id).style.display = 'block';
	document.getElementById(id + 'img').src = 'skins/default/index/minus.png';
	document.getElementById(id + 'img').setAttribute('onclick', 'zbal("' + id + '")');
	document.getElementById(id + 'img').title = 'skryj fakulty';		
}

function zbal(id) {
	document.getElementById(id).style.display = 'none';
	document.getElementById(id + 'img').src = 'skins/default/index/plus.png';
	document.getElementById(id + 'img').setAttribute('onclick', 'rozbal("' + id + '")');
	document.getElementById(id + 'img').title = 'rozbal fakulty';
}

function par_rozbal(url, id) {
	if (ajax_sent) {
		return;
	}
	ajax_sent = true;
	$('#more-' + id).hide();
    $('#w-par' + id).show();
    
	$.post(url, {id: id}, 
    function(data){
		$('#pl_par' + id).hide();
		$('#mn_par' + id).show();
    	$('#w-par' + id).hide();
    	$('#out-par' + id).append(data);
    	ajax_sent = false;
    });
}

function par_sbal(id) {
	$('#more-' + id).show();
	$('#w-par' + id).hide();
	$('#pl_par' + id).show();
    $('#mn_par' + id).hide();
    $('#out-par' + id).html('');
}

function ajax_call(url, id, action) {
	$('#img_' + action + id).show();
	$('#href_' + action + id).hide();
	$.get(url, {}, 
	    function(data){
			$('#img_' + action + id).hide();
			$('#href_' + action + id).show();
			switch(action){
				case 'hide':
				case 'del':
					$("tr:has(#ajax_" + id + ")").hide();
					break;
				default:
					$('#ajax_' + id).html(data);
					break;
			}
	    });
}





