/*
 * Tabs
 * ver 0.5.3
 * creat on: 2010.01.05 Ryoma.A
 * edit  on: 2010.08.24
 */

$(function() {
	
	function Tabs() {
		
		$(window).one('load', function() {
			var thisHash = location.hash;
			
			if (!thisHash) {
				$($('ul.tabs a.active').attr('href')).show();
			} else {
				$('ul.tabs li a').removeClass('active');
				$('ul.tabs li').find('a[href = ' + thisHash + ']').addClass('active');
				$(thisHash).show();
			}
		});
		
		$('.tabs > li > a').click(function() {
			
			$($('a.active').attr('href')).hide();
			$('a.active').removeClass('active');
			$(this).addClass('active');
			
			var t = $(this).attr('href');
			
			$(t).children().hide();
			$(t).show();
			$(t).children('*:not(.noscript, .display-block)').show();
			
			return false;
		});
	
	
		$('.tabs > li > a').mousedown(function() {
			var t = $(this).attr('href');
			location.hash = t;
		});
	
	}
	
	Tabs();
	
});


