var Site = {
	
	start: function(){
		
		if ($('kwick')) {Site.parseKwicks();}
		if ($('ads')) {Site.parseADBlocks();}
		
	},
	
	parseKwicks: function(){
		var kwicks = $$('#kwick .kwick');

		
		var fx = new Fx.Elements(kwicks, {wait: false, duration: 200, transition: Fx.Transitions.quadInOut});
		kwicks.each(function(kwick, i){
		
			
			kwick.addEvent('mouseenter', function(e){
				var obj = {};
				obj[i] = {
					'width': [kwick.getStyle('width').toInt(), 252]
				};
				kwicks.each(function(other, j){
					if (other != kwick){
						var w = other.getStyle('width').toInt();
						if (w != 112) obj[j] = {'width': [w, 112]};
					}
				});
				fx.start(obj);
			});
		});
		
		$('kwick').addEvent('mouseleave', function(e){
			var obj = {};
			kwicks.each(function(other, j){
				obj[j] = {'width': [other.getStyle('width').toInt(), 182]};
			});
			fx.start(obj);
		});
	},
	
  parseADBlocks: function(){
  	var blocks = $$('#ads .ad_block');
  	blocks.each(function(block, i){
			block.addEvent('mouseenter', function(e){
				if(!this.executing){
					this.executing=true;
					var elm = this;
					$(this).effect('opacity',{	duration: 250,	transition: Fx.Transitions.quadIn, onComplete:function(elm){elm.executing=false}}).start(0.2,1);
				}
			}); 	
  	});
  }
	
	
	
	
};


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