$.preloadImages = function() {
    for (var i = 0; i < arguments.length; i++) {
        jQuery("<img>").attr("src", arguments[i]);
    }
};

$(function() { $("#top-nav ul").lavaLamp({ fx: "backout", speed: 700 })}); 
function slideSwitch() {
    var $next;
    var $active = $('#slides IMG.active');

    if ($active.attr('src') == $('#slides IMG:last').attr('src')) {
        $next = $('#slides IMG:first');
    }
    else {
        $next = $active.next('IMG');
    }

    $active.fadeOut(1000, function() {
        $active.removeClass('active');
        $next.addClass('active');
        $next.fadeIn(1000);
    });
}
/*$(function() {
	$('#slides IMG:first').addClass('active').fadeIn('slow');
	setInterval(slideSwitch, 6000);
});*/
$.preloadImages("wp-content/themes/ls/images/athlete1.jpg",
				"wp-content/themes/ls/images/athlete2.jpg",
				"wp-content/themes/ls/images/athlete3.jpg",
				"wp-content/themes/ls/images/athlete4.jpg",
				"wp-content/themes/ls/images/boxing1.jpg",
				"wp-content/themes/ls/images/boxing2.jpg",
				"wp-content/themes/ls/images/boxing3.jpg",
				"wp-content/themes/ls/images/football1.jpg",
				"wp-content/themes/ls/images/football2.jpg",
				"wp-content/themes/ls/images/golf1.jpg",
				"wp-content/themes/ls/images/golf2.jpg",
				"wp-content/themes/ls/images/golf3.jpg",
				"wp-content/themes/ls/images/sports1.jpg",
				"wp-content/themes/ls/images/sports2.jpg",
				"wp-content/themes/ls/images/sports3.jpg",
				"wp-content/themes/ls/images/sports4.jpg",
				"wp-content/themes/ls/images/sports5.jpg",
				"wp-content/themes/ls/images/sports6.jpg");
$('#slides').cycle('fade');
