﻿function AdvertisementShare(adId, refreshTime) {
    $('#AdvertisementShare' + adId + ' div:first').addClass('actived');
    setInterval("slideSwitch(" + adId + ")", refreshTime);
}
function slideSwitch(adId) {
    var $active = $('#AdvertisementShare' + adId + ' div.actived');
    if ($active.length == 0) $active = $('#AdvertisementShare' + adId + ' div:last');
    var $next = $active.next().length ? $active.next() : $('#AdvertisementShare' + adId + ' div:first');
    
    $active.removeClass('actived').hide();
    $next.addClass('actived').show();    
}
  
