//activeButton zeigt an welcher Button gerade Aktiv, dass heisst geklickt ist
var activeButton = "";
var activeSubNaviButton = "";

//alert("current cookie value: " + document.cookie);
function initMainMenu()
{
	preloadImages('images/haupt_navi_1/profile_a.gif', 'images/haupt_navi_1/products_a.gif', 
				'images/subnavis/profile/referenzen_a.gif', 'images/subnavis/profile/partner_a.gif', 
				'images/subnavis/profile/jobs_a.gif', 'images/subnavis/profile/standorte_a.gif',
				'images/subnavis/products/hardware_a.gif', 'images/subnavis/products/software_a.gif',
				'images/subnavis/products/security_a.gif', 'images/subnavis/products/service_a.gif',
				'images/haupt_navi_1/it_management_ia.gif', 'images/haupt_navi_1/support_ia.gif',
				'images/haupt_navi_2/login_a.gif', 'images/haupt_navi_2/contact_a.gif',
				'images/haupt_navi_2/sitemap_a.gif','images/subnavis/it_management/consulting_a.gif',
				'images/subnavis/it_management/network_a.gif', 'images/subnavis/it_management/security_a.gif',
				'images/subnavis/support/news_a.gif', 'images/subnavis/support/newsLetter_a.gif', 
				'images/subnavis/support/newsArchive_a.gif', 'images/subnavis/support/itkuerzel_a.gif', 
				'images/subnavis/support/downloads_a.gif', 'images/subnavis/profile/phil_a.gif');

	/*swapImage('main', 'profilePic', 'images/haupt_navi_1/profile_a.gif', 'mainNaviLayer');

	fixLayer('subNaviProfileLayer');
	buttonClick("profile");
	*/
	
	//fixImage(null, 'profilePic', 'images/haupt_navi_1/profile_a.gif', 'mainNaviLayer');
}


/**
 *
 * Used when navi is reloaded and certain things have to be preset.
 *
 * Caution! this method does not simply perform a buttonOver
 * and buttonClick in that order.
 *
 **/
