if(document.all) {
    doc = "document.all";
    stl = ".style";
} else {
    doc = "document";
    stl = "";
}

home_on = new Image(90,25);
home_on.src = "images/menu/home_on.gif";
news_on = new Image(90,25);
news_on.src = "images/menu/news_on.gif";
gallery_on = new Image(90,25);
gallery_on.src = "images/menu/gallery_on.gif";
events_on = new Image(90,25);
events_on.src = "images/menu/events_on.gif";
scores_on = new Image(90,25);
scores_on.src = "images/menu/scores_on.gif";
staff_on = new Image(90,25);
staff_on.src = "images/menu/staff_on.gif";
links_on = new Image(90,25);
links_on.src = "images/menu/links_on.gif";
//
home_off = new Image(90,25);
home_off.src = "images/menu/home_off.gif";
news_off = new Image(90,25);
news_off.src = "images/menu/news_off.gif";
gallery_off = new Image(90,25);
gallery_off.src = "images/menu/gallery_off.gif";
events_off = new Image(90,25);
events_off.src = "images/menu/events_off.gif";
scores_off = new Image(90,25);
scores_off.src = "images/menu/scores_off.gif";
staff_off = new Image(90,25);
staff_off.src = "images/menu/staff_off.gif";
links_off = new Image(90,25);
links_off.src = "images/menu/links_off.gif";

var flags = new Array();
var group = new Array();
group['home']=[['homemenu']];
group['events']=[['eventsmenu']];
group['gallery']=[['gallerymenu']];
group['scores']=[['scoresmenu']];

function set_flag(group_name, flag) {
	flags[group_name]=flag;
}

function slow_down(group_name, act) {
	var ans;	
	if (act=='visible') {		
		set_flag(group_name,1);		
	}
	else {		
		set_flag(group_name,0);	
	}
	setTimeout("show_hide_group('"+group_name+"', '"+act+"');",1);	
}

function show_hide_group(group_name, act) {
	if(((flags[group_name]==1)&&(act='visible'))||((flags[group_name]==0)&&(act='hidden')))
	for(i=0;i<group[group_name].length;i++) {
		show_hide(group[group_name][i], act);
	}
}

function show_hide(who_to, what_to) {
	layer_str=eval(doc+"."+who_to+stl);
	layer_str.visibility=what_to;
}

function mOn(imgName) {
	document.images[imgName].src = eval(imgName + "_on.src");
}

function mOff(imgName) {
	document.images[imgName].src = eval(imgName + "_off.src");
}

function showPic(imgSource,iWidth,iHeight) {
	iWidth = iWidth + 50;
	iHeight = iHeight + 50;
	xWindow = window.open("images/" + imgSource,"xWin","toolbars=no,scrollbars=yes,width=" + iWidth + ",height=" + iHeight)
	xWindow.focus();
	return false;
}

function showPic2(imgSource,iWidth,iHeight) {
	// used when page is one-level deep
	iWidth = iWidth + 50;
	iHeight = iHeight + 50;
	xWindow = window.open("/tc/images/" + imgSource,"xWin","toolbars=no,scrollbars=yes,width=" + iWidth + ",height=" + iHeight)
	xWindow.focus();
	return false;
}