var time = 3000;
var numofitems = 8;

//menu constructor
function menu(allitems,thisitem,startstate){ 
  callname= "gl"+thisitem;
  divname="subglobal"+thisitem;  
  this.numberofmenuitems = 8;
  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 Spielbericht(x)
{
var link = "bbberichteshow.php?spielnr="+x
 Edit =
 window.open(link,"Spielbericht", "width=700,height=600,hotkeys=no,left=150,top=150,scrollbars=yes");
 Edit.focus();
}

function Newseintrag(x)
{
var link = "bbnewsshow.php?newsnr="+x
 Edit =
 window.open(link,"Newseintrag", "width=700,height=500,hotkeys=no,left=150,top=150,scrollbars=yes");
 Edit.focus();
}

function ShowBild(x)
{
var link = "bbportrait.php?spieler="+x
 Edit =
 window.open(link,"Edit", "width=300,height=450,hotkeys=no,left=150,top=150");
 Edit.focus();
}

function ShowHalle(x)
{
var link = "bbhalle.php?halle="+x
 Halle =
 window.open(link,"Halle", "width=400,height=150,hotkeys=no,left=120,top=100");
 Halle.focus();
}

function resize_me(n)
{
d=0;
ifObj=document.getElementsByName(n)[0];
p=(document.all)?'scroll':'offset';
eval("ifObj.style.height=window.frames[n].document.getElementsByTagName('body')[0]."+p+"Height+"+d);
} 