/*
var bannerContent = [
  ['ir',[
'images/banner/bayview_park_ad.jpg','http://www.sino-leasing.com/v4/residential_sect_en.asp?id=56','Link to Introduction of Bayview Park','_blank',
'images/banner/bowens_lookout_ad.jpg','http://www.sino-leasing.com/v4/residential_sect_en.asp?id=40','Link to Introduction of Bowen\'s Lookout','_blank',
'images/banner/central_plaza_ad.jpg','http://www.sino-leasing.com/v4/office_sect_en.asp?id=2','Link to Introduction of Central Plaza','_blank',
'images/banner/china_hk_ctr_ad.jpg','http://www.sino-leasing.com/v4/office_sect_en.asp?id=3','Link to Introduction of China Hong Kong City','_blank',
'images/banner/clifford_centre_ad.jpg','http://www.sino-leasing.com/v4/industrial_sect_en.asp?id=96','Link to Introduction of Clifford Centre','_blank',
'images/banner/corp_park_ad.jpg','http://www.sino-leasing.com/v4/industrial_sect_en.asp?id=110','Link to Introduction of Corporation Park','_blank',
'images/banner/exchange_tower_ad.jpg','http://www.sino-leasing.com/v4/office_sect_en.asp?id=129','Link to Introduction of Exchange Tower','_blank',
'images/banner/hk_gold_coast_ad.jpg','http://www.sino-leasing.com/v4/residential_sect_en.asp?id=45','Link to Introduction of HK Gold Coast','_blank',
'images/banner/island_resort_ad.jpg','default.asp?xid=hkp_pfs_r_hk_ir','Link to Introduction of Island Resort','_self',
'images/banner/one_silversea_ad.jpg','default.asp?xid=hkp_pfs_r_k_oss','Link to Introduction of One SilverSea','_self',
'images/banner/pacific_plaza_ad.jpg','http://www.sino-leasing.com/v4/retail_sect_en.asp?id=71','Link to Introduction of Pacific Plaza','_blank',
'images/banner/pacific_trade_ctr_ad.jpg','http://www.sino-leasing.com/v4/industrial_sect_en.asp?id=101','Link to Introduction of Pacific Trade Centre','_blank',
'images/banner/sino_plaza_ad.jpg','http://www.sino-leasing.com/v4/office_sect_en.asp?id=12','Link to Introduction of Sino Plaza','_blank',
'images/banner/the_centrium_ad.jpg','http://www.sino-leasing.com/v4/retail_sect_en.asp?id=74','Link to Introduction of The Centrium','_blank',
'images/banner/the_hennessy_ad.jpg','http://www.sino-leasing.com/v4/retail_sect_en.asp?id=128','Link to Introduction of The Hennessy','_blank',
'images/banner/tst_ctr_ad.jpg','http://www.sino-leasing.com/v4/retail_sect_en.asp?id=62','Link to Introduction of Tsim Sha Tsui Centre','_blank',
'images/banner/vision_city_ad.jpg','default.asp?xid=hkp_pfs_r_nt_vc','Link to Introduction of Vision City','_self'
  ]],
['*',[ // all other sections
'images/banner/bayview_park_ad.jpg','http://www.sino-leasing.com/v4/residential_sect_en.asp?id=56','Link to Introduction of Bayview Park','_blank',
'images/banner/bowens_lookout_ad.jpg','http://www.sino-leasing.com/v4/residential_sect_en.asp?id=40','Link to Introduction of Bowen\'s Lookout','_blank',
'images/banner/central_plaza_ad.jpg','http://www.sino-leasing.com/v4/office_sect_en.asp?id=2','Link to Introduction of Central Plaza','_blank',
'images/banner/china_hk_ctr_ad.jpg','http://www.sino-leasing.com/v4/office_sect_en.asp?id=3','Link to Introduction of China Hong Kong City','_blank',
'images/banner/clifford_centre_ad.jpg','http://www.sino-leasing.com/v4/industrial_sect_en.asp?id=96','Link to Introduction of Clifford Centre','_blank',
'images/banner/corp_park_ad.jpg','http://www.sino-leasing.com/v4/industrial_sect_en.asp?id=110','Link to Introduction of Corporation Park','_blank',
'images/banner/exchange_tower_ad.jpg','http://www.sino-leasing.com/v4/office_sect_en.asp?id=129','Link to Introduction of Exchange Tower','_blank',
'images/banner/hk_gold_coast_ad.jpg','http://www.sino-leasing.com/v4/residential_sect_en.asp?id=45','Link to Introduction of HK Gold Coast','_blank',
'images/banner/island_resort_ad.jpg','default.asp?xid=hkp_pfs_r_hk_ir','Link to Introduction of Island Resort','_self',
'images/banner/one_silversea_ad.jpg','default.asp?xid=hkp_pfs_r_k_oss','Link to Introduction of One SilverSea','_self',
'images/banner/pacific_plaza_ad.jpg','http://www.sino-leasing.com/v4/retail_sect_en.asp?id=71','Link to Introduction of Pacific Plaza','_blank',
'images/banner/pacific_trade_ctr_ad.jpg','http://www.sino-leasing.com/v4/industrial_sect_en.asp?id=101','Link to Introduction of Pacific Trade Centre','_blank',
'images/banner/sino_plaza_ad.jpg','http://www.sino-leasing.com/v4/office_sect_en.asp?id=12','Link to Introduction of Sino Plaza','_blank',
'images/banner/the_centrium_ad.jpg','http://www.sino-leasing.com/v4/retail_sect_en.asp?id=74','Link to Introduction of The Centrium','_blank',
'images/banner/the_hennessy_ad.jpg','http://www.sino-leasing.com/v4/retail_sect_en.asp?id=128','Link to Introduction of The Hennessy','_blank',
'images/banner/tst_ctr_ad.jpg','http://www.sino-leasing.com/v4/retail_sect_en.asp?id=62','Link to Introduction of Tsim Sha Tsui Centre','_blank',
'images/banner/vision_city_ad.jpg','default.asp?xid=hkp_pfs_r_nt_vc','Link to Introduction of Vision City','_self'
  ]]
];*/

