function trans(myname, myid)
{
	var name = myname;
	var text = new Array();	
	var active = -1;
	var len = 0;
	var delay = 1000;	
	var myInter = null;	
	var theid = myid;
	this.set_delay = function(thedelay){delay = thedelay;}
	this.set_text = function(txt){text[len++] = txt;}
	this.show = function(){if(!theid)return;active = (active + 1) % len;if(document.all && theid.filters && theid.filters.revealTrans){theid.filters.revealTrans.Transition = Math.floor(Math.random() * 23);theid.filters.revealTrans.apply();}theid.innerHTML = text[active];if(document.all && theid.filters && theid.filters.revealTrans){theid.filters.revealTrans.play();};}
	this.start = function(){myInter = window.setInterval(this.show, delay);}
	this.stops = function(){window.clearInterval(myInter);}
	this.init = function(){this.show();theid.onmouseover = function(){eval(name + ".stops();");};theid.onmouseout = function(){eval(name + ".start();");};this.start();}
}

function ad_delay(myName, myElem, myScrollAmount, myScrollDelay)
{
	var name = myName;							//ÊµÀýÃû³Æ
	var elem = myElem;							
	var scrollamount = myScrollAmount;
	var scrolldelay = myScrollDelay;
	var div = elem.getElementsByTagName("div")[0];
	
	var boxheight = elem.offsetHeight;
	var divheight = div.offsetHeight;
	
	var inter = null; 
	var time = null;
	
	var counter = 0;
	var account = 0;
	
	this.play = function(){if(boxheight >= divheight * 2)return;div.innerHTML += div.innerHTML;window.setTimeout(name + ".start()", scrolldelay);}
	
	this.start = function(){
		account ++;
		counter ++;
		if(counter < scrollamount)
		{
			account = account % divheight;
			elem.scrollTop = account;
			window.setTimeout(name + ".start()", 20);
		}
		else
		{
			counter = 0;
			window.setTimeout(name + ".start()", scrolldelay);
		}
		
	}
	
	this.stops = function(){}
	
	this.play();
}

function newEvent()
{
	var oEventUtil = new Object();
	oEventUtil.AddEventHandler = function(oTarget, sEventType, fnHandler){if(oTarget.addEventListener){oTarget.addEventListener(sEventType,fnHandler,false);}else if(oTarget.attachEvent){oTarget.attachEvent('on' + sEventType,fnHandler);}else{oTarget['on'+sEventType] = fnHandler;}}
	return oEventUtil;
}