//////////////////////////////////
//	menu.js
//	script-file for menu-creating and events
//	change: 29.09.2003
//	author: (c) ACS&S 2003, Klaus
//////////////////////////////////

if (NAV_IE || NAV_DOM || NAV_IE4) {
	fShow="visible";
	fHide="hidden";
}
if (NAV_NS4) {
	fShow="show";   
	fHide="hide";
}

// Events-overriding
if (NAV_IE || NAV_DOM)
{
	document.body.onclick = hideAll;
	document.body.onscroll = hideAll;
	document.body.onmousemove = updateIt;
}
if (NAV_NS4)
{
	document.onmousedown=hideAll;
	window.captureEvents(Event.MOUSEMOVE);
	window.onmousemove=updateIt;
}

// constants
NAV_ID_LINK = "_LINK";
NAV_ID_SUBMENU = "_SUBMENU";
NAV_ID_IMAGE = "_IMG";
NAV_ID_PARENT = "_PARENT";

// needed for hiding menus
lastMainMenu = null;
lastMenu = null;

// restoring menu-layout
_ImgSrc = null;
_ImgSrcParent = null;
_ImgSrcSub = null;
_MenuIsVertical = false;
_SubMenuBelow = false;
_BGColor = null;
_FontColor = null;
_leftX = 0;
_leftY = 0;
_rightX = 0;
_rightY = 0;

MenuIsBuild = false;

