function BrancheSelector() {
	this.brancheSelector = document.getElementById("brancheselector");
	this.brancheInfo = document.getElementById("brancheinfo");
	if(!this.brancheSelector || !this.brancheInfo) {return;}
	this.brancheSelector.context = this;
	
	this.infoPanels = new Array();
	var elems = this.brancheInfo.getElementsByTagName("*"); 
	for(var i=0;i<elems.length;i++){
		if(!elems[i].className.match("infopanel")) continue;
		this.infoPanels[this.infoPanels.length] = elems[i];
	}

	this.brancheSelector.onchange = function(){
		this.context.showPanel(this.options[this.selectedIndex].value);
	}
	
	if(this.brancheSelector.selectedIndex == -1) {
		this.showPanel("nobranche");
	} else {
		this.showPanel(this.brancheSelector.options[this.brancheSelector.selectedIndex].value);
	}
}

BrancheSelector.prototype.showPanel = function(elemID) {
	var panel = document.getElementById(elemID);
	if(!panel) {alert("page error. cannot find element: "+elemID);return;}
	for (var i=0;i<this.infoPanels.length;i++) {
		this.infoPanels[i].style.display = "none";
	}
	panel.style.display = "block";	
}