//
// Based on image loading code from Lightbox. Original License statement:
// -----------------------------------------------------------------------------------
//
//	Lightbox v2.03.3
//	by Lokesh Dhakar - http://www.huddletogether.com
//	5/21/06
//
//	For more information on this script, visit:
//	http://huddletogether.com/projects/lightbox2/
//
//	Licensed under the Creative Commons Attribution 2.5 License - http://creativecommons.org/licenses/by/2.5/
//	
//	Credit also due to those who have helped, inspired, and made their code available to the public.
//	Including: Scott Upton(uptonic.com), Peter-Paul Koch(quirksmode.com), Thomas Fuchs(mir.aculo.us), and others.
//
//
// -----------------------------------------------------------------------------------

var galleryIdDefs = new Array('Gal0','Gal1','Gal2');
var gallery = {

  changeImage: function(imgSrc,galleryId) {

    Element.hide('galleryImage'+galleryIdDefs[galleryId]);
    Element.show('galleryLoading'+galleryIdDefs[galleryId]);
    imgPreloader = new Image();
    // once image is preloaded, resize image container
    imgPreloader.onload=function(){
      Element.setSrc('galleryImage'+galleryIdDefs[galleryId], imgSrc);

      containerHeight=Element.getHeight('galleryContainer'+galleryIdDefs[galleryId]);
      Element.setTop('galleryImage'+galleryIdDefs[galleryId], (containerHeight-imgPreloader.height)/2 );

      Element.hide('galleryLoading'+galleryIdDefs[galleryId]);
      new Effect.Appear('galleryImage'+galleryIdDefs[galleryId], { duration: 0.8, queue: 'end' });

      imgPreloader.onload=function(){};	//	clear onLoad, IE behaves irratically with animated gifs otherwise 
    }
    imgPreloader.src = imgSrc;
  }
};

var mnuOut = function(mnuItem) {
	mnuItem.childNodes[0].src = mnuItem.childNodes[0].src.replace("_1.png","_0.png");
}
var mnuOver = function(mnuItem) {
	mnuItem.childNodes[0].src = mnuItem.childNodes[0].src.replace("_0.png","_1.png");
}

