/* Copyright (c) Motoki, 2010 */
/*   motokisensei@gmail.com   */
/*  Developed for FarGate.RU  */

$(document).ready(function() {
		
		var offset = 5;
		$('#menu').removeClass('off');
		$('#menu').children().each(function() {
			this.style.left = offset + 'px';
			$(this).children('ul').each(function() {
				this.parentNode.animation = {
					target: this,
					limit: this.offsetHeight
				};
				this.style.height = 1 + 'px';
			});
			offset += this.offsetWidth + 5;
			$(this).mouseover(function() {
				$(this.animation.target).stop();
				$(this.animation.target).animate({
					height: this.animation.limit
				}, 50);
			});
			$(this).mouseout(function() {
				$(this.animation.target).stop();
				$(this.animation.target).animate({
					height: 1
				}, 100);
			});
		});
		
});
