jQuery(function($){
	$(document).ready(function(){
		$('#navigation li:last').addClass('last');
		$('.peach').next('br').remove();
		$('ul.left').next('br').remove();
		$('ul.right').next('div').next('br').remove();
		$('.white-content').each(function() {
			if ($(this).height() > 15) {
				$(this).parent().addClass('twoline');
			}	
		});
		$('.inner-entry p:first').replaceWith($('.inner-entry p:first').html());
		$("p").filter( function() {
			return $.trim($(this).html()) == '';
		}).remove();

		$('.close-news').click(function() {
			$('.news-drop').slideUp();
			$('.news-padding').slideUp();
			return false;	
		});

		if (window.show_news == 'yes') {
			function show_the_news() {
				$('.news-drop').slideDown();
				$('.news-padding').slideDown();
			}
			window.setTimeout( show_the_news, 2000 ); 	
		}

		/* JCAROUSEL */
		$('.slider').jcarousel({
			wrap: 'both',
			scroll: 1,
			auto: 5,
			visible: 1,
			initCallback: init_carousel,
			itemFirstInCallback: function(carousel, item, idx, state) {
			}
			
		});

	});
});

function init_carousel(carousel) {
	jQuery('#slider-nav a').click(function(){
		var idx = jQuery(this).index()+1;
		carousel.scroll( idx );
		return false;
	});
}
