jQuery.fn.exists = function(){return jQuery(this).length>0;}
$(function () {
   function makeRight () {
      if ($(this).css('left') != '0px') {
         return;
      }
      var temp = this;
      //$('.animatedSlider').stop().animate({ left: 0 }, 'fast');
      $('.animatedSlider').stop().animate({ left: 0 }, 50);
      $('.anim_content:visible').stop().fadeOut(50, function () {
         $('#'+$(temp).attr('reveal')).stop().fadeIn(50);
      });
      //$(this).stop().animate({ left: 20 }, 'fast');
      $(this).stop().animate({ left: 20 }, 50);
   }
	
   function makeLeft () {
      //$(this).stop().animate({ left: 0 }, 'fast');
   }

   var config = {
      sensitivity: 2, // number = sensitivity threshold (must be 1 or higher)
      interval: 100, // number = milliseconds for onMouseOver polling interval
      over: makeRight, // function = onMouseOver callback (REQUIRED)
      timeout: 500, // number = milliseconds delay before onMouseOut
      out: makeLeft // function = onMouseOut callback (REQUIRED)
   };

   if ($("#anim_features").exists()) {
      $("#anim_features img").hoverIntent( config );
   }

   $('.expandingbuttons').bind('click', function() {
      $(this).parents('.ExpandableBoxControl')
      .find('.expandingbuttons')
      .toggle()
      .end()
      .find('.ExpandableBox')
      .toggle(500);
   });

   $("#supportSlider").easySlider({
      controlsBefore:	'<p id="controls">',
      controlsAfter:	'</p>',
      auto: true,
      continuous: true,
      pause: 8000
   });

});


