// JavaScript Document
var core=new Core();

core.addEventListener(window,'load',init);

function init()
{	
	var subNavDoc=document.getElementById("subNav").getElementsByTagName('ul')[0];
	var links=subNavDoc.getElementsByTagName('li');
	for(var i=0;i<links.length;i++)
	{
		core.addEventListener(links[i].firstChild,'mouseover',subNavDescriptionsIn);
		core.addEventListener(links[i].firstChild,'mouseout',subNavDescriptionsOut);
		core.addEventListener(links[i].firstChild,'click',subNavDescriptionsOut);
	}
	
}

function subNavDescriptionsIn()
{	
	var aTag=this;
	var value=this.firstChild.nodeValue;
	var spanValue;
	if(value=="Who?" || value=="Who")
	{
		aTag.firstChild.nodeValue="Who";
		spanValue="... are we?";
	}else if(value=="What?")
	{aTag.firstChild.nodeValue="What";
		spanValue="... do we do?";
	}else if(value=="Where?")
	{aTag.firstChild.nodeValue="Where";
		spanValue="... contact us today!";
	}
	else if(value=="Huh?!")
	{
		spanValue="... find out yourself";
	}
	
	var eleSpan=document.createElement('span');
	var eleText=document.createTextNode(spanValue);
	eleSpan.appendChild(eleText);
	eleSpan.className="subNavDescription";
	this.appendChild(eleSpan);
}
function subNavDescriptionsOut()
{
	var aTag=this;
	var value=this.firstChild.nodeValue;
	var spanValue;
	if(value=="Who?" || value=="Who")
	{
		aTag.firstChild.nodeValue="Who?";
			
	}else if(value=="What?" || value=="What")
	{
		aTag.firstChild.nodeValue="What?";
	}else if(value=="Where?" ||value=="Where")
	{
		aTag.firstChild.nodeValue="Where?";
	}
	else if(value=="Huh?!")
	{
		aTag.firstChild.nodeValue="Huh?!";
	}
	var me=this;
	var span=this.getElementsByTagName('span')[0];
	this.removeChild(span);	
	
}