	function picRotator()
	{
		this.curPicIndex = 0;
		this.curOpVal = 1;
		this.curInterval = 100;
		this.curChangeValue = 0.01;
		//this.picList = new Array();
		this.isAnimating = false;
		this.targetObj = "";
		this.state = 1;
		this.cycleTag = 0;
		this.fadeInGap = 0.2;
		this.fadeOutGap = 0.5
	}
	picRotator.prototype.Init = function(arPics)
	{
		this.picList = arPics;
		this.curPicIndex = this.picList.length;
		this.ChangePic();
	}
	picRotator.prototype.ChangePic = function()
	{
		if(this.targetObj == "")
			return false;
		
		this.curPicIndex++;
		if(this.curPicIndex >= this.picList.length)
		{
			this.curPicIndex = 0;
		}
		this.targetObj.src = this.picList[this.curPicIndex].src;
	}
	picRotator.prototype.Play = function ()
	{
		if(this.state == 1 ){
			//start fade in
			if(this.curOpVal>=(1+this.fadeOutGap))
			{
				if(this.cycleTag == 1)
				{
					this.ChangePic();
					this.cycleTag = 0;
				}else{
					this.cycleTag = 1;
				}
				this.state = 0;
				this.Play();
				return;
			}else{
				//show effect with change
				this.curOpVal += this.curChangeValue;
			}
		}else{
			//start fade out
			if(this.curOpVal<=(0-this.fadeInGap))
			{
				if(this.cycleTag == 1)
				{
					this.ChangePic();
					this.cycleTag = 0;
				}else{
					this.cycleTag = 1;
				}
				this.state = 1;
				this.Play();
				return;
			}else{
				//show effect with change
				this.curOpVal -= this.curChangeValue;
			}
		}
		this.setOpacity();
	}
	picRotator.prototype.OK = function(){
	}
	picRotator.prototype.setOpacity = function()
	{
		if(this.targetObj == "")
		{
			alert("Target Obj not defined."+ this.targetObj);
			return;
		}
		if(this.curOpVal>=-0 && this.curOpVal<=1){
		    this.targetObj.style.opacity = (this.curOpVal);
		    this.targetObj.style.MozOpacity = (this.curOpVal);
		    this.targetObj.style.KhtmlOpacity = (this.curOpVal);
		    if(this.targetObj.style.filters)
			    this.targetObj.style.filters.alpha.opacity = this.curOpVal*100;
		    this.targetObj.style.filter = "alpha(opacity=" + this.curOpVal*100 + ")";
		}
	}
	picRotator.prototype.SetTarget = function(myObj)
	{
		var ele = document.getElementById(myObj);
		if(ele == undefined)
		{
			return;
		}
		this.targetObj = document.getElementById(myObj);
	}
