<!-- Hide the script from old browsers --

/*
var timerID = null;
var timerRunning = false;
var id,pause=0,position=0;

function txtScroll() {
var i,x
var message="       Onze openingstijden zijn: Maandag gesloten, Dinsdag t/m Donderdag van 10.00-18.00, Vrijdag van 10.00-18.00 en 19.00-21.00, Zaterdag van 10.00-17.00                       ";
x=(120/message.length)+1;
for(i=0;i<=x;i++) message+=" "+message;
window.status=message.substring(position,position+120);
if(position++==148) position=2;
id=setTimeout("txtScroll()",1500/10);
}

function action() {
        if(!pause) {
                clearTimeout(id);
                pause=1; }

        else {
                ticker();
                pause=0; }
 }
*/
// --End Hiding Here -->

/*
function wikipedia(page)
{
  var link = 'http://en.wikipedia.org/wiki/' + page ;

  window.open(link, '_wiki');
}
*/


var g_imgindex=0;

function toggletn(img,imgname, tnname)
{
//alert(img.src + '\n' + imgname);

  if (img.src.indexOf('/' + tnname) != -1)
    img.src = img.src.replace(tnname, imgname);
  else
    img.src = img.src.replace(imgname, tnname);
//alert(img.src)
}

function writetoggleimage(name, tnpre, tnpost)
{
  var img =  "<img src='" + (tnpre + name + tnpost) + ".jpg' id='myimg_" + g_imgindex + "' alt='"+name+"' onclick='toggletn(document.getElementById(\"myimg_" + g_imgindex + "\"),\"" + name + "\", \""+ (tnpre + name + tnpost) +"\");' />";
  g_imgindex++;
//alert(img)
  return img;
}

function wti(name)
{
  document.write(writetoggleimage(name, g_tnpre, g_tnpost));
}


// [[www.resturl text]] url
// [[http://resturl text]] url
// [[en:page text]] wikipedia page (page with _ instead of spaces)
function wikipedia(id, idistext, imgwidth)
{
  var x = id;
  if (arguments.length < 3)
    imgwidth = '';
  else
    imgwidth = " \\width="+imgwidth+"\\'";

  if (arguments.length == 1 || !idistext)
    x = document.getElementById(id).innerHTML;

  // Generate mouseovers for dynamic drive pics
  // MUST USE single quotes for text !!!
  // Quotes in tags (e.g. <a href) should be escaped by \'  !!!
  // Untagged IMAGES should NOT be quoted !!!
  var re = /:::(.+?):::/mg;
  var a;
  var img_re = /^(.+?\.(gif|jpe?g|png))$/;
  while( a = re.exec(x))
  {
    a[1] = a[1].replace(img_re, "'<img src=\\'$1\\'"+imgwidth+" alt=\\'missing $1\\' />'");
    a[1] = a[1].replace(/"/gm, "'");

    var repl =

  " onmouseover=\"ddrivetip("+a[1]+");\"  onmouseout=\"hideddrivetip();\"";
    x = x.replace(a[0], repl);
  }

  x = x.replace(/\[\[(https?:\/\/[\S]+)\s+([^\]]+)\]\]/mg, '<a href="$1" target="_wiki">$2<\/a>');
  x = x.replace(/\[\[(www\.\S+)\s+([^\]]+)\]\]/mg, '<a href="http://$1" target="_wiki">$2<\/a>');
  x = x.replace(/\[\[([a-z][a-z]):([\S]+)\s+([^\]]+)\]\]/mg, '<a href="http://$1.wikipedia.org/wiki/$2" target="_wiki">$3<\/a>');
//  x = x.replace(/\[\[toggle:([^\]]+)\]\]/mg, writetoggleimage('$1' '<a href="http://$1.wikipedia.org/wiki/$2" target="_wiki">$3<\/a>');

  // replace spaces generating >onmouseover outside <A...> tag
  x = x.replace(/>(onmouseover.+?onmouseout="hideddrivetip\(\);")/gm, "$1>");;

  if (x != id)
  document.getElementById(id).innerHTML = x;
  return x;
}

