/*

File: custom.js

For: UtiSpain
Author: JotaWeb Rare Design
Created: 10/03/2011

*/


/* Fancybox */
jQuery(document).ready(function() {

  //display video
  $("a[rel=category_group]").fancybox({
    'opacity'    : true,
    'overlayShow'         : true,
    'overlayOpacity'     : 0.5,
    'transitionIn'  : 'elastic',
    'transitionOut'  : 'elastic'
  });

});

/* Home Scripts */
$(document).ready(function() {

  /* Header Slideshow */
  $('.slideshow').cycle({
    fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
  });
  $('div.slideshow').css("visibility","visible");

  /* Video Zoom */               
  $("a.fancy img").mouseover(function(){
    $(this).stop(true,true);
    $(this).fadeTo(300, 0.6);
  });
  
  $("a.fancy img").mouseout(function(){
    $(this).fadeTo(400, 1.0);
  });
  
  /* Video Button */
  $('#slidebottom button').click(function() { $(this).next().slideToggle(); });  
  $('.ribbonVideo').click(
    function() {
      if ($(this).hasClass('on')) {
        $(this).removeClass('on');
        $(this).addClass('off');
      } else if ($(this).hasClass('off')) {
        $(this).removeClass('off');
        $(this).addClass('on');
      } else {
        $(this).addClass('on');
      }
    }
  );  
  $('#slidebottom button').next().delay(1000).slideToggle();
  /* Tipsy jQuery Plugin */  
  $(function() { $('.tooltip').tipsy({fade: true});; });
 
});


/*jCarousel*/
  jQuery(document).ready(function() {
    jQuery('#mycarousel').jcarousel();
  });
