   	/***********************************************************************************************
	
	Copyright (c) 2005 - Alf Magne Kalleland post@dhtmlgoodies.com
	
	UPDATE LOG:
	
	March, 10th, 2006 : Added support for a message while large image is loading
	
	Get this and other scripts at www.dhtmlgoodies.com
	
	You can use this script freely as long as this copyright message is kept intact.
	
	***********************************************************************************************/ 
   	
	var displayWaitMessage=true;	// Display a please wait message while images are loading?
  	
   		
	var activeImage = false;
	var imageGalleryTopPos = false;
	var imageGalleryHeight = false;
	var imageGalleryObj = false;
	var maxGalleryYPos = false;
	var slideSpeed = 0;
	var imageGalleryCaptions = new Array();
		
	function gallerySlide()
	{
		if(slideSpeed!=0){
			var topPos = imageGalleryObj.offsetTop;
			topPos = topPos/1 + slideSpeed;
			if(topPos>maxGalleryYPos){
				topPos = maxGalleryYPos;
				slideSpeed = 0;
				
			}
			if(topPos<minGalleryYPos){
				topPos = minGalleryYPos;
				slideSpeed=0;
			}
			
			imageGalleryObj.style.top =topPos + 'px';
		}
		setTimeout('gallerySlide()',20);
		
	}
	
	function showImage()
	{
		if(activeImage){
			activeImage.style.filter = 'alpha(opacity=75)';	
			activeImage.style.opacity = 0.75;
		}	
		this.style.filter = 'alpha(opacity=100)';
		this.style.opacity = 1;	
		activeImage = this;	
	}
	
	function initSlideShow()
	{
		document.getElementById('arrow_top').onmousemove = startSlide;
		document.getElementById('arrow_top').onmouseout = releaseSlide;
		document.getElementById('arrow_bottom').onmousemove = startSlide;
		document.getElementById('arrow_bottom').onmouseout = releaseSlide;
		
		imageGalleryObj = document.getElementById('theImages');
		imageGallerytopPos = imageGalleryObj.offsetTop;
		imageGalleryHeight = document.getElementById('galleryContainer').offsetHeight - 80;
		maxGalleryYPos = imageGalleryObj.offsetTop; 
		minGalleryYPos = imageGalleryHeight - document.getElementById('slideEnd').offsetTop;
		var slideshowImages = imageGalleryObj.getElementsByTagName('IMG');
		for(var no=0;no<slideshowImages.length;no++){
			slideshowImages[no].onmouseover = showImage;
		}
		
		var divs = imageGalleryObj.getElementsByTagName('DIV');
		for(var no=0;no<divs.length;no++){
			if(divs[no].className=='imageCaption')imageGalleryCaptions[imageGalleryCaptions.length] = divs[no].innerHTML;
		}
		gallerySlide();
	}
		

//This code combines the window onload functions of the slideshow system and the google mapping system to allow them both to work

window.onload=function() {
initSlideShow();

}