﻿var opacitySpeed = 2; // Speed of opacity - switching between large images - Lower = faster
var opacitySteps = 10; 	// Also speed of opacity - Higher = faster
var slideSpeed = 5; // Speed of thumbnail slide - Lower = faster
var slideSteps = 8; // Also speed of thumbnail slide - Higher = faster
var columnsOfThumbnails = 4; // Hardcoded number of thumbnail columns, use false if you want the script to figure it out dynamically.

var slideshow = null;
var DHTMLgoodies_largeImage = false;
var DHTMLgoodies_imageToShow = false;
var DHTMLgoodies_currentOpacity = 100;
var DHTMLgoodies_slideWidth = false;
var DHTMLgoodies_thumbTotalWidth = false;
var DHTMLgoodies_viewableWidth = false;

var currentUnqiueOpacityId = false;
//var DHTMLgoodies_firstActiveImage = false;
var DHTMLgoodies_currentActiveImage = false;
var DHTMLgoodies_thumbDiv = false;
var DHTMLgoodies_thumbSlideInProgress = false;
var imageTitle = null;
var stretchTitle = null;

var browserIsOpera = navigator.userAgent.indexOf('Opera') >= 0 ? true : false;
var leftArrowObj;
var rightArrowObj;
var thumbsColIndex = 1;
var thumbsLeftPos = false;
var imageOrientation = null;
var sClass = null;

var image1_1 = null;
var image1_2 = null;
var image1_3 = null;
var image1_4 = null;
var image2_1 = null;
var image2_2 = null;
var image2_3 = null;
var image2_4 = null;
var image3_1 = null;
var image3_2 = null;
var image3_3 = null;
var image3_4 = null;

var image_big_src = new Array();
var image_big_class = new Array();

function initGalleryScript() {
    var sClass = null;
    slideshow = document.getElementById('slideshow');
    image1_1 = document.getElementById('image1_1');
    image1_2 = document.getElementById('image1_2');
    image1_3 = document.getElementById('image1_3');
    image1_4 = document.getElementById('image1_4');
    image2_1 = document.getElementById('image2_1');
    image2_2 = document.getElementById('image2_2');
    image2_3 = document.getElementById('image2_3');
    image2_4 = document.getElementById('image2_4');
    image3_1 = document.getElementById('image3_1');
    image3_2 = document.getElementById('image3_2');
    image3_3 = document.getElementById('image3_3');
    image3_4 = document.getElementById('image3_4');
    
	leftArrowObj = document.getElementById('DHTMLgoodies_leftArrow');
	rightArrowObj = document.getElementById('DHTMLgoodies_rightArrow');
	DHTMLgoodies_largeImage = document.getElementById('DHTMLgoodies_largeImage').getElementsByTagName('IMG')[0];

	leftArrowObj.style.cursor = 'pointer';
	rightArrowObj.style.cursor = 'pointer';
	leftArrowObj.onclick = moveThumbnails;
	rightArrowObj.onclick = moveThumbnails;
	var innerDiv = document.getElementById('DHTMLgoodies_thumbs_inner');
	DHTMLgoodies_slideWidth = innerDiv.getElementsByTagName('DIV')[0].offsetWidth;
	DHTMLgoodies_thumbDiv = document.getElementById('DHTMLgoodies_thumbs_inner');

	imageTitle = document.getElementById('imageTitle');
	stretchTitle = document.getElementById('stretchTitle');

	//loadStretch('Init');
}

