function Header(lan, topic, heading, ForumMenu)
{
	var doc = document;	
	var showmenushow = false;
	var showmenu = true; 

	doc.write('<div class="page">');

	doc.write('<table border="0" cellspacing="0" cellpadding="0" style="width: 99.5%; ">');

		doc.write('<div class="page_header">');
		PageHeader(lan);
		doc.write('</div> <!-- class="page_header"-->');
		
		doc.write('<div class="page_content">');
			doc.write('<tr>');

		if ((typeof ForumMenu) != 'undefined') 
		{
			showmenushow = navigator.cookieEnabled;
			showmenu = (CookieRead("MenuForum") != 'no');
		}

		if (showmenu)
		{
			LeftColumn(lan, topic, heading, ForumMenu); 
		}

		RightColumn(lan, heading, showmenu, showmenushow);
}



function PageHeader(lan)
{
	var doc = document;	

	var url = document.URL.toString().substr(0, 5);
	var prefix = "";
	
	if (url == "https")
	{
		prefix = 'https://secure.freiwald.com';
	}
	else if (lan == 0)
	{
		prefix = '.';
	}
	else
	{
		prefix = '..';
	}

	doc.write('<tr>');
		doc.write('<td valign="bottom">');
			doc.write('<center><img align="center" title="" alt="Logo" src="' + prefix + '/images/logo.gif"></center>');
		doc.write('</td>');

		doc.write('<td valign="bottom">');
			doc.write('<center>');


			doc.write('<div style="position:relative; top:+8px">');
			Logo();
			doc.write('</div>');	

			doc.write('<b style="color: rgb(59, 127, 244);"><font face="Arial,Helvetica"><font	size="-1"><br>');

			if (lan == 2)
			{
				doc.write('Software f&uuml;r perfekt gesteuerte Modelleisenbahnen');
			}
			else
			{
				doc.write('Software for perfectly controlled Model Railroads');
			}
			doc.write('<br><br>');
			doc.write('</font></font></b>');

			doc.write('<div class="menu_right">');
			MenuRight(lan);
			doc.write('</div>');

		doc.write('</td>');
	doc.write('</tr>');
}




function MenuRight(lan)
{
	var doc = document;	
	doc.write('<table width="95%" cellspacing="0" cellpadding="0"><tr>');

	var url = document.URL.toString().substr(0, 5);
	var prefix = '';

	if (lan == 2)
	{
		doc.write('<colgroup width="12%" span="8"></colgroup>');
		prefix = (url == "https") ? 'http://www.freiwald.com/seiten/' : '../seiten/';
	}
	else if (lan == 0)
	{
		doc.write('<colgroup width="14%" span="7"></colgroup>');
		prefix = (url == "https") ? 'http://www.freiwald.com/pages/' : 'pages/';
	}	
	else
	{
		doc.write('<colgroup width="14%" span="7"></colgroup>');
		prefix = (url == "https") ? 'http://www.freiwald.com/pages/' : '../pages/';
	}

	MenuRightEntry((lan <= 1)? "Home"							: "Hauptseite",						prefix + "index.html"); 
	MenuRightEntry((lan <= 1)? "Getting Started"				: "Erste Schritte",					prefix + "start.htm"); 
	MenuRightEntry((lan <= 1)? "Products"						: "Produkte",						prefix + "overview.htm"); 
	MenuRightEntry((lan <= 1)? "Download"						: "Download",						prefix + "download.htm"); 
	MenuRightEntry((lan <= 1)? "Shop"							: "Shop",							prefix + "register.htm"); 
	MenuRightEntry((lan <= 1)? "Terms & Conditions"				: "AGB",							prefix + "agb.htm"); 

	if (lan == 2)
	{
		MenuRightEntry("Forum",	prefix + "../forum?language=german"); 
	}
	else
	{
		MenuRightEntry("Forum",	prefix + "../forum?language=english"); 
	}

	MenuRightEntry((lan <= 1)? "Contact"						: "Impressum",						prefix + "contact.htm"); 

	doc.write('</tr></table>');
}


