$(function() {

  $('ul#bot_nav li a').hover(function() {
    $(this).parent().css('background', 'url('+theme_path+'/images/nav_bot_active.png) no-repeat top center');
  }, function() {
	$(this).parent().css('background', 'none');
  })

  $('ul#bot_nav li.current-menu-ancestor a:first').hover(function() {
    $(this).parent().css('background', 'url('+theme_path+'/images/nav_bot_active.png) no-repeat top center');
  }, function() {
    $(this).parent().css('background', 'url('+theme_path+'/images/nav_bot_active.png) no-repeat top center');
  })
  
  $.each($('ul#bot_nav li ul'), function() {
    $(this).children().last('li').css('border-bottom', 'none');
  });
  
  if($('#sidebar_nav')) {
    var navHeight = $($('#sidebar_nav ul')[0]).height();
    if(navHeight > $('#sidebar_nav').height()) {
      $('#sidebar_nav').height(navHeight);
    }
    if($('#main').height()-320 > $('#sidebar_nav').height()) {
      $('#sidebar_nav').height($('#main').height()-320);
    }
  }
  
  if($('a.button') && $.browser.mozilla) {
    $('a.button').css({
      'padding-top': '5px',
      'height': '13px'
    })
  }
  
  if($('#submit') && $.browser.mozilla) {
    $('input#submit').css('padding-bottom', '6px');
  }
  
  if($('#clear') && $.browser.mozilla) {
    $('input#clear').css('padding-bottom', '6px');
  }
  
  if($('#flash_intro') && $.browser.mozilla) {
    $('#flash_intro').css('margin-left', '-1px');
  } 
  
  if($('a.button') && $.browser.mozilla) {
    $('a.button span').css('padding-top', '6px');
    $('a.button span').css('height', '15px');
  }
  
  if($.browser.msie) {
    $('ul#bot_nav li a').hover(function() {
      $($(this).parent().children()[1]).css('display', 'block');
    }, function() {
      $('ul#bot_nav ul').css('display', 'none');
    })
  }
})
