// DEFINE VARIABLES //

	var rSpeed = 6000;
	var ie = document.all;
	var cntImg;
	var imgN = 0;
	var setIntervalID;

	var loadImgThumb = new Array();
	var loadImgLarge = new Array();

	var imgSetThumb = new Array();
	var imgSetLarge = new Array();

	var capSetThumb = new Array();
	var capSetLarge = new Array();

// DEFINE IMAGES //

	loadImgThumb[0] = "Donor-Dedication-Wall.jpg";
	loadImgThumb[1] = "Nurses-Station-A.jpg";
	loadImgThumb[2] = "Patient-Suite-A.jpg";
	loadImgThumb[3] = "Patient-Suite-B.jpg";
	loadImgThumb[4] = "Living-Room-A.jpg";
	loadImgThumb[5] = "Living-Room-Fireplace-B.jpg";
	loadImgThumb[6] = "Childrens-Activity-Room-A.jpg";

	loadImgLarge[0] = "Donor-Dedication-Wall.jpg";
	loadImgLarge[1] = "Nurses-Station-A.jpg";
	loadImgLarge[2] = "Patient-Suite-A.jpg";
	loadImgLarge[3] = "Patient-Suite-B.jpg";
	loadImgLarge[4] = "Living-Room-A.jpg";
	loadImgLarge[5] = "Living-Room-Fireplace-B.jpg";
	loadImgLarge[6] = "Childrens-Activity-Room-A.jpg";

// DEFINE CAPTIONS //

	capSetThumb[0] = "<b>Donor Recognition Wall</b>";
	capSetThumb[1] = "<b>Nurses Station</b>";
	capSetThumb[2] = "<b>Patient Suite</b>";
	capSetThumb[3] = "<b>Patient Suite</b>";
	capSetThumb[4] = "<b>Living Room</b>";
	capSetThumb[5] = "<b>Fireplace</b>";
	capSetThumb[6] = "<b>Children's Activity Room</b>";

	capSetLarge[0] = "<div style=\"text-align:center;\"><b>Donor Recognition Wall</b></div>As a nonprofit, community-based organization, there is plenty of goodwill in the communities served by Rainbow Hospice.  Upon entrance to the inpatient unit, a Donor Recognition Wall showcases the names of those who have made a gift in support of the inpatient unit.";
	capSetLarge[1] = "<div style=\"text-align:center;\"><b>Nurses Station</b></div>Centrally located to view each patient care suite, the nurses station provides easy access to hospice professionals for patients and their families.";
	capSetLarge[2] = "<div style=\"text-align:center;\"><b>Patient Suite</b></div>Patient care suites at Rainbow Hospice Ark provide comfort and care for patients and their families.  Each patient room is designed for comfort and includes a flat screen TV, overnight accommodations for guests and a private vanity.";
	capSetLarge[3] = "<div style=\"text-align:center;\"><b>Patient Suite</b></div>Each patient care suite is furnished with a comfortable recliner-bed so that family members can spend the night.";
	capSetLarge[4] = "<div style=\"text-align:center;\"><b>Living Room</b></div>The Great Room is designed to offer families a place of solace while visiting their loved ones.  The comfortable Great Room offers reading areas, two fireplaces, a library, and  space to hold family gatherings.";
	capSetLarge[5] = "<div style=\"text-align:center;\"><b>Fireplace</b></div>The Great Room includes a cozy fireplace that enhances the calming environment so that families can gather and visit with each other.";
	capSetLarge[6] = "<div style=\"text-align:center;\"><b>Children's Activity Room</b></div>The Ark's Children's Activity Room offers a peaceful and safe area where children can read, play games or create artwork.";

// PRELOAD IMAGES //

	var loadImgLen = loadImgThumb.length;

	for (cntImg=0; cntImg<loadImgLen; cntImg++) {
		imgSetThumb[cntImg] = new Image();
		imgSetThumb[cntImg].src = "/images/rotating/" + loadImgThumb[cntImg];
	}

	for (cntImg=0; cntImg<loadImgLen; cntImg++) {
		imgSetLarge[cntImg] = new Image();
		imgSetLarge[cntImg].src = "/images/rotating/large/" + loadImgLarge[cntImg];
	}

function SpinIELarge() {
	document.getElementById("rotatingImage").filters[0].Apply();
	document.getElementById("rotatingImage").src = imgSetLarge[imgN].src;
	document.getElementById("rotatingImage").filters[0].Play();
	document.getElementById("rotatingCaption").innerHTML = capSetLarge[imgN];
}

function SpinIESmall() {
	document.getElementById("rotatingImage").filters[0].Apply();
	document.getElementById("rotatingImage").src = imgSetThumb[imgN].src;
	document.getElementById("rotatingImage").filters[0].Play();
	document.getElementById("rotatingCaption").innerHTML = capSetThumb[imgN];
}

function SpinOtherLarge() {
	document.getElementById("rotatingImage").src = imgSetLarge[imgN].src;
	document.getElementById("rotatingCaption").innerHTML = capSetLarge[imgN];
}


function SpinOtherSmall() {
	document.getElementById("rotatingImage").src = imgSetThumb[imgN].src;
	document.getElementById("rotatingCaption").innerHTML = capSetThumb[imgN];
}

function flipImg(sDirection,sSize) {

	if (sDirection) {
		imgN++;
		if (imgN >= loadImgLen) imgN = 0;
	} else {
		imgN--;
		if (imgN < 0) imgN = loadImgLen-1;
	}

	if (ie && sSize == "small") {
		SpinIESmall();
	} else if (ie && sSize == "large") {
		SpinIELarge();
	} else if (sSize == "small") {
		SpinOtherSmall();
	} else if (sSize == "large") {
		SpinOtherLarge();
	}

}