function LeftColumn(lan, topic, heading, ForumMenu)
{
	var doc = document;	

	doc.write('<td class="page_left" valign ="top">');

	doc.write('<div class="left_header">');
	doc.write('</div> <!-- class="left_header"-->');

	doc.write('<div class="left_menu">');
		Menu(lan, ForumMenu); 
	doc.write('</div> <!-- class="left_menu"-->');

	Splash(lan, topic);
	ShowHits(lan);

	doc.write('</td> <!-- class="page_left"-->');
}



function Menu(lan, ForumMenu)
{
	var doc = document;	

	var url = document.URL.toString().substr(0, 5);
	var prefix = '';

	if (lan == 2)
	{
		prefix = (url == "https") ? 'http://www.freiwald.com/seiten/' : '../seiten/';
	}
	else if (lan == 0)
	{
		prefix = (url == "https") ? 'http://www.freiwald.com/pages/' : 'pages/';
	}
	else
	{
		prefix = (url == "https") ? 'http://www.freiwald.com/pages/' : '../pages/';
	}

	if ((typeof ForumMenu) != 'undefined')
	{
		doc.write('<div class="menu_forum">');

		MenuTitle((lan == 1)? 'Forum' : 'Forum');
		doc.write(ForumMenu);

		doc.write('</div> <!-- class="menu_forum"-->');
	}

	doc.write('<div class="menu_products">');

	MenuTitle((lan <= 1)? 'Products' : 'Produkte');

	MenuEntry((lan <= 1)? "TrainController&#8482;"				: "TrainController&#8482;",				prefix + "traincontroller.htm"); 
	MenuEntry((lan <= 1)? "Network +Net&#8482;"					: "Netzwerk +Net&#8482;",				prefix + "network.htm"); 
	MenuEntry((lan <= 1)? "Sound +4DSound&#8482;"				: "Sound +4DSound&#8482;",				prefix + "sound.htm"); 
	MenuEntry((lan <= 1)? "Handheld Control +SmartHand&#8482;"	: "Handsteuerung +SmartHand&#8482;",	prefix + "handheld.htm"); 
	MenuEntry((lan <= 1)? "TrainProgrammer&#8482;"				: "TrainProgrammer&#8482;",				prefix + "trainprogrammer.htm"); 
	MenuEntry((lan <= 1)? "Rocomotion&#8482;"					: "Rocomotion&#8482;",					prefix + "rocomotion.htm"); 

	doc.write('</div> <!-- class="menu_products"-->');

	doc.write('<div class="menu_news">');

	MenuTitle((lan <= 1)? 'News' : 'Aktuelles');

	if (lan <= 1)
	{
		MenuEntry("Latest Announcements", prefix + "../forum/viewforum.php?f=10&language=english"); 
	}
	else
	{
		MenuEntry("Neueste Ank&uuml;ndigungen", prefix + "../forum/viewforum.php?f=11&language=german"); 
	}

	MenuEntry((lan <= 1)? "Recent Changes"					: "Letzte &Auml;nderungen",				prefix + "history.htm"); 
	MenuEntry((lan <= 1)? "Version History"					: "Programmversionen",				prefix + "history2.htm"); 

	doc.write('</div> <!-- class="menu_news"-->');

	doc.write('<div class="menu_shop">');

	MenuTitle((lan <= 1)? 'Online Shop' : 'Online-Shop');

	MenuEntry((lan <= 1)? "Ordering & Pricing"				: "Bestellung & Preise",			prefix + "register.htm"); 
	MenuEntry((lan <= 1)? "Upgrade License"					: "Upgrade-Lizenz",					prefix + "upgrade.htm"); 

	if (lan <= 1)
	{
		MenuEntry("Your Shopping Cart", "https://secure.freiwald.com/pages/cart.htm"); 
	}
	else
	{
		MenuEntry("Ihr Warenkorb", "https://secure.freiwald.com/seiten/cart.htm"); 
	}

	doc.write('</div> <!-- class="menu_shop"-->');

	doc.write('<div class="menu_links">');

	MenuTitle('Links');

	MenuEntry((lan <= 1)? "References"						: "Referenzen",						prefix + "references.htm"); 
	MenuEntry((lan <= 1)? "Digital Systems"					: "Digitalsysteme",					prefix + "hardware.htm"); 

	if (lan == 2)
	{
		MenuEntry("Rat & Tat",					prefix + "references.htm#Rat_und_Tat"); 
	}	

	MenuEntry((lan <= 1)? "Dealers"							: "H&auml;ndler",						prefix + "dealerlist.htm"); 

	doc.write('</div> <!-- class="menu_links"-->');
}

