function TransObject(){
	this.currIndex = 0;
	this.src = new Array();
	this.text = new Array();
	this.target = new Array();
	this.link = new Array();
	this.imgObj = null;
	this.textObj = null;
	this.btnObj = null;
}
TransObject.prototype.getNumber = function(){
	return this.src.length;
}
TransObject.prototype.get = function(member){	
	if(member == "src")
		return this.src[this.currIndex];
	else if(member == "text") 
		return this.text[this.currIndex];
	else if(member == "target")
		return this.target[this.currIndex];
	else if(member == "link")
		return this.link[this.currIndex];
	return null;
}
function setTransition(ba){
   if (document.all){
      ba.filters.revealTrans.Transition=12;
      ba.filters.revealTrans.apply();
   }
}

function playTransition(ba){
   if (document.all)
      ba.filters.revealTrans.play()
}

function nextAd(transObj,func,timerid){
   if(transObj.getNumber() == 0) return ;
   transObj.imgObj.parentElement.href = transObj.get("link");
   transObj.textObj.href = transObj.get("link");
   setTransition(transObj.imgObj);
   transObj.imgObj.src= transObj.get("src");
   transObj.imgObj.alt =  transObj.get("text");
   transObj.textObj.innerHTML= transObj.get("text");
   transObj.textObj.title= transObj.get("text");
   var col = transObj.btnObj.childNodes;
   for(var i=0; i< col.length; i++) {
  	 if(i== transObj.currIndex) col[i].className = "currbtn";
  	 else col[i].className = "button";
   }
   playTransition(transObj.imgObj);
   if(transObj.currIndex <transObj.getNumber()-1)  transObj.currIndex++ ;
      else transObj.currIndex =0;
   eval(timerid +"=setTimeout(func, 3000)");
}
function showAd(transObj,func,index,timerid){
   clearTimeout( eval(timerid));
    transObj.currIndex = index;
   nextAd(transObj,func,timerid);
}