with(Animation=function(){
	this.Image=document.getElementById('item_image');
	this.Error=(this.Image)?0:0x01;

	Images=document.getElementsByTagName('img');
	this.Images=new Array();
	this.ImageURLs=new Array();
	this.ImagePreviewURLs=new Array();
	this.SelectedURLs=new Array();
	for(i=0;i<Images.length;i++){
		if(
			Images[i].getAttribute('src_a')
			||
			Images[i].getAttribute('src_b')
			||
			Images[i].getAttribute('src_c')
		){
			this.Images.push(Images[i]);
			URLs=new Array();
			URLs.push(Images[i].src);
			if(Images[i].getAttribute('src_a'))URLs.push(Images[i].getAttribute('src_a'));
			if(Images[i].getAttribute('src_b'))URLs.push(Images[i].getAttribute('src_b'));
			if(Images[i].getAttribute('src_c'))URLs.push(Images[i].getAttribute('src_c'));
			this.ImageURLs.push(URLs);
			URLs=new Array();
			if(
				Images[i].getAttribute('src_preview')
				||
				Images[i].getAttribute('src_preview_a')
				||
				Images[i].getAttribute('src_preview_b')
				||
				Images[i].getAttribute('src_preview_c')
			){
				if(Images[i].getAttribute('src_preview'))URLs.push(Images[i].getAttribute('src_preview'));
				if(Images[i].getAttribute('src_preview_a'))URLs.push(Images[i].getAttribute('src_preview_a'));
				if(Images[i].getAttribute('src_preview_b'))URLs.push(Images[i].getAttribute('src_preview_b'));
				if(Images[i].getAttribute('src_preview_c'))URLs.push(Images[i].getAttribute('src_preview_c'));
			}
			this.ImagePreviewURLs.push(URLs);
			this.SelectedURLs.push(0);
		}
	}
	setTimeout('A.Animate()',this.Delay);
}){
	prototype.Image;
	prototype.ImageError=0;

	prototype.Delay=2000;
	prototype.Images;
	prototype.ImageURLs;
	prototype.ImagePreviewURLs;
	prototype.SelectedURLs;

	prototype.Animate=function(){
		for(i=0;i<this.Images.length;i++){
			this.SelectedURLs[i]++;
			this.SelectedURLs[i]%=this.ImageURLs[i].length;
			this.Images[i].src=this.ImageURLs[i][this.SelectedURLs[i]];
			
			if(this.Image){
				for(j=0;j<this.ImagePreviewURLs[i].length;j++){
					if(this.ImagePreviewURLs[i][j]==this.Image.src){
						this.Image.src=this.ImagePreviewURLs[i][this.SelectedURLs[i]];
					}
				}
			}
		}
		setTimeout('A.Animate()',this.Delay);
	}
	
	prototype.SetImage=function(ImageURL,ImageFullURL){
		for(i=0;i<this.ImagePreviewURLs.length;i++){
			if(this.ImagePreviewURLs[i][0]==ImageURL){
				return I.SetImage(this.ImagePreviewURLs[i][this.SelectedURLs[i]],ImageFullURL);
			}
		}
		return I.SetImage(ImageURL,ImageFullURL);
	}
}