function MenuHide()
{
	CookieWrite("MenuForum", "no", 3*24*60*60*1000);
	location.reload();
}

function MenuShow()
{
	CookieWrite("MenuForum", "yes", 3*24*60*60*1000);
	location.reload();
}

function MenuTitle(Title)
{
	var doc = document;	

	doc.write('<div class="menu_title">');
		doc.write(Title);
	doc.write('</div> <!-- class="menu_title"-->');

}

function MenuEntry(Text, Url)
{
	var doc = document;	

	doc.write('<li>');
	doc.write('<a class="menu_entry" href="' + Url + '">' + Text + '</a>');
	doc.write('</li>');
}



function MenuRightEntry(Text, Url)
{
	var doc = document;	

	doc.write('<td align="left" nowrap ><div><a href="' + Url + '">' + Text + '</a></div></td>');
}


function BreakingNews(lan)
{
	return;

	var doc = document;	

	doc.write('<div class="page_right_wrapper"><table class="page_right" cellspacing="10" width="100%">');
	doc.write('<tr>');

	doc.write('<tr>');

/*
		doc.write('<td valign="bottom">');
		doc.write('<img align="center" title="" alt="Christmas" src="../images/christmas/christmas_l.jpg" style="height: 2cm;">');
		doc.write('</td>');
*/
/*
		doc.write('<td valign="middle">');
		doc.write('<img align="center" title="" alt="bronze" src="../images/bronze.jpg" >');
		doc.write('<img align="center" title="" alt="Silver" src="../images/silver.jpg">');
		doc.write('<img align="center" title="" alt="gold" src="../images/gold.jpg">');
		doc.write('</td>');
*/
		doc.write('<td width="100%" align="center">');

			doc.write('<font color="red" style="font-family:\'Arial\'; font-size:11pt;"><b>');

/*
			if (lan==2)
			{
				doc.write('<br>Wir wünschen allen Anwendern, Freunden und Geschäftspartnern mit Ihren Familien<br>ein fröhliches Weihnachtsfest<br>und einen guten Start in ein gesundes und erfolgreiches Neues Jahr !');
			}	
			else
			{
				doc.write('<br>We wish all users, friends and partners<br>Merry Christmas<br>and a Happy New Year !');
			}

*/
/*
			if (lan==2)
			{
				doc.write('<a href="../seiten/announcement70.htm" align="left" style="color:red; text-decoration:underline;">Endlich!<br>Version 7 ist da!!!</a>');

			}	
			else
			{
				doc.write('<a href="../pages/announcement70.htm" align="left" style="color:red; text-decoration:underline;">Finally!<br>Version 7 is available!!!</a>');
			}
*/
			if (lan==2)
			{
				doc.write('Unser Büro ist vom 20. August bis 30. August geschlossen.<br>Alle in diesem Zeitraum eingehenden Bestellungen werden danach so schnell wie möglich bearbeitet.<br>Vielen Dank für Ihr Verständnis.');
			}	
			else
			{
				doc.write('Our office is closed between August 20 and August 30.<br>All orders received during this period will be processed as soon as possible thereafter.<br>Thank you very much for your understanding.');			}
			doc.write('</font>');

		doc.write('</td> <!-- class="right_header"-->');

/*
		doc.write('<td valign="bottom">');
		doc.write('<img align="center" title="" alt="Christmas" src="../images/christmas/christmas_r.jpg" style="height: 2cm;">');
		doc.write('</td>');
*/
/*
		doc.write('<td valign="middle">');
		doc.write('<img align="center" title="" alt="gold" src="../images/gold.jpg" >');
		doc.write('<img align="center" title="" alt="Silver" src="../images/silver.jpg" >');
		doc.write('<img align="center" title="" alt="bronze" src="../images/bronze.jpg" >');
		doc.write('</td>');
*/

	doc.write('</tr>');
	doc.write('</table>');	
	doc.write('</div>');	
}


