jQuery(document).ready(function(){ 
	jQuery('#slickWrap').hide();
	getSlick();		
});

function fadezin() {
    jQuery('#slickWrap').hide();
    jQuery('#slickWrap').fadeIn(2500, function() {
        setTimeout(function() {
            jQuery('#slickWrap').fadeOut(2500, function() {
                getSlick();
            });
        }, 7000)
    });
}

function getSlick() {
    jQuery.ajax({
        url: '/slides/',
        cache: false,
        dataType: "json",
        success: function(json) {
            jQuery('#slickImg').attr({
                src: json[0].fields.image,
                width: 602,
                height: 202
            });            
        }
    });
    // timer eliminates last image to new image flicker
    setTimeout(function() {
        fadezin();
    }, 500)
}

	






