var openerWecker;
var openerTracker;
var openerEmpfehlung;
var openerNewsletter;
var openerMobilsuche;
var baseopacity=40

//**********************
//Funktionen fuer Popups
//**********************
function BewegeWecker() {
 if (navigator.appName == "Netscape") {
   openerWecker.moveTo(window.screenX+144,self.screenY);
 } else {
   openerWecker.moveTo(top.screenLeft+144,top.screenTop);
 }

 if(openerTracker && openerTracker.closed != true) {
 	openerTracker.focus();
 }
 if(openerEmpfehlung && openerEmpfehlung.closed != true) {
 	openerEmpfehlung.focus();
 }
 openerWecker.focus();
};

function BewegeTracker() {
 if (navigator.appName == "Netscape") {
   openerTracker.moveTo(window.screenX+144,self.screenY+100);
 } else {
   openerTracker.moveTo(top.screenLeft+144,top.screenTop+120);
 }
  if(openerWecker && openerWecker.closed != true) {
 	openerWecker.focus();
 }
 if(openerEmpfehlung && openerEmpfehlung.closed != true) {
 	openerEmpfehlung.focus();
 }
 openerTracker.focus();
};

function BewegeEmpfehlung() {
 if (navigator.appName == "Netscape") {
   openerEmpfehlung.moveTo(window.screenX+144,self.screenY);
 } else {
   openerEmpfehlung.moveTo(top.screenLeft+144,top.screenTop);
 }
 if(openerWecker && openerWecker.closed != true) {
 	openerWecker.focus();
 }
 if(openerTracker && openerTracker.closed != true) {
 	openerTracker.focus();
 }
 openerEmpfehlung.focus();
};

function BewegeNewsletter() {
 if (navigator.appName == "Netscape") {
   openerNewsletter.moveTo(window.screenX+144,self.screenY);
 } else {
   openerNewsletter.moveTo(top.screenLeft+144,top.screenTop);
 }
 if(openerNewsletter && openerNewsletter.closed != true) {
 	openerNewsletter.focus();
 }
 if(openerNewsletter && openerNewsletter.closed != true) {
 	openerNewsletter.focus();
 }
 openerNewsletter.focus();
};

function BewegeMobilsuche() {
 if (navigator.appName == "Netscape") {
   openerMobilsuche.moveTo(window.screenX+144,self.screenY);
 } else {
   openerMobilsuche.moveTo(top.screenLeft+144,top.screenTop);
 }
 if(openerMobilsuche && openerMobilsuche.closed != true) {
 	openerMobilsuche.focus();
 }
 if(openerMobilsuche && openerMobilsuche.closed != true) {
 	openerMobilsuche.focus();
 }
 openerMobilsuche.focus();
};


function seitezeigenWecker(HTMLPage) {
	openerWecker = window.open(HTMLPage,"infoWecker","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,copyhistory=0,width=620,height=505");
    BewegeWecker();
};

function seitezeigenTracker(HTMLPage) {
	openerTracker = window.open(HTMLPage,"infoTracker","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,copyhistory=0,width=610,height=557");
    BewegeTracker();
};

function seitezeigenEmpfehlung(HTMLPage) {
	openerEmpfehlung = window.open(HTMLPage,"infoEmpfehlung","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,copyhistory=0,width=625,height=500");
    BewegeEmpfehlung();
};

function seitezeigenNewsletter(HTMLPage) {
	openerNewsletter = window.open(HTMLPage,"infoNewsletter","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,copyhistory=0,width=625,height=590");
    BewegeNewsletter();
};

function seitezeigenMobilsuche(HTMLPage) {
	openerMobilsuche = window.open(HTMLPage,"infoMobilsuche","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,copyhistory=0,width=625,height=590");
    BewegeMobilsuche();
};
//***************************
//Ende Funktionen fuer Popups
//***************************

//***************************
//Allgemeine Funktionen
//***************************
function Preisaus() {
  document.sucheex.p1.value="";
  document.sucheex.p2.value="";
};

function Preisklick() {
  document.sucheex.volltext[1].checked=true;
};


 function SuchfeldFocus()
 {
    var eSuchfeld=document.getElementById("searchForm");
    if(eSuchfeld) {
    	if(location.hash=="") {
  			eSuchfeld.focus();
  		}
    }
 };

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d){d=document;} if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all){x=d.all[n];} for (i=0;!x&&i<d.forms.length;i++){ x=d.forms[i][n];}
  for(i=0;!x&&d.layers&&i<d.layers.length;i++){x=MM_findObj(n,d.layers[i].document);}
  if(!x && d.getElementById){x=d.getElementById(n);} return x;
};

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3){if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }}
};

//Suchstring ueber einen Reiterwechsel hinweg retten
function Registerwechsel(sZiel)
{
	eSuchfeld=document.getElementById("searchForm");
	if(eSuchfeld) {
		if(eSuchfeld.value!="") {
			sSucheingabe=eSuchfeld.value;
			sSucheingabe=str_replace("/","___",sSucheingabe);
			sSucheingabe=str_replace("&","____",sSucheingabe);
			location.href=sZiel+"suche/"+encodeURIComponent(sSucheingabe)+".html";
		} else {
			location.href=sZiel;
		}
	} else {
		location.href=sZiel;
	}
	return false;
};


//Hilfsfunktion  str_replace
function str_replace(search, replace, subject) {
    return subject.split(search).join(replace);
};


function RegisterwechselVolltext(sZiel)
{
	eSuchfeld=document.getElementById("searchForm");
	if(eSuchfeld) {
		if(eSuchfeld.value!="") {
			sSucheingabe=eSuchfeld.value;
			sSucheingabe=str_replace("/","___",sSucheingabe);
			sSucheingabe=str_replace("&","____",sSucheingabe);
			location.href=sZiel+"suchevoll/"+encodeURIComponent(sSucheingabe)+".html";
		} else {
			location.href=sZiel;
		}
	} else {
		location.href=sZiel;
	}
	return false;
};


function RegisterwechselNews(sZiel)
{
	//bei Volltextsuche einfach im Formular das hidden Feld setzen
	//und dann das Formular abschicken
	document.forms[0].bVolltext.value=0;
	document.forms[0].bNews.value=1;
	document.forms[0].AKT.value="newssearch";
	document.forms[0].submit();
	return false;
};


function messageOut(sBereichsname,asText)
{
	eBereich=document.getElementById(sBereichsname);
	if(eBereich) {
		while(eBereich.hasChildNodes()) {
			eBereich.removeChild(eBereich.firstChild);
		}
		for(i=0;i<asText.length;i++) {
			eBereich.appendChild(document.createTextNode(asText[i]));
			eBereich.appendChild(document.createElement("br"));
		}
	}
};


