

// Menu functionality Script

// SSD Drives Menue DATA

// Menu Data alter the following data to change the menu items.

// Replace ITEM1, ITEM2, etc. with the item names, and URL1, URL2, etc. with the location of the target page.
// arMenu1 - 5 refer to the five menus displayed.

// Any items that are empty strings mean that they are using default values as set in the script below.
// A list of argument values which may need to be changed are shown below:  

// arMenu[ref] = new Array("[width]","[x position]","[y position]","","","","","","","[item name][|number of lines(optional)]","[item url]",[0=has no submenu, 1=has sub menu], [add as many items as required] );

//To allow long menu items to wrap onto a new line with Internet Explorer 5: Use "|n" when defining the array.
//(Where | is used as a delimiter and n=number of lines required.)
//eg. arMenu1 = new Array(120,17,80,"","","","","","","Long Menu Item (this is a test of a very long item)|3","http://www.website.com/page.htm",0,"This is an even longer item with lots of text to demonstrate the height feature in the menu|5","http://www.website.com/page.htm",0)

arMenu1 = new Array(75,23,81,"","","","","","","Deutschland","http://www.ssd-drives.de",0);
arMenu2 = new Array(100,115,81,"","","","","","","Baureihe 890PX","890PX.htm",0);
arMenu3 = new Array(115,236,81,"","","","","","","Drehstromantriebe","ACHome.htm",0,"Gleichstromantriebe","DCHome.htm",0,"Servoantriebe","ServoHome.htm",0,"HMIs","TS8000.htm",0);
arMenu4 = new Array(105,343,81,"","","","","","","Informationen","Informationen.htm",0,"Wir über uns","wirueberuns.htm",0,"Messetermine","Messetermine.htm",0,"Pressemitteilungen","Pressemitteilung.htm",0,"Karriere","Job_Karriere.htm",0);
arMenu5 = new Array(85,468,81,"","","","","","","In Deutschland","Kontakte.htm",0,"Weltweit","http://www.ssddrives.com/Portal_m0_ge.php?x2=german&x3=Y",0);
arMenu6 = new Array(87,573,81,"","","","","","","Software","technik/software.htm",0,"Dokumentation","DokuHome.htm",0,"Kataloge","Dokumentation-AC-DC/Doku-Web/Doku-Kataloge.htm",0);
arMenu7 = new Array(90,695,81,"","","","","","","Service","Service.htm",0,"Reparatur","Reparatur.htm",0,"Helpline","Helpline.htm",0);

// This variable controls the delay used to display the menus.
// The value is in milliseconds.
ShowDelay = 25;

// Menu display variables

// The menu system has been changed so that the static menu item "MENU1", "MENU2", etc., below are now hyperlinks to section pages
// rather than null links as before. So a menu item "Products" would link to a "Product Overview" page from which all the menu items
// in the Products menu are also linked. We strongly urge site owners to use this feature to ensure compatibility with all browsers
// and all search engine spiders (including the Invensys search engine).
// For an example of how this works visit: www.invensys.com and click on any of the top menu links (rather than a drop-down link).

var displaymenu="";
displaymenu+="<table border=0 cellspacing=0 cellpadding=3>";
displaymenu+="<tr>";
displaymenu+="		<td width=80 align=center>";
displaymenu+="			<p class=menu><img src=\"images/arrow.gif\" width=9 height=6 border=0>";
displaymenu+="			<A class=menu HREF=\"javascript:nullLink()\" onMouseOver='displayMenu(event,\"Menu1\");status=\"Startseite\";return true' onMouseOut='hideMenu(\"Menu1\");status=\"\";return true'>Home</a>";
displaymenu+="		</td>";
displaymenu+="		<td width=17 align=center>";
displaymenu+="			<p class=menu>|";
displaymenu+="		</td>";
displaymenu+="		<td width=80 align=center>";
displaymenu+="			<p class=menu><img src=\"images/arrow.gif\" width=9 height=6 border=0>";
displaymenu+="			<A class=menu HREF=\"javascript:nullLink()\" onMouseOver='displayMenu(event,\"Menu2\");status=\"Neuigkeiten\";return true' onMouseOut='hideMenu(\"Menu2\");status=\"\";return true'>Neuigkeiten</a>";
displaymenu+="		</td>";
displaymenu+="		<td width=18 align=center>";
displaymenu+="			<p class=menu>|";
displaymenu+="		</td>";
displaymenu+="		<td width=85 align=center>";
displaymenu+="			<p class=menu><img src=\"images/arrow.gif\" width=9 height=6 border=0>";
displaymenu+="			<A class=menu HREF=\"javascript:nullLink()\" onMouseOver='displayMenu(event,\"Menu3\");status=\"Produkte\";return true' onMouseOut='hideMenu(\"Menu3\");status=\"\";return true'>Produkte</a>";
displaymenu+="		</td>";
displaymenu+="		<td width=18 align=center>";
displaymenu+="			<p class=menu>|";
displaymenu+="		</td>";
displaymenu+="		<td width=90 align=center>";
displaymenu+="			<p class=menu><img src=\"images/arrow.gif\" width=9 height=6 border=0>";
displaymenu+="			<A class=menu HREF=\"javascript:nullLink()\" onMouseOver='displayMenu(event,\"Menu4\");status=\"Wir über uns\";return true' onMouseOut='hideMenu(\"Menu4\");status=\"\";return true'>Wir über uns</a>";
displaymenu+="		</td>";
displaymenu+="		<td width=18 align=center>";
displaymenu+="			<p class=menu>|";
displaymenu+="		</td>";
displaymenu+="		<td width=80 align=center>";
displaymenu+="			<p class=menu><img src=\"images/arrow.gif\" width=9 height=6 border=0>";
displaymenu+="			<A class=menu HREF=\"javascript:nullLink()\" onMouseOver='displayMenu(event,\"Menu5\");status=\"Kontakte\";return true' onMouseOut='hideMenu(\"Menu5\");status=\"\";return true'>Kontakte</a>";
displaymenu+="		</td>";
displaymenu+="		<td width=18 align=center>";
displaymenu+="			<p class=menu>|";
displaymenu+="		</td>";
displaymenu+="		<td width=80 align=center>";
displaymenu+="			<p class=menu><img src=\"images/arrow.gif\" width=9 height=6 border=0>";
displaymenu+="			<A class=menu HREF=\"javascript:nullLink()\" onMouseOver='displayMenu(event,\"Menu6\");status=\"Downloads\";return true' onMouseOut='hideMenu(\"Menu6\");status=\"\";return true'>Downloads</a>";
displaymenu+="		</td>";
displaymenu+="		<td width=18 align=center>";
displaymenu+="			<p class=menu>|";
displaymenu+="		</td>";
displaymenu+="		<td width=85 align=center>";
displaymenu+="			<p class=menu><img src=\"images/arrow.gif\" width=9 height=6 border=0>";
displaymenu+="			<A class=menu HREF=\"javascript:nullLink()\" onMouseOver='displayMenu(event,\"Menu7\");status=\"Support\";return true' onMouseOut='hideMenu(\"Menu7\");status=\"\";return true'>Support</a>";
displaymenu+="		</td>";
displaymenu+="		<td width=17 align=center>";
displaymenu+="			<p class=menu>|";
displaymenu+="		</td>";
displaymenu+="	</tr>";
displaymenu+="</table>";

