var Gallery = new Array();



Gallery[0] = [

  '/intro.jpg'

];

Gallery[1] = [

  '/clientwork/1.jpg',

  '/clientwork/2.jpg',

  '/clientwork/3.jpg',

  '/clientwork/4.jpg',

  '/clientwork/5.jpg',

  '/clientwork/6.jpg',

  '/clientwork/7.jpg',

  '/clientwork/8.jpg',

  '/clientwork/9.jpg',

  '/clientwork/10.jpg'

];

Gallery[2] = [

  '/illustrations/1.jpg',

  '/illustrations/2.jpg',

  '/illustrations/3.jpg',

  '/illustrations/4.jpg',

  '/illustrations/5.jpg',

  '/illustrations/6.jpg',

  '/illustrations/7.jpg',

  '/illustrations/8.jpg',

  '/illustrations/9.jpg',

  '/illustrations/10.jpg',
  
];

Gallery[3] = [

  '/newera/1.jpg',

  '/newera/2.jpg',

  '/newera/3.jpg',

  '/newera/4.jpg',

  '/newera/5.jpg',

  '/newera/6.jpg',
  
  '/newera/7.jpg',
  
  '/newera/8.jpg',
  
  '/newera/9.jpg',
  
  '/newera/10.jpg',

];

Gallery[4] = [

  '/products/1.jpg',

  '/products/2.jpg',

  '/products/3.jpg',

  '/products/4.jpg',

  '/products/5.jpg',
  
];

Gallery[5] = [

  '/photos/1.jpg',

  '/photos/2.jpg',

  '/photos/3.jpg',

  '/photos/4.jpg',

  '/photos/5.jpg',


];

Gallery[6] = [

  '/paintings/1.jpg',

  '/paintings/2.jpg',

  '/paintings/3.jpg',

  '/paintings/4.jpg',

  '/paintings/5.jpg',

];



// Cache Nav Swap Images

ImageCache = new Image();



ImageCache.src = 'img/bag_clientwork_gray.gif';

ImageCache.src = 'img/bag_illustrations_gray.gif';

ImageCache.src = 'img/bag_newera_gray.gif';

ImageCache.src = 'img/bag_products_gray.gif';

ImageCache.src = 'img/bag_photos_gray.gif';

ImageCache.src = 'img/bag_paintings_gray.gif';

ImageCache.src = 'img/arrow_right.png';

ImageCache.src = 'img/arrow_left.png';

ImageCache.src = 'img/arrow_end.gif';



function LoadGallery(iGallery, iCanvas)

{

  var sCanvasPath = '';

  

  sCanvasPath = 'gallery' + Gallery[iGallery][iCanvas];

  document.getElementById('canvas').innerHTML   = '<img src="' + sCanvasPath + '">'; //width="453" height="335"

  document.getElementById('GalleryShown').value = iGallery;

  document.getElementById('CanvasShown').value  = iCanvas;

  

  if (iGallery > 0) document.getElementById('nav_arrows').style.display  = 'block';

  

  document.getElementById('bag_clientwork').src    = (iGallery == 1) ? 'img/bag_clientwork_gray.gif' : 'img/bag_clientwork.gif';

  document.getElementById('bag_illustrations').src = (iGallery == 2) ? 'img/bag_illustrations_gray.gif' : 'img/bag_illustrations.gif';

  document.getElementById('bag_newera').src        = (iGallery == 3) ? 'img/bag_newera_gray.gif' : 'img/bag_newera.gif';

  document.getElementById('bag_products').src      = (iGallery == 4) ? 'img/bag_products_gray.gif' : 'img/bag_products.gif';

  document.getElementById('bag_photos').src        = (iGallery == 5) ? 'img/bag_photos_gray.gif' : 'img/bag_photos.gif';

  document.getElementById('bag_paintings').src     = (iGallery == 6) ? 'img/bag_paintings_gray.gif' : 'img/bag_paintings.gif';



  return false;

}



function NextCanvas(sDirection)

{

  var iGalleryShown  = 0;

  var iGalleryLength = 0;

  var iNewCanvas     = 0;

  

  iGalleryShown  = document.getElementById('GalleryShown').value;

  iCanvasShown   = document.getElementById('CanvasShown').value;

  iGalleryLength = Gallery[iGalleryShown].length

  

  switch (sDirection)

  {

    case 'Prev':

      iNewCanvas = parseInt(iCanvasShown) - 1;

      iNewCanvas = (iNewCanvas > 0) ? iNewCanvas : (iGalleryLength - 1);

      break;

    case 'Next':

      iNewCanvas = parseInt(iCanvasShown) + 1;

      iNewCanvas = (iNewCanvas < iGalleryLength) ? iNewCanvas : 0;

      break;

  }

  

  LoadGallery(iGalleryShown, iNewCanvas)

  

  return false;

}

