defaultTypes = new Array('general', 'fish', 'attractions', 'camping');

usePhotoTypes = defaultTypes;

general_length = 9;
fish_length = 16;
attractions_length = 3;
camping_length = 6;
events_length = 19;
cottages_length = 4;
ghost_length = 6;
moose_length = 7;

nextImage = null;

function getImageSrc()
{
	if(typeof(window['menuPhotoTypes']) != "undefined" )
	{
		usePhotoTypes = menuPhotoTypes;
	}

	useMenuPhotoDir = usePhotoTypes[Math.round(Math.random()*(usePhotoTypes.length - 1))];

	useMenuPhotoCount = window[useMenuPhotoDir + '_length'];
	return 'photos/menuphotos-2/' + useMenuPhotoDir + '-photo-' + (Math.round(Math.random()*(useMenuPhotoCount - 1)) + 1) + '.jpg';

}


function changeImage()	
{
	theSRC = getImageSrc();
	if (navigator.appName == "Microsoft Internet Explorer")	
	{
		document ["menuImage"].filters.blendTrans.Apply();
		document ["menuImage"].src = nextImage.src;
		document ["menuImage"].filters.blendTrans.Play()
	}
	else	
	{
		document ["menuImage"].src = nextImage.src;
	}
	
	nextImage = new Image(220,142);
	nextImage.src = getImageSrc();
}

function getFilterStr()
{
	if (navigator.appName == "Microsoft Internet Explorer")	
	{
		return ' filter:blendTrans(duration=3); ';
	}

	return '';	
}

function startImageFlip()	
{
	if (parseInt(navigator.appVersion) >= 4 && document.images)	
	{
		nextImage = new Image(220,142);
		nextImage.src = getImageSrc();
		window.setInterval("changeImage();", 10000);
	}
}


//document.writeln('<img id="menuImage" name="menuImage" style="margin-bottom: 2px; margin-top: 2px;' + getFilterStr() + '" src="' + getImageSrc() + '" width="150" height="98" alt="Current Photo" border="0"/>');
document.writeln('<img id="menuImage" name="menuImage" style="padding-bottom: 2px;' + getFilterStr() + '" src="' + getImageSrc() + '" width="220" height="142" alt="Current Photo" border="0"/>');
startImageFlip();