function forgetIt() { return true; }
window.onerror = forgetIt;

var ip = (window.imagePath) ? window.imagePath : '/images/';

var loaded = false;
function init() {
	if (document.images) { 
		loaded = true;
		if (thisSec && thisSec != '' && checkSec(thisSec)) {
			document.images['menu_'+thisSec].src = imgArray[thisSec][1].src;
		}
	}
}
window.onload = init;

var secs = new Array('home', 'about', 'previous', 'business', 'community', 'contact');
var imgArray = new Object();

if (document.images) {
	for (var i=0; i < secs.length; i++) {
		var s = secs[i];
		imgArray[s] = new Array();
		imgArray[s][0] = new Image; imgArray[s][0].src = ip+'menu_'+s+'.gif';
		imgArray[s][1] = new Image; imgArray[s][1].src = ip+'menu_'+s+'_o.gif';
	}
}

function swap(sec, state) {
	if (thisSec && thisSec != '' && sec == thisSec) return;
	if (thisSec && thisSec != '' && !checkSec(thisSec)) return;
	document.images['menu_'+sec].src = imgArray[sec][state].src;
	return;
}
function checkClick(sec) {
	if (thisSec && thisSec != '' && sec == thisSec && !subSec) return false;
	return true;
}
function checkSec(sec) {
	if (!sec) return false;
	if (loaded && imgArray && imgArray[sec] && document.images['menu_'+sec]) return true;
	return false;
}

var timer = null;
var menuShown = '';

function toggleMenu(sec, state) {
	if (!sec) return;
	if (!document.getElementById) return;
	if (timer) clearTimeout(timer);
	if (sec != menuShown) hideMenu(menuShown);
	var menuDiv = document.getElementById('drop_'+sec);
	if (!menuDiv) return;
	if (state) {
		showMenu(sec);
		menuShown = sec;
	} else {
		timer = setTimeout("hideMenu('"+sec+"')", 20);
	}
}

function showMenu(sec) {
	if (!sec) return;
	if (!document.getElementById) return;
	var menuDiv = document.getElementById('drop_'+sec);
	if (!menuDiv) return;
	menuDiv.style.visibility = 'visible';
}

function hideMenu(sec) {
	if (!sec) return;
	if (!document.getElementById) return;
	var menuDiv = document.getElementById('drop_'+sec);
	if (!menuDiv) return;
	menuDiv.style.visibility = 'hidden';
	menuShown = '';
}

