<%@ language="vbscript" %> <% Dim sImage,sCaption,sPreviousVisibiliy,sNextVisibiliy,nNextPosition,nPreviousPosition Dim aPictures(4) 'An array containing the images to be used aPictures(0) = "" aPictures(1) = "" aPictures(2) = "" aPictures(3) = "" Dim aCaptions(4) 'An array containing a caption for each image aCaptions(0) = "The grass roof cones atop the restaurant are approximately 40 feet tall and can be seen from the fisherman in the Caribbean. They are in keeping with the local building traditions." aCaptions(1) = "The complex also houses the bar and lounge, which are convenient to the adjoining turtle shaped pool and hammock hut. A wide variety of drinks are served day and evening." aCaptions(2) = "Two guests get a lesson in making flour tortillas." aCaptions(3) = "The scents of flowers and delicious foods mix with sounds of birds and ocean to provide dining pleasure for breakfast, lunch and dinner. Our fine chef has years of experience and praise, but don’t take our word for it. Come see for yourself!" ' 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 %> Dining
 Dining
<%= sImage %>
<%= sCaption %>