var rexiteJS = {
	slidingMenuVert: function(szNormal, szSmall, szFull) {
		var menul = $$(".lmenu");
		var menuimg = document.getElementById("menu").getElementsByTagName("img");
		var fx = new Fx.Elements(menul, {wait: false, duration: 300});
		menul.each(function(x, i) {
			x.addEvent("mouseenter", function(event) {
				var o = {};
				o[i] = {height: [x.getStyle("height").toInt(), szFull]}
				menul.each(function(other, j) {
					if(i != j) {
						if(window.ie) menuimg[j].style.filter = "alpha(opacity=20)"; 
						else menuimg[j].style.opacity = 0.2; 
						var h = other.getStyle("height").toInt();
						if(h != szSmall) o[j] = {height: [h, szSmall]};
					} else {
						if(window.ie) menuimg[j].style.filter = "alpha(opacity=100)"; 
						else menuimg[j].style.opacity = 1;
					}
				});
				fx.start(o);
			});
		});
		$("menu").addEvent("mouseleave", function(event) {
			var o = {};
			menul.each(function(x, i) {
				if(window.ie) menuimg[i].style.filter = "alpha(opacity=100)"; 
				else menuimg[i].style.opacity = 1;
				o[i] = {height: [x.getStyle("height").toInt(), szNormal]}
			});
			fx.start(o);
		});
	},
	mouseOver: function(x) {
		var img = document.getElementById("topmenu").getElementsByTagName("img");
		switch(x) {
			case 0:
				if(window.ie) {
					img[0].style.filter = "alpha(opacity=100)";
					img[1].style.filter = "alpha(opacity=80)";
					img[2].style.filter = "alpha(opacity=80)";
				} else {
					img[0].style.opacity = 1; 
					img[1].style.opacity = 0.75;
					img[2].style.opacity = 0.75;
				}
				break;
			case 1:
				if(window.ie) {
					img[0].style.filter = "alpha(opacity=80)";
					img[1].style.filter = "alpha(opacity=100)";
					img[2].style.filter = "alpha(opacity=80)";
				} else {
					img[0].style.opacity = 0.75; 
					img[1].style.opacity = 1;
					img[2].style.opacity = 0.75;
				}
				break;
			case 2:
				if(window.ie) {
					img[0].style.filter = "alpha(opacity=80)";
					img[1].style.filter = "alpha(opacity=80)";
					img[2].style.filter = "alpha(opacity=100)";
				} else {
					img[0].style.opacity = 0.75; 
					img[1].style.opacity = 0.75;
					img[2].style.opacity = 1;
				}
				break;
		}
	},
	mouseOut: function() {
		var img = document.getElementById("topmenu").getElementsByTagName("img");
		if(window.ie) {
			img[0].style.filter = "alpha(opacity=80)";
			img[1].style.filter = "alpha(opacity=80)";
			img[2].style.filter = "alpha(opacity=80)";
		} else {
			img[0].style.opacity = 0.75; 
			img[1].style.opacity = 0.75;
			img[2].style.opacity = 0.75;
		}
	},
  init: function() { 
		this.slidingMenuVert(52,47,72);
		var img = document.getElementById("topmenu").getElementsByTagName("img");
		if(window.ie) {
			img[0].style.filter = "alpha(opacity=80)";
			img[1].style.filter = "alpha(opacity=80)";
			img[2].style.filter = "alpha(opacity=80)";
		} else {
			img[0].style.opacity = 0.75; 
			img[1].style.opacity = 0.75;
			img[2].style.opacity = 0.75;
		}
	}	
};

window.addEvent('domready', function() { rexiteJS.init(); });
