/* (c) Scientec Internet Applications + Media GmbH - www.scientec.de */

window.onerror=catchError;
window.name="berlin";
var titellocation = /onTEAM/g;
if(self!=top && (titellocation.exec(top.document.title) == null) && document.title.indexOf("Bestellung Exklusiv-Eintrag")==-1)
{
  top.location=self.location
}

var dom=(document.getElementById)?1:0;
var ie=(document.all && dom)?1:0;
var tag=(document.getElementsByTagName)?1:0;
var lay=(document.layers)?1:0;

window.onbeforeunload=function(){getformular(); /*Formular2Cookie*/}

if(!dom){
  document.write('<style type="text/css">span.details{display:none}</style>');
}
else {
  document.write('<style type="text/css">span.details{display:inline}</style>');
  document.write('<st'+'yle type="text/css">div.details{di');
  document.write('spla'+'y:none}</style>');
  document.write('<script src="/onTEAM/admin/onteam/scripts/werbung.js" type="text/javascript"></script>');
}

function catchError(Nachricht,Datei,Zeile){
  message="FEHLER";
  message+="-!-Fehlermeldung="+escape(Nachricht);
  message+="-!-Datei="+escape(Datei);
  message+="-!-Zeile="+escape(Zeile);
  message+="-!-Agent="+escape(navigator.userAgent);
  message+="-!-Referrer="+escape(document.referrer);
  //dead=new Image(); dead.src="http://www.onwatch.de/onerror.php?fehler="+message+"&pid=berlin";
  return true
}

function init(){
  for(h = 0; h < document.getElementsByTagName("H5").length; h++)
  {
    if(document.getElementsByTagName("H5")[h].className == "hobu")
    {
      hid = document.getElementsByTagName("H5")[h].id.slice(1);
      document.getElementsByTagName("H5")[h].innerHTML = '<a href="http://www.hotel.de/Booking.aspx?lng=DE&han=1158134&h_hmid='+hid+'&h_sfi=1" target="_blank" onmousedown = "onwatch(this);this.removeAttribute(\'onmousedown\')">Info & buchen</a>'
    }
  }
  if(dom){if(document.getElementById('navigation'))losgehts();}/*scrolling*/
  merken();/* Cookie erlaubt*/
  setformular(); /* Cookie2Formular*/  
  inbeding=false;
  if(dom){/*Aktionen auf Registerseiten*/
    if (document.getElementById("regsel")){
      document.getElementById("abc").getElementsByTagName("p")[0].innerHTML=document.getElementById("regsel").options.length+" Begriffe";
      document.registersuche.onsubmit=function(){
        if(document.getElementById("regsel").options.selectedIndex!=-1){
          document.getElementById("abdafuer").disabled="disabled"
        }
        else {alert("Bitte selektieren Sie einen Begriff nach dem gesucht werden soll");return false}
      }
    }
  }
  if (dom){
    if(document.body.id=="einzelansicht"){
      for(var i=0; i<document.getElementById("inhalt").getElementsByTagName("div").length;i++){
        var thisDIV=document.getElementById("inhalt").getElementsByTagName("div")[i];
        if (thisDIV.className=="suchpfad"){
          document.getElementById("pfad").replaceChild(thisDIV,document.getElementById("pfad").getElementsByTagName("span")[1]);
        }
      }
    }
    if(document.searchform){setSearch()};   
    modifyExternalLinks();
    modifyEmails()
    toggleAllDetails();
    initAD();
    searchStringHighlight();
    highlightNavigation();
    document.ondblclick=function(e){/*Einträge nummerieren*/
      fO = (ie)? event.srcElement : e.target;
      if (fO.className=="info"){
        var counter=0;
        for(var i=0; i<document.getElementById("text").getElementsByTagName("div").length;i++){
          var thisEntry=document.getElementById("text").getElementsByTagName("div")[i];
          if(thisEntry.className=="info"){counter++}
          if(thisEntry==fO){fO.title=counter;break}
        }
      }
    }
  }
}
function onwatch(link)
{
  dummyImg = new Image();
  dummyImg.src = "http://www.onwatch.de/onclick.php?url="+link.href.replace(/\&/gi,"__").replace(/(\/vs)/gi,"_vs")+"&location="+location.href+"&pid=berlin";
}
function w(id){
  zaehler=new Image();
  zaehler.src="http://www.onwatch.de/cc/_c.php?id="+id;
}
function setSearch(){
  if (document.searchform.beding.value==""){ document.searchform.beding.value="Suchbegriff ..."}
  document.searchform.beding.onclick=function(){if (document.searchform.beding.value=="Suchbegriff ...") {document.searchform.beding.value=""}};
  document.searchform.beding.onfocus=function(){inbeding=true;};/*keine Vorbesetzung, wenn im Suchfeld*/
  document.searchform.beding.onblur=function(){inbeding=false;};
  document.searchform.onsubmit=function(){/*keine oder zu kurze Suchbegriffe nicht akzeptieren*/
    if (document.searchform.beding.value=="Suchbegriff ..." || document.searchform.beding.value.length<3) {
      document.searchform.beding.value="";
      document.searchform.beding.style.cssText="background-color:red; color:white";
      document.searchform.beding.focus();
      return false;
    }
    document.searchform.getElementsByTagName("input")[document.searchform.getElementsByTagName("input").length-1].disabled="disabled"
  }
  document.onmouseup=function(){/*Suchfeld mit selektiertem Text vorbesetzen*/
    if(!inbeding){
      getSelectedText();
      if (String(selectedText).length>2 ){document.searchform.beding.value=selectedText}
    }
  }
}

