function setCurrentFG(){
	var currentVal = $("#tx_rzrehaatlas_pi2_kbilder").val();
   	if(currentVal!=0){
    	$.get("index.php",{eID : "rz_rehaatlas", func:"getFGValuefromKB", value:currentVal}, function(data){
	 	//alert("Gebiet: " + data);
		$("#tx_rzrehaatlas_pi2_fachgebiet").val(data).attr("selected","selected");	  
		});
    }
}
function setKBforFG(){
	var currentVal = $("#tx_rzrehaatlas_pi2_fachgebiet").val();
	$.get("index.php",{eID : "rz_rehaatlas", func:"setKBforFG", value:currentVal}, function(data){
		$('#tx_rzrehaatlas_pi2_kbilder').html(data);
	});
}

$(document).ready(function() { 
		// on change for kbilder
	$("#tx_rzrehaatlas_pi2_kbilder").change(function(){
		setCurrentFG();
	});

	// on change for fahgebiet
	$("#tx_rzrehaatlas_pi2_fachgebiet").change(function(){
		setKBforFG();
	});
	
    $(".tx-rzrehaatlas-pi2 table").tablesorter({
    	widthFixed: true,
        // pass the headers argument and assing a object 
        headers: { 
            // assign the secound column (we start counting zero) 
            1: { 
                sorter: false 
            },
            3: { 
                // disable it by setting the property sorter to false 
                sorter: false 
            }
        },
        widgets: ['zebra']
    });  
});
