﻿var slideurl=new Array()
slideurl[0]="slideshow00.jpg"
slideurl[1]="slideshow01.jpg"
slideurl[2]="slideshow02.jpg"
slideurl[3]="slideshow03.jpg"
slideurl[4]="slideshow04.jpg"
slideurl[5]="slideshow05.jpg"
slideurl[6]="slideshow06.jpg"
slideurl[7]="slideshow07.jpg"
slideurl[8]="slideshow08.jpg"
slideurl[9]="slideshow09.jpg"
slideurl[10]="slideshow10.jpg"
slideurl[11]="slideshow11.jpg"
slideurl[12]="slideshow12.jpg"
slideurl[13]="slideshow13.jpg"
slideurl[14]="slideshow14.jpg"
slideurl[15]="slideshow15.jpg"
slideurl[16]="slideshow16.jpg"
 
var slidecomment=new Array()
slidecomment[0]="Annual Car d'Lane"
slidecomment[1]="Annual Car d'Lane"
slidecomment[2]="Annual Car d'Lane"
slidecomment[3]="Annual Car d'Lane"
slidecomment[4]="Annual Car d'Lane"
slidecomment[5]="Annual Car d'Lane"
slidecomment[6]="Ironman Triathalon"
slidecomment[7]="Ironman Triathalon"
slidecomment[8]="Ironman Triathalon"
slidecomment[9]="Ironman Triathalon"
slidecomment[10]="Ironman Triathalon"
slidecomment[11]="Ironman Triathalon"
slidecomment[12]="Lake Activities"
slidecomment[13]="Lake Activities"
slidecomment[14]="Lake Activities"
slidecomment[15]="Lake Activities"
slidecomment[16]="Lake Activities"
 
// Font
var slidefont="Arial"
 
// Font-color
var slidefontcolor="#818181"
 
// Font-size (acceptable values form 1 to 6)
var slidefontsize=2
 
// Width slideshow (pixels)
var slidewidth=146
 
// Height slideshow (pixels)
var slideheight=115
 
//Pause between each slide (seconds)
var pauseslide=5
 
// Do not edit the code below this line //
/////////////////////////////////////////
 
var textposition="right_auto"
var slidecontent
var max_space=19
var space=" "
var i_substring=0
var i_space=max_space
var all_space=" "
var content=""
var pausefade=20
var i_slide=0
var i_filter=-1
var nextorprevious=1
var transparency=0
var transparencystep=5
var isloaded=false
var started=false
var stopshow=false
 
var newpause=pauseslide
var checkpause=200
var neximage=""
var howmanycomplete=0
var preload_slides=-1
var pauseslide=pauseslide*1000
 
var browserinfos=navigator.userAgent  
var ie=document.all&&!browserinfos.match(/Opera/)?1:0 
var ns6=document.getElementById&&!document.all?1:0
var ns4=document.layers?1:0
var op=browserinfos.match(/Opera/)
 
var preloadedimages=new Array()
for (i=0;i<slideurl.length;i++){
	preloadedimages[i]=new Image()
	preloadedimages[i].src=slideurl[i]
}
 
function initslideshow4() {
	setimagetocache()
	getcontent()
	if (ie) {
		slidecontainer.innerHTML=slidecontent
		}
	if (ns6 || op) {
		transparency=100
		document.getElementById('slidecontainer').innerHTML=slidecontent
	}
	var inittimer=setTimeout("checkifcached()",100)
}
 
function setimagetocache() {
	preload_slides++
	if (preload_slides<=slideurl.length) {
		nextimage=new Image();
   		nextimage.src=slideurl[preload_slides];
		checkautocached()
	}
}
 
function checkautocached() {
	if (nextimage.complete) {
		howmanycomplete++
		setimagetocache()
	}
   	else {
   		var timer2=setTimeout("checkautocached()",checkpause);
	}
}
 
