// BROWSERWEICHE START
	var DHTML = 0, DOM = 0, MS = 0, NS = 0, OP = 0, what = '';
	function DHTML_init()
	{
	
	  if (window.opera)
	  {
		OP = 1;
	  }
	  if(document.getElementById)
	  {
		DHTML = 1;
		DOM = 1;
	  }
	  if(document.all && !OP)
	  {
		DHTML = 1;
		MS = 1;
	  }
	  if(document.layers && !OP)
	  {
	   DHTML = 1;
	   NS = 1;
	  }
	}
	
	DHTML_init();

// BROWSERWEICHE END

// FONT SWITCH START

	var fontStepMin = 0; 
	var fontStepMax = 5; 
	var fontStepCur = 0; 
	var tempFontSize;
	
	
	
	var elementBasicFontSizes = new Array();
	elementBasicFontSizes["p"] = 13; // px
	elementBasicFontSizes["li"] = 13; // px
	elementBasicFontSizes["h1"] = 21; // px
	elementBasicFontSizes["h2"] = 15; // px
	elementBasicFontSizes["h3"] = 13; // px
	
	function setButtonVisibility(mode)
	{	
		var buttonId;		
		if(mode == "min") { buttonId = "fontSwitchDown"; }
		if(mode == "max") { buttonId = "fontSwitchUp"; }
		window.document.getElementById(buttonId).style.visibility = "hidden";
	}
	
	function readCookieAndsetFontSize()
	{
		var contentElements = window.document.getElementById("contentElements");
		if(document.cookie)
		{
			a = document.cookie;		
			cookieName = a.substr(0,a.search('='));		
			cookieValue = a.substr(a.search('=')+1, a.search(';'));
			if(a.search(';') == -1)
			{
				cookieValue = a.substr(a.search('=')+1,a.length);
			}		
			fontStepCur = cookieValue * 1;
			
			for( var index in elementBasicFontSizes)
			{						
				for ( i= 0 ; i < contentElements.getElementsByTagName(index).length ; i++)
				{
					tempFontSize = elementBasicFontSizes[index] + fontStepCur;					
					contentElements.getElementsByTagName(index)[i].style.fontSize = tempFontSize + "px" ;
				}	
			}
		}
	}
	
	function changeFontSize(mode)
	{
			fontStepCur = (fontStepCur + mode) *1;	
			document.cookie = "fontStepCur=" + fontStepCur;
			
			var contentElements = window.document.getElementById("contentElements");	
			var buttonDownVisibility;
			var buttonUpVisibility;			
			
			if(fontStepCur <= fontStepMax && fontStepCur >= fontStepMin)
			{	
				for( var index in elementBasicFontSizes)
				{						
					for ( i= 0 ; i < contentElements.getElementsByTagName(index).length ; i++)
					{
						tempFontSize = elementBasicFontSizes[index] + fontStepCur;					
						contentElements.getElementsByTagName(index)[i].style.fontSize = tempFontSize + "px" ;
					}	
				}
			}
			if(fontStepCur > fontStepMax) { fontStepCur = fontStepMax; } 
			if(fontStepCur < fontStepMin) { fontStepCur = fontStepMin; }
			
			if(fontStepCur >= fontStepMax)
			{
				// + ausblenden				
				buttonUpVisibility = "hidden";
			}
			else if(fontStepCur < fontStepMax)
			{
				// + ausblenden				
				buttonUpVisibility = "visible";
			}
			if(fontStepCur <= fontStepMin)
			{
				// - ausblenden	
				buttonDownVisibility = "hidden";
			}
			else if(fontStepCur > fontStepMin)
			{
				// + ausblenden				
				buttonDownVisibility = "visible";
			}
			window.document.getElementById("fontSwitchUp").style.visibility = buttonUpVisibility;
			window.document.getElementById("fontSwitchDown").style.visibility = buttonDownVisibility;		
	}
	
	// onload = setButtonVisibility;
	// onload = readCookieAndsetFontSize;
	
	function loadSettings()
	{	
		readCookieAndsetFontSize();
		if(fontStepCur == fontStepMin) { setButtonVisibility('min'); }
		if(fontStepCur == fontStepMax) { setButtonVisibility('max'); }
	}
	
	onload = loadSettings;
	