// Null function to prevent href links
function nullLink(){
}

// Default menu settings

var BV=parseInt(navigator.appVersion);
var BN=window.navigator.appName;
var IsWin=(navigator.userAgent.indexOf('Windows')!=-1)?true:false;
var OP=(navigator.userAgent.indexOf('Opera')!=-1&&BV>=4)?true:false;
var NS4=(BN.indexOf('Netscape')!=-1&&(BV==4)&&!OP)?true:false;
var SM=(BN.indexOf('Netscape')!=-1&&(BV>=5)||OP)?true:false;
var IE4=(BN.indexOf('Explorer')!=-1&&(BV>=4)||SM)?true:false;
isMac = (navigator.appVersion.indexOf("Mac") != -1);
isMIE = (navigator.appName == "Microsoft Internet Explorer");
isMenu = (NS4 || (IE4 && !isMac));
ver4 = (NS4 || IE4);

var pMenu4SM;

function displayMenu(){return};
function hideMenu(){return};

if(!ver4) event = null;

// code altered by Keith Harris on 28.9.00
// if brackets commented out to
// help fail-safe on Mac browsers

// if(isMenu) {
	menuVersion = 3;

	menuWidth = 80;
	childOverlap = 50;
	childOffset = 5;
	perCentOver = null;
	secondsVisible = .3;

	fntCol = "#ffffff";
	fntSiz = "7";
	fntBold = true;
	fntItal = false;
	fntFam = "verdana";

	backCol = "#000000";
	overCol = "#000000";
	overFnt = "#cc6600";

	borWid = 0;
	borCol = "black";
	borSty = "solid";
	itemPad = 3;

	imgSrc = "";
	imgSiz = 6;

	separator = 0;
	separatorCol = "#000000";

	isFrames = false;
	navFrLoc = "left";

	keepHilite = true;
	NSfontOver = true;
	clickStart = false;
	clickKill = false;
// }

// Main code

loader = (isFrames)?((NS4)?parent:parent.document.body):window;
loader.onload = startIt;

if(NS4){
	origWidth = loader.innerWidth;
	origHeight = loader.innerHeight;
	loader.onresize = reDo;
}
isLoaded = false;
NSresized = false;

if(!window.menuVersion)
	clickKill = showVisited = NSfontOver = keepHilite = clickStart = false;

if(!window.imgHspace) imgHspace=0;

isWin = (navigator.appVersion.indexOf("Win") != -1)
if(!isWin && !isMac) NSfontOver = showVisited = false;

mSecsVis = secondsVisible*1000;
isRight = (window.navFrLoc && navFrLoc == "right");

imgSuf = (isRight)?">" :" ALIGN=RIGHT>";

imgStr = "<IMG SRC='" + imgSrc + "' WIDTH=" + imgSiz + " HEIGHT=" + imgSiz +" VSPACE=2 HSPACE="+ imgHspace +" BORDER=0"+ imgSuf;

fullImgSize = (imgSiz+(imgHspace*2));

//NS 6 does not seem to like the <span> tag... NS bug #1,985,234 :)
if(IE4&&!SM) imgStr = "<SPAN STYLE='height:100%;width:"+ (fullImgSize-(isRight?3:0)) +";float:"+ (isRight?"left":"right") +";overflow:hidden'>"+ imgStr +"</SPAN>";

areCreated = false;
menuLoc = null;

function initVars() {
	if(areCreated) {
		for(i=1; i<topCount; i++) {
			cur = eval("Menu"+i);
			clearTimeout(cur.hideTimer);
			cur.hideTimer=null;
		}
		clearTimeout(allTimer);
	}
	topCount = 1;
	areCreated = false;
	beingCreated = false;
	isOverMenu = false;
	currentMenu = null;
	allTimer = null;
}

initVars();

function NSunloaded(){
	isLoaded = false;
}

function NSloaded(e){
	if(e.target.name == mainFrName) {
		initVars();
		startIt();
	}
}

function IEunloaded() {
	initVars();
	isLoaded = false;
	setTimeout("keepTrack()",50)
}

function keepTrack() {
	if(menuLoc.document.readyState == "complete") {
		initVars();
		startIt();
	}
	else {
		setTimeout("keepTrack()",50);
	}
}

function startIt() {
	setTimeout('wechsel()',2000);
	isLoaded = true;
	if(isFrames) {
		menuLoc = eval("parent.frames." + mainFrName);
		if(NS4) {
			loader.captureEvents(Event.LOAD);
			loader.onload = NSloaded;
			menuLoc.onunload = NSunloaded;
		}
		if(IE4) {
			menuLoc.document.body.onunload = IEunloaded;
		}
	}
	else {
		menuLoc = window;
	}
	menuLoc.nav = nav = window;
	if(clickKill) {
		if(NS4) menuLoc.document.captureEvents(Event.MOUSEDOWN);
		menuLoc.document.onmousedown = clicked;
	}
	makeTop();	
}

function makeTop(){
	beingCreated = true;

	if(IE4) {
		topZ = 0;
		if(SM)			
			for(z=0;z<menuLoc.document.body.childNodes.length;z++){
				oldEl = menuLoc.document.body.childNodes.item(z);
				if(oldEl.style) topZ = Math.max(oldEl.style.zIndex,topZ)
			}
		else
			for(z=0;z<menuLoc.document.all.length;z++){
				oldEl = menuLoc.document.all(z);
				topZ = Math.max(oldEl.style.zIndex,topZ)
			}
	}
	while(eval("window.arMenu" + topCount)) {
		NS4?makeMenuNS(false,topCount):makeMenuIE(false,topCount);
		topCount++;
	}

	status = ""
	areCreated = true;
	beingCreated = false;
}

function makeMenuNS(isChild,menuCount,parMenu,parItem) {
	tempArray = eval("arMenu" + menuCount);
	
	if(!isChild) {
		tempWidth = tempArray[0]?tempArray[0]:menuWidth;
		menu = makeElement("Menu" + menuCount,tempWidth,null,null);
	} else {
		menu = makeElement("Menu" + menuCount,null,parMenu,null);
	}
	menu.array = tempArray;
	menu.setMenuTree = setMenuTree;
	menu.setMenuTree(isChild,parMenu);

	while(menu.itemCount < menu.maxItems) {
		menu.itemCount++;
		status = "";
		prevItem = (menu.itemCount > 1)?menu.item:null;
		itemName = "item" + menuCount + "_" + menu.itemCount;

		menu.item = makeElement(itemName,null,null,menu);

		menu.item.prevItem = prevItem;
		menu.item.setup = itemSetup;
		menu.item.setup(menu.itemCount,menu.array);
		if(menu.item.hasMore) {
			makeMenuNS(true,menuCount + "_" + menu.itemCount,menu,menu.item);
			menu = menu.parentMenu;
		}
	}

	menu.lastItem = menu.item;
	menu.setup(isChild,parMenu,parItem);
}

