
function galleryListRight()
{
  if (gx<=(450-galleryLength-last))
  {
    return false;
  }
  gx-=2;
  document.getElementById('gallery-list-in').style.margin='0 0 0 '+gx+'px';  
}

function galleryListLeft()
{
  if (gx>=0)
  {
    return false;
  }
  gx+=2;
  document.getElementById('gallery-list-in').style.margin='0 0 0 '+gx+'px';  
}


function preloadImage(path, id, name)
{
  images[id]=new Image();
  images[id].src=path; 
  images[id].name=name; 
  galleryLength+=document.getElementById('gallery-thumb-'+id).width;
  document.getElementById('gallery-thumb-'+id).style.margin=Math.round(40-document.getElementById('gallery-thumb-'+id).height/2)+'px 0 0 0';
  last=document.getElementById('gallery-thumb-'+id).width;
}



function setGalleryImage(id)
{
  document.getElementById('gallery-image-name').innerHTML='<h2>'+images[id].name+'</h2>';
  document.getElementById('main-gallery-image').src=images[id].src;
}


function showGalleryImage(path)
{
  showImage(document.getElementById('main-gallery-image').src.replace('/thumb-m', ''), 1, 1);
}

var gx=0;
var images=new Array();
var galleryLength=0;
var last;
