<!--
// mps mediaworks webprojects */
// nav1_vorb.js */
// NAVIGATION VORBELEGUNG Version 0.9.1 by Nikolai Vogel 2001-10-13
// zuletzt angepasst am 25.10.2001 von Alexander Baumgartl */

// the subclass MyNavigationLink can be used
// to either shorten or broaden the constructor
// and overwrite the write method according to the website

/**
 * class NavigationLink
 * 
 * This class represents a link/a row in the navigation
 *
 * Navigation.addLink is called using a NavigationLink-Object
 * as parameter.
 * To provide visibility of the row NavigationLink::write() is called.
 * This should always be done by using Navigation::write()
 * 
 * Parameters:
 * integer navLevel:	hirarchy level of the item in the navigation
 *						(0: root, 1: toplevel)
 * string linkUrl:		relative link to the page or #
 *						(uses Navigation::basePath as base)
 * string linkOnClick:	provide a javascript to handle clicks
 *						e.g. oNav.getJsOnClickLink('oNav') to expand/collapse nodes
 * string linkText:		shown text for this navigation link
 * variant linkImage:	reserved for an optional Image used for this link
 * string linkStyle:	name of a the css stylesheet used for this link
 *						(depending on the write method() there should also be a 
 * 						version with the suffixes "-curr", "-anc", "-cld")
 */
 function MyNavigationLink(navLevel, linkUrl, linkOnClick, linkText, linkImage, navSort, pgId, lHiddenNode) {
	// specific styles/classes are only allowed 
	// on the top level of the navigation 
	this.navSort = navSort;
	this.pgId = pgId;
	this.lHiddenNode = lHiddenNode;	// mark this link as hidden in navigation
	linkStyle = 'navlink2';
	// every top level node gets the same js - so  the parameter is overwritten:
	if (navLevel == 1)
		linkOnClick = oNav.getJsOnClickLink('oNav');
	this.NavigationLink(navLevel, linkUrl, linkOnClick, linkText, linkStyle);
	this.linkImage = linkImage;
	// "navigation","Projektidee", 10, "#29448A"
}
MyNavigationLink.prototype = new NavigationLink("","",0,"");
//MyNavigationLink.prototype.constructor = MyNavigationLink;

/**
 * NavigationLink.write()
 *
 * This method actualy writes the navigation link
 * to the document object.
 * It's responsible for look and feel and for so 
 * has to be overwritten in a derived class (see navigation_custim.js)
 */
