
var $j = jQuery.noConflict();

jQuery(document).ready(function(){

	
	$j(".studieselect", document.body).bind("change", function(e){
		stap = this.id.substr(6,1);
		
		nextstap = parseInt(stap)+1;
		newdiv = '#select'+(nextstap);
		
		
		if(stap==0){
			$j('#select1').attr('disabled', 'disabled');
			$j('#select2').attr('disabled', 'disabled');
	
		}
		
		if(stap==1){
	
			$j('#select2').attr('disabled', 'disabled');
	
		}
		
		
		
		
		var olddiv = '#select'+stap;
		
		var oldval = $j(olddiv).val().split("[;;]");
		
		$j(newdiv).removeAttr('disabled');
		$j(newdiv).html('<option>laden...</option>');   
		$j(newdiv).load("http://www.studentdocent.nl/ajax_request.php?pos=form&act=select&no="+oldval[0]);
		
	
		
	
	
	})
	
	$j(".functionselect", document.body).bind("change", function(e){
		stap = this.id.substr(8,1);
		
		nextstap = parseInt(stap)+1;
		newdiv = '#function'+(nextstap);
		
		
		if(stap==0){
			$j('#function1').attr('disabled', 'disabled');
			
	
		}
		
				
		
		var olddiv = '#function'+stap;
		var oldval = $j(olddiv).val().split("[;;]");
		$j(newdiv).html('<option>laden...</option>');   
		$j(newdiv).load("http://www.studentdocent.nl/ajax_request.php?pos=form&act=select&no="+oldval[0]);
		$j(newdiv).removeAttr('disabled');
	
		
	
	
	})
	

    
    
})