function pruefFormular()
{
	asText=new Array();
	var i=0;
	var eFormular=document.forms[1];
	var bFehler=false;

	if(eFormular) {
		if(eFormular.sName && eFormular.sName.value=="") {
			asText[i]="Bitte einen Namen eingeben.";
			bFehler=true;
			i++;
		}
		if(eFormular.sTitel && eFormular.sTitel.value=="") {
			asText[i]="Bitte einen Titel eingeben.";
			bFehler=true;
			i++;
		}
		if(eFormular.sNachricht && eFormular.sNachricht.value=="") {
			asText[i]="Bitte eine Nachricht eingeben.";
			bFehler=true;
			i++;
		}
		if(eFormular.iCode) {
			if(eFormular.iCode.value=="") {
				asText[i]="Bitte den Zahlencode eingeben.";
				bFehler=true;
				i++;
			} else {
			    sVergleich="";
				if(eFormular.sCapText) {
		   	 		sVergleich=((MD5(eFormular.sCapText.value)).toUpperCase()).substr(0,6);
				}
				if(sVergleich!=eFormular.iCode.value) {
					asText[i]="Fehler bei Eingabe des Zahlencodes. Bitte erneut versuchen";
					bFehler=true;
					i++;
				}
			}
		}

		if(bFehler) {
			messageOut("meldung",asText)
			location.hash="formular";
			return false;
		}
	}
	return true;
};
//***************************
//Ende Allgemeine Funktionen
//***************************

//***************************
//Funktionen fuer News und Blogs
//***************************
var aBewertungen = new Array('schlecht','ausreichend','durchschnittlich','gut','ausgezeichnet');
var eBewertungWeiter;
var eBewertung3;
var eBewertung4;
var eBewertung5;
var eBewertung6;
var eWordcounterBeschreibung
var eSendenButton;
var eBalken;
var eUeberschrift;
var eNachricht;
var eName;


function initBlog(bNeuinitialisierung,sButtonpic) {
	eBewertungWeiter = document.getElementById('bewertungWeiter');
	eBewertung3 = document.getElementById('neubewertung3');
	eBewertung4 = document.getElementById('neubewertung4');
	eBewertung5 = document.getElementById('neubewertung5');
	eBewertung6 = document.getElementById('neubewertung6');
	eWordcounterBeschreibung = document.getElementById('wordcounterBeschreibung');
	eSendenButton = document.getElementById('sendenButton');
	eBalken = document.getElementById('balken');
	eUeberschrift = document.getElementById('ueberschrift');
	eNachricht = document.getElementById('nachricht');
	eName = document.getElementById('name');

	if(eBewertung5) {
		eBewertung5.style.visibility='visible';
	}

	//Button ausgrauen und deaktivieren
	if(eSendenButton) {
		eSendenButton.disabled = true;
		eSendenButton.src = sButtonpic;
	}

	//wordcounter und zugehoerige Erklaerung einblenden
	if(eWordcounterBeschreibung) {
		eWordcounterBeschreibung.style.visibility = 'visible';
	}
	if(eBalken) {
		eBalken.style.visibility = 'visible';
	}

	if(bNeuinitialisierung) {
		//vorerst nicht sichtbare Bereiche ausblenden

		if(eBewertungWeiter) {
			eBewertungWeiter.style.display= 'none';
		}
		if(eBewertung3) {
			eBewertung3.style.visibility = 'hidden';
		}
		if(eBewertung4) {
			eBewertung4.style.visibility = 'hidden';
		}
		if(eBewertung5) {
			eBewertung5.style.visibility = 'hidden';
		}
		if(eBewertung6) {
			eBewertung6.style.visibility = 'hidden';
		}

		//alle Sterne auf leer setzen
		for(i=1;i<6;i++) {
			var eStern=document.getElementById("stern"+i);
			if(eStern) {
				eStern.style.backgroundPosition="bottom";
			}
		}
	}
}

//aendern der Grafiken (Sterne) bei Bewertung von Blogs (onmouseover)
function showBewertung(iWertung)
{
	//console.log('Visibility: ' + eBewertung5.style.visibility);
	if(eBewertung5) {
		if(eBewertung5.style.visibility == 'visible') {
			return;
		}
	}
	for(i=1;i<6;i++) {
		var eStern=document.getElementById("stern"+i);
		if(eStern) {
			if(i<=iWertung) {
				eStern.style.backgroundPosition="top";
				if(i==iWertung) {
					eStern.blur();
				}
			} else {
				eStern.style.backgroundPosition="bottom";
			}
		}
	}
	if(eBewertung4) {
		eBewertung4.style.visibility = 'visible';
		eBewertung4.innerHTML = aBewertungen[iWertung-1];
	}
};


//aendern der Grafiken (Sterne) bei Bewertung von News oder Blogs (Klick)
function bewertung(iWertung, bWeiterleitung)
{
	var eHidden = document.getElementById("iBewertung");
	var eTextbereich = document.getElementById("bewertung");
	for(i=1;i<6;i++) {
		var eStern=document.getElementById("stern"+i);
		if(eStern) {
			if(i<=iWertung) {
				eStern.style.backgroundPosition="top";
				if(i==iWertung) {
					eStern.blur();
				}
			} else {
				eStern.style.backgroundPosition="bottom";
			}
		}
	}
	if(eHidden) {
		eHidden.value=iWertung;
	}
	if(eTextbereich) {
		eTextbereich.innerHTML = aBewertungen[iWertung-1];
	}
	if(eBewertungWeiter) {
		eBewertungWeiter.style.display = 'block';
	}
	if(eBewertung3) {
		eBewertung3.style.visibility = 'visible';
	}
	if(eBewertung4) {
		eBewertung4.style.visibility = 'visible';
		eBewertung4.innerHTML = aBewertungen[iWertung-1];
	}
	if(eBewertung5) {
		eBewertung5.style.visibility = 'visible';
	}
	if(eBewertung6) {
		eBewertung6.style.visibility = 'visible';
	}
};


