// JavaScript Document
// slideshow variables, photo loader, and functions to control Div  - put in header of html file 
// rollover images

BTNfirst = new Image();
BTNfirst.src = "http://www.gnhealth.com/pix/photoGallery/gal_first.jpg";
BTNfirstOver = new Image();
BTNfirstOver.src = "http://www.gnhealth.com/pix/photoGallery/gal_first-over.jpg";

BTNprev = new Image();
BTNprev.src = "http://www.gnhealth.com/pix/photoGallery/gal_prev.jpg";
BTNprevOver = new Image();
BTNprevOver.src = "http://www.gnhealth.com/pix/photoGallery/gal_prev-over.jpg";

BTNnext = new Image();
BTNnext.src = "http://www.gnhealth.com/pix/photoGallery/gal_next.jpg";
BTNnextOver = new Image();
BTNnextOver.src = "http://www.gnhealth.com/pix/photoGallery/gal_next-over.jpg";

BTNlast = new Image();
BTNlast.src = "http://www.gnhealth.com/pix/photoGallery/gal_last.jpg";
BTNlastOver = new Image();
BTNlastOver.src = "http://www.gnhealth.com/pix/photoGallery/gal_last-over.jpg";


BTNplay = new Image();
BTNplay.src = "http://www.gnhealth.com/pix/photoGallery/gal_play.jpg";
BTNplayOver = new Image();
BTNplayOver.src = "http://www.gnhealth.com/pix/photoGallery/gal_play-over.jpg";

BTNstop = new Image();
BTNstop.src = "http://www.gnhealth.com/pix/photoGallery/gal_stop.jpg";
BTNstopOver = new Image();
BTNstopOver.src = "http://www.gnhealth.com/pix/photoGallery/gal_stop-over.jpg";


// to run slideshow
effect = 23; // transition effect. number between 0 and 23, 23 is random effect
duration = 1.5; // transition duration. number of seconds effect lasts
display = 3.5; // seconds to display each image
oW = 550; // width of stage (first image)
oH = 550; // height of stage

// preload photos
function load_photos(folder, n) {
	// each element in the array is in sequential order starting with 0
	// image name must be photo_x.jpg - where x is a sequential number beginning with 1
	SLIDES = new Array();
	for (a=0;a<n;a++) {
		SLIDES[a] = eval('[\"http://www.gnhealth.com/pix/photoGallery/'+folder+'/photo_'+(a)+'.jpg\"]');
	}
	S = new Array();
	for(a = 0; a < SLIDES.length; a++){
		S[a] = new Image(); 
		S[a].src  = SLIDES[a][0];
	}
}