var text = "";
var map = "";
var imgname;

var fotomap = "gfx/albums/";
var thumbmap = "thumb/";

var nrpics = 0;
var nrrows = 0;
var max_pics_on_row = 4;
var nr_pics_on_row = 0;
var data  = new Array();
var title = new Array();
var this_title = "";
var i = 0;

var std_txt = new Array();
std_txt[0] = Array( "nl", "klik op een foto om deze te vergroten", "naar alle albums", "foto's in hoge resolutie", "mail úw foto's naar: ", "foto(s)" );
std_txt[1] = Array( "en", "click a picture to enlarge it", "to all albums", "pictures in high resolution", "mail your pictures to: ", "picture(s)" );

// data[i] = Array( "mapnaam", "subkop", "index-foto", "alt-text", nrpics );

data[i]  = Array( "2011", "Vlieg- & Kunstwerk in 2011", "04", "", 16 );
title[i] = Array( "", "Oddlings op Artiesten- & Evenenementen Beurs, Eindhoven", "Circus Tadaa! op Onderwijsbeurs NOT, Utrecht", "Oddlings speelt Alienzz in Gent (B)", "Oddlings speelt Alienzz in Gent (B)", "Circus Tadaa! op Eventbeurs, Utrecht", "\"Boom van een Vent\" met mr. Pieter van Vollenhoven voor Pret op recept", "\"Sweet Chefs\" voor Pret op recept, op Festival Mundial", "Met Circus Tadaa! in Heemstede", "\"Struis\" in Appeltern", "acrobatiekworkshop op St. Adelbertusschool Alkmaar", "publiek voor Oddlings Mannekino, Festival Esbaiola t, Esterri d Aneu (Esp)", "training", "bedrijfsworkshop voor Circus Tadaa!", "Sinterklaasbezoek voor Pret op recept", "Oddlings Mannekino @ Sarmede (Italië), 5 minuten voor aanvang, 12 graden Celsius", "acrobatiekles voor Stichting Stapel, Amsterdam" );
i++;

data[i]  = Array( "2010", "Vlieg- & Kunstwerk in 2010", "01", "", 14 );
title[i] = Array( "", "Oddlings Mannekino @ World Buskers Festival, Christchurch - Nieuw-Zeeland (foto: Sam Hannaford)", "Oddlings Alienzz @ Amsterdam (foto: Linden & Barbosa)", "\"Boom van een vent\" voor Pret op recept", "Circus Tadaa!", "\"Sweet Chefs\" voor Pret op recept", "Oddlings @ Wolfsburg (Duitsland)", "Oddlings Mannekino @ Straatfestival Woerden (foto: Michael van Baarsen)", "Circus Tadaa!", "handstand op Wibbe (Fullstop Acrobatic Theatre)", "Oddlings Mannekino @ ViaThea, Görlitz - Duitsland (foto: Frank Koniarski)", "Oddlings Mannekino @ Mintfest, Kendal - GB (foto: Paul Johnson)", "\"Struis\" op Ede Smakelijk", "Oddlings Mannekino @ Inverness - Schotland (foto: Neil Paterson)","Circus Tadaa! in verzorgingshuis"  );
i++;

data[i]  = Array( "2009", "Vlieg- & Kunstwerk in 2009", "09", "", 19 );
title[i] = Array( "", "16feet Acro-producties", "Alkmaarsche Courant (foto: jjfoto)", "\"Boom van een vent\" voor Pret op recept", "Jongleerballen maken op basisschool Oranjehof", "Oddlings speelt Mannekino, festival De Gevleugelde Stad in Ieper (foto: FotoFrankie)", "Oddlings speelt Mannekino, festival De Gevleugelde Stad in Ieper (foto: FotoFrankie)", "Oddlings speelt Mannekino, festival De Gevleugelde Stad in Ieper (foto: FotoFrankie)", "Beurs Event 2009 voor Circus Tadaa!", "Beurs Event 2009 voor Circus Tadaa!", "\"Sweet Chefs\" voor Pret op recept (foto: <a href=http://www.fotosandra.nl target=_blank>fotosandra</a>)", "\"Sweet Chefs\" voor Pret op recept", "\"Hoogleraar\" voor Pret op recept", "\"Fractals\" voor Tiramisu", "opnames film Entr Acte", "Oddlings speelt Alienzz, Utrecht (foto: Susan van Schijndel)", "Circus Tadaa! in Renswoude", "Boer Driekus voor Circus Klomp", "Circus Tadaa! in IJsselmuiden", "Oddlings speelt Mannekino tijdens World Statues Arnhem (foto: Peter Rommers)" );
i++;