//Woerter in Textarea zaehlen und bei 15 oder mehr Woertern den Button freischalten
function wordcounter(iMinwords,sPicEnabled,sPicDisabled) {
	if(eNachricht) {
		var aWoerter = eNachricht.value.split(' ');
		var iAnzahl = aWoerter.length;
		for(i=0;i<aWoerter.length;i++) {
			if(aWoerter[i]=='') {
				iAnzahl--;
			}
		}
		if(eSendenButton && eBalken) {
			if(iAnzahl >= iMinwords) {
				eSendenButton.disabled = false;
				if(eUeberschrift.value != '' && eName.value != '') {
					eSendenButton.src = sPicEnabled;
					eSendenButton.style.cursor = 'pointer';
					eSendenButton.title = '';
				} else {
					eSendenButton.disabled = true;
					eSendenButton.src = sPicDisabled;
					eSendenButton.style.cursor = 'crosshair';
					eSendenButton.title = 'Bitte noch Name und �berschrift eintragen';
				}
				eBalken.alt = 'Mehr als 15 Worte'
				eBalken.src = aBilder[iMinwords];
			} else {
				if(iAnzahl < 0) {
					iAnzahl = 0;
				}
				eSendenButton.disabled = true;
				eSendenButton.src = sPicDisabled;
				eSendenButton.style.cursor = 'crosshair';
				eBalken.src = aBilder[iAnzahl];
				eBalken.alt = iAnzahl + ' Wort' + ((iAnzahl > 1) ? 'e' : '');
			}
		}
	}
}


//aendern der hilfreich/nicht hilfreich Grafiken bei Mouseover
function changeIcon(eImg,sGrafik)
{
	eImg.src = sGrafik;
}

//fuer Kommentare zu news: KID setzen und zum Formular springen
function schreibKommentar(KID)
{
	eKID=document.getElementById("KID");
	if(eKID) {
		eKID.value=KID;
	}
	document.location.hash="#formular";
};

//fuer Kommentare zu Blogs: BID und KID setzen und zum Formular springen.
//Gleichzeitig Erscheinungsbild des Formulars anpassen
function schreibKommentarOderBlog(BID,KID)
{
	eKID=document.getElementById("KID");
	eBID=document.getElementById("BID");
	if(eKID && eBID) {
		eKID.value=KID;
		eBID.value=BID;

		eText1=document.getElementById("beschreibungBlog");
		eText2=document.getElementById("beschreibungKommentar");
		eEingabe1=document.getElementById("zeileUrl");
		eEingabe3=document.getElementById("zeileBewerten");
		eEingabe4=document.getElementById("zeileBewerten2");
		if(eText1 && eText2 && eEingabe1 && eEingabe3 && eEingabe4) {
			if(BID==0) {
				eEingabe1.style.display="table-row";
				eEingabe3.style.display="table-row";
				eEingabe4.style.display="table-row";
				eText1.style.display="block";
				eText2.style.display="none";
			} else {
				eEingabe1.style.display="none";
				eEingabe3.style.display="none";
				eEingabe4.style.display="none";
				eText1.style.display="none";
				eText2.style.display="block";
			}
		}
	}
	document.location.hash="#formular";
};
//***************************
//Ende Funktionen fuer News und Blogs
//***************************

//***************************
//Funktionen fuer Info-Layer
//***************************
function showLayer(link, message, xOffset)
{
	if(typeof xOffset == 'undefined') {
      // default-wert:
      xOffset = 0;
    }
	message=str_replace("&apos;","'",message);
	document.getElementById("layerInfo").innerHTML = message;
    var x = 0, y = 0;
    do {
    	x += link.offsetLeft;
     	y += link.offsetTop;
    }
    while (link = link.offsetParent){;}
    tmp = document.getElementById("layerInfo").style;
    //tmp.left = (x-225)+"px";
    tmp.left = (x+xOffset)+"px";
	tmp.top  = (y)+"px";
	tmp.display = "block";
	tmp.zIndex = 99;
};


function hideLayer()
{
	document.getElementById("layerInfo").style.display="none";
};
//***************************
//Ende Funktionen fuer Info-Layer
//***************************

//***************************
//Funktionen fuer Hilfeseite
//***************************
/***********************************************
* Gradual Highlight image script - Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
*********************************************/
function slowhigh(which2){
	imgobj=which2;
	browserdetect=which2.filters? "ie" : typeof which2.style.MozOpacity=="string"? "mozilla" : "";
	instantset(baseopacity);
	highlighting=setInterval("gradualfade(imgobj)",50);
};

function slowlow(which2){
	cleartimer();
	instantset(baseopacity);
};

function instantset(degree){
	if (browserdetect=="mozilla") {
		imgobj.style.MozOpacity=degree/100;
	} else if (browserdetect=="ie") {
		imgobj.filters.alpha.opacity=degree
	}
};

function cleartimer(){
	if (window.highlighting){
		clearInterval(highlighting);
	}
};

function gradualfade(cur2){
	if (browserdetect=="mozilla" && cur2.style.MozOpacity<1) {
		cur2.style.MozOpacity=Math.min(parseFloat(cur2.style.MozOpacity)+0.1, 0.99);
	} else if (browserdetect=="ie" && cur2.filters.alpha.opacity<100) {
		cur2.filters.alpha.opacity+=10;
	} else if (window.highlighting) {
		clearInterval(highlighting);
	}
};
//***************************
//Ende Funktionen fuer Hilfeseite
//***************************


//***************************
//Funktionen Ajax
//***************************
function initAjax() {
	if (typeof XMLHttpRequest != 'undefined') {
	    xmlHttp = new XMLHttpRequest();
	} else {
		var xmlHttp = false;
	}

	if (!xmlHttp) {
	    try {
	        xmlHttp  = new ActiveXObject("Msxml2.XMLHTTP");
	    } catch(e) {
	        try {
	            xmlHttp  = new ActiveXObject("Microsoft.XMLHTTP");
	        } catch(e) {
	            xmlHttp  = null;
	        }
	    }
	}
	return xmlHttp;
};

var sFWP_SS_TextField = "searchForm";
var sFWP_SS_Layer = "suggestions";
var sFWP_SS_bg = "fwpBg";
var iFWP_SS_Pos = -1;
var iFWP_SS_Timeout = null;
var iFWP_SS_TimeoutLength = 300;
var iFWP_SS_MinLength = 4;
var aFWP_SS_Url = new Array;
var bSearchHelp = false;
var sBaseUrl = "";

function searchHelp( sUrl )
{
	alert( sUrl );
	bSearchHelp = true;
	window.location.href=sUrl;
};

