// JavaScript Document


function setMenu(ref){
	
	$('#navigation li').each(function(){
		
		// remove all active classes
		$(this).find('a').removeClass('active');
		
		// search for match with 'ref'
		if ($(this).find('a').attr('href') == '?pg='+ref){
			
			// add class 'active'
			$(this).find('a:first').addClass('active');
			$(this).parent().parent().children(0).addClass('active');
		}
		
	}).hover(
	  function () {
		
		
		if ($(this).children(0).hasClass('single')) {
			var height = $(this).find('li').length;
			$(this).children(0).stop(true, false).animate({'padding-bottom':height*30+25},200);
			$(this).find('.submenu').slideDown(200);
			
		}
	  },
	  function () {
		$(this).find('.submenu').stop(true, false).slideUp(200);
		$(this).children(0).animate({'padding-bottom':'3px'},200);
	  }
	);
}


