	function setLanguage()
	{
		document.countryselector.Language.value=document.countryselector.Country.options[document.countryselector.Country.selectedIndex].value;
		if (document.countryselector.Language.value.length > 5)
		{
			window.location.href = document.countryselector.Language.value;
		}
		else
		{
			document.countryselector.submit();
		}
	}
	
	function focusWebcode()
	{
		if( document.webcodeform.NodeID.value == "WebCode..." )
		{
			document.webcodeform.NodeID.value = "";
		}
	}
	
	function blurWebcode()
	{
		if( document.webcodeform.NodeID.value == "" )
		{
			document.webcodeform.NodeID.value = "WebCode...";
		}
	}
	
	function submitWebcode()
	{
		if( !( ( document.webcodeform.NodeID.value == "WebCode..." )
			|| ( document.webcodeform.NodeID.value == "" ) ) )
		{
			document.webcodeform.submit();
		}
	
	}
	
		function focusPinCode()
	{
		if( document.pincodeform.PinCode.value == "PinCode..." )
		{
			document.pincodeform.PinCode.value = "";
		}
	}
	
	function blurPinCode()
	{
		if( document.pincodeform.PinCode.value == "" )
		{
			document.pincodeform.PinCode.value = "PinCode...";
		}
	}
	
	function submitPinCode()
	{
		if( !( ( document.pincodeform.PinCode.value == "PinCode..." )
			|| ( document.pincodeform.PinCode.value == "" ) ) )
		{
			document.pincodeform.submit();
		}
	
	}
	
	function openURL( in_strURL, in_strMethod )
	{
		// code for Mozilla, etc.
		if( window.XMLHttpRequest )
		{
			xmlhttp=new XMLHttpRequest();
			xmlhttp.open( in_strMethod, in_strURL, false );
			xmlhttp.send( null );
		}
		// code for IE
		else if( window.ActiveXObject )
		{
			xmlhttp=new ActiveXObject( "Microsoft.XMLHTTP" )
			xmlhttp.open( in_strMethod, in_strURL, false );
			xmlhttp.send();
		}
	
		// if xmlhttp shows "loaded"
		if( xmlhttp.readyState==4 )
		{
			// if "OK"
			if( xmlhttp.status==200 )
		    {
				return xmlhttp.responseText;
		    }
		}
		return;
	}
	var xmlhttp2;
	function openURLAsync( in_strURL, in_strMethod, in_xFunction )
	{
		// code for Mozilla, etc.
		if( window.XMLHttpRequest )
		{
			xmlhttp2=new XMLHttpRequest();
			xmlhttp2.open( in_strMethod, in_strURL, true );
			xmlhttp2.onreadystatechange = in_xFunction;
			xmlhttp2.send( null );
		}
		// code for IE
		else if( window.ActiveXObject )
		{
			xmlhttp2=new ActiveXObject( "Microsoft.XMLHTTP" )
			xmlhttp2.open( in_strMethod, in_strURL, true );
			xmlhttp2.onreadystatechange = in_xFunction;
			xmlhttp2.send();
		}	
	}
	
	function logon( in_strSessionId )
	{
		var test = openURL("logon/logon.php?session=" + in_strSessionId, "POST" );
		//document.getElementById("logonTest").innerHTML = test;
		if( test == 1 )
		{
			location.reload();
		}
	}
	
	function showAttributes( in_xElement )
	{
		var strOut = "";
		for( prop in in_xElement )
		{
			strOut += prop + " = " + in_xElement[prop] + "<br>";
		}
		outWindow = window.open( "", "outWindow", "toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,dependent=1,width=640,height=480,screenX=100,screenY=100,top=100,left=100" );
		outWindow.document.writeln( strOut );
		outWindow.focus();
	}
	
	function showValue( in_strValue )
	{
		valueWindow = window.open( "", "valueWindow", "toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,dependent=1,width=640,height=480,screenX=100,screenY=100,top=100,left=100" );
		valueWindow.document.writeln( in_strValue + "<br>" );
		valueWindow.focus();
	}
	
	var oldClassName = null;
	var strOut = "";
	var strStyleOut = "";
	var xWindows = new Array;
	
	function ov( in_strMenuName, in_xElement, in_strStyleName, in_iNodeID )
	{
		strOut = "";
		
		var xParents = new Array;
		xParents[ in_iNodeID ] = true;
		
		var xElement = in_xElement;
		while( ( xElement ) && ( xElement.className.search( in_strMenuName ) != -1 ) )
		{
			var pattern = /(\w.+)_nd(\d+)/;
			pattern.exec( xElement.id );
			var strMenuName = RegExp.$1;
			var iNID = RegExp.$2;
			if( ( iNID.length > 0 ) && ( strMenuName == in_strMenuName ) )
			{
				xParents[ iNID ] = true;
			}
			
			xElement = xElement.parentNode;
		}
		
		var xCurElement = document.getElementById( in_strMenuName + "_nd" + in_iNodeID );
		for( var iNodeID in xWindows )
		{
			if( ( xWindows[ iNodeID ] ) && ( !xParents[ iNodeID ] ) )
			{
				if( document.getElementById( in_strMenuName + "_nd" + iNodeID ) )
				{
					document.getElementById( in_strMenuName + "_nd" + iNodeID ).style.display = 'none';
				}
				xWindows[ iNodeID ] = false;
			}
		}
		
		xWindows[ in_iNodeID ] = true;
		oldClassName = in_xElement.className;
		in_xElement.className = in_strStyleName + "_o";
		
		if( xCurElement )
		{
			
			if( xCurElement.style.display != 'inline' )
			{
				var iXPos = in_xElement.offsetLeft;
				var iYPos = in_xElement.offsetTop + in_xElement.offsetHeight;
				
				var Eltern = in_xElement.parentNode;

				/*if( Eltern )
				{
			  		//showAttributes( Eltern );
			  		iXPos += Eltern.offsetLeft;
			  		iYPos += Eltern.offsetTop;
			  		
			  		//Eltern = Eltern.parentNode;
				}*/

				xCurElement.style.left = iXPos;
				xCurElement.style.top = iYPos;
				xCurElement.style.display = 'inline';
			}
		}
	}
	
	function ou( in_xElement )
	{
		in_xElement.className = oldClassName;
	}
	
	function he( in_strID )
	{
		if( ( strOut.length > 0 ) && ( strOut == in_strID ) )
		{
			if( document.getElementById( strOut ) )
			{
				for( var iNodeID in xWindows )
				{
					xElement = document.getElementById( strStyleOut + "_nd" + iNodeID );
					//showValue( strStyleOut + "_nd" + iNodeID );
					if( xElement )
					{
						xElement.style.display = 'none';
						xWindows[ iNodeID ] = null;
					}
				}
				
				document.getElementById( strOut ).style.display = 'none';
			}
			strOut = "";
		}
	}
	
	function ha( in_xElement, in_strStyleName )
	{
		strOut = in_xElement.id;
		strStyleOut = in_strStyleName;
		setTimeout( "he('"+in_xElement.id+"')", 1000 );
	}
	
	var m_iFavCount = 15;
	function addFavorite( in_iNodeID, in_iCurrentNodeID )
	{
		strUrl = "scripts/favorite.php?action=add&NodeID=" + in_iNodeID + "&curNodeID=" + in_iCurrentNodeID;
		var result = openURL( strUrl, "GET" );
		if( result == "1" )
		{
			document.getElementById("addFavorite").style.display = "none";
			document.getElementById("removeFavorite").style.display = "inline";
			
			if( document.getElementById("favoritesList") )
			{
				listFavorites( m_iFavCount, in_iCurrentNodeID );
			}
		}
	}
	
	function removeFavorite( in_iNodeID, in_iCurrentNodeID )
	{
		strUrl = "scripts/favorite.php?action=remove&NodeID=" + in_iNodeID + "&curNodeID=" + in_iCurrentNodeID;
		var result = openURL( strUrl, "GET" );
		if( result == "1" )
		{
			if( in_iNodeID == in_iCurrentNodeID )
			{
				document.getElementById("addFavorite").style.display = "inline";
				document.getElementById("removeFavorite").style.display = "none";
			}
			
			if( document.getElementById("favoritesList") )
			{
				listFavorites( m_iFavCount, in_iCurrentNodeID );
			}
		}
	}
	
	function listFavorites( in_iCount, in_iCurrentNodeID )
	{
		m_iFavCount = in_iCount;		
		strUrl = "scripts/favorite.php?action=list&MaxCount=" + in_iCount + "&curNodeID=" + in_iCurrentNodeID;
		var result = openURL( strUrl, "GET" );
		if( result != null && result.length > 0 )
		{
			document.getElementById("favoritesList").innerHTML = result;
		}
	}
	
	function openAuthenticationFormular( in_iSizeX, in_iSizeY, in_iNodeID, in_iContentID, in_iContentDataID, in_iFileID, in_strCheckMail, in_iSave )
	{
		var authWindow = window.open( "scripts/authenticateFile.php?NodeID=" + in_iNodeID + "&ContentID=" + in_iContentID + "&ContentDataID=" + in_iContentDataID + "&FileID=" + in_iFileID + "&save=" + in_iSave + "&checkSendByEmail=" + in_strCheckMail , "authenticationWindow", "toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=1,dependent=1,width=" + in_iSizeX + ",height=" + in_iSizeY + ",screenX=100,screenY=100,top=100,left=100" );
		authWindow.focus();
	}
	
	function newWindow( in_strUrl, in_iSizeX, in_iSizeY )
	{
		var newWindow = window.open( in_strUrl, "valueWindow", "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,dependent=0,width="+in_iSizeX+",height="+in_iSizeY+",screenX=1,screenY=1,top=1,left=1" );
		newWindow.focus();
	}
	
			// Lädt einen Hilfetext und zeigt Ihn im Divider helpBox an!
		function loadHelp( url, element )
		{
			if( strHelp = loadXMLDoc( url ) )
			{
				if( document.getElementById( "helpBox" ) )
				{
					document.getElementById( "helpBox" ).innerHTML = strHelp;

					var x = 0, y = 0;
					while( element.offsetParent )
					{
						x += element.offsetLeft;
						y += element.offsetTop;
						element = element.offsetParent;
					}

					document.getElementById( "helpBox" ).style.left = x + 20;
					document.getElementById( "helpBox" ).style.top = y + 20;
					document.getElementById( "helpBox" ).style.visibility = "visible";

					var iLeft = document.getElementById( "helpBox" ).style.left.substr( 0, document.getElementById( "helpBox" ).style.left.length-2 );
					if( Number(document.body.clientWidth) < Number(iLeft) + document.getElementById( "helpBox" ).clientWidth )
					{
						document.getElementById( "helpBox" ).style.left = Number( document.body.clientWidth ) - 370;
					}
					var iTop = document.getElementById( "helpBox" ).style.top.substr( 0, document.getElementById( "helpBox" ).style.top.length-2 );
					var iHeight = Number( document.body.clientHeight );
					
					if( iHeight < Number(iTop) + document.getElementById( "helpBox" ).clientHeight )
					{
						document.getElementById( "helpBox" ).style.top = iTop - document.getElementById( "helpBox" ).clientHeight - 25;
					}
				}
			}
		}
		
			function loadXMLDoc( url )
	{
		// code for Mozilla, etc.
		//var zeit, ms;
		if( window.XMLHttpRequest )
		{
		  	//zeit = new Date();
			//ms = zeit.getTime();
		  	xmlhttp=new XMLHttpRequest();
		  	xmlhttp.open("GET",url,false);
		  	xmlhttp.send(null);
		}
		// code for IE
		else if( window.ActiveXObject )
		{
		  	xmlhttp=new ActiveXObject( "Microsoft.XMLHTTP" )
	    	xmlhttp.open("GET",url,false);
	    	xmlhttp.send();
		}
		
		// if xmlhttp shows "loaded"
		if( xmlhttp.readyState==4 )
		{
			// if "OK"
			if( xmlhttp.status==200 )
		    {
				//var zeit2 = new Date();
				//var ms2 = zeit2.getTime();
				//alert( ( ms2 -  ms ) );
				return xmlhttp.responseText;
		    }
		}
		return;
	}
	
	function clearHelp()
	{
		document.getElementById( "helpBox" ).style.visibility = "hidden";
	}

	function showMousePos(e){

	    var p = mouse_pos(e);

	    for(var i in p)    
	    {
	    	document.getElementById("div_container_Flags").style.left = p["left"] + 5 - document.getElementById("div_container_Flags").offsetWidth;
	    	document.getElementById("div_container_Flags").style.top =  p["top"] - 5;
	    }
	    window.document.onmousemove = null;
	}
	
	function mouse_pos(e) {

		if(!e) e = window.event;

		var body = (window.document.compatMode && window.document.compatMode == "CSS1Compat") ? 

		window.document.documentElement : window.document.body;

		return {

		top: e.pageY ? e.pageY : e.clientY + body.scrollTop - body.clientTop,

		left: e.pageX ? e.pageX : e.clientX + body.scrollLeft  - body.clientLeft
		};

	}
	
	var on = false;
	var schliessen = false;
	var interval;
	
	function openFlags ( in_FlagsHTML ) 
	{
		if ( on == false && in_FlagsHTML.length > 0)
		{
			document.getElementById("div_container_Flags_inner").innerHTML = "";
			document.getElementById("div_container_Flags_inner").innerHTML = in_FlagsHTML;
			document.getElementById("div_container_Flags").style.visibility = "visible";
			document.getElementById("div_container_Flags").style.display = "block";
			window.document.onmousemove = showMousePos;
			on = true;
		}
		schliessen = false;
	}
	
	function closeFlagsTime () 
	{
		if ( on == true)
		{
			schliessen = true;
			interval = window.setTimeout("closeFlags()", 500);
		}
	}
	
	function closeFlags()
	{
		if ( schliessen )
		{
			window.clearTimeout(interval);
			document.getElementById("div_container_Flags").style.visibility = "hidden";
			document.getElementById("div_container_Flags").style.display = "none";
			window.document.onmousemove = null;
			on = false;
		}
	}
	
	function reloadURL( url )
	{
		window.location.href = url;
	}
	
	function unCryptEmail( s )
	{
		var n = 0;
		var r = "";
		for( var i = 0; i < s.length; i++)
		{
				n = s.charCodeAt( i );
				if( n >= 8364 )
				{
						n = 128;
				}
				r += String.fromCharCode( n - 1 );
		}
		return r;
	}

	function linkTo( s )
	{
		location.href = unCryptEmail( s );
	}
	
	function resetMenu()
	{
		var menu_objects = document.getElementsByName('VerticalMenu');
		var max = 0;
		var summe = 0;
		for (var i = 0; i < menu_objects.length; i++)
		{
			if (menu_objects[i].offsetHeight > max )
			{
				max = menu_objects[i].offsetHeight;
			}
			summe = summe + menu_objects[i].offsetHeight + 10;
		}
				
		summe = summe % 50;
		var wert = ( 16 - 50 - ( summe ) );
		var wert2 = ( 50 );
		if( summe != 0 )
		{
			wert2 = ( 50 + ( 50 - ( summe ) ) );
		}
		
		document.getElementById("menu_under").style.background='url(gif/lookandfeel/Microsite/menu_background.gif) repeat-y 0px '+ wert + 'px';
		document.getElementById("menu_under").style.height=wert2+'px';
	}
	
	var Temp_comment_Headline;
	
	function setCommentParentID( ParentCommentID ,UserNameText,remove)
	{
		if (remove==undefined)
		{
			remove="entfernen";
		}
	
		document.getElementById("ParentCommentID").value = ParentCommentID;
		var commentHeadlineText = document.getElementById("commentHeadlineText")

		if (Temp_comment_Headline == null)
		{
			Temp_comment_Headline = commentHeadlineText.innerHTML;
		}
		commentHeadlineText.innerHTML = UserNameText + " ";
		var myp = document.createElement( "a");
		var chi = commentHeadlineText.appendChild( myp);
		//alert(dump(myp));
		if (document.all)
		{
			myp.innerText = remove;
		}
		else
		{
			myp.innerHTML = remove;
		}
		
		myp.href="javascript:resetCommentParentID()";
	}	
	
	function resetCommentParentID()
	{
		document.getElementById("ParentCommentID").value = "";
		var commentHeadlineText = document.getElementById("commentHeadlineText")
		commentHeadlineText.innerHTML = Temp_comment_Headline;
	}
	
	function dump(arr,text,level) {
		var dumped_text = "";
		if(!level) level = 0;
		if(!text) text = "";
		
		//The padding given at the beginning of the line.
		var level_padding = "";
		for(var j=0;j<level+1;j++) level_padding += "    ";
		
		if(typeof(arr) == 'object') { //Array/Hashes/Objects 
			for(var item in arr) {
				var value = arr[item];
				
				if(typeof(value) == 'object') { //If it is an array,
					if (level > 0){
					dumped_text += level_padding + "'" + item + "' ...\n";
					dumped_text += dump(value,level-1);
					}
				} else {
					if (text.length > 0 )
					{
						if( item.indexOf(text) != -1 )
						{
							dumped_text += level_padding + "'" + item + "' => \"" + value + "\"\n";
						}
					}
					else
					{
						dumped_text += level_padding + "'" + item + "' => \"" + value + "\"\t";
					}
				}
			}
		} else { //Stings/Chars/Numbers etc.
			if (text.length > 0 )
			{
				if( item.indexOf('background') != -1 )
				{
					dumped_text = "===>"+arr+"<===("+typeof(arr)+")";
				}
			}
			else
			{
				dumped_text = "===>"+arr+"<===("+typeof(arr)+")";
			}
		}
		return dumped_text;
}

