//模块：用随机特效的方式轮显图片
//作者：李超
//修改记录：
//		2006年9月4日		创建

function tranObj(width,height,tran,dur)
{
	this.width = width;
	this.height = height;
	this.tran = tran;
	this.dur = dur;
	this.count = 0;
	this.img = new Array();//图片
	this.url = new Array();//电击图片后指向的链接地址	
	this.target = new Array();//打开的窗口
	this.title = new Array();//图片的标题
	
	this.addImg =function addImgUrl(img,url,title,target){
		this.img[this.img.length] = img;
		this.url[this.url.length] = url;
		this.target[this.target.length] = target;
		this.title[this.title.length] = title;
	}

	this.play = function transition(){

		var s;
		this.count = this.count + 1;
		if(this.count >= this.img.length) this.count = 0;
		lay_tran.filters[0].transition=this.tran;				
		lay_tran.filters[0].Apply();
		s = "<img border=0 class='TranImg' src='"+this.img[this.count]+"' align=center ";
		s = s + " width='" + this.width +"' height='" + this.height + "'>";
		s = '<a href="' + this.url[this.count] + '" target="'+this.target[this.count]+'">' + s;
		s = s +'<br><div>' + this.title[this.count] + '</div></a>';
		lay_tran.innerHTML= s;
		
		lay_tran.filters[0].Play();
		
	
		
	}
	this.showTran = function showTran(){
		document.write('<div id=lay_tran style="FILTER: revealTrans(transition='+this.tran+',duration='+this.dur+');');
		document.write('width:'+this.width+'; height='+this.height+';">');
		document.write('<img class="TranImg" src="'+this.img[0]+'" width="'+this.width+' height="'+this.height+'" >');
		document.write('<br>'+this.title[0]);
		document.write('</div>');
	}



}
