var TAB_NAME = {
				'#features':'log/features.html',
				'#design':'log/design.html',
				'#function':'log/function.html',
				'#spec':'log/spec.html',
				'#face':'log/face.html'
			}

$(function(){
	
	/* 新規ウィンドウ */
	$('.comparison a').click(function(e){
		e.preventDefault();
		window.open('../dolls/comparison.html','comparison','width=' + window.screen.width + ',height=' + window.screen.height + 'top=0, left=0,toolbar=yes,scrollbars=yes');
	})
	
	/* タブ機能 */
	var loc = location.href.substr(location.href.indexOf('#'));
	
	if(TAB_NAME[loc] && loc != '#features' ){
		setState(loc)
	}else{
		setState('#features')
	}
	
	
	$('.features a,.design a,.function a,.spec a,.face a').click(function(e){
		e.preventDefault();
		if(!$(this).hasClass('selected')){
			loc = $(this).attr('href');
			setState(loc)
		}
	})
		
	function resetState(){
		$('.productinfo').css('display','none');
		$('#doll_navi li a').removeClass('selected');
	}
	
	function setState(location){
		resetState();
		$(location).css('display','block');
		$('#doll_navi .' + location.substr(1) + ' a').addClass('selected')
		$(document).scrollTop(0);
	}
	
	
	/* 詳しいボディサイズLightbox */
	$('#body_detail_button').fancybox({'imageScale':false,'padding':30,'hideOnContentClick':false,'frameWidth':540,'frameHeight':757,'centerOnScroll':false});
	
})