/*
function TextBannerInfo(linkURL, linkText, sid){
	this.linkText = linkText;
	this.linkURL = linkURL;
	this.sid = sid;
}

function TextBannerObject(bArr, divObj, sec){
	this.XmlHttpObject = txtbannerGetXmlHttp_Object();
	this.bannerArray = bArr;
	this.divObject = divObj;
	this.second = sec;
	
	this.i = -1;
	
	this.play = function (){
		if(this.bannerArray.length == 0)return;
		if (this.i == (bArr.length - 1))
		{this.i=0;}
		else
		{this.i++;}
		var textBannerLink = divObj.getElementsByTagName("a");
		
		if(textBannerLink.length > 0){
			textBannerLink[0].filters[0].apply();
			textBannerLink[0].innerText = this.bannerArray[this.i].linkText;
			textBannerLink[0].href = this.bannerArray[this.i].linkURL;
			textBannerLink[0].filters[0].play();
		}
		
		this.XmlHttpObject.open("GET", "ad/onlinetime.html?sid=" + this.bannerArray[this.i].sid, false);
	    this.XmlHttpObject.setRequestHeader("If-Modified-Since","0");
		this.XmlHttpObject.send("");
	}
}

function txtbannerGetXmlHttp_Object(){
	var isIE=document.all?1:0;
	
	var xmlhttp = null; 
	
	if(isIE){
		try { 
		    xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); 
		}catch(e){ 
		    try { 
		        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); 
		    }catch(e2){} 
		} 
	}else{
		xmlhttp = new XMLHttpRequest();
	}
	return xmlhttp;
}

*/

function textBannerControl(){
	this.banners = new Array();
	
	this.add = function (bArr, divObj, sec){
		this.banners.push(new TextBannerObject(bArr, divObj, sec));
	}
	
	this.play = function (){
		for(var i=0; i<this.banners.length; i++){
			tdoPlay(i, this.banners[i].second);
		}
	}
}

function tdoPlay(index, sec){
	textBannerInterval = window.setInterval(function(){tbControl.banners[index].play();}, sec * 1000);
}

var textBannerInterval = null;
var tbControl = new textBannerControl();
