
// Used for Accommodation and Motel Features page. Not for Attractions page.

var g_iimg = -1;
var g_imax = 0;
var pageIsLoaded = false;
var g_ImageTable = new Array();
var preloadedimages = new Array();
var bigimgsrc, bigimgwidth, bigimgheight;
var browsercap;

browsercap = eval(navigator.appVersion.toLowerCase().indexOf("msie 5.0") > -1);

function enlarge() {
	if (pageIsLoaded)
		window.open(bigimgsrc, "_blank", "width=" + (bigimgwidth + 20) + ",height=" + (bigimgheight + 25) + ",topmargin=0,fullscreen=no,toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,directories=no,location=no")
}

function ChangeImage(fFwd)
{
	if (fFwd)
	{
		if (++g_iimg==g_imax)
			g_iimg=0;
		}
		else
		{
		if (g_iimg==0)
			g_iimg=g_imax;
		g_iimg--;
	}
	Update();
}

function getobject(obj){
	if (document.getElementById)
		return document.getElementById(obj)
	else if (document.all)
		return document.all[obj]
}

function isObject(a) {
	return (a && typeof a == 'object');
}

function Update(){
	//if (isObject(document.images._Ath_Slide.filters[0])) {
	if (!browsercap && document.images._Ath_Slide.filters != null)
		document.images._Ath_Slide.filters[0].stop();
	if (!browsercap && document.images._Ath_Slide.filters != null)
		document.images._Ath_Slide.filters[0].apply();
	//getobject("_Ath_Slide").src = g_ImageTable[g_iimg][0];
	getobject("_Ath_Slide").src = preloadedimages[g_iimg].src;
	if (!browsercap && document.images._Ath_Slide.filters != null)
		document.images._Ath_Slide.filters[0].play();
	getobject("_Ath_FileName").innerHTML = g_ImageTable[g_iimg][1];
	bigimgsrc = g_ImageTable[g_iimg][2];
	bigimgwidth = g_ImageTable[g_iimg][3];
	bigimgheight = g_ImageTable[g_iimg][4];
}

function Prev()
{
	if (pageIsLoaded)
		ChangeImage(false);
}

function Next()
{
	if (pageIsLoaded)
		ChangeImage(true);
}

function slideshow() {
	if (document.getElementById||document.all) {
		pageIsLoaded = true;
		Next();
	}
}
