﻿window.setTimeout("ajaxPostBack()", 5000)

function ajaxPostBack()
{        
    $.ajax({   
       type: "POST",   
       url: "default.aspx/RotateBanners",   
       data: "{}",   
       contentType: "application/json; charset=utf-8",  
       dataType: "json",  
       async: true,  
       cache: false,  
       success: function (response) {  
            var array = response.split("~");            
            $.each(array, function(index, text) { 
                if (text.substring(text.length-1).length > 0)                    
                    $("#ctl00_mainContent_divAd" + (text.substring(text.length-1))).html(text.substring(0, text.length-1));
            });
            
            window.setTimeout("ajaxPostBack()", 5000);
       }  
   });   
}

