// globale Variablen
var intCounter;
    intCounter=0;
var newWin
var intMaxAryElemente

function openWindowBildgalerie(url, beschreibung, wName, w, h, x, y) {

  if (!x) x=(screen.availWidth/2) - w/2;
  if (!y) y=(screen.availHeight/2) - h/2;
  
  var options = "";
  options += "resizable='no',scrollbars='auto',status='no'";
  options += "menubar='no',toolbar='no',location='no',directories='no', noresize";

  newWin = window.open('', 'newWin', options);
  newWin.resizeTo(w,h);
  newWin.moveTo(x,y)
  newWin.focus();
  newWin.document.write("<html><head><title>WLB-Esslingen</title>");
  newWin.document.write("<link href='/stile/haupt.css' rel='stylesheet' type='text/css' media='all'>");
  newWin.document.write("</head>\n<body bgcolor='#ffffff' text='#808080' style='margin:0px' marginwidth='0' marginheight='0'>");
  newWin.document.write("\n<table border=0 width=100% height=100%><tr>");
  newWin.document.write("<td valign=middle align=center colspan=2><a href='#' OnClick='self.close();'><img src='" + url + "' border=0 name='pics'></a></td>");
  newWin.document.write("</tr>\n");
  newWin.document.write("<tr><td valign=middle align=center colspan=2><div id='Beschreibung' class='schw10'>" + beschreibung + "</div></td></tr>");
  if (intMaxAryElemente > 1)
    {
    newWin.document.write("<tr><td align='right'><form><a onClick='opener.count(0)'><img src='/bilder/pfeil_links.gif' border=0></a></form></td>");
    newWin.document.write("<td><form><a onClick='opener.count(1)'><img src='/bilder/pfeil_rechts.gif' border=0></a></form></td></tr>");
    }
  newWin.document.write("\n</table>");  
  newWin.document.write("\n</body></html>");
  newWin.document.close();
  //pos = url.indexOf("?");
  //url = url.substr(0,pos);
  //if (url>'') newWin.document.location=url;
  }
  
function count(direction)
  {
  switch(direction)
    {
    // Dia ZURUECK
    case 0:
      if(intCounter==0)
        {
        // intCounter auf groessten index des arrays setzen
        intCounter=intMaxAryElemente-1;
        break;
        }
      else
        {
        // intCounter um 1 verringern
        intCounter=intCounter-1;
        break;
        }
    // Dia VOR
    case 1:
      if(intCounter==intMaxAryElemente-1)
        {
        // intCounter auf kleinsten Index des arrays (0) setzen
        intCounter=0;
        break;
        }
      else
        {
        // intCounter um 1 vergroessern
        intCounter=intCounter+1;
        break;
        }
    }
    
  newWin.resizeTo(aryElemente[intCounter][2],aryElemente[intCounter][3]);
  newWin.document.images["pics"].src = aryElemente[intCounter][0];
  newWin.document.getElementById('Beschreibung').innerHTML = aryElemente[intCounter][1];
  } // Ende function count(direction)
  