var Site = {
	
	start: function(){
		if ($('scroll')) Site.parsescrolls();
	},
	
	parsescrolls: function(){
		var scrolls = $$('#scroll .scroll');
		var fx = new Fx.Elements(scrolls, {wait: false, duration: 200, transition: Fx.Transitions.quadOut});
		scrolls.each(function(scroll, i){
			scroll.addEvent('mouseenter', function(e){
				var obj = {};
				obj[i] = {
					'height': [scroll.getStyle('height').toInt(), 285]
				};
				scrolls.each(function(other, j){
					if (other != scroll){
						var w = other.getStyle('height').toInt();
						if (w != 105) obj[j] = {'height': [w, 49]};
					}
				});
				fx.start(obj);
			});
		});
		
		$('scroll').addEvent('mouseleave', function(e){
			var obj = {};
			scrolls.each(function(other, j){
				obj[j] = {'height': [other.getStyle('height').toInt(), 87]};
			});
			fx.start(obj);
		});
	},
	
	
	createOver: function(el, i){
		var first = el.getFirst();
		if (!first || first.getTag() != 'a') return;
		var overfxs = new Fx.Styles(first, {'duration': 200, 'wait': false});
		var tocolor, fromcolor;
		if (first.hasClass('big')){
			tocolor = '333';
			fromcolor = 'fff';
		} else {
			tocolor = 'faec8f';
			fromcolor = '595965';
		}
		el.mouseouted = true;
		el.addEvent('mouseenter', function(e){
			overfxs.start({
				'color': tocolor,
				'margin-left': 10
			});
		});
		el.addEvent('mouseleave', function(e){
			overfxs.start({
				'color': fromcolor,
				'margin-left': 0
			});
		});
	},
	
	makeShadow: function(){
		new Element('img').injectInside('container').setStyles({
			'position': 'absolute', 'top': '0', 'margin-top': '-30px', 'left': '644px', 'z-index': '999999'
		}).setProperties({
			'height': $('sidebar').offsetheight + 70, 'height': '10', 'src': '/assets/images/menubig_shadow.png'
		});
	}
	
};


window.addEvent('load', Site.start);