function getSelectedText(){/*markierten Text ermitteln*/
  if (window.getSelection) selectedText=window.getSelection();
  else if (document.getSelection) selectedText=document.getSelection();
  else if (document.selection) selectedText=document.selection.createRange().text;
}

function highlightNavigation(){
  if(dom && document.getElementById('navigation')){
    var obj=document.getElementById('navigation');
    var length=obj.getElementsByTagName("a").length;
    var url=document.location.href;
    if(document.getElementById("pfad")){
      var link2="";
      if(document.getElementById("pfad").getElementsByTagName("a").length>2){var link2=document.getElementById("pfad").getElementsByTagName("a")[2].href}
      for (var i=0; i<length; i++){
        var A=obj.getElementsByTagName("a")[i];
        if (A.href==url || (A.href==link2) && !document.getElementById('kartenshoplogo2')){
          A.parentNode.style.backgroundColor="#fff";
          A.style.color="#505050";
          A.style.textDecoration="none";
        }
  	  else {
          A.parentNode.style.backgroundColor="";
          A.style.color="";
          A.style.textDecoration="";
        }
      }
    }
  }
}


function showDetail(id){/*Details in Webkatalog anzeigen*/
  if(document.getElementById("d"+id).style.display == "block"){ /*Details sind offen*/
    document.getElementById("d"+id).style.display = "none";
    document.getElementById("l"+id).innerHTML = "<a title=\"anzeigen\" href=\"javascript: showDetail('" + id + "')\">Details + Vorschau</a>";
  }
  else {/*Details sind geschlossen*/
    document.getElementById("i"+id).style.display = "block";
    if(document.getElementById("i"+id).className=="thumb"){
      letzteziffern=id.substr(id.length-2,2);
      document.getElementById("i"+id).getElementsByTagName("img")[0].src = "/onTEAM/medien/vorschau/"+letzteziffern+"/"+id+".jpg";
    }
    else if(document.getElementById("i"+id).className=="nothumb"){
      document.getElementById("i"+id).getElementsByTagName("img")[0].src = "/onTEAM/admin/onteam/_grafik/nothumb.gif";
    }
    document.getElementById("d"+id).style.display = "block";
    document.getElementById("l"+id).innerHTML = "<a title=\"verbergen\" class=\"verbergen\" href=\"javascript: showDetail('" + id + "')\">Details + Vorschau</a>";
  }
}