function RightColumn(lan, heading, showmenu, showmenushow)
{
	var doc = document;	
	var url = document.URL.toString().substr(0, 5);
	var link = '';
	var image = '';

	if (showmenu)
	{
		doc.write('<td valign ="top">');
	}
	else
	{
		doc.write('<td valign ="top" colspan="2">');
	}

	BreakingNews(lan);
	
	doc.write('<div class="page_right_wrapper"><table class="page_right" cellspacing="10" width="100%">');

	if ((typeof heading) != 'undefined')
	{
		doc.write('<tr>');
			doc.write('<td class="right_header" width="100%">');
			doc.write(heading);
			doc.write('</td> <!-- class="right_header"-->');

			if (showmenushow)
			{
				doc.write('<td>');

				if (showmenu)
				{
					doc.write('<a href="' + document.URL.toString() + '" onclick="MenuHide()">' + ((lan <= 1) ? 'Hide Menu' : 'Menü verbergen') + '</a>');
				}
				else
				{	
					doc.write('<a href="' + document.URL.toString() + '" onclick="MenuShow()">' + ((lan <= 1) ? 'Show Menu' : 'Menü anzeigen') + '</a>');
				}

				doc.write('</td>');
			}

			doc.write('<td>');

			if (lan == 2)
			{
				link = (url == "https") ? 'https://secure.freiwald.com/pages/' : '../pages/';
				image = link + '../images/german.gif';
			}
			else if (lan == 0)
			{
				link = (url == "https") ? 'https://secure.freiwald.com/seiten/' : 'seiten/';
				image = link + '../images/english.gif';
			}
			else
			{
				link = (url == "https") ? 'https://secure.freiwald.com/seiten/' : '../seiten/';
				image = link + '../images/english.gif';
			}
			
			doc.write('<img src="' + image + '" alt="Language" border="0" />');
			doc.write('</td>');
		doc.write('</tr>');
	}

	doc.write('<tr><td colspan="3" class="right_content" cellspacing="0" cellpadding="0">');
}



function RightFooter(lan)
{
	var doc = document;	

	var url = document.URL.toString().substr(0, 5);
	var prefix = '';

	doc.write('<div class="right_footer">');
	doc.write('<center><table width="95%"><tr>');

	if (lan == 2)
	{
		doc.write('<colgroup width="20%" span="5"></colgroup>');
		prefix = (url == "https") ? 'http://www.freiwald.com/seiten/' : '../seiten/';
	}
	else
	{
		doc.write('<colgroup width="20%" span="5"></colgroup>');
		prefix = (url == "https") ? 'http://www.freiwald.com/pages/' : '../pages/';
	}

	MenuRightEntry((lan != 2)? "Contact"						: "Impressum",						prefix + "contact.htm"); 
	MenuRightEntry((lan != 2)? "Privacy Statement"						: "Datenschutzerkl&auml;rung",						prefix + "privacy.htm"); 

	doc.write('<td nowrap>Copyright &copy; 2009 Freiwald Software</td>');

	if (lan != 2)
	{
		doc.write('<td nowrap>Revised: 17/06/2010</td>');
		MenuRightEntry("Terms & Conditions", prefix + "agb.htm"); 
	}		
	else
	{
		doc.write('<td nowrap>Stand: 17.06.2010</td>');
		MenuRightEntry("AGB", prefix + "agb.htm"); 
	}

	var image = '';
	var link = '';

	doc.write('<td width="1%">');

	if (lan == 2)
	{
		link = (url == "https") ? 'https://secure.freiwald.com/pages/' : '../pages/';
		image = link + '../images/englishsmall.gif';
	}
	else if (lan == 0)
	{
		link = (url == "https") ? 'https://secure.freiwald.com/seiten/' : 'seiten/';
		image = link + '../images/germansmall.gif';
	}
	else
	{
		link = (url == "https") ? 'https://secure.freiwald.com/seiten/' : '../seiten/';
		image = link + '../images/germansmall.gif';
	}

	var strName = window.location.href
	var nIndex = strName.lastIndexOf('/');

	if (nIndex >= 0)
	{
		strName = strName.substr(nIndex + 1);
	}
	else
	{
		strName = "index.html";
	}
	
	doc.write('<a href="' + link + strName + '" align="left"><img src="' + image + '" alt="Language" border="0"/></a>');
	doc.write('</td>');

	doc.write('</tr></table></center>');
	doc.write('</div>');
}


