var TINY={};

function $(i){return document.getElementById(i)}
function $$(e,p){p=p||document; return p.getElementsByTagName(e)}

TINY.slideshow=function(n){
	this.infoSpeed=this.imgSpeed=this.speed=10;
	this.thumbOpacity=this.navHover=70;
	this.navOpacity=25;
	this.scrollSpeed=5;
	this.letterbox='#000';
	this.n=n;
	this.c=0;
	this.a=[]
};

TINY.slideshow.prototype={
	init:function(s,z,b,f,q){
		s=$(s);
		var m=$$('li',s), i=0, w=0;
		this.l=m.length;
		this.q=$(q);
		this.f=$(z);
		this.r=$(this.info);
		this.o=parseInt(TINY.style.val(z,'width'));
		if(this.thumbs){
			var u=$(this.left), r=$(this.right);
			u.onmouseover=new Function('TINY.scroll.init("'+this.thumbs+'",-1,'+this.scrollSpeed+',"'+this.left+'")');
			u.onmouseout=new Function('TINY.scroll.cl("'+this.thumbs+'","'+this.left+'")');
			r.onmouseover=new Function('TINY.scroll.init("'+this.thumbs+'",1,'+this.scrollSpeed+',"'+this.right+'")'); 
			r.onmouseout=new Function('TINY.scroll.cl("'+this.thumbs+'","'+this.right+'")');
			this.p=$(this.thumbs) 
		}
		for(i;i<this.l;i++){
			this.a[i]={};
			var h=m[i], a=this.a[i];
			a.t=$$('h3',h)[0].innerHTML;
			a.d=$$('p',h)[0].innerHTML;
			a.l=$$('a',h)[0]?$$('a',h)[0].href:'';
			a.p=$$('span',h)[0].innerHTML;
			if(this.thumbs){
				var g=$$('img',h)[0];
				this.p.appendChild(g);
				w+=parseInt(g.offsetWidth);
				if(i!=this.l-1){
					g.style.marginRight=this.spacing+'px';
					w+=this.spacing
				}
				this.p.style.width=w+'px';
			}
		}
	},
	mv:function(d,c){
	},
	pr:function(t,c){
	},
	is:function(s,c){      
	},
	le:function(s,c){
	},
	nf:function(s){    
	}
};

TINY.scroll=function(){
	return{ 
		init:function(e,d,s,za){
			e=typeof e=='object'?e:$(e); 
			za=typeof za=='object'?za:$(za);

			if (za) {
			  if (za.id=="slideleft")	
				za.style.background="url(images/l-arrow_rollover.jpg) center center no-repeat";
			  else 
				za.style.background="url(images/r-arrow_rollover.jpg) center center no-repeat";
			 }

			var p=e.style.left||TINY.style.val(e,'left'); e.style.left=p;

			var l=d==1?parseInt(e.offsetWidth)-parseInt(e.parentNode.offsetWidth):0; 
			e.si=setInterval(function(){TINY.scroll.mv(e,l,d,s)},20)
		},
		mv:function(e,l,d,s){
			var c=parseInt(e.style.left); 
			if(c==l){TINY.scroll.cl(e)}
			else{
				var i=Math.abs(l+c); 
				i = i<s?i : s; 
				var n=c-i*d; 
				e.style.left=n+'px'
			}
		},
		cl:function(e, zb){
			e=typeof e=='object'?e:$(e); 
			zb=typeof zb=='object'?zb:$(zb);
				
			if (zb) {
			  if (zb.id=="slideleft")	
				zb.style.background="url(images/l-arrow.jpg) center center no-repeat";
			  else 
				zb.style.background="url(images/r-arrow.jpg) center center no-repeat";
			 }
			clearInterval(e.si)
		}
	}
}();

TINY.height=function(){
	return{
		set:function(e,h,s,d){
			e=typeof e=='object'?e:$(e); var oh=e.offsetHeight, ho=e.style.height||TINY.style.val(e,'height');
			ho=oh-parseInt(ho); var hd=oh-ho>h?-1:1; clearInterval(e.si); e.si=setInterval(function(){TINY.height.tw(e,h,ho,hd,s)},20)
		},
		tw:function(e,h,ho,hd,s){
			var oh=e.offsetHeight-ho;
			if(oh==h){clearInterval(e.si)}else{if(oh!=h){e.style.height=oh+(Math.ceil(Math.abs(h-oh)/s)*hd)+'px'}}
		}
	}
}();

TINY.alpha=function(){
	return{
		set:function(e,a,s){
		},
		tw:function(e,a,d,s){
		}
	}
}();

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