var kaskusTickler={
	scID:'',
	delay:4000, 
	maxsteps:30,
	stepdelay:100, 
	startcolor:new Array(255,255,255),
	endcolor:new Array(0,0,0),
	
	begintag:'<div style="padding: 3px;" onmouseover="kaskusTickler.Mousein();" onmouseout="kaskusTickler.Mouseout();"><table cellpadding=0 cellspacing=0 border=0 id="Textatasis"><tr><td><div style="cursor:pointer; padding-top:3px;" onclick="kaskusTickler.Next(0);"><img src="newhomeimages/arrleft.gif" border="0"/></div></td><td><div style="cursor:pointer; padding-top:3px;" onclick="kaskusTickler.Next(1);"><img src="newhomeimages/arrright.gif" border="0"/></div></td><td valign="middle">',
	fcontent:new Array(),
	closetag:'</td></tr></table></div>',
	fadelinks:1,
	ie4:(document.all && !document.getElementById),
	DOM2:document.getElementById,
	faderdelay:30,
	index:0,
	curIndex:0,
	contentChanger:0,
	fadecounter:0,
	ticklerHover:false,
		
	Mousein:function(){
		this.ticklerHover = true;
		clearTimeout(this.fadecounter);
		clearTimeout(this.contentChanger);
		document.getElementById(this.scID).style.color="rgb("+this.endcolor[0]+", "+this.endcolor[1]+", "+this.endcolor[2]+")";
	},
		
	Mouseout:function(){
		this.ticklerHover = false;
		this.index++;
		this.contentChanger = setTimeout("kaskusTickler.changecontent()", this.delay);
	},
		
	Next:function(nx){
		if(nx==1)
			this.curIndex++;
		else
			this.curIndex--;
		if(this.curIndex >= this.fcontent.length)
			this.curIndex = 0;
		else if(this.curIndex < 0)
			this.curIndex = this.fcontent.length - 1;
		this.index = this.curIndex;
		this.changecontent();
	},
		
	changecontent:function(){
	  if (this.index >= this.fcontent.length)
			this.index=0;
		this.curIndex = this.index;
		
	  if (this.DOM2){
		document.getElementById(this.scID).style.color="rgb("+this.startcolor[0]+", "+this.startcolor[1]+", "+this.startcolor[2]+")";
		document.getElementById(this.scID).innerHTML=this.begintag+this.fcontent[this.index]+this.closetag;
		if (this.fadelinks)
		  this.linkcolorchange(1);
			this.colorfade(1);
	  }
	  else if (this.ie4)
			document.all[this.scID].innerHTML=this.begintag+this.fcontent[this.index]+this.closetag;
		if(!this.ticklerHover)
	  this.index++;
	},
				
	linkcolorchange:function(step){
	  var obj=document.getElementById(this.scID).getElementsByTagName("A");
	  if (obj.length>0){
		
			for (i=0;i<obj.length;i++){
				obj[i].style.color=this.getstepcolor(step);
			}
			
	  }
	},
		
		
	colorfade:function(step) {
	  if(step<=this.maxsteps) {	
		document.getElementById(this.scID).style.color=this.getstepcolor(step);
		if (this.fadelinks)
		  this.linkcolorchange(step);
			step++;
			this.fadecounter=setTimeout("kaskusTickler.colorfade("+ step+")",this.stepdelay);
	  }else{
			clearTimeout(this.fadecounter);
			document.getElementById(this.scID).style.color="rgb("+this.endcolor[0]+", "+this.endcolor[1]+", "+this.endcolor[2]+")";
		if(!this.ticklerHover)
			this.contentChanger = setTimeout("kaskusTickler.changecontent()", this.delay);
	  }   
	},
		
	getstepcolor:function(step){
	  var diff;
	  var newcolor=new Array(255,255,255);
	  for(var i=0;i<3;i++) {
			diff = (this.startcolor[i] - this.endcolor[i]);
			if(diff > 0) {
			  newcolor[i] = this.startcolor[i] - (Math.round((diff/this.maxsteps))*step);
			} else {
			  newcolor[i] = this.startcolor[i] + (Math.round((Math.abs(diff)/this.maxsteps))*step);
			}
	  }
	  return ("rgb(" + newcolor[0] + ", " + newcolor[1] + ", " + newcolor[2] + ")");
	},
	
	init:function(scrollID){
		this.scID = scrollID;
		this.changecontent();
		
		/*
		if (window.addEventListener)
		window.addEventListener("load", this.changecontent, false)
		else if (window.attachEvent)
		window.attachEvent("onload", this.changecontent)
		else if (document.getElementById)
		window.onload=this.changecontent
		*/
	}
}