
// --------------------------------> BACK BUTTON

jQuery.fn.fadeToggle = function(speed, easing, callback) {
  return this.animate({opacity: 'toggle'}, speed, easing, callback);  
};

jQuery(document).ready(function() {
  jQuery('#back-blind').hide();
  jQuery('#back-fade').hover(function() {
    jQuery(this).next().fadeToggle('slow');
  });
  
});

jQuery.fn.slideFadeToggle = function(speed, easing, callback) {
  return this.animate({opacity: 'toggle', height: 'toggle'}, speed, easing, callback);  
};

jQuery(document).ready(function() {
  jQuery('#slide-fade').hover(function() {
    jQuery(this).next().slideFadeToggle('slow', function() {
      var jQuerythis = jQuery(this);
      if (jQuerythis.is(':visible')) {
        jQuerythis.text('Successfully opened.');
      } else {
        jQuerythis.text('Sucessfully closed.');
      }
    });
  });
  
});

jQuery.fn.blindToggle = function(speed, easing, callback) {
  var h = this.height() + parseInt(this.css('paddingTop')) + parseInt(this.css('paddingBottom'));
  return this.animate({marginTop: parseInt(this.css('marginTop')) < 0 ? 0 : -h}, speed, easing, callback);  
};

jQuery(document).ready(function() {
  var jQuerybox = jQuery('#box')
    .wrap('<div id="box-outer"></div>');
  jQuery('#back-blind').hover(function() {
    jQuerybox.blindToggle('slow');  
  });    
});


// --------------------------------> NEXT BUTTON

jQuery.fn.fadeToggle = function(speed, easing, callback) {
  return this.animate({opacity: 'toggle'}, speed, easing, callback);  
};

jQuery(document).ready(function() {
  jQuery('#next-blind').hide();
  jQuery('#next-fade').hover(function() {
    jQuery(this).next().fadeToggle('slow');
  });
  
});

jQuery.fn.slideFadeToggle = function(speed, easing, callback) {
  return this.animate({opacity: 'toggle', height: 'toggle'}, speed, easing, callback);  
};

jQuery(document).ready(function() {
  jQuery('#slide-fade').hover(function() {
    jQuery(this).next().slideFadeToggle('slow', function() {
      var jQuerythis = jQuery(this);
      if (jQuerythis.is(':visible')) {
        jQuerythis.text('Successfully opened.');
      } else {
        jQuerythis.text('Sucessfully closed.');
      }
    });
  });
  
});

jQuery.fn.blindToggle = function(speed, easing, callback) {
  var h = this.height() + parseInt(this.css('paddingTop')) + parseInt(this.css('paddingBottom'));
  return this.animate({marginTop: parseInt(this.css('marginTop')) < 0 ? 0 : -h}, speed, easing, callback);  
};

jQuery(document).ready(function() {
  var jQuerybox = jQuery('#box')
    .wrap('<div id="box-outer"></div>');
  jQuery('#next-blind').hover(function() {
    jQuerybox.blindToggle('slow');  
  });    
});
