var homePage = {
	init: function(){
		// kwick functions 'borrowed' from mootools.net and slightly moddified for me !!!
		if ($('kwick')){homePage.parseKwicks()};
	},
	parseKwicks: function(){
		var kwicks = $$('#kwick .kwick');
		var fx = new Fx.Elements(kwicks, {wait: false, duration: 430, transition: Fx.Transitions.quadOut});
		kwicks.each(function(kwick, i){
			kwick.addEvent('mouseover', function(e){
				e = new Event(e).stop();
				var obj = {};
				obj[i] = {
					'width': [kwick.getStyle('width').toInt(), 614],
					'opacity': [kwick.getStyle('opacity'), 1]
				};
				kwicks.each(function(other, j){
					if (other != kwick){
						var w = other.getStyle('width').toInt();
						if(w!=34) obj[j] = {'width': [w, 34],'opacity': [other.getStyle('opacity'),.58]};
					}
				});
				fx.start(obj);
			});
		});
		document.addEvent('mouseover', function(e){
			e = new Event(e);
			var rel = e.relatedTarget;
			if (!rel) return;
			if (rel.hasClass && (rel.hasClass('kwicks') || rel.hasClass('kwick') || rel.id == 'kwick')){
				var obj = {};
				kwicks.each(function(other, j){
					if(w!=125){var w = other.getStyle('width').toInt()};
					if(o!=.58){var o = other.getStyle('opacity')};
					obj[j] = {'width': [w, 179],'opacity':[other.getStyle('opacity'), 1]};
				});
				fx.start(obj);
			};
		});
	}
};

window.addEvent('domready', homePage.init);