function fwpInitSuggest(sUebergabe)
{
	sBaseUrl=sUebergabe;
	//mbr 03.08.2007: set autocomplete off dynamically,so the site gets validated
	var eSuchformular=document.getElementById("searchForm");
	if(eSuchformular) {
		var eNewAttrib=document.createAttribute("autocomplete");
		eNewAttrib.nodeValue = "off";
		eSuchformular.setAttributeNode(eNewAttrib);
	}

	// set event handler
	var eSuchbox=document.getElementById(sFWP_SS_TextField);
	if(eSuchbox) {
		document.getElementById(sFWP_SS_TextField).onkeyup = function (oEvent)
		{
			if (!oEvent) {oEvent = window.event;}
			fwpKeyHandler(oEvent);
		}
		document.getElementById(sFWP_SS_TextField).onkeydown = function (oEvent)
		{
			if (!oEvent) {oEvent = window.event;}
			fwpKeyHandlerdown(oEvent);
		}
		// set position of fwpSuggestion layer
		aPosition = fwpGetPosition();
		document.getElementById(sFWP_SS_Layer).style.top = (aPosition[0]+document.getElementById(sFWP_SS_TextField).offsetHeight) + "px";
		document.getElementById(sFWP_SS_Layer).style.left = aPosition[1] + "px";
	}
};


function fwpGetPosition()
{
	var aPosition = new Array;
		aPosition[0] = 0;
		aPosition[1] = 0;
	var oNode = document.getElementById(sFWP_SS_TextField);
	while (oNode.tagName != "BODY") {
		aPosition[0] += oNode.offsetTop;
		aPosition[1] += oNode.offsetLeft;
		oNode = oNode.offsetParent;
	}
	return aPosition;
};

function fwpSuggest(oEvent)
{
	var iKey = oEvent.keyCode;
	if (iKey != 8 && (iKey < 32 || (iKey >= 33 && iKey <=46) || (iKey >= 112 && iKey <=123))){
		fwpRemoveValues();
	} else if (document.getElementById(sFWP_SS_TextField).value.length < iFWP_SS_MinLength) {
		fwpRemoveValues();
	} else {
		iFWP_SS_Pos = -1;
		clearTimeout(iFWP_SS_Timeout);
		iFWP_SS_Timeout = setTimeout(function() {

			// fetch values from server and add them to the fwpSuggestion div
			fwpGetResults(document.getElementById(sFWP_SS_TextField).value);
			document.getElementById(sFWP_SS_Layer).onmouseover = function(oEvent)
			{
				if (!oEvent) {
					oEvent = window.event;
				}
				if (oEvent.target) {
					var oTarget = oEvent.target;
				} else {
					var oTarget = oEvent.srcElement;
				}
				fwpHighlight(oTarget);
			}
			document.getElementById(sFWP_SS_Layer).onclick = function(oEvent)
			{
				if (!oEvent) {
					oEvent = window.event;
				}
				if (oEvent.target) {
					var oTarget = oEvent.target;
				} else {
					var oTarget = oEvent.srcElement;
				}
				if (aFWP_SS_Url[oTarget.id] != "") {
					location.href = aFWP_SS_Url[oTarget.id];
				}
			}
		},iFWP_SS_TimeoutLength);
	}
};

function hs()
{
	document.getElementById(sFWP_SS_Layer).style.display = "none";
};

function fwpCheckSuggest()
{
	var sSearchString = document.getElementById(sFWP_SS_TextField).value;
	sSearchString = sSearchString.replace(/^( )*$/,"");
	if (sSearchString.length < 2) {
		SuchfeldFocus();
		return false;
	}

	if (iFWP_SS_Pos > 0 && aFWP_SS_Url.length > 0) {
		if (aFWP_SS_Url[iFWP_SS_Pos] != null && aFWP_SS_Url[iFWP_SS_Pos] != "") {
			if(bSearchHelp) {
				bSearchHelp = false;
				location.href = aFWP_SS_Url[iFWP_SS_Pos];
				return false;
			} else {
				return true;
			}
		} else {
			return true;
		}
	} else {
		return true;
	}
};

function fwpChangeHighlight(iType)
{
	var aNodes = document.getElementById(sFWP_SS_Layer).childNodes;

	if (aNodes.length > 0) {
		var oNode = null;

		if (iType > 0) {
			if (iFWP_SS_Pos < aNodes.length - 1) {
				oNode = aNodes[++iFWP_SS_Pos];
				if (oNode.className == "cat" && iFWP_SS_Pos < aNodes.length - 1) {
					oNode = aNodes[++iFWP_SS_Pos];
				}
			}
		} else {
			if (iFWP_SS_Pos > 0) {
				oNode = aNodes[--iFWP_SS_Pos];
				if (oNode.className == "cat"  && iFWP_SS_Pos > 0) {
					oNode = aNodes[--iFWP_SS_Pos];
				}
			}
		}
		if (oNode) {
			fwpHighlight(oNode);
		}
	}
};


function fwpKeyHandlerdown(oEvent)
{
	if(oEvent.keyCode == 13) {
		bSearchHelp = true;
	}
};

function fwpKeyHandler(oEvent) {
	switch (oEvent.keyCode) {
		case 38: // up
			fwpChangeHighlight(-1);
			break;
		case 40: // down
			fwpChangeHighlight(1);
			break;
		case 13: // enter
		    bSearchHelp = true;
			//fwpLoadUrl();
			break;
		default:
			fwpSuggest(oEvent);
			break;
	}
};

function fwpHighlight(oTarget)
{
	for (var i = 1; i < document.getElementById(sFWP_SS_Layer).childNodes.length; i++ ) {
		var oNode = document.getElementById(sFWP_SS_Layer).childNodes[i];
		if (oNode == oTarget) {
			if (oNode.className == "r1") {
				oNode.className = "r1a";
			} else if (oNode.className == "r2") {
				oNode.className = "r2a";
			}
			iFWP_SS_Pos = i;
		} else {
			if (oNode.className == "r1a") {
				oNode.className = "r1";
			} else if (oNode.className == "r2a") {
				oNode.className = "r2";
			}
		}
	}
};

function fwpRemoveValues()
{
	document.getElementById(sFWP_SS_Layer).style.display = "none";
	while (document.getElementById(sFWP_SS_Layer).hasChildNodes()) {
		var div = document.getElementById(sFWP_SS_Layer).firstChild;
		document.getElementById(sFWP_SS_Layer).removeChild(div);
	}
};