function findTree(men){
	foundTree = false;
	for(i=11;i<men.array.length;i+=3){
		if(men.array[i]) {
			foundTree = true;
			break;
		}
	}

	return foundTree;
}

function setMenuTree(isChild,parMenu) {
	if(!isChild) {
		this.menuWidth = this.array[0]?this.array[0]:menuWidth;
		this.menuLeft = this.array[1];
		this.menuTop = this.array[2];
		this.menuFontColor = this.array[3]?this.array[3]:fntCol;
		this.menuFontOver = this.array[4]?this.array[4]:overFnt;
		this.menuBGColor = this.array[5]?this.array[5]:backCol;
		this.menuBGOver = this.array[6]?this.array[6]:overCol;
		this.menuBorCol = this.array[7]?this.array[7]:borCol;
		this.menuSeparatorCol = this.array[8]?this.array[8]:separatorCol;
		this.treeParent = this;
		this.startChild = this;
		this.isTree = findTree(this);
	} else {
		this.menuWidth = parMenu.menuWidth;
		this.menuLeft = parMenu.menuLeft;
		this.menuTop = parMenu.menuTop;
		this.menuFontColor = parMenu.menuFontColor;
		this.menuFontOver = parMenu.menuFontOver;
		this.menuBGColor = parMenu.menuBGColor;
		this.menuBGOver = parMenu.menuBGOver;
		this.menuBorCol = parMenu.menuBorCol;
		this.menuSeparatorCol = parMenu.menuSeparatorCol;
		this.treeParent = parMenu.treeParent;
		this.isTree = parMenu.isTree;
	}

	this.maxItems = (isChild)?this.array.length/3:(this.array.length-9)/3;
	this.hasParent = isChild;
    this.setup = menuSetup;
	this.itemCount = 0;
}

function makeMenuIE(isChild,menuCount,parMenu) {

	menu = makeElement("Menu" + menuCount);
	menu.array = eval("arMenu" + menuCount);

	menu.setMenuTree = setMenuTree;
	menu.setMenuTree(isChild,parMenu);

	menu.itemStr = "";
	
	cmdTop=0;
	while(menu.itemCount < menu.maxItems) {
		menu.itemCount++;
		status = "";
		itemName = "item" + menuCount + "_" + menu.itemCount;

		arrayPointer = isChild?(menu.itemCount-1)*3:((menu.itemCount-1)*3)+9;
		dispText = menu.array[arrayPointer];
		if(dispText.indexOf("|")>0) {     //---------------Additional functionality added to allow long menu items to wrap to new line. Provided by using "|x"(x=number of lines required) in defining array
			NumLines = dispText.split("|")[1];
			dispText = dispText.split("|")[0];
		} else
			NumLines = 1;
		
		hasMore = menu.array[arrayPointer + 2];
		htmStr = hasMore?imgStr + dispText:dispText;

		//Subitems render a bit smaller under NS6... NS6 bug #2,345,768
		menu.itemStr += "<SPAN ID=" + itemName + " STYLE=\"position: absolute; left:0; top:" + cmdTop + 
						"; width:" + (menu.menuWidth+(2*borWid) + ((SM&&hasMore)?imgSiz:0)) + 
						"px; cursor: hand;\">" + htmStr + "</SPAN><BR>";
		cmdTop += (6 + (12 * NumLines));  //---------------Additional functionality ends.
		
		if(hasMore) {
			makeMenuIE(true,menuCount + "_" + menu.itemCount,menu);
			menu = menu.parentMenu;
		}			
	}

	menu.innerHTML = menu.itemStr;
	if(SM) {
		var j=0;
		pMenu4SM = menu;
		itemColl = menu.childNodes;
		for(i=0; i<itemColl.length; i++) {
			if(itemColl.item(i).tagName=="SPAN") {
				it = itemColl.item(i);
				it.setup = itemSetup;
				it.setup((j++)+1,menu.array);
			}
		}
		menu.lastItem = itemColl.item(itemColl.length-1);
	} else {
		itemColl = menu.children.tags("SPAN");
		for(i=0; i<itemColl.length; i++) {
			it = itemColl(i);
			it.setup = itemSetup;
			it.setup(i+1,menu.array);
		}
		menu.lastItem = itemColl(itemColl.length-1);
	}	
	menu.setup(isChild,parMenu);
}

function makeElement(whichEl,whichWidth,whichParent,whichContainer) {
	if(NS4) {
		if(whichWidth) {
			elWidth = whichWidth;
		}
		else {
			elWidth = whichContainer?whichContainer.menuWidth:whichParent.menuWidth;
			if(whichContainer) elWidth = elWidth-(borWid*2)-(itemPad*2);
		}
		if(!whichContainer) whichContainer = menuLoc;
		eval(whichEl + "= new Layer(elWidth,whichContainer)");
	} else {
		if(SM) {
			newDiv = menuLoc.document.createElement("DIV");
			newDiv.id = whichEl;
			newDiv.setAttribute("STYLE", "position: absolute; left:0; top:0;");
			menuLoc.document.body.appendChild(newDiv);
			return menuLoc.document.getElementById(whichEl);
		} else {
			elStr = "<DIV ID=" + whichEl + " STYLE='position:absolute'></DIV>";
			menuLoc.document.body.insertAdjacentHTML("BeforeEnd",elStr);
		}
		if(isFrames) eval(whichEl + "= menuLoc." + whichEl);
	}
	
	return eval(whichEl);	
}