// FONT SWITCH END

// TELL A FRIEND START
	function mailPageLink()
	{
		var mailString = "";		
		mailString = "mailto:?subject= Interessante Seite gefunden: " + document.title;
		mailString += "&body=Vielleicht ist folgende Seite interessant: " + document.title + ". ";
		mailString += "Hier ist der Link: " + document.URL;				
		// mailString = encodeURI(mailString);		
		location.href = mailString;		
	}
// TELL A FRIEND END

// BOOKMARK PAGE START
	function bookmarkPage()
	{
		
		if(MS)
		{
			window.external.AddFavorite(document.URL, document.title);
		}
		else
		{
			// window.sidebar.addPanel(document.title, document.URL, '')
			window.external.addPanel(document.title, document.URL, '')
		}		
	}
// BOOKMARK PAGE END

function createJsToolbar()
{
	
	// SEITZEICHEN SOCIAL BOOKMARKS START
		document.write(' <!-- Seitzeichen --> ');
		document.write(' <script type="text/javascript"> ');
		document.write(' var szu=encodeURIComponent(location.href); ');		
		document.write(" var szt=encodeURIComponent(document.title).replace(/\'/g,'`'); "); 
		document.write(" var szjsh=(window.location.protocol == 'https:'?'https://ssl.seitzeichen.de/':'http://w3.seitzeichen.de/'); ");
		document.write(' </script> ');		
		document.write(unescape("%3Cscript src='" + szjsh + "w/9d/7a/widget_9d7aa81fd4b1baa4c4cee748ac21931a.js' type='text/javascript'%3E%3C/script%3E"));		
		
		document.write(' <!-- Seitzeichen --> ');
	// SEITZEICHEN SOCIAL BOOKMARKS END
	
	
	var bookmarkPage = '<a href="javascript:void(0);" onclick="bookmarkPage();"><img src="layout/bookmarkPage.gif" alt="Diese Seite zu den Favoriten hinzuf&uuml;gen" title="Diese Seite zu den Favoriten hinzuf&uuml;gen" width="15" height="15" border="0"></a>';

	var mailPageLink = '<a href="javascript:void(0);" onclick="mailPageLink();"><img src="layout/tellAFriend.gif" alt="Link zu dieser Seite mailen" title="Link zu dieser Seite mailen" width="15" height="15" border="0"></a>';
	
	var fontSwitchUp = '<a href="javascript:void(0);" onclick="changeFontSize(1);" id="fontSwitchUp"><img src="layout/fontSizeUp.gif" alt="Schrift vergr&ouml;&szlig;ern" title="Schrift vergr&ouml;&szlig;ern" width="15" height="15" border="0"></a>';
    var fontSwitchDown = '<a href="javascript:void(0);" onclick="changeFontSize(-1);" id="fontSwitchDown"><img src="layout/fontSizeDown.gif" alt="Schrift verkleinern" title="Schrift verkleinern" width="15" height="15" border="0"></a>';
	
	var printPage = '<a href="javascript:void(0);" onclick="javascript:window.print();"><img src="iconsImg/print_icon.gif" alt="Diese Seite drucken" title="Diese Seite drucken" width="15" height="15" border="0"></a>';
	
	document.write("|");
	if(!OP)
	{
		document.write(bookmarkPage);
		document.write("|");
	}
	document.write(mailPageLink);
	document.write("|");
	document.write(fontSwitchUp);
	document.write(fontSwitchDown);
	document.write("|");
	document.write(printPage);
	document.write("|");
}
