var Site = {
	
	start: function(){
		
		if ($('kwick')) Site.parseKwicks();

		if ($('frontpageProducts')) Site.parseProducts();

	},
	parseProducts: function(){
//		var products = $$('#frontpageProducts .productBoxOuter .productFrontpage .productDescription');
		var products = $$('.catalogLinkPush');

var fx = new Fx.Elements(products, {wait: false, duration: 500, transition: Fx.Transitions.Cubic.easeInOut});
		products.each(function(catalogLinkPush, i){
		catalogLinkPush.setStyle('height',250);
			catalogLinkPush.addEvent('mouseenter', function(e){
				var obj = {};
				obj[i] = {
					'height': [catalogLinkPush.getStyle('height').toInt(), 150]
				};
				products.each(function(other, j){
					if (other != catalogLinkPush){
						var w = other.getStyle('height').toInt();
						if (w != 250) obj[j] = {'height': [w, 250]};
					}
				});
				fx.start(obj);
			});
		});
		
		$('frontpageProducts').addEvent('mouseleave', function(e){
			var obj = {};
			products.each(function(other, j){
				obj[j] = {'height': [other.getStyle('height').toInt(), 250]};
			});
			fx.start(obj);
		});
		
},
	
	
	parseKwicks: function(){
		var kwicks = $$('#kwick .kwick');
		// Fx.Transitions.Cubic.easeInOut
		//
		//  var fx = new Fx.Elements(kwicks, {wait: false, duration: 100, transition: Fx.Transitions.quadOut});
		// Bounce
		// Cubic
		
		var fx = new Fx.Elements(kwicks, {wait: false, duration: 200, transition: Fx.Transitions.Cubic.easeOut});
		kwicks.each(function(kwick, i){
			kwick.addEvent('mouseenter', function(e){
				var obj = {};
				obj[i] = {
					'width': [kwick.getStyle('width').toInt(), 210]
				};
				kwicks.each(function(other, j){
					if (other != kwick){
						var w = other.getStyle('width').toInt();
						if (w != 128) obj[j] = {'width': [w, 128]};
					}
				});
				fx.start(obj);
			});
		});
		
		$('kwick').addEvent('mouseleave', function(e){
			var obj = {};
			kwicks.each(function(other, j){
				obj[j] = {'width': [other.getStyle('width').toInt(), 128]};
			});
			fx.start(obj);
		});
	}
	
};
window.addEvent('domready', Site.start);