function itemSetup(whichItem,whichArray) {
	
	this.onmouseover = itemOver;
	this.onmouseout = itemOut;
	this.container = NS4?this.parentLayer:(SM?pMenu4SM:this.offsetParent);

	arrayPointer = (this.container.hasParent)?(whichItem-1)*3:((whichItem-1)*3)+9;

	this.dispText = whichArray[arrayPointer];
	this.linkText = whichArray[arrayPointer + 1];
	this.hasMore = whichArray[arrayPointer + 2];
	
	if(IE4 && this.hasMore) {
		if(SM)
			this.child = document.getElementById("Menu" + this.id.substr(4));
		else
			this.child = eval("Menu" + this.id.substr(4));
		this.child.parentMenu = this.container;
		this.child.parentItem = this;
	}

	if(this.linkText) {
		if(NS4) {
			this.captureEvents(Event.MOUSEUP)
			this.onmouseup = linkIt;
		}
		else {
			this.onclick = linkIt;
			this.style.cursor = SM?"default":"hand";
		}
	}

	if(NS4) {
		htmStr = this.dispText;
		if(htmStr.indexOf("|")>0)
			htmStr = htmStr.split("|")[0];
		if(fntBold) htmStr = htmStr.bold();
		if(fntItal) htmStr = htmStr.italics();

		htmStr = "<FONT FACE='" + fntFam + "' POINT-SIZE=" + fntSiz + ">" + htmStr+ "</FONT>";

		this.htmStrOver = htmStr.fontcolor(this.container.menuFontOver);
		this.htmStr = htmStr.fontcolor(this.container.menuFontColor);

		if(this.hasMore) {
			this.document.write(imgStr);
			this.document.close();
		}

		this.visibility = "inherit";
		this.bgColor = this.container.menuBGColor;

		if(whichItem == 1) {
			this.top = borWid + itemPad;
		} else {
			this.top = this.prevItem.top + this.prevItem.clip.height + separator;
		}
		this.left = borWid + itemPad;
		this.clip.top = this.clip.left = -itemPad;
		this.clip.right = this.container.menuWidth-(borWid*2)-itemPad;

		maxTxtWidth = this.container.menuWidth-(borWid*2)-(itemPad*2);
		if(this.container.isTree) maxTxtWidth-=(fullImgSize); 

		this.txtLyr = new Layer(maxTxtWidth,this);

		if(isRight && this.container.isTree) this.txtLyr.left = fullImgSize;

		this.txtLyr.document.write(this.htmStr);
		this.txtLyr.document.close();
		this.txtLyr.visibility = "inherit";
		this.clip.bottom = this.txtLyr.document.height+itemPad;

		this.dummyLyr = new Layer(100,this);
		this.dummyLyr.left = this.dummyLyr.top = -itemPad;
		this.dummyLyr.clip.width = this.clip.width;
		this.dummyLyr.clip.height = this.clip.height;
		this.dummyLyr.visibility = "inherit";
	} else {
		with(this.style) {
			padding = itemPad;
			
			if(this.container.isTree && !this.hasMore) {
				if(isRight) paddingLeft = itemPad+fullImgSize;
				else paddingRight = itemPad+fullImgSize;
			}
			color = this.container.menuFontColor;
			fontSize = fntSiz + "pt";
			fontWeight = fntBold?"bold":"normal";
			fontStyle =	fntItal?"italic":"normal";
			fontFamily = fntFam;
		
			borderBottomWidth = separator + "px";
			borderBottomColor = this.container.menuSeparatorCol;
			borderBottomStyle = "solid";
			backgroundColor = this.container.menuBGColor;
		}
	}
}

function menuSetup(hasParent,openCont,openItem) {
	this.onmouseover = menuOver;
	this.onmouseout = menuOut;
	
	this.showIt = showIt;
	this.keepInWindow = keepInWindow;
	this.hideTree = hideTree
	this.hideParents = hideParents;
	this.hideChildren = hideChildren;
	this.hideTop = hideTop;
	this.hasChildVisible = false;
	this.isOn = false;
	this.hideTimer = null;

	this.childOverlap = (perCentOver != null)?((perCentOver/100) * this.menuWidth):childOverlap;
	this.currentItem = null;
	this.hideSelf = hideSelf;
		
	if(hasParent) {
		this.hasParent = true;
		this.parentMenu = openCont;
		if(NS4) {
			this.parentItem = openItem;
			this.parentItem.child = this;
		}
	} else
		this.hasParent = false;

	if(NS4) {
		this.bgColor = this.menuBorCol;
		this.fullHeight = this.lastItem.top + this.lastItem.clip.bottom + borWid;
		this.clip.right = this.menuWidth;
		this.clip.bottom = this.fullHeight;
	} else {
		with(this.style) {
			width = this.menuWidth;
			borderWidth = borWid;
			borderColor = this.menuBorCol;
			borderStyle = borSty;
			zIndex = topZ;
		}

		this.lastItem.style.border="";
		this.fullHeight = this.scrollHeight;
		this.showIt(false);
		this.onselectstart = cancelSelect;
		this.moveTo = moveTo;
		this.moveTo(0,0);
	}
}

function displayMenu(e,menuName){
	if(isMac && isMIE) return;
	if(NS4 && NSresized) startIt();
	if(!isLoaded) return;
	linkEl = (NS4||SM)?e.target:event.srcElement;
	if(clickStart) linkEl.onclick = popMenu;
	if(!beingCreated && !areCreated) startIt();
	linkEl.menuName = menuName;	
	if(!clickStart) popMenu(e);
}

// Stuff used to handle the new
// ShowDelay feature.
// All these global vars are used to avoid having to pass objects through the
// setTimeout function. Is much easier this way.
var ee;
var eevent;
var sEvent = 0;
var linkEl;
function popMenu(e){
	
	if(!isLoaded || !areCreated) return true;

	eType = (NS4||SM)?e.type:event.type;
	if(clickStart && eType != "click") return true;
	
	linkEl = (NS4||SM)?e.target:event.srcElement;

	if(NS4||SM)
		ee = e;
	else
		eevent = event;
	ClearSEvent();
	sEvent = window.setTimeout("popMenu2(0)", ShowDelay);
}

function popMenu2(IsSubmenu){
	ClearSEvent();
	
	if(!IsSubmenu) {
		hideAll();
	
		if(SM)
			currentMenu = menuLoc.document.getElementById(linkEl.menuName);
		else
			currentMenu = eval(linkEl.menuName);
		currentMenu.hasParent = false;
		currentMenu.treeParent.startChild = currentMenu;
		
		if(IE4) menuLocBod = menuLoc.document.body;
		if(!isFrames) {
			xPos = (currentMenu.menuLeft)?currentMenu.menuLeft:(NS4||SM)?ee.pageX:(eevent.clientX + menuLocBod.scrollLeft);
			yPos = (currentMenu.menuTop)?currentMenu.menuTop:(NS4||SM)?ee.pageY:(eevent.clientY + menuLocBod.scrollTop);
		} else {
			switch(navFrLoc) {
				case "left":
					xPos = (currentMenu.menuLeft)?currentMenu.menuLeft:(NS4||SM)?menuLoc.pageXOffset:menuLocBod.scrollLeft;
					yPos = (currentMenu.menuTop)?currentMenu.menuTop:(NS4||SM)?(ee.pageY-pageYOffset)+menuLoc.pageYOffset:eevent.clientY + menuLocBod.scrollTop;
					break;
				case "top":
					xPos = (currentMenu.menuLeft)?currentMenu.menuLeft:(NS4||SM)?(ee.pageX-pageXOffset)+menuLoc.pageXOffset:eevent.clientX + menuLocBod.scrollLeft;
					yPos = (currentMenu.menuTop)?currentMenu.menuTop:(NS4||SM)?menuLoc.pageYOffset:menuLocBod.scrollTop;
					break;
				case "bottom":
					xPos = (currentMenu.menuLeft)?currentMenu.menuLeft:(NS4||SM)?(ee.pageX-pageXOffset)+menuLoc.pageXOffset:eevent.clientX + menuLocBod.scrollLeft;
					yPos = (currentMenu.menuTop)?currentMenu.menuTop:(NS4||SM)?menuLoc.pageYOffset+menuLoc.innerHeight:menuLocBod.scrollTop + menuLocBod.clientHeight;
					break;
				case "right":
					xPos = (currentMenu.menuLeft)?currentMenu.menuLeft:(NS4||SM)?menuLoc.pageXOffset+menuLoc.innerWidth:menuLocBod.scrollLeft+menuLocBod.clientWidth;
					yPos = (currentMenu.menuTop)?currentMenu.menuTop:(NS4||SM)?(ee.pageY-pageYOffset)+menuLoc.pageYOffset:eevent.clientY + menuLocBod.scrollTop;
					break;
			}
		}
		currentMenu.moveTo(xPos,yPos);
		currentMenu.keepInWindow()
		currentMenu.isOn = true;
	} else
		currentMenu = linkEl;
	
	currentMenu.showIt(true);

	return false;
}

