function $(id){return document.getElementById(id)}

var tiny={};

tiny.slideshow=function(n){this.n=n; this.c=0; this.a=[]};

tiny.slideshow.prototype={
	init:function(n,z){
		var u=document.getElementById(n), m=u.getElementsByTagName('img'), i=0;
		this.f=document.getElementById(z); this.l=m.length;
		for(i;i<this.l;i++){
			this.a[i]={}; var h=m[i]; this.a[i].p=h.src
		}
		this.is(Math.floor(Math.random()*(this.l-1)))
	},
	mv:function(d){var t=this.c+d; this.c=t=t<0?this.l-1:t>this.l-1?0:t; this.pr(t)},
	pr:function(t){
		clearTimeout(this.lt);
		this.c=t;
		this.is(t)
	},
	is:function(s){
		var i=document.createElement('img');
		i.style.opacity=0;
		i.style.filter='alpha(opacity=0)';
		this.i=i;
		i.onload=new Function(this.n+'.le('+s+')');
		i.src=this.a[s].p;
	},
	ad:function(){
		this.at=setTimeout(new Function(this.n+'.mv(1,false)'),5000)
	},
	le:function(s){
		this.f.appendChild(this.i);
		tiny.alpha.set(this.i,100,10);
		this.ad()
		this.cl()
	},
	cl:function(){
		var m=this.f.getElementsByTagName('img');
		if(m.length>2){this.f.removeChild(m[0])}
	}
};

tiny.alpha=function(){
	return{
		set:function(e,a,s,k){
			e=typeof e=='object'?e:tiny.$(e); var o=e.style.opacity||tiny.style.val(e,'opacity'),
			d=a>o*100?1:-1; e.style.opacity=o; clearInterval(e.ai); e.ai=setInterval(function(){tiny.alpha.tw(e,a,d,s,k)},20)
		},
		tw:function(e,a,d,s,k){
			var o=Math.round(e.style.opacity*100);
			if(o==a){clearInterval(e.ai); if(k){e.style.display='none'}}else{var n=o+Math.ceil(Math.abs(a-o)/s)*d; e.style.opacity=n/100; e.style.filter='alpha(opacity='+n+')'}
		}
	}
}();

tiny.style=function(){return{val:function(e,p){return e.currentStyle?e.currentStyle[p]:document.defaultView.getComputedStyle(e,null).getPropertyValue(p)}}}();