/*	#################################################################
#																	#
#		handling the main-navigation								#
#																	#
################################################################## */


/*
*	@ mainNavArray 	=> controls the active/ inactiv button stati
*	of the main navigation
*/
var mainNavArray 	= new Array (  );

var subNavArray 	= new Array (  );

/*
*	@ currentPage	=> active button, whenever a rollout is invoked that button is active again when rollout is invoked
*					=> currentPage is a function attribute set in every body tag (= function "mainNav ( start1, >> start2 << )" )
*/
var currentPage;
var maxNavElements = 8;

/*
*	function which controls the main navigation stati
*	with the effect of the current button <=> current page relation
*
*	start1 & start2 is false in the copyright area as there is no highlight
*	so the currentPage is set to "empty"
*/
function mainNav ( start1, start2 )
	{
		if ( start1 != "false" && start2 != "false" )
			{
				mainNavArray.push ( start2 );
				document.getElementById ( start2 ).className = "mainActive";
				
				currentPage = start2;	
			}
			else
			{
				currentPage = "empty";		
			}
		
		
		for ( var i = 1; i <= maxNavElements; i++ )
			{
				if ( document.getElementById ( "mainNav" + i ) != null || document.getElementById ( "mainNav" + i ) != undefined )
					{
						document.getElementById ( "mainNav" + i ).onmouseover 	= changeStatus;
						document.getElementById ( "mainNav" + i ).onmouseout 	= activePage;	
					}
			}
	}
	
function getBrowserData (  )
	{
		var browser_name;
		var browser_ver;
		
		browser_name	= navigator.appName;
		browser_ver		= navigator.appVersion;
		
		if ( browser_ver.substring ( 5, 8 ) ==  "Win" )
			{
				return -8;
			}
			else if ( browser_name == "Netscape" && browser_ver.substring ( 5, 8 ) ==  "Mac" )
				{
					return 8;
				}
				else
				{
					return 0;	
				}
	}
	
function subNav ( divID, margin )
	{
		if ( document.getElementById ( divID ) != null || document.getElementById ( divID ) != undefined )
		if ( divID != null )
			{
				document.getElementById ( divID ).className = "subActive";
			}
		
		document.getElementById ( "subNaviagtion" ).style.marginLeft = Number ( margin ) + "px";
		
	}

/*
*	@ activePage
*	function invoked with every rollout
*/
function activePage (  )
	{
		if ( currentPage != this.id + "_1" && currentPage != "empty" )
			{
				mainNavArray.push ( currentPage );
				document.getElementById ( currentPage ).className = "mainActive";
				if ( mainNavArray.length >= 2 )
					{
						var lastButton = mainNavArray.shift (  );	
						document.getElementById ( lastButton ).className = "mainInactive";
					}	
			}
			else
			{
				if ( currentPage == "empty" )
					{
						var lastButton = mainNavArray.shift (  );	
						document.getElementById ( lastButton ).className = "mainInactive";
					}
			}
	}

/*
*	@ activePage
*	function invoked with every rollover
*/
function changeStatus (  )
	{
		mainNavArray.push ( this.id + "_1" );
		if ( mainNavArray.length >= 2 )
			{
				var lastButton = mainNavArray.shift (  );	
				document.getElementById ( lastButton ).className = "mainInactive";
			}
		document.getElementById ( this.id + "_1" ).className = "mainActive";
		
	}
	
/*
*	@ activePage
*	function invoked with every rollover on sub menu items
*/
function changeStatusSub (  )
	{
		subNavArray.push ( this.id + "_1" );
		if ( mainNavArray.length >= 2 )
			{
				var lastButton = mainNavArray.shift (  );	
				document.getElementById ( lastButton ).className = "mainInactive";
			}
		document.getElementById ( this.id + "_1" ).className = "mainActive";
		
		alert ( this.id );
	}
	
	