function toggleAllDetails(){
  allDLs=document.getElementsByTagName("dl");
  nod=allDLs.length;
  if(nod>0 && document.getElementById("navigator")){
    document.getElementById("navigator").innerHTML+='<div id="detailsToggleDIV"><a href="#" onclick="openAllDetails();return false"><img src="/onTEAM/admin/onteam/_grafik/buttons/alleiauf.png" title="Alle Detailansichten öffnen"></a></div>';
    if(document.location.href.indexOf("/cache/")!=-1 || document.location.href.indexOf("/onteamsuche/")!=-1 || document.body.id=="einzelansicht" ){openAllDetails()}
  }
}
function openAllDetails(){
  document.getElementById("detailsToggleDIV").innerHTML='<a href="#" onclick="closeAllDetails();return false"><img src="/onTEAM/admin/onteam/_grafik/buttons/alleizu.png" title="Alle Detailansichten schließen"></a>';
  for(var i=0;i<nod;i++){
    var id=allDLs[i].parentNode.parentNode.id.replace(/id/,"");
    document.getElementById("i"+id).style.display = "block";
    if(document.getElementById("i"+id).className=="thumb"){
      letzteziffern=id.substr(id.length-2,2);
      document.getElementById("i"+id).getElementsByTagName("img")[0].src = "/onTEAM/medien/vorschau/"+letzteziffern+"/"+id+".jpg";
    }
    else if(document.getElementById("i"+id).className=="nothumb"){
      document.getElementById("i"+id).getElementsByTagName("img")[0].src = "/onTEAM/admin/onteam/_grafik/nothumb.gif";
    }
    document.getElementById("d"+id).style.display = "block";
    document.getElementById("l"+id).innerHTML = "<a title=\"verbergen\" class=\"verbergen\" href=\"javascript: showDetail('" + id + "')\">Details + Vorschau</a>";
  }
}
function closeAllDetails(){
  document.getElementById("detailsToggleDIV").innerHTML='<a href="#" onclick="openAllDetails();return false"><img src="/onTEAM/admin/onteam/_grafik/buttons/alleiauf.png" title="Alle Detailansichten öffnen"></a>';
  for(var i=0;i<nod;i++){
    var id=allDLs[i].parentNode.parentNode.id.replace(/id/,"");
    document.getElementById("d"+id).style.display = "none";
    document.getElementById("l"+id).innerHTML = "<a title=\"anzeigen\" href=\"javascript: showDetail('" + id + "')\">Details + Vorschau</a>";
  }
}
function toggle(id){/*Sitemap*/
  if (dom){
    if (document.getElementById('DIV'+id).innerHTML.match(/openfolder\.gif/)){
      document.getElementById(id).style.display='none';
      document.getElementById('DIV'+id).innerHTML = document.getElementById('DIV'+id).innerHTML.replace(/openfolder\.gif/,"folder.gif");
    }
    else {
      document.getElementById(id).style.display='block';
      document.getElementById('DIV'+id).innerHTML = document.getElementById('DIV'+id).innerHTML.replace(/folder\.gif/,"openfolder.gif");
    }
  }
}

function modifyExternalLinks(){/*externe Links über exit.shtml leiten*/
  if (dom){
    for (var i=0; i<document.links.length;i++){
      var o=document.links[i];
      if(o.target=="link" && o.href.indexOf("exit0")==-1){		
			  if(o.parentNode.parentNode.className=="premium"){o.target="_blank"}
				else { 
				  var HREF=escape(o.href).replace(/\%25/gi,"%").replace(/\%3A/gi,":");
				  o.href="/onTEAM/exit.shtml?"+HREF;
				}
      }
    }
  }
}

function modifyEmails() {
  for(var i=document.getElementsByName("a").length-1; i>=0;i--){
    str=document.getElementsByName("a")[i].parentNode.innerHTML.replace(/<img.+?>/ig,"\@").replace(/<.+?>/ig,"");
    document.getElementsByName("a")[i].parentNode.innerHTML="<a href='mailto:"+str+"'>"+str+"</a>";
  }
}


