<!--
function getRealPos(i)
{ for(x=y=0;i!=null;i=i.offsetParent) x+=i.offsetLeft,y+=i.offsetTop;this.x=x;this.y=y; }

var BANROT_MAXIMG=10;
var iCurBan,iNextBan=-1,iBanMax=0,iBanTimer=0,iBanSwf=-1,
    sFirstLink="0",sBanPath,asBanList,objPreload,objImg,objSwf;
function BannerRotation(sImgList,sRelPath,ctlImg,iDelay)
{	var iColonPos,sCurImg;
	if(sImgList!=null) { iNextBan=-1; } //Reset or Init
	//alert("il:"+String(typeof(sImgList))+" nb:"+String(iNextBan)+" rp:"+String(sRelPath)+" img:"+String(ctlImg)+" delay:"+String(iDelay));
	
	if(iNextBan<0)
	{	if(sImgList==null || sImgList=="") return true;
		asBanList=String(sImgList).split(",",10);iBanMax=asBanList.length;sBanPath=sRelPath;
		sCurImg=asBanList[iCurBan=iNextBan=Math.floor(Math.random()*iBanMax)];
		if((iColonPos=sCurImg.indexOf(":"))>0) { sFirstLink=sCurImg.substr(iColonPos+1);sCurImg=sCurImg.substr(0,iColonPos); }
		objPreload=new Image();objPreload.src=sBanPath+sCurImg;
		objImg=ctlImg;
		if(iBanTimer) window.clearInterval(iBanTimer); iBanTimer=window.setInterval(BannerRotation,iDelay,null);
	}
	
	if((sExt=objPreload.src.substr(objPreload.src.lastIndexOf('.')))=='.gif' ||
		sExt=='.jpg' || sExt=='.jpeg' || sExt=='.png')
	//TODO: improve caching
	{	objImg.src=objPreload.src;
		objImg.style.visibility='visible';if(objSwf) objSwf.style.visibility='hidden';
	}
	else if(sExt=='.swf')
	{	if(iBanSwf<0) document.write(
			"<EMBED ID=bannerswf SRC='"+objPreload.src+"?clickTAG=http://"+sFirstLink+"'"+
			" WIDTH=1 HEIGHT=1 QUALITY=high TYPE='application/x-shockwave-flash'></EMBED>");
		iBanSwf=iCurBan;
		
		if(!objSwf) objSwf=document.getElementById('bannerswf');
		pos=new getRealPos(objImg);
		objSwf.style.position='absolute'; objSwf.style.left=pos.x; objSwf.style.top=pos.y;
			//objSwf.style.posLeft=pos.x;objSwf.style.posTop=pos.y;
		objSwf.style.width=objImg.width; objSwf.style.height=objImg.height;
		objSwf.style.visibility='visible'; objImg.style.visibility='hidden';
	}
	
	iCurBan=iNextBan++;iNextBan%=iBanMax;sCurImg=asBanList[iNextBan];
	if((iColonPos=sCurImg.indexOf(":"))>0) sCurImg=sCurImg.substr(0,iColonPos);
	objPreload.src=sBanPath+sCurImg;
	return false;
}

function BannerClick()
{	if(iNextBan<0) return true; // Not inited
	
	var iColonPos,sCurLink=asBanList[iCurBan];
	if((iColonPos=sCurLink.indexOf(":"))>0) 
	{	sCurLink=sCurLink.substr(iColonPos+1);
		if(sCurLink.charAt(0)!="/" && sCurLink.indexOf("://")==-1) 
			sCurLink="http://"+sCurLink
		window.open(sCurLink,"joynt_bannerad");
	}
	return false;
}
//-->