/*
	(c)2009 Florian Pichler - es&es - esundes.com
*/
init = function(){
	var fWrap = new Element('div',{'id':'fWrap'}).inject('site','top').adopt($('front'));
	var bWrap = new Element('div',{'id':'bWrap'}).inject(fWrap,'after').adopt($('back'));

	var savedFront = fWrap.getSize().y;
	var savedBack = bWrap.getSize().y;
	fWrap.setStyles({'overflow':'hidden','cursor':'pointer'}).addEvent('click',function(){ showBack() });
	bWrap.setStyle('overflow','hidden');
	
	showBack = function(){
		fWrap.tween('height',0); bWrap.tween('height',savedBack);
		bToggle.setStyle('background','url(./i/site.png) -200px -40px');
		return window.location.hash = "#more";
	};
	
	var bToggle = new Element('div',{
		'styles':{
			'position':'absolute',
			'top':0, 'right':0,
			'width':'40px', 'height':'40px',
			'margin':'0 40px',
			'cursor':'pointer',
			'background':'url(./i/site.png) -200px 0'
		},
		'events':{
			click:function(){
				if(window.location.hash == '#more'){
					bWrap.tween('height',0); fWrap.tween('height',savedFront);
					bToggle.setStyle('background','url(./i/site.png) -200px 0');
					return window.location.hash = "#";
				}else{
					showBack();
				}
			}
		}
	}).inject($('site'));
	
	if(window.location.hash != '#more'){ 
		bWrap.setStyle('height','0');
	}else{ 
		fWrap.setStyle('height','0');
		bToggle.setStyle('background','url(./i/site.png) -200px -40px');
	}	
}