function buttonOverAndClick(which)
{
	if ( which == activeButton || which == activeSubNaviButton )
	{
		return;
	}	
		

	if ( which == "profile" )
	{
		swapImage('main', 'profilePic', 'images/haupt_navi_1/profile_a.gif');
		fixImage('main', 'profilePic', 'images/haupt_navi_1/profile_ia.gif');
		notifyFrames('mainFrame', 'index.php?module=profile');				

		displayLayers('subNaviProfileLayer');		
		fixLayer('subNaviProfileLayer');		

		activeButton = "profile";		
	}
	
	else if ( which == "support" )
	{		
		swapImage('main', 'supportPic', 'images/haupt_navi_1/support_a.gif');
		fixImage('main', 'supportPic', 'images/haupt_navi_1/support_ia.gif');
		
		hideLayers('subNaviProfileLayer');
		showLayer('subNaviSupportLayer');		
		fixLayer('subNaviSupportLayer');		

		activeButton = "support";
		
		//umleiten des Klick da noch nicht implementiert
		//buttonOverAndClick('profile');
	}
	
	else if ( which == "products" )
	{
		swapImage('main', 'productsPic', 'images/haupt_navi_1/products_a.gif');
		fixImage('main', 'productsPic', 'images/haupt_navi_1/products_ia.gif');
		
		hideLayers('subNaviProfileLayer');		
		showLayer('subNaviProductsLayer');		
		fixLayer('subNaviProductsLayer');	
		
		//alert(parent.mainFrame.location.href);
		var href = String(parent.mainFrame.location.href);
		
		if ( href.indexOf('main.products.html') == -1 )
		{			
			notifyFrames('mainFrame', 'main.products.html');
		}			

		activeButton = "products";
	}	
	
		
	else if ( which == "sitemap" )
	{
		swapImage('main', 'sitemapPic', 'images/haupt_navi_2/sitemap_a.gif');
		fixImage('main', 'sitemapPic', 'images/haupt_navi_2/sitemap_ia.gif');
		
		hideLayers('subNaviProfileLayer', 'subNaviProductsLayer');		
				
		//alert(parent.mainFrame.location.href);
		var href = String(parent.mainFrame.location.href);
		
		if ( href.indexOf('main.sitemap.html') == -1 )
		{			
			notifyFrames('mainFrame', 'main.sitemap.html');
		}			

		activeButton = "sitemap";
	}
	
	else if ( which == "shop" )
	{
		hideLayers('subNaviProfileLayer', 'subNaviProductsLayer');	
		
		//alert(parent.mainFrame.location.href);
		var href = String(parent.mainFrame.location.href);
		
		if ( href.indexOf('main.shop.html') == -1 )
		{			
			notifyFrames('mainFrame', 'main.shop.html');
		}			
			
		activeButton = "shop";
	}
	
	else if ( which == "contact" )
	{
		swapImage('main', 'contactPic', 'images/haupt_navi_2/contact_a.gif');
		fixImage('main', 'contactPic', 'images/haupt_navi_2/contact_ia.gif');
		
		hideLayers('subNaviProfileLayer', 'subNaviProductsLayer', 'subNaviSupportLayer');		
		showLayer('subNaviContactLayer');		
		fixLayer('subNaviContactLayer');	
		
		//alert(parent.mainFrame.location.href);
		var href = String(parent.mainFrame.location.href);
		
		if ( href.indexOf('index.php?module=contact&action=infosupport') == -1 )
		{			
			notifyFrames('mainFrame', 'index.php?module=contact&action=infosupport');
		}			

		activeButton = "contact";
		
		swapImage('sub', 'infoSupportPic', 'images/subnavis/contact/infosupport_a.gif', 'subNaviContacttLayer');
	
		buttonClick('infoSupport');
	}
	
	// contact subnavi buttons
	else if ( which == "standort" )
	{
		swapImage('sub', 'standortePic', 'images/subnavis/profile/standorte_a.gif', 'subNaviProfileLayer');
		fixImage('sub', 'standortePic', 'images/subnavis/profile/standorte_ia.gif', 'subNaviProfileLayer');
		notifyFrames('mainFrame', 'index.php?module=profile&action=standorte');				

		activeSubNaviButton = "standort";
	}	


	// Profile Subnavi Buttons
	else if ( which == "philosophie" )
	{
		swapImage('sub', 'philosophiePic', 'images/subnavis/profile/phil_a.gif', 'subNaviProfileLayer');
		fixImage('sub', 'philosophiePic', 'images/subnavis/profile/phil_ia.gif', 'subNaviProfileLayer');
		notifyFrames('mainFrame', 'index.php?module=profile&action=philosophie');				

		activeSubNaviButton = "philosophie";			
		
	}
	
	else if ( which == "referenzen" )
	{
		swapImage('sub', 'referenzenPic', 'images/subnavis/profile/referenzen_a.gif', 'subNaviProfileLayer');
		fixImage('sub', 'referenzenPic', 'images/subnavis/profile/referenzen_ia.gif', 'subNaviProfileLayer');
		notifyFrames('mainFrame', 'index.php?module=profile&action=referenzen');				

		activeSubNaviButton = "referenzen";			
		
	}

	
	else if ( which == "partner" )
	{
		swapImage('sub', 'partnerPic', 'images/subnavis/profile/partner_a.gif', 'subNaviProfileLayer');
		fixImage('sub', 'partnerPic', 'images/subnavis/profile/partner_ia.gif', 'subNaviProfileLayer');
		notifyFrames('mainFrame', 'main.profile.partner.inc.html');				

		activeSubNaviButton = "partner";
	}

	
	else if ( which == "jobs" )
	{
		swapImage('sub', 'jobsPic', 'images/subnavis/profile/jobs_a.gif', 'subNaviProfileLayer');
		fixImage('sub', 'jobsPic', 'images/subnavis/profile/jobs_ia.gif', 'subNaviProfileLayer');
		notifyFrames('mainFrame', 'index.php?module=profile&action=jobs');				

		activeSubNaviButton = "jobs";
	}

	else if ( which == "standorte" )
	{
		swapImage('sub', 'standortePic', 'images/subnavis/profile/standorte_a.gif', 'subNaviProfileLayer');
		fixImage('sub', 'standortePic', 'images/subnavis/profile/standorte_ia.gif', 'subNaviProfileLayer');
		notifyFrames('mainFrame', 'index.php?module=profile&action=standorte');				

		activeSubNaviButton = "standorte";
	}
	
	//products subnavi 
	else if ( which == "hardware" )
	{
		
		swapImage('sub', 'hardwarePic', 'images/subnavis/products/hardware_a.gif', 'subNaviProductsLayer');
		fixImage('sub', 'hardwarePic', 'images/subnavis/products/hardware_ia.gif', 'subNaviProductsLayer');
		
		notifyFrames('mainFrame', 'main.products.html?t=hw');		
		
		activeSubNaviButton = "hardware";
	}
	
	else if ( which == "software" )
	{
		swapImage('sub', 'softwarePic', 'images/subnavis/products/software_a.gif', 'subNaviProductsLayer');
		fixImage('sub', 'softwarePic', 'images/subnavis/products/software_ia.gif', 'subNaviProductsLayer');
		notifyFrames('mainFrame', 'main.products.html?t=sw');				

		activeSubNaviButton = "software";
	}
	
	else if ( which == "network" )
	{
		swapImage('sub', 'networkPic', 'images/subnavis/products/network_a.gif', 'subNaviProductsLayer');
		fixImage('sub', 'networkPic', 'images/subnavis/products/network_ia.gif', 'subNaviProductsLayer');
		notifyFrames('mainFrame', 'main.products.html?t=nw');				

		activeSubNaviButton = "network";
	}
	
	else if ( which == "security" )
	{
		swapImage('sub', 'securityPic', 'images/subnavis/products/security_a.gif', 'subNaviProductsLayer');
		fixImage('sub', 'securityPic', 'images/subnavis/products/security_ia.gif', 'subNaviProductsLayer');
		notifyFrames('mainFrame', 'main.products.html?t=sec');				

		activeSubNaviButton = "security";
	}
	
	/*
	// {{{ SUPPORT SUBNAVI
	else if ( which == "newsletter" )
	{
		swapImage('sub', 'newsLetterPic', 'images/subnavis/support/newsletter_a.gif', 'subNaviSupportLayer');
		fixImage('sub', 'newsLetterPic', 'images/subnavis/support/newsletter_ia.gif', 'subNaviSupportLayer');
		notifyFrames('mainFrame', 'main.support.newsletter.html');				

		activeSubNaviButton = "newsletter";
	}
	
	else if ( which == "newsletter" )
	{
		swapImage('sub', 'newsLetterPic', 'images/subnavis/support/happy_a.gif', 'subNaviSupportLayer');
		fixImage('sub', 'newsLetterPic', 'images/subnavis/support/happy_ia.gif', 'subNaviSupportLayer');
		notifyFrames('mainFrame', 'index.php?module=support&action=valentin&go=cards');				

		activeSubNaviButton = "newsletter";
	}
	
	else if ( which == "newsArchive" )
	{
		swapImage('sub', 'newsArchivePic', 'images/subnavis/support/newsarchive_a.gif', 'subNaviSupportLayer');
		fixImage('sub', 'newsArchivePic', 'images/subnavis/support/newsarchive_ia.gif', 'subNaviSupportLayer');
		notifyFrames('mainFrame', 'support.newsl.archiv.html');				

		activeSubNaviButton = "newsArchive";
	}
	*/
	else if ( which == "itKuerzel" )
	{
		swapImage('sub', 'itKuerzelPic', 'images/subnavis/support/itkuerzel_a.gif', 'subNaviSupportLayer');
		fixImage('sub', 'itKuerzelPic', 'images/subnavis/support/itkuerzel_ia.gif', 'subNaviSupportLayer');
		notifyFrames('mainFrame', 'it_dictionary.php');
		
		activeSubNaviButton = "itKuerzel";
	}
	else if ( which == "downloads" )
	{
		swapImage('sub', 'downloadsPic', 'images/subnavis/support/downloads_a.gif', 'subNaviSupportLayer');
		fixImage('sub', 'downloadsPic', 'images/subnavis/support/downloads_ia.gif', 'subNaviSupportLayer');
		notifyFrames('mainFrame', 'main.support.downloads2.html');
		
		activeSubNaviButton = "downloads";
	}
	
	/*else if ( which == "news" )
	{
		swapImage('sub', 'newsPic', 'images/subnavis/support/news_a.gif', 'subNaviSupportLayer');
		fixImage('sub', 'newsPic', 'images/subnavis/support/news_ia.gif', 'subNaviSupportLayer');
		notifyFrames('mainFrame', 'index.php?module=support&action=news');
		
		activeSubNaviButton = "news";
	}*/
	
	/*else if ( which == "new_media" )
	{
		swapImage('sub', 'newsPic', 'images/subnavis/support/news_a.gif', 'subNaviSupportLayer');
		fixImage('sub', 'newsPic', 'images/subnavis/support/news_ia.gif', 'subNaviSupportLayer');
		notifyFrames('mainFrame', 'index.php?module=support&action=new_media_form');
		
		activeSubNaviButton = "news";
	}*/
	
	/*else if ( which == "xcard" )
	{
		swapImage('sub', 'newsPic', 'images/subnavis/support/news_a.gif', 'subNaviSupportLayer');
		fixImage('sub', 'newsPic', 'images/subnavis/support/news_ia.gif', 'subNaviSupportLayer');
		notifyFrames('mainFrame', 'index.php?module=support&action=news&xmas=cards');
		
		activeSubNaviButton = "news";
	}*/
	
	/*else if ( which == "xscreen" )
	{
		swapImage('sub', 'newsPic', 'images/subnavis/support/news_a.gif', 'subNaviSupportLayer');
		fixImage('sub', 'newsPic', 'images/subnavis/support/news_ia.gif', 'subNaviSupportLayer');
		notifyFrames('mainFrame', 'index.php?module=support&action=news&xmas=screens');
		
		activeSubNaviButton = "news";
	}*/
	
	/*else if ( which == "news2" )
	{
		swapImage('sub', 'newsPic', 'images/subnavis/support/news_a.gif', 'subNaviSupportLayer');
		fixImage('sub', 'newsPic', 'images/subnavis/support/news_ia.gif', 'subNaviSupportLayer');
		notifyFrames('mainFrame', 'xmas.cards.dl.html');
		
		activeSubNaviButton = "news2";
	}*/
	// SUPPORT SUBNAVI }}}

	else
	{
		//alert("Button not available(reload): " + which);
	}
}


