/*
Author: Elan Clarkson
*/

var removed = false;


// Remove empty slide
function onafter(curr, next, opts, fwd) {
	if (!removed) {
		// on the first pass, removeSlide is undefined (plugin hasn't yet created the fn yet) 
		if (!opts.removeSlide) {return;}

		// Remove the first slide
		opts.removeSlide();

		removed = true;
	}
}


$(document).ready(function() {
	$('#large_logo').delay(2000).animate({
	 	marginLeft: "-400px"
  		}, 1000, function() {
  	});

	$('.slideshow').cycle({
		fx: 'scrollLeft',
		after: onafter,
		speed: 1000,
		timeoutFn: function (curr, next, options, forward) {
			if ($(curr).hasClass("first")) {
				return 2000;
			}
			else {
				return 4000;
			}
       	} 
	});

	$('.slide a').mouseover(function() {
		$('.slideshow').cycle("pause");
	}).mouseout(function() {
		$('.slideshow').cycle("resume");
	});
});