function resetSlideShow() {
    if (DHTMLgoodies_currentActiveImage) {
        resetActiveImage()
    }
//    DHTMLgoodies_currentActiveImage = DHTMLgoodies_firstActiveImage;
    var sClass = image1_1.className;
    if (sClass == 'htbimg') {
        image1_1.className = 'ahtbimg';
        DHTMLgoodies_currentActiveImage.className = 'ahtbimg';
        stretchTitle.className = 'horizontalStretchTitle';
        imageTitle.className = 'horizontalImageTitle';
    }
    else {
        image1_1.className = 'avtbimg';
        DHTMLgoodies_currentActiveImage.className = 'avtbimg';
        stretchTitle.className = 'verticalStretchTitle';
        imageTitle.className = 'verticalImageTitle';
    }
    leftArrowObj.style.visibility = 'hidden';
    rightArrowObj.style.visibility = 'visible';
    var subDivs = DHTMLgoodies_thumbDiv.getElementsByTagName('DIV');
    DHTMLgoodies_thumbTotalWidth = 0;
    DHTMLgoodies_thumbDiv.style.left = '0px';
    thumbsColIndex = 1;
    var tmpLeft = 0;
    thumbsLeftPos = false;
    for (var no = 0; no < subDivs.length; no++) {
        if (subDivs[no].className == 'strip_of_thumbnails') {
            DHTMLgoodies_thumbTotalWidth = DHTMLgoodies_thumbTotalWidth + DHTMLgoodies_slideWidth;
            subDivs[no].style.left = tmpLeft + 'px';
            subDivs[no].style.top = '0px';
            tmpLeft = tmpLeft + subDivs[no].offsetWidth;
        }
    }

    DHTMLgoodies_viewableWidth = document.getElementById('DHTMLgoodies_thumbs').offsetWidth;
}

function resetActiveImage() {
    var sClass = DHTMLgoodies_currentActiveImage.className;
    if (sClass == 'ahtbimg') {
        DHTMLgoodies_currentActiveImage.className = 'htbimg';
    }
    else {
        DHTMLgoodies_currentActiveImage.className = 'vtbimg';
    }
}

function moveThumbnails() {
	if (DHTMLgoodies_thumbSlideInProgress) return;
	DHTMLgoodies_thumbSlideInProgress = true;
	if (this.id == 'DHTMLgoodies_leftArrow') {
		thumbsColIndex--;
		rightArrowObj.style.visibility = 'visible';
		if (DHTMLgoodies_thumbDiv.style.left.replace('px', '') / 1 >= 0) {
			leftArrowObj.style.visibility = 'hidden';
			DHTMLgoodies_thumbSlideInProgress = false;
			return;
		}

		slideThumbs(slideSteps, 0);

	} else {
		thumbsColIndex++;
		leftArrowObj.style.visibility = 'visible';
		var left = DHTMLgoodies_thumbDiv.style.left.replace('px', '') / 1;
		var showArrow = true;
		if (DHTMLgoodies_thumbTotalWidth + left - DHTMLgoodies_slideWidth <= DHTMLgoodies_viewableWidth) showArrow = false;
		if (columnsOfThumbnails) showArrow = true;

		if (!showArrow) {
			rightArrowObj.style.visibility = 'hidden';
			DHTMLgoodies_thumbSlideInProgress = false;
			return;
		}

		slideThumbs((slideSteps * -1), 0);
	}

}

function slideThumbs(speed, currentPos) {
	var leftPos;
	if (thumbsLeftPos) {
		leftPos = thumbsLeftPos;
	} else {
		leftPos = DHTMLgoodies_thumbDiv.style.left.replace('px', '') / 1;
		thumbsLeftPos = leftPos;
	}
	currentPos = currentPos + Math.abs(speed);
	var tmpLeftPos = leftPos;
	leftPos = leftPos + speed;
	thumbsLeftPos = leftPos;
	DHTMLgoodies_thumbDiv.style.left = leftPos + 'px';
	if (currentPos < DHTMLgoodies_slideWidth) setTimeout('slideThumbs(' + speed + ',' + currentPos + ')', slideSpeed); else {
		if (tmpLeftPos >= 0 || (columnsOfThumbnails && thumbsColIndex == 1)) {
			document.getElementById('DHTMLgoodies_leftArrow').style.visibility = 'hidden';
		}
		var left = tmpLeftPos;
		var showArrow = true;
		if (DHTMLgoodies_thumbTotalWidth + left - DHTMLgoodies_slideWidth <= DHTMLgoodies_viewableWidth) showArrow = false;
		if (columnsOfThumbnails) {
			if ((thumbsColIndex + 1) < columnsOfThumbnails) showArrow = true; else showArrow = false;
		}
		if (!showArrow) {
			document.getElementById('DHTMLgoodies_rightArrow').style.visibility = 'hidden';
		}
		DHTMLgoodies_thumbSlideInProgress = false;
	}

}

