var photo_path='', in_row=4, slide_width=0, slide_height=0, slide_spacing=10, photoNo=0

function gallery_start() {
  document.write('<TABLE BORDER="0" WIDTH="100%" CELLPADDING="0" CELLSPACING="10">') }

function photo(file, width, height, text ) {  photoNo++
  if(photoNo%in_row == 1) document.write('</TR><TR>')
  document.write('<TD ALIGN=CENTER VALIGN=TOP>')
  document.write('<TABLE BORDER="0" CELLPADDING="1" CELLSPACING="0"><TR><TD CLASS=photoBorder>')
  document.write('<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0"><TR><TD CLASS=photoBg>')
  if(slide_height>0)
    document.write('<IMG SRC="img/0.gif" WIDTH=1 HEIGHT='+ slide_height +' ALIGN=RIGHT>')
  document.write('<TABLE BORDER="0"'+ (slide_width>0 ? ' WIDTH='+slide_width : '') +' CELLPADDING="0" CELLSPACING="'+ slide_spacing +'">')
  document.write('<TR><TD CLASS=photoNo>'+ photoNo +'</TD><TD ALIGN=RIGHT VALIGN=TOP>')
  document.write('<A HREF="'+ photo_path +'/'+ file +'" TITLE="Click to enlarge photo" TARGET="_blank">')
  document.write('<IMG SRC="'+ photo_path +'/thumb/'+ file +'" BORDER="0"'+ (width>0 ? ' WIDTH='+width : '') + (height>0 ? ' HEIGHT='+height : '') +' ALT="Click to enlarge photo"></A></TD></TR>')
  document.write('<TR><TD COLSPAN=2 CLASS=photoText>')
  document.write(text +'</TD></TR></TABLE></TD></TR></TABLE></TD></TR></TABLE></TD>') }

function gallery_end() {
  document.write('</TR></TABLE>'); }