/**
 *
 * Handles a click on the given button
 *
 * @param string the button that has been clicked
 * @access public
 *
 **/
function buttonClick(which)
{
	if ( which != 'profile' 
		&& (which == activeButton || which == activeSubNaviButton) )
	{
		return;
	}
	
	
	if ( which == "profile" )
	{
		freeFixedImage('main');
		swapImage('main', 'profilePic', 'images/haupt_navi_1/profile_a.gif');
		fixImage('main', 'profilePic', 'images/haupt_navi_1/profile_ia.gif');
		
		//notifyFrames('mainFrame', 'main.profile.html');

		hideLayers(getFixedLayer());
		freeFixedLayer();
		fixLayer('subNaviProfileLayer');
		showLayer('subNaviProfileLayer');

		activeButton = "profile";
		activeSubNaviButton = "";
		
		freeFixedImage('sub');	
	}

	
	else if ( which == "products" )
	{
		freeFixedImage('sub');
		freeFixedImage('main');
		swapImage('main', 'productsPic', 'images/haupt_navi_1/products_a.gif', 'mainNaviLayer');
		fixImage('main', 'productsPic', 'images/haupt_navi_1/products_ia.gif', 'mainNaviLayer');
		
		//notifyFrames('mainFrame', 'main.products.html')
			
		hideLayers(getFixedLayer());	
		freeFixedLayer();
		fixLayer('subNaviProductsLayer');
		
		showLayer('subNaviProductsLayer');

		activeButton = "products";
		activeSubNaviButton = "";	
	}
	
	
	else if ( which == "sitemap" )
	{
		freeFixedImage('sub');
		freeFixedImage('main');
		swapImage('main', 'sitemapPic', 'images/haupt_navi_2/sitemap_a.gif', 'mainNaviLayer');
		fixImage('main', 'sitemapPic', 'images/haupt_navi_2/sitemap_ia.gif', 'mainNaviLayer');
		
		activeButton = "sitemap";
		activeSubNaviButton = "";		
		
		hideLayer(getFixedLayer());	
		freeFixedLayer();
	}
	
	else if ( which == "shop" )
	{
		freeFixedImage('sub');
		freeFixedImage('main');
		activeButton = "shop";
		activeSubNaviButton = "";
		
		hideLayer(getFixedLayer());	
		freeFixedLayer();
	}
	
	else if ( which == "contact" )
	{
		freeFixedImage('sub');
		freeFixedImage('main');
		swapImage('main', 'contactPic', 'images/haupt_navi_2/contact_a.gif', 'mainNaviLayer');
		fixImage('main', 'contactPic', 'images/haupt_navi_2/contact_ia.gif', 'mainNaviLayer');
		swapImage('sub', 'infoSupportPic', 'images/subnavis/contact/infosupport_a.gif', 'subNaviContactLayer');
		fixImage('sub', 'infoSupportPic', 'images/subnavis/contact/infosupport_ia.gif', 'subNaviContactLayer');
		
		activeButton = "contact";
		activeSubNaviButton = "";		
		
		hideLayer(getFixedLayer());	
		freeFixedLayer();
		fixLayer('subNaviContactLayer');
	}

	/*
	else if ( which == "it_management" )
	{
		if ( activeButton != "it_management" )
		{	
			freeFixedImage('main');
			fixImage('main', 'it_managementPic', 'images/haupt_navi_1/it_management_ia.gif', 'mainNaviLayer');
			//notifyFrames('mainFrame', 'main_aktuelles_angebot.inc.html', 'subNaviFrame', 'subnavi.inc.html')
			
			hideLayers(getFixedLayer());			

			freeFixedLayer('main');
			fixLayer('subNaviITManagementLayer');
			displayLayers('subNaviITManagementLayer');	
			

			activeButton = "it_management";
			
		}
	}
	*/
	else if ( which == "support" )
	{
		freeFixedImage('sub');
		freeFixedImage('main');
		swapImage('main', 'supportPic', 'images/haupt_navi_1/support_a.gif', 'mainNaviLayer');
		fixImage('main', 'supportPic', 'images/haupt_navi_1/support_ia.gif', 'mainNaviLayer');
		
		hideLayers(getFixedLayer());	
		freeFixedLayer();
		fixLayer('subNaviSupportLayer');
		showLayer('subNaviSupportLayer');	

		activeButton = "support";		
		activeSubNaviButton = "";	
		
		supportLink.blur();
	}
	
	
	// contact subnavi buttons
	else if ( which == "standort" )
	{
		freeFixedImage('sub');
		fixImage('sub', 'standortPic', 'images/subnavis/contact/standort_ia.gif', 'subNaviContactLayer');
		//notifyFrames('mainFrame', 'main.profile.standorte.inc.html');				

		activeSubNaviButton = "standort";	
	}
	else if ( which == "infoSupport" )
	{
		freeFixedImage('sub');
		fixImage('sub', 'infoSupportPic', 'images/subnavis/contact/infosupport_ia.gif', 'subNaviContactLayer');
		//notifyFrames('mainFrame', 'main.profile.standorte.inc.html');				

		activeSubNaviButton = "infoSupport";	
	}

	

	// Profile Subnavi Buttons
	else if ( which == "philosophie" )
	{
		if ( activeSubNaviButton != "philosophie" )
		{	
			freeFixedImage('sub');
			fixImage('sub', 'philosophiePic', 'images/subnavis/profile/phil_ia.gif', 'subNaviProfileLayer');
			//notifyFrames('mainFrame', 'main.profile.referenzen.inc.html');				

			activeSubNaviButton = "philosophie";			
		}
	}
	
	else if ( which == "referenzen" )
	{
		if ( activeSubNaviButton != "referenzen" )
		{	
			freeFixedImage('sub');
			fixImage('sub', 'referenzenPic', 'images/subnavis/profile/referenzen_ia.gif', 'subNaviProfileLayer');
			//notifyFrames('mainFrame', 'main.profile.referenzen.inc.html');				

			activeSubNaviButton = "referenzen";
			
		}
	}

	else if ( which == "partner" )
	{
		if ( activeSubNaviButton != "partner" )
		{	
			freeFixedImage('sub');
			fixImage('sub', 'partnerPic', 'images/subnavis/profile/partner_ia.gif', 'subNaviProfileLayer');
			notifyFrames('mainFrame', 'main.profile.partner.inc.html');				

			activeSubNaviButton = "partner";			
		}
	}

	else if ( which == "jobs" )
	{
		if ( activeSubNaviButton != "jobs" )
		{	
			freeFixedImage('sub');
			fixImage('sub', 'jobsPic', 'images/subnavis/profile/jobs_ia.gif', 'subNaviProfileLayer');
			notifyFrames('mainFrame', 'main.profile.jobs.inc.html');				

			activeSubNaviButton = "jobs";
			
		}
	}

	else if ( which == "standorte" )
	{
		freeFixedImage('sub');
		fixImage('sub', 'standortePic', 'images/subnavis/profile/standorte_ia.gif', 'subNaviProfileLayer');
		notifyFrames('mainFrame', 'main.profile.standorte.inc.html');				

		activeSubNaviButton = "standorte";	
	}
	
	
	// Products Subnavi Buttons
	else if ( which == "hardware" )
	{
		freeFixedImage('sub');		
		fixImage('sub', 'hardwarePic', 'images/subnavis/products/hardware_ia.gif', 'subNaviProductsLayer');
		getElementsByName('hardwareLink')[0].blur();
		
		var href = String(parent.mainFrame.location.href);
		
		if ( href.indexOf('main.products.html') == -1 )
		{			
			notifyFrames('mainFrame', 'main.products.html?t=hw');			
		}
		//notifyFrames('mainFrame', 'main.products.html?t=hw')	
		parent.mainFrame.buttonClick('hardware');	

		activeSubNaviButton = "hardware";		
	}
	
	else if ( which == "software" )
	{
		freeFixedImage('sub');
		fixImage('sub', 'softwarePic', 'images/subnavis/products/software_ia.gif', 'subNaviProductsLayer');
		getElementsByName('softwareLink')[0].blur();
		
		var href = String(parent.mainFrame.location.href);
		
		if ( href.indexOf('main.products.html') == -1 )
		{			
			notifyFrames('mainFrame', 'main.products.html?t=sw');			
		}
		//notifyFrames('mainFrame', 'main.products.html?t=hw')	
		parent.mainFrame.buttonClick('software');			

		activeSubNaviButton = "software";		
	}
	
	else if ( which == "network" )
	{
		freeFixedImage('sub');
		fixImage('sub', 'networkPic', 'images/subnavis/products/network_ia.gif', 'subNaviProductsLayer');
		getElementsByName('networkLink')[0].blur();
		
		var href = String(parent.mainFrame.location.href);
		
		if ( href.indexOf('main.products.html') == -1 )
		{			
			notifyFrames('mainFrame', 'main.products.html?t=nw');			
		}
		//notifyFrames('mainFrame', 'main.products.html?t=hw')	
		parent.mainFrame.buttonClick('network');	

		activeSubNaviButton = "network";		
	}
	
	else if ( which == "security" )
	{
		freeFixedImage('sub');
		fixImage('sub', 'securityPic', 'images/subnavis/products/security_ia.gif', 'subNaviProductsLayer');
		getElementsByName('securityLink')[0].blur();
		
		var href = String(parent.mainFrame.location.href);
		
		if ( href.indexOf('main.products.html') == -1 )
		{			
			notifyFrames('mainFrame', 'main.products.html?t=sec');			
		}
		//notifyFrames('mainFrame', 'main.products.html?t=hw')	
		parent.mainFrame.buttonClick('security');		

		activeSubNaviButton = "security";		
	}
	
	/*
	//subnavi support
	else if ( which == "newsletter" )
	{
		freeFixedImage('sub');
		fixImage('sub', 'newsLetterPic', 'images/subnavis/support/newsletter_ia.gif', 'subNaviSupportLayer');
		getElementsByName('newsletterLink')[0].blur();
		
		var href = String(parent.mainFrame.location.href);
		
		if ( href.indexOf('main.support.newsletter.html') == -1 )
		{			
			notifyFrames('mainFrame', 'main.support.newsletter.html');			
		}
		
		activeSubNaviButton = "newsletter";	
	}
	
	else if ( which == "newsArchive" )
	{
		freeFixedImage('sub');
		fixImage('sub', 'newsArchivePic', 'images/subnavis/support/newsarchive_ia.gif', 'subNaviSupportLayer');
		getElementsByName('newsArchiveLink')[0].blur();
		
		var href = String(parent.mainFrame.location.href);
		
		if ( href.indexOf('main.support.newsletter.html') == -1 )
		{			
			notifyFrames('mainFrame', 'main.support.newsletter.html');			
		}
		
		activeSubNaviButton = "newsArchive";	
	}
	*/
	else if ( which == "itKuerzel" )
	{
		freeFixedImage('sub');
		fixImage('sub', 'itKuerzelPic', 'images/subnavis/support/itkuerzel_ia.gif', 'subNaviSupportLayer');
		getElementsByName('itKuerzelLink')[0].blur();
		
		var href = String(parent.mainFrame.location.href);
		
		if ( href.indexOf('main.support.itk.html') == -1 )
		{			
			notifyFrames('mainFrame', 'main.support.itk.html');			
		}
		
		activeSubNaviButton = "itKuerzel";		
	}
	
	else if ( which == "downloads" )
	{
		freeFixedImage('sub');
		fixImage('sub', 'downloadsPic', 'images/subnavis/support/downloads_ia.gif', 'subNaviSupportLayer');
		getElementsByName('downloadsLink')[0].blur();
		
		var href = String(parent.mainFrame.location.href);
		
		if ( href.indexOf('main.support.downloads.html') == -1 )
		{			
			notifyFrames('mainFrame', 'main.support.downloads.html');			
		}
		
		activeSubNaviButton = "downloads";		
	}
	
	/*else if ( which == "news" )
	{
		freeFixedImage('sub');
		fixImage('sub', 'newsPic', 'images/subnavis/support/news_ia.gif', 'subNaviSupportLayer');
		getElementsByName('newsLink')[0].blur();
		
		var href = String(parent.mainFrame.location.href);
		
		if ( href.indexOf('xmas.screensaver.dl.html') == -1 )
		{			
			notifyFrames('mainFrame', 'xmas.screensaver.dl.html');			
		}
		
		activeSubNaviButton = "news";		
	}*/
	
	
	else
	{
		alert("Der Menüpunkt " + which + " wird im Moment überarbeitet!");
		return;
	}
	
	//set cookie to remember current position of navi and subnavi
	document.cookie = "sigNavi=" + activeButton + "&" + activeSubNaviButton;
}