/*
This is the original popMenu function
function popMenu(e){
	if(!isLoaded || !areCreated) return true;

	eType = (NS4||SM)?e.type:event.type;
	if(clickStart && eType != "click") return true;
	hideAll();

	linkEl = (NS4||SM)?e.target:event.srcElement;
	
	if(SM)
		currentMenu = menuLoc.document.getElementById(linkEl.menuName);
	else
		currentMenu = eval(linkEl.menuName);
	currentMenu.hasParent = false;
	currentMenu.treeParent.startChild = currentMenu;
	
	if(IE4) menuLocBod = menuLoc.document.body;
	if(!isFrames) {
		xPos = (currentMenu.menuLeft)?currentMenu.menuLeft:(NS4||SM)?e.pageX:(event.clientX + menuLocBod.scrollLeft);
		yPos = (currentMenu.menuTop)?currentMenu.menuTop:(NS4||SM)?e.pageY:(event.clientY + menuLocBod.scrollTop);
	} else {
		switch(navFrLoc) {
			case "left":
				xPos = (currentMenu.menuLeft)?currentMenu.menuLeft:(NS4||SM)?menuLoc.pageXOffset:menuLocBod.scrollLeft;
				yPos = (currentMenu.menuTop)?currentMenu.menuTop:(NS4||SM)?(e.pageY-pageYOffset)+menuLoc.pageYOffset:event.clientY + menuLocBod.scrollTop;
				break;
			case "top":
				xPos = (currentMenu.menuLeft)?currentMenu.menuLeft:(NS4||SM)?(e.pageX-pageXOffset)+menuLoc.pageXOffset:event.clientX + menuLocBod.scrollLeft;
				yPos = (currentMenu.menuTop)?currentMenu.menuTop:(NS4||SM)?menuLoc.pageYOffset:menuLocBod.scrollTop;
				break;
			case "bottom":
				xPos = (currentMenu.menuLeft)?currentMenu.menuLeft:(NS4||SM)?(e.pageX-pageXOffset)+menuLoc.pageXOffset:event.clientX + menuLocBod.scrollLeft;
				yPos = (currentMenu.menuTop)?currentMenu.menuTop:(NS4||SM)?menuLoc.pageYOffset+menuLoc.innerHeight:menuLocBod.scrollTop + menuLocBod.clientHeight;
				break;
			case "right":
				xPos = (currentMenu.menuLeft)?currentMenu.menuLeft:(NS4||SM)?menuLoc.pageXOffset+menuLoc.innerWidth:menuLocBod.scrollLeft+menuLocBod.clientWidth;
				yPos = (currentMenu.menuTop)?currentMenu.menuTop:(NS4||SM)?(e.pageY-pageYOffset)+menuLoc.pageYOffset:event.clientY + menuLocBod.scrollTop;
				break;
		}
	}
	currentMenu.moveTo(xPos,yPos);
	currentMenu.keepInWindow()
	currentMenu.isOn = true;
	currentMenu.showIt(true);

	return false;
}
*/

function menuOver(e) {
	this.isOn = true;
	isOverMenu = true;
	currentMenu = this;
	if(this.hideTimer) clearTimeout(this.hideTimer);
}

function menuOut() {
	if(IE4&&!SM) {
		theEvent = menuLoc.event;
		if(theEvent.srcElement.contains(theEvent.toElement)) return;
	}
	this.isOn = false;
	isOverMenu = false;

	menuLoc.status = "";
	if(!clickKill) allTimer = setTimeout("currentMenu.hideTree()",10);  
}

function itemOver(e) {
	if(keepHilite) {
		if(this.container.currentItem && this.container.currentItem != this) {
			if(NS4) {
				this.container.currentItem.bgColor = this.container.menuBGColor;
				if(NSfontOver)
					with(this.container.currentItem.txtLyr.document) {
						write(this.container.currentItem.htmStr)
						close();
					}
			} else
				with(this.container.currentItem.style) {
					backgroundColor = this.container.menuBGColor;
					color = this.container.menuFontColor;
				}
		}
	}

	if(IE4) {
		theEvent=SM?e:menuLoc.event;
		theEventTarget = SM?theEvent.target.tagName:theEvent.srcElement.tagName;
		if(theEventTarget == "IMG") return;
		this.style.backgroundColor = this.container.menuBGOver;
		this.style.color = this.container.menuFontOver;
		if(SM) this.style.cursor = "default";
	} else {
		this.bgColor = this.container.menuBGOver;
		if(NSfontOver) {
			this.txtLyr.document.write(this.htmStrOver);
			this.txtLyr.document.close();
		}
	}

	menuLoc.status = this.linkText;

	this.container.currentItem = this;

	// Added: && (lastVisible != this.id)
	// Original: if(this.container.hasChildVisible) {
	// Weird uh? Well, this is because freaking NS6 generates multiple events on a single onmouseover causing the
	// submenus to dissapear and reapear when you move from the command that triggers the submenu to the submenu.
	// hmmm... let's call this one: bug #3,456,234
	if(this.container.hasChildVisible && (lastVisible != this.id)) {
		this.container.hideChildren(this);
		lastVisible = this.id;
	}
	
	ClearSEvent();

	if(this.hasMore) {
		horOffset = (isRight)?(this.container.childOverlap - this.container.menuWidth):(this.container.menuWidth - this.container.childOverlap);

		if(NS4) {
			this.childX = this.container.left + horOffset;
			this.childY = (this.pageY+this.clip.top) + childOffset;
		} else {
			this.childX = parseInt(this.container.style.left) + horOffset;
			//NS6 calculates the offsetTop quite differently than IE... a bug? a feature?
			c_offsetTop = SM?this.offsetTop-parseInt(this.container.style.top):this.offsetTop;
			this.childY = c_offsetTop + parseInt(this.container.style.top) + childOffset + borWid;
		}
		
		this.child.moveTo(this.childX,this.childY);
		this.child.keepInWindow();
		this.container.hasChildVisible = true;
		this.container.visibleChild = this.child;
		//this.child.showIt(true);
		// ^^^^ no longer used. Now we use the same fucntion to display menus and submenus
		// ...this is the way the ShowDelay implementation works.

		if(lastVisible == this.child.id) {
			popMenu2(1)
		} else {
			linkEl = this.child;
			sEvent = window.setTimeout("popMenu2(1)", ShowDelay);
		}
	}
}
var lastVisible = "";