// constructor for the menu-object
// initializes the parameter-variables
// creates the main div-layer
function menu(menuID,ParamArr)
{
	// paramter array
	this.menuID = menuID;
	this.MenuName = ParamArr["MenuName"];
	this.MenuHeight = ParamArr["MenuHeight"];
	this.MenuWidth = ParamArr["MenuWidth"];
	this.SubMenuHeight = ParamArr["SubMenuHeight"];
	this.MainMenuWidth = ParamArr["MainMenuWidth"];	
	this.MainMenuHeight = ParamArr["MainMenuHeight"];
	this.SubMenuWidth = ParamArr["SubMenuWidth"];
	this.MenuTop = ParamArr["MenuTop"];
	this.MenuLeft = ParamArr["MenuLeft"];
	this.MenuIsVertical = ParamArr["MenuIsVertical"];
	this.MenuIsAbsolute = ParamArr["MenuIsAbsolute"];
	this.SubMenuOffsetX = ParamArr["SubMenuOffsetX"];
	this.SubMenuOffsetY = ParamArr["SubMenuOffsetY"];
	this.SubMenuBelow = ParamArr["SubMenuBelow"];
	this.FontFamily = ParamArr["FontFamily"];		//Schriftart für IE4+ und NS6
	this.FontSize = ParamArr["FontSize"];
	this.FontColor   = ParamArr["FontColor"];					//Schriftfarbe
	this.FontBold = ParamArr["FontBold"];
	this.FontItalic = ParamArr["FontItalic"];
	this.FontColor = ParamArr["FontColor"];
	this.FontColorOver = ParamArr["FontColorOver"];
	this.FontSizeSub = ParamArr["FontSizeSub"];
	this.FontBoldSub = ParamArr["FontBoldSub"];
	this.FontItalicSub = ParamArr["FontItalicSub"];
	this.FontColorSub = ParamArr["FontColorSub"];
	this.FontColorOverSub = ParamArr["FontColorOverSub"];
	this.FontColorSubNoLink = ParamArr["FontColorSubNoLink"];
	this.LinkDecoration = ParamArr["LinkDecoration"];	
	this.BGColor = ParamArr["BGColor"];					//Hintergrundfarbe
	this.BGColorOver = ParamArr["BGColorOver"];
	this.BGColorSub = ParamArr["BGColorSub"];
	this.BGColorOverSub = ParamArr["BGColorOverSub"];
	this.BorderWidth = ParamArr["BorderWidth"];
	this.NSBorderWidth = ParamArr["NSBorderWidth"];
	this.SubBorderWidth = ParamArr["SubBorderWidth"];
	this.BorderLeft = ParamArr["BorderLeft"];
	this.BorderRight = ParamArr["BorderRight"];
	this.BorderTop = ParamArr["BorderTop"];
	this.BorderBottom = ParamArr["BorderBottom"];
	this.BorderColor = ParamArr["BorderColor"];
	this.BorderStyle = ParamArr["BorderStyle"];
	this.ImageSrc = ParamArr["ImageSrc"];
	this.ImageSrcParent = ParamArr["ImageSrcParent"];
	this.ImageSrcParentOver = ParamArr["ImageSrcParentOver"];
	this.ImageSrcSub = ParamArr["ImageSrcSub"];
	this.ImageSrcSubNoLink = ParamArr["ImageSrcSubNoLink"];

	// function assignments
	this.addItem = addItem;
	this.addSubItem = addSubItem;
	this.showMenu = showMenu;
	this.displaySubMenu = displaySubMenu;
	this.NAV_GetFontString = NAV_GetFontString;
	this.NAV_GetFontSubString = NAV_GetFontSubString;
	this.NAV_GetStyle = NAV_GetStyle;
	this.NAV_MouseMoveMainItem = NAV_MouseMoveMainItem;
	this.NAV_MouseMoveSubItem = NAV_MouseMoveSubItem;

	if (NAV_MOZ) {
		// Mozilla Correction
		this.MenuHeight += 4;
		this.SubMenuHeight += 6;
	}
	
	this.HTMLstr = "";

	this.HTMLstr += "<!-- MENU PANE DECLARATION BEGINS -->\n";
	this.HTMLstr += "\n";
	if (NAV_IE || NAV_DOM) this.HTMLstr += "<div id='" + this.MenuName + "' style='" + this.NAV_GetStyle("MainDiv") + "'>\n";

	this.HTMLstr += "<table cellpadding=0 cellspacing=0>\n";
	this.HTMLstr += "<tr>";
	this.HTMLstr += "<!-- MAIN MENU STARTS -->\n";
	this.HTMLstr += "<!-- MAIN_MENU -->\n";
	this.HTMLstr += "<!-- MAIN MENU ENDS -->\n";
	this.HTMLstr += "</tr>\n";
	this.HTMLstr += "</table>\n";
		
	if (NAV_IE || NAV_DOM) this.HTMLstr+= "</div>\n";

	this.HTMLstr += "\n";
	this.HTMLstr += "<!-- SUB MENU STARTS -->\n";
	this.HTMLstr += "<!-- SUB_MENU -->\n";
	this.HTMLstr += "<!-- SUB MENU ENDS -->\n";
	this.HTMLstr += "\n";

	this.HTMLstr += "<!-- MENU PANE DECALARATION ENDS -->\n";

	MenuIsBuild = true;
}

