$(document).ready(function() {
  
  $('#nav ul ul li:first-child').addClass('first-child');
  
  $("#nav td li").mouseover(function() {
    if ($(this).parent().parent().is('td') && $(this).children().is('ul')) {
      $(this).parent().parent().addClass('hover');
      if ($.browser.msie) {
        $(this).find('.l').addClass('z');
        $(this).find('.r').addClass('w');
      };
    };
  });
  $("#nav td li").mouseout(function() {
    if ($(this).parent().parent().is('td')) {
      $(this).parent().parent().removeClass('hover');
    };
  });
  
  $('#serv td .parent').hover(function() {
    if ($(this).find('.sub')) {
      $(this).find('.sub').addClass('hover');
    }}, function() {
      if ($(this).find('.sub')) {
        $(this).find('.sub').removeClass('hover');
      }
    }
  );
  $('#serv td .sub').click(function() {
    var a = $(this).parent().find('a')[0].href;
    window.location = a;
  });
  
});

