function banner_carousel_callback(carousel) {

    $('#banner_button_left a').bind('click', function() {
        //carousel.startAuto(0);
        carousel.prev();
        return false;
    });

    $('#banner_button_right a').bind('click', function() {
        //carousel.startAuto(0);
        carousel.next();
        return false;
    });
    
    // Pause autoscrolling if the user moves with the cursor over the clip.
    $('#banner_button_left a').hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
    
    // Pause autoscrolling if the user moves with the cursor over the clip.
    $('#banner_button_right a').hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
    
};

$(document).ready(

	function() {
		
		$("#banner ul").jcarousel({
			scroll: 1,
			auto: 4,
			wrap: 'circular',
			initCallback: banner_carousel_callback,
			// This tells jCarousel NOT to autobuild prev/next buttons
			buttonNextHTML: null,
			buttonPrevHTML: null
		});
		
	}
	
);


jQuery(function() {
	jQuery.getFeed({
		url: 'proxy.php?url=http://kcrsolutions.wordpress.com/feed/',
		success: function(feed) {
			
			li_items = '';
			
			for(var i = 0; i < feed.items.length && i < 3; i++) {
			
				var item = feed.items[i];
				
				li_items += '<li><a href="' + item.link + '">' + item.title + '<br />';
				li_items += '<small>' + item.updated + '</small></a></li>';
			}
			
			var html = '<ul>' + li_items + '</ul>';
			
			$('#blog_feed').html(html);
		}    
	});
});

