function menu(catN, subcatN) {
	this.currentCat = catN;
	this.currentSubCat = subcatN;
	this.numCats = 0;
	
	this.cats = new Array();
	this.subcats = new Array();
	
	this.mouseOverCat = function(maincatID, subcatID) {
		this.highlightCat(maincatID, subcatID);
	};
	
	// private
	this.highlightCat = function(maincatID, subcatID) {
		if(subcatID < 0 && maincatID > -1) {
			this.hideAll();
			this.soberAll();
			this.showSub(maincatID);
			//document.getElementById('mainCat_'+maincatID).style.backgroundColor = "#e90268";
			this.cats[maincatID].style.backgroundColor = "#e90268";
		}
	};
	
	this.soberCat = function(maincatID, subcatID) {
		//document.getElementById('mainCat_'+maincatID).style.backgroundColor = "transparent";
		this.cats[maincatID].style.backgroundColor = "transparent";
	};
	
	this.showSub = function(ID) {
		//document.getElementById('subcats_'+ID).style.display = "block";
		if(this.subcats[ID] !== undefined && this.subcats[ID] !== null) {
			this.subcats[ID].style.display = "block";
		}
	};
	
	this.hideSub = function(ID) {
		if(this.subcats[ID] !== undefined && this.subcats[ID] !== null) {
			this.subcats[ID].style.display = "none";
		}
	};
	
	this.soberAll = function() {
		for(var n=0; n < this.numCats; n++) {
			this.soberCat(n , -1);
		}
	};
	
	this.hideAll = function() {
		for(var n=0; n < this.numCats; n++) {
			this.hideSub(n);
		}
	};
	
	for(var n=0; document.getElementById('mainCat_'+n) != undefined; n++) {
		this.cats[n] = document.getElementById('mainCat_'+n);
		if(document.getElementById('subcats_'+n) !== undefined) {
			this.subcats[n] = document.getElementById('subcats_'+n);
		}
		this.cats[n].style.display = "block";
		this.numCats++;
	}
	
	this.hideAll();
	
	this.highlightCat(catN, -1);
	this.highlightCat(catN, subcatN);
}

