<!--
var bigpicWin = null;

/*
function showbigimage(url, picwidth, picheight, bildunterschrift)
{  
	if (!bigpicWin || bigpicWin.closed)
  {
    // Zur Positionierung des Fensters wird die Bildschirmauflösung ermittelt
    // und damit die XY-Position der linken oberen Ecke berechnet

    usrwidth = screen.width;
    usrheight = screen.height;

    winwidth = picwidth;
    winheight = picheight;

    var X = (usrwidth - winwidth) / 2;
    var Y = (usrheight - winheight) / 2;

    properties = "toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=no,copyhistory=no,width="+winwidth+",height="+winheight+",";

    checkie = navigator.appName.indexOf("icrosoft");
    if (checkie == -1)
    {
      properties = properties+"screenX="+X+",screenY="+Y;
    }
    else
    {
      properties = properties+"left="+X+",top="+Y;
    }

    bigpicWin = window.open('','bigpicWin',properties);

    bigpicWin.document.open();
    bigpicWin.document.write('<HTML><HEAD>');
    bigpicWin.document.write('<TITLE>'+bildunterschrift+'</TITLE>');
    bigpicWin.document.write('</HEAD>');
    bigpicWin.document.write('<BODY MARGINWIDTH="0" MARGINHEIGHT="0" LEFTMARGIN="0" TOPMARGIN="0" BOTTOMMARGIN="0" SCROLLING=NO>');
    bigpicWin.document.write('<A HREF="JavaScript:self.close()"><IMG SRC="'+url+'" ALT="Klicken zum Schlie&szlig;en" HSPACE="0" VSPACE="0" BORDER="0"></A>');
    bigpicWin.document.write('</BODY>');
    bigpicWin.document.write('</HTML>');
    bigpicWin.document.close()

    bigpicWin.focus();
  }
  else
  {
    bigpicWin.focus();
  }
}
*/

function showbigimage(path, imagewidth, imageheight, bildunterschrift, auchverzeichnis) {
  //$('divPopup').update("<div class='event'>"+bildunterschrift+"</div><a href='javascript:hide();'><img src='"+url+"'/></a>");
  new Ajax.Updater(
    'divPopup',
    'ajaxFotos.php',
    {
      asynchronous:false,
      method:'post',
      parameters:{path:path,
                  bildunterschrift:bildunterschrift,
                  auchverzeichnis:auchverzeichnis}
    }
  );
  $('divBlack').setStyle({display: 'block'}); 
  
  $('divPopup').setStyle({display: 'block', marginLeft:(-Math.floor(imagewidth/2)-17)+'px', width:imagewidth+'px'});
  //if($('divLeft'))
  //  $('divLeft').setStyle({marginLeft: leftPx+'px'});
  if($('divRight'))
    $('divRight').setStyle({marginLeft: (imagewidth-20)+'px'});
}

function showpreviousalbumpage(albumId) {
  new Ajax.Updater(
    'divAlbum' + albumId,
    'ajaxFotoalbum.php',
    {
      asynchronous:true,
      method:'get',
      parameters:{previousPage:albumId}
    }
  );
}

function shownextalbumpage(albumId) {
  new Ajax.Updater(
    'divAlbum' + albumId,
    'ajaxFotoalbum.php',
    {
      asynchronous:true,
      method:'get',
      parameters:{nextPage:albumId}
    }
  );
}

function checkAll(bilder, check) {
	for(var i=0;i<bilder.length;i++) {
		$('pictures'+bilder[i]).checked = check;
	}
}

function showpreviouscalendarpage(mainmenu, submenu, monat, jahr, filter1, filter2, filter3) {
  new Ajax.Updater(
    'divKalender',
    'ajaxKalender.php',
    {
      asynchronous:true,
      method:'get',
      parameters:{
        mainmenu: mainmenu,
        submenu: submenu,
        previousMonth:monat, 
        previousYear: jahr,
        filter1: filter1,
        filter2: filter2,
        filter3: filter3
      }
    }
  );
}

function shownextcalendarpage(mainmenu, submenu, monat, jahr, filter1, filter2, filter3) {
  new Ajax.Updater(
    'divKalender',
    'ajaxKalender.php',
    {
      asynchronous:true,
      method:'get',
      parameters:{
        mainmenu: mainmenu,
        submenu: submenu,
        nextMonth:monat, 
        nextYear: jahr,
        filter1: filter1,
        filter2: filter2,
        filter3: filter3
      }
    }
  );
}

function WinOpen(URL,winName,features) { 
  window.open(URL,winName,"scrollbars=yes,height=650,width=580,resizable");
}

function Spring() {
    var welcherLink = document.Springen.URLs.selectedIndex;
    document.Springen.URLs.selectedIndex = "0";
    if(welcherLink > "0"){
       self.location.href = document.Springen.URLs.options[welcherLink].value;
    }
}

function Tagesinfo(URL,winName,features) { 

    xy=window.open(URL,winName,"height=370,width=350,top=230,left=270,scrollbars=yes");
    xy.focus();
}

function extlink(URL)
{
window.opener.location.href=URL;
self.focus();
}

function change(bildname,tauschbild)
{
document.images[bildname].src=tauschbild;
}

function hide() {
  $('divBlack').setStyle({display: 'none'});
  $('divPopup').setStyle({display: 'none'});
}

function kalenderInfo(tag, monat, jahr, filter1, filter2, filter3) {
  //$('divPopup').update("<div class='center'><img src='images/ajax.gif'/></div>");
  $('divBlack').setStyle({display: 'block'});  
  $('divPopup').update("<img src='images/ajax.gif'/>");
  $('divPopup').setStyle({display: 'block', marginLeft:'-315px'});
  
  new Ajax.Updater(
    'divPopup',
    'ajaxTagesinfo.php',
    {
      asynchronous:true,
      method:'post',
      parameters:{Jahr:jahr, Monat:monat, Tag:tag, filter1:filter1, filter2:filter2, filter3:filter3}
    }
  );
}

function kalenderInfoNeu(terminId) {
  //$('divPopup').update("<div class='center'><img src='images/ajax.gif'/></div>");
  $('divBlack').setStyle({display: 'block'});  
  $('divPopup').update("<img src='images/ajax.gif'/>");
  $('divPopup').setStyle({display: 'block', width:'575px', marginLeft:'-315px'});
  
  new Ajax.Updater(
    'divPopup',
    'ajaxTagesinfo.php',
    {
      asynchronous:true,
      method:'post',
      parameters:{TerminId:terminId}
    }
  );
}

function einblenden(id) {
  $(id).setStyle({display: 'block'});
}

function ausblenden(id) {
  $(id).setStyle({display: 'none'});
}

function legende(str) {
  if(str == 'einblenden') {
    ausblenden('legende_hidden');
    einblenden('legende_visible');
  }
  if(str == 'ausblenden') {
    ausblenden('legende_visible');
    einblenden('legende_hidden');
  }
}

