$(document).ready(function(){
  
  $('#header').hide();
  $('#nav ul li ul, #nav ul li ul li ul').hide();
  
  $('li.current_page_ancestor > a:first').css({"color":"#a2ce45"});
  $('#nav-top > li > ul').addClass('nav-level2');
  $('#nav-top > li > ul > li > ul').addClass('nav-level3');
  
  var ulnb = $('#nav-top .current_page_ancestor > ul:first > li').length;
  var a = $('#container').width();
  var c = 181*ulnb;
  var margeG = (a-c)/2;
  /*alert(margeG);*/
  $('#nav-top .current_page_ancestor > ul:first').css({"margin-left" : margeG+"px","width":c});
  $('#nav-top .current_page_ancestor > ul:first li ul').css({"margin-left" : -margeG+"px"});
  $('#header').show();
  $('li.current_page_ancestor > ul:first, li.current_page_parent > ul:first, .current_page_item > ul:first').show();
  
});