// Uhr
function initTime(){
  Wochentagname =  new Array("Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag");
  serverTime =new Date();
  serverTime.setYear(DATE_LOCAL[0]);
  serverTime.setMonth(DATE_LOCAL[1]-1);
  serverTime.setDate(DATE_LOCAL[2]);
  serverTime.setHours(DATE_LOCAL[3]);
  serverTime.setMinutes(DATE_LOCAL[4]);
  serverTime.setSeconds(DATE_LOCAL[5]);
  clientTime= new Date();
  timeOffset =  serverTime.getTime() - clientTime.getTime();
  ZeitAnzeigen()
}

function ZeitAnzeigen(){
  var Jetzt = new Date();
  Jetzt.setTime(Jetzt.getTime()+timeOffset);
  var WoTag = Jetzt.getDay();
  var Tag = Jetzt.getDate();
  var Monat = Jetzt.getMonth()+1;
  var Jahr = Jetzt.getYear();
  if(Jahr < 999) Jahr += 1900;
  var Stunden = Jetzt.getHours();
  var Minuten = Jetzt.getMinutes();
  var Sekunden = Jetzt.getSeconds();
  var Vortag  = ((Tag < 10) ? "0" : "");
  var Vormon  = ((Monat < 10) ? ".0" : ".");
  var Vorstd  = ((Stunden < 10) ? "0" : "");
  var Vormin  = ((Minuten < 10) ? ":0" : ":");
  var Vorsek  = ((Sekunden < 10) ? ":0" : ":");
  var Datum = Vortag + Tag + Vormon + Monat  + "." + Jahr;
  var Uhrzeit = Vorstd + Stunden + Vormin + Minuten + Vorsek + Sekunden;
  var Gesamt = Wochentagname[WoTag] + ", " + Datum + ", " + Uhrzeit;
  if( document.getElementById("Uhr") && document.getElementById("Uhr").firstChild){
    document.getElementById("Uhr").innerHTML = Gesamt;
  }
  window.setTimeout("ZeitAnzeigen()",1000);
}

function openWindow(url){
  HHImap=window.open(url,"HHImap","scrollbars=yes,resizable=yes,width=820,height=570");
}

function mouseOver(o) {
  o.src='/onTEAM/admin/onteam/_grafik/buttons/'+o.name+'-1.png'
}

function mouseOut(o) {
  o.src='/onTEAM/admin/onteam/_grafik/buttons/'+o.name+'-0.png'
}

/*Fliegende Navigation ANFANG*/

