<%@ 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) = "Turtle Beach Lodge has the rare distinction of having both beach and jungle in a single location. Our wide dark-sand beach is cleaned and cared for daily." aCaptions(1) = "The surf at Turtle Beach Lodge can be wild and is always invigorating. While respecting the power of the ocean, playing in the surf just steps away from your room is a favorite among guests." aCaptions(2) = "Is this guest reading or fishing? Fishing or reading? Who cares as long as he’s enjoying himself." aCaptions(3) = "The pace at the lodge is always peaceful. Although Tom is one of our owners, one wouldn't exactly define the position as stressful. (As you can see.)" aCaptions(4) = "In addition to green sea turtles laying their eggs each season, you will share the beach with all kinds of small creatures." aCaptions(5) = "From the beach, when one looks back toward the lodge the untamed beauty of Lowland Jungle provides a brilliant view." aCaptions(6) = "The sky fills with color at sunset for a pleasant way to ease into evening." ' 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 %> The Beach
 The Beach
<%= sImage %>
<%= sCaption %>