function getURL(uri) {
        uri.dir = location.href.substring(0, location.href.lastIndexOf('\/'));
        uri.dom = uri.dir; if (uri.dom.substr(0,7) == 'http:\/\/') uri.dom = uri.dom.substr(7);
        uri.path = ''; var pos = uri.dom.indexOf('\/'); if (pos > -1) {uri.path = uri.dom.substr(pos+1); uri.dom = uri.dom.substr(0,pos);}
        uri.page = location.href.substring(uri.dir.length+1, location.href.length+1);
        pos = uri.page.indexOf('?');if (pos > -1) {uri.page = uri.page.substring(0, pos);}
        pos = uri.page.indexOf('#');if (pos > -1) {uri.page = uri.page.substring(0, pos);}
        uri.ext = ''; pos = uri.page.indexOf('.');if (pos > -1) {uri.ext =uri.page.substring(pos+1); uri.page = uri.page.substr(0,pos);}
        uri.file = uri.page;
        if (uri.ext != '') uri.file += '.' + uri.ext;
        if (uri.file == '') uri.page = 'index';
        uri.args = location.search.substr(1).split("?");
        return uri;
}
var quote1 = new Array(4);
var quote2 = new Array(4);
var quote2c = new Array(5);
var quote3 = new Array(3);
var quote4 = new Array(3);
var quote5 = new Array(2);
var quote6 = new Array(2);
var quote7 = new Array(4);
var quote8 = new Array(4);
var Index1, Index2, Index7, Index8;

function DisplayBNR1() {

quote1[0] = "131x65_marketbeat";
quote1[1] = "131x65_facetoct";
quote1[2] = "consumer/main07_card";
quote1[3] = "consumer/main07_loan";

var now = new Date();
var sec = now.getSeconds();

document.randombnr1.src = '/img/hk/' + quote1[sec % 4] + '.gif';
Index1 = quote1[sec % 4];
}

function DisplayBNR2() { //Card Right Nav
var uri = new Object();
var uri = getURL(uri);
var now = new Date();
var sec = now.getSeconds();

//quote2[0] = "20080331_black";


document.randombnr2.src = '/img/hk/consumer/' + quote2[sec % 0] + '.gif';
Index2 = quote2[sec % 0];
}

function DisplayBNR2c() { //Card Right Nav

//quote2c[0] = "20080331_black_c"


var now = new Date();
var sec = now.getSeconds();

document.randombnr2c.src = '/img/hk/consumer/' + quote2c[sec % 0] + '.gif';
Index2c = quote2c[sec % 0];
}

function DisplayBNR3() { //reward page left eng

quote3[0] = "bonus_pt_e";
quote3[1] = "cash_couopon_e";
quote3[2] = "mileage_e";

var now = new Date();
var sec = now.getSeconds();

document.randombnr3.src = '/img/hk/creditcards/' + quote3[sec % 3] + '.gif';
}

function DisplayBNR4() { //reward page left zh

quote4[0] = "bonus_pt_c";
quote4[1] = "cash_couopon_c";
quote4[2] = "mileage_c";

var now = new Date();
var sec = now.getSeconds();

document.randombnr4.src = '/img/hk/creditcards/' + quote4[sec % 3] + '.gif';
}

function DisplayBNR5() { //reward page right en

quote5[0] = "rebate01_e";
quote5[1] = "rebate02_e";

var now = new Date();
var sec = now.getSeconds();

document.randombnr5.src = '/img/hk/creditcards/' + quote5[sec % 2] + '.gif';
}

function DisplayBNR6() { //reward page right zh

quote6[0] = "rebate01_c";
quote6[1] = "rebate02_c";

var now = new Date();
var sec = now.getSeconds();

document.randombnr6.src = '/img/hk/creditcards/' + quote6[sec % 4] + '.gif';
}

