//set the duration for each banner (1000 = 1sec)
var cycleDuration=3000;

//insert html code stating image source, alt tag and link
var bnrAry=new Array(
'<a href="/me/"><img src="/img/sg/bnr2006/131x65_me.gif" alt="ME" width="131" height="65" border="0" /></a>', 
'<a href="/sg/realtyeasy/"><img src="/img/sg/bnr2006/131x65_realtyeasy.gif" alt="RealtyEasy" width="131" height="65" border="0" /></a>',
'<a href="/sg/personal/rewards/"><img src="/img/sg/bnr2009/rewards_131x65.jpg" alt="DBS Rewards" width="131" height="65" border="0" /></a>',
'<a href="/sg/dining/"><img src="/img/sg/bnr2007/131x65_indulge.gif" alt="DBS Indulge" width="131" height="65" border="0" /></a>',
'<a href="/sg/personal/cards/travel/"><img src="/img/sg/bnr2008/131x65_travel.gif" alt="Travel" width="131" height="65" border="0" /></a>',
'<a href="/sg/personal/cards/healthcare/"><img src="/img/sg/bnr2007/131x65_healthcare.gif" alt="DBS Healthcare Privileges" width="131" height="65" border="0" /></a>');

/********** Don't change beyond this point **********/

var intCount, bnrHolder, timer;
_spBodyOnLoadFunctionNames.push("bnrCycle");
function bnrCycle(imgNum) {
	clearTimeout(timer);
	if (imgNum) intCount=imgNum-1; 
	else intCount=0; //reset banner queue
	//i=0; //reset banner queue
	bnrHolder=document.getElementById("rightnavLifestyleBnr");

	if (bnrHolder) {
		doCycle();
	}
}
function doCycle() {
	// RLR - Randell L. Rivera - Update code to be compatible with IE.
	var pnlBanner = document.createElement("span");
	pnlBanner.innerHTML = bnrAry[intCount];
	bnrHolder.removeChild(bnrHolder.firstChild);
	bnrHolder.appendChild(pnlBanner);
	(intCount==bnrAry.length-1)? intCount=0 : intCount++; //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++;
	//setTimeout("doCycle()", cycleDuration);
	timer = setTimeout("doCycle()", cycleDuration);
}