function itemOut(e) {
	if(IE4) {
		theEvent = SM?e:menuLoc.event;
		theEventTarget = SM?theEvent.target:theEvent.srcElement;
		if(!SM) {
			//This code is not portable to SeaMonkey's DOM
    		if(theEvent.srcElement.contains(theEvent.toElement) || (theEvent.fromElement.tagName=="IMG" && theEvent.toElement.contains(theEvent.fromElement)))
        		return;
        }
		if(!keepHilite) {
			this.style.backgroundColor = this.container.menuBGColor;
			this.style.color = this.container.menuFontColor;
		}
	} else {
		if(!keepHilite) {
			this.bgColor = this.container.menuBGColor;
			if(NSfontOver) {
				with(this.txtLyr.document) {
					write(this.htmStr);
					close();
				}
			}
	
		}
		if(!isOverMenu && !clickKill) {
			allTimer = setTimeout("currentMenu.hideTree()",10); 
		}
	}
}

function moveTo(xPos,yPos) {
	if(SM) {
		this.style.left = xPos;
		this.style.top = yPos;
	} else {
		this.style.pixelLeft = xPos;
		this.style.pixelTop = yPos;
	}
}

function showIt(on) {
	if(NS4) {
		this.visibility = on?"show":"hide";
		if(keepHilite && this.currentItem) {
			this.currentItem.bgColor = this.menuBGColor;
			if(NSfontOver) {
				with(this.currentItem.txtLyr.document) {
					write(this.currentItem.htmStr);
					close();
				}
			}
		}
	}
	else {
		this.style.visibility = on?"visible":"hidden";
		if(keepHilite && this.currentItem) {
			with(this.currentItem.style) {
				backgroundColor = this.menuBGColor;
				color = this.menuFontColor;
			}
		}
	}
	this.currentItem = null;
}

function keepInWindow() {
	scrBars = 20;
	botScrBar = (isFrames && navFrLoc=="bottom")?(borWid*2):scrBars;
	rtScrBar = (isFrames && navFrLoc=="right")?(borWid*2):scrBars;
	if(NS4) {
		winRight = (menuLoc.pageXOffset + menuLoc.innerWidth) - rtScrBar;
		rightPos = this.left + this.menuWidth;
   
		if(rightPos > winRight) {
			if(this.hasParent) {
				parentLeft = this.parentMenu.left;
				newLeft = ((parentLeft-this.menuWidth) + this.childOverlap);
				this.left = newLeft;
			}
			else {
				dif = rightPos - winRight;
				this.left -= dif;
			}
		}

		winBot = (menuLoc.pageYOffset + menuLoc.innerHeight) - botScrBar ;
		botPos = this.top + this.fullHeight;

		if(botPos > winBot) {
			dif = botPos - winBot;
			this.top -= dif;
		}
		
		winLeft = menuLoc.pageXOffset;
		leftPos = this.left;

		if(leftPos < winLeft) {
			if(this.hasParent) {
				parentLeft = this.parentMenu.left;
				newLeft = ((parentLeft+this.menuWidth) - this.childOverlap);
				this.left = newLeft;
			}
			else {
				this.left = 5;
			}
		}
	} else {
		if(SM)
			winRight = (menuLoc.pageXOffset + menuLoc.innerWidth) - rtScrBar;
		else
    		winRight = (menuLoc.document.body.scrollLeft + menuLoc.document.body.clientWidth) - rtScrBar;
		rightPos = this.style.pixelLeft + this.menuWidth;
	
		if(rightPos > winRight) {
			if(this.hasParent) {
				parentLeft = this.parentMenu.style.pixelLeft;
				newLeft = ((parentLeft - this.menuWidth) + this.childOverlap);
				this.style.pixelLeft = newLeft;
			}
			else {
				dif = rightPos - winRight;
				this.style.pixelLeft -= dif;
			}
		}
		
		if(SM)
			winBot = (menuLoc.pageYOffset + menuLoc.innerHeight) - botScrBar ;
		else
    		winBot = (menuLoc.document.body.scrollTop + menuLoc.document.body.clientHeight) - botScrBar;
		botPos = this.style.pixelTop + this.fullHeight;

//		if(botPos > winBot) {
//			dif = botPos - winBot;
//			this.style.pixelTop -= dif;
//		}
		
		if(SM)
			winLeft = menuLoc.pageXOffset;
		else
			winLeft = menuLoc.document.body.scrollLeft;
		leftPos = this.style.pixelLeft;

		if(leftPos < winLeft) {
			if(this.hasParent) {
				parentLeft = this.parentMenu.style.pixelLeft;
				newLeft = ((parentLeft+this.menuWidth) - this.childOverlap);
				this.style.pixelLeft = newLeft;
			}
			else {
				this.style.pixelLeft = 5;
			}
		}
	}
}

function linkIt() {
	// Original: if(this.linkText.indexOf("javascript:")!=-1) eval(this.linkText)
	// The new version works when using vbscript: and javascript:
	// We could have used "this.linkText.indexOf("script:")!=-1" but its too risky
	if((this.linkText.indexOf("javascript:")!=-1) || (this.linkText.indexOf("vbscript:")!=-1)) eval(this.linkText)
	else menuLoc.location.href = this.linkText;
}

function hideMenu(menuName){
	if(!isLoaded || !areCreated) return;
	if(SM)
		whichEl = menuLoc.document.getElementById(menuName);
	else
		whichEl = eval(menuName);
	whichEl.isOn = false;
	
	ClearSEvent();
	
	if(!clickKill) whichEl.hideTop();
}

// This function clears any pending
// timer to display a menu
function ClearSEvent() {
	if(sEvent) {
		clearTimeout(sEvent);
		sEvent = 0;
	}
}

function hideAll() {
	for(i=1; i<topCount; i++) {
		if(SM) {
			m = menuLoc.document.getElementById("Menu" + i);
			temp = m.startChild;
		} else
			temp = eval("Menu" + i + ".startChild");
		temp.isOn = false;
		if(temp.hasChildVisible) temp.hideChildren();
		temp.showIt(false);
	}	
}

function hideTree() { 
	allTimer = null;
	if(isOverMenu) return;
	if(this.hasChildVisible) {
		this.hideChildren();
	}
	this.hideParents();
}

