
//Image Fading by Interlinx Group, based on a script obtained from http://www.dynamicdrive.com


var fadeImageWidth = 176;
var fadeImageHeight = 199;
var waitTime = 7000;

var IE = document.all&&navigator.userAgent.indexOf("Opera")==-1;
var NS = document.getElementById&&navigator.userAgent.indexOf("Opera")==-1;

var curOpacity = 10;
var currentFrame = "first";
var current = 0;
var next = 1;

var Images = new Array();
Images[0] = "/alaska-fishing-img/gg-fly-fishing-1.jpg";
Images[1] = "/alaska-fishing-img/gg-halibut-fishing-1.jpg";
Images[2] = "/alaska-fishing-img/gg-king-fishing-1.jpg";
Images[3] = "/alaska-fishing-img/gg-king-fishing-2.jpg";
Images[4] = "/alaska-fishing-img/gg-steelhead-fishing-7.jpg";
Images[5] = "/alaska-fishing-img/gg-saltwater-fishing-1.jpg";
Images[6] = "/alaska-fishing-img/gg-salmon-fishing-1.jpg";
Images[7] = "/alaska-fishing-img/gg-steelhead-fishing-6.jpg";
Images[8] = "/alaska-fishing-img/gg-salmon-fishing-2.jpg";


var Testim = new Array();
Testim[0] = "&#147;This is a first class operation&#133; I highly recommend it.&#148;<BR>&#150; Shel Benjamin";
Testim[1] = "&#147;&#133;the warm hospitality and atmosphere of the lodge made for an excellent time.&#148;<BR>&#150; Daren Steuart";
Testim[2] = "&#147;One of planet Earth's 10 best fishing lodges&#133;&#148;<BR>&#150; Bob Newman, &#147;The Fish Doctor,&#148; <I>Fish Belly</I>";
Testim[3] = "&#147;I do not consider myself easy to please, but I thoroughly enjoyed my stay at Boardwalk Lodge.&#148;<br>&#150; Scott Poffenberger, <i>The Angling Report</i>";
Testim[4] = "&#147;I cannot say enough about the extraordinary friendliness of the staff there&#133;&#148;<br>&#150; Robert Steele";
Testim[5] = "&#147;Large, powerful Chinook, spectacular fighting cohos, giant halibut, large lingcod and an award winning lodge&#133;&#148;<br>&#150; <i>Pacific Fisherman</i>";
Testim[6] = "&#147;The guides cater to novices as well as fanatics&#133;&#148;<br>&#150; Lori Lincoln, <i>Business Traveler</i>";
Testim[7] = "&#147;The cuisine and fishing were unmatched! Thank you for a wonderful time.  We'll be back!&#148;<br>&#150; Anne &amp; Jerry Millar";
Testim[8] = "&#147;Our week spent with you exceeded our wildest expectations and dreams&#133; Those are great memories that will last a lifetime.&#148;<br>&#150; Richard Miles";

function layerWrite(id, nestref, text)
{
	if(document.layers)
	{
		var lyr = (nestref)?eval('document.'+nestref+'.document.'+id+'.document'):document.layers[id].document
		lyr.open()
		lyr.write(text)
		lyr.close()
	}
	else if(document.all && !document.getElementById)
	{
		document.all[id].innerHTML = text;
	}
	else if(document.getElementById)
	{
		//all new standard compliant browsers (ie5+ and ns6+)
		document.getElementById(id).innerHTML = text;
	}
}

var preloadImages = new Image();
for(i=0;i<Images.length;i++)
{
	preloadImages.src = Images[i];
}

function fader()
{
	if (curOpacity<100)
	{
		curOpacity+=10;
		if (frameObj.filters)
		{
			frameObj.filters.alpha.opacity=curOpacity;
		}
		else if (frameObj.style.MozOpacity)
		{
			frameObj.style.MozOpacity=curOpacity/100;
		}
	}
	else
	{
		clearInterval(fadeout);
		nextFrame=(currentFrame=="first")? "first" : "second";
		frameObj=IE? eval("document.all."+nextFrame) : document.getElementById(nextFrame);
		frameObj.innerHTML='<img src="'+Images[next]+'">';
		next=(next<Images.length-1)? next+1 : 0;
		setTimeout("swapImages()",waitTime);
	}
}

function swapImages()
{
	if (IE || NS)
	{
		reset(currentFrame);
		var crossoverFrame = frameObj = IE? eval("document.all."+currentFrame) : document.getElementById(currentFrame);
		crossoverFrame.style.zIndex++;
		var temp='setInterval("fader()",50)';
		fadeout=eval(temp);
		currentFrame=(currentFrame=="first")? "second" : "first";
	}
	else
	{
		document.images.defaultImage.src=Images[current];
	}
	layerWrite("Testimonial","",Testim[current]);
	current=(current<Images.length-1)? current+1 : 0;
}

function reset(whichFrame)
{
	curOpacity=10;
	var crossoverFrame=IE? eval("document.all."+whichFrame) : document.getElementById(whichFrame);
	if (crossoverFrame.filters)
	{
		crossoverFrame.filters.alpha.opacity=curOpacity;
	}
	else if (crossoverFrame.style.MozOpacity)
	{
		crossoverFrame.style.MozOpacity=curOpacity/100;
	}
}

function starter()
{
	var crossoverFrame=IE? eval("document.all."+currentFrame) : document.getElementById(currentFrame);
	crossoverFrame.innerHTML='<img src="'+Images[current]+'">';
	swapImages();
}

if (IE || NS)
{
	window.onload=starter;
}
else
{
	setInterval("swapImages()",waitTime);
}

