addLoadEvent(function(){
		oFeed.init();
	}
);

var oFeed = {
	
	init : function(){
		this.aItems = [];
		var a = document.getElementById("magentaFeed").getElementsByTagName("a");
		for(var i=0; i<a.length; i++){
			this.aItems[this.aItems.length] = new oMTLib.animation(a[i]);
		}
		this.timeIt();
		this.show();
	},
	
	timeIt : function(){
		window.setInterval("oFeed.show(oFeed.nCurrent++)", 4000)
	},
	
	show : function(){
		if(this.nCurrent == this.aItems.length)this.nCurrent = 0;
		if(this.oActive){
			this.oActive.animation("height", "px", this.oActive.obj.offsetHeight, 0, 100, "linearTween");
			this.oActive.onanimationendheight = function(){
				this.obj.style.position = "absolute";
				this.obj.style.height = "auto";
			};
		}
		this.oActive = this.aItems[this.nCurrent];
		this.oActive.nHeight = this.oActive.obj.offsetHeight;
		document.getElementById("magentaFeed").style.height = this.oActive.nHeight + "px";
		status = document.getElementById("magentaFeed").style.height;
		this.oActive.obj.style.overflow = "hidden";
		this.oActive.animation("height", "px", 1, this.oActive.nHeight, 400, "linearTween");
		this.oActive.obj.style.position = "static";
		this.oActive.onanimationendheight = null;
	},
	nCurrent : 0,
	oActive : null

}

document.write("<style>\n");
document.write("ul#magentaFeed {\n");
document.write("	overflow:hidden;\n");
document.write("}\n");
document.write("ul#magentaFeed li a {\n");
document.write("	position:absolute;\n");
document.write("	left:-5000px;\n");
document.write("	top:0;\n");
document.write("}\n");
document.write("</style>\n");

oMTLib = {}
oMTLib.animation = function(o){	
	this.nDelay = 20;
	this.aCache = []
	return this.initialise(o);
};


oMTLib.animation.prototype = {
	
	initialise	: function(o){
		if(typeof o == 'string'){
			this.sID = o;
			o = document.getElementById(o);
		};
		this.sID = this.sID || (o.id || "animobject" + this.aCache.length);
		if(o.bInitalised) return this.aCache[this.sID];
		o.bInitalised = 1;
		this.obj 		= o;
		this.aCache[this.sID] = this;
		this.aCache[this.aCache.length] = this;
		return this;
	},

	animation : function(sStyle, sUnit, nStart, nEnd, nDuration, sType){
		if(this["_slide" + sStyle]) window.clearInterval(this["_slide" + sStyle]);
		var nTime = 0;
		var _self = this;
		sType = sType || "easeInOutQuad";
		nDuration = nDuration / this.nDelay;
		this["_slide" + sStyle] = window.setInterval(
			function(){
				if(_self.onanimate) _self.onanimate();
				_self.obj.style[sStyle] = _self[sType](nTime++, nStart, nEnd-nStart, nDuration) + sUnit;
				if(nTime >= nDuration){
					_self.obj.style[sStyle] = nEnd + sUnit;
					window.clearInterval(_self["_slide" + sStyle]);
					if(_self["onanimationend" + sStyle]) _self["onanimationend" + sStyle]();
				};
			}
			, this.nDelay);
	},
	
		linearTween : function(t, b, c, d){
			return c*t/d+b;
		}
}