/////////////////////////////////////////////////////////
// 	Name:		interface.js
//	Intention:	scripts of BJB website
//	Author:		Helge Fredrich
//	last m.:	20.12.2004
// 	
//	all rights by Helge Fredrich
/////////////////////////////////////////////////////////
//

function getRef(id)
{
 return document.getElementById(id);
}
function getHeight()
{
		var x,y;
if (self.innerHeight) // all except Explorer
{
	x = self.innerWidth;
	y = self.innerHeight;
}
else if (document.documentElement && document.documentElement.clientHeight)
	// Explorer 6 Strict Mode
{
	x = document.documentElement.clientWidth;
	y = document.documentElement.clientHeight;
}
else if (document.body) // other Explorers
{
	x = document.body.clientWidth;
	y = document.body.clientHeight;
}

		return y;
}

//
// scaling of background and content
function resizeInterface(){
var border=40;
var howTall=getHeight()-border;
var howTall2=howTall-270;
var howTall3=((howTall2 < 350) ? howTall2: 350);
getRef("interface").style.height=howTall;
getRef("content").style.height=howTall2;
getRef("news").style.height=howTall3;
}
window.onresize = new Function("resizeInterface()");
window.onload = new Function("resizeInterface()");
//
//
// nescape resize fix
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//
//
//  menu actions
var time = 3000;
var numofitems = 5;

//menu constructor
function menu(allitems,thisitem,startstate){ 
  callname= "gl"+thisitem;
  divname="subglobal"+thisitem;  
	this.numberofmenuitems = 5;
	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 <100)||(event.clientY > 275)){
    for (var i=1; i<= numofitems; i++){
      var shutdiv =eval('menuitem'+i+'.thediv');
			shutdiv.style.visibility='hidden';
		}  
	}
}
// -->

function MM_callJS(jsStr) { //v2.0
  return eval(jsStr)
}
// -->
function loadContent(url){
var layer=document.getElementById("content");
layer.src=url;
}
//-->