<%@ 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) 'An array containing a caption for each image aCaptions(0) = "The jungle surrounding the lodge is lush and full of surprises. It warrants many visits and photographs." aCaptions(1) = "This momma and baby monkey are high up in the trees. Sometimes, if you’re lucky and still, their curiosity gets the best of them and they come closer." aCaptions(2) = "Look carefully. This Iguana is one of many jungle creatures that blends into its surroundings." aCaptions(3) = "This Strangler Fig tree is the largest known to the area. Luckily for our guests it is located right on the Turtle Beach Jungle Trail." aCaptions(4) = "For the fullest experience, our guests are invited to use all their senses to fully discover the jungle." aCaptions(5) = "Most of the color in the jungle is subtle, but these beauties are as bright as any flowers that grow in full sun." aCaptions(6) = "The jungle is a tangle of varieties of life. Return to it time and again, and take lots of time to explore, each visit is unique and memorable." ' 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 %> Jungle Trail
 Jungle Trail
<%= sImage %>
<%= sCaption %>