function elem (AID)
{
 if (document.all) return (document.all[AID]); else return (document.getElementById(AID));
}

var pics= new Array(); iPic=0;
function picNavGoto(iNum)
{

 if (iNum==-1) iPic=(iPic==0)?(pics.length-1):(iPic-1); else if (iNum==-2) iPic=(iPic>=pics.length-1)?(0):(iPic+1); else iPic=iNum;
 for (i=0; i<pics.length; i++)
 {
  elem("picNav"+i).className=(i==iPic)?("picNavActive"):("picNav");
 }
 document.images["dia"].src=pics[iPic];

}

var detPicFile="su_pic_det.php";
function showDetPic(ASource,ADir,AWidth,AHeight)
{
F1 = open('../'+detPicFile+"?src="+ASource+"&dir="+ADir,"F1","width="+AWidth+",height="+AHeight+",screenX=0,screenY=0,resizable=no");
F1.focus();
}

function playSound(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");
   }
}

function print_content(filename,lang,title)
{
   F1 = open("../printwin.php?src="+filename+"&lang="+lang+"&title="+title,"fPrint","width=750,height=800,screenX=10,screenY=10,resizable=no");
   F1.focus();
}

function goForm() {
//alert (document.forms.length);
document.forms[0].submit();

}

function btn_hover(i) {
//alert (document.forms.length);
document.getElementById("formbutton").className=(i)?("btn-hover"):("btn");

}