/*
var jjs = document.getElementById("ss")
if(jjs.src!=null && jjs.src!="")
{
	if(jjs.src.indexOf("type=a"))
	{
		
	}
}
*/
var _si = window.setInterval;

window.setInterval=function(fRef, mDelay) {
 if(typeof fRef == 'function'){
  var argu = new Array();
  for(var i=2;i<3;i++)
  {
	argu[i-2] = Array.prototype.slice.call(arguments,i);
  }
  var f = (function(){ fRef.apply(null, argu); });
  return _si(f, mDelay);
 }
 return _si(fRef,mDelay);
}


function RoundDiv()
	{
		this.parent=null;
		this.childs=null;
		this.runAble = true;
		this.curPlay = 0;
		this.showStyle;
		this.hiddenStyle;
		//this.waitInterval=window.setInterval;
		
	}
	RoundDiv.prototype.Init=function(parent,showStyle,hiddenStyle)
		{
			//alert(typeof(parent));
			if(typeof parent =="object")
			{
				this.parent=parent;
				//alert(this.parent.id)
			}
			else
			{
				this.runAble=false;
				alert("error!");
			}

			var tmp = parent.childNodes;
			if(tmp.length<1)
			{
				this.runAble=false;
			}
			else
			{
				var cs = new Array();
				for(var i = 0; i<tmp.length;i++)
				{
					cs.push(tmp[i]);
					
				}
				this.childs = cs;
			}

			if(showStyle==null || hiddenStyle==null || showStyle=="" || hiddenStyle=="")
			{
				alert("请给两种样式");
				this.runAble=false;
			}
			else
			{
				this.showStyle=showStyle;
				this.hiddenStyle=hiddenStyle;
			}
			//alert(this.childs.length)
			
		}
	RoundDiv.prototype.play=function(cur)
	{
		c=cur[0];
		if(c.runAble && c!=null)
		{
			//this.waitInterval=null;
			//this.waitInterval=window.setInterval(this.play,6000)
			var curNum = c.curPlay
			var nextNum =curNum+1;
			if(nextNum>=c.childs.length)
			{
				//curNum=0;
				nextNum=0;
			}
			c.childs[curNum].className=c.hiddenStyle;
			c.childs[nextNum].className=c.showStyle;
			c.curPlay=nextNum;
			
			
		}
		
		
	}


