var Slide=function(){
				return {		
					clarityDgree:0,
					opacityDgree:100,
					images:null,
					start:0,
					end:0,
					persistTime:3000,
					countLoop:null,
					opacityLoop:null,
					run:function(containerID,persistTime){
						//初始化images
						if(containerID)
						{
							this.images=document.getElementById(containerID).getElementsByTagName("img");
							this.end=this.images.length-1;
						}
						//覆盖默认停留时间
						if(persistTime)
						{
							this.persistTime=persistTime;	
						}
						//校验是否具有images属性值
						if(!this.images)
							throw "Can't find any images!";
						//从最第一张图开始渐显图片
						this.images[this.start].style.filter="alpha(opacity="+this.clarityDgree+")"
						this.images[this.start].style.opacity=this.clarityDgree/100;
						//渐隐当前焦点图片的前一张图片
						var temp=this.start==0 ? this.images.length-1 : this.start-1;
						this.images[temp].style.filter="alpha(opacity="+this.opacityDgree+")";
						this.images[temp].style.opacity=this.opacityDgree/100;
						//循环变量改变
						this.clarityDgree+=1;
						this.opacityDgree-=1;
						//检查是否需要重复调用
						if(this.clarityDgree>100)
						{
							this.clarityDgree=0;
							this.opacityDgree=100;
							this.start==this.end ? this.start=0 :this.start+=1;							
							this.countLoop=setTimeout("Slide.run()",this.persistTime);
						}
						else
							this.opacityLoop=setTimeout("Slide.run()",1);
					},
					pause:function(){
						if(this.opacityLoop)
							clearTimeout(this.opacityLoop);
						if(this.countLoop)
							clearTimeout(this.opacityLoop);
					}
				};
			}();
window.onload=function(){Slide.run("aa",10000)};