function addItem(idItem, text, hint, location, target, isParent, menuWidth, menuHeight)
/*
 addItem: adds MainMenuItem

 params:
		idItem: unique ID
		text:	menu-text
		hint:	hint for the <a href=....> tag
		location:	url-location
		target:	target-frame
		isParent:	true/false if it has submenu or not
		menuWidth:	individual menu-width

*/
{
	// expand Itemname
	idItem = this.MenuName + idItem;
	
	var Lookup = "<!-- ITEM "+idItem+" -->";
	if (this.HTMLstr.indexOf(Lookup) != -1)
	{
		// main-menu entry already exists
		alert(idItem + " already exist");
		return;
	}
	var MENUitem = "";
	MENUitem += "\n<!-- ITEM "+idItem+" -->\n";

	if (menuWidth)
		this.MainMenuWidth = menuWidth;

	if (menuHeight)
		this.MainMenuHeight = menuHeight;

	if (NAV_IE || NAV_DOM)
	{
		if (this.MenuIsVertical)
			MENUitem += "<tr>\n";

		MENUitem += "<td>\n";
		MENUitem += "<div id='"+idItem+"' style='" + this.NAV_GetStyle("MainMenu") + "'>\n";
		MENUitem += "<table><tr><td height=" + this.MenuHeight + "valign=\"middle\">";
		
		if (this.ImageSrc) {
			MENUitem += "<img name='"+idItem+NAV_ID_IMAGE+"' src='" + this.ImageSrc + "'>&nbsp;";
			_ImageSrc = this.ImageSrc;
		}
		
		MENUitem += "<a ";
		MENUitem += "id=" + idItem + NAV_ID_LINK + " ";
		MENUitem += "style='" + this.NAV_GetStyle("MainLink") + "'";
		if (hint != null)
			MENUitem += "title='"+hint+"' ";
		if (location != null)
			MENUitem += "href='"+location+"' ";		

		MENUitem += "onmouseover=\"" + this.menuID + ".NAV_MouseMoveMainItem('over','"+idItem+"')\" ";
		MENUitem += "onmouseout=\"" + this.menuID + ".NAV_MouseMoveMainItem('out','"+idItem+"')\" ";

		if (target)
			MENUitem += "target=\" + target + \"";

		MENUitem += ">";
		MENUitem += text;
		MENUitem += "</a>\n";

		if (isParent && this.ImageSrcParent)
			MENUitem += "<img name='"+idItem+NAV_ID_IMAGE+NAV_ID_PARENT+"' src='" + this.ImageSrcParent + "'>";

		MENUitem += "</td></tr></table>";
		MENUitem += "</div>\n";
		MENUitem += "</td>\n";

		if (this.MenuIsVertical)
			MENUitem += "</tr>\n";
	}
	MENUitem += "<!-- END OF ITEM "+idItem+" -->\n\n";
	MENUitem += "<!-- MAIN_MENU -->\n";

	this.HTMLstr = this.HTMLstr.replace("<!-- MAIN_MENU -->\n", MENUitem);
}

function addSubItem(idItem, idParent, text, hint, location, target)
/*
 addSubItem: adds SubMenu items

 params:
		idItem: unique ID
		idParent:	ID of main-menu item (see addItem)
		text:	menu-text
		hint:	hint for the <a href=....> tag
		location:	url-location
		target:	target-frame
*/
{
	var MENUitem = "";
	
	// expand Parentname
	idParent = this.MenuName + idParent;
	
	Lookup = "<!-- ITEM "+idParent+" -->";
	if (this.HTMLstr.indexOf(Lookup) == -1)
	{
		alert(idParent + " not found");
		return;
	}
	Lookup = "<!-- NEXT ITEM OF SUB MENU "+ idParent +" -->";
	if (this.HTMLstr.indexOf(Lookup) == -1)
	{
		if (NAV_IE || NAV_DOM)
		{
			MENUitem += "\n";
			MENUitem += "<div id='"+idParent+NAV_ID_SUBMENU+"' style='" +this.NAV_GetStyle("SubDiv") + "'>\n";
			MENUitem += "<table cellspacing=0 cellpadding=0>\n";
			MENUitem += "<!-- NEXT ITEM OF SUB MENU "+ idParent +" -->\n";
			MENUitem += "</table>\n";
			MENUitem += "</div>\n";			
			MENUitem += "\n";
		}
		MENUitem += "<!-- SUB_MENU -->\n";
		this.HTMLstr = this.HTMLstr.replace("<!-- SUB_MENU -->\n", MENUitem);
	}

	Lookup = "<!-- NEXT ITEM OF SUB MENU "+ idParent +" -->\n";
	
	if (NAV_IE || NAV_DOM) {

		MENUitem = "<tr><td>\n";
		MENUitem += "<div id='"+idParent+NAV_ID_SUBMENU+idItem+"' style='" + this.NAV_GetStyle("SubMenu") + "'>\n";
		MENUitem += "<table><tr><td height=" + this.SubMenuHeight + "valign=\"middle\">";

		if (location != null) {
	
			if (this.ImageSrcSub) {
				MENUitem += "<img name='"+idParent+NAV_ID_SUBMENU+NAV_ID_IMAGE+"' src='" + this.ImageSrcSub + "'>&nbsp;";
				_ImageSrcSub = this.ImageSrcSub;
			}

			MENUitem += "<a ";
			MENUitem += "id=" + idParent+NAV_ID_SUBMENU+idItem + NAV_ID_LINK+ " ";
			MENUitem += "style='" + this.NAV_GetStyle("SubLink") + "'";
			if (hint != null)
				MENUitem += "title='"+hint+"' ";
			MENUitem += "href='"+location+"' ";
			MENUitem += "onmouseover=\"" + this.menuID + ".NAV_MouseMoveSubItem('over','"+idParent+NAV_ID_SUBMENU+idItem+"');\" ";
			MENUitem += "onmouseout=\"" + this.menuID + ".NAV_MouseMoveSubItem('out','"+idParent+NAV_ID_SUBMENU+idItem+"');\" ";

			if (target)
				MENUitem += "target=\" + target + \"";			

			MENUitem += ">";
			MENUitem += text;
			MENUitem += "</a>\n";
		}
		else {
			MENUitem += "<span style='"+ this.NAV_GetStyle("SubNoLink") + "'>";
			if (this.ImageSrcSubNoLink)
				MENUitem += "<img name='"+idParent+NAV_ID_SUBMENU+NAV_ID_IMAGE+"' src='" + this.ImageSrcSubNoLink + "'>&nbsp;";
			MENUitem += text;
			MENUitem += "</span>";
		}

		MENUitem += "</td></tr></table>";
		MENUitem += "</div>\n";
		MENUitem += "</td></tr>\n";
	}	
	
	MENUitem += Lookup;
	this.HTMLstr = this.HTMLstr.replace(Lookup, MENUitem);
}

