// User InterFace Eichenbaum.org, JavaScript ie5+ only
// Copyright 2002 (c) Nils Eikelenboom
// Script by Nils Eikelenboom
// All rights reserved. No part of this work may be reproduced, 
// copied or adapted in any form or by any means without written 
// permission from Nils Eikelenboom. 
// Nils Eikelenboom makes no representation or warranties with respect 
// to the contents hereof and specifically disclaims any implied warranties 
// of merchantability or fitness for any particular purpose. 
// Further, Nils Eikelenboom reserves the right to revise this publication 
// and to make changes from time to time in the content hereof without obligation 
// to notify any person of such revision or changes.
// ------------------------------------------------------------------------------

// Initializing Functions

self.status = "Eichenbaum.org";
FnBrowserInfo();

// ------------------------------------------------------------------------------

// Navigation Functions :

function FnRefresh() {
	history.go();
}

function FnBack() {
	history.go(-1);
}

function FnForward() {
	history.go(+1);
}

function FnHome() {
	window.location.href="http://www.eichenbaum.org/headquarters.html";
}

function FnViewRefresh() {
	history.go();
}

// ------------------------------------------------------------------------------

// Window Functions :

function FnViewMin() {

	self.moveTo(0,0)
	self.resizeTo(1,1)

}

function FnViewMax() {

	self.moveTo(0,0)
	self.resizeTo(screen.availWidth,screen.availHeight)

}

function FnMainScreen() {
	controlWindow=window.open("main.html","main","toolbar=no,directories=no,menubar=no,location=no,scrollbars=yes,resizable=no,fullscreen=no,status=yes,top=0,left=0,height=800,width=600");
}

// ------------------------------------------------------------------------------

// Portal Functions

function FnFavorites() {

	window.external.AddFavorite('http://www.eichenbaum.org','CMBB Eichenbaum');

}

// ------------------------------------------------------------------------------

// File handling

function FnSaveFile() {

	// Save file
	alert('There is no file open to save. \n \n No files are saved.')

}

function FnDeleteFile() {

	// Save file
	alert('There is no file open to delete. \n \n No files are deleted.')

}

function FnRenameFile() {

	// Save file
	alert('There is no file open to rename. \n \n No files are renamed.')

}

function FnMoveFile() {

	// Save file
	alert('There is no file open to Move. \n \n No files are moved.')

}

function FnOpenFile() {

	alert('No user has been logged on. \n \n Could not open file.')

}

function FnCloseFile() {

	window.close();

}

function FnSaveFileAs() {

	// Save file As
	alert('There is no file open to save. \n \n No files are saved.')

}

function FnNewFile() {

	// New file
	alert('No user has been logged on. \n \n Could not create file.')

}

function FnPrint() {

	print(document); 
	
}


// ------------------------------------------------------------------------------

// Information Functions

function FnBrowserInfo() {
  	this.name = navigator.appName;
  	this.codename = navigator.appCodeName;
  	this.version = navigator.appVersion.substring(0,4);
  	this.platform = navigator.platform;
  	this.javaEnabled = navigator.javaEnabled();
  	this.screenWidth = screen.width;
  	this.screenHeight = screen.height;
}

function FnProperties() {
	var properties = new FnBrowserInfo();
	confirm('Browser name : '+properties.name+'\n'+'Browser Codename : '+properties.codename+'\n'+'Browser version : '+properties.version+'\n'+'Operating system : '+properties.platform+'\n'+'Javascript enabled : '+properties.javaEnabled+'\n'+'\n'+'This site is best viewed with'+'\n'+'Internet Explorer 5 or higher');
}

function FnPortal() {

	alert('No user has been logged on. \n \n Could not open portal.')
}

function FnAdvertise() {

	alert('No user has been logged on. \n \n Could not open portal.')
}


// ------------------------------------------------------------------------------

// RightClick Menu :

function showmenuie5(){
	var rightedge=document.body.clientWidth-event.clientX
	var bottomedge=document.body.clientHeight-event.clientY
		if (rightedge<ie5menu.offsetWidth)
			ie5menu.style.left=document.body.scrollLeft+event.clientX-ie5menu.offsetWidth
		else
			ie5menu.style.left=document.body.scrollLeft+event.clientX
		if (bottomedge<ie5menu.offsetHeight)
			ie5menu.style.top=document.body.scrollTop+event.clientY-ie5menu.offsetHeight
		else
			ie5menu.style.top=document.body.scrollTop+event.clientY
		ie5menu.style.visibility="visible"
		return false
}
function hidemenuie5(){
	ie5menu.style.visibility="hidden"
}
function highlightie5(){
	if (event.srcElement.className=="menuitems"){
		event.srcElement.style.backgroundColor="highlight"
		event.srcElement.style.color="white"
		}
}
function lowlightie5(){
	if (event.srcElement.className=="menuitems"){
		event.srcElement.style.backgroundColor=""
		event.srcElement.style.color="#C0C0C0"
		}
} 
function jumptoie5(){
		if (event.srcElement.className=="menuitems"){
			if (event.srcElement.url != ''){
				if (event.srcElement.getAttribute("target")!=null)
					window.open(event.srcElement.url,event.srcElement.getAttribute("target"))
				else
					window.location=event.srcElement.url
			}
		}
}

// ------------------------------------------------------------------------------

// Top Menu

  var eOpenMenu = null;
  function OpenMenu(eSrc,eMenu){
    eMenu.style.left = eSrc.parentElement.offsetLeft + divMenuBar.offsetLeft;
    eMenu.style.top = divMenuBar.offsetHeight + divMenuBar.offsetTop;
    eMenu.style.visibility = "visible";
    eOpenMenu = eMenu;
  }

  function CloseMenu(eMenu){
    eMenu.style.visibility = "hidden";
    eOpenMenu = null;
  }

  function MenuBar_over(){
    var eSrc = window.event.srcElement;
    if ("A" == eSrc.tagName.toUpperCase()){
      var eMenu = document.all[eSrc.parentElement.id.replace("tdMenuBarItem","divMenu")];
      if (eOpenMenu && eOpenMenu != eMenu){
        CloseMenu(eOpenMenu);}
      if (eMenu){
		  OpenMenu(eSrc,eMenu);}
    }
  }

  function MenuBar_out(){
    var eTo = window.event.toElement;
    if (eOpenMenu && eTo && !eOpenMenu.contains(eTo) && "tblMenuBar" != eTo.id){
      CloseMenu(eOpenMenu)}
	}

  function Menu_out(){
    var eSrc = window.event.toElement;
    if (eOpenMenu && !eOpenMenu.contains(eSrc) && !divMenuBar.contains(eSrc)){
      CloseMenu(eOpenMenu)}
	}
		
// ------------------------------------------------------------------------------