// Stop all JavaScript errors

function stoperror(){
	return true;
}
window.onerror=stoperror;

// 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() {
	impacton = new Image();
	impacton.src = "http://www.dpagroundswell.org/images/impact1.gif";
	impactoff = new Image();
	impactoff.src = "http://www.dpagroundswell.org/images/impact0.gif";
	threaton = new Image();
	threaton.src = "http://www.dpagroundswell.org/images/threat1.gif";
	threatoff = new Image();
	threatoff.src = "http://www.dpagroundswell.org/images/threat0.gif";
	helpon = new Image();
	helpon.src = "http://www.dpagroundswell.org/images/help1.gif";
	helpoff = new Image();
	helpoff.src = "http://www.dpagroundswell.org/images/help0.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";
	}

}


