

//Rotating Ads

var currentAdIndex = -1;
var ads = new Array();
var ad = new Object();






var dummyImage = null;

function rotateBannerAd(adIndex)
{
	var waitInMilliseconds = 6000;

	if(ads.length>0)
	{
		if(isNaN(adIndex))
			adIndex = 0;

		var ad = ads[adIndex];
		currentAdIndex = adIndex;

		document.rotateImage.src = ad.img.src;
		document.rotateImage.width = ad.width;
		document.rotateImage.height = ad.height;
		
		if (ad.displayCount == 0)
		{
			dummyImage = new Image();
			dummyImage.src = ad.recordViewURL;
		}
		ad.displayCount = ad.displayCount + 1;

		var newIndex = (adIndex==(ads.length-1)?0:(adIndex+1));
		if (ads.length>1)
			setTimeout("rotateBannerAd(" + newIndex + ")", waitInMilliseconds);
	}
}

function rotateAdClick()
{
	if(currentAdIndex >= 0)
	{
		var ad = ads[currentAdIndex];
		window.open("/bf/ut/uvhba/mem/adClick.jsp?ad_id=" + ad.adId + "&is_global=" + ad.isGlobal);
	}
}

var oldPrimaryAdOnload = "" + window.onload;

if(oldPrimaryAdOnload)
{
	if(oldPrimaryAdOnload.indexOf("rotateBannerAd")==-1)
	{
		oldPrimaryAdOnload = oldPrimaryAdOnload.substring(oldPrimaryAdOnload.indexOf("{")+1,oldPrimaryAdOnload.lastIndexOf("}"));

		window.onload = function doPrimaryAdOnLoad() {
			if(oldPrimaryAdOnload) eval(oldPrimaryAdOnload);
			rotateBannerAd();
		}
	}
}
else
{
	window.onload = function doPrimaryAdOnload() {
		rotateBannerAd();
	}
}

document.write("<table width=\"469\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">");
document.write("<tr>");
document.write("	<td width=\"1\"><img src=\"/bf/ut/uvhba/mem/images/clear.gif\" height=\"60\" width=\"1\"></td>");
document.write("	<td width=\"468\" align=\"center\" class=\"primaryAd\"><a href=\"javascript:void(0);\" onClick=\"rotateAdClick(); return false\" onMouseOver=\"window.status='Visit Ad Website';return true\" onMouseOut=\"window.status='';return true\"><img src=\"/bf/ut/uvhba/mem/images/clear.gif\" border=\"0\" width=\"468\" height=\"60\" name=\"rotateImage\"></a></td>");
document.write("</tr>");
document.write("</table>");
