function initSwish(swishId, heightImage) {
	// Main menu items and sub menu container effects
	var swishMenu = $$('#'+swishId+' .MISwishMenu');
	var fxMain = new Fx.Elements(swishMenu, {wait: false, duration: 300, transition: Fx.Transitions.Back.easeOut});
	swishMenu.each(function(swishItem, i){
		swishItem.addEvent('mouseenter', function(e){
			if (!swishItem.active) {
				var obj = {};
				obj[i] = { 'width': [swishItem.getStyle('width').toInt(), 200] };
				swishItem.active = true;
				swishMenu.each(function(other, j){
					if (other != swishItem){
						if (other.active) fxMainOut(other, heightImage);
						other.active = false;
						var w = other.getStyle('width').toInt();
						if (w != 119) obj[j] = {'width': [w, 119]};
					}
				});
				fxMain.start(obj);
				fxMainIn(swishItem, heightImage);
			}
		});
		swishItem.addEvent('mouseup', function(e){
			swishItem.blur();
		});
	});
	$(swishId).addEvent('mouseleave', function(e){
		var obj = {};
		swishMenu.each(function(other, j){
			obj[j] = { 'width': [other.getStyle('width').toInt(), 135] };
			if (other.active) fxMainOut(other, heightImage);
			other.active = false;
		});
		fxMain.start(obj);
	});

	// fade effect on the sub menu items
	var swishSubs = $$('.SwishMenu .SwishMainMenu li ul li a');
	swishSubs.each(function(smi, i){
		smi.fx = new Fx.Style(smi, 'color', {wait: false, duration: 200, transition: Fx.Transitions.Sine.easeOut});
		smi.addEvent('mouseenter', function(e){
			if (smi.fx) smi.fx.stop();
			smi.fx.start('222266', 'ffffff');
		});
		smi.addEvent('mouseleave', function(e){
			if (smi.fx) smi.fx.stop();
			smi.fx.start('ffffff', '222266');
		});
	});
}

function fxMainIn(other, heightImage) {
	kds = other.getChildren();
	if (kds[0].src != undefined) {
		new Fx.Styles(kds[0], {duration:375, transition: Fx.Transitions.Back.easeOut}).start({
			'height': [0, heightImage], 'width': [0, heightImage], 'top': [24, -24], 'left': [-32, 0],
			'opacity': [(isIE()?1:0), 1], 'margin-right': [0, -16], 'margin-bottom': [0, -50]
		});
		new Fx.Styles(kds[1], {duration:250, transition: Fx.Transitions.Back.easeOut}).start({
			'left': [10, 35]
//			, 'color': ['f2f2f2', 'ffff33']
		});
	}
	else
	{
		new Fx.Styles(kds[0], {duration:250, transition: Fx.Transitions.Back.easeOut}).start({
			'left': [10, 35]
//			, 'color': ['f2f2f2', 'ffff33']
		});
	};
	subMenu = other.getParent().getChildren()[1];
	if (subMenu != undefined) {
		if (kds[0].src == undefined) 
			{subMenu.style.marginLeft = 0}
		else
			{subMenu.style.marginLeft = heightImage-4}
		new Fx.Styles(subMenu, {duration:400, transition: Fx.Transitions.Quart.easeIn}).start({
			'width': [0, 110*subMenu.getChildren().length+24], 'opacity': [0.2, 1]
		});
	};
}
function fxMainOut(other, heightImage) {
	kds = other.getChildren();
	if (kds[0].src != undefined) {
		new Fx.Styles(kds[0], {duration:375, transition: Fx.Transitions.Cubic.easeOut}).start({
			'height': [heightImage, 0], 'width': [heightImage, 0], 'top': [-24, 24], 
			'opacity': [1, (isIE()?1:0)], 'margin-right': [-16, 0]
		});
		new Fx.Styles(kds[1], {duration:260, transition: Fx.Transitions.Cubic.easeOut}).start({
			'left': [35, 10]
//			, 'color': ['ffff33', 'f2f2f2']
		});
	}
	else
	{
		new Fx.Styles(kds[0], {duration:260, transition: Fx.Transitions.Cubic.easeOut}).start({
			'left': [35, 10]
//			, 'color': ['ffff33', 'f2f2f2']
		});
	};
	subMenu = other.getParent().getChildren()[1];
	if (subMenu != undefined) {
		new Fx.Styles(subMenu, {duration:410, transition: Fx.Transitions.Quart.easeOut}).start({
			'width': [110*subMenu.getChildren().length+24, 0], 'opacity': [1, 0.2]
		});
	};
}

function isIE() { return navigator.appName=="Microsoft Internet Explorer"; }
