function BigBannerClass(CanObj){ //CanObj用于存储图像的容器
	
	this.imgCan=CanObj;
	this.imgWidth=0;
	this.imgHeight=0;
	this.imgCount=0;//图片数量，不要改动这个值
	this.imgArray=new Array(); //图片缓存数组
	this.imgGoURL=new Array(); //图片超链接
	this.play=true;	//是否播放
	this.currentNum=1;//当前图片号
	this.aTarget="_self";
	this.theTimer=null;
	this.timeOut=8000;
	//this.StatusChange=pcallback;	//状态改变回调过程(未完成)
	
	//初始化共享变量
	if(typeof BigBannerClass._initShareVar == "undefined"){
		BigBannerClass.prototype.instanceCount=0; //初始化实例数
		BigBannerClass.prototype.instanceArray=new Array(); //保存实例数组
		BigBannerClass._initShareVar=true;
	}
	BigBannerClass.prototype.instanceCount++;
	this.hwnd=BigBannerClass.prototype.instanceCount; //窗口句柄用于窗口代码回调使用
	BigBannerClass.prototype.instanceArray[this.hwnd]=this; //保存实例引用
	//变量初始化完毕
	
	//初始化共享方法用于减少内存使用
	if(typeof BigBannerClass._initialized == "undefined"){
		BigBannerClass.prototype.show=function(){ //显示窗口
			var HtmlCode="<div style='width:"+(this.imgWidth+2)+";margin:0px;padding-bottom:0px;padding-left:0px;padding-right:0px;height:"+(this.imgHeight)+";padding-top:0px' onmouseover='BigBannerClass.CallFunc("+this.hwnd+",\"stop\",null)' onmouseout='BigBannerClass.CallFunc("+this.hwnd+",\"play\",null)'>";
			HtmlCode+="<a href='"+this.imgGoURL[0]+"' target='"+this.aTarget+"' id='BigBannerClass_AHREF"+this.hwnd+"'>";
			HtmlCode+="<img src='"+this.imgArray[0].src+"' id='BigBannerClass_img"+this.hwnd+"' width='"+this.imgWidth+"' height='"+this.imgHeight+"' style='border: 0px solid #A6C9E1;'>";
			HtmlCode+="</a>";
			HtmlCode+="<div style='overflow:hidden;margin-top:-18px;'>";
			HtmlCode+="<div style='text-align:right;left:0px;margin-right:10px;'>";
			HtmlCode+="<a style='width:50px; background-color:#000;filter : progid:DXImageTransform.Microsoft.Alpha(startX=0, startY=0, finishX=100, finishY=100,style=1,opacity=0,finishOpacity=40);'></a>";
			for(var i=1;i<=this.imgCount;i++){
				HtmlCode+="<a id='BigBannerClass"+this.hwnd+"link"+i+"' href='javascript:BigBannerClass.CallFunc("+this.hwnd+",\"nextImg\","+i+")' style='cursor:hand;text-decoration: none;padding: 2px 7px;background: #7B7B63;margin: 0px;font: bold 9px sans-serif; border-left:#fff 1px solid;' onFocus='this.blur()'>"+i+"</a>";
			}
			HtmlCode+="</div>";
			HtmlCode+="</div>";
			HtmlCode+="</div>";
			this.imgCan.innerHTML=HtmlCode;
			document.getElementById("BigBannerClass"+this.hwnd+"link1").style.background="#f60";
			this.playImg();
		}
		
		BigBannerClass.prototype.addImg=function(pURL,pnURL){ //添加图片及超链接
			this.imgArray[this.imgCount]=new Image(); 
			this.imgArray[this.imgCount].src=pURL;
			this.imgGoURL[this.imgCount]=pnURL;
			this.imgCount++;
		}
		
		BigBannerClass.prototype.nextImg=function(pn){ //显示下一幅图画
			for(var i=1;i<=this.imgCount;i++){
				document.getElementById("BigBannerClass"+this.hwnd+"link"+i).style.background="#7B7B63";
			}
			document.getElementById("BigBannerClass"+this.hwnd+"link"+pn).style.background="#f60";
			document.getElementById("BigBannerClass_img"+this.hwnd).src=this.imgArray[pn-1].src;
			document.getElementById("BigBannerClass_AHREF"+this.hwnd).href=this.imgGoURL[pn-1];
		}
		
		
		BigBannerClass.prototype.playImg=function(){		//播放动画
			var temp=this;
			this.theTimer=setTimeout(function(){temp.timerCallBack();},this.timeOut);
		}
		
		BigBannerClass.prototype.stopImg=function(){   //停止播放
			if(this.theTimer==null)return;
			clearTimeout(this.theTimer);
		}

		//计时器回调
		BigBannerClass.prototype.timerCallBack=function(){
				if(this.currentNum<this.imgCount)this.currentNum++;
				else this.currentNum=1;
				this.nextImg(this.currentNum);
				var temp=this;
				this.theTimer=setTimeout(function(){temp.timerCallBack();},this.timeOut);
		};

		//静态方法调用函数
		BigBannerClass.CallFunc=function(pHwnd,pFuncName,pPara){
			if(pFuncName=="nextImg"){
				BigBannerClass.prototype.instanceArray[pHwnd].nextImg(pPara);
			}else if(pFuncName=="stop"){
				BigBannerClass.prototype.instanceArray[pHwnd].stopImg();
			}else if(pFuncName=="play"){
				BigBannerClass.prototype.instanceArray[pHwnd].playImg();
			}
		};
		
		BigBannerClass._initialized = true; 
	}
}
