var winGuestbook = null;
var winMusic = null;
var winAppearance = null;
var winGallery = null;
var winPlayer = null;
var winAdminLogin = null;
var winNews = null;
var winDownload = null;
var winLinks = null;
var winImpressum = null;

function closeAll() {
 
 if(winLinks != null) {
   try {
    winLinks.close();
    winLinks = null;
   }
   catch(e) {
    winLinks = null;
   } 
  }
 
 if(winImpressum != null) {
   try {
    winImpressum.close();
    winImpressum = null;
   }
   catch(e) {
    winImpressum = null;
   } 
  }

 if(winDownload != null) {
   try {
    winDownload.close();
    winDownload = null;
   }
   catch(e) {
    winDownload = null;
   } 
  }
 
  if(winGuestbook != null) {
   try {
    winGuestbook.close();
    winGuestbook = null;
   }
   catch(e) {
    winGuestbook = null;
   } 
  } 
 
  if(winMusic != null) {
   try {
    winMusic.close();
    winMusic = null;
   }
   catch(e) {
    winMusic = null;
   } 
  }
 
  if(winAppearance != null) {
   try {
    winAppearance.close();
    winAppearance = null;
   }
   catch(e) {
    winAppearance = null;
   } 
  }
 
  if(winGallery != null) {
   try {
    winGallery.close();
    winGallery = null;
   }
   catch(e) {
    winGallery = null;
   } 
  }
 
  if(winAdminLogin != null) {
   try {
    winAdminLogin.close();
    winAdminLogin = null;
   }
   catch(e) {
    winAdminLogin = null;
   } 
  }
    
  if(winNews != null) {
   try {
    winNews.close();
    winNews = null;
   }
   catch(e) {
    winNews = null;
   } 
  }

  closePlayer();

}

function openLinks() {
 closeAll();
 winLinks = window.open("./../content/links.html", "", "width=500, height=334, screenX=200, screenY=200, " +
                            "left=200, top=200, resizable=no, menubar=no, scrollbars=no, toolbar=no, status=no");
}

function openDownload() {
 closeAll();
 winDownload = window.open("./../content/download.html", "", "width=467, height=700, screenX=100, screenY=0, " +
                            "left=100, top=0, resizable=no, menubar=no, scrollbars=no, toolbar=no, status=no");
}

function openGuestbook() {
 closeAll();
 winGuestbook = window.open("./../content/guestbook.php", "", "width=700, height=467, screenX=0, screenY=0, " +
                            "left=0, top=0, resizable=no, menubar=no, scrollbars=no, toolbar=no, status=no");
}

function openMusic() {
 closeAll();
 winMusic = window.open("./../content/music.html", "", "width=800, height=794, screenX=0, screenY=0, " +
                          "left=0, top=0, resizable=no, menubar=no, scrollbars=yes, toolbar=no, status=no");
}

function openAppearance() {
 closeAll();
 winAppearance = window.open("./../content/appearance.php", "", "width=700, height=582, screenX=0, screenY=0, " +
                             "left=0, top=0, resizable=no, menubar=no, scrollbars=no, toolbar=no, status=no");
}

function openGallery() {
 closeAll();
 winGallery = window.open("./../images/gallery/index.html", "", "width=1024, height=800, screenX=0, screenY=0, " +
                          "left=0, top=0, resizable=no, menubar=no, scrollbars=yes, toolbar=no, status=no");
}

function openAdminLogin() {
 closeAll();
 winAdminLogin = window.open("./../admin/admin_login.php", "", "width=700, height=450, screenX=0, screenY=0, " +
                             "left=0, top=0, resizable=no, menubar=0, scrollbars=yes, toolbar=no, status=no");
}

function openNews() {
 closeAll();
 winNews = window.open("./../content/news.php", "", "width=500, height=500, screenX=150, screenY=100, " +
                            "left=150, top=100, resizable=no, menubar=no, scrollbars=no, toolbar=no, status=no");
}


function openImpressum() {
 closeAll();
 winImpressum = window.open("./../content/impressum.html", "", "width=766, height=705, screenX=150, screenY=100, " +
                            "left=150, top=100, resizable=no, menubar=no, scrollbars=no, toolbar=no, status=no");
}

function openPlayerFront(title) {
 closePlayer();
 winPlayer = window.open("./samples/player.php?title="+title, "", "width=150, height=150, screenX=0, screenY=0, "+
                         "left=0, top=0, resizable=no, menubar=no, scrollbars=no, toolbar=no status=no");
}

function openPlayer(title) {
 closePlayer();
 winPlayer = window.open("./../samples/player.php?title="+title, "", "width=150, height=250, screenX=0, screenY=0, "+
                         "left=0, top=0, resizable=no, menubar=no, scrollbars=no, toolbar=no status=no");
}

function closePlayer() {
  if(winPlayer != null) {
   try {
    winPlayer.close();
    winPlayer = null;
   }
   catch(e) {
    winPlayer = null;
   } 
  }
}

