function convertDierenSelectXHR() {
	/* fijne custom xhr */ 
	var _this = this;
	var _frms = $C("xhr","FORM","");
	
	_this.init = function(){
		for(var i=0;i<_frms.length;i++){
			var f = _frms[i];
			f["isAjaxRequest"].value = 1;
			f.action = f["xhraction"].value;
			var selects = f.getElementsByTagName("select");
			addEvent(selects, "change", _this.getChildren);
		}
	}
	
	_this.getChildren = function(e){
		if(!e) e = window.event;
		var el = getTargetElement(e);
		var f = getParentByTagName(el,"form");
		if(el.value==''){
			alert('er is niets gekozen');
		}
		else {
			var ajaxRequest = new AjaxRequest(f.action);
			ajaxRequest.addFormElements(f);
			ajaxRequest.setUsePOST();
			ajaxRequest.sendRequest();
			// alert("Kinderen van id " + el.value + " plaatsen in: " + _target[el.id]);
		}
	}
	
	_this.init();
}

function changeTitle(diernaam){
	var title = document.title
	title = title.split("|");
	title.shift();
	title.unshift(diernaam + " ");
	title = title.join("|");
	document.title = title;
}

addEvent(window,"load",convertDierenSelectXHR);

