comboClass = { 
	comboVisible : false,
	comboHover : false,
	combo : null
}

comboClass.ShowCombo = function () {
	this.combo = document.getElementById("combo_content");		
	
	if(this.combo != null){
		if(this.comboVisible){
			this.combo.style.display = "none";
			this.comboVisible = false;
		}else{
			this.combo.style.display = "block";
			this.comboVisible = true;
		}
	}
}

comboClass.SetButtonText = function (text, id) {
	element = document.getElementById("combo_button");
	if(element != null){
		element.innerHTML = text;
		element.title = id;
	}
}

initComboClassSearch = function(){
	anchors = document.getElementById("combo_content").getElementsByTagName("li");
	for(i = 0; i < anchors.length; i++){
		anchorText = anchors[i].innerHTML;
		anchors[i].onclick = function(){
			comboClass.SetButtonText(this.innerHTML, this.id);
			comboClass.ShowCombo();
		}
	}
	document.getElementById("combo_button").onmouseover = function(){
		comboClass.comboHover = true;
	}
	document.getElementById("combo_button").onmouseout = function(){
		comboClass.comboHover = false;
	}
	
	document.onclick = function () {
		if (comboClass.comboVisible && !comboClass.comboHover) {
			comboClass.ShowCombo();
		}
	}
}

/*
window.onload = function() {
	initComboClassSearch();
}
*/