<!--

/* 
 * Show the indicated photo from the array of available photos
 */
function showPhoto(nPhoto){
 if (document.getElementById) 
 {
 	if (nPhoto >= imgFiles.length)
	{
		/* wrap around to first photo if we've clicked next on last photo */
		nPhoto = 1;
	}
 	if (nPhoto <= 0)
	{
		/* wrap around to last photo if we've clicked previous on first photo */
		nPhoto = imgFiles.length - 1;
	}
	document.getElementById('placeholder').src = imgFiles[nPhoto];
	document.getElementById('placeholder').alt = imgCaptions[nPhoto];
	document.getElementById('caption').childNodes[0].nodeValue = imgCaptions[nPhoto];

	/* get the current active thumbnail and deactivate it */
	var sThumbId = 't' + currentPhoto;
	document.getElementById(sThumbId).className = 'thumb';
	
	/* activate the new thumbnail */
	var sThumbId = 't' + nPhoto;
	document.getElementById(sThumbId).className = 'thumb active';

	currentPhoto = nPhoto;
	return false;
 }
 else 
 {
  return true;
 }
}

/* 
 * Show the indicated photo from the array of available photos
 * The array is generated in the Casabase property_photo_templates file
 */
function showRentalPhoto(nPhoto){
 if (document.getElementById) 
 {
 	if (nPhoto >= imgFiles.length)
	{
		/* wrap around to first photo if we've clicked next on last photo */
		nPhoto = 1;
	}
 	if (nPhoto <= 0)
	{
		/* wrap around to last photo if we've clicked previous on first photo */
		nPhoto = imgFiles.length - 1;
	}
	document.getElementById('placeholder').src = imgFiles[nPhoto];
	document.getElementById('placeholder').alt = imgCaptions[nPhoto];
	document.getElementById('caption').childNodes[0].nodeValue = imgCaptions[nPhoto];
	/* is it portrait or landscape */
	if (imgPortrait[nPhoto] == 1)
	{
		document.getElementById('mainphoto').className = 'bigpt'
	}
	else
	{
		document.getElementById('mainphoto').className = 'bigls'
	}
	currentPhoto = nPhoto;
	return false;
 }
 else 
 {
  return true;
 }
}
//-->
