var Site = {
	
	start: function(){
		
		if ($('kwick')) Site.parseKwicks();
		
		Site.parseFader();
		
	},
	
	parseKwicks: function(){
		var kwicks = $$('#kwick .kwick');
		var fx = new Fx.Elements(kwicks, {wait: false, duration: 200, transition: Fx.Transitions.quadOut});
		kwicks.each(function(kwick, i){
			kwick.addEvent('mouseenter', function(e){
				var obj = {};
				obj[i] = {
					'width': [kwick.getStyle('width').toInt(), 380]
				};
				kwicks.each(function(other, j){
					if (other != kwick){
						var w = other.getStyle('width').toInt();
						if (w != 110) obj[j] = {'width': [w, 95]};
					}
				});
				fx.start(obj);
			});
		});
							 
		
		$('kwick').addEvent('mouseleave', function(e){
			var obj = {};
			kwicks.each(function(other, j){
				if(j == 0) {
					obj[j] = {'width': [other.getStyle('width').toInt(), 380]};
				} else { 
					obj[j] = {'width': [other.getStyle('width').toInt(), 95]};
				}
			});
			fx.start(obj);
		});
							 
	},
	
	parseFader: function(){
		var faders = $$('#rightbar .fadeBlock');
		var fx = new Fx.Elements(faders, {wait: false, duration: 500, transition: Fx.Transitions.quadOut});
		
		faders.each(function(fade, i){
			fade.addEvent('mouseenter', function(e){
				var obj = {};
				obj[i] = {
					'opacity': [0]
				};
				fx.start(obj);
			});
			fade.addEvent('mouseleave', function(e){
				var obj = {};
				obj[i] = {
					'opacity': [100]
				};
				fx.start(obj);
			});
		});
							 
							 
	}
	
	
	
};

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

