//set the duration for each banner (1000 = 1sec)
var cycleDuration3=3000;
var cycleDuration4=3000;

//insert html code stating image source, alt tag and link
var bnrAry3=new Array(
'<a href="/treasures/sg/beat/" ><img src="/img/hk/131x65_marketbeat.gif" border="0" /></a>',
'<a href="/sg/personal/cards/womans/promotions/facetoct/" ><img src="/img/hk/131x65_facetoct.gif" border="0" /></a>' );

var bnrAry4=new Array(
'<a href="/sg/personal/cards/womans/promotions/facetoct/" ><img src="/img/hk/131x65_facetoct.gif" border="0" /></a>',
'<a href="/treasures/sg/beat/" ><img src="/img/hk/consumer/main07_loan.gif" border="0" /></a>' );

/********** Don't change beyond this point **********/

var k, j, bnrHolder3, bnrHolder4, timer3, timer4;
function bnrCycle3() {

	clearTimeout(timer3);
	k=0; //reset banner queue
	bnrHolder3=document.getElementById("rightnavPromotionBnr3");
	doCycle3();
}

function bnrCycle4() {
	clearTimeout(timer4);
	j=0; //reset banner queue
	bnrHolder4=document.getElementById("rightnavPromotionBnr4");
	doCycle4();
}

function doCycle3() {
	bnrHolder3.innerHTML = bnrAry3[k];
	(k==bnrAry3.length-1)? k=0 : k++; //if this is the last banner in the array, reset to first banner, else go to next banner
	//if (i==bnrAry.length-1) i=0; else i++;
	timer3=setTimeout("doCycle3()", cycleDuration3);
}

function doCycle4() {
	bnrHolder4.innerHTML = bnrAry4[j];
	(j==bnrAry4.length-1)? j=0 : j++; //if this is the last banner in the array, reset to first banner, else go to next banner
	//if (i==bnrAry.length-1) i=0; else i++;
	timer4=setTimeout("doCycle4()", cycleDuration4);
}