var t = setTimeout("primarynavReset();secondarynavReset()",2000);

function primarynavReset() {
  var primarynav = 8;  //number of primary navs in navbar
  for(j=1;j<=primarynav;j++){
    if(document.getElementById('primarynav'+j)){
	   document.getElementById('primarynav'+j).style.textDecoration='none';
	   //document.getElementById('primarynav'+j).style.color='#ffffff';
	  }
  }
}

function secondarynavReset() {
  var secondnav = 8;    //number of secondary navs in navbar
  for(j=1;j<=secondnav;j++){
    if(document.getElementById('secondarynav'+j)){
	   document.getElementById('secondarynav'+j).style.left='-999em';
	   document.getElementById('secondarynav'+j).style.top='0';
	  }
	}
}

function timeoutReset() {
	t = setTimeout("primarynavReset();secondarynavReset()",2000);	
}

function timeoutResetoff() {
	clearTimeout(t);
}

function secondarynav(i) {
	primarynavReset();
	secondarynavReset();
	document.getElementById('primarynav'+i).style.textDecoration='none';
	//document.getElementById('primarynav'+i).style.color='#000000';
	document.getElementById('secondarynav'+i).style.left='0';
	document.getElementById('secondarynav'+i).style.top='50px';
}
