/* 
  randomly pick display a number of banners, depends on the following global variables:-
  total_no_of_banners ===> total no of possible banners
  no_of_banners_to_show ==> no of banners to be shown
*/

function showBanners( total_no_of_banners, no_of_banners_to_show ) {
  var banners = new Array();
  
  for ( var i = 0; i < no_of_banners_to_show; i++) {
    random_no = Math.floor(Math.random() * total_no_of_banners);
    while (banners.indexOf(random_no) != -1) {
      /* make sure that the random no is not duplicated */
      random_no = Math.floor(Math.random() * total_no_of_banners);
    }
    banners[i] = random_no;
    banner_id = 'banner_' + (random_no + 1);
    $(banner_id).show();
  }
}