// rowtype = 0: header, 1 odd row, 2 even row
function tablerow(row, rowtype)
{
  var therow = row.split('%%%');
  var out = '';

  if (rowtype & 2)
    out += "<tr> class='odd'>";
  else
    out += "<tr>";

  for (i in therow)
  {
    if (rowtype != 0)
      out += '<td>' + therow[i] + '</td>';
    else
      out += '<th>' + therow[i] + '</th>';
  }
  out += "</tr>\n";
  return out;

}

var g_galleryindex = 0;

function fancyboxgallery() 
{
  g_galleryindex++;
  if (window.jQuery) {
  $('a[rel=images_group_'+ g_galleryindex + ']').fancybox({
    'transitionIn'    : 'none',
    'transitionOut'   : 'none',
    'cyclic' : 'true',
    'speedIn'   : 100,
    'speedOut'   : 100,
    'changeSpeed' : 100,
    'titlePosition'   : 'over',
    'titleFormat'   : function(title, currentArray, currentIndex, currentOpts) {
      return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
    }
  });
  }
}


function Imagedata(picture, thumbnail, smalltext, largetext, cx, cy)
{
    this.picture = picture;
    this.thumbnail = thumbnail;
    this.smalltext = smalltext;
    this.largetext = largetext;
    this.url = "";
    var i = smalltext.indexOf('!');
    if (i > 0)
    {
        this.url = this.smalltext.substring(i+1);
        this.smalltext = this.smalltext.substring(0,i);
    }
    this.cx = cx;
    this.cy = cy;
}

var index = 0;
var g_defcellwidth = 200;
var g_defcellheight = 200;
var g_showdata = 0;                 // ZET OP 0 ALVORENS PAGINA TE PUBLICEREN !!!!
var g_defsmalltext  = 'Picture';
var g_ncolumns      = 3;
var g_deffont       = 'Comic Sans MS';
var g_mouseovertext = 'Click here for larger photo';
var g_defcx         = 640;
var g_defcy         = 480;
var g_defrowheight  = 30;
var g_maxarraysize  = 512;
var g_pictndir      = "";
var g_picdir        = "";


function showImage(picture, cx, cy, smalltext, largetext, number)
{
   var url = "";

   if (smalltext == "")
       smalltext = g_defsmalltext;
   if (largetext == "")
       largetext = smalltext;

   var msg1 =
       '<html>\n' +
       '<head>\n' +
       '<title>[' + number + '] ' + smalltext + '</title>\n' +
       '<scr' + 'ipt language=\"javascript\" src=\"images.js\">' +
       '</scr' + 'ipt>\n' +
       '<link rel="stylesheet" href="style.css" type="text/css">\n' +
//        stylesheet() +
       '</head>\n' +
       '<body oncontextmenu="return false" onclick="window.close()" onBlur="self.focus()">\n' +
       '<p><center>\n' +
       '<h3>' + largetext + '</h3>\n' +
       '<p>\n' +
       '<img src=\"' + picture + '\" name=\"largeimg\">\n' +
       '<scr' + 'ipt language=\"Javascript\">\n' +
       'width  = window.document.largeimg.width;\n' +
       'height = window.document.largeimg.height;\n' +
       '// workaround on bug ???\n' +
       'if (width < 100 || height < 100)\n' +
       '{\n' +
       '    width  = ' + g_defcx + ';\n' +
       '    height = ' + g_defcy + ';\n' +
       '}\n' +
       'width += 50; height += 120;\n' +
       'if (width > window.screen.availWidth)\n' +
       '    width = window.screen.availWidth;\n' +
       'if (height > window.screen.availHeight)\n' +
       '    height = window.screen.availHeight;\n' +
       'x = (window.screen.availWidth - width)/2;\n' +
       'y = (window.screen.availHeight - height)/2;\n' +
       'window.moveTo( x,y);\n' +
       'window.resizeTo( width,height);\n' +
       '</s' + 'cript>\n' +
       '</body>\n' +
       '</html>\n';

//  msg1 = showSource(msg1);
    var s = "y=0,height="+cy+",width="+cx+",status=no,location=no,toolbar=no,directories=no,menubar=no,resizable=yes,scrollbars";
    w = open(url, "newwin", s);
    w.document.open("text/html", "replace")
    w.document.write(msg1)
    w.document.close()
    w.focus();
}