function Logo()
{
	var doc = document;	

	doc.write('<center><b>');
	doc.write('<font style="font-family:\'Arial\'; font-size:36pt; color: #3b7ff4;">R</font>');
	doc.write('<font style="font-family:\'Arial\'; font-size:30pt; color: #44A844;">AIL</font>');
	doc.write('<font style="font-family:\'Arial\'; font-size:36pt; color: #3b7ff4;">R</font>');
	doc.write('<font style="font-family:\'Arial\'; font-size:30pt; color: #44A844;">OAD </font>');
	doc.write('<font style="font-family:\'Arial\'; font-size:36pt; color: #3b7ff4;"> & C</font>');
	doc.write('<font style="font-family:\'Arial\'; font-size:30pt; color: #3b7ff4;">O.</font>');
	doc.write('</b>');
	doc.write('<font valign="top" style="font-family:\'Arial\'; font-size:10pt; color: #44A844; position:relative; top:-26px">®</font>');
	doc.write('</center>');
}


function Footer(lan)
{
	var doc = document;	

						doc.write('</td></tr> <!-- class="right_content"-->');
					doc.write('</table></div>	<!-- class="page_right" -->');

					RightFooter(lan);

				doc.write('</td>');
			doc.write('</tr></table>');
		doc.write('</div> <!-- class="page_content"-->');

		doc.write('<div class="page_footer>');
		doc.write('</div> <!-- class="page_footer"-->');

	doc.write('</div>	<!-- class="page" -->');
}

/****************************************************************************************************/
/*																									*/
/* The splash boxes																					*/
/*																									*/
/****************************************************************************************************/


function SplashContent(upper, lower)
{
	var doc = document;	

	doc.write('<table align="center" valign="middle">');
	doc.write('<tr id="splash_upper"><td height="60px" align="center" valign="middle"><span class="splash_upper_font">');
	doc.write(upper);
	doc.write('</span></td></tr>');

	doc.write('<tr><td height="70px">');
	doc.write('</td></tr>');

	doc.write('<tr id="splash_lower"><td height="110px" align="center" valign="middle"><span class="splash_lower_font">');
	doc.write(lower);
	doc.write('</span></td></tr>');

	doc.write('</table>');
}