ding.marke={}; 
function ding(id,x,y,w,h){var wo=ding.zeiger(id); if (!wo){return}; this.id=id; ding.marke[this.id]=this; this.folge="ding.marke." + this.id; var px=window.opera? 0: "px"; this.x=x || 0; if (x) wo.style.left=this.x + px; this.y=y || 0; if (y) wo.style.top=this.y + px; this.w=w || wo.offsetWidth || 0; this.h=h || wo.offsetHeight || 0; if (w){ wo.style.width=w + px}; if (h){wo.style.height=h + px}; } 
ding.zeiger=function(id){var wo=document.getElementById? document.getElementById(id): null; return wo; } 
ding.welches=function(id){var dong=ding.marke[id]; if (!dong){ dong=new ding(id)} else if (!dong.wo){dong.wo=ding.zeiger(id)}; return dong; } 
ding.prototype.hin=function(x,y){var wo=this.wo? this.wo: ding.zeiger(this.id)? ding.zeiger(this.id): null; if (wo){ if (x != null){ wo.style.left=(this.x=x) + "px"}; if (y != null){ wo.style.top=(this.y=y) + "px"}; } } 
ding.prototype.her=function(x,y){ this.hin(this.x+x, this.y+y); } 
ding.prototype.an=function(){var wo=this.wo? this.wo: ding.zeiger(this.id)? ding.zeiger(this.id): null; if (wo){ wo.style.visibility="visible"}; } 
ding.prototype.unsi=function(){var wo=this.wo? this.wo: ding.zeiger(this.id)? ding.zeiger(this.id): null; if (wo){ wo.style.visibility="hidden"}; } 
var bez={ B1: function (t){ return t*t*t }, B2: function (t){ return 3*t*t*(1-t) }, B3: function (t){ return 3*t*(1-t)*(1-t) }, B4: function (t){ return (1-t)*(1-t)*(1-t) }, getValue: function (proz,auf,zu,mm,mn){ return zu * this.B1(proz) + mn * this.B2(proz) + mm * this.B3(proz) + auf * this.B4(proz); } } 
mrklsak={ menge: [], hinzu: function(fp){ this.menge[this.menge.length]=fp; if (this.menge.length == 1){ this.uhr=window.setInterval("mrklsak.pol()", 10)}; }, remove: function(fp){ for (var i=0; this.menge[i]; i++){ if (fp == this.menge[i]){ this.menge=this.menge.slice(0,i).concat( this.menge.slice(i+1) ); break; } } if (this.menge.length == 0){ window.clearInterval(this.uhr); this.uhr=null; } }, pol: function(){ for (var i=0; this.menge[i]; i++){ if (typeof this.menge[i] == "function" ){this.menge[i]()} else eval(this.menge[i]); } } } 
ufo.marke=[]; 
function ufo(id,x,y,w,h,d,beschl){ this.flug=d || 1000; this.origX=x; this.mb=y; this.beschl=-beschl || 0; this.unten=ding; this.unten(id,x,y,w,h); ufo.marke[ufo.marke.length]=this; if (!ufo.fenster){ ufo.fenster=fh()}; } 
ufo.prototype=new ding; 
ufo.prototype.vorschau=function (){/**/}; 
ufo.prototype.cUfo=function(){var ende=abstand() + this.mb; if (ende != this.y){ if (ende != this.zwischen){ this.zwischen=ende; this.schnipp(); this.vorschau(); } this.fliegen(); } } 
ufo.prototype.schnipp=function(){ this.gt=new Date().getTime(); var ma=this.zwischen - this.y; if ( Math.abs(ma) > ufo.fenster ){ this.ganzhoch=(ma > 0)? this.zwischen - ufo.fenster: this.zwischen + ufo.fenster; } else { this.ganzhoch=this.y}; this.hoch1=this.ganzhoch + ( (1+this.beschl) * (this.zwischen - this.ganzhoch)/3 ); this.hoch2=this.ganzhoch + ( (2+this.beschl) * (this.zwischen - this.ganzhoch)/3 ); } 
ufo.prototype.fliegen=function(){var tick=new Date().getTime() - this.gt; if (tick < this.flug){var y=bez.getValue( tick/this.flug, this.ganzhoch, this.zwischen, this.hoch1, this.hoch2 ); this.hin(null,y); } else { this.hin(null,this.zwischen)} } 
ufo.pol=function(){ for (var i=0; ufo.marke[i]; i++){var das=ufo.marke[i]; if (das){ das.cUfo()}; } } 
mrklsak.hinzu(ufo.pol); 
function fh(){var fenster=0; if (window.innerHeight){ fenster=window.innerHeight-18} else if (document.documentElement && document.documentElement.clientHeight){ fenster=document.documentElement.clientHeight} else if (document.body && document.body.clientHeight){ fenster=document.body.clientHeight} return fenster; } 
function abstand(){var hoch=0; if (document.documentElement && document.documentElement.scrollTop){hoch=document.documentElement.scrollTop} else if (document.body && document.body.scrollTop){ hoch=document.body.scrollTop} else if (window.pageYOffset){ hoch=window.pageYOffset} else if (window.scrollY){ hoch=window.scrollY} return ((hoch>71) && fh()>600)?hoch-71:0; } if (window.addEventListener){ window.addEventListener("resize", function(){ ufo.fenster=fh(); }, "false")} else if (window.attachEvent){ window.attachEvent("onresize", function(){ ufo.fenster=fh(); } )} 
function losgehts(){var rak=new ufo("navigation",0,71,null,null,1000,-1); rak.an(); }

