function urlinfo(AUrl)
{
   // members: (file)name, dir, lang
   sUrl=AUrl.replace(/%26/g,"&");

   //-----------------------------
   // auszufilternde URLs
   aFilter=new Array("http://www.jeremyfindlay.com/",
                    "http://jeremyfindlay.test/",
                    "http://jeremy.test/",
                    "http://127.0.0.1/");
   s=sUrl.toLowerCase();
   for (i=0;i<aFilter.length;i++)
   {
      x=aFilter[i].length;
      if (s.substr(0,x)==aFilter[i])
      {
         sUrl=sUrl.substr(x,sUrl.length-x);
         break;
      }
   }

   s="/homepage/";
   i=sUrl.indexOf(s);
   if (i>-1) sUrl=sUrl.substr(i+s.length,sUrl.length-s.length);

   sSearch="";
   i=sUrl.indexOf("?");
   if (i>-1)
   {
      sSearch=sUrl.substr(i+1,sUrl.length-i);
      sUrl=sUrl.substr(0,i);
   }

   // members -----------------
   aNav=sUrl.split("/");
   this.name=aNav[aNav.length-1];

   s="";
   s1="";
   for (i=0;i<aNav.length-1;i++)
   {
      s+=aNav[i]+"/";
      s1+="../";
   }
   if (s) s=s.substr(0,s.length-1);
   this.dir=s;

}
var doc=new urlinfo(location.href);
var isDOM = (document.getElementById ? true : false);
var isIE4 = ((document.all && !isDOM) ? true : false);
var isNS4 = (document.layers ? true : false);

function getRef(id)
{
   if (isDOM) return top.nav.document.getElementById(id);
   if (isIE4) return top.nav.document.all[id];
   if (isNS4) return document.layers[id];
}

function start()
{
   getRef("home").className=(doc.dir=="home")?("navactive"):("nav");
   getRef("news").className=(doc.dir=="news")?("navactive"):("nav");
   getRef("bio").className=(doc.dir=="bio")?("navactive"):("nav");
   getRef("rep").className=(doc.dir=="rep")?("navactive"):("nav");
   getRef("press").className=(doc.dir=="press")?("navactive"):("nav");
   getRef("photos").className=(doc.dir=="photos")?("navactive"):("nav");
   getRef("video").className=(doc.dir=="video")?("navactive"):("nav");
   getRef("cd").className=(doc.dir=="cd")?("navactive"):("nav");
   getRef("mp3").className=(doc.dir=="mp3")?("navactive"):("nav");
   getRef("duo").className=(doc.dir=="duo")?("navactive"):("nav");
   getRef("contact").className=(doc.dir=="contact")?("navactive"):("nav");
}

var detPicFile="su_pic_det.php";
function showDetPic(ASource,ADir,AWidth,AHeight)
{
var s=window.location.pathname;
i=s.lastIndexOf("/");
if (i>-1) s=s.substr(0,i);
F1 = open('/'+detPicFile+"?src="+s+"/"+ASource,"F1","width="+AWidth+",height="+AHeight+",screenX=0,screenY=0,resizable=no");
F1.focus();
}


function play(AFile,AKomp,AWerk)
{
   if (AFile.substr(0,1)=="/") sDir="";
   else {
      sDir=window.location.pathname;
      i=sDir.lastIndexOf("/");
      if (i>-1) sDir=sDir.substr(0,i);
   }

   i=AFile.lastIndexOf(".");
   if (i>0)
   {
      s=AFile.substr(i);
      if (s==".mp3")
      {
         x=screen.width;
         y=screen.height;
         b=242;
         h=50;
         f = window.open("/flashaudioplayer.php?file="+sDir+'/'+AFile+"&komp="+AKomp+"&werk="+AWerk, "xxx", "width="+b+",height="+h+",left="+(x-b)/2+",top="+(y-h)/2)-15;
         //f.focus();
      }
      else f = window.open(sDir+'/'+AFile, "xxx");
   }
}

window.onload= function () {
   parent.frames["main"].focus(); 
   window.setTimeout("start()",100);

}