function Splash(lan, topic)
{
	var doc = document;	

	if(topic==0)
	{
		topic = (Math.round(Math.random() * 10)) % 10;	
	}

//	doc.write('<div class="menu_splash" style="background-image:url(../images/splash' + topic.toString() + '.jpg); background-repeat:no-repeat; background-position: center top">');

	var strUrl = document.URL.toString().substr(0, 5);
	var strPrefix = "";
	
	if (strUrl == "https")
	{
		strPrefix = 'https://secure.freiwald.com';
	}
	else if (lan == 0)
	{
		strPrefix = '.';
	}
	else
	{
		strPrefix = '..';
	}

	strUrl = strPrefix + '/images/splash' + '0' + (Math.round(Math.random() * 10)) % 10 + '.jpg';

	doc.write('<div class="menu_splash" style="background-image:url(' + strUrl + '); background-repeat:no-repeat; background-position: center top">');

	if (lan==1)
	{	
		switch(topic)
		{	
		// product specific messages:	

			case 1:
			{ 
				SplashContent('TrainController<span class="TM">&#8482;</span>', 'The leading software for Model Railroad Computer Control!');
				break;
			}
			case 2:
			{ 
				SplashContent('TrainProgrammer<span class="TM">&#8482;</span>', 'For all DCC-, Selectrix- and LocoNet compatible Decoder and Devices!');
				break;
			}

		// common messages:	

			case 0:
			default:
			{ 
				SplashContent('TrainController<span class="TM">&#8482;</span>', 'The leading software for Model Railroad Computer Control!');
				break;
			}
			case 3:
			{ 
				SplashContent('TrainController<span class="TM">&#8482;</span>', 'Award Winning!');
				break;
			}
			case 4:
			{ 
				SplashContent('TrainProgrammer<span class="TM">&#8482;</span>', 'For all DCC-, Selectrix- and LocoNet compatible Decoder and Devices!');
				break;
			}
			case 5:
			{ 
				SplashContent('RAILROAD & CO.<BR>Forum', 'About<BR>7000<BR>Members!');
				break;
			}
			case 6:
			{ 
				SplashContent('TrainController<span class="TM">&#8482;</span><BR>+Net<span class="TM">&#8482;</span>', 'Control your layout in a network with several computers!');
				break;
			}
			case 7:
			{ 
				SplashContent('TrainController<span class="TM">&#8482;</span><BR>+4DSound<span class="TM">&#8482;</span>', 'Realistic multi train/<BR>multi channel surround sound for your trains!');
				break;
			}
			case 8:
			{ 
				SplashContent('RAILROAD & CO.', 'New:<BR>Version 7!');
				break;
			}
			case 9:
			{ 
				SplashContent('RAILROAD & CO.', 'Order all programs conveniently on the Internet!');
				break;
			}
		}	
	}
	else
	{
		switch(topic)
		{	
		// product specific messages:	

			case 1:
			{ 
				SplashContent('TrainController<span class="TM">&#8482;</span>', 'Das führende Programm zur Steuerung von Modellbahnen!');
				break;
			}
			case 2:
			{ 
				SplashContent('TrainProgrammer<span class="TM">&#8482;</span>', 'Für alle DCC-, Selectrix- und LocoNet- kompatiblen Decoder und Geräte!');
				break;
			}

		// common messages:	

			case 0:
			default:
			{ 
				SplashContent('TrainController<span class="TM">&#8482;</span>', 'Das führende Programm zur Steuerung von Modellbahnen!');
				break;
			}
			case 3:
			{ 
				SplashContent('TrainController<span class="TM">&#8482;</span>', 'Als Testsieger ausgezeichnet!');
				break;
			}
			case 4:
			{ 
				SplashContent('TrainProgrammer<span class="TM">&#8482;</span>', 'Für alle DCC-, Selectrix- und LocoNet- kompatiblen Decoder und Geräte!');
				break;
			}
			case 5:
			{ 
				SplashContent('RAILROAD & CO.<BR>Forum', 'Ungefähr 7000 Mitglieder!');
				break;
			}
			case 6:
			{ 
				SplashContent('TrainController<span class="TM">&#8482;</span><BR>+Net<span class="TM">&#8482;</span>', 'Steuern Sie Ihre Anlage im Netzwerk mit mehreren Computern!');
				break;
			}
			case 7:
			{ 
				SplashContent('TrainController<span class="TM">&#8482;</span><BR>+4DSound<span class="TM">&#8482;</span>', 'Realistischer Mehrzug-/<BR>Mehrkanal-Sound<BR>für jede Modellbahn!');
				break;
			}
			case 8:
			{ 
				SplashContent('RAILROAD & CO.', 'Jetzt neu:<BR>Version 7!');
				break;
			}
			case 9:
			{ 
				SplashContent('RAILROAD & CO.', 'Alle Produkte bequem über Internet zu bestellen!');
				break;
			}
		}	
	}

	doc.write('</div> <!-- class="menu_splash"-->');
}


/****************************************************************************************************/
/*																									*/
/* hit counter																						*/
/*																									*/
/****************************************************************************************************/



