//set the duration for each banner (1000 = 1sec)

var cycleDuration2=11000;

//insert html code stating image source, alt tag and link
var bnrAry2=new Array(
'<a href="/en/consumer/promotion/deposits/20120120rmb.htm"><img src="/img/hk/consumer/20120201_RMBdeposit_e.gif" width="620" height="140" border="0" /></a>',
'<a href="/en/consumer/promotion/deposits/20111026_atmoctopus.html"><img src="/img/hk/consumer/20111026_octopus_en.gif" width="620" height="140" border="0" /></a>'
);
//'<a href="/en/consumer/dbsw/promotion/index.html?pid=JB_deposit_201107dbsw_zh"><img src="/img/hk/dbsw/20110929_dbsw_620x140_e.gif" width="620" height="140" border="0" /></a>'//'<a href="/en/consumer/promotion/deposits/20110118_mysavings.html"><img src="/img/hk/promotion/20110118_mysavings_01_en.jpg" width="620" height="140" border="0" /></a>',

//'<a href="/en/consumer/promotion/deposits/20100323_rmb.htm"><img src="/img/hk/promotion/20100323_rmb_top_e.gif" width="620" height="140" border="0" /></a>',
//'<a href="/en/consumer/promotion/automatedbankingservices/20091201_ecbluckydraw.htm"><img src="/img/hk/consumer/main_ebk_luckydraw.gif" width="620" height="140" border="0" /></a>',
//'<a href="javascript:MM_openBrWindow(%27/en/consumer/promotion/automatedbankingservices/20090901_ecbluckydraw.htm%27,%27DBS%27,%27resizable,scrollbars,status,width=800,height=600%27)"><img src="/img/hk/consumer/main_ebk_luckydraw.gif" width="620" height="140" border="0" /></a>',
//'<a href="/en/consumer/promotion/deposits/20090810_rmb.htm"><img src="/img/hk/promotion/20090807_rmb_top_e.gif" width="620" height="140" border="0" /></a>',			  
//'<a href="/en/consumer/promotion/deposits/20090702_treasures_td.htm"><img src="/img/hk/promotion/20090702_treasuetb_jumbo_e.gif" width="620" height="140" border="0" /></a>'


/********** Don't change beyond this point **********/

var i2, bnrHolder2, timer2;
function bnrCycle2(imgNum) {
	clearTimeout(timer2);
	if (imgNum) i2=imgNum-1; 
	else i2=0; //reset banner queue
	bnrHolder2=document.getElementById("landingPageBnr");
	doCycle2();
}
function doCycle2() {
	bnrHolder2.innerHTML = bnrAry2[i2]; //update banner
	highlightNum2(i2); //highlight selected number
	(i2==bnrAry2.length-1)? i2=0 : i2++; //if this is the last banner in the array, reset to first banner, else go to next banner
	//if (i2==bnrAry2.length-1) i2=0; else i2++;
	timer2 = setTimeout("doCycle2()", cycleDuration2);
}
function highlightNum2(i2) {
	for (var j=1; j<bnrAry2.length+1; j++) { //run thru number of elements, eg. 1-4
		var landingPageBnrNum = 'landingPageBnrNum' + j.toString();
		if (j==i2+1) document.getElementById(landingPageBnrNum).style.fontWeight = "bold";
		else document.getElementById(landingPageBnrNum).style.fontWeight = "normal";
	}
}
