%@ language="vbscript" %>
<%
Dim sImage,sCaption,sPreviousVisibiliy,sNextVisibiliy,nNextPosition,nPreviousPosition
Dim aPictures(7) 'An array containing the images to be used
aPictures(0) = ""
aPictures(1) = "
"
aPictures(2) = "
"
aPictures(3) = "
"
aPictures(4) = "
"
aPictures(5) = "
"
aPictures(6) = "
"
Dim aCaptions(7)
aCaptions(0) = "Our turtle pool faces the beach to mimic the giant turtles returning to the sea after laying their eggs."
aCaptions(1) = "The pool complex offers a pleasant place to mix with fellow travelers. The hammock hut shields you from sun or rain as you relax. The nearness to the restaurant and bar makes getting a cool drink handy on a hot day."
aCaptions(2) = "The turtle shaped pool has three baby turtles on the bottom made from a mosaic of colored tiles."
aCaptions(3) = "A dip in the pool is equally nice day or evening."
aCaptions(4) = "After a day of touring the lowland jungle, nothing beats relaxing and refreshing in our turtle shaped pool."
aCaptions(5) = "The hammock hut provides a shaded spot to relax with a view of the lovely grounds, the swimming pool, or the back of your eyelids as you nap a little."
aCaptions(6) = "This is the view from inside the restaurant and bar. With the restaurant and pool next to each other it is convenient to get a cool drink on a hot day."
' SetDefaults(): Sets the default image and caption.
' This function is called the first time the page is loaded
' if an invalid request is made.
Sub SetDefaults()
sImage = aPictures(0)
sCaption = aCaptions(0)
sPreviousVisibiliy = "hidden"
sNextVisibiliy = "visible"
nPreviousPosition = 0
nNextPosition = 1
End Sub
' MoveNext(IntPosition): Moves the image and corresponding caption forward or backward
Function MoveNext(IntPosition)
nNextPosition = IntPosition+1
nPreviousPosition = IntPosition-1
If (CInt(IntPosition)+1 = UBound(aCaptions)) Then
sNextVisibiliy = "hidden"
Else
sNextVisibiliy = "visible"
End If
If (CInt(IntPosition) = 0) Then
sPreviousVisibiliy = "hidden"
Else
sPreviousVisibiliy = "visible"
End If
sImage = aPictures(CInt(IntPosition))
sCaption = aCaptions(CStr(IntPosition))
End Function
' GetCommand(): Returns the name of the image button ("previous" or "next") clicked on by the user
Function GetCommand()
If (Request.Form.Count = 0) Then
GetCommand = ""
Else
GetCommand = Left(Request.Form.Key(3),Instr(Request.Form.Key(3), ".")-1)
End If
End Function
Select Case GetCommand()
Case "Next" MoveNext(Request("NextPosition"))
Case "Previous" MoveNext(Request("PreviousPosition"))
Case Else SetDefaults()
End Select
%>