//----------------------------------------------------------------------------------------------------//
//--                           MOOTOOLS                                                             --//
//----------------------------------------------------------------------------------------------------//
//check Contact form
window.addEvent('domready', function(){
	var szNormal = 49, szSmall  = 49, szFull   = 219;
	var jsmenus = $$("#jsmenus .jsmenu");
	var fx = new Fx.Elements(jsmenus, {wait: false, duration: 300, transition: Fx.Transitions.Back.easeOut});
	jsmenus.each(function(jsmenu, i) {
		jsmenu.addEvent("mouseenter", function(event) {
			szFull = getElHeight("listing"+i) + szNormal;		
			flashCommunicator(i);
			var o = {};
			o[i] = {height: [jsmenu.getStyle("height").toInt(), szFull]}
			jsmenus.each(function(other, j) {
				if(i != j) {
					var w = other.getStyle("height").toInt();
					if(w != szSmall) o[j] = {height: [w, szSmall]};
				}
			});
			fx.start(o);
		});
	});	
	$("jsmenus").addEvent("mouseleave", function(event) {
		var o = {};
		jsmenus.each(function(jsmenu, i) {
			//will be called 5 times for every mouseleave! 
			flashCommunicator("err");
			o[i] = {height: [jsmenu.getStyle("height").toInt(), szNormal]}
		});
		fx.start(o);
	})			
});
	
function getElHeight(id){
	return (document.getElementById(id).offsetHeight);
}
