////////////////////////////////////////////////////////////////
//
// Beschreibung: Browsererkennung
//
////////////////////////////////////////////////////////////////

var ns  = (document.layers) ? 1 : 0;
var ie  = (document.all) ? 1 : 0;
var opera  = (window.opera) ? 1 : 0;
var dom = (document.getElementById) ? 1 : 0;
var mac = (navigator.platform.indexOf("Mac") != -1) ? 1 : 0;
var ielt8 = false;

var ieVersion = 100;

if (navigator.appName == 'Microsoft Internet Explorer') {
  var ua = navigator.userAgent;
  var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
  if (re.exec(ua) != null)
  	ieVersion = parseFloat( RegExp.$1 );
}

if (ieVersion < 8.0) {
	ielt8 = true;
}

	function isNumeric (param) {
		blnCheckNumeric = true;
		
		for (y = 0; y < param.length; y++) {
			if ((param.charAt(y) < "0" || param.charAt(y) > "9") && (param.charAt(y) != ",")) {
				blnCheckNumeric = false;
			}
		}
		
		return blnCheckNumeric;
	}

///////////////////////////////////////////////////
// Prüft die Richtigkeit der Eingaben in Formularen
// by Maciej Homziuk
///////////////////////////////////////////////////
// Naming of a field oenName of field
// Empty values: text and select-one "".
	function checkForm (iForm, paramNameSubmit, paramSchicken, paramToday) {
		
		var checkVar = /^(o|x)(ex|xn|dx|dd|xx)/;
		//zusätzliche Variablen für das überprüfen von Checkboxen		
		var cbCounter = 0;
		var cbChecked = false;
		var cbName = "";
		var nameDelimiterPos = 0;
		
		for (x=0; x<document.forms[iForm].elements.length; x++) {
			blnObligatory = false;
			blnEmail = false;
			blnDate = false;
			blnNumeric = false;
			blnEmpty = false;
			blnAt = false;
			blnPoint = false;
			blnCheckNumeric = true;
			blnCheckDate = true;
			strMaxLength = "";
			strTextAreaName = "";
			fieldName = "";
			
			fieldName = document.forms[iForm].elements[x].name;
			fieldType = document.forms[iForm].elements[x].type;
	
			if (typeof(fieldName) != "undefined"){
				if (checkVar.test(fieldName.charAt(0)+fieldName.charAt(1)+fieldName.charAt(2)) == true || fieldName == "oEmail2" || fieldName == "oPasswort2"){
					
					//Checking if the field is obligatory.
					if (fieldName.charAt(0) == "o") {blnObligatory = true}
					//Checking if the field is a date field.
					if (fieldName.charAt(1) == "d") {blnDate = true}
					//Checking if the field is an email field.
					if (fieldName.charAt(1) == "e") {blnEmail = true}
					//Checking if the field is "only numeric values" field.
					if (fieldName.charAt(2) == "n") {blnNumeric = true}
		
					strRealName = fieldName.slice(3);
					
					if (strRealName == "Email") {
						strRealName = "E-Mail";
					} else if (strRealName == "ail2") {
						strRealName = "E-Mail wiederholen";
					} else if (strRealName == "sswort2") {
						strRealName = "Passwort wiederholen";
					}
					strValue = document.forms[iForm].elements[x].value;
					// Whole procedure for the obligatory field.
					if (blnObligatory) {
						//Checking if the obligatory field wans't filled in the form.
						if (fieldType == "text" || fieldType == "textarea" || fieldType == "password") {
							if (strValue == "") {
								blnEmpty = true;
								emptyAlert = "Bitte füllen Sie das Feld \""+strRealName+"\" aus!";
							}
						} else if (fieldType == "select-one" || fieldType == "select-multiple") {
							if (strValue == "") {
								blnEmpty = true;
								emptyAlert = "Bitte treffen Sie im Feld \""+strRealName+"\" eine Wahl!";
							}
						} else if (fieldType == "checkbox") {

							//wirklichen Namen der Checkbox ermitteln
							nameDelimiterPos = fieldName.search(/_/);
							if (nameDelimiterPos != -1) {
								//falls ein neues Checkboxfeld geprueft wird ... check Variable und Zaehler zuruecksetzen und Namen speichern
								if (cbName != fieldName.substring(0, nameDelimiterPos)) {
									cbChecked = false;
									cbName =  fieldName.substring(0, nameDelimiterPos);
									cbCounter = 0;
								}
							} else {
								cbChecked = false;
								cbCounter = 0;
								cbName = "";
							}
							
							//pruefen ob diese Checkbox angekreuzt wurde
							if (document.forms[iForm].elements[x].checked == false && !cbChecked) {
								addToCbCounter = false;
								if (x + 1 < document.forms[iForm].elements.length) {
									if (document.forms[iForm].elements[x + 1].type == "checkbox" && document.forms[iForm].elements[x + 1].name.substring(0, cbName.length) == cbName && cbName != "") {
										addToCbCounter = true;
									}
								}
								
								if (addToCbCounter) {
									cbCounter++;
								} else {
									blnEmpty = true;
									if (cbCounter == 0) { 
										emptyAlert = "Wir können den Vorgang erst abschließend bearbeiten, wenn Sie unsere "+strRealName+" akzeptieren.";
									} else {
										emptyAlert = "Bitte im Feld "+document.forms[iForm].elements[x].name.substring(3,document.forms[iForm].elements[x].name.search(/_/))+ " mindestens eine Wahl treffen!!!";
									}
								}
							} else {
								cbChecked = true;
							}
							
						} else if (fieldType == "radio") {
							blnRadioOK = false;
							intAnzahlElemente = document.getElementsByName(document.forms[iForm].elements[x].name).length;
							for (var i=0; i<intAnzahlElemente; i++) {
								if (document.getElementsByName(document.forms[iForm].elements[x].name)[i].checked) {
									blnRadioOK = true;
								}
							}
							if (!blnRadioOK) {
								blnEmpty = true;
								emptyAlert = "Bitte eine Option im Feld \""+strRealName+"\" auswählen !!!";
							}
						}
						
						if (blnEmpty == true) {
							alert (emptyAlert);
							document.forms[iForm].elements[x].focus();
							return false;
						}
					}
		
					// Whole procedure for the email field.
					strIllegalChar = "";
					if (blnEmail && (strValue != "")) {
						for (y = 0; y < document.forms[iForm].elements[x].value.length; y++) {
							if (document.forms[iForm].elements[x].value.charAt(y) == "@")
								{blnAt = true}
							if (document.forms[iForm].elements[x].value.charAt(y) == ".")
								{blnPoint = true}
							if (document.forms[iForm].elements[x].value.charAt(y).match(/(,|;|:|#|!| |\u00E4|\u00F6|\u00FC|\u00DF)/))
								{strIllegalChar = document.forms[iForm].elements[x].value.charAt(y);}
						}
						if (strIllegalChar != "") {
							alert("Unerlaubtes Zeichen in der E-Mailadresse: \""+strIllegalChar+"\" !");
							document.forms[iForm].elements[x].focus();
							return false;
						}
						if (! (blnAt && blnPoint)) {
							alert("Geben Sie bitte im Feld "+strRealName+" eine gültige E-Mailadresse ein !");
							document.forms[iForm].elements[x].focus();
							return false;
						}
					}
		
					// Whole procedure for the date field.
					if (blnDate && (strValue != "")) {
						for (y = 0; y < document.forms[iForm].elements[x].value.length; y++) {
							if (document.forms[iForm].elements[x].value.length != 10) {
								blnCheckDate = false;
							}
							if (y == 4 || y == 7) {
								if (document.forms[iForm].elements[x].value.charAt(y) != "-") {
									blnCheckDate = false;
								}
							} else {
								if (document.forms[iForm].elements[x].value.charAt(y) < "0" || 
									document.forms[iForm].elements[x].value.charAt(y) > "9") {
									blnCheckDate = false;
								}
							}
							if (! blnCheckDate) {
								alert("Geben Sie bitte im Feld "+strRealName+" ein Datum im Format JJJJ-MM-TT ein !");
								document.forms[iForm].elements[x].focus();
								return false;
							}
						}
					}			
					
					// Whole procedure for numeric field.
					if (blnNumeric && (strValue != "")) {
						if (!isNumeric(document.forms[iForm].elements[x].value)) {
							alert("Geben Sie bitte im Feld "+strRealName+" einen numerischen Wert ein !");
							document.forms[iForm].elements[x].focus();
							return false;
						}
					}
					
					// Checking if the email adresses and passwords are in booths fields the same.
					if (strRealName == "E-Mail wiederholen") {
						strEmail1 = document.forms[iForm].oexEmail.value;
						strEmail2 = document.forms[iForm].oEmail2.value;
				  		if (strEmail1 != strEmail2) {
							alert("Die Werte im Feld \"E-Mail\" und \"E-Mail wiederholen\"\nstimmen nicht überein !!!");
							document.forms[iForm].oexEmail.focus();
							return false;
						}
					}
		
					if (strRealName == "Passwort wiederholen") {
						strEintrag1 = document.forms[iForm].oxxPasswort.value;
						strEintrag2 = document.forms[iForm].oPasswort2.value;
				  		if (strEintrag1 != strEintrag2) {
							alert("Die Werte im Feld \"Passwort\" und \"Passwort wiederholen\"\nstimmen nicht überein !!!");
							document.forms[iForm].oxxPasswort.focus();
							return false;
						}
						
						if (strEintrag1.length < 6) {
							alert("Das Passwort muss mindestens aus 6 Zeichen bestehen.");
							document.forms[iForm].oxxPasswort.focus();
							return false;
						}
					}
				}//end of variable name validation
			}//end of type validation
		}//end of loop 
		
		// If everything is ok then submit the form.
		if (paramNameSubmit) {
			document.getElementById(paramNameSubmit).value = "Bitte warten...";
			document.getElementById(paramNameSubmit).disabled = true;
		}
		
		if (paramSchicken != "nicht_schicken") {
			document.forms[iForm].submit();
		}
		return true;
	}

/***********************************************
* Textarea Maxlength script-  Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

function ismaxlength(obj){
	var mlength=obj.getAttribute? parseInt(obj.getAttribute("maxlength")) : ""
	if (obj.getAttribute && obj.value.length>mlength) {
		obj.value=obj.value.substring(0,mlength)
		alert("Der Text in diesem Feld darf nicht "+mlength+" Zeichen "+String.fromCharCode(252)+"berschreiten. Der von Ihnen eingestellte Text wurde automatisch verk"+String.fromCharCode(252)+"rzt.");
	}
}	
	
////////////////////////////////////////////////////////////////////
//Setzt den Zeiger auf das n-te (moegliche) Element im m-ten Formular
////////////////////////////////////////////////////////////////////

	function focusOn(n,m) {
		var blnGesetzt = false;
		while (!blnGesetzt && document.forms[m]) {
			if (document.forms[m].elements[n].type == "hidden" || document.forms[m].elements[n].value != "") {
				n++;
				if (n > document.forms[m].elements.length - 1) {
					return false;
				}
			} else {
				document.forms[m].elements[n].focus();
				blnGesetzt = true;
			}
		}
	} 
	
////////////////////////////////////////////////////////////////////
//oeffnet das Bestätigungsfenster, wenn bestätigt öffnet die URL
////////////////////////////////////////////////////////////////////
	
	function warnung(paramText,paramURL) {
		blnAction = confirm(paramText);
		if (blnAction == true) {
			window.location.href = paramURL;
		}
	}	

	function mypopup(strURL,intSzer,intWys,scroll,namewindow,paramEinstellungen,showPreloader) {
		if (paramEinstellungen == "") {
			strEinstellungen = ",status=no,resizable=no";
		} else {
			strEinstellungen = paramEinstellungen;
		}
		if (showPreloader == "1") {
			windowPopup = window.open("",namewindow,"width="+intSzer+",height="+intWys+",scrollbars="+scroll+",left="+(screen.availWidth/2-0.5*intSzer)+",top="+(screen.availHeight/2-0.5*intWys)+strEinstellungen);
			windowPopup.document.write('<div style="position: absolute; width: 100%; top: 50%;margin-top: -66px;z-index:6;" align="center"><img src="/includes/images/ajax_ai/little_circle_white.gif" /></div><div style="position: absolute; font-family: Arial;width: 100%; left: 0;top: 50%;overflow: hidden;margin-top: -15px;z-index:6; font-size: 12px; font-weight: 900; text-align: center;">&nbsp;&nbsp;&nbsp;Bitte warten...</div>');
		}
		
		windowPopup = window.open(strURL,namewindow,"width="+intSzer+",height="+intWys+",scrollbars="+scroll+",left="+(screen.availWidth/2-0.5*intSzer)+",top="+(screen.availHeight/2-0.5*intWys)+strEinstellungen);

		if (windowPopup) {
			windowPopup.focus();
		} else {
			alert("Achtung!!! Sie haben in Ihrem Browser Popups deaktiviert.\nAktivieren Sie bitte Popups für deutsche-versicherungsboerse.de, um alle Inhalte zu sehen.");
		}		
	}
	
////////////////////////////////////////////////////////////////////
//Öffnet ein Layer mit dem Hilfetext
////////////////////////////////////////////////////////////////////

	function showHelp (paramLayerId,paramX,paramY) {
		document.getElementById(paramLayerId).style.left = paramX;
		document.getElementById(paramLayerId).style.top = paramY;
		document.getElementById(paramLayerId).style.visibility = 'visible';
	}
	
////////////////////////////////////////////////////////////////////
//Schliesst ein Layer mit dem Hilfetext
////////////////////////////////////////////////////////////////////

	function hideHelp (paramLayerId) {
		document.getElementById(paramLayerId).style.visibility = 'hidden';
	}

////////////////////////////////////////////////////////////////////
//Diese Funktion aktiviert und / oder deaktiviert gleichzeitig 
//mehrere Checkboxes
////////////////////////////////////////////////////////////////////
	function markieren(paramAction,paramFeld, paramVon, paramBis, formId) {
	
		if (typeof paramVon == "undefined") {
			y = -1;
		} else {
			y = 0;
		}
		
		if (typeof(formId) == "undefined") formId = 0;

		for (x=0; x<document.forms[formId].elements.length; x++) {
			objFeld = document.forms[formId].elements[x];
			
			fieldType = objFeld.type;

				intSchneidenBis = objFeld.name.lastIndexOf("_");
				if (intSchneidenBis > -1) {
					fieldName = objFeld.name.slice(0,intSchneidenBis);
				} else {
					fieldName = objFeld.name;
				}

			if (fieldType == "checkbox") {
				
				if (paramAction == "on") {
					if (fieldName == paramFeld) {
						if ((y >= paramVon && y <= paramBis || y == -1) && !objFeld.checked) {
							objFeld.click();
						}
					}
				} else if (paramAction == "off") {
					if (fieldName == paramFeld) {
						if ((y >= paramVon && y <= paramBis || y == -1) && objFeld.checked) {
							objFeld.click();
						}
					}
				} else if (paramAction == "change") {
					if (objFeld.checked) {
						if (fieldName == paramFeld) {
							if (y >= paramVon && y <= paramBis || y == -1) {
								 objFeld.click();
							}
						}
					} else {
						if (fieldName == paramFeld) {
							if (y >= paramVon && y <= paramBis || y == -1) {
								objFeld.click();
								objFeld.checked = true;
							}
						}
					}
				}
			}
			if (fieldName == paramFeld) {
				if (y != -1) {y++;}
			}
		}
	}
	/////////////////////////////////////////////////////////////////////////////////
	//Die beiden folgenden Funktionen ermitteln die absolute position eines Elements 
	////////////////////////////////////////////////////////////////////////////////
	
	//absolute Position left
	function getOffsetLeft(element){
		if(!element) return 0;
		return element.offsetLeft + getOffsetLeft(element.offsetParent);
	}
	
	//absolute Position top
	function getOffsetTop(element){
		if(!element) return 0;
		return element.offsetTop + getOffsetTop(element.offsetParent);
	}
	////////////////////////////////////////////////////////////////////
	//Die folgenden Funktionen werden von einem Formelement genutzt 
	////////////////////////////////////////////////////////////////////
	function DoAdd(id)
	{
		if (document.getElementById("availableList").selectedIndex > -1)
		{
			var strText = document.getElementById("availableList").options[document.getElementById("availableList").selectedIndex].text;
			var strId = document.getElementById("availableList").options[document.getElementById("availableList").selectedIndex].value;
			AddItem(document.getElementById("chosenList"), strText, strId);
			RemoveItem(document.getElementById("availableList"), document.getElementById("availableList").selectedIndex);
			sortSelect(document.getElementById("chosenList"));
			UpdateRealValue(id);
		}
	}
	
	function DoRemove(id)
	{
		if (document.getElementById("chosenList").selectedIndex > -1){
			var strText = document.getElementById("chosenList").options[document.getElementById("chosenList").selectedIndex].text;
			var strId = document.getElementById("chosenList").options[document.getElementById("chosenList").selectedIndex].value;
			AddItem(document.getElementById("availableList"), strText, strId);
			RemoveItem(document.getElementById("chosenList"), document.getElementById("chosenList").selectedIndex);
			UpdateRealValue(id);
		}	
	}
	
	function AddItem(objListBox, strText, strId)
	{
		var newOpt;
		newOpt = document.createElement("OPTION");
		newOpt = new Option(strText,strId);
		newOpt.id = strId;
		objListBox.options[objListBox.length]=newOpt;
	}
	
	function RemoveItem(objListBox, strId)
	{
		if (strId > -1)
			objListBox.options[strId]=null;
	}

	function requestAJAX(paramGetURL,paramParams,paramDivName,paramLoaderGrafik,paramAsynchronous,paramColorBorder,paramColorBackground){
		
		//sicherstellen, dass Parameter übergeben wurden
		if (paramParams != '') {
			arrParams = paramParams.split("&");
		} else {
			arrParams = new Array();
		}
		
		var arrParamsConverted = new Array();

		for (x = 0; x < arrParams.length; x++) {
			if (arrParams[x] != "") {
				arrParams2 = arrParams[x].split("=");
				arrParams2[1] = arrParams2[1].replace(/\u20AC/g, "[dvb_euro]");
				arrParams2[1] = arrParams2[1].replace(/\+/g, "[dvb_plus]");
				arrParamsConverted[x] = arrParams2[0]+"="+arrParams2[1];
			}
		}
		
		paramParams = arrParamsConverted.join("&");
		
		if (typeof(paramLoaderGrafik) == "undefined" || paramLoaderGrafik == "") {
			paramLoaderGrafik = "little_circle_white.gif";
		}
		
		if (typeof(paramAsynchronous) == "undefined") {
			paramAsynchronous = true;
		}
		
		if (typeof(paramColorBorder) == "undefined" || paramColorBorder == "") {
			paramColorBorder = "#F7CA31";
		}
		
		if (typeof(paramColorBackground) == "undefined" || paramColorBackground == "") {
			paramColorBackground = "#FCF6D4";
		}
		
		height = document.getElementById(paramDivName).offsetHeight;
		width = document.getElementById(paramDivName).offsetWidth;
		
		//erstellen des requests
		var req = null;
		
		try{
			req = new XMLHttpRequest();
		} catch (ms){
			try{
				req = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (nonms){
				try{
					req = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (failed){
					req = null;
				}
			}  
		}
		
		if (req == null) {
			alert("Error creating request object!");
		}
                  
		//anfrage erstellen (GET, url ist localhost, request ist asynchron
		if (req.overrideMimeType) {
			req.overrideMimeType("text/html; charset=ISO-8859-1");
		}
		req.open("POST", paramGetURL, paramAsynchronous);
		
		req.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		req.setRequestHeader("Content-length", paramParams.length);
		req.setRequestHeader("Connection", "close");
		
		req.send(paramParams);
		
		document.getElementById(paramDivName).innerHTML = "<table style=\"border-width: 1px; border-style: solid; border-color: "+paramColorBorder+"; height: "+height+"px; width: "+width+"px;\" class=\"clear\"><tr><td valign=\"center\" style=\"background-color: "+paramColorBackground+"\"><center><img src=\"/includes/images/ajax_ai/"+paramLoaderGrafik+"\" alt=\"\" border=\"0\"></center></td></tr></table>";
		
		//Beim abschliessen des request wird diese Funktion ausgefuehrt
		req.onreadystatechange = function(){
			switch(req.readyState) {
				case 4:
				if(req.status!=200) {
//					alert("Fehler:"+req.status); 
				} else {
					//schreibe die antwort in den div container mit der id content 
					document.getElementById(paramDivName).style.backgroundColor = "";
					document.getElementById(paramDivName).innerHTML = req.responseText;
				}
				break;
				
				default:
				return false;
				break;     
			}
		};
	}
	
	function embedFlash (file, width, height, id, urlStart, bgcolor) {
		document.write('<object width = "'+width+'" height = "'+height+'" codebase = "'+urlStart+'download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" id = "object'+id+'" align = "middle">');
			document.write('<param name = "allowScriptAccess" value = "sameDomain" />');
			document.write('<param name = "allowFullScreen" value = "false" />');
			document.write('<param name = "movie" value = "'+urlStart+file+'" />');
			document.write('<param name = "quality" value = "high" />');
			document.write('<param name = "bgcolor" value = "'+bgcolor+'" />');
			document.write('<param name = "wmode" value = "opaque"/>');
			document.write('<embed src = "'+urlStart+file+'"');
						document.write('width = "'+width+'" height = "'+height+'" ');
						document.write('wmode = "opaque" ');
						document.write('quality = "high" bgcolor = "'+bgcolor+'" name = "'+id+'" align = "middle" ');
						document.write('allowScriptAccess = "sameDomain" allowFullScreen = "false" '); 
						document.write('type = "application/x-shockwave-flash" ');
						document.write('pluginspage = "http://www.macromedia.com/go/getflashplayer" />');
		document.write('</object>');
	}
	
	function optionenliste_verstecken(paramFeld) {
		paramForm = findFormNameForCal(paramFeld);
		
		paramFeldNicht = paramFeld.substr(0,3)+"nicht_"+paramFeld.substr(3);
		
		blnOptionAktiv = false;
		
		for (x=0; x<document.forms[paramForm].elements.length; x++) {
			fieldName = document.forms[paramForm].elements[x].name;
			
			if ((fieldName.indexOf(paramFeld+"_") == 0 && isNumeric(fieldName.replace(paramFeld+"_",""))) || (fieldName.indexOf(paramFeldNicht+"_") == 0 && isNumeric(fieldName.replace(paramFeldNicht+"_","")))) {
				if (document.forms[paramForm].elements[x].checked) {
					blnOptionAktiv = true;
				}
			}
		}
		
		if (blnOptionAktiv) {
			alert("Die Liste kann nicht zusammengeklappt werden, weil sie einen Inhalt hat.");
		}  else if (document.getElementById(paramFeld).style.display == "block") {
			document.getElementById(paramFeld).style.display = "none";
			document.getElementById('li_'+paramFeld).style.listStyleImage = "url('/includes/images/arrow.jpg')";
		} else {
			document.getElementById(paramFeld).style.display = "block";
			document.getElementById('li_'+paramFeld).style.listStyleImage = "url('/includes/images/arrow_down.jpg')";
		}
	}

	//  Erlaubt die Wahl von ENTWEDER einem ODER anderem CB.
	function beide_gleichzeitig(js_id) { //f.e. xxxUnternehmensart_27 nicht_xxxUnternehmensart_27
		if (js_id.substr(0,6) == "nicht_") { //Nein-Spalte ist gewahlt
			if ((document.getElementById(js_id).checked == true) && (document.getElementById(js_id.substr(6)).checked == true))
				document.getElementById(js_id.substr(6)).checked = false;
		} else { //Ja-Spalte ist gewahlt
			if ((document.getElementById(js_id).checked == true) && (document.getElementById('nicht_'+js_id).checked == true))
				document.getElementById('nicht_'+js_id).checked = false;		
		}
	}

/**
 * Copyright (c) 2007, Carl S. Yestrau
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *     * Redistributions of source code must retain the above copyright
 *       notice, this list of conditions and the following disclaimer.
 *     * Redistributions in binary form must reproduce the above copyright
 *       notice, this list of conditions and the following disclaimer in the
 *       documentation and/or other materials provided with the distribution.
 *     * Neither the name of Feature Blend nor the
 *       names of its contributors may be used to endorse or promote products
 *       derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY Carl S. Yestrau ''AS IS'' AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL Carl S. Yestrau BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 */
function FlashDetectBase(options){
	var self = this;
	var _release = "1.0";
	var options = options || {};
	self.installed = false;
	self.major = -1;
	self.minor = -1;
	self.revision = -1;
	self.revisionStr = "";
	self.activeXVersion = "";
	var activeXDetectRules = options.activeXDetectRules || [
		{
			"name":"ShockwaveFlash.ShockwaveFlash.7",
			"version":function(obj){return getActiveXVersion(obj);}
		},
		{
			"name":"ShockwaveFlash.ShockwaveFlash.6",
			"version":function(obj){
//				var version = "6,-1,-1,-1";
				var version = "6,0,21";
				try{
					obj.AllowScriptAccess = "always";
					version = getActiveXVersion(obj);
				}catch(err){}
				return version;
			}
		},
		{
			"name":"ShockwaveFlash.ShockwaveFlash",
			"version":function(obj){return getActiveXVersion(obj);}
		}
	];
	var getActiveXVersion = function(activeXObj){
		var version = -1;
		try{
			version = activeXObj.GetVariable("$version");
		}catch(err){}
		return version;
	}
	var getActiveXObject = function(name){
		var obj = -1;
		try{
			obj = new ActiveXObject(name);
		}catch(err){}
		return obj;
	}
	var parseActiveXVersion = function(str){
		var versionArray = str.split(",");
		return {
			"major":parseInt(versionArray[0].split(" ")[1]),
			"minor":parseInt(versionArray[1]),
			"revision":parseInt(versionArray[2]),
			"revisionStr":versionArray[2]
		};
	}
	var parseRevisionStrToInt = function(str){
		return parseInt(str.replace(/[a-zA-Z]/g,"")) || self.revision;
	}
	self.majorAtLeast = function(version){
		return self.major >= version;
	}
	self.DetectBase = function(){
		if(navigator.plugins && navigator.plugins.length>0){
			var type = 'application/x-shockwave-flash';
			var mimeTypes = navigator.mimeTypes;
			if(mimeTypes && mimeTypes[type] && mimeTypes[type].enabledPlugin && mimeTypes[type].enabledPlugin.description){
				var desc = mimeTypes[type].enabledPlugin.description;
				var descParts = desc.split(' ');
				var majorMinor = descParts[2].split('.');
				self.major = parseInt(majorMinor[0]);
				self.minor = parseInt(majorMinor[1]); 
				self.revisionStr = descParts[3];
				self.revision = parseRevisionStrToInt(self.revisionStr);
				self.installed = true;
			}
		}else if(navigator.appVersion.indexOf("Mac")==-1 && window.execScript){
			var version = -1;
			for(var i=0; i<activeXDetectRules.length && version==-1; i++){
				var obj = getActiveXObject(activeXDetectRules[i].name);
				if(typeof obj == "object"){
					self.installed = true;
					version = activeXDetectRules[i].version(obj);
					if(version!=-1){
						var versionObj = parseActiveXVersion(version);
						self.major = versionObj.major;
						self.minor = versionObj.minor; 
						self.revision = versionObj.revision;
						self.revisionStr = versionObj.revisionStr;
						self.activeXVersion = version;
					}
				}
			}
		}
	}();
}
var FlashDetect = new FlashDetectBase();

/******************************************************************************************
 ******************************************************************************************
 *Die Funktion expandWindow vergrößert bzw. verkleinert ein Objekt auf eine angegebene Größe.
 *
 *Variablen:
 *id ... ist die Id des Objektes des Größe verändert werden soll  
 *width ... ist die Breite in px die zu der aktuellen Breite des Objektes hinzugefügt werden
 *					HINWEIS: diese Größe ist beim Verkleinern natürlich negativ
 *height ... gleiche wie "width" nur bezogen auf die Höhe des Objektes
 *xDirection ... Angabe der horizontalern Richtung in die das Objekt erweitert werden soll
 *							 l ... left
 *							 r ... right  
 *yDirection ... Angabe der vertikalen Richtung in die das Objekt verändert werden soll
 *							 t ... top
 *							 b ... bottom
 *!!!Wichtig: Beim verkleinern wird immer die Richtung angegebne in der das Objekt zuvor vergrößert wurde.
 *step ... Angabe um wieviel Pixel das Objekt in jedem Zeitschritt verändert werden soll
 *speed ... Abstand der einzelnen Schritte in ms
 ******************************************************************************************
 ******************************************************************************************  
 */    

function expandWindow(id, width, height, xDirection, yDirection, step, speed) {
	
	/**********************************check parameters****************************************/
	if (typeof(width) != 'number' || typeof(height) != 'number' 
			|| typeof(step) != 'number' || typeof(speed) != 'number') {
			
			alert('expandWindow(): Einer der der numerischen Parameter wurde nicht als Zahl übergeben');
			return;
	}
		
	switch (xDirection) {
		case 'l': xDirection = -1; break;
		case 'r': xDirection = 0; break;
		default: alert('expandWindow(): Parameter xDirection muss "l" oder "r" sein!'); return; break;		
	}
	
	switch (yDirection) {
		case 't': yDirection = -1; break;
		case 'b': yDirection = 0; break;
		default: alert('expandWindow(): Parameter yDirection muss "t" oder "b" sein!'); return; break;		
	}

	if (step == '') step = 1;
	if (speed == '') speed = 10;
	
	/***************************************set variables**************************************/
	obj = document.getElementById(id);
	endSizeWidth = parseInt(obj.style.width) + width;
	endSizeHeight = parseInt(obj.style.height) + height;
	
	/*************************************call functions**************************************/
	if (endSizeWidth != parseInt(obj.style.width) && endSizeWidth > 50) {
		activWidthInterval = window.setInterval('doExpandWidth(obj, endSizeWidth, '+xDirection+', '+step+'); if (parseInt(obj.style.width) == endSizeWidth) {window.clearInterval(activWidthInterval);}', speed);
	}
	
	if (endSizeHeight != parseInt(obj.style.height) && endSizeHeight > 50) {
		activHeightInterval = window.setInterval('doExpandHeight(obj, endSizeHeight, '+yDirection+', '+step+'); if (parseInt(obj.style.height) == endSizeHeight) {window.clearInterval(activHeightInterval);}', speed);
	}
	
}

/******************************* veraendert die breite eines Objektes ************************/

function doExpandWidth(obj, endSizeWidth, xDirection, step) {
	
	if (parseInt(obj.style.width) < endSizeWidth)	factor = 1;
	else factor = -1;
	
	newWidth = parseInt(obj.style.width) + (factor * step);
	newLeftPos = parseInt(obj.style.left) + (1 * xDirection * factor * step);
	
	obj.style.width = newWidth + 'px';
	obj.style.left = newLeftPos + 'px';
}

/******************************* veraendert die Hoehe eines Objektes ************************/

function doExpandHeight(obj, endSizeHeight, yDirection, step) {
	
	if (parseInt(obj.style.height) < endSizeHeight)	factor = 1;
	else factor = -1;
	
	newHeight = parseInt(obj.style.height) + (factor * step);
	newTopPos = parseInt(obj.style.top) + (1 * yDirection * factor * step);
	
	obj.style.height = newHeight + 'px';
	obj.style.top = newTopPos + 'px';
}

/********Seite zu den Favoriten hinzufuegen************/
function addToFavorites(pageTitle) {
	var strHotkey = 'Strg + D';
	
	if (document.all) {
		window.external.AddFavorite( document.URL, pageTitle); 
	} else {
		alert('Druecken Sie '+strHotkey+' um die Seite zu Ihren Favoriten hinzuzufuegen');
	}
}

/******** Zeigt einen Preloader, bevor die Seite geladen wird ************/
// Created by: Simon Willison | http://simon.incutio.com/
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

function showPreloader(paramFrame,newLocation) {

	MM_preloadImages("/includes/images/preloader.gif");
	if(typeof paramFrame == "undefined") {
		document.write('<div id="loading" style="position: absolute; width: 100%; top: 50%;margin-top: -66px;z-index:6;" align="center"><img src="/includes/images/preloader.gif" /><div style="position: absolute; font-family: Arial;width: 100%; left: 0;top: 50%;overflow: hidden;margin-top: -15px;z-index:6; font-size: 12px; font-weight: 900; text-align: center;">&nbsp;&nbsp;&nbsp;Bitte warten...</div></div>');
	} else {
		parent.frames[paramFrame].document.write('<div id="loading" style="position: absolute; width: 100%; top: 50%;margin-top: -66px;z-index:6;" align="center"><img src="/includes/images/preloader.gif" /><div style="position: absolute; font-family: Arial;width: 100%; left: 0;top: 50%;overflow: hidden;margin-top: -15px;z-index:6; font-size: 12px; font-weight: 900; text-align: center;">&nbsp;&nbsp;&nbsp;Bitte warten...</div></div>');
	}
	if(typeof newLocation != "undefined") {
		window.location.href=newLocation;
	}
	addLoadEvent(function() {
		document.getElementById("loading").style.display="none";
	});

}

//Diese Funktion ermittelt den Namen des Formulars, indem sich das Element mit der Id paramName befindet (benötigt für die Erstellung des Tigra-Calendars)
	function findFormNameForCal(paramName) {

		//Den ersten Eltern-Knoten finden.
		objSearchingNode = document.getElementById(paramName).parentNode;
		
		//So lange auf die Elternknoten zugreifen, bis der Knoten FORM gefunden wird.
		while (objSearchingNode.tagName != "FORM") {
			objSearchingNode = objSearchingNode.parentNode;
		}
		return objSearchingNode.attributes["name"].nodeValue;
	}
	
	//Diese Funktion ermittelt die Koordinaten des Cursors aus dem Bildschirm.
	function mousepos(e) {
		x = (document.all) ? window.event.x + document.body.scrollLeft : e.pageX;
		y = (document.all) ? window.event.y + document.body.scrollTop  : e.pageY;
		alert(x);
		return x;
	}
	
	//Diese Funktion öffnet ein GreyBox Popup-Fenster
	GB_dvbPopup = function(caption, url, /* optional */ height, width, callback_fn, showClosePic) {
    	
		intClientHoehe = document.documentElement.clientHeight;
		intClientBreite = document.documentElement.clientWidth;
		
		if (typeof(intClientHoehe) == "undefined") {
			intClientHoehe = document.body.clientHeight;
		}
		
		if (typeof(intClientBreite) == "undefined") {
			intClientBreite = document.body.clientWidth;
		}
		
		if (typeof(height) == "undefined") {
			maxHeight = Math.min((intClientHoehe-50),600);
		} else {
			maxHeight = Math.min((intClientHoehe-50),height);
		}
		
		if (typeof(width) == "undefined") {
			maxWidth = Math.min((intClientBreite-50),663);
		} else {
			maxWidth = Math.min((intClientBreite-50),width);
		}
		
		if (typeof(showClosePic) == "undefined") {
			showClosePic = true;
		}
		
		var options = {
    	    caption: caption,
	        height: maxHeight,
        	width: maxWidth,
    	    fullscreen: false,
	        show_loading: true,
        	callback_fn: callback_fn,
			center_win: true,
			show_close_img: showClosePic
	    }
		
    	var win = new parent.GB_Window(options);
		document.body.style.overflow = 'hidden';
		document.body.style.marginRight = '20px';
	    return win.show(url);
	}
	
	//Diese Funktion oeffnet ein GreyBox Popup-Fenser aus einem GreyBox Popup-Fenster (das Hauptfenster wird geschlossen, das neue Fenster nach 0,3 Sek, geoefffnet)
	function GB_dvbPopup_aus_GB(strParamTitel,strParamLink, /* optional */ height, width, callback_fn) {
		window.setTimeout("GB_dvbPopup('"+strParamTitel+"', '"+strParamLink+"',"+height+", "+width+", "+callback_fn+")",500);
	}
	
	function actionNotizAufrufen(paramId,paramThema,paramQuery,paramInhalt) {
		if (paramInhalt != "") {
			strLoeschen = "<a href='javascript:actionNotizSpeichern("+paramId+",\""+paramThema+"\",\""+paramQuery+"\",\"\");' style='margin-left: 120px;'>Löschen...</a>";
		} else {
			strLoeschen = "";
		}
		
		if (paramQuery != "") {
			strDIVId = paramQuery;
		} else {
			strDIVId = paramId;
		}
		
		Tip("<div id='container_notiz_"+paramThema+"_"+strDIVId+"' style='width: 250px; height: 120px;'><textarea name='notiz_wert_"+paramThema+"_"+strDIVId+"' id='notiz_wert_"+paramThema+"_"+strDIVId+"' style='width: 248px; height: 100px;'>"+paramInhalt+"</textarea><br><a href='javascript:actionNotizSpeichern(\""+paramId+"\",\""+paramThema+"\",\""+paramQuery+"\",document.getElementById(\"notiz_wert_"+paramThema+"_"+strDIVId+"\").value);'>Speichern...</a>"+strLoeschen+"</div>",WIDTH,-250,TITLE,"Notiz anfertigen");
		if (paramInhalt == "") {
			window.setTimeout("document.getElementById('notiz_wert_"+paramThema+"_"+strDIVId+"').focus();",250);
		}
	}
	
	function actionNotizSpeichern(paramId,paramThema,paramQuery,paramInhalt) {
		if (paramQuery != "") {
			strDIVId = paramQuery;
		} else {
			strDIVId = paramId;
		}
		requestAJAX('/meine_dvb/notiz.ajax.php','xxxId='+paramId+'&xxxThema='+paramThema+'&xxxQuery='+paramQuery+'&xxxNotiz='+paramInhalt,'notiz_'+paramThema+'_'+strDIVId,'vlittle_circle.gif');
		window.setTimeout("tt_HideInit();",150);
		window.setTimeout("requestAJAX('/meine_dvb/merkzettel.ajax.php','xxxId="+paramId+"&xxxQuery="+paramQuery+"&xxxThema="+paramThema+"&xxxCheckStatus=1','merkzettel_"+paramThema+"_"+strDIVId+"','vlittle_circle.gif');",1000);
		
		if (document.getElementById("notiz_einblendung_"+paramThema+"_"+paramId) != null) {
			window.setTimeout("requestAJAX('/meine_dvb/notiz_einblendung.ajax.php','xxxId="+paramId+"&xxxThema="+paramThema+"','notiz_einblendung_"+paramThema+"_"+paramId+"','vlittle_circle.gif');",1000);
		}
	}
	
	function actionMerkzettel(paramId,paramThema,paramQuery,paramNotiz) {
		if (paramQuery != "") {
			strDIVId = paramQuery;
		} else {
			strDIVId = paramId;
		}
		
		if (paramNotiz != "") {
			if (confirm("Mit der Entfernung aus dem Merkzettel wird automatisch auch Ihre Notiz gelöscht. Fortfahren?")) {
				blnAktionDurchfuehren = true;
			} else {
				blnAktionDurchfuehren = false;
			}
		} else {
			blnAktionDurchfuehren = true;
		}
		
		if (blnAktionDurchfuehren) {
			requestAJAX('/meine_dvb/merkzettel.ajax.php','xxxId='+paramId+'&xxxThema='+paramThema+'&xxxQuery='+paramQuery,'merkzettel_'+paramThema+'_'+strDIVId,'vlittle_circle.gif');
			window.setTimeout("requestAJAX('/meine_dvb/notiz.ajax.php','xxxId="+paramId+"&xxxThema="+paramThema+"&xxxQuery="+paramQuery+"&xxxCheckStatus=1','notiz_"+paramThema+"_"+strDIVId+"','vlittle_circle.gif');",1000);
			if (document.getElementById("notiz_einblendung_"+paramThema+"_"+paramId) != null) {
				window.setTimeout("window.location.reload();",1500);
			}
		}
	}
	
	var intElementKalenderIndex = 0;
	arrElementKalender = new Array();
     
	/////////////////////////////////////////////////////////////////////////////////
	//Die beiden folgenden Funktionen ermitteln die absolute position eines Elements 
	////////////////////////////////////////////////////////////////////////////////
	
	//absolute Position left
	function getOffsetLeft(element){
		if(!element) return 0;
		return element.offsetLeft + getOffsetLeft(element.offsetParent);
	}
	
	//absolute Position top
	function getOffsetTop(element){
		if(!element) return 0;
		return element.offsetTop + getOffsetTop(element.offsetParent);
	}
	
	/////////////////////////////////////////////////////////////////////////////////
	//Die Funktion scrollt das Fenster zu dem angegebenen Element 
	////////////////////////////////////////////////////////////////////////////////

	function scrollToElement(e, elem) {
  	var selectedPosY = getOffsetTop(elem);
		if (e.clientY) {
  		var posTop = e.clientY;
 		}
 		window.scrollTo(0, selectedPosY - posTop + 10);
	}//Ende Funktion
	
	//Diese Funktion oeffnet ein Popup mit der Druckvorschau - wird durch Klick auf ActionsIcon Drucken (default) ausgefuehrt.
	function defaultDruckenAI() {
		var strSearch = window.location.search;
		
		if (strSearch == "") {
			strSearch = "?xxxDrucken";
		} else {
			strSearch = strSearch+"&xxxDrucken";
		}
		
		mypopup(window.location.pathname+strSearch,800,600,1);
	}
	
/***********************************************
* Pausing up-down scroller- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/

function pausescroller(content, divId, divClass, delay){
this.content=content //message array content
this.tickerid=divId //ID of ticker div to display information
this.delay=delay //Delay between msg change, in miliseconds.
this.mouseoverBol=0 //Boolean to indicate whether mouse is currently over scroller (and pause it if it is)
this.hiddendivpointer=1 //index of message array for hidden div
document.write('<div id="'+divId+'" class="'+divClass+'" style="position: relative; overflow: hidden"><div class="innerDiv" style="position: absolute; width: 100%" id="'+divId+'1">'+content[0]+'</div><div class="innerDiv" style="position: absolute; width: 100%; visibility: hidden" id="'+divId+'2">'+content[1]+'</div></div>')
var scrollerinstance=this
if (window.addEventListener) //run onload in DOM2 browsers
window.addEventListener("load", function(){scrollerinstance.initialize()}, false)
else if (window.attachEvent) //run onload in IE5.5+
window.attachEvent("onload", function(){scrollerinstance.initialize()})
else if (document.getElementById) //if legacy DOM browsers, just start scroller after 0.5 sec
setTimeout(function(){scrollerinstance.initialize()}, 500)
}

// -------------------------------------------------------------------
// initialize()- Initialize scroller method.
// -Get div objects, set initial positions, start up down animation
// -------------------------------------------------------------------

pausescroller.prototype.initialize=function(){
this.tickerdiv=document.getElementById(this.tickerid)
this.visiblediv=document.getElementById(this.tickerid+"1")
this.hiddendiv=document.getElementById(this.tickerid+"2")
this.visibledivtop=parseInt(pausescroller.getCSSpadding(this.tickerdiv))
//set width of inner DIVs to outer DIV's width minus padding (padding assumed to be top padding x 2)
this.visiblediv.style.width=this.hiddendiv.style.width=this.tickerdiv.offsetWidth-(this.visibledivtop*2)+"px"
this.getinline(this.visiblediv, this.hiddendiv)
this.hiddendiv.style.visibility="visible"
var scrollerinstance=this
document.getElementById(this.tickerid).onmouseover=function(){scrollerinstance.mouseoverBol=1}
document.getElementById(this.tickerid).onmouseout=function(){scrollerinstance.mouseoverBol=0}
if (window.attachEvent) //Clean up loose references in IE
window.attachEvent("onunload", function(){scrollerinstance.tickerdiv.onmouseover=scrollerinstance.tickerdiv.onmouseout=null})
setTimeout(function(){scrollerinstance.animateup()}, this.delay)
}


// -------------------------------------------------------------------
// animateup()- Move the two inner divs of the scroller up and in sync
// -------------------------------------------------------------------

pausescroller.prototype.animateup=function(){
var scrollerinstance=this
if (parseInt(this.hiddendiv.style.top)>(this.visibledivtop+5)){
this.visiblediv.style.top=parseInt(this.visiblediv.style.top)-5+"px"
this.hiddendiv.style.top=parseInt(this.hiddendiv.style.top)-5+"px"
setTimeout(function(){scrollerinstance.animateup()}, 50)
}
else{
this.getinline(this.hiddendiv, this.visiblediv)
this.swapdivs()
setTimeout(function(){scrollerinstance.setmessage()}, this.delay)
}
}

// -------------------------------------------------------------------
// swapdivs()- Swap between which is the visible and which is the hidden div
// -------------------------------------------------------------------

pausescroller.prototype.swapdivs=function(){
var tempcontainer=this.visiblediv
this.visiblediv=this.hiddendiv
this.hiddendiv=tempcontainer
}

pausescroller.prototype.getinline=function(div1, div2){
div1.style.top=this.visibledivtop+"px"
div2.style.top=Math.max(div1.parentNode.offsetHeight, div1.offsetHeight)+"px"
}

// -------------------------------------------------------------------
// setmessage()- Populate the hidden div with the next message before it's visible
// -------------------------------------------------------------------

pausescroller.prototype.setmessage=function(){
var scrollerinstance=this
if (this.mouseoverBol==1) //if mouse is currently over scoller, do nothing (pause it)
setTimeout(function(){scrollerinstance.setmessage()}, 100)
else{
var i=this.hiddendivpointer
var ceiling=this.content.length
this.hiddendivpointer=(i+1>ceiling-1)? 0 : i+1
this.hiddendiv.innerHTML=this.content[this.hiddendivpointer]
this.animateup()
}
}

pausescroller.getCSSpadding=function(tickerobj){ //get CSS padding value, if any
if (tickerobj.currentStyle)
return tickerobj.currentStyle["paddingTop"]
else if (window.getComputedStyle) //if DOM2
return window.getComputedStyle(tickerobj, "").getPropertyValue("padding-top")
else
return 0
}

				
	function sort_zufall(a,b) {
		return Math.random()-Math.random()
	}
	
	function displayCountdown(countdn,cd,paramMeldung) {
		if (countdn < 0) {
			document.getElementById(cd).innerHTML = "Sorry, you are too late.";
		} else {
			var secs = countdn % 60;
		}
		
		if (secs < 10) {
			secs = '0'+secs;
		}
		
		var countdn1 = (countdn - secs) / 60;
		var mins = countdn1 % 60;
		
		if (mins < 10) {
			mins = '0'+mins;
		}
		
		countdn1 = (countdn1 - mins) / 60;
		
		var hours = countdn1 % 24;
		var days = (countdn1 - hours) / 24;
		
		if (days == "0" && hours == "0" && mins == "00" && secs == "00") {
			document.getElementById(cd).innerHTML = paramMeldung;
		} else {
			document.getElementById(cd).innerHTML = days+'T  '+hours+':'+mins+':'+secs;setTimeout('displayCountdown('+(countdn-1)+',\''+cd+'\',\''+paramMeldung+'\');',999);
		}
	}
	
	function Fader(el, fadeIn) {
		var me = this;
		this.el = (typeof(el) == "object")?el:(typeof(el) == "string")?document.getElementById(el):null;
		this.fadeIn = fadeIn;
		this.doFade = doFade;
		this.setOpacity = setOpacity;
		this.showElement = showElement;
		this.opacity = 0;
		
		this.doFade();
		
		function setOpacity() {
			if (typeof(this.el.style.opacity) != null) this.el.style.opacity = this.opacity / 100;
			if (typeof(this.el.style.filter) != null) this.el.style.filter = "alpha(opacity=" + this.opacity + ")";
			this.opacity += (this.fadeIn)?1:-1;
		}
		
        function showElement(show) {
			if (this.el && this.el.style) this.el.style.display = (show)?"block":(this.fadeIn)?"block":"none";
		}
		
		function doFade() {
			this.showElement(true);
			if (this.fadeIn) {
				this.opacity = 0;
				this.setOpacity();
				
				for (var i=0; i<=100; i++) {
					var newFunc = function() { me.setOpacity(); };
					setTimeout(newFunc, 8*i);
				}
			} else {
				this.opacity = 100;
				this.setOpacity();
				
				for (var i=0; i<=100; i++) {
					var newFunc = function() { me.setOpacity(); };
					setTimeout(newFunc, 8*i);
				}
			}
			
			var newFunc = function () { me.showElement(); };
			
			setTimeout(newFunc, 810);
		}
	}
	
	function fade(obj, fadeIn) {
		if (obj) new Fader(obj, fadeIn);
	}

	function verbraucherbalkenCookie() {
		var objAblauf = new Date();
		var indreihundertTagen = objAblauf.getTime() + (300 * 24 * 60 * 60 * 1000);
		objAblauf.setTime(indreihundertTagen);
		document.cookie = "verbraucherbalkenNichtAnzeigen=ja; path=/; expires=" + objAblauf.toGMTString();
	}
