Imports System.Threading

Partial Class PushServer
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim pictures(2) As String
        Dim pictureInfo(2) As String
        Dim pic As Integer

        pictures(0) = "boat.gif"
        pictures(1) = "car.gif"
        pictures(2) = "train.gif"
        pictureInfo(0) = "A boat"
        pictureInfo(1) = "A car"
        pictureInfo(2) = "A train"
        pic = 0

        ' Set the content type
        Response.ContentType = "text/plain"
        Response.ContentEncoding = Encoding.UTF8
        'Response.Expires = -1

        Response.Write("<html xmlns='http://www.w3.org/1999/xhtml' >")
        Response.Write("<head>")
        Response.Write("</head>")

        Response.Write("<body>")

        Do While True
            Response.Write("<script type='text/javascript' language='javascript'>")
            Response.Write("parent._parent.heartbeat();")   ' IE Change here
            Response.Write("parent._parent.newpicture('" & pictures(pic) & "', '" & pictureInfo(pic) & "');")   ' IE Change here
            Response.Write("</script>")
            Response.Flush()

            Thread.Sleep(5000)

            If pic + 1 < 3 Then
                pic = pic + 1
            Else
                pic = 0
            End If
        Loop

        Response.Write("</body>")
        Response.Write("</html>")
    End Sub
End Class
