//set the duration for each banner (1000 = 1sec)

var cycleDuration2=3000;

//insert html code stating image source, alt tag and link
var bnrAry2=new Array(
'<img src="/img/hk/creditcards/xmas2007_430x100.jpg" width="620" height="140" border="0" alt="What Joy Will You Bring This Christmas" />',
'<img src="/img/hk/creditcards/bnr_dining_430x100.jpg" width="620" height="140" border="0" alt="DBS Indulge" />', 
'<img src="/img/hk/creditcards/bnr_rewards_430x100.jpg" width="620" height="140" border="0" alt="DBS Rewards" />'
);
//'<a href="/sg/personal/cards/promotions/cards_draw/"><img src="/img/sg/bnr2007/cardsdraw_430x100_011007.gif" width="430" height="100" border="0" alt="The DBS/POSB Winning Cards Draw" /></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";
	}
}
