var galery_canvas_height="400";
var galery_pic_index=0;
var galery_pic_name;
var galery_pic_comment;
var galery_picture;
var galery_directory;

function showPasswordPrompt(){
  var check = prompt("Lieber Besucher, der interne Bereich enthält vertrauliche Daten, die den Mitgliedern des Jazzclub vorbehalten sind. Wir bitten um ihr Verständnis. Bitte geben Sie das Passwort ein.", "");
  if (check != "superarschloch") {
    
  } else {
    window.location.href = "jazzclub_intern_superarschloch.php"
  }
}

function setPictureData(pic_name,pic_comment,directory){
  galery_pic_name=new Array(pic_name.length);
  galery_pic_comment=new Array(pic_comment.length);
  galery_picture=new Array(pic_name.length);
  galery_directory=directory;
  for (var i=0;i<galery_pic_name.length;i++){
    galery_pic_name[i]=pic_name[i];
    galery_pic_comment[i]=pic_comment[i];
    galery_picture[i]=new Image();
    galery_picture[i].src="graphics/galeries/"+directory+"/"+galery_pic_name[i];
    
  }
}

function changePicture(richtung){
  galery_pic_index=galery_pic_index+richtung;
  if (galery_pic_index<0)
    galery_pic_index=0;
  if (galery_pic_index>=galery_pic_name.length)
    galery_pic_index=galery_pic_name.length-1;
  if (galery_pic_index==0)
    document.getElementById("arrow_left").style.visibility="hidden";
  if (galery_pic_index==1)
    document.getElementById("arrow_left").style.visibility="visible";
  if (galery_pic_index==galery_pic_name.length-1)
    document.getElementById("arrow_right").style.visibility="hidden";
  if (galery_pic_index==galery_pic_name.length-2)
    document.getElementById("arrow_right").style.visibility="visible";
  document.getElementById("canvas").src = galery_picture[galery_pic_index].src;
  var comment=document.getElementById("comment");
  comment.removeChild(comment.firstChild);
  comment.appendChild(document.createTextNode(galery_pic_comment[galery_pic_index]));
}

function nextPicture(){
  changePicture(1);
}

function prevPicture(){
  changePicture(-1);
}

function showSubmenu(id){
  var submenu=document.getElementById(id);
  submenu.style.visibility="visible";
}
function hideSubmenu(id){
  var submenu=document.getElementById(id);
  submenu.style.visibility="hidden";
}

function showInfoWindow(url,width,height){
  var infoWindow = window.open(url, "Zweitfenster", "width="+width+",height="+height+",scrollbars=no");
  infoWindow.focus();
}