// 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() {
	abouton = new Image();
	abouton.src = "/images/about1.gif";
	aboutoff = new Image();
	aboutoff.src = "/images/about0.gif";
	donateon = new Image();
	donateon.src = "/images/donate1.gif";
	donateoff = new Image();
	donateoff.src = "/images/donate0.gif";
	consumeron = new Image();
	consumeron.src = "/images/consumer1.gif";
	consumeroff = new Image();
	consumeroff.src = "/images/consumer0.gif";
	affordableon = new Image();
	affordableon.src = "/images/affordable1.gif";
	affordableoff = new Image();
	affordableoff.src = "/images/affordable0.gif";
	reformon = new Image();
	reformon.src = "/images/reform1.gif";
	reformoff = new Image();
	reformoff.src = "/images/reform0.gif";
	informedon = new Image();
	informedon.src = "/images/informed1.gif";
	informedoff = new Image();
	informedoff.src = "/images/informed0.gif";
	productson = new Image();
	productson.src = "/images/products1.gif";
	productsoff = new Image();
	productsoff.src = "/images/products0.gif";
	bookson = new Image();
	bookson.src = "/images/books1.gif";
	booksoff = new Image();
	booksoff.src = "/images/books0.gif";
	authoron = new Image();
	authoron.src = "/images/author1.gif";
	authoroff = new Image();
	authoroff.src = "/images/author0.gif";
	contacton = new Image();
	contacton.src = "/images/contact1.gif";
	contactoff = new Image();
	contactoff.src = "/images/contact0.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";
	}

}

