var IMG_BackToWhite
var TR_ParentFolderID
	function PopupFenster(url,breite,hoehe)
		{
		var options = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=' + breite + ',height='+hoehe;
		window.open(url, 'Popup',options);
		}
		
	function PopupFenster3(url,breite,hoehe,ID)
		// Popupfenster 2 mit Scrallbars
		{
		var options = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,width=' + breite + ',height='+hoehe;
		window.open(url, 'Popup_' + ID,options);
		}

	function ChangeOnMouseOver(ImgID,Child)
		{
		// OnMouseOver
		//NewSRC = 'pic/Arrow_1.gif'
		if (Child == 'on')
			// Untermenue "ON"
			{
			TR_BGColor = '#E6EDF5'
			TR_BGColorParentFolder = '#E6EDF5'
			TR_ParentFolderID = 'TR_<%= request.querystring("ParentFolder") %>' 
			window.document.getElementById(TR_ParentFolderID).bgColor = TR_BGColorParentFolder
			window.document.getElementById('TR_' + ImgID).bgColor = TR_BGColor	
			}
		else
			// Hauptmenue "ON"
			{
			TR_BGColor = '#E6EDF5'
			TR_BGColor2 = '#E6EDF5'
			window.document.getElementById('TR_' + ImgID).bgColor = TR_BGColor
			window.document.getElementById('TR2_' + ImgID).bgColor = TR_BGColor2
			}
		}
		
	function ChangeOnMouseOut(ImgID,Child,firstBGColor)
		{
		// OnmouseOut
		if (Child == 'on')
			// Untermenue "OUT", wird nicht benötigt; nimmt wieder die Hintergrundfarbe der Tabelle an
			{TR_BGColor = ''
			window.document.getElementById('TR_' + ImgID).bgColor = ''}
		else
			// Hauptmenue "OUT"
			{
			TR_BGColor = firstBGColor
			window.document.getElementById('TR_' + ImgID).bgColor = ''
			window.document.getElementById('TR2_' + ImgID).bgColor = ''
				
			}
		
		}	
	function ChangeOnMouseOverNavi1(ImgID)
			{
			TR_BGColor = '#E6EDF5'
			window.document.getElementById('TR_' + ImgID).bgColor = TR_BGColor	
			}
			
	function ChangeOnMouseOutNavi1(ImgID)
				{
				TR_BGColor = ''
				window.document.getElementById('TR_' + ImgID).bgColor = TR_BGColor
				}

	function ChangeIMGonclick(ImgID)
		{
		// Oncklick
		if (IMG_BackToWhite != undefined)
			{
			NewSRC = 'images/Arrow_1.gif'
			NewImage = new Image(); NewImage.src = NewSRC
			window.document.getElementById('IMG_' + IMG_BackToWhite).src = NewImage.src;
			}
			
		NewSRC = 'images/Arrow_red.gif'
		NewImage = new Image(); NewImage.src = NewSRC
		window.document.getElementById('IMG_' + ImgID).src = NewImage.src;
		alert(IMG_BackToWhite)
		IMG_BackToWhite = ImgID
		}		

	function ChangeIMG(ImgID,ImgSRC,ImgIndex)
		{
		NewSRC = 'fotos/' + ImgSRC
		//alert(NewSRC )
		NewImage = new Image(); NewImage.src = NewSRC
		window.document.getElementById(ImgID).src = NewImage.src
		window.document.getElementById(ImgID).name = ImgIndex
		}
	function ChangeIMG_2(ImgID,Status)
		{
		if (Status == 'over')
			{
			NewSRC = 'images/Button_' + ImgID + '_over.jpg'
			}
		else
			{
			NewSRC = 'images/Button_' + ImgID + '.jpg'
			}
			NewImage = new Image(); NewImage.src = NewSRC
			window.document.getElementById(ImgID).src = NewImage.src
		}	
		function ChangeIMGSchriftgroesse(ImgID,ImgSRC)
		{
		NewSRC = 'images/' + ImgSRC
		//alert(NewSRC )
		NewImage = new Image(); NewImage.src = NewSRC
		window.document.getElementById(ImgID).src = NewImage.src
		//window.document.getElementById(ImgID).name = ImgIndex
		}
		
	function OpenIMGBrowser(breite,hoehe,ListenID,Darstellung)
		{
		//alert(window.document.getElementById(ListenID).name)
		if (Darstellung == undefined)
			{
			Darstellung = ''
			}
		ActiveIMGIndex = window.document.getElementById(ListenID).name
		var options = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=' + breite + ',height=' + hoehe;
		window.open('fotos_htm/popup_frame.asp?FileNumber=' + ActiveIMGIndex + '&ListenID=' + ListenID + '&Darstellung=' + Darstellung, 'Bilder',options);
		
		}
	function OpenIMGBrowserFotos2(breite,hoehe,FolderName)
		{
		//alert(window.document.getElementById(ListenID).name)
		
		//ActiveIMGIndex = window.document.getElementById(ListenID).name
		var options = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,width=' + breite + ',height=' + hoehe;
		window.open('fotos_htm/popup_frame.asp?FileNumber=1&FolderName=' + FolderName, 'Bilder',options);
		
		}
	function ChangeSiteIndex(SiteIndex)
		{
		window.document.getElementById('UserEditSiteIndex').value = SiteIndex
		//alert(window.document.getElementById('UserEditSiteIndex').value)
		document.form.submit()
		}
		
	function CheckSendPWD()
		{
			if (window.document.getElementById('PWDold').value == '' || window.document.getElementById('PWDnew1').value == '' || window.document.getElementById('PWDnew2').value == '')
				{
					alert('Um Ihr Passwort zu ändern bitte die Felder:\n\"altes Passwort\"\n\"neues Passwort\"\n\"neues Passwort wiederholen\"\nausfüllen! ' )
				}
			else
				{
					if (window.document.getElementById('PWDnew1').value == window.document.getElementById('PWDnew2').value)
						{
						//alert('richtig')
						
						window.document.getElementById('changePWD').value = 'true'
						window.document.getElementById('UserEditSiteIndex').value = '5'
						document.form.submit()
						}
					else
						{
						alert('Passwortwiederholung nicht korrekt. Bitte erneut eingeben!')
						}
				}
		}
		
	function DelAccount()
		{
		window.document.getElementById('UserEditSiteIndex').value = '5'
		window.document.getElementById('DelAccount').value = 'true'
		document.form.submit()
		}
	function InsertNewLine(SiteIndex,LineIndex)
		{
		window.document.getElementById('UserEditSiteIndex').value = SiteIndex
		window.document.getElementById('InsertNewLine').value = LineIndex
		//alert(window.document.getElementById('UserEditSiteIndex').value)
		document.form.submit()
		}
		
	function DeleteLine(SiteIndex,LineIndex)
		{
		window.document.getElementById('UserEditSiteIndex').value = SiteIndex
		window.document.getElementById('DeleteLine').value = LineIndex
		//alert(window.document.getElementById('UserEditSiteIndex').value)
		document.form.submit()
		}
	function ChangeBGColor(ToDo,ObjectID)
		{
		if (ToDo == 'over')
			{
			TR_BGColor = '#F5F5F5'
			//alert(window.document.getElementById('TR3_' + ObjectID))
			}
		else
			{
			TR_BGColor = ''
			}
		window.document.getElementById('TR1_' + ObjectID).bgColor = TR_BGColor
		window.document.getElementById('TR2_' + ObjectID).bgColor = TR_BGColor
		
		if (window.document.getElementById('TR3_' + ObjectID) != null)
			{
			window.document.getElementById('TR3_' + ObjectID).bgColor = TR_BGColor
			window.document.getElementById('TR4_' + ObjectID).bgColor = TR_BGColor
			window.document.getElementById('TR5_' + ObjectID).bgColor = TR_BGColor
			}
		}
	function SendChancheURLForm(Modus,StartCounter,ContentID)
		{
		window.document.getElementById('FormListUser').action = 'index.asp?Modus=' + Modus + '&ContentID=' + ContentID + '&ParentFolder=0&StartCounter=' + StartCounter
		document.form.submit()
		}	
		
		
	
	function OpenPrintWindow(CurrentURL,ContentID)
		{
		// Popupfenster 2 mit Scrallbars
		
		var PrintViewPara = '&PrintView=true' //Startseite wird sonst nicht angezeigt (funktioniert nur online)
		if (ContentID == '14')
			{
			//CurrentURL = ''
			PrintViewPara = 'index.asp?PrintView=true'
			}
		var options = 'toolbar=yes,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=no,width=600,height=500'
		window.open(CurrentURL + PrintViewPara, 'PrintPopup',options);
		
		}
	function OpenDownloadIMGWin(breite,hoehe,ID,LangID)
		{
		
		var options = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=' + breite + ',height=' + hoehe;
		window.open('showDownlIMG.asp?ID=' + ID + '&LangID=' + LangID, 'OrgSize',options);
		
		}
	function CheckNewsletterForm(Vorname,Nachname,Email)
		{
		
		var Vorname
		var Nachname
		var Email
		
		var NameValue 
		NameValue = window.document.getElementById('Name').value
		
		var FirstNameValue = window.document.getElementById('FirstName').value
		
		var EmailValue = window.document.getElementById('Email').value
		
		var TXTErrorVorname = ''
		
		var TXTErrorName = ''
		
		var TXTErrorEmail = ''
		
		var ErrorOcc
		
		
		if ( FirstNameValue == '' )
			{
				TXTErrorVorname = Vorname + ' \n '
				ErrorOcc = 'true'
			}
		if ( NameValue == '' )
			{
				TXTErrorName = Nachname + ' \n '
				ErrorOcc = 'true'
			}
		
		if ( EmailValue == '' )
			{
				TXTErrorEmail = Email + ' \n '
				ErrorOcc = 'true'
			}
		if (ErrorOcc == 'true')
			{
			alert ( 'Please enter: \n ' + TXTErrorVorname + TXTErrorName + TXTErrorEmail )
			}
		else
		
			{ document.form.submit()  }
			
			
		/*
			alert('hallo')
			*/
		}
	function CheckFormAbmelden()
		{
		var EmailValue = window.document.getElementById('Email').value
		var EmailFiltered
		EmailFiltered = EmailValue
		var x = 1;
		do {
			EmailFiltered = EmailFiltered.replace(' ','')
			x = x + 1;
			} 
		while (x < 255);

		EmailValue = EmailFiltered
		//alert(EmailFiltered)
		
		var TXTErrorEmail = ''
		var ErrorOcc = ''
		if ( EmailValue == '' )
			{
				TXTErrorEmail = 'E-Mail '
				ErrorOcc = 'true'
			}
		if (ErrorOcc == 'true')
			{ alert ( 'Please enter ' +  TXTErrorEmail ) }
		else
		
			{ document.form.submit()  }
		
		
		
		}

function UnCryptMailto(s) {
	var n=0;
	var r="";
	for(var i=0;i<s.length;i++) { 
		n=s.charAt(i); 	
			
		umlaut = false
		
		if (n == "ä") {
			r += "ä"
			umlaut = true
		}
		if (n == "ö") {
			r += "ö"
			umlaut = true
		}
		if (n == "ü") {
			r += "ü"
			umlaut = true
		}
		if (n == "Ä") {
			r += "Ä"
			umlaut = true
		}
		if (n == "Ü") {
			r += "Ü"
			umlaut = true
		}
		if (n == "Ö") {
			r += "Ö"
			umlaut = true
		}
		if (n == "ß") {
			r += "ß"
			umlaut = true
		}
		
		if (umlaut == false) {
			n=s.charCodeAt(i); 
			if (n>=8364) {n = 128;}			
			r += String.fromCharCode(n-7);			
		}
	}
	return r;
}

function linkTo_UnCryptMailto(s)	{
	location.href=UnCryptMailto(s);
}