var images = {
	img : [],
	pointer:0,
	frame:"",
	timer:"",
	statu:false,
	init : function (id){
		this.frame = document.getElementById(id);
		if(!window.ActiveXObject){
			//this.img=document.getElementsByName('imgshow');
			this.img = this.frame.childNodes;
		}else{
			var child=this.frame.childNodes;
			for(var i=0;i<child.length;i++){
				if(child[i].getAttribute('title')=='imgshow'){
					this.img.push(child[i]);
				}
			}
		}
		this.show();
		this.play();
	},
	show:function(){
		for(var i=0;i<this.img.length;i++){
			this.img[i].style.display = "none";
		}
		this.img[this.pointer].style.display = "";
		document.getElementById('dlcount').innerHTML=this.pointer+1 + "/" +this.img.length;
	},
	next:function (b){
		this.pointer+=1;
		if(this.pointer>=this.img.length){
			this.pointer=0;
		}
		this.show();
		if(!b)this.clearTimer();
	},
	previous:function(){
		this.pointer-=1;
		if(this.pointer<0){
			this.pointer=this.img.length-1;
		}
		this.show();
		this.clearTimer();
	},
	clearTimer :function(){
		clearInterval(this.timer);
		this.statu=true;

		document.getElementById('btn_play').src="http://www.aiongold365.com/themes/default/images/pause.gif";

	},
	play:function(){
		var img_play=document.getElementById('btn_play');
		if(this.statu){
			this.clearTimer();
			this.statu=true;

			img_play.src="http://www.aiongold365.com/themes/default/images/pause.gif";

		}else{
			this.timer = setInterval('images.next(true)',3000);
			this.statu=false;

			img_play.src="http://www.aiongold365.com/themes/default/images/play.gif";

		}
	}
};
function next(){
	images.next(false);
}
function previous(){
	images.previous();
}
function play(o){
	if(images.statu){
		images.statu=false;
	}else{
		images.statu=true;
	}
	images.play(o);
}
window.onload = function(){
	images.init('adv');
}

function transImg(obj,enable)	{
		obj.filters.blendtrans.Apply();
		obj.filters[0].enabled=enable;
		obj.filters.blendtrans.Play();
	}