// --------------------------------------------------// simple dhtml menue// // needs lib.js// made for static css/html, to make shure// that navigation without js is possible////// the calls "initNC4x" and "initAnim" must be// deleted in case of external use//// NOTE: if menue opens over other div-layer add// z-index to the menue-css-properties, otherwise // IE5/Mac will not register mousemove over the // divs properly!//// author kgde@wendenburg.de// modified://// --------------------------------------------------// every menuepointvar menueDivs =  new Array("home", "kamera", "grafik", "webdesign", "kontakt");// submenues belonging to every menuepoint or 0var subDivs   =  new Array(0, "kameraSub", "grafikSub", "webdesignSub", "kontaktSub");var aktDiv =  0;var bgc    =  nc? "bgColor" : "backgroundColor";      // crossover css-attribut for background-colorvar doOpen =  new Array();                            // remember what divs to open or to close while moving over a divvar doSwap =  new Array();                            // remember where to change colorvar ncIsIn =  0;                                      // a little flag to keep nc 4x from hiding divs too quickvar isIn   =  0;                                      // a flag needed for mozContainsvar bye    =  1;                                      // do not swap divs after click// start menue, register events within the divsfunction initMenue() {	// just a little css-help for nc4x, not necessary for the menue	initNC4x();	for (i in menueDivs) {						dRefS(menueDivs[i])[bgc] =  "#cccccc";						if (nc) dRef(menueDivs[i]).captureEvents(Event.MOUSEMOVE);				dRef(menueDivs[i]).onmousemove   =  divMove;			// submenue available?		if(subDivs[i]) {			if (nc) dRef(subDivs[i]).captureEvents(Event.MOUSEMOVE);				dRef(subDivs[i]).onmousemove =  divMove; 							}			doOpen[menueDivs[i]]             =  subDivs[i];		doOpen[subDivs[i]]               =  subDivs[i];		doSwap[menueDivs[i]]             =  menueDivs[i];		doSwap[subDivs[i]]               =  menueDivs[i];	}	if (nc) document.captureEvents(Event.MOUSEMOVE); 	document.onmousemove =  docMove;	window.onunload=function() {bye =  1};	bye =  0;}// mousemove over divfunction divMove(e) {	if (typeof bye != "undefined" && !bye) {		if (!aktDiv) on(this.id);		else if (aktDiv != this) {			off (aktDiv.id);			on (this.id);		} 		aktDiv =  this;			ncIsIn =  1;	}}// mousemove in documentfunction docMove(e) {		// nc 4x	if (nc) {		if (!ncIsIn && aktDiv) {			off(aktDiv.id);			aktDiv =  0;		}		else ncIsIn =  0;	}	// nc6, moz, opera & ie	if (dom || ie4) {		var checkEl =  (nc6 || window.opera)? e.target : window.event.srcElement;		if(aktDiv) {			var isElIn =  (aktDiv == checkEl)? 1 : (nc6? mozContains(aktDiv, checkEl) : aktDiv.contains(checkEl));							if (!isElIn) {				off (aktDiv.id);				aktDiv =  0;			}				isIn =  0; // resetting moz-flag		}			}	// bar anim, not necessary for the menue	initAnim ();	if (nc) routeEvent(e);}// checking for Mozilla if n2 within n1function mozContains(n1, n2) {	if(n1 && n2 && n1.hasChildNodes()) {		for (var i = 0; i <  n1.childNodes.length; i++) {			var nx1 =  n1.childNodes[i];			if (nx1 == n2) isIn = 1;			if (nx1.hasChildNodes()) mozContains(nx1, n2);		}		}	return isIn;} // open and close submenue, change colorfunction on (el)  {	if (doOpen[el]) dRefS(doOpen[el]).visibility =  "visible";	dRefS(doSwap[el])[bgc]                       =  "#FC8F01"; }function off (el) {	if (doOpen[el]) dRefS(doOpen[el]).visibility =  "hidden";	dRefS(doSwap[el])[bgc]                       =  "#cccccc";}