var time = 3000;
var numofitems = 7;

//menu constructor
function menu(allitems,thisitem,startstate){ 
  callname= "gl"+thisitem;
  divname="subglobal"+thisitem;  
	this.numberofmenuitems = allitems;
	this.caller = document.getElementById(callname);
	this.thediv = document.getElementById(divname);
	this.thediv.style.visibility = startstate;
}
				 
//menu methods
function ehandler(event,theobj){
  for (var i=1; i<= theobj.numberofmenuitems; i++){
	  var shutdiv =eval( "menuitem"+i+".thediv");
    shutdiv.style.visibility="hidden";
	}
	theobj.thediv.style.visibility="visible";
}
				
function closesubnav(event){
  if ((event.clientY <48)||(event.clientY > 107)){
    for (var i=1; i<= numofitems; i++){
      var shutdiv =eval('menuitem'+i+'.thediv');
			shutdiv.style.visibility='hidden';
		}  
	}
}
function gotoAnchor(navVar) {
		location.href = navVar;
}

var images = new Array() 
/* this really should be dynamic, but we can't use any serverside scripting
 *(yey andrew publishing) so we have to provide a list of the images we want
 * to randomize
 */ 
images[0] = 'media/images/site/0016b02v.jpg'
images[1] = 'media/images/site/0016b02w.jpg'
images[2] = 'media/images/site/0016b02x.jpg'
images[3] = 'media/images/site/0016b02y.jpg'
images[4] = 'media/images/site/0016b02z.jpg'
images[5] = 'media/images/site/0016b02u.jpg'

function alliesLogo(){
document.write('<img src="'+images[Math.round(Math.random()*(images.length-1))]+'" width="768" height="150">');
}
