topThumb = 1;
currentSlide = 1; 
var caption;

	
// Thumbnail & Slide Images
thumbArray = new Array(maxSlides);
slideArray = new Array(maxSlides);

if (document.images) {
	for(var n=1; n<=maxSlides;n++){
		thumbArray[n] = new Image();
		thumbArray[n].src = 'slideshow/thumb'+n+'.jpg';

		slideArray[n] = new Image();
		slideArray[n].src = 'slideshow/slide'+n+'.jpg';
	}




// Arrow Images
	var dwn_on = new Image();
	var dwn_off = new Image();
	var up_on = new Image();
	var up_off = new Image();
		
	dwn_on.src  ="slideshow/arrow_up_on.gif"
	dwn_off.src ="slideshow/arrow_up_off.gif"
	up_on.src  ="slideshow/arrow_dwn_on.gif"
	up_off.src ="slideshow/arrow_dwn_off.gif"
}

function clickdown() {
	if (topThumb+ 3 < maxSlides) {
		topThumb= topThumb+ 1;
		displayAllThumbs();
		displayArrows();
	}
}

function clickup() {
	if (topThumb> 1) {
		topThumb= topThumb- 1;
		displayAllThumbs();
		displayArrows();
	}
}

function displayArrows() {
	if (document.images) {
		if (topThumb== 1) document["up"].src = dwn_off.src;
			else document["up"].src = dwn_on.src;

		if (topThumb + 3 >= maxSlides) document["dwn"].src = up_off.src
			else document["dwn"].src = up_on.src
	}
}


// Thumbnail Functions
function displayAllThumbs() {
	if (document.images) {
		for(var n=1; n<=4; n++){
			document["thumb" + n].src = thumbArray[topThumb+n-1].src;
		}
	}
}

// Slide Function
function displaySlide(thumbLocation) {
	currentSlide = topThumb + thumbLocation - 1
	if (document.images) {
//			document["slide"].src = 'slideshow/slide'+currentSlide+'.jpg';
			document["slide"].src = slideArray[currentSlide].src;
			displayCaption(currentSlide);
	}
}


// Caption Functions
function displayCaption(number) {
	text = capArray[number];
	writeIt (text, 'caption');	
}

function writeIt(text,id)
{
	if (document.getElementById)
	{
		x = document.getElementById(id);
		x.innerHTML = '';
		x.innerHTML = text;
	}
	else if (document.all)
		document.all[id].innerHTML = text;
}

// popup window script
function popupWin() {
caption = capArray[currentSlide];
newWindow = window.open('hotel_popup.htm','newWin','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,ressizeable=no,width=533,height=465,top=170,left=125');
if (!newWindow.opener)
  newWindow.opener = this.window;
}

