if (document.all){
  var ie=true;
}else if (document.layers){
 var ns4=true;
}else if (document.getElementById){
  var ns6=true;
}else{
  var undetected=true;
}

function init(num){
	section=num;
	setHighlite();
}

function setHighlite(){
	// create highlite for section on page load if not home
	if(section>0){
		var sectionTag="nav"+section;
		var sectionImg=sectionTag+"a.gif";
		changeImage(sectionTag,sectionImg,'nav');
	}
}

function changeImage(whichTag,whichImg,whichDiv,whichSection){
	if(whichSection!=section){
		var path="images/nav/";
		if(ie)document.all[whichTag].src=path+whichImg;
		if(ns6)document.images[whichTag].src=path+whichImg;	
		if(ns4)document.layers[whichDiv].document.images[whichTag].src=path+whichImg;
	}
	killSubnav();
	if(whichSection==1 || whichSection==2 || whichSection==4){
		revealSubnav(whichSection);
	}
}
function killSubnav(){
	for(i=1;i<5;i++){
		if(i!=3){
			var tDiv='sub'+i;
			if(ie)document.all[tDiv].style.visibility="hidden";
			if(ns6)document.getElementById(tDiv).style.visibility="hidden";
			if(ns4)document.layers[tDiv].visibility="hide";	
		}
	}
	for(i=1;i<3;i++){
		var tDiv='kill'+i;
		if(ie)document.all[tDiv].style.visibility="hidden";
		if(ns6)document.getElementById(tDiv).style.visibility="hidden";
		if(ns4)document.layers[tDiv].visibility="hide";	
	}
}
function revealSubnav(whichSection){
	var whichDiv='sub'+whichSection;
	if(ie)document.all[whichDiv].style.visibility="visible";
	if(ns6)document.getElementById(whichDiv).style.visibility="visible";
	if(ns4)document.layers[whichDiv].visibility="show";
	for(i=1;i<3;i++){
		var tDiv='kill'+i;
		if(ie)document.all[tDiv].style.visibility="visible";
		if(ns6)document.getElementById(tDiv).style.visibility="visible";
		if(ns4)document.layers[tDiv].visibility="show";	
	}
}