function convertint(n,base)
{
    var repres="";
    var DIGITS = "0123456789ABCDEF";
    var remainder;
    if (n == 0) return "0";
    while (n > 0)
    {
        remainder = n % base;
        repres = DIGITS.substr(remainder,1) + repres;
        n = (n-remainder)/base;
    }
    return repres;
}
/*

function setimageall(mask, count, width, height)
{
  myarray = new array();
  for (var i=1; i<=count; i++)
  {
    index = 0;
    setimagedata(myarray, mask + convertint(i,16) + ".jpg","", "","",6width, height);
  }

  writeTable(myarray, count);
}
*/
function setimagedata(a,picture,thumbnail, smalltext, largetext, cx, cy)
{
   picture = g_picturepath + picture;
   if (arguments.length < 3)
    {
        smalltext = '';
        largetext = '';
        cx = 0;
        cy = 0;
    }
    if (typeof(smalltext) == "undefined") smalltext = '';
    if (thumbnail == "" || typeof(thumbnail) == "undefined" || arguments.length < 3)
    {
        if (picture != "")
        {
            var i = picture.indexOf(".",i);
            thumbnail = picture.substring(0,i) + "_t" + picture.substring(i);
        }
        else
            thumbnail = "";
    }
//picture   = g_imagedir + picture;
//thumbnail = g_imagedir + thumbnail;
    // largetext not given
    if (typeof(largetext) == "undefined") largetext = "";

    a[index++] = new Imagedata(picture, thumbnail, smalltext, largetext, cx, cy);
}


function writeThumbnail(picture, thumbnail, smalltext, largetext, cx, cy, url)
{
   var content = "";
    if (cx == 0 || cx == "") cx = g_defcx;
    if (cy == 0 || cy == "") cy = g_defcy;

    if (thumbnail == "")
    {
        content += ("<td align=center valign=top>&nbsp;</td>\n");
        return;
    }

    var number = picture;
    var picturelink;
//alert(1);
    if (picture.substring(0,7) != "http://")
    {
      var i = number.indexOf("/");
      if (i == -1) i = 0;
      var i = number.indexOf(".",i);
      number = number.substring(0,i);


      if (window.jQuery)
          picturelink = "      <a class='viewimage' rel='images_group_"+ g_galleryindex  +"' title='" + smalltext + " " + largetext + "' href=\"" + picture+"\"" ;
      else 
          picturelink = "      <a href=\"javascript:showImage(\'" + picture + "\'," +
                          cx +"," + cy + ",\'" + smalltext + "\',\'" + largetext + "\','" + number + "');\"\n" ;
    }
    else
    {
//        picturelink = "<a href=\"" + picture + "\" class='viewimage' target=\"main\"" ;
        picturelink = "<a href=\"" + picture + "\" target=\"main\"" ;
        number = 0;
    }

    content += ("<td align=center valign=top style='width:"+g_defcellwidth+"px; height:"+g_defcellheight+"px;'>\n" );
    if (g_showdata)
    {
      content += ("  <table border=" + g_showdata + ">\n");

      content += ("  <tr>\n" +
                    "    <td align=center valign=bottom height=" + g_defrowheight + "><font face=\"" + g_deffont + "\">\n");
      content += ("<font color=\"#ff0000\">" + ++allcount + ":[" +  picture + "]<br>\n" +
                       "[" +  largetext + "]</FONT><BR>\n");
    }

    if (g_showdata)
        content += ("    </font></td>\n");
    if (g_showdata) {
      content += ("  </tr>\n");
      content += ("  <tr>\n");
      content += ("    <td align=center valign=middle height=" + g_defcellheight + " width=" + g_defcellwidth + ">\n" );
    }
    content +=  ((  picture != "" ?
                     picturelink +
                   "      onmouseover=\"window.status=\'" + g_mouseovertext + "\'; return true;\"\n" +
                   "      onmouseout=\"window.status=\'\'; return true;\">\n" +
                   "      <IMG SRC=\"" + thumbnail + "\" border=\"0\">\n" +
                   "      </A>\n" :   "      <P><IMG SRC=\"" + thumbnail + "\" BORDER=\"0\">\n" ))
    if (g_showdata) content += (
                   "    </TD>\n" +
                   "  </TR>\n" +
                "  </TABLE>\n");
    if (smalltext != "")
    {
      content += "<br />";
      if (url != "")
          content += ("<a href=\"http://" + url + "\" target=\"main\">" + smalltext + "</a>\n");
      else
          content += (smalltext + "\n");
    }
    content += "</td>\n";
//p_r(content);
   document.write(content);
}