function fwpGetResults(sSearch)
{
	var status;
	request = initAjax();
	if(request) {
		var sUrl = sBaseUrl+"fwp/suggest_search.php?sSearch="+escape(sSearch);
		request.onreadystatechange = function()
		{
			if(request.readyState == 4) {
				// remove values
				fwpRemoveValues();
				var j = 1;

				if (request.responseText == "") {
					return;
				}

				var oObj = eval("("+request.responseText+")");
				iLength=oObj.sNotation.length;
				for(i=0;i<iLength;i++)
				{
					var sNewDiv = document.createElement('div');
					sNewDiv.setAttribute('id',i);
					aFWP_SS_Url[i] = oObj.sUrl[i];
					if (oObj.sType[i] == "P") {
						if (j == 1) {
							sNewDiv.setAttribute('className','r1');
							sNewDiv.setAttribute('class','r1');
						} else {
							sNewDiv.setAttribute('className','r2');
							sNewDiv.setAttribute('class','r2');
							j = 0;
						}
						sNewDiv.style.cursor = "pointer";
						var oText = document.createTextNode(unescape(oObj.sNotation[i]));
						sNewDiv.appendChild(oText);
						j++;
					} else {
						sNewDiv.setAttribute('className','cat');
						sNewDiv.setAttribute('class','cat');
						sNewDiv.appendChild(document.createTextNode(unescape(oObj.sNotation[i])));
					}

					document.getElementById(sFWP_SS_Layer).appendChild(sNewDiv);
				}
				if (iLength > 0) {
					document.getElementById(sFWP_SS_Layer).style.display = "block";
				} else {
					document.getElementById(sFWP_SS_Layer).style.display = "none";
				}
			}
		}
		request.open("GET",sUrl,true);
		request.setRequestHeader("Content-Type","text/plain; charset=iso-8859-1");
		request.send(null);
		status=true;
	} else {
		//alert("Kein Request")
	}
};
//***************************
//Ende Funktionen Ajax
//***************************


//***************************
//Funktionen Up-Down-Scroller
//***************************
/***********************************************
* 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=(this.content.length>1)?1:0; //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[this.hiddendivpointer]+'</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
	}
};
//***************************
//Ende Funktionen Up-Down-Scroller
//***************************

//***************************
//Funktionen Photoscroller Produkt
//***************************
var ProductImage = {
    element: null,
    currentEl: null,
    hiddenEl: null,
    instance: null,
    images: new Array(),
    currentImage: 0,
    currentHiddenImage: 1,

    init: function(id, images) {
        if (this.instance == true) {
            return;
        }

        this.instance  = true;
        this.element   = document.getElementById(id);
        this.currentEl = document.getElementById('currentImage');
        this.hiddenEl  = document.getElementById('hiddenImage');
		this.images    = images;


        if (this.images.length <= 1) {
            return false;
        }

        with (this.element) {
        	style.margin   = '0px';
        	style.padding  = '0px';
            style.width    = '200px';
            style.overflow = 'hidden';
        }

        this.scrollDelay(8);
    },

    scrollDelay: function(seconds) {
        with (this.currentEl) {
            innerHTML      = this.images[this.currentImage];
            style.position = 'absolute';
            style.top      = '0px';
            style.right    = '0px';
        }

        with (this.hiddenEl) {
            innerHTML      = this.images[this.currentHiddenImage];
            style.position = 'absolute';
            style.top      = '0px';
            style.right    = '-200px';
        }

        window.setInterval('ProductImage.scroll();', seconds*1000)
    },

    scroll: function() {
        this.hiddenEl.style.visibility = 'visible';

        if (this.currentImage >= this.images.length) {
            this.currentImage = 0;
        }

        if (this.currentHiddenImage >= this.images.length) {
            this.currentHiddenImage = 0;
        }

        for (i=1, x=200; i<=200; i++, x--) {
            setTimeout("ProductImage.paddIt('" + i + "px', '-" + x + "px');", i*20);
        }
    },

    setCurrentNew: function() {
        if (this.currentImage >= this.images.length) {
            this.currentImage = 0;
        }

        if (this.currentHiddenImage >= this.images.length) {
            this.currentHiddenImage = 0;
        }

        with (this.currentEl) {
            style.right      = '0px';
            innerHTML        = this.images[this.currentHiddenImage];
        }

        with (this.hiddenEl) {
            style.visibility = 'hidden';
            style.right      = '-200px';
        }

        this.currentHiddenImage++;
        ProductImage.setHiddenNew();
    },

    setHiddenNew: function() {
        if (this.currentImage >= this.images.length) {
            this.currentImage = 0;
        }

        if (this.currentHiddenImage >= this.images.length) {
            this.currentHiddenImage = 0;
        }

        this.hiddenEl.innerHTML = this.images[this.currentHiddenImage];
        this.currentImage++;
    },

    paddIt: function(paddLeft, paddHiddenLeft) {
        this.currentEl.style.right = paddLeft;
        this.hiddenEl.style.right  = paddHiddenLeft;

        if (paddLeft == '200px') {
            this.setCurrentNew();
        }
    },

    start: function() {
        this.init();
    },

    stop: function() {
        this.init();
    }
};
//***************************
//Ende Funktionen Photoscroller Produkt
//***************************

//***************************
//Funktionen MD5 Verschluesselung
//***************************
/*
 *  md5.js 1.0b 27/06/96
 *
 * Javascript implementation of the RSA Data Security, Inc. MD5
 * Message-Digest Algorithm.
 *
 * Copyright (c) 1996 Henri Torgemane. All Rights Reserved.
 *
 * Permission to use, copy, modify, and distribute this software
 * and its documentation for any purposes and without
 * fee is hereby granted provided that this copyright notice
 * appears in all copies.
 *
 * Of course, this soft is provided "as is" without express or implied
 * warranty of any kind.
 *
 *
 * Modified with german comments and some information about collisions.
 * (Ralf Mieke, ralf@miekenet.de, http://mieke.home.pages.de)
 */


function array(n) {
  for(i=0;i<n;i++) this[i]=0;
  this.length=n;
};


/* Einige grundlegenden Funktionen m�ssen wegen
 * Javascript Fehlern umgeschrieben werden.
 * Man versuche z.B. 0xffffffff >> 4 zu berechnen..
 * Die nun verwendeten Funktionen sind zwar langsamer als die Originale,
 * aber sie funktionieren.
 */

function integer(n) { return n%(0xffffffff+1); };

function shr(a,b) {
  a=integer(a);
  b=integer(b);
  if (a-0x80000000>=0) {
    a=a%0x80000000;
    a>>=b;
    a+=0x40000000>>(b-1);
  } else {
    a>>=b;
  }
  return a;
};

function shl1(a) {
  a=a%0x80000000;
  if (a&0x40000000==0x40000000) {
    a-=0x40000000;
    a*=2;
    a+=0x80000000;
  } else {
    a*=2;
  }
  return a;
};

