﻿var StartPage =
{
    init: function (timeout)
    {
        var image = $("#topBody .container img").first();
        var balloon = $("#speechBalloon div").first();
        var counter = 0;

        setInterval(function ()
        {
            $.ajax({
                type: "POST",
                url: "/SubSites/ETC/Templates/Public/WebServices/Common.asmx/GetNextQuote",
                data: "{'counter':" + ++counter + "}",
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (msg)
                {
                    image.alt = balloon.html(msg.d).find("a").html();
                }
            });
        }, timeout * 1000);
    }
}

