$(document).ready(function(){ for_you_events_init(); });

function for_you_events_init() {
/* homepage slider */

if ( $('.slider').length == 1 && $('.slider li').length > 1) {
  $('.slider').anythingSlider({
    easing: "swing",                // Anything other than "linear" or "swing" requires the easing plugin
    autoPlay: true,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not
    startStopped: false,            // If autoPlay is on, this can force it to start stopped
    delay: 6000,                    // How long between slide transitions in AutoPlay mode
    animationTime: 600,            // How long the slide transition takes
    hashTags: false,                // Should links change the hashtag in the URL?
    buildNavigation: false,          // If true, builds and list of anchor links to link to each slide
    pauseOnHover: false,             // If true, and autoPlay is enabled, the show will pause on hover
    startText: "",             // Start text
    stopText: "",               // Stop text
    navigationFormatter: null       // Details at the top of the file on this use (advanced use)
  });
}

/*end of homepage slider*/
/* desktop slider */
if ( $('.carousel').length == 1 && $('.carousel li').length > 1 ) {
  $('.carousel').anythingSlider({
    easing: "swing",                // Anything other than "linear" or "swing" requires the easing plugin
    autoPlay: true,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not
    startStopped: false,            // If autoPlay is on, this can force it to start stopped
    delay: 30000,                    // How long between slide transitions in AutoPlay mode
    animationTime: 600,            // How long the slide transition takes
    hashTags: false,                // Should links change the hashtag in the URL?
    buildNavigation: true,          // If true, builds and list of anchor links to link to each slide
    pauseOnHover: false,             // If true, and autoPlay is enabled, the show will pause on hover
    startText: "",             // Start text
    stopText: "",               // Stop text
    navigationFormatter: null       // Details at the top of the file on this use (advanced use)
  });
}
/*end of desktop slider*/

/* tab panels mouse hovering */
var mhovers = {
    ".ubuntu-home-pane-3":".ubuntu-home-pane-3 img",
    ".ubuntu-home-pane-4":".ubuntu-home-pane-4 img",
    ".err2_pane_4":".err2_pane_4 img",
    ".err2_pane_5":".err2_pane_5 img",
    ".err2_pane_6":".err2_pane_6 img",
    "#template-f #panel-flexible-112 #row-3 .f_pane_7 h4":"#template-f #panel-flexible-112 #row-3 .f_pane_7 .pane-content img",
    "#template-su #row-1 .su_pane_4":"#template-su #row-1 .su_pane_4 h6 img",
    "#template-su #row-2 .su_pane_5":"#template-su #row-2 .su_pane_5 img",
    "#template-su #row-4 .s4_pane_4":"#template-su #row-4 .s4_pane_4 img",
    "#template-su #row-5 .su_pane_5":"#template-su #row-5 .su_pane_5 img",
    "#template-su #row-9 .su_pane_4":"#template-su #row-9 .su_pane_4 img",
    "#template-su #row-11 .su_pane_2":"#template-su #row-11 .su_pane_2 img",
    ".ubuntu-home-pane-2 a span":".ubuntu-home-pane-2 img",
    "#template-g .row-wrapper-main-row .g_pane_1": "#template-g .row-wrapper-main-row .g_pane_1 img",
    "#template-u1 .u1_pane_8 a span":"#template-u1 .u1_pane_8 a img"
  };

  jQuery.each(mhovers, function(i, val) {
    $(i).hover(
      function () {
	$(val).addClass("hover"); return false;
      },
      function () {
	$(val).removeClass("hover"); return false;
      }
    );
    $(i).mousedown(
      function () {
	$(val).removeClass("hover");
	$(val).addClass("active"); return false;
      }
    );
    $(i).mouseup(
      function () {
	$(val).addClass("hover");
	$(val).removeClass("active"); return false;
      }
    );

    $(i).mouseout(
      function () {
	$(val).removeClass("active"); return false;
      }
    );
  });
}