function shl(a,b) {
  a=integer(a);
  b=integer(b);
  for (var i=0;i<b;i++) a=shl1(a);
  return a;
};

function and(a,b) {
  a=integer(a);
  b=integer(b);
  var t1=(a-0x80000000);
  var t2=(b-0x80000000);
  if (t1>=0) {
    if (t2>=0) {
      return ((t1&t2)+0x80000000);
    } else {
      return (t1&b);
  	}
  } else {
    if (t2>=0) {
      return (a&t2);
    } else {
      return (a&b);
    }
  }
};

function or(a,b) {
  a=integer(a);
  b=integer(b);
  var t1=(a-0x80000000);
  var t2=(b-0x80000000);
  if (t1>=0) {
    if (t2>=0) {
      return ((t1|t2)+0x80000000);
    } else {
      return ((t1|b)+0x80000000);
    }
  } else {
    if (t2>=0) {
      return ((a|t2)+0x80000000);
  	} else {
      return (a|b);
  	}
  }
};

function xor(a,b) {
  a=integer(a);
  b=integer(b);
  var t1=(a-0x80000000);
  var t2=(b-0x80000000);
  if (t1>=0) {
    if (t2>=0) {
      return (t1^t2);
    } else {
      return ((t1^b)+0x80000000);
    }
  } else {
    if (t2>=0) {
      return ((a^t2)+0x80000000);
    } else {
      return (a^b);
    }
  }
};

function not(a) {
  a=integer(a);
  return (0xffffffff-a);
};

