
function StartQuoteTimer()
{
    GetNextQuote();
    setInterval('GetNextQuote();', 15000); // update twice a minute
}

function GetNextQuote()
{
    var index = $('input#quoteindex');
    var quoteindex = 0;
    
    if(index)
    {
        quoteindex = parseInt(index.val(), 10);
    }
    
    quoteindex++;
    
    $.ajax({
       url: _xmlbaseUrl + 'Quote.ashx',
       type: 'POST',
       cache: false,
       data: ({ qid: quoteindex }),
      success: function(html){
        UpdateQuoteHTML(html);
      }
    });
}

function UpdateQuoteHTML(html)
{
    if(html != '' && $('div#quote').html != html)
    {
        $('div#quote').fadeOut("slow");    
        //$('div#quote').hide("slow");    
        
        $('div#quote').html(html).fadeIn("slow");
        
        //$('div#quote').show("slow");    
    }

}