function ShowHits(nLan)
{
	return;		// disabled for the time being

	if (!navigator.cookieEnabled)
	{
		return;
	}

	var url = document.URL.toString().substr(0, 5);
	
	if (url == "https")
	{
		return;
	}	

	var doc = document;

	if (!IsMyself() && (CookieRead("ShowClusterMap") != 'no'))
	{
		doc.write('<a href="http://www2.clustrmaps.com/counter/maps.php?url=http://www.freiwald.com" id="clustrMapsLink"><img src="http://www2.clustrmaps.com/counter/index2.php?url=http://www.freiwald.com" style="border:0px solid; width: 1px;" alt="Locations of visitors to this page" title="Locations of visitors to this page" id="clustrMapsImg" onError="this.onError=null; this.src=\'http://clustrmaps.com/images/clustrmaps-back-soon.jpg\'; document.getElementById(\'clustrMapsLink\').href=\'http://clustrmaps.com\'" /></a>');
	}

//	if (IsMyself())
	{
		doc.write('<div class="box_hits"><center>');
//		doc.write((nLan == 2) ? 'Woher kommen unsere Besucher?' : 'Where our visitors come from:');

		doc.write('<a href="http://www2.clustrmaps.com/counter/../stats/maps-clusters/www.freiwald.com-world.jpg" id="clustrMapsLink" target="_blank"><img src="http://www2.clustrmaps.com/stats/maps-clusters/www.freiwald.com-thumb.jpg" style="border:0px solid; width: 159px;" alt="Locations of visitors to this page" title="Locations of visitors to this page" id="clustrMapsImg" onError="this.onError=null; this.src=\'http://clustrmaps.com/images/clustrmaps-back-soon.jpg\'; document.getElementById(\'clustrMapsLink\').href=\'http://clustrmaps.com\'" /></a><br>');

		doc.write('<small>');
//		doc.write((nLan == 2) ? 'Zum Vergr&ouml;ssern<br>Landkarte anklicken.' : 'Click to map for larger image.');
		doc.write('</small>');
		doc.write('</center></div> <!-- class="box_hits"-->');
	}	

	CookieWrite("ShowClusterMap", "no", 30*60*1000);
}


/****************************************************************************************************/
/*																									*/
/* Cookie helper functions																			*/
/*																									*/
/****************************************************************************************************/


function CookieWrite(name, value, expires)
{
	var cook = name + '=' + value + ';path=/';

	if ((typeof expires) != 'undefined')
	{
		var a = new Date();
		a = new Date(a.getTime() + expires);
		cook = cook + ';expires=' + a.toGMTString() + ';';
	}

	document.cookie = cook;
}

function CookieRead(name)
{
	var a = document.cookie;

	var res = '';
	while(a != '')
	{
		var cookiename = a.substring(0,a.search('='));
		
		var n = a.search(';');

		if (n < 0)	
		{
			n = a.length;
		}

		var cookiewert = a.substring(a.search('=')+1, n);

		while (cookiename.substring(0, 1) == ' ')
		{
			cookiename = cookiename.substring(1);
		}

		if(name == cookiename)
		{
			res = cookiewert;
			a = '';
		}
		else
		{
			var i = a.search(';')+1;
			if(i == 0){i = a.length}
			a = a.substring(i,a.length);
		}
	}

	return(res)
}


/****************************************************************************************************/
/*																									*/
/* "Pseudo Session Var" helper functions															*/
/*																									*/
/****************************************************************************************************/

function SessionRead(name)
{
	var strSession = CookieRead('SESSION');
	var aSession = strSession.split(' ');

	for (var i = 0; i < aSession.length; i += 2)
	{
		if (aSession[i] == name)
		{
			return decodeURI(aSession[i + 1]);
		}
	}

	return '';
}