MyNavigationLink.prototype.getHtml = function () {
	/*
	 * classes we need from the css style sheet:
	 * a.navigation:	defines navigation links (this depends on the linkStyle parameter to the constructor)
	 * a.navigationakt:	defines highlighted navigation links to show current path
	 * 
	 * images we need:
	 * navigation_mark:			Marker/bullet point for link entries
	 * navigation_mark-cur:		highlighted version of above to mark current path
	 * navigation_mark_over:	highlighted version of above for roll over effect
	 * navigation_mark_over-cur:	highlighted version of above to mark current path
	 * navigation_mark-anc, navigation_mark_over-anc, navigation_mark-cld, navigation_mark_over-cld
	 * navigation_mark_transp:	transparent version of above as (??)
	 * (rem: if you don't really need as much images, just copy them on each other)
	 *
	 * members to use for html output (in order of preference):
	 * int navLevel:		level of navigation (1=toplevel)
	 * string linkStyleWithSuffix:	class name for css style sheet notation (e.g. navigation, navigation-akt)
	 * string linkText:		text to display for the link
	 * string linkHref:		complete url for the navigation link for the href attribute
	 *						(This should always be adapted to current host or filesystem-drive)
	 * string zaehler:		counter for creating image id for later reference (e.g. for MouseOver-Event)
	 * string linkCurrentSuffix:	suffix "-cur" when in current navigation path or "" else
	 *						used to modify styles e.g. image filenames
	 */
	var sHtmlLink = '';
	
	// this.linkCurrent suffix is either '' or '-akt' to provide a
	// simple way of highlighting the current nodes
	
	if (this.navLevel==0 || this.lHiddenNode) {
		// do not display the super/root node
	}
	else {
		// vertical spacing and dividing line
		// length of line is determined by minimum of current and preceeding line level
		//oDebug.write(this.navLevelLast+','+this.navLevel);
		var iLineLevel = Math.min(this.navLevel, this.oNav.navLevelLast);
		this.oNav.navLevelLast = this.navLevel;
		if (iLineLevel != 1) {
			iLineLevel += 1;
			//oDebug.write(', '+this.navLevelLast+','+this.navLevel);
			sHtmlLink += '\n<tr>'
						+ '<td colspan="' + iLineLevel + '" align="left" valign="top"></td>'
						+ '<td colspan="'+(7-iLineLevel)+'" align="left" class="border"><img src="/mo/images/all/nav/spacer.gif" border="0" width="1" height="1"></td>'
						+ '</tr>\n\n';
		}
		else {
			sHtmlLink += '\n<tr>'
						+ '<td colspan="7" align="left" class="border"><img src="/mo/images/all/nav/spacer.gif" border="0" width="1" height="1"></td>'
						+ '</tr>\n\n';
		}
					
		sHtmlLink += '\n<tr align="left">';
		
		// first cell in a link-line
		sHtmlLink += '\n<td width="6" x_height="18">&nbsp;</td>';
		
		// indent
		var sNavlink = 'navlink2'+ this.linkCurrentSuffix;
		if (this.navLevel == 1)
			sNavlink = 'navlink1';
		
		// space between marker and Nav title will be grey in navlevel 1
		var sClassGap = '';
		//if (this.navLevel == 1)
			sClassGap = 'navlink'+this.navLevel+this.linkCurrentSuffix;
			
		var sRollOverSuffix = '-area'+(this.navSort).substr(0,1);	// style with background color for each area (1-4)
		var sImage = ''
		if (this.linkImage != '')
			sImage = '<img src="' + this.linkImage + '" border="0">';
		sHtmlLink += '\n<td colspan="' + this.navLevel + '" align="left" valign="top" class="'+sNavlink+'">&nbsp;</td>'
					//'\n<td colspan="1" align="left" valign="top" class="'+sNavlink+'">&nbsp;</td>'
					// link itself
					+ '\n<td class="'+sNavlink+'" valign="top" align="left" colspan="'+(6-this.navLevel)+'">'
					//+ '\n<td class="navlink" valign="top" align="left" colspan="'+(6-this.navLevel)+'">'
					+ '\n<a target="main" class="'+sNavlink+'"'
					+ ' href="'+ this.linkHref  +'"'
					+ ' onClick="' + this.linkOnClick + '"'
					//+ ' onMouseOver="RolloverOnMouseOver(\'nav_mark_'+this.zaehler+'\',\'/mo/images/all/nav/navigation_mark_over'+sRollOverSuffix+'.gif\');"'
					//+ ' onMouseOut="RolloverOnMouseOut(\'nav_mark_'+this.zaehler+'\');"'
					+ '>'+ sImage + this.linkText + '</a>'
					+ '\n<br></td></tr>';

			/*			
			<tr class="navlevel1">
				<td width="6" height="18" class="bg"><img src="/mo/images/all/transparentes.gif" border="0" width="8" height="6"></td>
				<td width="11"><img src="/mo/images/all/spacer.gif" border="0" width="11" height="1"></td>
				<td width="11"><img src="/mo/images/all/spacer.gif" border="0" width="11" height="1"></td>
				<td width="11"><img src="/mo/images/all/spacer.gif" border="0" width="11" height="1"></td>
				<td width="11"><img src="/mo/images/all/spacer.gif" border="0" width="11" height="1"></td>
				<td width="11"><img src="/mo/images/all/spacer.gif" border="0" width="11" height="1"></td>
				<td width="180" class="navlevel1"><a href="" class="navlink1">Mondialogo World</a></td>
			</tr>
			*/					
	}
	//oDebug.write(sHtmlLink);
	return(sHtmlLink);
	
}

