$(function(){
	var prismId = 0;
	$('ul.thumb-prism li dl').hide();

	if($('ul.thumb-prism li:nth-child('+(prismId+1)+') dl').text()) {
		prismId = prismId+1;
		$('a.prism-prev').fadeTo('fast', 0.45);
		if(!$('ul.thumb-prism li:nth-child('+(prismId+1)+') dl').text()) {
			$('a.prism-next').fadeTo('fast', 0.45);
		}
		$('ul.thumb-prism li:nth-child('+prismId+') dl').show();
	}

	toggleTab('tab-notice');
	$('.notice a.notice-tab').bind('click focus mouseenter', function(){
		var tabId = $(this).attr('class').split(' ');
		toggleTab(tabId[1]);
		return false;
	});

	$('a.prism-prev').click(function(){
		if($('ul.thumb-prism li:nth-child('+(prismId-1)+') dl').text()) {
			$('ul.thumb-prism li dl').hide();
			prismId = prismId-1;
			if(!$('ul.thumb-prism li:nth-child('+(prismId-1)+') dl').text()) {
				$(this).fadeTo('fast', 0.45);
			} else {
				$(this).fadeTo('fast', 1);
			}
			if(!$('ul.thumb-prism li:nth-child('+(prismId+1)+') dl').text()) {
				$('a.prism-next').fadeTo('fast', 0.45);
			} else {
				$('a.prism-next').fadeTo('fast', 1);
			}
			$('ul.thumb-prism li:nth-child('+prismId+') dl').show();
		}
		return false;
	});
	$('a.prism-next').click(function(){
		if($('ul.thumb-prism li:nth-child('+(prismId+1)+') dl').text()) {
			$('ul.thumb-prism li dl').hide();
			prismId = prismId+1;
			if(!$('ul.thumb-prism li:nth-child('+(prismId-1)+') dl').text()) {
				$('a.prism-prev').fadeTo('fast', 0.45);
			} else {
				$('a.prism-prev').fadeTo('fast', 1);
			}
			if(!$('ul.thumb-prism li:nth-child('+(prismId+1)+') dl').text()) {
				$(this).fadeTo('fast', 0.45);
			} else {
				$(this).fadeTo('fast', 1);
			}
			$('ul.thumb-prism li:nth-child('+prismId+') dl').show();
		}
		return false;
	});
});
function toggleTab(tabId) {
	$('.notice ol, .notice a.more').hide();
	$('.notice a.notice-tab').removeClass('active');
	$('.notice a.notice-tab.'+tabId).addClass('active');
	$('.notice a.more.'+tabId).show();
	$('.notice ol.'+tabId).show();
}