/* Beginn des Algorithmus */

    var state = new array(4);
    var count = new array(2);
        count[0] = 0;
        count[1] = 0;
    var buffer = new array(64);
    var transformBuffer = new array(16);
    var digestBits = new array(16);

    var S11 = 7;
    var S12 = 12;
    var S13 = 17;
    var S14 = 22;
    var S21 = 5;
    var S22 = 9;
    var S23 = 14;
    var S24 = 20;
    var S31 = 4;
    var S32 = 11;
    var S33 = 16;
    var S34 = 23;
    var S41 = 6;
    var S42 = 10;
    var S43 = 15;
    var S44 = 21;

    function F(x,y,z) {
        return or(and(x,y),and(not(x),z));
    };

    function G(x,y,z) {
        return or(and(x,z),and(y,not(z)));
    };

    function H(x,y,z) {
        return xor(xor(x,y),z);
    };

    function I(x,y,z) {
        return xor(y ,or(x , not(z)));
    };

    function rotateLeft(a,n) {
        return or(shl(a, n),(shr(a,(32 - n))));
    };

    function FF(a,b,c,d,x,s,ac) {
        a = a+F(b, c, d) + x + ac;
        a = rotateLeft(a, s);
        a = a+b;
        return a;
    };

    function GG(a,b,c,d,x,s,ac) {
        a = a+G(b, c, d) +x + ac;
        a = rotateLeft(a, s);
        a = a+b;
        return a;
    };

    function HH(a,b,c,d,x,s,ac) {
        a = a+H(b, c, d) + x + ac;
        a = rotateLeft(a, s);
        a = a+b;
        return a;
    }

    function II(a,b,c,d,x,s,ac) {
        a = a+I(b, c, d) + x + ac;
        a = rotateLeft(a, s);
        a = a+b;
        return a;
    };

    function transform(buf,offset) {
        var a=0, b=0, c=0, d=0;
        var x = transformBuffer;

        a = state[0];
        b = state[1];
        c = state[2];
        d = state[3];

        for (i = 0; i < 16; i++) {
            x[i] = and(buf[i*4+offset],0xff);
            for (j = 1; j < 4; j++) {
                x[i]+=shl(and(buf[i*4+j+offset] ,0xff), j * 8);
            }
        }

        /* Runde 1 */
        a = FF ( a, b, c, d, x[ 0], S11, 0xd76aa478); /* 1 */
        d = FF ( d, a, b, c, x[ 1], S12, 0xe8c7b756); /* 2 */
        c = FF ( c, d, a, b, x[ 2], S13, 0x242070db); /* 3 */
        b = FF ( b, c, d, a, x[ 3], S14, 0xc1bdceee); /* 4 */
        a = FF ( a, b, c, d, x[ 4], S11, 0xf57c0faf); /* 5 */
        d = FF ( d, a, b, c, x[ 5], S12, 0x4787c62a); /* 6 */
        c = FF ( c, d, a, b, x[ 6], S13, 0xa8304613); /* 7 */
        b = FF ( b, c, d, a, x[ 7], S14, 0xfd469501); /* 8 */
        a = FF ( a, b, c, d, x[ 8], S11, 0x698098d8); /* 9 */
        d = FF ( d, a, b, c, x[ 9], S12, 0x8b44f7af); /* 10 */
        c = FF ( c, d, a, b, x[10], S13, 0xffff5bb1); /* 11 */
        b = FF ( b, c, d, a, x[11], S14, 0x895cd7be); /* 12 */
        a = FF ( a, b, c, d, x[12], S11, 0x6b901122); /* 13 */
        d = FF ( d, a, b, c, x[13], S12, 0xfd987193); /* 14 */
        c = FF ( c, d, a, b, x[14], S13, 0xa679438e); /* 15 */
        b = FF ( b, c, d, a, x[15], S14, 0x49b40821); /* 16 */

        /* Runde 2 */
        a = GG ( a, b, c, d, x[ 1], S21, 0xf61e2562); /* 17 */
        d = GG ( d, a, b, c, x[ 6], S22, 0xc040b340); /* 18 */
        c = GG ( c, d, a, b, x[11], S23, 0x265e5a51); /* 19 */
        b = GG ( b, c, d, a, x[ 0], S24, 0xe9b6c7aa); /* 20 */
        a = GG ( a, b, c, d, x[ 5], S21, 0xd62f105d); /* 21 */
        d = GG ( d, a, b, c, x[10], S22,  0x2441453); /* 22 */
        c = GG ( c, d, a, b, x[15], S23, 0xd8a1e681); /* 23 */
        b = GG ( b, c, d, a, x[ 4], S24, 0xe7d3fbc8); /* 24 */
        a = GG ( a, b, c, d, x[ 9], S21, 0x21e1cde6); /* 25 */
        d = GG ( d, a, b, c, x[14], S22, 0xc33707d6); /* 26 */
        c = GG ( c, d, a, b, x[ 3], S23, 0xf4d50d87); /* 27 */
        b = GG ( b, c, d, a, x[ 8], S24, 0x455a14ed); /* 28 */
        a = GG ( a, b, c, d, x[13], S21, 0xa9e3e905); /* 29 */
        d = GG ( d, a, b, c, x[ 2], S22, 0xfcefa3f8); /* 30 */
        c = GG ( c, d, a, b, x[ 7], S23, 0x676f02d9); /* 31 */
        b = GG ( b, c, d, a, x[12], S24, 0x8d2a4c8a); /* 32 */

        /* Runde 3 */
        a = HH ( a, b, c, d, x[ 5], S31, 0xfffa3942); /* 33 */
        d = HH ( d, a, b, c, x[ 8], S32, 0x8771f681); /* 34 */
        c = HH ( c, d, a, b, x[11], S33, 0x6d9d6122); /* 35 */
        b = HH ( b, c, d, a, x[14], S34, 0xfde5380c); /* 36 */
        a = HH ( a, b, c, d, x[ 1], S31, 0xa4beea44); /* 37 */
        d = HH ( d, a, b, c, x[ 4], S32, 0x4bdecfa9); /* 38 */
        c = HH ( c, d, a, b, x[ 7], S33, 0xf6bb4b60); /* 39 */
        b = HH ( b, c, d, a, x[10], S34, 0xbebfbc70); /* 40 */
        a = HH ( a, b, c, d, x[13], S31, 0x289b7ec6); /* 41 */
        d = HH ( d, a, b, c, x[ 0], S32, 0xeaa127fa); /* 42 */
        c = HH ( c, d, a, b, x[ 3], S33, 0xd4ef3085); /* 43 */
        b = HH ( b, c, d, a, x[ 6], S34,  0x4881d05); /* 44 */
        a = HH ( a, b, c, d, x[ 9], S31, 0xd9d4d039); /* 45 */
        d = HH ( d, a, b, c, x[12], S32, 0xe6db99e5); /* 46 */
        c = HH ( c, d, a, b, x[15], S33, 0x1fa27cf8); /* 47 */
        b = HH ( b, c, d, a, x[ 2], S34, 0xc4ac5665); /* 48 */

        /* Runde 4 */
        a = II ( a, b, c, d, x[ 0], S41, 0xf4292244); /* 49 */
        d = II ( d, a, b, c, x[ 7], S42, 0x432aff97); /* 50 */
        c = II ( c, d, a, b, x[14], S43, 0xab9423a7); /* 51 */
        b = II ( b, c, d, a, x[ 5], S44, 0xfc93a039); /* 52 */
        a = II ( a, b, c, d, x[12], S41, 0x655b59c3); /* 53 */
        d = II ( d, a, b, c, x[ 3], S42, 0x8f0ccc92); /* 54 */
        c = II ( c, d, a, b, x[10], S43, 0xffeff47d); /* 55 */
        b = II ( b, c, d, a, x[ 1], S44, 0x85845dd1); /* 56 */
        a = II ( a, b, c, d, x[ 8], S41, 0x6fa87e4f); /* 57 */
        d = II ( d, a, b, c, x[15], S42, 0xfe2ce6e0); /* 58 */
        c = II ( c, d, a, b, x[ 6], S43, 0xa3014314); /* 59 */
        b = II ( b, c, d, a, x[13], S44, 0x4e0811a1); /* 60 */
        a = II ( a, b, c, d, x[ 4], S41, 0xf7537e82); /* 61 */
        d = II ( d, a, b, c, x[11], S42, 0xbd3af235); /* 62 */
        c = II ( c, d, a, b, x[ 2], S43, 0x2ad7d2bb); /* 63 */
        b = II ( b, c, d, a, x[ 9], S44, 0xeb86d391); /* 64 */

        state[0] +=a;
        state[1] +=b;
        state[2] +=c;
        state[3] +=d;

    }
    /* Mit der Initialisierung von Dobbertin:
       state[0] = 0x12ac2375;
       state[1] = 0x3b341042;
       state[2] = 0x5f62b97c;
       state[3] = 0x4ba763ed;
       gibt es eine Kollision:

       begin 644 Message1
       M7MH=JO6_>MG!X?!51$)W,CXV!A"=(!AR71,<X`Y-IIT9^Z&8L$2N'Y*Y:R.;
       39GIK9>TF$W()/MEHR%C4:G1R:Q"=
       `
       end

       begin 644 Message2
       M7MH=JO6_>MG!X?!51$)W,CXV!A"=(!AR71,<X`Y-IIT9^Z&8L$2N'Y*Y:R.;
       39GIK9>TF$W()/MEHREC4:G1R:Q"=
       `
       end
    */
    function init() {
        count[0]=count[1] = 0;
        state[0] = 0x67452301;
        state[1] = 0xefcdab89;
        state[2] = 0x98badcfe;
        state[3] = 0x10325476;
        for (i = 0; i < digestBits.length; i++) {
            digestBits[i] = 0;
        }
    };

    function update(b) {
        var index,i;

        index = and(shr(count[0],3) , 0x3f);
        if (count[0]<0xffffffff-7) {
          count[0] += 8;
        } else {
          count[1]++;
          count[0]-=0xffffffff+1;
          count[0]+=8;
        }
        buffer[index] = and(b,0xff);
        if (index  >= 63) {
            transform(buffer, 0);
        }
    };

    function finish()
    {
        var bits = new array(8);
        var        padding;
        var        i=0, index=0, padLen=0;

        for (i = 0; i < 4; i++) {
            bits[i] = and(shr(count[0],(i * 8)), 0xff);
        }
        for (i = 0; i < 4; i++) {
            bits[i+4]=and(shr(count[1],(i * 8)), 0xff);
        }
        index = and(shr(count[0], 3) ,0x3f);
        padLen = (index < 56) ? (56 - index) : (120 - index);
        padding = new array(64);
        padding[0] = 0x80;
        for (i=0;i<padLen;i++) {
          update(padding[i]);
        }
        for (i=0;i<8;i++) {
          update(bits[i]);
        }

        for (i = 0; i < 4; i++) {
            for (j = 0; j < 4; j++) {
                digestBits[i*4+j] = and(shr(state[i], (j * 8)) , 0xff);
            }
        }
    };

/* Ende des MD5 Algorithmus */

function hexa(n) {
 var hexa_h = "0123456789abcdef";
 var hexa_c="";
 var hexa_m=n;
 for (hexa_i=0;hexa_i<8;hexa_i++) {
   hexa_c=hexa_h.charAt(Math.abs(hexa_m)%16)+hexa_c;
   hexa_m=Math.floor(hexa_m/16);
 }
 return hexa_c;
};