/*
 * is this node the current page (window.location) of the 
 * browser?
 */
MyNavigationLink.prototype.isCurrentPage = function () {
	//oDebug.write('\nisCurrentPage:'+this.oNav.currentLocationPath+'=='+ this.linkUrl);
	if (this.pgId == 1)
		return true;
	if (window.location.search  == this.linkUrl) {
		//oDebug.write('=true');
		return true;
	}
	return false;
}


function MyNavigation() {
	this.Navigation();
}
MyNavigation.prototype = new Navigation();

MyNavigation.prototype.clickLink = function MyNavigation_clickLink (iNodeIndex) {
	//Navigation_clickLink(iNodeIndex);
	//alert(this.oNavLinks[iNodeIndex].oChildLinks.length);
	var oLink = this.oNavLinks[iNodeIndex];
	//if (oLink.oChildLinks.length > 0 && oLink.oChildLinks[0].isVisibleOld) {
	if (oLink.isExpanded) {
		oLink.collapseLink();
		//alert('collapse');
	}
	else {
		// collapse the complete branch of the parent node
		(oLink.getAncestor(1)).collapseBranch();
		//alert('expand');
		oLink.expandLink();
	}
	// show navigation
	this.write();
	
	// mac will not execute link after returning
	// neither true or false
	parent.frames['main'].location.href = oLink.linkUrl;

	// returning false from the onClick will
	// prevent a reload
	return true;
}

var oNav = new MyNavigation();

oNav.sHtmlHeader = '\n<table width="228" border="0" cellpadding="0" cellspacing="0">';
var sBottomLine = '\n<tr>'
						+ '<td colspan="7" align="left" class="border"><img src="/mo/images/all/nav/spacer.gif" border="0" width="1" height="1"></td>'
						+ '</tr>\n\n';

oNav.sHtmlFooter = sBottomLine +'\n	<tr class="navlevel1">	<td width="6" height="1" class="white"><img src="/mo/images/all/spacer.gif" border="0" width="6" height="1"></td>		<td width="11"><img src="/mo/images/all/spacer.gif" border="0" width="11" height="1"></td>		<td width="6"><img src="/mo/images/all/spacer.gif" border="0" width="6" height="1"></td>		<td width="20"><img src="/mo/images/all/spacer.gif" border="0" width="20" height="1"></td>		<td width="20"><img src="/mo/images/all/spacer.gif" border="0" width="20" height="1"></td>		<td width="20"><img src="/mo/images/all/spacer.gif" border="0" width="20" height="1"></td>		<td width="129"><img src="/mo/images/all/spacer.gif" border="0" width="129" height="1"></td>	</tr>'
			+ '\n</table>';

// maximum depth of navigation
oNav.navtiefe = 5;
// expand navigation right from start up to level x
oNav.gesamtnavbis = 1;
// expand/show current/selected path from x to y
oNav.gewaehltnavab = 1;
oNav.gewaehltnavbis = 5; // deeper links won be expanded
// angewaehlten Pfad ganz anzeigen - gesamtnavbis, gewaehltnav u. gewaehltnavbis bleiben gueltig
oNav.nurpfad = false;
// nur jeweils Bereiche aus ausgewaehltem Level anzeigen
oNav.nuraktpfad = true;
// base path for defined links on this site
// e.g. oNav.basePath = '/ecap/site';
// e.g. oNav.basePath = '/workload/site';
oNav.basePath = '';

// insert super node (not visible in most navigations)
oNav.addLink(new MyNavigationLink(0, '/', oNav.getJsOnClickLink('oNav'), 'root node', '', ''));

// -->