function showPreview(imageNumber, inputObj) {
    var sClass = null;
	if (DHTMLgoodies_currentActiveImage) {
	    if (DHTMLgoodies_currentActiveImage == inputObj.getElementsByTagName('IMG')[0]) return;
	    resetActiveImage();
	}
	DHTMLgoodies_currentActiveImage = inputObj.getElementsByTagName('IMG')[0];
	sClass = DHTMLgoodies_currentActiveImage.className;
	if (sClass == 'htbimg') {
	    DHTMLgoodies_currentActiveImage.className = 'ahtbimg';
	    imageOrientation = 'H';
	    stretchTitle.className = 'horizontalStretchTitle';
	    imageTitle.className = 'horizontalImageTitle';
	}
	else {
	    DHTMLgoodies_currentActiveImage.className = 'avtbimg';
	    imageOrientation = 'V';
	    stretchTitle.className = 'verticalStretchTitle';
	    imageTitle.className = 'verticalImageTitle';
	}

	DHTMLgoodies_imageToShow = image_big_src[imageNumber];
	var tmpImage = new Image();
	tmpImage.src = image_big_src[imageNumber];
	imageTitle.innerText = DHTMLgoodies_currentActiveImage.title;
	
	currentUnqiueOpacityId = Math.random();
	moveOpacity(opacitySteps * -1, currentUnqiueOpacityId);
}

function setOpacity() {
	if (document.all) {
		DHTMLgoodies_largeImage.style.filter = 'alpha(opacity=' + DHTMLgoodies_currentOpacity + ')';
	} else {
		DHTMLgoodies_largeImage.style.opacity = DHTMLgoodies_currentOpacity / 100;
	}
}
function moveOpacity(speed, uniqueId) {

	if (browserIsOpera) {
		DHTMLgoodies_largeImage.src = DHTMLgoodies_imageToShow;
		if (imageOrientation == 'H') {
		    DHTMLgoodies_largeImage.className = 'himage';
		}
		else {
		    DHTMLgoodies_largeImage.className = 'vimage';
		}
		return;
	}

	DHTMLgoodies_currentOpacity = DHTMLgoodies_currentOpacity + speed;
	if (DHTMLgoodies_currentOpacity <= 5 && speed < 0) {

		var tmpParent = DHTMLgoodies_largeImage.parentNode;
		DHTMLgoodies_largeImage.parentNode.removeChild(DHTMLgoodies_largeImage);
		DHTMLgoodies_largeImage = document.createElement('IMG');
		if (imageOrientation == 'H') {
		    DHTMLgoodies_largeImage.className = 'himage';
		}
		else {
		    DHTMLgoodies_largeImage.className = 'vimage';
		}
		tmpParent.appendChild(DHTMLgoodies_largeImage);
		setOpacity();
		DHTMLgoodies_largeImage.src = DHTMLgoodies_imageToShow;

		speed = opacitySteps;
        }

	if (DHTMLgoodies_currentOpacity >= 99 && speed > 0) DHTMLgoodies_currentOpacity = 99;
	setOpacity();
	if (DHTMLgoodies_currentOpacity >= 99 && speed > 0) return;
	if (uniqueId == currentUnqiueOpacityId) setTimeout('moveOpacity(' + speed + ',' + uniqueId + ')', opacitySpeed);
}

