jQuery(function($) {
	$('#navMenu #menu1 > ul > li').hover(
		function(event) {
			div = $(this).children('div');
			list = div.children('ul');
			if(document.body.offsetWidth > 800) {
				height = list.height() - 1;
				width = list.width();
				div.css({'width':width})
				list.css({'position':'absolute', 'bottom':0, 'z-index':999})
				div.stop(true,false).animate({'height':height}, 'fast')
			}
			else {
				div.removeAttr('style');
				list.removeAttr('style');
			}
		},
		function(event) {
			div = $(this).children('div');
			list = div.children('ul');
			if(document.body.offsetWidth > 800) {
				list.css({'z-index':'auto'});
				div.stop(true,false).animate({'height':0})
			}
		}
	);
	$('#navMenu').click(
		function(event) {
			$(this).toggleClass('active');
		}
	)
	$('#navMenu #menu1 > ul > li').click(
		function(event) {
			$('#navMenu #menu1 > ul > li').removeClass('active');
			$(this).addClass('active');
			console.log('test');
		}
	)
});