/**
 *
 * buttonOver
 *
 **/
function buttonOver(which)
{
	if ( which == activeButton || which == activeSubNaviButton )
	{
		return;
	}

	if ( which == "profile" )
	{
		//fixImage(null, 'shopPic', 'images/navigation/shop_off.gif', 'mainNaviLayer');  
		swapImage('main', 'profilePic', 'images/haupt_navi_1/profile_a.gif');
		hideLayers(getFixedLayer());
		displayLayers('subNaviProfileLayer');
	}

	else if ( which == "products" )
	{
		//fixImage(null, 'shopPic', 'images/navigation/shop_off.gif', 'mainNaviLayer');  
		swapImage('main', 'productsPic', 'images/haupt_navi_1/products_a.gif');
		hideLayers(getFixedLayer());
		displayLayers('subNaviProductsLayer');
	}

	else if ( which == "it_management" )
	{
		//fixImage(null, 'shopPic', 'images/navigation/shop_off.gif', 'mainNaviLayer');  
		swapImage('main', 'it_managementPic', 'images/haupt_navi_1/it_management_a.gif');
		hideLayers(getFixedLayer());
		displayLayers('subNaviITManagementLayer');
	}

	else if ( which == "support" )
	{
		//fixImage(null, 'shopPic', 'images/navigation/shop_off.gif', 'mainNaviLayer');  
		swapImage('main', 'supportPic', 'images/haupt_navi_1/support_a.gif');
		hideLayers(getFixedLayer());
		displayLayers('subNaviSupportLayer');
	}


	// 2. Hauptnavi Buttons
	else if ( which == "login" )
	{
		swapImage('main', 'loginPic', 'images/haupt_navi_2/login_a.gif');
	}	
	else if ( which == "contact" )
	{
		swapImage('main', 'contactPic', 'images/haupt_navi_2/contact_a.gif');
		hideLayers(getFixedLayer());
		displayLayers('subNaviContactLayer');
	}	
	else if ( which == "sitemap" )
	{
		swapImage('main', 'sitemapPic', 'images/haupt_navi_2/sitemap_a.gif');
	}



	// Subnavi Profile Buttons
	else if ( which == "philosophie" )
	{
		swapImage('sub', 'philosophiePic', 'images/subnavis/profile/phil_a.gif');
	}
	else if ( which == "referenzen" )
	{
		swapImage('sub', 'referenzenPic', 'images/subnavis/profile/referenzen_a.gif');
	}
	else if ( which == "partner" )
	{
		swapImage('sub', 'partnerPic', 'images/subnavis/profile/partner_a.gif');
	}
	else if ( which == "jobs" )
	{
		swapImage('sub', 'jobsPic', 'images/subnavis/profile/jobs_a.gif');
	}
	else if ( which == "standorte" )
	{
		swapImage('sub', 'standortePic', 'images/subnavis/profile/standorte_a.gif');
	}


	// Subnavi Products Buttons
	else if ( which == "hardware" )
	{
		swapImage('sub', 'hardwarePic', 'images/subnavis/products/hardware_a.gif', 'subNaviProductsLayer');
	}
	else if ( which == "software" )
	{
		swapImage('sub', 'softwarePic', 'images/subnavis/products/software_a.gif', 'subNaviProductsLayer');
	}
	else if ( which == "security" )
	{
		swapImage('sub', 'securityPic', 'images/subnavis/products/security_a.gif', 'subNaviProductsLayer');
	}
	else if ( which == "network" )
	{
		swapImage('sub', 'networkPic', 'images/subnavis/products/network_a.gif', 'subNaviProductsLayer');
	}

	// Subnavi IT Management Buttons
	else if ( which == "consulting" )
	{
		swapImage('sub', 'consultingPic', 'images/subnavis/it_management/consulting_a.gif', 'subNaviITManagementLayer');
	}
	else if ( which == "networkIT" )
	{
		swapImage('sub', 'networkITPic', 'images/subnavis/it_management/network_a.gif', 'subNaviITManagementLayer');
	}
	else if ( which == "security2" )
	{
		swapImage('sub', 'security2Pic', 'images/subnavis/it_management/security_a.gif', 'subNaviITManagementLayer');
	}	
	

	// Subnavi Support Buttons
	else if ( which == "news" )
	{
		swapImage('sub', 'newsPic', 'images/subnavis/support/news_a.gif', 'subNaviSupportLayer');
	}
	else if ( which == "newsletter" )
	{
		swapImage('sub', 'newsLetterPic', 'images/subnavis/support/newsletter_a.gif', 'subNaviSupportLayer');
		//swapImage('sub', 'newsLetterPic', 'images/subnavis/support/happy_a.gif', 'subNaviSupportLayer');
	}
	else if ( which == "newsArchive" )
	{
		swapImage('sub', 'newsArchivePic', 'images/subnavis/support/newsArchive_a.gif', 'subNaviSupportLayer');
	}
	else if ( which == "itKuerzel" ) {
				swapImage('sub', 'itKuerzelPic', 'images/subnavis/support/itkuerzel_a.gif', 'subNaviSupportLayer');
	}
	else if ( which == "downloads" )
	{
		swapImage('sub', 'downloadsPic', 'images/subnavis/support/downloads_a.gif', 'subNaviSupportLayer');
	}


	// Subnavi Contact Buttons
	else if ( which == "infoSupport" )
	{
		swapImage('sub', 'infoSupportPic', 'images/subnavis/contact/infosupport_a.gif', 'subNaviContacttLayer');
	}
	else if ( which == "email" )
	{
		swapImage('sub', 'emailPic', 'images/subnavis/contact/email_a.gif', 'subNaviContacttLayer');
	}
	else if ( which == "standort" )
	{
		swapImage('sub', 'standortPic', 'images/subnavis/contact/standort_a.gif', 'subNaviContacttLayer');
	}	
	
}