function loadStretch(xStretchIdx) {
    slideshow.style.visibility = 'visible';
    switch (xStretchIdx) {

        case "Init":
            stretchTitle.innerText = "Click a stretch of river";

            image_big_src[1] = "../images/flag_big.jpg";
            image_big_src[2] = "../images/flag_big.jpg";
            image_big_src[3] = "../images/flag_big.jpg";
            image_big_src[4] = "../images/flag_big.jpg";
            image_big_src[5] = "../images/flag_big.jpg";
            image_big_src[6] = "../images/flag_big.jpg";
            image_big_src[7] = "../images/flag_big.jpg";
            image_big_src[8] = "../images/flag_big.jpg";
            image_big_src[9] = "../images/flag_big.jpg";
            image_big_src[10] = "../images/flag_big.jpg";
            image_big_src[11] = "../images/flag_big.jpg";
            image_big_src[12] = "../images/flag_big.jpg";
            break;

            
        case "BarToTongue":
            stretchTitle.innerText = "Bar to Tongue Point";

            image_big_src[1] = "../images/rivertour/BarTotongue/crp_001_big.jpg";
            image1_1.src = "../images/rivertour/BarTotongue/crp_001_small.jpg";
            image1_1.className = "htbimg";
            image1_1.title = "Inbound at Astoria";

            image_big_src[2] = "../images/rivertour/BarTotongue/crp_007_big.jpg";
            image1_2.src = "../images/rivertour/BarTotongue/crp_007_small.jpg";
            image1_2.className = "htbimg";
            image1_2.title = "Car ship heads up river";

            image_big_src[3] = "../images/rivertour/BarTotongue/crp_012_big.jpg";
            image1_3.src = "../images/rivertour/BarTotongue/crp_012_small.jpg";
            image1_3.className = "htbimg";
            image1_3.title = "Astoria anchor";

            image_big_src[4] = "../images/rivertour/BarTotongue/crp_080_big.jpg";
            image1_4.src = "../images/rivertour/BarTotongue/crp_080_small.jpg";
            image1_4.className = "htbimg";
            image1_4.title = "Pilot change in Astoria";

            image_big_src[5] = "../images/rivertour/BarTotongue/crp_081_big.jpg";
            image2_1.src = "../images/rivertour/BarTotongue/crp_081_small.jpg";
            image2_1.className = "htbimg";
            image2_1.title = "Heading out to anchor";

            image_big_src[6] = "../images/rivertour/BarTotongue/crp_105_big.jpg";
            image2_2.src = "../images/rivertour/BarTotongue/crp_105_small.jpg";
            image2_2.className = "htbimg";
            image2_2.title = "Inbound dead ship tow";

            image_big_src[7] = "../images/rivertour/BarTotongue/crp_258_big.jpg";
            image2_3.src = "../images/rivertour/BarTotongue/crp_258_small.jpg";
            image2_3.className = "htbimg";
            image2_3.title = "Outbound at Astoria";

            image_big_src[8] = "../images/rivertour/BarTotongue/crp_265_big.jpg";
            image2_4.src = "../images/rivertour/BarTotongue/crp_265_small.jpg";
            image2_4.className = "htbimg";
            image2_4.title = "Pilot launch underway";

            image_big_src[9] = "../images/flag_big.jpg";
            image3_1.src = "../images/flag_small.jpg";
            image3_1.className = "htbimg";
            image3_1.title = "";

            image_big_src[10] = "../images/flag_big.jpg";
            image3_2.src = "../images/flag_small.jpg";
            image3_2.className = "htbimg";
            image3_2.title = "";

            image_big_src[11] = "../images/flag_big.jpg";
            image3_3.src = "../images/flag_small.jpg";
            image3_3.className = "htbimg";
            image3_3.title = "";

            image_big_src[12] = "../images/flag_big.jpg";
            image3_4.src = "../images/flag_small.jpg";
            image3_4.className = "htbimg";
            image3_4.title = "";
            break;

        case "TongueToWauna":
            stretchTitle.innerText = "Tongue Point to Wauna";

            image_big_src[1] = "../images/rivertour/TongueToWauna/crp_003_big.jpg";
            image1_1.src = "../images/rivertour/TongueToWauna/crp_003_small.jpg";
            image1_1.className = "htbimg";
            image1_1.title = "Inbound at Bugby Hole";

            image_big_src[2] = "../images/rivertour/TongueToWauna/crp_005_big.jpg";
            image1_2.src = "../images/rivertour/TongueToWauna/crp_005_small.jpg";
            image1_2.className = "htbimg";
            image1_2.title = "Battleship outbound at Puget Is";

            image_big_src[3] = "../images/rivertour/TongueToWauna/crp_021_big.jpg";
            image1_3.src = "../images/rivertour/TongueToWauna/crp_021_small.jpg";
            image1_3.className = "htbimg";
            image1_3.title = "Outbound at Three Tree";

            image_big_src[4] = "../images/rivertour/TongueToWauna/crp_133_big.jpg";
            image1_4.src = "../images/rivertour/TongueToWauna/crp_133_small.jpg";
            image1_4.className = "htbimg";
            image1_4.title = "Meet at Hunt's Mill Pt.";

            image_big_src[4] = "../images/rivertour/TongueToWauna/crp_496_big.jpg";
            image1_4.src = "../images/rivertour/TongueToWauna/crp_496_small.jpg";
            image1_4.className = "htbimg";
            image1_4.title = "Inbound at Jim Crow";

            image_big_src[5] = "../images/rivertour/TongueToWauna/crp_179_big.jpg";
            image2_1.src = "../images/rivertour/TongueToWauna/crp_179_small.jpg";
            image2_1.className = "htbimg";
            image2_1.title = "Outbound meet at Tongue Pt.";

            image_big_src[6] = "../images/rivertour/TongueToWauna/crp_256_big.jpg";
            image2_2.src = "../images/rivertour/TongueToWauna/crp_256_small.jpg";
            image2_2.className = "htbimg";
            image2_2.title = "Into the setting sun";

            image_big_src[7] = "../images/rivertour/TongueToWauna/crp_305_big.jpg";
            image2_3.src = "../images/rivertour/TongueToWauna/crp_305_small.jpg";
            image2_3.className = "htbimg";
            image2_3.title = "Inbound meet at Bugbee ";

            image_big_src[8] = "../images/flag_big.jpg";
            image2_4.src = "../images/flag_small.jpg";
            image2_4.className = "htbimg";
            image2_4.title = "Inbound at Jim Crow";

            image_big_src[9] = "../images/flag_big.jpg";
            image3_1.src = "../images/flag_small.jpg";
            image3_1.className = "htbimg";
            image3_1.title = "Inbound at Jim Crow";

            image_big_src[10] = "../images/flag_big.jpg";
            image3_2.src = "../images/flag_small.jpg";
            image3_2.className = "htbimg";
            image3_2.title = "";

            image_big_src[11] = "../images/flag_big.jpg";
            image3_3.src = "../images/flag_small.jpg";
            image3_3.className = "htbimg";
            image3_3.title = "";

            image_big_src[12] = "../images/flag_big.jpg";
            image3_4.src = "../images/flag_small.jpg";
            image3_4.className = "htbimg";
            image3_4.title = "";
            break;

        case "WaunaToLongview":
            stretchTitle.innerText = "Wauna to Longview";

            image_big_src[1] = "../images/rivertour/WaunaToLongview/crp_004_big.jpg";
            image1_1.src = "../images/rivertour/WaunaToLongview/crp_004_small.jpg";
            image1_1.className = "htbimg";
            image1_1.title = "Indian Face at Bunker Hill";

            image_big_src[2] = "../images/rivertour/WaunaToLongview/crp_020_big.jpg";
            image1_2.src = "../images/rivertour/WaunaToLongview/crp_020_small.jpg";
            image1_2.className = "htbimg";
            image1_2.title = "Meeting an outbound at Westport";

            image_big_src[3] = "../images/rivertour/WaunaToLongview/crp_060_big.jpg";
            image1_3.src = "../images/rivertour/WaunaToLongview/crp_060_small.jpg";
            image1_3.className = "htbimg";
            image1_3.title = "Inbound at Abernathy";

            image_big_src[4] = "../images/rivertour/WaunaToLongview/crp_072_big.jpg";
            image1_4.src = "../images/rivertour/WaunaToLongview/crp_072_small.jpg";
            image1_4.className = "htbimg";
            image1_4.title = "Outbound along Puget Island";

            image_big_src[5] = "../images/rivertour/WaunaToLongview/crp_120_big.jpg";
            image2_1.src = "../images/rivertour/WaunaToLongview/crp_120_small.jpg";
            image2_1.className = "htbimg";
            image2_1.title = "Outbound at Abernathy";

            image_big_src[6] = "../images/rivertour/WaunaToLongview/crp_176_big.jpg";
            image2_2.src = "../images/rivertour/WaunaToLongview/crp_176_small.jpg";
            image2_2.className = "htbimg";
            image2_2.title = "Outbound at Stella";

            image_big_src[7] = "../images/rivertour/WaunaToLongview/crp_228_big.jpg";
            image2_3.src = "../images/rivertour/WaunaToLongview/crp_228_small.jpg";
            image2_3.className = "htbimg";
            image2_3.title = "Outbound at Bunker Hill";

            image_big_src[8] = "../images/rivertour/WaunaToLongview/crp_277_big.jpg";
            image2_4.src = "../images/rivertour/WaunaToLongview/crp_277_small.jpg";
            image2_4.className = "htbimg";
            image2_4.title = "Inbound at Longview";

            image_big_src[9] = "../images/rivertour/WaunaToLongview/crp_399_big.jpg";
            image3_1.src = "../images/rivertour/WaunaToLongview/crp_399_small.jpg";
            image3_1.className = "htbimg";
            image3_1.title = "Inbound at Bunker Hill";

            image_big_src[10] = "../images/rivertour/WaunaToLongview/crp_504_big.jpg";
            image3_2.src = "../images/rivertour/WaunaToLongview/crp_504_small.jpg";
            image3_2.className = "htbimg";
            image3_2.title = "Dead ship tow outbound at Rainier";

            image_big_src[11] = "../images/rivertour/WaunaToLongview/crp_631_big.jpg";
            image3_3.src = "../images/rivertour/WaunaToLongview/crp_631_small.jpg";
            image3_3.className = "htbimg";
            image3_3.title = "Inbound at Eagle Cliff";

            image_big_src[12] = "../images/flag_big.jpg";
            image3_4.src = "../images/flag_small.jpg";
            image3_4.className = "htbimg";
            image3_4.title = "";
            break;


            
        case "LongviewToStHelens":
            stretchTitle.innerText = "Longview to St. Helens";

            image_big_src[1] = "../images/rivertour/LongviewToStHelens/crp_022_big.jpg";
            image1_1.src = "../images/rivertour/LongviewToStHelens/crp_022_small.jpg";
            image1_1.className = "htbimg";
            image1_1.title = "Port of Longview";

            image_big_src[2] = "../images/rivertour/LongviewToStHelens/crp_029_big.jpg";
            image1_2.src = "../images/rivertour/LongviewToStHelens/crp_029_small.jpg";
            image1_2.className = "htbimg";
            image1_2.title = "Meeting at Kalama";

            image_big_src[3] = "../images/rivertour/LongviewToStHelens/crp_096_big.jpg";
            image1_3.src = "../images/rivertour/LongviewToStHelens/crp_096_small.jpg";
            image1_3.className = "htbimg";
            image1_3.title = "Anchored at Prescott";

            image_big_src[4] = "../images/rivertour/LongviewToStHelens/crp_243_big.jpg";
            image1_4.src = "../images/rivertour/LongviewToStHelens/crp_243_small.jpg";
            image1_4.className = "htbimg";
            image1_4.title = "Sunset at Longview";

            image_big_src[5] = "../images/rivertour/LongviewToStHelens/crp_301_big.jpg";
            image2_1.src = "../images/rivertour/LongviewToStHelens/crp_301_small.jpg";
            image2_1.className = "htbimg";
            image2_1.title = "Meeting at Trojan";

            image_big_src[6] = "../images/rivertour/LongviewToStHelens/crp_495_big.jpg";
            image2_2.src = "../images/rivertour/LongviewToStHelens/crp_495_small.jpg";
            image2_2.className = "htbimg";
            image2_2.title = "USN inbound at Duck Club (495 is missing)";

            image_big_src[7] = "../images/rivertour/LongviewToStHelens/crp_499_big.jpg";
            image2_3.src = "../images/rivertour/LongviewToStHelens/crp_499_small.jpg";
            image2_3.className = "htbimg";
            image2_3.title = "USN inbound at Columbia City";

            image_big_src[8] = "../images/flag_big.jpg";
            image2_4.src = "../images/flag_small.jpg";
            image2_4.className = "htbimg";
            image2_4.title = "";

            image_big_src[9] = "../images/flag_big.jpg";
            image3_1.src = "../images/flag_small.jpg";
            image3_1.className = "htbimg";
            image3_1.title = "";

            image_big_src[10] = "../images/flag_big.jpg";
            image3_2.src = "../images/flag_small.jpg";
            image3_2.className = "htbimg";
            image3_2.title = "";

            image_big_src[11] = "../images/flag_big.jpg";
            image3_3.src = "../images/flag_small.jpg";
            image3_3.className = "htbimg";
            image3_3.title = "";

            image_big_src[12] = "../images/flag_big.jpg";
            image3_4.src = "../images/flag_small.jpg";
            image3_4.className = "htbimg";
            image3_4.title = "";
            break;


        case "StHelensToVancouver":
            stretchTitle.innerText = "St. Helens to Vancouver";

            image_big_src[1] = "../images/rivertour/StHelensToVancouver/crp_002_big.jpg";
            image1_1.src = "../images/rivertour/StHelensToVancouver/crp_002_small.jpg";
            image1_1.className = "htbimg";
            image1_1.title = "Car carrier departs berth 607";

            image_big_src[2] = "../images/rivertour/StHelensToVancouver/crp_017_big.jpg";
            image1_2.src = "../images/rivertour/StHelensToVancouver/crp_017_small.jpg";
            image1_2.className = "htbimg";
            image1_2.title = "Outbound VLCC at Kelley Point";

            image_big_src[3] = "../images/rivertour/StHelensToVancouver/crp_122_big.jpg";
            image1_3.src = "../images/rivertour/StHelensToVancouver/crp_122_small.jpg";
            image1_3.className = "htbimg";
            image1_3.title = "Vancouver Anchor at sunrise";

            image_big_src[4] = "../images/rivertour/StHelensToVancouver/crp_171_big.jpg";
            image1_4.src = "../images/rivertour/StHelensToVancouver/crp_171_small.jpg";
            image1_4.className = "htbimg";
            image1_4.title = "Turning out of Terminal 6";

            image_big_src[5] = "../images/rivertour/StHelensToVancouver/crp_175_big.jpg";
            image2_1.src = "../images/rivertour/StHelensToVancouver/crp_175_small.jpg";
            image2_1.className = "htbimg";
            image2_1.title = "Outbound at Vancouver lower anchorage";

            image_big_src[6] = "../images/rivertour/StHelensToVancouver/crp_234_big.jpg";
            image2_2.src = "../images/rivertour/StHelensToVancouver/crp_234_small.jpg";
            image2_2.className = "htbimg";
            image2_2.title = "Passing at Columbia City";

            image_big_src[7] = "../images/rivertour/StHelensToVancouver/crp_315_big.jpg";
            image2_3.src = "../images/rivertour/StHelensToVancouver/crp_315_small.jpg";
            image2_3.className = "htbimg";
            image2_3.title = "Vancouver lower anchorage";

            image_big_src[8] = "../images/rivertour/StHelensToVancouver/crp_364_big.jpg";
            image2_4.src = "../images/rivertour/StHelensToVancouver/crp_364_small.jpg";
            image2_4.className = "htbimg";
            image2_4.title = "Inbound for berth 605";

            image_big_src[9] = "../images/rivertour/StHelensToVancouver/crp_383_big.jpg";
            image3_1.src = "../images/rivertour/StHelensToVancouver/crp_383_small.jpg";
            image3_1.className = "htbimg";
            image3_1.title = "Heading for Terminal 6";

            image_big_src[10] = "../images/flag_big.jpg";
            image3_2.src = "../images/flag_small.jpg";
            image3_2.className = "htbimg";
            image3_2.title = "";

            image_big_src[11] = "../images/flag_big.jpg";
            image3_3.src = "../images/flag_small.jpg";
            image3_3.className = "htbimg";
            image3_3.title = "";

            image_big_src[12] = "../images/flag_big.jpg";
            image3_4.src = "../images/flag_small.jpg";
            image3_4.className = "htbimg";
            image3_4.title = "";
            break;


        case "KelleyPointToSeawall":
            stretchTitle.innerText = "Kelley Point to Seawall";

            image_big_src[1] = "../images/rivertour/KelleyPointToSeawall/crp_006_big.jpg";
            image1_1.src = "../images/rivertour/KelleyPointToSeawall/crp_006_small.jpg";
            image1_1.className = "htbimg";
            image1_1.title = "Passing off of Terminal 5";

            image_big_src[2] = "../images/rivertour/KelleyPointToSeawall/crp_011_big.jpg";
            image1_2.src = "../images/rivertour/KelleyPointToSeawall/crp_011_small.jpg";
            image1_2.className = "htbimg";
            image1_2.title = "Outbound below Swan Island";

            image_big_src[3] = "../images/rivertour/KelleyPointToSeawall/crp_013_big.jpg";
            image1_3.src = "../images/rivertour/KelleyPointToSeawall/crp_013_small.jpg";
            image1_3.className = "htbimg";
            image1_3.title = "Outbound at St. Johns";

            image_big_src[4] = "../images/rivertour/KelleyPointToSeawall/crp_019_big.jpg";
            image1_4.src = "../images/rivertour/KelleyPointToSeawall/crp_019_small.jpg";
            image1_4.className = "htbimg";
            image1_4.title = "At the Broadway Bridge";

            image_big_src[5] = "../images/rivertour/KelleyPointToSeawall/crp_024_big.jpg";
            image2_1.src = "../images/rivertour/KelleyPointToSeawall/crp_024_small.jpg";
            image2_1.className = "htbimg";
            image2_1.title = "Outbound off Willbridge oil docks";

            image_big_src[6] = "../images/rivertour/KelleyPointToSeawall/crp_028_big.jpg";
            image2_2.src = "../images/rivertour/KelleyPointToSeawall/crp_028_small.jpg";
            image2_2.className = "htbimg";
            image2_2.title = "Turning off of Centennial Mills";

            image_big_src[7] = "../images/rivertour/KelleyPointToSeawall/crp_087_big.jpg";
            image2_3.src = "../images/rivertour/KelleyPointToSeawall/crp_087_small.jpg";
            image2_3.className = "htbimg";
            image2_3.title = "VLCC inbound at Willbridge";

            image_big_src[8] = "../images/rivertour/KelleyPointToSeawall/crp_088_big.jpg";
            image2_4.src = "../images/rivertour/KelleyPointToSeawall/crp_088_small.jpg";
            image2_4.className = "htbimg";
            image2_4.title = "Approaching Swan Island lagoon";

            image_big_src[9] = "../images/rivertour/KelleyPointToSeawall/crp_125_big.jpg";
            image3_1.src = "../images/rivertour/KelleyPointToSeawall/crp_125_small.jpg";
            image3_1.className = "htbimg";
            image3_1.title = "Inbound at Linnton";

            image_big_src[10] = "../images/rivertour/KelleyPointToSeawall/crp_137_big.jpg";
            image3_2.src = "../images/rivertour/KelleyPointToSeawall/crp_137_small.jpg";
            image3_2.className = "htbimg";
            image3_2.title = "Approaching Terminal 2";

            image_big_src[11] = "../images/rivertour/KelleyPointToSeawall/crp_484_big.jpg";
            image3_3.src = "../images/rivertour/KelleyPointToSeawall/crp_484_small.jpg";
            image3_3.className = "htbimg";
            image3_3.title = "Waiting for St. Johns Railroad Bridge to open";

            image_big_src[12] = "../images/flag_big.jpg";
            image3_4.src = "../images/flag_small.jpg";
            image3_4.className = "htbimg";
            image3_4.title = "";
            break;

    }

    DHTMLgoodies_largeImage.src = image_big_src[1];
    DHTMLgoodies_currentActiveImage = image1_1;
    imageTitle.innerText = DHTMLgoodies_currentActiveImage.title;

    if (image1_1.className == 'htbimg') {
        DHTMLgoodies_largeImage.className = "himage";
        DHTMLgoodies_currentActiveImage.className = "ahtbimg";
    }
    else {
        DHTMLgoodies_largeImage.className = "vimage";
        DHTMLgoodies_currentActiveImage.className = "avtbimg";
    }

    resetSlideShow();
}