function SessionWrite(name, value)
{
	var strSession = CookieRead('SESSION');
	var aSession = strSession.split(' ');

	for (var i = 0; i < aSession.length; i += 2)
	{
		if (aSession[i] == name)
		{
			if (value != '')
			{
				aSession[i+1] = encodeURI(value);
			}
			else
			{
				aSession.splice(i, 2);
			}
						
			break;
		}
	}

	if ((i >= aSession.length) && (value != ''))
	{
		aSession[i] = name;
		aSession[i+1] = encodeURI(value);		
	}

	strSession = aSession.join(' ');
	CookieWrite('SESSION', strSession, 30*60*1000);

	if ((value != '') && (SessionRead(name) == ''))
	{
		if (CalcLanguage() == 2)
		{
			alert("Achtung: die Benutzung von Cookies muss eingeschaltet sein,\nda unser Shopsystem sonst nicht funktioniert.");
		}
		else
		{
			alert("Attention: the use of cookies must be enabled,\notherwise our shop system will not work.");
		}

		return;
	}
}


/****************************************************************************************************/
/*																									*/
/* Param line helper functions																			*/
/*																									*/
/****************************************************************************************************/



function ParameterRead(name)
{
	var a = location.href;

	var n = -1;

	for (var c = 0; c < a.length; c++)
	{
		if (a.substring(c, c+1) == '?')
		{
			n = c;
			break;
		}
	
	}

	if (n < 0)
	{
		return '';
	}

	a = a.substring(n+1,a.length);

	var res = '';
	while(a != '')
	{
		var cookiename = a.substring(0,a.search('='));
		
		var n = a.search('\&');

		if (n < 0)	
		{
			n = a.length;
		}

		var cookiewert = a.substring(a.search('=')+1, n);

		while (cookiename.substring(0, 1) == ' ')
		{
			cookiename = cookiename.substring(1);
		}

		if(name == cookiename)
		{
			res = cookiewert;
			a = '';
		}
		else
		{
			var i = a.search('&')+1;
			if(i == 0){i = a.length}
			a = a.substring(i,a.length);
		}
	}

	for (var c = 0; c < res.length; c++)
	{
		if (res.substring(c, c+1) == '+')
		{
			res = res.substring(0, c) + ' ' + res.substring(c + 1, res.length);
		}
	
	}

	return unescape(res);
}


function InputRead(name)
{
	var strRes = ParameterRead(name);

	if (strRes == '')
	{
		strRes = SessionRead(name);
	}

	if (strRes == '')
	{
		strRes = CookieRead(name);
	}

	return strRes;
}




function WriteHiddenParam(strParam, strValue)
{
	if ((typeof strValue) == 'undefined')
	{
		strValue = InputRead(strParam);
	}

	document.write('<input type="hidden" name="' + strParam + '" value="' + strValue + '">');
}


/****************************************************************************************************/
/*																									*/
/* misc helper functions																			*/
/*																									*/
/****************************************************************************************************/


function CalcLanguage()
{
	if (location.href.indexOf("seiten") >= 0)
	{
		return 2;
	}

	return 0;
}



function IsLocalTest()
{
	return (document.URL.toString().substr(0, 4) == 'file');
}


function ForwardToSecure()
{	
	var strHref = location.href;
	var strUrl = "http://www";	

	if (strHref.substring(0, strUrl.length) == strUrl)
	{
		location.href = "https://secure" + strHref.substring(strUrl.length);
	}
}



function IsMyself()
{
	var strMyself = ParameterRead('myself');

	if (strMyself == '1')
	{
		CookieWrite("MySelf", "yes", 10*365*24*60*60*1000); 
		return true;
	}	
	else if (strMyself == '0')
	{
		CookieWrite("MySelf", "no", 10*365*24*60*60*1000); 
		return false;
	}

	if (CookieRead("MySelf") == 'yes')
	{
		return true;
	}	

	return false;
}


function isalpha(c)
{
	if (('A' <= c) && (c <= 'Z'))
	{
		return true;
	}

	if (('a' <= c) && (c <= 'z'))
	{
		return true;
	}

	return false;
}


function isdigit(c)
{
	if (('0' <= c) && (c <= '9'))
	{
		return true;
	}

	return false;
}


function isalnum(c)
{
	return (isdigit(c) || isalpha(c));
}