function hideTop() {
	whichTop = this;
	(clickKill)?whichTop.hideSelf():(this.hideTimer = setTimeout("if(whichTop.hideSelf)whichTop.hideSelf()",mSecsVis));
}

function hideSelf() {
	this.hideTimer = null;
	if(!this.isOn && !isOverMenu) { 
		this.showIt(false);
	}
}

function hideParents() {
	tempMenu = this;
	while(tempMenu.hasParent) {
		tempMenu.showIt(false);
		tempMenu.parentMenu.isOn = false;		
		tempMenu = tempMenu.parentMenu;
	}
	tempMenu.hideTop();
}

function hideChildren(item) {
	tempMenu = this.visibleChild;
	while(tempMenu.hasChildVisible) {
		tempMenu.visibleChild.showIt(false);
		tempMenu.hasChildVisible = false;
		tempMenu = tempMenu.visibleChild;
	}

	if(!this.isOn || !item.hasMore || this.visibleChild != this.child) {
		this.visibleChild.showIt(false);
		this.hasChildVisible = false;
	}
}

function cancelSelect(){return false}

function reDo(){
	if(loader.innerWidth==origWidth && loader.innerHeight==origHeight) return;
	initVars();
	NSresized=true;
	menuLoc.location.reload();
}

function clicked() {
	if(!isOverMenu && currentMenu!=null && !currentMenu.isOn) {
		whichEl = currentMenu;
		whichEl.hideTree();
	}
}

if(!SM)
	window.onerror = handleErr;

function handleErr(){
	arAccessErrors = ["permission","access"];
	mess = arguments[0].toLowerCase();
	found = false;
	for(i=0;i<arAccessErrors.length;i++) {
		errStr = arAccessErrors[i];
		if(mess.indexOf(errStr)!=-1) found = true;
	}
	return found;
}

function goSite(v){
	var destination=eval('document.forms[0].' + v + '.options[document.forms[0].' + v + '.selectedIndex].value');
	if(destination!=""){
	location=destination;
	}
}

function search(v){
	if(eval('document.forms[0].' + v + '.value')==""){
		alert ("Please complete the search field.");
		return;
	}
	document.forms[0].submit();
}
function open_window(){
window.open("kontakte.htm","Aktuelles","width=200,height=150");
}

 function close_window(){
 	window.close("Aktuelles");
}


//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


var dom = (document.getElementById) ? true : false;
var ns5 = ((navigator.userAgent.indexOf("Gecko")>-1) && dom) ? true: false;
var ie5 = ((navigator.userAgent.indexOf("MSIE")>-1) && dom) ? true : false;
var nsfor = (document.layers && !dom) ? true : false;
var iefor = (document.all && !dom) ? true : false;
var nodyn = (!ns5 && !nsfor && !iefor && !ie5) ? true : false;

var origWidth, origHeight;
if (nsfor) {
	origWidth = window.innerWidth; origHeight = window.innerHeight;
	window.onresize = function() { if (window.innerWidth != origWidth || window.innerHeight != origHeight) history.go(0); }
}


if (nodyn) { event = "nope" }
var tipFollowMouse	= true; // set to false if you want the display box not to move along with the mouse moves
var tipWidth		= 400;
var offX		= 60;	// how far from mouse to show tip
var offY		= 0;
var tipFontFamily 	= "Verdana, arial, helvetica, sans-serif";
var tipFontSize		= "10pt";
var tipFontWeight	= "bold";
var tipFontColor	= "#000000";
var tipBgColor		= "#DDECFF"; 
var origBgColor 	= tipBgColor; // in case no bgColor set in array
var tipBorderColor 	= "#000080";
var tipBorderWidth 	= 2;
var tipBorderStyle 	= "ridge";
var tipPadding	 	= 4;

var messages = new Array();
messages[0] = new Array('../../img/wild_cards/help.gif','Page Help: TO BE FILLED IN !',"#FFFFFF");
messages[1] = new Array('../../img/partner_icons/zip_file.gif','Kernel Software Version: 2.0.0z, zip file includes Configuration templates & examples and Documentation',"#FFFFFF");
messages[2] = new Array('../../img/partner_icons/zip_file.gif','I/O RTU: management of the Digital & Analogue Modules of Luciol Version: 1.0.0z, zip file includes Configuration templates & examples and Documentation',"#FFFFFF");
messages[3] = new Array('../../img/partner_icons/zip_file.gif','Monitoring -including Modem & PPP libraries- Version: 1.0.0z, zip file includes Configuration templates & examples and Documentation',"#FFFFFF");
messages[4] = new Array('../../img/partner_icons/zip_file.gif','IEC 101 Master and Slave Version: 1.0.0z, zip file includes Configuration templates & examples and Documentation',"#FFFFFF");
messages[5] = new Array('../../img/partner_icons/zip_file.gif','IEC 103 Master and Slave Version: 1.0.0z, zip file includes Configuration templates & examples and Documentation',"#FFFFFF");
messages[6] = new Array('../../img/partner_icons/zip_file.gif','IEC 104 Master and Slave Version: 1.0.0z, zip file includes Configuration templates & examples and Documentation',"#FFFFFF");
messages[7] = new Array('../../img/partner_icons/zip_file.gif','DNP3 Master and Slave Version: 1.0.0z, zip file includes Configuration templates & examples and Documentation',"#FFFFFF");
messages[8] = new Array('../../img/partner_icons/zip_file.gif','Modbus RTU Master and Slave Version: draft under release',"#FFFFFF");
messages[9] = new Array('../../img/partner_icons/zip_file.gif','Modbus ASCII Master and Slave Version: draft under release',"#FFFFFF");
messages[10] = new Array('../../img/partner_icons/zip_file.gif','Modbus TCP Master and Slave Version: draft under release',"#FF0000");
messages[11] = new Array('../../img/partner_icons/zip_file.gif','IEC 61850 Version: Not Available',"#FFFFFF");
messages[12] = new Array('../../img/partner_icons/html_file.gif','Left click to access aJile tools download area',"#FFFFFF");
messages[13] = new Array('../../img/partner_icons/zip_file.gif','aJile Tools Configuration Files: Readme, Charade Configuration and JemBuilder Configuration',"#FFFFFF");
messages[14] = new Array('../../img/partner_icons/html_file.gif','Left click to access Eclipse website',"#FFFFFF");
messages[15] = new Array('../../img/partner_icons/zip_file.gif','(Under Completion) Luciol Plug-In for Luciol Configuration Tool Based on Eclipse: unzip in plug-in directory of your Eclipse drive',"#FFFFFF");
messages[16] = new Array('../../img/partner_icons/zip_file.gif','Documentation Versions and Index, zipped HTML files',"#FFFFFF");
messages[17] = new Array('../../img/partner_icons/zip_file.gif','First Time User Guide: under release, zipped HTML files',"#FFFFFF");
messages[18] = new Array('../../img/partner_icons/zip_file.gif','First Time Developer Guide: under release, zipped HTML files',"#FFFFFF");
messages[19] = new Array('../../img/partner_icons/zip_file.gif','User Guides (Some Guides are Under Release): First Time User Guide, Hardware De-Assembling and Assembling Guide, Hardware Configuration Guide, Hardware Installation Guide and Configuraton Guides for Monitoring, IEC Protocols, Modbus Protocols, DNP3 Protocol, all zipped HTML files',"#FFFFFF");
messages[20] = new Array('../../img/partner_icons/zip_file.gif','Developer Guides (Very Little Available): First Time Developer Guide, Application Integration Guide, Firmware Development Guide, Luciol Development Tool Guides and JavaDoc for Kernel and All Applications, all zipped HTML files',"#FFFFFF");
messages[21] = new Array('../../img/partner_icons/zip_file.gif','User and Developer Guides (Partly Available): all User Guides and Developer Guides plus Documentation Index, all zipped HTML files',"#FFFFFF");

