function slideSwitch() {
    var $active = $('#slideshow IMG.active');
    if ( $active.length == 0 ) $active = $('#slideshow IMG:last');
    var $next =  $active.next().length ? $active.next()
        : $('#slideshow IMG:first');

    // Comment the next 3 lines to pull the images in order.
    
    var $sibs  = $active.siblings();
    var rndNum = Math.floor(Math.random() * $sibs.length );
    var $next  = $( $sibs[ rndNum ] );
    $active.addClass('last-active');
    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}
$(function() {
    setInterval( "slideSwitch()", 4000 );
});

$(function(){
	$('.ats div, .faqs div').alternate();
});

(function($){
	
	$.fn.alternate = function(options,fnClick) {
		var opts = $.extend({}, $.fn.alternate.defaults, options);
		return this.each(function(i) {

			/* Support $.meta plugin */
			
			var $this = $(this), o = $.meta ? $.extend({}, opts, $this.data()) : opts;
			
			/* Alternate <tr> class */
			
			if(i % 2 == 0 && opts.even.length){
				$this.removeClass(opts.odd)
					.addClass(opts.even);
			} else if(opts.odd.length){
				$this.removeClass(opts.even)
					.addClass(opts.odd);
			};
			
			/* Add optional onclick behavior */
			
			if(fnClick){
				$this.click(fnClick);
			};
			
			/* Add optional "hover" class */
			
			if(opts.hover){
				$this.bind('mouseenter mouseleave', function(e){
					$(this).toggleClass('hover');
				});
			};
		});
	};

  $.fn.alternate.defaults = {
  	odd : 'odd'
  	,even : 'even'
  	,hover : false
  };

})(jQuery);
