﻿$(document).ready(function() {
  // Bouncing icons
  $(".icon img").mouseover(function() {
    $(this).animate({ top: 10 }, "fast", "easeOutCirc");
    $(this).animate({ top: 0 }, "fast", "easeOutCirc");
  })

  // Sub-nav
  $("#ctl00_HyperLink1").click(function() {
    if ($("#ctl00_BulletedList1").css("height") == "145px") {
      $("#ctl00_BulletedList1").animate({ "height": 0 }, "slow", "easeOutCirc");
    } else {
    $("#ctl00_BulletedList1").animate({ "height": 145 }, "fast", "easeOutCirc");
    }
  })

  // Contact form
  $("#handle").click(function() {
    if ($("#contact").css("right") == "-370px") {
      $("#contact").animate({ "right": 0 }, "slow", "easeInBack");
    } else {
      $("#contact").animate({ "right": -370 }, "fast", "easeInBack");
    }
  })
  $("#container").click(function() {
    $("#contact").animate({ "right": -370 }, "fast", "easeInBack");
  })

  // Fancy nav
  $("#nav a").mouseenter(function() {
    $(this).fadeTo("fast", .8);
    $(this).fadeTo("fast", 1);
  });
})

var animIndex = -1;
function ReturnAnimationIndexToPlay() {
  animIndex++;
  animIndex = (animIndex) % 2;
  return animIndex;
}