if (document.images) {
	var theImgs = new Array();
	for (var i=0; i<messages.length; i++) {
  	theImgs[i] = new Image();
	theImgs[i].src = messages[i][0];
  }
}

var startStr = '<table width="' + tipWidth + '"><tr><td align="center" width="10%" valign="middle"><img src="';
var midStr = '" border="0"></td><td valign="middle">';
var endStr = '</td></tr></table>';

var tooltip, tipcss;

/*
function initTip() {
	if (nodyn) return;
	tooltip = (nsfor)? document.tipDiv.document: (iefor)? document.all['tipDiv']: (ie5||ns5)? document.getElementById('tipDiv'): null;
	tipcss = (nsfor)? document.tipDiv: tooltip.style;
	if (iefor||ie5||ns5) {	// nsfor would lose all this on rewrites
		tipcss.width = tipWidth+"px";
		tipcss.fontFamily = tipFontFamily;
		tipcss.fontSize = tipFontSize;
		tipcss.fontWeight = tipFontWeight;
		tipcss.color = tipFontColor;
		tipcss.backgroundColor = tipBgColor;
		tipcss.borderColor = tipBorderColor;
		tipcss.borderWidth = tipBorderWidth+"px";
		tipcss.padding = tipPadding+"px";
		tipcss.borderStyle = tipBorderStyle;
	}

	if (tooltip&&tipFollowMouse) {
		if (nsfor) document.captureEvents(Event.MOUSEMOVE);
		document.onmousemove = trackMouse;
	}
}

window.onload = initTip;
*/
var t1,t2;	// for setTimeouts
var tipOn = false;	// check if over tooltip link

function doTooltip(evt,num) {

	if (!tooltip) return;
	if (t1) clearTimeout(t1);
	if (t2) clearTimeout(t2);
	tipOn = true;
	// set colors if included in messages array
	if (messages[num][2])	var curBgColor = messages[num][2];
	else curBgColor = tipBgColor;
	if (messages[num][3])	var curFontColor = messages[num][3];
	else curFontColor = tipFontColor;
	if (nsfor) {
		var tip = '<table bgcolor="' + tipBorderColor + '" width="' + tipWidth + '" weight="' + tipFontWeight + '" cellspacing="0" cellpadding="' + tipBorderWidth + '" border="0"><tr><td><table bgcolor="' + curBgColor + '" width="100%" cellspacing="0" cellpadding="' + tipPadding + '" border="0"><tr><td>'+ startStr + messages[num][0] + midStr + '<span style="font-family:' + tipFontFamily + '; font-size:' + tipFontSize + '; color:' + curFontColor + ';">' + messages[num][1] + '</span>' + endStr + '</td></tr></table></td></tr></table>';
		tooltip.write(tip);
		tooltip.close();
	} else if (iefor||ie5||ns5) {
		var tip = startStr + messages[num][0] + midStr + '<span style="font-family:' + tipFontFamily + '; font-size:' + tipFontSize + '; font-weight: ' + tipFontWeight + '; color:' + curFontColor + ';">' + messages[num][1] + '</span>' + endStr;
		tipcss.backgroundColor = curBgColor;
	 	tooltip.innerHTML = tip;
	}
	if (!tipFollowMouse) positionTip(evt);
	else t1=setTimeout("tipcss.visibility='visible'",100);
}

var mouseX, mouseY;
function trackMouse(evt) {
	mouseX = (nsfor||ns5)? evt.pageX: window.event.clientX + document.body.scrollLeft;
	mouseY = (nsfor||ns5)? evt.pageY: window.event.clientY + document.body.scrollTop;
	if (tipOn) positionTip(evt);
}

function positionTip(evt) {
	if (!tipFollowMouse) {
		mouseX = (nsfor||ns5)? evt.pageX: window.event.clientX + document.body.scrollLeft;
		mouseY = (nsfor||ns5)? evt.pageY: window.event.clientY + document.body.scrollTop;
	}
	// tooltip width and height
	var tpWd = (nsfor)? tooltip.width: (iefor||ie5)? tooltip.clientWidth: tooltip.offsetWidth;
	var tpHt = (nsfor)? tooltip.height: (iefor||ie5)? tooltip.clientHeight: tooltip.offsetHeight;
	// document area in view (subtract scrollbar width for ns)
	var winWd = (nsfor||ns5)? window.innerWidth-20+window.pageXOffset: document.body.clientWidth+document.body.scrollLeft;
	var winHt = (nsfor||ns5)? window.innerHeight-20+window.pageYOffset: document.body.clientHeight+document.body.scrollTop;
	// check mouse position against tip and window dimensions
	// and position the tooltip 
	if ((mouseX+offX+tpWd)>winWd) 
		tipcss.left = (nsfor)? mouseX-(tpWd+offX): mouseX-(tpWd+offX)+"px";
	else tipcss.left = (nsfor)? mouseX+offX: mouseX+offX+"px";
	if ((mouseY+offY+tpHt)>winHt) 
		tipcss.top = (nsfor)? winHt-(tpHt+offY): winHt-(tpHt+offY)+"px";
	else tipcss.top = (nsfor)? mouseY+offY: mouseY+offY+"px";
	if (!tipFollowMouse) t1=setTimeout("tipcss.visibility='visible'",100);
}

function hideTip() {
	if (!tooltip) return;
	t2=setTimeout("tipcss.visibility='hidden'",100);
	tipOn = false;
}

	
	var imgs = new bildarray;
	var i = 0;
	
	function bildarray() {
	
		this[0] = "images/Location-OG.jpg";
   		this[1] = "images/Location-HP.jpg";
	location[0] = "       Hauptverwaltung Offenburg";
	location[1] = "       Verkaufzentrale Heppenheim";
	}
	
	function wechsel() {
		if (i < 1)  {
			i +=1;
			} else {
			i = 0;
		}
		// document.forms[0].nummer.value = i;
		document.forms[0].bild.value = location[i];
		document.images.src = imgs[i];
		setTimeout("wechsel()",4000);
	}