function foto_boek( mapnr )
{
  text = "";
/*
  map = mp;

  for ( taalnr=0; taalnr<std_txt.length; taalnr++ )
  {
    if ( std_txt[taalnr][0] == tl )
    {
      break;
    }
  }

  if ( taalnr == std_txt.length )
  {
    taalnr = 0;
    tl = std_txt[0][0];
  }

  for ( mapnr=0; mapnr<data.length; mapnr++ )
  {
    if ( data[mapnr][0] == map )
    {
      break;
    }
  }

  if ( mapnr == data.length )
  {
    text +=
      "<a href='foto-album.htm' onMouseOver=\"self.status='';return true;\"><u>" + std_txt[taalnr][2] + "</u></a><br>" +
      "";
    document.write( text );

    return;
  }
*/
  map = data[ mapnr][0];
  taalnr = 0;
  tl = std_txt[0][0];

//nrpics = title[mapnr].length - 2;
  nrrows = 1;
  nrpics = data[mapnr][4];
  max_pics_on_row = 4;
  nr_pics_on_row = 0;

  text +=
    "<center>" +
    "	<b>\"" + data[mapnr][1] + "\"</b><br>" +
    std_txt[taalnr][1] + "<br>" +
    "   <a href=\"foto-album.htm\" onMouseOver=\"self.status='foto-albums';return true;\" onMouseOut=\"self.status='';return true;\">alle foto-albums</a><br>" +
    "";

  text +=
    "	<table cellspacing=0 cellpadding=4 border=0>" +
    "	  <tr valign=middle align=center>" +
    "";

  for ( idx=1; idx <= nrpics; idx++ )
  {
    imgname = idx + ".jpg";
    if ( idx < 10 )
    {
      imgname = "0" + imgname;
    }

    this_title = title[mapnr][0];
    if ( title[mapnr][idx] != null && title[mapnr][idx] != "" )
    {
      this_title += title[mapnr][idx];
    }

    text +=
      "	    <td>" +
      "		<a href='" + fotomap + map + "/" + imgname + "' " +
      "		  rel='lightbox[" + map + "]' onMouseOver=\"self.status='';return true\" " +
      "		  title='<br>" + this_title + "'><img " +
      "		  alt='" + this_title + "' " +
      "		  src='" + fotomap + map + "/" + thumbmap + imgname + "' " +
      "		  border=1></a>" +
      "	    </td>" +
      "";

    nr_pics_on_row += 1;
    if ( nr_pics_on_row == max_pics_on_row )
    {
      text +=
        "	  </tr>" +
        "	</table>" +
        "	<table cellspacing=0 cellpadding=4 border=0>" +
        "	  <tr valign=middle align=center>" +
        "";

      nr_pics_on_row = 0;
      nrrows += 1;
    }
  }

  if ( nrrows == 1 )
  {
    text += "</tr><tr><td height=120>&nbsp;</td>";
  }

  text +=
    "	  </tr>" +
    "	</table>" +
    "</center>" +
    "";

//  document.write( text );
  document.getElementById('tekst_main').innerHTML = text;
}

function foto_album( tl )
{
  text = "";

  for ( taalnr=0; taalnr<std_txt.length; taalnr++ )
  {
    if ( std_txt[taalnr][0] == tl )
    {
      break;
    }
  }

  if ( taalnr == std_txt.length )
  {
    taalnr = 0;
    tl = std_txt[0][0];
  }

  text +=
    "<center>" +
    "	<table class='galerij' cellspacing=0 cellpadding=10 border=0>" +
    "	  <tr valign=top align=center>" +
    "";

  nrrows = 1;
  max_pics_on_row = 4;
  nr_pics_on_row = 0;

  for( idx = 0; idx < data.length; idx++)
  {
//  nrpics = title[idx].length - 2;
    nrpics = data[idx][4];

    text +=
      "    <td>" +
      "	<a href=\"javascript:foto_boek(" + idx + ");\" onMouseOver=\"self.status='';return true;\">" +
      "	<img src=\"" + fotomap + data[idx][0] + "/" + thumbmap + data[idx][2] + ".jpg\" border=2 bordercolor=#000000 alt=\"" + data[idx][1] + "\"></a>" +
      "<br>" + data[idx][1] +
      "<br>" + nrpics + " " + std_txt[taalnr][5] +
      "    </td>" +
      "";

    nr_pics_on_row += 1;
    if ( nr_pics_on_row == max_pics_on_row )
    {
      text +=
        "	  </tr>" +
        "	  <tr valign=top align=center>" +
        "";

      nr_pics_on_row = 0;
    }
  }

  if ( nrrows == 1 )
  {
    text += "</tr><tr><td height=120>&nbsp;</td>";
  }

  text +=
    "	  </tr>" +
    "	</table>" +
    "</center>" +
    "";

  document.write( text );
}

