
var tabHover = {
	init : function() {
		this.textBox = "navDescription";
		this.ids = ["navhome", "who", "in", "protecting", "information", "living", "family"];
		this.text = ["Return to the Main Homepage", 
					 "Information on the Agency's Mission, Board, and Strategic Vision", 
					 "Receiving the Help You Need to Stay at Home",
					 "Offering programs to protect Consumers of long-term care and vulnerable older adults",
					 "Providing you with information on services for older adults",
					 "Helping you find a place to call home",
					 "Giving Family Caregivers a Helping Hand"];
		
		Event.observe(window, 'load', this._pageLoad.bindAsEventListener(this), false);
	},
	
	_pageLoad : function(){
		this.originalText=$(this.textBox).innerHTML;
		
		for (var i=0; i<this.ids.length; i++) {
			var tmpID=$(this.ids[i]).getElementsByTagName('a')[0];
			Event.observe(tmpID, "mouseover", this.mouseover.bindAsEventListener(this), true);
			Event.observe(tmpID, "mouseout", this.mouseout.bindAsEventListener(this), true);
		}		
	},
	
	mouseover : function(e) {
		if(!e){return false;}
		var id=Event.findElement(e, "li").id;
		var index=this.ids.indexOf(id);
		$(this.textBox).innerHTML= '<span>'+ this.text[index] +'</span>';
	},
	
	mouseout : function(e) {
		if(!e){ return false;}
		$(this.textBox).innerHTML=this.originalText;
	}	 
}

tabHover.init();