var ascii="01234567890123456789012345678901" +
          " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ"+
          "[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~";

function MD5(nachricht)
{
 var l,s,k,ka,kb,kc,kd;

 init();
 for (k=0;k<nachricht.length;k++) {
   l=nachricht.charAt(k);
   update(ascii.lastIndexOf(l));
 }
 finish();
 ka=kb=kc=kd=0;
 for (i=0;i<4;i++) ka+=shl(digestBits[15-i], (i*8));
 for (i=4;i<8;i++) kb+=shl(digestBits[15-i], ((i-4)*8));
 for (i=8;i<12;i++) kc+=shl(digestBits[15-i], ((i-8)*8));
 for (i=12;i<16;i++) kd+=shl(digestBits[15-i], ((i-12)*8));
 s=hexa(kd)+hexa(kc)+hexa(kb)+hexa(ka);
 return s;
}
//***************************
//Ende Funktionen MD5 Verscluesselung
//***************************

//***************************
//Funktionen Google Adsense
//***************************
var googleAdNewWindow 	= 1;
var google_afs_hl 		= 'de';
var google_afs_client 	= 'pub-1106817073700639'; // substitute your client ID

function google_afs_request_done(google_ads)
{
 	var google_num_ads 		= google_ads.length;
  	var wideAds 			= "";   // wide ad unit html text
  	var narrowAds 			= "";   // narrow ad unit html text

  if (google_num_ads <= 0) {
  	  /* wenn auf der Suchseite keine Google Ads fuer das jeweilige Suchwort
  	     gefunden wurden, wird die Suchseite nochmals mit dem Parameter repeat=1 aufgerufen
  	     der bewirkt, dass nun Google Adds zum Stichwort shopping angezeigt werden */
  	  if((location.href.indexOf('search=') != -1) && (location.href.indexOf('&repeat') == -1)) {
  	  	if(location.href.indexOf('?') == -1) {
  	  		location.href = location.href + '?repeat=1';
  	  	} else {
  	  		location.href = location.href + '&repeat=1';
  	  	}
  	  } else {
  	  	return;
  	  }
  }

  for(i = 0; i < google_num_ads; i++) {
      if (google_ads[i].type=="text/wide") {
      	// render a wide ad
          wideAds+='<div class="link"><a  target="_blank" onmouseover="javascript:window.status=\'' + google_ads[i].visible_url + '\';return true;" ' + 'onmouseout="javascript:window.status=\'\';return true;" ' + 'href="' + google_ads[i].url + '" class="ad_line1">' + google_ads[i].line1 + '</a>' +
                  '<span class="ad_line2">' + google_ads[i].line2  + '</span>' +
                  '<a  target="_blank" class="ad_url" onmouseover="javascript:window.status=\'' + google_ads[i].visible_url + '\';return true;" ' + 'onmouseout="javascript:window.status=\'\';return true;" ' + 'href="' + google_ads[i].url + '">' + google_ads[i].visible_url + '</a></div>';
      } else {
          // render a narrow ad
          narrowAds+='<div class="w230"><a  target="_blank" onmouseover="javascript:window.status=\'' +
                  google_ads[i].url + '\';return true;" ' +
                  'onmouseout="javascript:window.status=\'\';return true;" ' +
                  'href="' + google_ads[i].url + '">' +

                  '<span class="ad_line1">' + google_ads[i].line1 + '</span></a><br>' +

                  '<span class="ad_text">' + google_ads[i].line2 + '</span><br>' +

                  '<span class="ad_text">' + google_ads[i].line3 + '</span><br>' +

                  '<a class="ad_url" target="_blank" onmouseover="javascript:window.status=\'' +
                  google_ads[i].url + '\';return true;" ' +
                  'onmouseout="javascript:window.status=\'\';return true;" ' +
                  'href="' + google_ads[i].url + '">' + google_ads[i].visible_url + '</a></div>';
      }
  }

  if (narrowAds != "") {
      narrowAds = '<h2>Google-Anzeigen f&uuml;r {$smarty.get.search}</h2>'
                + '<div class="box-main">'
                + narrowAds
                + '</div><div class="spacer15"></div>';
  }

  if (wideAds != "") {
      wideAds = '<h2>Google-Anzeigen f&uuml;r ' + keywords + '</h2>'
                + '<div class="box-main">'
                + wideAds
                + '</div><div class="spacer15"></div>';
  }
  // Write HTML for wide and narrow ads to the proper <div> elements
  eWideDiv = document.getElementById("adsense");
  if(eWideDiv) {
  	eWideDiv.innerHTML = wideAds;
  }
  if (narrowAds != '') {
  	eNarrowDiv = document.getElementById("adsense");
  	if(eNarrowDiv) {
  		enarrowDiv.innerHTML = narrowAds;
  	}
  }
};

//***************************
//Ende Funktionen Google Adsense
//***************************

//***************************
//Funktionen rss
//***************************
function showAboPopup( element, feedUrl, xOffset ) {
	if(typeof xOffset == 'undefined') {
      xOffset = 4;
    }
    var x = 0, y = 0;
    do {
    	x += element.offsetLeft;
     	y += element.offsetTop;
    } while (element = element.offsetParent);
    popup = document.getElementById("rss_abo");
    popup.style.left = (x+xOffset)+"px";
	popup.style.top  = (y+8)+"px";
	popup.style.display = "block";
	popup.style.zIndex = 999;
	// Links einbauen
	document.getElementById("rss_abo_xml1").href = feedUrl;
	document.getElementById("rss_abo_xml2").href = feedUrl;
	document.getElementById("rss_abo_google").href = 'http://fusion.google.com/add?feedurl=' + feedUrl;
	document.getElementById("rss_abo_yahoo").href = 'http://add.my.yahoo.com/content?url=' + feedUrl;
	document.getElementById("rss_abo_netvibes").href = 'http://www.netvibes.com/subscribe.php?url=' + feedUrl;
	document.getElementById("rss_abo_pageflakes").href = 'http://www.pageflakes.com/subscribe.aspx?url=' + feedUrl;
	document.getElementById("rss_abo_bloglines").href = 'http://www.bloglines.com/sub/' + feedUrl;
	document.getElementById("rss_abo_msn").href = 'http://my.msn.com/addtomymsn.armx?id=rss&amp;ut=' + feedUrl;
	return false;
};

function hideAboPopup() {
	document.getElementById("rss_abo").style.display="none";
	return false;
};
//***************************
//Ende Funktionen rss
//***************************