function showMenu()
/*
 showMenu: writes the this.HTMLstr-String to the HTML-page
*/
{
	document.writeln(this.HTMLstr);
}


////////////////////////////////////////////////////////////////////////////
// Private declaration

// displays Sub-Menu and does some visualization work
function displaySubMenu(idMainMenu)
/*
 displaySubMenu: displays submenu

 params:
		idMainMenu:	unique ID of the main-menu item
*/
{
	var menu;
	var submenu;
	
	if (NAV_IE || NAV_DOM)
	{
		menu = document.getElementById(idMainMenu);
		submenu = document.getElementById(idMainMenu+NAV_ID_SUBMENU);

		// hover color
		document.getElementById(idMainMenu + NAV_ID_LINK).style.color = this.FontColorOver;		
		menu.style.backgroundColor = this.BGColorOver;
		_BGColor = this.BGColor;
		_FontColor = this.FontColor;

		// change image if necessary
		if (this.ImageSrcParentOver && submenu) {
			document.images[idMainMenu+NAV_ID_IMAGE+NAV_ID_PARENT].src = this.ImageSrcParentOver;
			_ImgSrcParent = this.ImageSrcParent;
		}

		if (submenu != null) {

			// different offsets for vertical / horizontal and absolute / relative positioning
			addTopOffset = 0;
			addLeftOffset = 0;
			if (NAV_IE && !this.MenuIsVertical)
				addTopOffset = 4;

			if (this.MenuIsVertical && !this.SubMenuBelow)
			{
				addLeftOffset += this.MenuWidth + this.BorderWidth + this.BorderRight;
				addTopOffset += (-1)*this.MenuHeight + (-1)*this.BorderWidth + (-1)*this.BorderTop;
			}

			addLeftOffset += this.SubMenuOffsetX;
			addTopOffset += this.SubMenuOffsetY;

			if (!this.MenuIsVertical || this.SubMenuBelow || !this.MenuIsAbsolute)
			{
				// horizontal, relative, submenu under main-menu item (even if vertical)
				with(submenu.style) {
					left = calculateSumOffset(menu, 'offsetLeft') + addLeftOffset;	//SUB Menue-Entfernung von links				
					top  = this.MenuHeight + calculateSumOffset(menu, 'offsetTop') + this.BorderWidth + addTopOffset;	//SUB Menue-Entfernung von oben
					visibility = fShow;
				}
			}
			else
			{
				// vertical and not submenu under main-menu item and absolute
				with(submenu.style) {
					left = this.MenuLeft + this.MenuWidth + this.SubMenuOffsetX;
					top  = calculateSumOffset(menu, 'offsetTop') + this.SubMenuOffsetY;	//SUB Menue-Entfernung von oben
					visibility = fShow;
				}
			}

			if (!this.MenuIsVertical || this.SubMenuBelow) {
				if (NAV_IE)
					_leftX  = submenu.style.posLeft;
				if (NAV_DOM)
					_leftX = Number(submenu.style.left.replace("px",""));
			}
			else
				if (this.MenuIsAbsolute)
					_leftX = this.MenuLeft;
				else
				{
					if (NAV_IE)
						_leftX  = submenu.style.posLeft - addLeftOffset;
					if (NAV_DOM)
						_leftX = Number(submenu.style.left.replace("px","")) - addLeftOffset;
				}

			_rightX = _leftX + submenu.offsetWidth;
			if (this.MenuIsVertical && !this.SubMenuBelow)
				_rightX += this.MenuWidth

			if (NAV_IE)
				_leftY  = submenu.style.posTop + submenu.offsetHeight;
			if (NAV_DOM)
				_leftY = Number(submenu.style.top.replace("px","")) + submenu.offsetHeight;
			_rightY = _leftY;

			if (this.MenuIsVertical && !this.SubMenuBelow)
			{
				if (NAV_IE)
					_leftY = submenu.style.posTop;
				if (NAV_DOM)
					_leftY = Number(submenu.style.top.replace("px",""));
			}
		}
	}
		
	if (lastMenu != null && lastMenu != submenu) hideAll();

	lastMainMenu = menu;
	lastMenu = submenu;
	
	_MenuIsVertical = this.MenuIsVertical;
	_SubMenuBelow = this.SubMenuBelow;
}

