/*
$(function() {

    $('.slideshow_wide_inner_container').cycle({random:1,timeout:'5000',speed:'700'});
    $('.slideshow_narrow').cycle({random:1,speed:'700'});
    $('.homepage_promo_band').cycle({random:1,timeout:'3500',speed:'200'});
    
});
*/


$(function() {
	
var is_image_loaded = function(img) {
    // IE
    if(!img.complete) {
        return false;
    }
    // Others
    if(typeof img.naturalWidth != "undefined" && img.naturalWidth == 0) {
        return false;
    }
    return true;
}

var first_slide = $('.slideshow_wide_inner_container img:first');
if(is_image_loaded(first_slide.get(0))) {
	$('.loading').hide();
	$('.slideshow_wide_inner_container').show();
    $('.slideshow_wide_inner_container').cycle({timeout:'5000',speed:'700'});
} else {
    first_slide.load(function(e) {
        $('.loading').hide();
		$('.slideshow_wide_inner_container').show();
        $('.slideshow_wide_inner_container').cycle({timeout:'5000',speed:'700'});
    });
    $('.slideshow_wide_inner_container').hide();
    // I'll handwave the display of a loading indicator, since
    // it's covered in the tutorial linked in the question.
    $('.loading').show();
}

// $('.homepage_promo_band').cycle({random:1,timeout:'3500',speed:'200'});

});
