
function listBox(id){
	this.obj = null;
	this.contentItems = null
	this.contentMain = null
	this.selectedItem = null;
	this.contentShow = function (bool) {
	        if(bool){this.updatePos()};
			this.contentItems.style.display = bool ? "block" : "none";
		}
	this.updatePos = function (){
		with(this.contentItems){
			style.top = this.contentMain.offsetHeight+this.contentMain.getBoundingClientRect().top-3+"px"
			style.position = ToolKit.navegadorIsGecko ? "fixed" : "absolute";
			style.left = this.contentMain.getBoundingClientRect().left+"px"
			style.width = this.contentMain.offsetWidth+"px"
			style.height = "100px"
			}
		}
	this.init = function (){
		this.obj = document.getElementById(id);
			for(var i=0;i<this.obj.childNodes.length;i++){
				if(this.obj.childNodes[i].className){
					if(this.obj.childNodes[i].className.toUpperCase()=="CONTENTMAINCUSTOMDROPLIST"){
						this.contentMain = this.obj.childNodes[i]
					}else if(this.obj.childNodes[i].className.toUpperCase()=="CONTENTITEMSCUSTOMDROPLIST"){
						this.contentItems = this.obj.childNodes[i]
					}
				}
				
			}
		var _this = this
		listen("click",this.contentItems,function() {_this.contentShow(false);})
		listen("click",this.contentMain,function() {_this.contentShow(true)})
		listen("mouseout",this.contentItems,function() {_this.contentShow(false);})
		listen("mouseover",this.contentItems,function() {_this.contentShow(true);})
		listen("mouseout",this.contentMain,function() {_this.contentShow(false);})
		if(ToolKit.navegadorIsGecko){listen("scroll",window,function() {_this.updatePos()})}
		
		this.contentItems.style.overflowX = "hidden"
		this.contentItems.style.overflowY = "scroll"
		this.contentShow(false);
		this.updatePos();
		}
	}