// hide SubMenus and redefine font and background-colors for DIVs
function hideAll()
/*
 hideAll: hides submenus
*/
{	
	if (NAV_IE || NAV_DOM) {

		if (lastMainMenu != null && lastMenu != null) {
			if (_ImgSrcParent)
				document.images[lastMainMenu.id+NAV_ID_IMAGE+NAV_ID_PARENT].src = _ImgSrcParent;
			lastMainMenu.style.backgroundColor = _BGColor;
			document.getElementById(lastMainMenu.id + NAV_ID_LINK).style.color = _FontColor;
		}
		if (lastMenu != null) {
			lastMenu.style.visibility = fHide;
			lastMenu.style.left = 0;
		}
	}
}

function calculateSumOffset(idItem, offsetName)
/*
 calculateSumOffset: calculate offset for submenu-display

 params:
		idItem: main-menu item
		offsetName: type of offset to calculate
*/
{
	var totalOffset = 0;
	var item = eval('idItem');
	do
	{
		totalOffset += eval('item.'+offsetName);
		item = eval('item.offsetParent');
	} while (item != null);	
	return totalOffset;
}

function updateIt(e)
/*
 updateIt: called by onmousemove

 params:
	e: mouse-event
*/
{
//	document.getElementById("mdiv").innerHTML = e.pageX;
	
	if (NAV_IE)
	{
		var x = window.event.clientX;
		var y = window.event.clientY;

		if (MenuIsBuild)
			if (x > _rightX || x < _leftX) hideAll();
			else if	(y > _rightY) hideAll()
				 else if (_MenuIsVertical && !_SubMenuBelow)
						if (y < _leftY) hideAll();
	}
	if (NAV_DOM && !NAV_IE)
	{
		var x = e.pageX;
		var y = e.pageY;

		if (MenuIsBuild) {

			if (NAV_DOM)
			{
				var faultleftX = new Number(_leftX.valueOf());
				faultleftX += 5;					//Rand-Fehler links bei NS6
				var faultrightY = new Number(_rightY.valueOf());
				faultrightY -= 5;					//Rand-Fehler unten bei NS6
				var faultleftY = new Number(_leftY.valueOf());
				faultleftY -= 5;					//Rand-Fehler unten bei NS6
				var faultrightX = new Number(_rightX.valueOf());
				faultrightX -= 5;					//Rand-Fehler rechts bei NS6
			}
			else { faultleftX = _leftX; faultrightY = _rightY; faultleftY = _leftY; faultrightX = _rightX;}

			if (x > faultrightX || x < faultleftX) hideAll();
			else if (y > faultrightY) hideAll()
				 else if (_MenuIsVertical && !_SubMenuBelow)
						if (y < faultleftY) hideAll();
		}
	}

}

