var padding = "00";

function CreateGallery(picName, picNameSmall, picPath)
{
  document.write("<table class='Gallery' border=0 align=center>");
  for(var rowCount=0; rowCount<=16; rowCount+=8)
  {
    document.write("<tr>");
    for(var iCount=1; iCount<=8 ; iCount++)
    {
      var strIndex = new String(iCount+rowCount);
      strIndex = padding.substr(0,3-strIndex.length)+strIndex;
      document.write("<td><a href='#top'><img height=70 width=60 src='");
      document.write(picPath+picNameSmall+strIndex+".jpg");
      document.write("' alt='"+picName+strIndex+"' onClick=ShowBig('");
      document.write(picName+strIndex+"','"+picPath+"','big')></a></td>");
    }
    document.write("</tr>");
  }
  document.write("</table>");
}

function ShowBig(picName, picPath, id)
{
  document.getElementById(id).src = picPath+picName+".jpg";
}

function Slides(id, direction, picPath, picName)
{
  var file=document.getElementById(id).src;
  var current = file.substr(file.length-7,3);
  var strIndex = (current/1)+direction;
  if(strIndex == 0)
  {
    strIndex = 24;
  }
  if(strIndex > 24)
  {
    strIndex = 1;
  }
  strIndex = strIndex+"";
  strIndex = padding.substr(0,3-strIndex.length)+strIndex;
  document.getElementById(id).src = picPath+picName+strIndex+".jpg";
}
