Formidable.Classes.objSearchCodeBehind = Formidable.Classes.CodeBehindClass.extend({  
   
     iCounterJs: 0,  
   
     btnHelloWorldJs_Click: function() {  
         this.iCounterJs++;  
     },

     haustiereClick: function() {
			cb = this.oForm.rdt('box_main.haustiere');
			box = this.oForm.rdt('box_main.box_haustiere');
			if(cb.getValue()) box.displayBlock();
			else box.displayNone();
     },
	 
     kinderChanged: function() {
			cb = this.oForm.rdt('box_main.anzkind');
			cnt = parseInt(cb.getValue());
			for (var i = 1; i <= 10; i++) {
				box = this.oForm.rdt('box_main.kindalter'+i);
				if(!box) continue;
				if(i<=cnt)
					box.displayDefault();
				else
					box.displayNone();
			}
     },
	 
	 bundeslandChanged: function(){
		//var bl = this.oForm.rdt('box_main.box_bundesland.bundesland');
		//var reg = this.oForm.rdt('box_main.box_region.region');
		var bl = document.getElementById('netfewo.box_main.box_bundesland.bundesland');
		var reg = document.getElementById('netfewo.box_main.box_region.region');
	
		//console.log(reg);
	
		if(bl.getValue()>0){
			reg.selectedIndex=0;
			reg.disabled=true;
		}else{
			reg.disabled=false;
		} 
	 },
	 
	 regionChanged: function(){
		var bl = document.getElementById('netfewo.box_main.box_bundesland.bundesland');
		var reg = document.getElementById('netfewo.box_main.box_region.region');
	
		if(reg.getValue()>0){
			bl.selectedIndex=0;
			bl.disabled=true;
		}else{
			bl.disabled=false;
		} 
	 }	 
   
});

