/**
 * File:         behaviour.css
 * Project:      Perfect Osteopathy
 * Version:      1.2
 * Last change:  06/03/11
 * Changed by:   Arnold Macauley (am)
 * Assigned to:  Diego Lago (dl)
 * Primary use:  Website
 *
 */

/**
 * jQuery on document ready 
 */
$(document).ready(function() {

/**
 * Vertical accordion home page
 */
  if ($('#vertical-accordion').length) {
    $('#vertical-accordion').verticordion();
  }

/**
 * Superfish menu
 */
  $('#navigation ul#menuElem').superfish({
    hoverClass:    'sfHover',          // the class applied to hovered list items 
    pathClass:     'overideThisToUse', // the class you have applied to list items that lead to the current page 
    pathLevels:    1,                  // the number of levels of submenus that remain open or are restored using pathClass 
    delay:         400,                // the delay in milliseconds that the mouse can remain outside a submenu without it closing 
    animation:     {opacity:'show'},   // an object equivalent to first parameter of jQuery’s .animate() method 
    speed:         'slow',           // speed of the animation. Equivalent to second parameter of jQuery’s .animate() method 
    autoArrows:    true,               // if true, arrow mark-up generated automatically = cleaner source code at expense of initialisation performance 
    dropShadows:   true,               // completely disable drop shadows by setting this to false 
    disableHI:     true,              // set to true to disable hoverIntent detection 
    onInit:        function(){},       // callback function fires once Superfish is initialised – 'this' is the containing ul 
    onBeforeShow:  function(){},       // callback function fires just before reveal animation begins – 'this' is the ul about to open 
    onShow:        function(){},       // callback function fires once reveal animation completed – 'this' is the opened ul 
    onHide:        function(){}        // callback function fires after a sub-menu has closed – 'this' is the ul that just closed 
  });
  
/**
 * Scrollable
 */
  // select #flow-quotes and make it scrollable. Use circular and navigator plugins
  $('#flow-quotes').scrollable({size: 1}).circular().navigator({
    // select A tags inside the navigator to work as items (not direct children)
    naviItem: 'a',
    // assign "current" class name for the active A tag inside navigator
    activeClass: 'current'
  }).autoscroll({
       autoplay: true,
       interval: 8000
    });

  $("#quotes-button-prev").click(function(evt) {
    // This stops the form submission.
    evt.preventDefault();
  });
  
  $("#quotes-button-next").click(function(evt) {
    // This stops the form submission.
    evt.preventDefault();
  });
  
 /**
 * Tabs Scrollable. Slideshow plugin for the Tabs
 */
  $('div.tabs').tabs('.panes > div', {
    // enable "cross-fading" effect 
    effect: 'fade',
    fadeInSpeed: 2000,
    fadeOutSpeed: 2000,
    // start from the beginning after the last tab 
    rotate: true
    
  // use the slideshow plugin. It accepts its own configuration adding functionality on top of tabs
  }).slideshow({
    autoplay: true,
    interval: 6000
  });

});