function writeThumbnail1(picture, thumbnail, smalltext, largetext, cx, cy, url)
{
    if (cx == 0 || cx == "") cx = g_defcx;
    if (cy == 0 || cy == "") cy = g_defcy;
    var number = picture;

    var i = number.indexOf(".");
    number = number.substring(0,i);

    document.write("<TD ALIGN=CENTER VALIGN=TOP>\n" +
                   "  <TABLE border=" + g_showdata + ">\n");
    document.write("  <TR>\n" +
                   "    <TD ALIGN=CENTER VALIGN=bottom HEIGHT=" + g_defrowheight + ">\n");
    if (g_showdata)
    {
        document.write("<FONT COLOR=\"#FF0000\">[" +  picture + "]<BR>\n" +
                       "[" +  largetext + "]<BR>\n");
    }

    if (smalltext != "")
    {
        if (url != "")
            document.write("<A HREF=\"http://" + url + "\" TARGET=\"MAIN\">" + smalltext + "</A>\n");
        else
            document.write(smalltext + "\n");
    }
    document.write("    </FONT></TD>\n");
    document.write("  </TR>\n");
    document.write("  <TR>\n" +
                   "    <TD ALIGN=CENTER VALIGN=top HEIGHT=" + g_defcellheight + ">\n" +
                   "      <A HREF=\"javascript:showImage(\'" + picture + "\'," +
                           cx +"," + cy + ",\'" + smalltext + "\',\'" + largetext + "\','" + number + "');\"\n" +
                   "      ONMOUSEOVER=\"window.status=\'" + g_mouseovertext + "\'; return true;\"\n" +
                   "      ONMOUSEOUT=\"window.status=\'\'; return true;\">\n");
    document.write("      <P><IMG SRC=\"" + thumbnail + "\" BORDER=\"0\">\n");
    document.write("      </A>\n");
    document.write("    </TD>\n" +
                   "  </TR>\n");
    document.write("  </TABLE>\n" +
                   "</TD>\n");
}

myarray = new Array (g_maxarraysize);

function writeTable(myarray, ncolumns)
{
    var i=0;
    document.write("<TABLE>\n<TR>\n");
    for (i=0; i<index; i++)
    {
        writeThumbnail(g_picdir + myarray[i].picture, g_pictndir + myarray[i].thumbnail, myarray[i].smalltext,
            myarray[i].largetext, myarray[i].cx, myarray[i].cy, myarray[i].url);
        if ((i+1) % ncolumns == 0)
        {
            document.write("</TR>\n<TR>\n");
        }
    }
    document.write("</TR>\n</TABLE>\n");
}

