(function() {

  $(document).ready(function() {
    var clickShowBio, hideBio, imgOverlay, initJscroll, loadShowBio, personOverlay, showContent, validateForm;
    showContent = function() {
      $(".col-left .person-wrap:odd, .col-right .person-wrap:odd").addClass("right");
      $(".col-left .person-wrap:even, .col-right .person-wrap:even").addClass("left");
      $(".col-left, .col-right").css({
        'display': 'block'
      });
      return $("a:has(img)").css({
        'display': 'block'
      });
    };
    showContent();
    initJscroll = function() {
      var $needScroll;
      $needScroll = $("#news");
      if ($needScroll.length > 0) {
        return $needScroll.jScrollPane();
      } else {

      }
    };
    initJscroll();
    personOverlay = function() {
      var $personImg;
      $personImg = $(".person-img-link");
      $personImg.prepend("<span class='blue-overlay'></span>");
      return $personImg.hover((function() {
        var $footer, $overlay;
        $overlay = $(this).children(".blue-overlay");
        $footer = $(this).siblings(".box-footer").find(".person-social");
        $overlay.stop(true, true).fadeIn(200);
        $footer.stop(true, true).animate({
          backgroundColor: '#b0bc22'
        }, 200);
        return $footer.children('.latest-point-green').stop(true, true).fadeIn(200);
      }), function() {
        $(this).children(".blue-overlay").stop(true, true).fadeOut(200);
        $(this).siblings(".box-footer").find(".person-social").stop(true, true).animate({
          backgroundColor: '#636363'
        }, 200);
        return $(this).siblings(".box-footer").find(".person-social").children('.latest-point-green').stop(true, true).fadeOut(200);
      });
    };
    personOverlay();
    imgOverlay = function() {
      var $img;
      $img = $(".img-link");
      $img.prepend("<span class='blue-overlay'></span>");
      return $img.hover((function() {
        $(this).children('.blue-overlay').stop(true, true).fadeIn(200);
        $(this).parents(".square").siblings(".service-detail").find(".trigger").stop(true, true).animate({
          backgroundColor: '#b0bc22'
        }, 200);
        return $(this).parents(".square").siblings(".service-detail").find(".trigger").children(".latest-point-green").stop(true, true).fadeIn(200);
      }), function() {
        $(this).children('.blue-overlay').stop(true, true).fadeOut(200);
        $(this).parents(".square").siblings(".service-detail").find(".trigger").stop(true, true).animate({
          backgroundColor: '#636363'
        }, 200);
        return $(this).parents(".square").siblings(".service-detail").find(".trigger").children(".latest-point-green").stop(true, true).fadeOut(200);
      });
    };
    imgOverlay();
    $(".person-social").hover((function() {
      $(this).children(".latest-point-green").stop(true, true).fadeIn(200);
      $(this).stop(true, true).animate({
        backgroundColor: '#b0bc22'
      }, 200);
      return $(this).parents(".box-footer").siblings(".person-img-link").children(".blue-overlay").stop(true, true).fadeIn(200);
    }), function() {
      $(this).children(".latest-point-green").stop(true, true).fadeOut(200);
      $(this).stop(true, true).animate({
        backgroundColor: '#636363'
      }, 200);
      return $(this).parents(".box-footer").siblings(".person-img-link").children(".blue-overlay").stop(true, true).fadeOut(200);
    });
    $(".trigger").hover((function() {
      $(this).children(".latest-point-green").stop(true, true).fadeIn(200);
      $(this).stop(true, true).animate({
        backgroundColor: '#b0bc22'
      }, 200);
      return $(this).parents(".service-detail").siblings(".square").children(".img-link").children(".blue-overlay").stop(true, true).fadeIn(200);
    }), function() {
      $(this).children(".latest-point-green").stop(true, true).fadeOut(200);
      $(this).stop(true, true).animate({
        backgroundColor: '#636363'
      }, 200);
      return $(this).parents(".service-detail").siblings(".square").children(".img-link").children(".blue-overlay").stop(true, true).fadeOut(200);
    });
    $(".hide-bio").hover((function() {
      return $(this).animate({
        backgroundColor: '#b0bc22'
      }, 200);
    }), function() {
      return $(this).animate({
        backgroundColor: '#636363'
      }, 200);
    });
    clickShowBio = function() {
      var $fullBio, $parent, $shortBio;
      $parent = $(this).parents('.person-wrap');
      $shortBio = $parent.find(".short-bio");
      $fullBio = $parent.find(".full-bio");
      $shortBio.hide();
      $fullBio.show();
      $parent.addClass('expanded');
      return false;
    };
    loadShowBio = function() {
      var $fullBio, $parent, $shortBio;
      $parent = $('.expanded');
      $shortBio = $parent.find(".short-bio");
      $fullBio = $parent.find(".full-bio");
      $shortBio.hide();
      $fullBio.show();
      return $parent.addClass('expanded');
    };
    hideBio = function() {
      var $fullBio, $parent, $shortBio;
      $parent = $(this).parents('.person-wrap');
      $shortBio = $parent.find(".short-bio");
      $fullBio = $parent.find(".full-bio");
      $fullBio.hide();
      $shortBio.show();
      return $parent.removeClass('expanded');
    };
    $(".show-bio").click(clickShowBio);
    $(".hide-bio").click(hideBio);
    loadShowBio();
    validateForm = function() {
      var $field;
      $field = $("#keywords").val();
      if ($field === "" || null) {
        alert("Please be sure to enter a search term.");
        $("#keywords").focus();
        return false;
      } else if ($field.length < 3) {
        alert("Your search term must be at least three characters.");
        $("#keywords").focus();
        return false;
      } else {
        return true;
      }
    };
    return $(".col-right form").submit(validateForm);
  });

}).call(this);

