var email_newsletter_text = "Your Email Address";

$(document).ready(function() {
  
  // nav
  $("header .menu-main-menu-container ul li:first").addClass("first");
  $("header .menu-main-menu-container ul li:last").addClass("last");
  $("header .menu-main-menu-container ul li:nth-child(4) a").addClass("active");
  $("header .menu-main-menu-container ul li a").hover(
    function () {
      $(this).children('.title1').addClass('hover');
    }, 
    function () {
      $(this).children('.title1').removeClass('hover');
    }
  );
  
  // setup newsletter text
  $("#email_address").val(email_newsletter_text);
  
  $("section#home-more-top a#top").bind('click', function(e) {
    e.preventDefault();
      $('html, body').animate({scrollTop:0}, 'slow');
  });
  
  $("#email_address").focus(function() {
    if($(this).val() == email_newsletter_text) {
      $(this).val('');
    }
  });
  $("#email_address").blur(function() {
    if($(this).val() == "") {
      $("#email_address").val(email_newsletter_text);
    }
  });
  $("a#submit-newsletter").bind('click', function(e){ 
    e.preventDefault();
    $("form#newsletter_form").submit();
  });  
  
  $("#more-top a#top").bind('click', function(e) {
     e.preventDefault();
       $('html, body').animate({scrollTop:0}, 'slow');
   });
  
  $("a#search-submit").bind('click', function(e) {
    e.preventDefault();
    $("#searchform").submit();
  });
  
  $("a.show-more-cats").live('click', function(e) {
    e.preventDefault();
    $(this).empty().append("Show Less");
    $(this).removeClass("show-more-cats");
    $(this).removeClass("show-more");
    $(this).addClass("show-less-cats");
    $(this).addClass("show-less");
    $("ul.more-cats").slideDown(500);
  });
  
  $("a.show-less-cats").live('click', function(e) {
    e.preventDefault();
    $(this).empty().append("Show More");
    $(this).removeClass("show-less-cats");
    $(this).removeClass("show-less");
    $(this).addClass("show-more-cats");
    $(this).addClass("show-more");
    $("ul.more-cats").slideUp(500);
  });
  
  $("a.show-more-archives").live('click', function(e) {
    e.preventDefault();
    $(this).empty().append("Show Less");
    $(this).removeClass("show-more-archives");
    $(this).removeClass("show-more");
    $(this).addClass("show-less-archives");
    $(this).addClass("show-less");
    $("ul.more-archives").slideDown(500);
  });
  
  $("a.show-less-archives").live('click', function(e) {
    e.preventDefault();
    $(this).empty().append("Show More");
    $(this).removeClass("show-less-archives");
    $(this).removeClass("show-less");
    $(this).addClass("show-more-archives");
    $(this).addClass("show-more");
    $("ul.more-archives").slideUp(500);
  });
  
  $("#submit-comment").bind('click', function(e) {
    e.preventDefault();
    $("form#commentform").submit();
  })
  
  $(".post .entry-content p:last").css('padding-bottom:0px');
});