/*Fliegende Navigation ENDE*/

/*COOKIES*/

function getCookie(alle){alert
  anfang=document.cookie.indexOf(alle+"!!")+alle.length+2;
  ende=document.cookie.indexOf(",",anfang);
  wert=document.cookie.substring(anfang,ende);
  return wert
}
	
function setCookie(cookiename, url, folder, firma, nachname, vorname, str, plz, ort, email, tel, fax, mobil, domain, expires, path, secure){
  var cook = cookiename+"= ";
  cook += "url!!"+unescape(url)+", ";
  cook += "folder!!"+unescape(folder)+", ";
  cook += "firma!!"+unescape(firma)+", ";
  cook += "nachname!!"+unescape(nachname)+", ";
  cook += "vorname!!"+unescape(vorname)+", ";
  cook += "str!!"+unescape(str)+", ";
  cook += "plz!!"+unescape(plz)+", ";
  cook += "ort!!"+unescape(ort)+", ";
  cook += "email!!"+unescape(email)+", ";
  cook += "tel!!"+unescape(tel)+", ";
  cook += "fax!!"+unescape(fax)+", ";
  cook += "mobil!!"+unescape(mobil)+", ";
  cook += (domain) ? ";domain="+ domain:"";
  cook += (expires) ? ";expires="+expires: "";
  cook += (path) ? ";path="+path: "";
  cook += (secure) ? ";secure":"";
  document.cookie = cook;
}

function setformular(){
  if(navigator.cookieEnabled && document.cookie!="" && document.formular){
    if(document.formular.url)document.formular.url.value=(getCookie("url"));
    if(document.formular.folder)if(document.formular.folder.value=="")document.formular.folder.value=(getCookie("folder"));
    if(document.formular.firma)document.formular.firma.value=(getCookie("firma"));
    if(document.formular.nachname)document.formular.nachname.value=getCookie("nachname");
    if(document.formular.vorname);document.formular.vorname.value=getCookie("vorname");
    if(document.formular.str)document.formular.str.value=(getCookie("str"));
    if(document.formular.plz)document.formular.plz.value=(getCookie("plz"));
    if(document.formular.ort)document.formular.ort.value=(getCookie("ort"));
    if(document.formular.email)document.formular.email.value=(getCookie("email"));
    if(document.formular.tel)document.formular.tel.value=(getCookie("tel"));
    if(document.formular.fax)document.formular.fax.value=(getCookie("fax"));
    if(document.formular.mobil)document.formular.mobil.value=(getCookie("mobil"));
  }
}
	
function getformular(){
  if(navigator.cookieEnabled && document.formular){
    if(document.formular.checkok.checked==true){
      var url=(document.formular.url)?document.formular.url.value:getCookie("url");
      var folder=(document.formular.folder)?document.formular.folder.value:getCookie("folder");
      var firma=(document.formular.firma)?document.formular.firma.value:getCookie("firma");
      var nachname=(document.formular.nachname)?document.formular.nachname.value:getCookie("nachname")
      var vorname=(document.formular.vorname)?document.formular.vorname.value:getCookie("vorname");
      var str=(document.formular.str)?document.formular.str.value:getCookie("str");
      var plz=(document.formular.plz)?document.formular.plz.value:getCookie("plz");
      var ort=(document.formular.ort)?document.formular.ort.value:getCookie("ort");
      var email=(document.formular.email)?document.formular.email.value:getCookie("email");
      var tel=(document.formular.tel)?document.formular.tel.value:getCookie("tel");
      var fax=(document.formular.fax)?document.formular.fax.value:getCookie("fax");
      var mobil=(document.formular.mobil)?document.formular.mobil.value:getCookie("mobil");
      var jetzt = new Date();
      var loeschtermin = new Date(jetzt.getTime() + 365*1000*60*60*24*365);
      var string=url+firma+nachname+vorname+str+plz+ort+email+tel+fax+mobil;
      if(string.length>0){
        setCookie("persdata", url, folder, firma, nachname, vorname, str, plz, ort, email, tel, fax, mobil, window.location.host, loeschtermin.toGMTString(),"/");
      }
    }
    else {/*cookie löschen*/
      var jetzt = new Date();
      var delcookie=new Date(jetzt.getTime() - 365*1000*60*60*24*365);
      setCookie("persdata","" , "", "","" ,"" ,"" ,"" ,"" ,"" ,"" ,"" , "","" , delcookie.toGMTString(),"/");
    }
  }
}

