
var Tpl = {
	
	init: function(){
		this.centerWebsite( 100 );
		this.mkThumbs();
		CSBfleXcroll('scroller');
	},
	
	centerWebsite: function( delay ){
		var container = $('container');
		var body_height = window.getSize().y;
		var margin_top = (( body_height - container.getSize().y ) / 2) - 30;
		if(margin_top > 0){
			container.setStyle('margin-top', margin_top);
		}
		else{
			container.setStyle('margin-top', 0);
		}
		if( ! window.ie ){
			(function(){this.centerWebsite( delay );}.bind(this)).delay( delay );
		}
	},
	
	mkThumbs: function(){
		var thumbs = $$('ul.thumbs li a');
		if($chk(thumbs)){
			thumbs.each(function(thumb, i){
				var title = thumb.getElement('strong');
				var bottom = title.getSize().y;				
				title.setStyle('bottom', -bottom);
				var fx = new Fx.Morph(title, {
					duration: 200, 
					wait: false
				});
				thumb.addEvents({
					'mouseover' : function(){
						fx.start({
							'bottom' : 0,
							'opacity' : 1
						});
					},
					'mouseout' : function(){
						fx.start({
							'bottom' : -bottom,
							'opacity' : 0
						});
					}
				});
			});
		}
	}
	
};