var bannerContent = [
'bayview_park_ad.jpg','http://www.sino-leasing.com/v4/residential_sect_en.asp?id=56','Link to Introduction of Bayview Park','_blank',
'bowens_lookout_ad.jpg','http://www.sino-leasing.com/v4/residential_sect_en.asp?id=40','Link to Introduction of Bowen\'s Lookout','_blank',
'central_plaza_ad.jpg','http://www.sino-leasing.com/v4/office_sect_en.asp?id=2','Link to Introduction of Central Plaza','_blank',
'china_hk_ctr_ad.jpg','http://www.sino-leasing.com/v4/office_sect_en.asp?id=3','Link to Introduction of China Hong Kong City','_blank',
'clifford_centre_ad.jpg','http://www.sino-leasing.com/v4/industrial_sect_en.asp?id=96','Link to Introduction of Clifford Centre','_blank',
'corp_park_ad.jpg','http://www.sino-leasing.com/v4/industrial_sect_en.asp?id=110','Link to Introduction of Corporation Park','_blank',
'exchange_tower_ad.jpg','http://www.sino-leasing.com/v4/office_sect_en.asp?id=129','Link to Introduction of Exchange Tower','_blank',
'hk_gold_coast_ad.jpg','http://www.sino-leasing.com/v4/residential_sect_en.asp?id=45','Link to Introduction of HK Gold Coast','_blank',
'island_resort_ad.jpg','default.asp?xid=hkp_pfs_r_hk_ir','Link to Introduction of Island Resort','_self',
'one_silversea_ad.jpg','default.asp?xid=hkp_pfs_r_k_oss','Link to Introduction of One SilverSea','_self',
'pacific_plaza_ad.jpg','http://www.sino-leasing.com/v4/retail_sect_en.asp?id=71','Link to Introduction of Pacific Plaza','_blank',
'pacific_trade_ctr_ad.jpg','http://www.sino-leasing.com/v4/industrial_sect_en.asp?id=101','Link to Introduction of Pacific Trade Centre','_blank',
'sino_plaza_ad.jpg','http://www.sino-leasing.com/v4/office_sect_en.asp?id=12','Link to Introduction of Sino Plaza','_blank',
'the_centrium_ad.jpg','http://www.sino-leasing.com/v4/retail_sect_en.asp?id=74','Link to Introduction of The Centrium','_blank',
'the_hennessy_ad.jpg','http://www.sino-leasing.com/v4/retail_sect_en.asp?id=128','Link to Introduction of The Hennessy','_blank',
'tst_ctr_ad.jpg','http://www.sino-leasing.com/v4/retail_sect_en.asp?id=62','Link to Introduction of Tsim Sha Tsui Centre','_blank',
'vision_city_ad.jpg','default.asp?xid=hkp_pfs_r_nt_vc','Link to Introduction of Vision City','_self'
]




function displayBanner(w,h,x){ // x=contentName
    var ar = bannerContent;
    if(ar.length == 0 || typeof ar[0] == 'string'){

      return banner_v1x(w,h);
    }
    var ar = banner_getArrayByContentName(typeof x!='undefined'?x:'*');
    var i = Math.floor(Math.random()*(ar.length/4));
    var str = '<A href="'+ar[4*i+1]+'" target="'+ar[4*i+3]+'"><IMG border=0 src="images/banner/'+ar[4*i]+'" width='+w+' height='+h+' '+(x?x:'')+'alt=\"'+ar[4*i+2]+'\">'

    return str;
}


function banner_v1x(w,h){ // for v1.x legacy support
    var ar = bannerContent;
    var i = Math.floor(Math.random()*(ar.length/4));
    return '<A href="'+ar[4*i+1]+'" target="'+ar[4*i+3]+'"><IMG border=0 src="images/banner/'+ar[4*i]+'" width='+w+' height='+h+' alt=\"'+ar[4*i+2]+'\">';
}

function banner_getArrayByContentName(x){
    var arEtc = [];
    for(var i=0; i<ar.length; i++){
      if(x.indexOf(ar[i][0])==0){

        return ar[i][1];
      }
      if(ar[i][0]=='*') arEtc = ar[i][1];
    }

    return arEtc;
}