function DisplayBNR7(){ //consumer main page en
var now = new Date();
var sec = now.getSeconds();

quote7[0] = "main_taxloan";
quote7[1] = "main_travel";
quote7[2] = "main_compass_ticket";
quote7[3] = "main_inv_securities";
quote7[4] = "main_eFNA";
quote7[5] = "main_RMBdeposit";


document.randombnr7.src = '/img/hk/consumer/' + quote7[sec%5]+'.gif';
Index7 = quote7[sec%5];
}

function DisplayBNR8(){ //consumer main page zh
var now = new Date();
var sec = now.getSeconds();
quote8[0] = "main_taxloan_zh"; 
quote8[1] = "main_travel_c";
quote8[2] = "main_compass_ticket_c";
quote8[3] = "main_inv_securities_c";
quote8[4] = "main_eFNA_c";
quote8[5] = "main_RMBdeposit_c";


document.randombnr8.src = '/img/hk/consumer/' + quote8[sec%5]+'.gif';
Index8 = quote8[sec%5];
}

function gotolink1(imgname) {

		switch (Index1) {

		case '131x65_marketbeat':
			document.location = '/en/marketupdate';
			break;
		case '131x65_facetoct':
			document.location = '/en/consumer/promotion';
			break;
		case 'consumer/main07_loan':
			document.location = '/en/consumer/loans/';
			break;
		case 'consumer/main07_card':		
			document.location = '/en/consumer/creditcards/';
		default:
			break;
		}
}

function gotolink2(imgname) {

		switch (Index2) {

		case '20080331_black':
			window.open('/en/consumer/creditcards/blackcard/blackcard_e.htm');
			break;
		case '20080417_compass':		
			window.open('http://www.compassvisa.com.hk/html/compassvisa_platium_promotion.aspx?lang=en-US');
			break;
		case '20080814_fundtransfer':
			document.location = '/en/consumer/creditcards/20080814_fundtransfer.html';
			break;
		case 'banner_ecbluckydraw':
			document.location = '/en/consumer/promotion/automatedbankingservices/20080818_ecbluckydraw.htm';
			break;		
		case '20090514_ft':
			document.location = '/en/consumer/promotion/creditcards/20090508_ft.html';
			break;
		case '20090709_plat':
			document.location = '/en/consumer/creditcards/platinum/#1';
			break;
		default:
			break;
		}
}

function gotolink2c(imgname) {

		switch (Index2c) {

		case '20080331_black_c':
			window.open('/zh/consumer/creditcards/blackcard/blackcard_c.htm');
			break;
		case '20080417_compass_c':		
			window.open('http://www.compassvisa.com.hk/html/compassvisa_platium_promotion.aspx');
			break;
		case '20080814_fundtransfer_c':
			document.location = '/zh/consumer/creditcards/20080814_fundtransfer.html';
			break;
		case 'banner_ecbluckydraw_c':
			document.location = '/zh/consumer/promotion/automatedbankingservices/20080818_ecbluckydraw.htm';
			break;	
		case '20090514_ft_c':
			document.location = '/zh/consumer/promotion/creditcards/20090508_ft.html';
			break;
		case '20090709_plat_c':
			document.location = '/zh/consumer/creditcards/platinum/#1';
			break;
		default:
			break;
		}
}

function gotolink3(imgname) { //reward left eng
	document.location = '/en/consumer/creditcards/rewards/bonuspoint1/';
}

function gotolink4(imgname) { //reward left zh
	document.location = '/zh/consumer/creditcards/rewards/bonuspoint1/';
}

function gotolink5(imgname) { //reward right eng
	document.location = '/en/consumer/creditcards/rewards/cashrebate/';
}

function gotolink6(imgname) { //reward right zh
	document.location = '/zh/consumer/creditcards/rewards/cashrebate/';
}

