﻿/* jQuery.whynot.index.js - Kezdőlapi animációk */
jQuery(document).ready(function($) {
  // Menü
  $('.menu').find('a').hover(
    // Hover
    function() {
      var current_class = $(this).parent().attr("class").replace(/^(\S*).*/, '$1');
      $(this).addClass('active', 100);
      $("#index-overlays a."+current_class).stop().animate({"opacity": "1"}, 700);
      //$("#index-overlays a."+current_class).stop().css("opacity", "1");
    },
    // Out
    function() {
      var current_class = $(this).parent().attr("class").replace(/^(\S*).*/, '$1');
      $(this).removeClass('active', 100);
      $("#index-overlays a."+current_class).stop().animate({"opacity": "0"}, 300);
      //$("#index-overlays a."+current_class).stop().css("opacity", "0");
    }
  );
  // Képek
  $('#index-overlays').find('a').hover(
    // Hover
    function() {
      var current_class = $(this).attr("class");
      $(this).stop().animate({"opacity": "1"}, 700);
      //$(this).stop().css("opacity", "1");
      $(".menu li." + current_class + " a").addClass('active');
    },
    // Out
    function() {
      var current_class = $(this).attr("class");
      $(this).stop().animate({"opacity": "0"}, 300);
      //$(this).stop().css("opacity","0");
      $(".menu li."+current_class+" a").removeClass('active');
    }
  );
});
