/*------------------------------------------------------------------------
# $JA#PRODUCT_NAME$ - Version $JA#VERSION$ - Licence Owner $JA#OWNER$
# ------------------------------------------------------------------------
# Copyright (C) 2004-2008 J.O.O.M Solutions Co., Ltd. All Rights Reserved.
# @license - Copyrighted Commercial Software
# Author: J.O.O.M Solutions Co., Ltd
# Websites:  http://www.joomlart.com -  http://www.joomlancers.com
# This file may not be redistributed in whole or significant part.
-------------------------------------------------------------------------*/

if (!self.jaSLWI2) {
	var jaSLWI2 = {
		jaSLWI2Init: function() {
			jaSLWI2.modules = $$(".ja-catslwi2");
			jaSLWI2.modulesText = $$(".ja-catslwi2-text");
			var x = new Fx.Elements(jaSLWI2.modulesText, { wait: false, duration: 250 });

		var obj = {};
			jaSLWI2.modules.each(function(module, i) {
				jaSLWI2.modulesText[i].collapseH = jaSLWI2.modulesText[i].offsetHeight;
				obj[i] = { 'height': [jaSLWI2.modulesText[i].getStyle('height').toInt(), jaSLWI2.modulesText[i].collapseH]};
				module.addEvent('mouseenter', function(e) {
					var obj = {};
					obj[i] = { 'height': [jaSLWI2.modulesText[i].getStyle('height').toInt(), jaSLWI2.expandH]};
					jaSLWI2.modules.each(function(other, j) {
						if (other != module) {
							var h = jaSLWI2.modulesText[j].getStyle('height').toInt();
							if (h != jaSLWI2.modulesText[j].collapseH) obj[j] = { 'height': [h, jaSLWI2.modulesText[j].collapseH] };
						}
					});
					x.start(obj);
				});

				module.addEvent('mouseleave', function(e) {
					var obj = {};
					jaSLWI2.modules.each(function(other, j) {
						obj[j] = { 'height': [jaSLWI2.modulesText[j].getStyle('height').toInt(), jaSLWI2.modulesText[j].collapseH]};
					});
					x.start(obj);
				});
			});
			x.start(obj);
		}
	}

	window.addEvent('load', jaSLWI2.jaSLWI2Init);
}
