//Each time page is displayed, show starts on a different slide
//
var slidemax = 48						//maximum slide number
var showsize = 8						//num of slides to show
var initialslide = Math.round(Math.random()*slidemax)		//first slide index

var initialinterval = 0	//time for first slide
var displayinterval = 5000	//time between slides in ms
var switchinterval = 3			//switch time in s
var slidenum = 1;	

//Load slide images
var slideimgs = new Array()
slide = initialslide
for (s = 0; s < showsize; s++){
   slideimgs[s] = new Image()
	 if( slide > slidemax )
	 		slide = 0
   slideimgs[s].src = "Images/slideshow/show"+slide+".jpg"
	 slide++
}

function InitSlideShow()
{
	 //document.images.sshow.src = slideimgs[0].src
	 setTimeout('SlideShow()', initialinterval)
	 document.images.sshow.alt="Cozumel slideshow images (C) Steve Lantz, Brian Lasenby & David Cohn\nSpecial thanks for the use of their photos!" 
}

function SlideShow()
{
   if (document.all)
	 {
      document.images.sshow.style.filter="blendTrans(duration=switchinterval)"
      document.images.sshow.filters.blendTrans.Apply()      
   }
   document.images.sshow.src = slideimgs[slidenum].src
   if (document.all)
	 {
      document.images.sshow.filters.blendTrans.Play()
   }
	 
	 if( ++slidenum == showsize )
	 	slidenum = 0
   setTimeout('SlideShow()', displayinterval)
}

/*Disable right mouse context menu */
var message="This function has been disabled!";

function clickIE() {if (document.all) {alert(message);return false;}}
function clickNS(e) {if 
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {alert(message);return false;}}}
if (document.layers) 
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}

document.oncontextmenu=new Function("return false")