function NAV_GetFontString()
/*
 NAV_GetFontString: creates font-string for main-menu item
*/
{
	sFontString = (this.FontBold) ? "bold" : "";
	sFontString += (this.FontItalic) ? " italic" : "";
	sFontString += (this.FontSize) ? " " + this.FontSize : "";
	sFontString += (this.FontFamily) ? " " + this.FontFamily : "";
	return(sFontString);
}

function NAV_GetFontSubString()
/*
 NAV_GetFontSubString: creates font-string for sub-menu item
*/
{
	sFontString = (this.FontBoldSub) ? "bold" : "";
	sFontString += (this.FontItalicSub) ? " italic" : "";
	sFontString += (this.FontSizeSub) ? " " + this.FontSizeSub : "";
	sFontString += (this.FontFamily) ? " " + this.FontFamily : "";
	return(sFontString);
}


function NAV_GetStyle(sID)
/*
 NAV_GetStyle: creates style-string (builds the style-strings for DIVs, LINKS and SPAN)

 params:
	sID: selector for different items
*/
{
	var sStyleString = "";

	switch (sID)
	{
		case "MainDiv":
			{	
				sStyleString = (this.MenuIsAbsolute) ? "position:absolute;" : "position:relative;";
				sStyleString += (this.BorderWidth>=0) ? " border: " + this.BorderWidth + "px;" : "";
				sStyleString += (this.BorderLeft > 0) ? " border-left: " + this.BorderLeft + "px;" : "";
				sStyleString += (this.BorderRight > 0) ? " border-right: " + this.BorderRight + "px;" : "";
				sStyleString += (this.BorderTop > 0) ? " border-top: " + this.BorderTop + "px;" : "";
				sStyleString += (this.BorderBottom > 0) ? " border-bottom: " + this.BorderBottom + "px;" : "";
				sStyleString += (this.BorderColor) ? " border-color: " + this.BorderColor + ";" : "";
				sStyleString += (this.BorderStyle) ? " border-style: " + this.BorderStyle + ";" : "";
				sStyleString += (this.BGColor) ? " background-color: " + this.BGColor + ";" : "";
				sStyleString += (this.MenuTop && this.MenuIsAbsolute) ? " top: " + eval(this.MenuTop) + "px;" : "";
				sStyleString += (this.MenuLeft && this.MenuIsAbsolute) ? " left: " + eval(this.MenuLeft) + "px;" : "";
				sStyleString += (this.MenuWidth) ? " width: " + eval(this.MenuWidth) + "px;" : "";
				break;
			}
		case "MainMenu":
			{
				sStyleString = "position:relative;";		
				sStyleString += (this.BGColor) ? " background-color: " + this.BGColor + ";" : "";
				sStyleString += (this.MainMenuWidth && !this.MenuIsVertical) ? "width: " + this.MainMenuWidth + "px;" : "width: " + this.MenuWidth + "px;" ;
				sStyleString += (this.MainMenuHeight) ? " height: " + this.MainMenuHeight + "px;"  : "height: " + this.MenuHeight + "px;";
				break;
			}
		case "MainLink":
			{
				sStyleString = (this.FontColor) ? " color: " + this.FontColor + ";" : "";
				sStyleString += (this.NAV_GetFontString()) ? " font: " + this.NAV_GetFontString() + ";" : "";
				sStyleString += (this.LinkDecoration) ? " text-decoration: " + this.LinkDecoration + ";" : "";
				break;
			}
		case "SubDiv":
			{
				sStyleString = "position:absolute;";				
				sStyleString += " visibility: " + fHide + ";";
				sStyleString += (this.SubMenuWidth) ? " width: " + this.SubMenuWidth + "px;": "";
				sStyleString += (this.BGColorSub) ? " background-color: " + this.BGColorSub + ";" : "";
				sStyleString += (this.SubBorderWidth>=0) ? " border: " + this.SubBorderWidth + "px;" : "";
				sStyleString += (this.BorderColor) ? " border-color: " + this.BorderColor + ";" : "";
				sStyleString += (this.BorderStyle) ? " border-style: " + this.BorderStyle + ";" : "";
				break;
			}
		case "SubMenu":
			{
				sStyleString = "position:relative;";
				sStyleString += (this.BGColorSub) ? " background-color: " + this.BGColorSub + ";" : "";
				sStyleString += (this.SubMenuWidth) ? " width: " + this.SubMenuWidth + "px;": "";				
				sStyleString += (this.SubMenuHeight) ? " height: " + this.SubMenuHeight + "px;" : "";				
				break;
			}
		case "SubLink":
			{
				sStyleString = (this.FontColor) ? " color: " + this.FontColorSub + ";" : "";
				sStyleString += (this.NAV_GetFontSubString()) ? " font: " + this.NAV_GetFontSubString() + ";" : "";
				sStyleString += (this.LinkDecoration) ? " text-decoration: " + this.LinkDecoration + ";" : "";
				break;
			}
		case "SubNoLink":
			{
				sStyleString = (this.FontColor) ? " color: " + this.FontColorSubNoLink + ";" : "";
				sStyleString += (this.NAV_GetFontSubString()) ? " font: " + this.NAV_GetFontSubString() + ";" : "";
				break;
			}
		default:;
	};

	return(sStyleString);
}


