// Set inner width and height for NS and Explorer
var iw, ih			
// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 5000;
// Duration of crossfade (seconds)
var crossFadeDuration = 3;
// Specify the image files
var Pic = new Array();
// to add more images, just continue
// the pattern, adding to the array below

Pic[0] = 'http://www.sandypointsailing.org/Photos/2008_Regatta/Image (74).jpg'
Pic[1] = 'http://www.sandypointsailing.org/Photos/2007_Regatta/Image (15).jpg'
Pic[2] = 'http://www.sandypointsailing.org/Photos/2008_Regatta/Image (23).jpg'
Pic[3] = 'http://www.sandypointsailing.org/Photos/2008_Regatta/Image (27).jpg'
Pic[4] = 'http://www.sandypointsailing.org/Photos/2007_Regatta/Image (1).jpg'
Pic[5] = 'http://www.sandypointsailing.org/Photos/2009_Regatta/Image (345).jpg'
Pic[6] = 'http://www.sandypointsailing.org/Photos/2008_Regatta/Image (188).jpg'
Pic[7] = 'http://www.sandypointsailing.org/Photos/2009_Regatta/Image (77).jpg'
Pic[8] = 'http://www.sandypointsailing.org/Photos/2009_Regatta/Image (117).jpg'
Pic[9] = 'http://www.sandypointsailing.org/Photos/2009_Regatta/Image (136).jpg'
Pic[10] = 'http://www.sandypointsailing.org/Photos/2009_Regatta/Image (136).jpg'
Pic[11] = 'http://www.sandypointsailing.org/Photos/2009_Regatta/Image (197).jpg'
Pic[12] = 'http://www.sandypointsailing.org/Photos/2009_Regatta/Image (299).jpg'
Pic[13] = 'http://www.sandypointsailing.org/Photos/2008_Regatta/Image (183).jpg'
Pic[14] = 'http://www.sandypointsailing.org/Photos/2008_Regatta/Image (95).jpg'
Pic[15] = 'http://www.sandypointsailing.org/Photos/2009_Regatta/Image (234).jpg'
Pic[16] = 'http://www.sandypointsailing.org/Photos/2009_Regatta/Image (396).jpg'
Pic[17] = 'http://www.sandypointsailing.org/Photos/2009_Regatta/Image (306).jpg'
Pic[18] = 'http://www.sandypointsailing.org/Photos/2008_Regatta/Image (217).jpg'
Pic[19] = 'http://www.sandypointsailing.org/Photos/2008_Regatta/Image (20).jpg'
Pic[20] = 'http://www.sandypointsailing.org/Photos/2009_Regatta/Image (67).jpg'
Pic[21] = 'http://www.sandypointsailing.org/Photos/2009_Regatta/Image (242).jpg'
Pic[22] = 'http://www.sandypointsailing.org/Photos/2009_Regatta/Image (267).jpg'
Pic[23] = 'http://www.sandypointsailing.org/Photos/2008_Regatta/Image (43).jpg'




function showpic(src, w, h, alt, aln, pw, ph, bw, bh) {
	if (src==null) return;
	if (window.innerWidth==null) {
		iw=document.body.clientWidth;ih=document.body.clientHeight;}
	else {iw=window.innerWidth;ih=window.innerHeight}
	if (w==null) w=iw; 				// width
	if(h==null)  h=ih;				// height
	if(alt==null) alt="Picture";		// alt text
	if(aln==null) aln="left";			// alignment
	if(pw==null) pw=100;			// percentage width
	if(ph==null) ph=100;			// percentage height
	if(bw==null) bw=24;			// border width
	if(bh==null) bh=24;			// border height
	var sw=Math.round((iw-bw-215)*pw/100);
	var sh=Math.round((ih-bh)*ph/100);
	if ((w*sh)/(h*sw)<1) sw=Math.round(w*sh/h);
	else sh=Math.round(h*sw/w);
	document.write('<img src="'+src+'" alt="'+alt+'" width="'+sw+'" height="'+sh+'" align="'+aln+'">')
	}



// do not edit anything below this line
var t;
var j = 0;
var p = Pic.length;
var preLoad = new Array();
for (i = 0; i < p; i++) {
preLoad[i] = new Image();
preLoad[i].src = Pic[i];
}
function runSlideShow() {
if (document.all) {
document.images.SlideShow.style.filter="blendTrans(duration=2)";
document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)";
document.images.SlideShow.filters.blendTrans.Apply();
}
document.images.SlideShow.src = preLoad[j].src;
if (document.all) {
document.images.SlideShow.filters.blendTrans.Play();
}
j = j + 1;
if (j > (p - 1)) j = 0;
t = setTimeout('runSlideShow()', slideShowSpeed);
}



var randomimagewidth = 255;
var randomimageheight = 191;

var preBuffer = new Array()
for (i = 0; i < p; i++){
   preBuffer[i] = new Image()
   preBuffer[i].src = Pic[i]
}
var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
document.write('<img src="'+Pic[whichImage]+'" width="'+randomimagewidth+'" height="'+randomimageheight+'">');
}



