$(document).ready(function() {
	$('.bites-container').css('height',$('.bites').height()+'px');
	$('.bites-container').css('overflow','visible');
	$('.bites').accordion({
		fillSpace: true,
		header: "a.title"
	});
	$('a.title').click(function() {
		if(!$(this).hasClass("open")) {
			$('a.open').removeClass("open");
			$(this).addClass("open");
		}
	});
	$('.copy').accordion("destroy");
	$('.ui-accordion-header').click(function() {
		$(this).siblings('div').children('.copy').css('display','block');
		$(this).parents('li').css('border-bottom','1px solid #E5E5E5');
	});
	
	$('.bites li .copy').jScrollPane({
		showArrows: true,
		scrollbarWidth: 14,
		dragMinHeight: 34,
		dragMaxHeight: 34
	});
	$('.jScrollPaneContainer:first').css('margin-left','-2px');
	$('.jScrollPaneContainer:first .copy').css('padding-left','12px');
	$('.jScrollPaneContainer:not(:first)').css('margin-left','-3px');
	$('.jScrollPaneContainer:not(:first) .copy').css('padding-left','13px');
	$('.jScrollPaneContainer').css('height',$('.jScrollPaneContainer').height() - 4 + 'px');
	//if($.browser.msie) { 
	//	$('.bites-container').css('margin-bottom','14x');
	//}
	if($.browser.msie && $.browser.version < 7) {
		$('.jScrollPaneContainer').css('height',$('.jScrollPaneContainer').height() - 14 + 'px');
	}
	$('.bites .copy').css("overflow","auto");
	$('.bites .copy').jScrollPane({
		showArrows: true,
		scrollbarWidth: 14,
		dragMinHeight: 34,
		dragMaxHeight: 34
	});
	$('.jScrollPaneContainer:not(:first)').css('display','none');
});