function NAV_MouseMoveMainItem(evt,idItem)
/*
 NAV_MouseMoveMainItem: visualization work of MainMenu-Items

 params:
	evt: event of action
	idItem: main-menu item-id
*/
{
	switch (evt) {
		case "over": {
				this.displaySubMenu(idItem);				
				break;
			}
		case "out": {
				if (lastMainMenu != null && lastMenu != null) {
					// Parent and Child is hidden

					if (NAV_IE || NAV_DOM) {
						if (lastMenu.visibility == fHide) {
							if (_ImgSrc)
								document.images[lastMainMenu.id+NAV_ID_IMAGE].src = _ImgSrc;
							if (_ImgSrcParent)
								document.images[lastMainMenu.id+NAV_ID_IMAGE+NAV_ID_PARENT].src = _ImgSrcParent;

							lastMainMenu.style.backgroundColor = _BGColor;
							document.getElementById(lastMainMenu.id + NAV_ID_LINK).style.color = _FontColor;
						}
					}

				}
				else
				{ // no parent
						if (NAV_IE || NAV_DOM) {
							if (_ImgSrc)
								document.images[this.lastMainMenu.id+NAV_ID_IMAGE].src = _ImgSrc;
							lastMainMenu.style.backgroundColor = _BGColor;
							document.getElementById(lastMainMenu.id + NAV_ID_LINK).style.color = _FontColor;
						}
				}
				break;
			}
		default:;
	};
}

function NAV_MouseMoveSubItem(evt,idItem) {
/*
 NAV_MouseMoveSubItem: // visualization work of SubMenu-Items

 params:
	evt: event of action
	idItem: sub-menu item-id
*/
	switch (evt) {
		case "over": {
				if (NAV_IE || NAV_DOM) {
					document.getElementById(idItem).style.backgroundColor = this.BGColorOverSub;
					document.getElementById(idItem + NAV_ID_LINK).style.color = this.FontColorOverSub;
				}
				break;
			}
		case "out":	{
				if (NAV_IE || NAV_DOM) {
					document.getElementById(idItem).style.backgroundColor = this.BGColorSub;
					document.getElementById(idItem + NAV_ID_LINK).style.color = this.FontColorSub;
				}
				break;
			}
		default:;
	};
}