/* Copyright Scientec Internet Applications + Media GmbH - www.scientec.de */

function init()
{
  mailDecode();
  linkHighlight();
}

function linkHighlight()
{
  for (var i=0; i<document.getElementsByTagName("a").length; i++){
    thisA=document.getElementsByTagName("a")[i];
    thisHREF=thisA.href;
    thisLOCATION=document.location.href;
    if(thisHREF==thisLOCATION)
		{
			thisA.className+="hier"
		}
    if(thisHREF.indexOf("/wirtschaftsdetektei.html")!=-1 && thisLOCATION.indexOf("/wirtschaftsdetektei/")!=-1)
		{
			thisA.className+=" aktiv"
		}
    if(thisHREF.indexOf("/privatdetektei.html")!=-1 && thisLOCATION.indexOf("/privatdetektei/")!=-1)
		{
			thisA.className+=" aktiv"
		}
    if(thisHREF.indexOf("/kunden.html")!=-1 && thisLOCATION.indexOf("/einsatzorte/")!=-1)
		{
			thisA.className+=" aktiv"
		}
  }
}

function mailDecode()
{
  var EM=document.getElementsByTagName("em");
  if(EM.length>0){
    var mt="m"+"ai"+"lto:";
    for(var i=0;i<EM.length;i++){
      thisEM=EM[i];
      EMSTR=String(thisEM.innerHTML);
      if(EMSTR.indexOf("~AT~")!=-1){
        EMSTR=EMSTR.replace(/~AT~/,"@");
        thisEM.innerHTML='<a href="'+mt+EMSTR+'">'+EMSTR+'</a>';
        thisEM.className="em";
      }
    }
  }
}