function checkifcached() {
	if (i_slide<=howmanycomplete) {
		if (ie) {
			if (textposition=="top_auto" || textposition=="bottom_auto"  || textposition=="left_auto" || textposition=="right_auto") {
				var nextimer=setTimeout("autoslide()",newpause)
			}
			if (textposition=="top_hand" || textposition=="bottom_hand" || textposition=="left_hand" || textposition=="right_hand") {
				if (started) {
					handslide()
				}
				started=true
			}
		}
		if (ns6 || op) {
			if (textposition=="top_auto" || textposition=="bottom_auto"  || textposition=="left_auto" || textposition=="right_auto") {
				unfadeslide()
			}
			if (textposition=="top_hand" || textposition=="bottom_hand" || textposition=="left_hand" || textposition=="right_hand") {
				if (started) {
					fadeslidehand()
				}
				started=true
			}
		}
   	}
   	else {
		newpause=newpause-checkpause
		if (newpause<1200) {newpause=1200}
   		var timer2=setTimeout("checkifcached()",checkpause);
	}
}
 
function getcontent() {
	if (textposition=="top_auto") {
		slidecontent="&nbsp;&nbsp;<font face='"+slidefont+"' size='"+slidefontsize+"' color='"+slidefontcolor+"'>"+slidecomment[i_slide]+"</font><br><img name='slideimage' src='"+slideurl[i_slide]+"' border=0>"
	}
	else if (textposition=="bottom_auto") {
		slidecontent="<img name='slideimage' src='"+slideurl[i_slide]+"' border=0><br>&nbsp;&nbsp;<font face='"+slidefont+"' size='"+slidefontsize+"' color='"+slidefontcolor+"'>"+slidecomment[i_slide]+"</font>"
	}
	else if (textposition=="left_auto") {
		slidecontent="&nbsp;&nbsp;<font face='"+slidefont+"' size='"+slidefontsize+"' color='"+slidefontcolor+"'>"+slidecomment[i_slide]+"</font><br><img name='slideimage' src='"+slideurl[i_slide]+"' border=0>"
	}
	else if (textposition=="right_auto") {
		slidecontent="<img name='slideimage' src='"+slideurl[i_slide]+"' border=0><br>&nbsp;&nbsp;<font face='"+slidefont+"' size='"+slidefontsize+"' color='"+slidefontcolor+"'>"+slidecomment[i_slide]+"</font>"
	}
	else if (textposition=="top_hand") {
		slidecontent="&nbsp;&nbsp;<font face='"+slidefont+"' size='"+slidefontsize+"' color='"+slidefontcolor+"'>"+slidecomment[i_slide]+"</font><br><img name='slideimage' src='"+slideurl[i_slide]+"' border=0>"
	}
	else if (textposition=="bottom_hand") {
		slidecontent="<img name='slideimage' src='"+slideurl[i_slide]+"' border=0><br>&nbsp;&nbsp;<font face='"+slidefont+"' size='"+slidefontsize+"' color='"+slidefontcolor+"'>"+slidecomment[i_slide]+"</font>"
	}
	else if (textposition=="left_hand") {
		slidecontent="&nbsp;&nbsp;<font face='"+slidefont+"' size='"+slidefontsize+"' color='"+slidefontcolor+"'>"+slidecomment[i_slide]+"</font><br><img name='slideimage' src='"+slideurl[i_slide]+"' border=0>"
	}
	else if (textposition=="right_hand") {
		slidecontent="<img name='slideimage' src='"+slideurl[i_slide]+"' border=0><br>&nbsp;&nbsp;<font face='"+slidefont+"' size='"+slidefontsize+"' color='"+slidefontcolor+"'>"+slidecomment[i_slide]+"</font>"
	}
}
 
function unfadeslide() {
	if (transparency<100){
		transparency+=transparencystep
		if (ns6) {
			document.getElementById('slidecontainer').style.MozOpacity=transparency/100
		}
		var fadetimer=setTimeout("unfadeslide()",pausefade)
	}
	else {
		clearTimeout(fadetimer)
		var fadetimer=setTimeout("fadeslide()",newpause)
	}
}
 
function unfadeslidehand() {
	if (transparency<100){
		transparency+=transparencystep
		if (ns6) {
			document.getElementById('slidecontainer').style.MozOpacity=transparency/100
		}
		var fadetimer=setTimeout("unfadeslidehand()",pausefade)
	}
	else {
		clearTimeout(fadetimer)
	}
}
 