function gotolink7(imgname) {

		switch (Index7) {

		case 'main_places_e':
document.location = 'javascript:MM_openBrWindow(%27/en/consumer/redirect_places.htm?pid=JB_places7_en%27,%27DBS%27,%27resizable,scrollbars,status,width=600,height=600%27)';
			break;
		case 'main_compass_ticket':
			window.open('http://www2.compassvisa.com.hk/html/compassvisa_platium_promotion.aspx?lang=en-US');
			break;
		case 'main_tpb':
			document.location = '/en/consumer/treasuresprioritybanking/promotion/';
			break;
		case 'main_dbsw_jb_e':
			document.location = 'javascript:MM_openBrWindow(%27/en/consumer/dbsw/promotion/index.html?pid=JB_dbsw5a_201107dbsw_en%27,%27DBS%27,%27resizable,scrollbars,status,width=800,height=600%27)';
			break;
		case 'main_dbsw_e':
			document.location = 'javascript:MM_openBrWindow(%27/en/consumer/dbsw/promotion/index.html?pid=JB_dbsw5b_201107dbsw_en%27,%27DBS%27,%27resizable,scrollbars,status,width=800,height=600%27)';
			break;
		case 'main_eFNA':
			window.open('/en/consumer/investments/financialplanning/fna/index.html?pid=JB_inv_eFNA_en');
			break;
		case 'main_td':
			document.location = '/en/consumer/promotion/deposits/20080703_td.html';
			break;
		case 'main_RMBdeposit':
			document.location = '/en/consumer/promotion/deposits/20120120rmb.htm?pid=JB_deposit_RMB_en';
			break;
		case 'main_3g':
			document.location = '/en/consumer/promotion/automatedbankingservices/20080911_3g.htm';
			break;
		case 'main_homeadvice':
			document.location = '/en/consumer/loans/mortgage/homeadvice/';
			break;
		case 'main_mobile':
			document.location = '/en/consumer/promotion/automatedbankingservices/20081020_mobile.html';
			break;
		case 'main_taxloan':
			document.location = '/en/consumer/loans/unsecuredloans/taxpil/index.html?pid=JB_loan_en';
			break;
		case 'main_debtcon_en':
			document.location = '/en/consumer/loans/unsecuredloans/debtconsolidation/';
			break;
		case 'main_PD_en':
			document.location = '/en/consumer/promotion/investments/20090406premiumdeposit.htm';
			break;
		case 'main_ibusage':
			document.location = '/en/consumer/promotion/automatedbankingservices/201109_IB_Usage.html?pid=JB_ib_luckydraw_en';
			break;
		case 'main_plat':
			document.location = '/en/consumer/creditcards/platinum/#1';
			break;
		case 'main_ins':
			window.open = '/en/consumer/promotion/insurance/20090501_medisure_promo.htm';
			break;
		case 'main_ebk_luckydraw':
			document.location = '/en/consumer/promotion/automatedbankingservices/20091201_ecbluckydraw.htm';
			break;
		case 'main_ft':
			document.location = '/en/consumer/creditcards/20090529_cashoffer.html';
			break;
		case 'main_summerCamp_zh.jpg':
			window.open('/zh/consumer/creditcards/diningClub/si/');
			break;
		case 'main_inv_survey':
			window.open('http://dbshk3.surveypros.net/survey.php');
			break;
		case 'main_3everyday':
			window.open('http://www.compassvisa.com.hk/html/compassvisa_platium_promotion.aspx?lang=en-US');
			break;
		case 'main_octopus':
			window.open('/en/consumer/automatedbankingservices/octopusatmcard/');
			break;
		case 'main_award':
			document.location = '/en/consumer/201001_award.htm ';
			break;
		case 'main_instalment':
			window.open('http://www.compassvisa.com.hk/html/airticket.aspx?lang=en-US');
			break;
		case 'main_flexi':
			window.open('http://www.compassvisa.com.hk/Channel/Finance/FBISpeLanding.aspx?lang=en-US');
			break;
		case 'main_compass_taobao':
			window.open('http://www.compassvisa.com.hk/taobao/');
			break;
		case 'main_bp_offer':
			document.location = '/en/consumer/promotion/automatedbankingservices/201012_eb_bp_offer.htm';
			break;
		case 'main_3x':
			window.open('/en/consumer/creditcards/diningClub/3x/');
			break;
		case 'main_paywave':
			window.open('http://www.compassvisa.com.hk/html/paywave0929.aspx?lang=en-US');
			break;
		case 'main_compass_tax_e':
			window.open('http://www.compassvisa.com.hk/html/flexitax.aspx?lang=en-US');
			break;
		case 'main_summerCamp_en':
			window.open('/en/consumer/creditcards/diningclub/cardoffer/20110715_summerdining.html?promo=20110715_summerdining_content.html?pid=JB_card_summer_en&type=monthly&highlight=monthlyPromo15');
			break;
		case 'main_eb_DYK':
			document.location = '/en/consumer/promotion/automatedbankingservices/201008_eb_DYK.htm';
			break;
		case 'main_travel':
			window.open( '/en/consumer/insurance/promotion/index.html?pid=JB_insu_en');
			break;
	
		case 'main_inv_securities':
			document.location = 'javascript:MM_openBrWindow(%27/en/consumer/promotion/investments/20111114_securities.html?pid=JB_inv_securities_en%27,%27DBS%27,%27resizable,scrollbars,status,width=720,height=800%27)';
			break;
		case 'main_travel':
			window.open('/en/consumer/insurance/promotion/index.html?pid=JB_insu_en');
			break;
		
		default:
			break;
		}
}
function gotolink8(imgname) {

		switch (Index8) {

		case 'main_places_c':
		document.location ='javascript:MM_openBrWindow(%27/zh/consumer/redirect_places.htm?pid=JB_places7_zh%27,%27DBS%27,%27resizable,scrollbars,status,width=600,height=600%27)';
			break;
		case 'main_compass_ticket_c':
			window.open('http://www2.compassvisa.com.hk/html/compassvisa_platium_promotion.aspx?lang=zh-HK');
			break;
		case 'main_tpb_c':
			document.location = '/zh/consumer/treasuresprioritybanking/promotion/';
			break;
		case 'main_dbsw_jb_c':
			document.location = 'javascript:MM_openBrWindow(%27/zh/consumer/dbsw/promotion/index.html?pid=JB_5adbsw_201107dbsw_zh%27,%27DBS%27,%27resizable,scrollbars,status,width=800,height=600%27)';
			break;
		case 'main_dbsw_c':
			document.location = 'javascript:MM_openBrWindow(%27/zh/consumer/dbsw/promotion/index.html?pid=JB_5bdbsw_201107dbsw_zh%27,%27DBS%27,%27resizable,scrollbars,status,width=800,height=600%27)';
			break;
		case 'main_eFNA_c':
			window.open('/zh/consumer/investments/financialplanning/fna/index.html?pid=JB_inv_eFNA_zh');
			break;
		case 'main_td_c':
			document.location = '/zh/consumer/promotion/deposits/20080703_td.html';
			break;
		case 'main_pd_c':
			document.location = '/zh/consumer/promotion/investments/20080714premiumdeposit.htm';
			break;
		case 'main_3g_c':
			document.location = '/zh/consumer/promotion/automatedbankingservices/20080911_3g.htm';
			break;
		case 'main_homeadvice_c':
			document.location = '/zh/consumer/loans/mortgage/homeadvice/';
			break;
		case 'main_mobile_c':
			document.location = '/zh/consumer/promotion/automatedbankingservices/20081020_mobile.html';
			break;
		case 'main_taxloan_zh':
			document.location = '/zh/consumer/loans/unsecuredloans/taxpil/index.html?pid=JB_loan_zh';
			break;
		case 'main_rightissue_c':
			document.location = '/zh/consumer/promotion/loans/20090312_loans.htm';
			break;
		case 'main_RMBdeposit_c':
			document.location = '/zh/consumer/promotion/deposits/20120120rmb.htm?pid=JB_deposit_RMB_zh';
			break;
		case 'main_ibusage_c':
			document.location = '/zh/consumer/promotion/automatedbankingservices/201109_IB_Usage.html?pid=JB_ib_luckydraw_zh';
			break;
		case 'main_plat_c':
			document.location = '/zh/consumer/creditcards/platinum/#1';
			break;
		case 'main_ins_c':
			window.open = '/zh/consumer/promotion/insurance/20090501_medisure_promo.htm';
			break;
		case 'main_ebk_luckydraw_c':
			document.location = '/zh/consumer/promotion/automatedbankingservices/20091201_ecbluckydraw.htm';
			break;
		case 'main_ft_c':
			document.location = '/zh/consumer/creditcards/20090529_cashoffer.html';
			break;
		case 'main_inv_survey_c':
			window.open('http://dbshk4.surveypros.net/survey.php');
			break;
		case 'main_3everyday_c':
			window.open('http://www.compassvisa.com.hk/html/compassvisa_platium_promotion.aspx?lang=zh-HK');
			break;
		case 'main_summerCamp_zh':
			window.open('/zh/consumer/creditcards/diningclub/cardoffer/20110715_summerdining.html?promo=20110715_summerdining_content.html?pid=JB_card_summer_zh&type=monthly&highlight=monthlyPromo15');
			break;
		case 'main_octopus_c':
			window.open('/zh/consumer/automatedbankingservices/octopusatmcard/');
			break;
		case 'main_award_c':
			document.location = '/zh/consumer/201001_award.htm ';
			break;
		case 'main_instalment_c':
			window.open('http://www.compassvisa.com.hk/html/airticket.aspx');
			break;
		case 'main_flexi_c':
			window.open('http://www.compassvisa.com.hk/Channel/Finance/FBISpeLanding.aspx?lang=zh-HK');
			break;
		case 'main_compass_taobao_c':
			window.open('http://www.compassvisa.com.hk/taobao/');
			break;
		case 'main_dailydraw_c':
			document.location = '/zh/consumer/promotion/automatedbankingservices/20100614_ebkdailydraw.htm';
			break;
		case 'main_ebbpdraw_c':
			document.location = '/zh/consumer/promotion/automatedbankingservices/20100501_ebbpdraw.htm';
			break;
		case 'main_bp_offer_c':
			document.location = '/zh/consumer/promotion/automatedbankingservices/201012_eb_bp_offer.htm';
			break;
		case 'main_3x_c':
			window.open('/zh/consumer/creditcards/diningClub/3x/');
			break;
		case 'main_paywave_c':
			window.open('http://www.compassvisa.com.hk/html/paywave0929.aspx');
			break;
		case 'main_compass_tax_c':
			window.open('http://www.compassvisa.com.hk/html/flexitax.aspx?lang=zh-HK');
			break;
		case 'main_diningplanners_c':
			window.open('/zh/consumer/creditcards/diningclub/dbsplanners/');
			break;
		case 'main_eb_DYK_c':
			document.location = '/zh/consumer/promotion/automatedbankingservices/201008_eb_DYK.htm';
			break;
		case 'main_travel_c':
			window.open('/zh/consumer/insurance/promotion/index.html?pid=JB_insu_zh');
			break;
		case 'main_festive_c':
			window.open('/zh/consumer/creditcards/diningclub/si/?201010_core_festive');
			break;
		case 'main_travel_c':
			window.open('/zh/consumer/insurance/promotion/index.html?pid=JB_insu_zh');
			break;
		
		case 'main_inv_securities_c':
			document.location ='javascript:MM_openBrWindow(%27/zh/consumer/promotion/investments/20111114_securities.html?pid=JB_inv_securities_zh%27,%27DBS%27,%27resizable,scrollbars,status,width=720,height=800%27)';
			break;
		default:
			break;
		}
}