function buttonOut(which)
{
	if ( which == activeButton || which == activeSubNaviButton )
	{
		return;
	}


	if ( which == "profile" )
	{
		swapImgRestore('main');

		if ( getFixedLayer() != "subNaviProfileLayer" )
		{
			hideLayers('subNaviProfileLayer');
			displayLayers(getFixedLayer());
		}
	}

	else if ( which == "products" )
	{
		swapImgRestore('main');

		if ( getFixedLayer() != "subNaviProductsLayer" )
		{
			hideLayers('subNaviProductsLayer');
			displayLayers(getFixedLayer());
		}
	}

	else if ( which == "it_management" )
	{
		swapImgRestore('main');

		if ( getFixedLayer() != "subNaviITManagementLayer" )
		{
			hideLayers('subNaviITManagementLayer');
			displayLayers(getFixedLayer());
		}
	}

	else if ( which == "support" )
	{
		swapImgRestore('main');

		if ( getFixedLayer() != "subNaviSupportLayer" )
		{
			hideLayers('subNaviSupportLayer');
			displayLayers(getFixedLayer());
		}
	}


	// 2. Hauptnavi Buttons
	else if ( which == "login" )
	{
		swapImgRestore('main');
	}	
	else if ( which == "contact" )
	{
		swapImgRestore('main');

		if ( getFixedLayer() != "subNaviContactLayer" )
		{
			hideLayers('subNaviContactLayer');
			displayLayers(getFixedLayer());
		}
	}	
	else if ( which == "sitemap" )
	{
		swapImgRestore('main');
	}




	// subnavi Profilfe buttons
	else if ( which == "philosophie" )
	{
		swapImgRestore('sub');
	}
	else if ( which == "referenzen" )
	{
		swapImgRestore('sub');
	}
	else if ( which == "partner" )
	{
		swapImgRestore('sub');
	}
	else if ( which == "jobs" )
	{
		swapImgRestore('sub');
	}
	else if ( which == "standorte" )
	{
		swapImgRestore('sub');
	}


	// subnavi Products buttons
	else if ( which == "hardware" )
	{
		swapImgRestore('sub');
	}
	else if ( which == "software" )
	{
		swapImgRestore('sub');
	}
	else if ( which == "security" )
	{
		swapImgRestore('sub');
	}
	else if ( which == "network" )
	{
		swapImgRestore('sub');
	}


	// Subnavi IT Management Buttons
	else if ( which == "consulting" )
	{
		swapImgRestore('sub');
	}
	else if ( which == "networkIT" )
	{
		swapImgRestore('sub');
	}
	else if ( which == "security2" )
	{
		swapImgRestore('sub');
	}


	// Subnavi Support Buttons
	else if ( which == "news" )
	{
		swapImgRestore('sub');
	}
	else if ( which == "newsletter" )
	{
		swapImgRestore('sub');
	}
	else if ( which == "newsArchive" )
	{
		swapImgRestore('sub');
	}
	else if ( which == "itKuerzel" )
	{
		swapImgRestore('sub');
	}
	else if ( which == "downloads" )
	{
		swapImgRestore('sub');
	}
	// Subnavi Support Buttons
	else if ( which == "infoSupport" )
	{
		swapImgRestore('sub');
	}
	else if ( which == "email" )
	{
		swapImgRestore('sub');
	}
	else if ( which == "standort" )
	{
		swapImgRestore('sub');
	}
}







