var isDOM = (document.getElementById ? true : false); 
var isIE4 = ((document.all && !isDOM) ? true : false);
var isNS4 = (document.layers ? true : false);

var nsArray = new Array();

function getRef(id) {
if (isDOM) return document.getElementById(id);
if (isIE4) return document.all[id];
if (isNS4) return document.layers[id];
}
function getSty(id) {
return (isNS4 ? getRef(id) : getRef(id).style);
} 

//function dbgclr() {
//document.frm.dbg.value = '';
//}

function dbg(txt) {
document.frm.dbg.value = document.frm.dbg.value + '\n' + txt;
}

function newWindowPP(content, name, angaben) {
  nw = window.open(content,name,angaben);
  nw.focus();
}

function newVideo(content, w, h) {
   if (w == null) w = 650;
   if(h == null) h = 540;
   nw = window.open(content,"popupWindow","width=" + w + ",height=" + h + ",left=0,top=0, scrollbars=no, menubar=no, status=no,resizable=no");
   nw.focus();
}

function newVideo560(content, w, h) {
   if (w == null) w = 570;
   if(h == null) h = 350;
   nw = window.open(content,"popupWindow","width=" + w + ",height=" + h + ",left=0,top=0, scrollbars=no, menubar=no, status=no,resizable=no");
   nw.focus();
}

function bookmark() {
  if (navigator.appName == 'Microsoft Internet Explorer' && parseInt(navigator.appVersion) >= 4) {
    window.external.AddFavorite(location.href, document.title);
  } else { alert('Bookmark this page by clicking CTRL-D.');}
}

function popup(target) {
  exWin = window.open(target,"Draeger", "width=400,height=300,left=0,top=0, scrollbars=yes,resizable=yes");
  exWin.focus();
}

function popupPure(target) {
  exWin = window.open(target,"Draeger","width=400,height=400,left=0,top=0,scrollbars=no,menubar=no");
  exWin.focus();
}

function popupPDF(target) {
  winPDF = window.open(target,"Draeger","left=0,top=0,scrollbars=no,menubar=no,resizable=yes");
  winPDF.focus();
}

// Hide timeout.
var popTimer = 0;
// Array showing highlighted menu items.
var litNow = new Array();
var litNowL = new Array();
var litNowLT = new Array();
var selectedItem = new Array();
var selectedItemL = new Array();

function parentWindow(URI){ 
	opener.location.href = URI;
}

function findPosX(obj)
{

	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft;
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}

function findPosY(obj)
{
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop;
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
}


// *** MENU CONSTRUCTION FUNCTIONS ***

function Menu(isVert, popInd, x, y, width, overCol, backCol, borderClass, textClass) {
// True or false - a vertical menu?
this.isVert = isVert;
// The popout indicator used (if any) for this menu.
this.popInd = popInd
// Position and size settings.
this.x = x;
this.y = y;
this.width = width;
// Colours of menu and items.
this.overCol = overCol;
this.backCol = backCol;
// The stylesheet class used for item borders and the text within items.
this.borderClass = borderClass;
this.textClass = textClass;
// Parent menu and item numbers, indexed later.
this.parentMenu = null;
this.parentItem = null;
// Reference to the object's style properties (set later).
this.ref = null;
// Menu object to get Height/width
this.obj=null;
}

function Item(text, href, frame, length, spacing, target) {
this.text = text;
this.href = href;
this.frame = frame;
this.length = length;
this.spacing = spacing;
this.target = target;
// Reference to the object's style properties (set later).
this.ref = null;
this.reftd = null;
}