// Generic rollover functions

function overImage(imgName) {
	if (document.images) {
		imgOn = eval(imgName + "on.src");
		document [imgName].src = imgOn;	
	}
}

function offImage(imgName) {
	if (document.images) {
		imgOff = eval(imgName + "off.src");
		document [imgName].src = imgOff;	
	}
}

function loadImages() {
	homeon = new Image();
	homeon.src = "http://www.nahu.org/images/home1.gif";
	homeoff = new Image();
	homeoff.src = "http://www.nahu.org/images/home0.gif";
	storeon = new Image();
	storeon.src = "http://www.nahu.org/images/store1.gif";
	storeoff = new Image();
	storeoff.src = "http://www.nahu.org/images/store0.gif";
	shouton = new Image();
	shouton.src = "http://www.nahu.org/images/shout1.gif";
	shoutoff = new Image();
	shoutoff.src = "http://www.nahu.org/images/shout0.gif";
	contacton = new Image();
	contacton.src = "http://www.nahu.org/images/contact1.gif";
	contactoff = new Image();
	contactoff.src = "http://www.nahu.org/images/contact0.gif";
	abouton = new Image();
	abouton.src = "http://www.nahu.org/images/about1.gif";
	aboutoff = new Image();
	aboutoff.src = "http://www.nahu.org/images/about0.gif";
	newson = new Image();
	newson.src = "http://www.nahu.org/images/news1.gif";
	newsoff = new Image();
	newsoff.src = "http://www.nahu.org/images/news0.gif";
	connecton = new Image();
	connecton.src = "http://www.nahu.org/images/connect1.gif";
	connectoff = new Image();
	connectoff.src = "http://www.nahu.org/images/connect0.gif";
	blogon = new Image();
	blogon.src = "http://www.nahu.org/images/blog1.gif";
	blogoff = new Image();
	blogoff.src = "http://www.nahu.org/images/blog0.gif";
	joinon = new Image();
	joinon.src = "http://www.nahu.org/images/join1.gif";
	joinoff = new Image();
	joinoff.src = "http://www.nahu.org/images/join0.gif";
	searchon = new Image();
	searchon.src = "http://www.nahu.org/images/search1.gif";
	searchoff = new Image();
	searchoff.src = "http://www.nahu.org/images/search0.gif";
	consumeron = new Image();
	consumeron.src = "http://www.nahu.org/images/consumer1.gif";
	consumeroff = new Image();
	consumeroff.src = "http://www.nahu.org/images/consumer0.gif";
	legislativeon = new Image();
	legislativeon.src = "http://www.nahu.org/images/legislative1.gif";
	legislativeoff = new Image();
	legislativeoff.src = "http://www.nahu.org/images/legislative0.gif";
	educationon = new Image();
	educationon.src = "http://www.nahu.org/images/education1.gif";
	educationoff = new Image();
	educationoff.src = "http://www.nahu.org/images/education0.gif";
	edfoundon = new Image();
	edfoundon.src = "http://www.nahu.org/images/edfound1.gif";
	edfoundoff = new Image();
	edfoundoff.src = "http://www.nahu.org/images/edfound0.gif";
	memberson = new Image();
	memberson.src = "http://www.nahu.org/images/members1.gif";
	membersoff = new Image();
	membersoff.src = "http://www.nahu.org/images/members0.gif";
	mediaon = new Image();
	mediaon.src = "http://www.nahu.org/images/media1.gif";
	mediaoff = new Image();
	mediaoff.src = "http://www.nahu.org/images/media0.gif";
	meetingson = new Image();
	meetingson.src = "http://www.nahu.org/images/meetings1.gif";
	meetingsoff = new Image();
	meetingsoff.src = "http://www.nahu.org/images/meetings0.gif";
	bookson = new Image();
	bookson.src = "http://www.nahu.org/images/books1.gif";
	booksoff = new Image();
	booksoff.src = "http://www.nahu.org/images/books0.gif";
	mynahuon = new Image();
	mynahuon.src = "http://www.nahu.org/images/mynahu1.gif";
	mynahuoff = new Image();
	mynahuoff.src = "http://www.nahu.org/images/mynahu0.gif";
	carerighton = new Image();
	carerighton.src = "http://www.nahu.org/images/right1.gif";
	carerightoff = new Image();
	carerightoff.src = "http://www.nahu.org/images/right0.gif";
}

if (document.images) {
	loadImages();
}

// Returns a handle to the named layer.

function getLayer(name) {

	if (document.layers) {
		return(document.layers[name]);
	}
	else {
		layer = document.getElementById(name);
		if (layer) {
			return(layer);
		} else {
			return(null);
		}
	}
}

// Hides the named layer

function hideLayer(name) {

	var layer = getLayer(name);

	if (layer.style) {
		layer.style.visibility="hidden";	
	} else {
		layer.visibility="hide";
	}

}

// Shows the named layer

function showLayer(name) {

	var layer = getLayer(name);

	if (layer.style) {
		layer.style.visibility="visible";	
	} else {
		layer.visibility="show";
	}

}


// Font resize code

var min=8;
var max=18;
var str="p,li,td";
var valueArray = str.split(",");
function increaseFontSize() {
   for(var j=0; j<valueArray.length; j++) {
   var p = document.getElementsByTagName(valueArray[j]);
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=max) {
         s += 1;
      }
      p[i].style.fontSize = s+"px"
   }
   }
}
function decreaseFontSize() {
   for(var j=0; j<valueArray.length; j++) {
   var p = document.getElementsByTagName(valueArray[j]);
   for(i=0;i<p.length;i++) {
      if(p[i].style.fontSize) {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=min) {
         s -= 1;
      }
      p[i].style.fontSize = s+"px"
   }   
   }
}