/**
 *
 * Click event from an external frame
 * e.g. main.sitemap.html uses this method
 *
 **/
function externalClick(which)
{
	if ( which != 'profile' 
		&& (which == activeButton || which == activeSubNaviButton) )
	{
		return;
	}
	else if ( which == 'profile' )
	{
		// first swap and fix main navi image (profile)
		freeFixedImage('main');
		swapImage('main', 'profilePic', 'images/haupt_navi_1/profile_a.gif', 'mainNaviLayer');
		fixImage('main', 'profilePic', 'images/haupt_navi_1/profile_ia.gif', 'mainNaviLayer');
		
		// display profile subnavi links
		displayLayers('subNaviProfileLayer');		
		fixLayer('subNaviProfileLayer');		

		activeButton = "profile";		
	}
	else if ( which == 'philosophie' )
	{
		// first swap and fix main navi image (profile)
		freeFixedImage('main');
		swapImage('main', 'profilePic', 'images/haupt_navi_1/profile_a.gif', 'mainNaviLayer');
		fixImage('main', 'profilePic', 'images/haupt_navi_1/profile_ia.gif', 'mainNaviLayer');
		
		// display profile subnavi links
		displayLayers('subNaviProfileLayer');		
		fixLayer('subNaviProfileLayer');		

		activeButton = "profile";	
		
		// swap and fix subnavi element
		freeFixedImage('sub');
		swapImage('sub', 'philosophiePic', 'images/subnavis/profile/phil_a.gif', 'subNaviProfileLayer');
		fixImage('sub', 'philosophiePic', 'images/subnavis/profile/phil_ia.gif', 'subNaviProfileLayer');
		
		activeSubNaviButton = "philosophie";			
	}
	
	else if ( which == 'referenzen' )
	{
		// first swap and fix main navi image (profile)
		freeFixedImage('main');
		swapImage('main', 'profilePic', 'images/haupt_navi_1/profile_a.gif', 'mainNaviLayer');
		fixImage('main', 'profilePic', 'images/haupt_navi_1/profile_ia.gif', 'mainNaviLayer');
		
		// display profile subnavi links
		displayLayers('subNaviProfileLayer');		
		fixLayer('subNaviProfileLayer');		

		activeButton = "profile";	
		
		// swap and fix subnavi element
		freeFixedImage('sub');
		swapImage('sub', 'referenzenPic', 'images/subnavis/profile/referenzen_a.gif', 'subNaviProfileLayer');
		fixImage('sub', 'referenzenPic', 'images/subnavis/profile/referenzen_ia.gif', 'subNaviProfileLayer');
		
		activeSubNaviButton = "referenzen";			
	}
	
	else if ( which == 'partner' )
	{
		// first swap and fix main navi image (profile)
		freeFixedImage('main');
		swapImage('main', 'profilePic', 'images/haupt_navi_1/profile_a.gif', 'mainNaviLayer');
		fixImage('main', 'profilePic', 'images/haupt_navi_1/profile_ia.gif', 'mainNaviLayer');
		
		// display profile subnavi links
		displayLayers('subNaviProfileLayer');		
		fixLayer('subNaviProfileLayer');		

		activeButton = "profile";	
		
		// swap and fix subnavi element
		freeFixedImage('sub');
		swapImage('sub', 'partnerPic', 'images/subnavis/profile/partner_a.gif', 'subNaviProfileLayer');
		fixImage('sub', 'partnerPic', 'images/subnavis/profile/partner_ia.gif', 'subNaviProfileLayer');
		
		activeSubNaviButton = "partner";			
	}
	
	else if ( which == 'jobs' )
	{
		// first swap and fix main navi image (profile)
		freeFixedImage('main');
		swapImage('main', 'profilePic', 'images/haupt_navi_1/profile_a.gif', 'mainNaviLayer');
		fixImage('main', 'profilePic', 'images/haupt_navi_1/profile_ia.gif', 'mainNaviLayer');
		
		// display profile subnavi links
		displayLayers('subNaviProfileLayer');		
		fixLayer('subNaviProfileLayer');		

		activeButton = "profile";	
		
		// swap and fix subnavi element
		freeFixedImage('sub');
		swapImage('sub', 'jobsPic', 'images/subnavis/profile/jobs_a.gif', 'subNaviProfileLayer');
		fixImage('sub', 'jobsPic', 'images/subnavis/profile/jobs_ia.gif', 'subNaviProfileLayer');
		
		activeSubNaviButton = "jobs";			
	}
	
	else if ( which == 'standorte' )
	{
		// first swap and fix main navi image (profile)
		freeFixedImage('main');
		swapImage('main', 'profilePic', 'images/haupt_navi_1/profile_a.gif', 'mainNaviLayer');
		fixImage('main', 'profilePic', 'images/haupt_navi_1/profile_ia.gif', 'mainNaviLayer');
		
		// display profile subnavi links
		displayLayers('subNaviProfileLayer');		
		fixLayer('subNaviProfileLayer');		

		activeButton = "profile";	
		
		// swap and fix subnavi element
		freeFixedImage('sub');
		swapImage('sub', 'standortePic', 'images/subnavis/profile/standorte_a.gif', 'subNaviProfileLayer');
		fixImage('sub', 'standortePic', 'images/subnavis/profile/standorte_ia.gif', 'subNaviProfileLayer');
		
		activeSubNaviButton = "standorte";			
	}
	
	
	// {{{ products subnavi links
	else if ( which == 'hardware' )
	{
		// first swap and fix main navi image (profile)
		freeFixedImage('main');
		swapImage('main', 'productsPic', 'images/haupt_navi_1/products_a.gif', 'mainNaviLayer');
		fixImage('main', 'productsPic', 'images/haupt_navi_1/products_ia.gif', 'mainNaviLayer');
		
		// display products subnavi links
		displayLayers('subNaviProductsLayer');		
		fixLayer('subNaviProductsLayer');		

		activeButton = "products";	
		
		// swap and fix subnavi element
		freeFixedImage('sub');
		swapImage('sub', 'hardwarePic', 'images/subnavis/products/hardware_a.gif', 'subNaviProductsLayer');
		fixImage('sub', 'hardwarePic', 'images/subnavis/products/hardware_ia.gif', 'subNaviProductsLayer');
		
		activeSubNaviButton = "hardware";	
	}
	
	else if ( which == 'software' )
	{
		// first swap and fix main navi image (profile)
		freeFixedImage('main');
		swapImage('main', 'productsPic', 'images/haupt_navi_1/products_a.gif', 'mainNaviLayer');
		fixImage('main', 'productsPic', 'images/haupt_navi_1/products_ia.gif', 'mainNaviLayer');
		
		// display products subnavi links
		displayLayers('subNaviProductsLayer');		
		fixLayer('subNaviProductsLayer');		

		activeButton = "products";	
		
		// swap and fix subnavi element
		freeFixedImage('sub');
		swapImage('sub', 'softwarePic', 'images/subnavis/products/software_a.gif', 'subNaviProductsLayer');
		fixImage('sub', 'softwarePic', 'images/subnavis/products/software_ia.gif', 'subNaviProductsLayer');
		
		activeSubNaviButton = "software";	
	}
	
	else if ( which == 'network' )
	{
		// first swap and fix main navi image (profile)
		freeFixedImage('main');
		swapImage('main', 'productsPic', 'images/haupt_navi_1/products_a.gif', 'mainNaviLayer');
		fixImage('main', 'productsPic', 'images/haupt_navi_1/products_ia.gif', 'mainNaviLayer');
		
		// display products subnavi links
		displayLayers('subNaviProductsLayer');		
		fixLayer('subNaviProductsLayer');		

		activeButton = "products";	
		
		// swap and fix subnavi element
		freeFixedImage('sub');
		swapImage('sub', 'networkPic', 'images/subnavis/products/network_a.gif', 'subNaviProductsLayer');
		fixImage('sub', 'networkPic', 'images/subnavis/products/network_ia.gif', 'subNaviProductsLayer');
		
		activeSubNaviButton = "network";	
	}
	
	else if ( which == 'security' )
	{
		// first swap and fix main navi image (profile)
		freeFixedImage('main');
		swapImage('main', 'productsPic', 'images/haupt_navi_1/products_a.gif', 'mainNaviLayer');
		fixImage('main', 'productsPic', 'images/haupt_navi_1/products_ia.gif', 'mainNaviLayer');
		
		// display products subnavi links
		displayLayers('subNaviProductsLayer');		
		fixLayer('subNaviProductsLayer');		

		activeButton = "products";	
		
		// swap and fix subnavi element
		freeFixedImage('sub');
		swapImage('sub', 'securityPic', 'images/subnavis/products/security_a.gif', 'subNaviProductsLayer');
		fixImage('sub', 'securityPic', 'images/subnavis/products/security_ia.gif', 'subNaviProductsLayer');
		
		activeSubNaviButton = "security";	
	}
	// products subnavi }}}
	
	// {{{ support subnavi links
	else if ( which == "itKuerzel" )
	{
		// first swap and fix main navi image (profile)
		freeFixedImage('main');
		swapImage('main', 'supportPic', 'images/haupt_navi_1/support_a.gif', 'mainNaviLayer');
		fixImage('main', 'supportPic', 'images/haupt_navi_1/support_ia.gif', 'mainNaviLayer');
		
		// display products subnavi links
		displayLayers('subNaviSupportLayer');		
		fixLayer('subNaviSupportLayer');		

		activeButton = "support";	
		
		// swap and fix subnavi element
		freeFixedImage('sub');
		swapImage('sub', 'itKuerzelPic', 'images/subnavis/support/itkuerzel_a.gif', 'subNaviSupportLayer');
		fixImage('sub', 'itKuerzelPic', 'images/subnavis/support/itkuerzel_ia.gif', 'subNaviSupportLayer');
		
		activeSubNaviButton = "itKuerzel";
	}
	else if ( which == "downloads" )
	{		
		// first swap and fix main navi image (profile)
		freeFixedImage('main');
		swapImage('main', 'supportPic', 'images/haupt_navi_1/support_a.gif', 'mainNaviLayer');
		fixImage('main', 'supportPic', 'images/haupt_navi_1/support_ia.gif', 'mainNaviLayer');
		
		// display products subnavi links
		displayLayers('subNaviSupportLayer');		
		fixLayer('subNaviSupportLayer');		

		activeButton = "support";	
		
		// swap and fix subnavi element
		freeFixedImage('sub');
		swapImage('sub', 'downloadsPic', 'images/subnavis/support/downloads_a.gif', 'subNaviSupportLayer');
		fixImage('sub', 'downloadsPic', 'images/subnavis/support/downloads_ia.gif', 'subNaviSupportLayer');
		
		activeSubNaviButton = "downloads";		
	}
	else if ( which == "news" )
	{
		// first swap and fix main navi image (profile)
		freeFixedImage('main');
		swapImage('main', 'supportPic', 'images/haupt_navi_1/support_a.gif', 'mainNaviLayer');
		fixImage('main', 'supportPic', 'images/haupt_navi_1/support_ia.gif', 'mainNaviLayer');
		
		// display products subnavi links
		displayLayers('subNaviSupportLayer');		
		fixLayer('subNaviSupportLayer');		

		activeButton = "support";	
		
		// swap and fix subnavi element
		freeFixedImage('sub');
		swapImage('sub', 'newsPic', 'images/subnavis/support/news_a.gif', 'subNaviSupportLayer');
		fixImage('sub', 'newsPic', 'images/subnavis/support/news_ia.gif', 'subNaviSupportLayer');
		
		activeSubNaviButton = "news";	
	}
	
	//set cookie to remember current position of navi and subnavi
	cookie = "sigNavi=" + activeButton + "&" + activeSubNaviButton;
	
}