function merken(){
  if(navigator.cookieEnabled){
  if(document.formular && document.getElementById("merken")){
      var merkfeld=document.getElementById("merken");
      var checked=( document.cookie!="")?"checked":"";
      merkfeld.innerHTML='<input type="checkbox" name="checkok" value="cookiesok" '+checked+'>Daten in Cookie speichern';
	
    }
  }
  else {
    if(document.formular && document.getElementById("merken")){
      var merkfeld=document.getElementById("merken");
      merkfeld.innerHTML="";
    }
  }
}

function highlightWord(node,word) {
  if (node.hasChildNodes){
    var hi_cn;
    for (hi_cn=0;hi_cn<node.childNodes.length;hi_cn++){
      highlightWord(node.childNodes[hi_cn],word);
    }
  }
  if (node.nodeType == 3 && node.parentNode.tagName!="TEXTAREA") {
    tempNodeVal = node.nodeValue.toLowerCase();
    tempWordVal = word.toLowerCase();
    if (tempNodeVal.indexOf(tempWordVal) != -1) {
      pn = node.parentNode;
      if (pn.className != "searchword") {
        nv = node.nodeValue;
        ni = tempNodeVal.indexOf(tempWordVal);
        before = document.createTextNode(nv.substr(0,ni));
        docWordVal = nv.substr(ni,word.length);
        after = document.createTextNode(nv.substr(ni+word.length));
        hiwordtext = document.createTextNode(docWordVal);
        hiword = document.createElement("span");
        hiword.className = "searchword";
        hiword.title = "Suchtreffer";
        hiword.appendChild(hiwordtext);
        pn.insertBefore(before,node);
        pn.insertBefore(hiword,node);
        pn.insertBefore(after,node);
        pn.removeChild(node);
      }
    }
  }
}
function searchStringHighlight() {
  if (!document.createElement || !document.getElementsByTagName) return;
  ref = document.referrer;
  if (ref.indexOf('?') == -1 || ref.indexOf('google') == -1 || ref.indexOf('search') == -1) return;
  qs = ref.substr(ref.indexOf('?')+1);
  qsa = qs.split('&');
  for (i=0;i<qsa.length;i++) {
    qsip = qsa[i].split('=');
    if (qsip.length == 1) continue;
    if (qsip[0] == 'q' || qsip[0] == 'as_q') { /* q= for Google, p= for Yahoo*/
      words = unescape(qsip[1].replace(/\+/g,' ')).replace(/\"/g,'').replace(/berlin/gi,'').split(/\s+/);
      highlightedWords="";
      for (var w=0;w<words.length;w++) {
        if(words[w].length>3) {
          highlightWord(document.getElementById("inhalt"),words[w]);
          highlightedWords+="<span class=searchword>"+words[w]+"</span> "
        }
      }
    }
  }
  if(highlightedWords!="" && document.getElementById("seitentools")){document.getElementById("seitentools").innerHTML+="<div id=suchtrefferliste>Markierte Suchtreffer: "+highlightedWords+"</div>"}
  openAllDetails();
  /*for (var i=0; i<document.getElementsByTagName("span").length;i++){
    if (document.getElementsByTagName("span")[i].className=="searchword"){
      document.getElementsByTagName("span")[i].scrollIntoView();
      break;
    }
  }*/
}


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_validateForm() { //v4.0
  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+nm+' keine korrekte E-Mail.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' darf nur Zahlen enthalten.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' ist erforderlich.\n'; }
  } if (errors) alert('Folgende Fehler sind aufgetreten:\n'+errors);
  document.MM_returnValue = (errors == '');
}