function fadeslide() {
	if (!stopshow) {
		if (transparency>0){
			transparency-=transparencystep
			if (ns6) {
				document.getElementById('slidecontainer').style.MozOpacity=transparency/100
			}
			var fadetimer=setTimeout("fadeslide()",pausefade)
		}
		else {
			var autotimer=setTimeout("autoslide()",200)
		}
	}
	else {
		var stoptimer=setTimeout("fadeslide()",500)
	}
}
 
function fadeslidehand() {
	if (transparency>0){
		transparency-=transparencystep
		if (ns6) {
			document.getElementById('slidecontainer').style.MozOpacity=transparency/100
		}
		var fadetimer=setTimeout("fadeslidehand()",pausefade)
	}
	else {
		i_slide++
		if (i_slide>=slideurl.length) {i_slide=0}
		getcontent()
		document.getElementById('slidecontainer').innerHTML=slidecontent
		transparency=0
		var fadetimer=setTimeout("unfadeslidehand()",500)
	}
}
 
function autoslide(){
	if (ie) {
		if (!stopshow) {
			newpause=pauseslide
			i_slide++
			if (i_slide>=slideurl.length) {i_slide=0}
			getcontent()
			i_filter++
			if (i_filter>slidecontainer.filters.length-1) {i_filter=0}	
			slidecontainer.filters[i_filter].apply()
			slidecontainer.innerHTML=slidecontent
			slidecontainer.filters[i_filter].play()
			checkifcached()
		}
		else {
			var stoptimer=setTimeout("autoslide()",500)
		}
	}
	if (ns6 || op) {
		newpause=pauseslide
		i_slide++
		if (i_slide>=slideurl.length) {i_slide=0}
		getcontent()
		document.getElementById('slidecontainer').innerHTML=slidecontent
		transparency=0
		i_space=max_space
		checkifcached()
	}
}
 
function handslide(){
	i_slide++
	if (i_slide>=slideurl.length) {i_slide=0}
	getcontent()
	if (ie) {
		i_filter++
		if (i_filter>slidecontainer.filters.length-1) {i_filter=0}	
		slidecontainer.filters[i_filter].apply()
		slidecontainer.innerHTML=slidecontent
		slidecontainer.filters[i_filter].play()
	}
	if (ns6 || op) {
		document.getElementById('slidecontainer').innerHTML=slidecontent
		transparency=100
	}
}
 
function simpleslideshow() {
	i_slide++
	if (i_slide>=slideurl.length) {i_slide=0}
	document.slideimage.src=preloadedimages[i_slide].src
	simpleslideshowcomment()
	var fadetimer=setTimeout("simpleslideshow()",pauseslide)
}
 
function simpleslideshowcomment() {
	if (i_space>=0){
		all_space=""
		content=""
		for (i=0;i<i_space;i++) {
			all_space+=" "
		}
		for (i=0;i<slidecomment[i_slide].length;i++) {
			var thisletter=slidecomment[i_slide].substring(i,i+1)
			thisletter=thisletter+all_space
			content+=thisletter
		}
		window.status=content
		i_space--
		var fadetimer=setTimeout("simpleslideshowcomment()",pausefade)
	}
	else {
		clearTimeout(fadetimer)
		i_space=max_space
	}
}
 
if (ie) {
	document.write('<div style="position:relative;width:'+slidewidth+'px;height:'+slideheight+'px;overflow:hidden">')
	document.write('<div id="slidecontainer" style="position:absolute;width:'+slidewidth+'px;height:'+slideheight+'px;top:0px;left:0px;filter:progid:DXImageTransform.Microsoft.GradientWipe(duration=1.2,wipeStyle=1)"></div>')
	document.write('</div>')
	window.onload=initslideshow4
}
else if (ns6||op) {
	document.write('<div style="position:relative;width:'+slidewidth+'px;height:'+slideheight+'px;overflow:hidden">')
	document.write('<div id="slidecontainer" style="position:absolute;width:'+slidewidth+'px;height:'+slideheight+'px;top:0px;left:0px;-moz-opacity:100"></div>')
	document.write('</div>')
	window.onload=initslideshow4
}
else if (ns4) {
	document.write('<a href="javascript:simpleslideshowjump()"><img name="slideimage" src="'+slideurl[0]+'" border=0></a>')
	i_slide=-1
	window.onload=simpleslideshow
}

