// JavaScript Document

/* fancybox */

$(document).ready(function() {

	/* This is basic - uses default settings */
	
	$("a.fancybox").fancybox({
		'autoScale'			: true,
		'transitionIn'		: 'none',
		'transitionOut'		: 'none'
	});
	
	/* Using custom settings */
	
	$("a#inline").fancybox({
		'hideOnContentClick': true
	});

	/* Apply fancybox to multiple items */
	
	$("a.group").fancybox({
		'transitionIn'	:	'elastic',
		'transitionOut'	:	'elastic',
		'speedIn'		:	600, 
		'speedOut'		:	200, 
		'overlayShow'	:	false
	});

	$("a[rel=fb_group]").fancybox({
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'titlePosition'		: 'inside',
		'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
		return 'サンプル画面 ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '';
		}
	});
	$("a[rel=fb_group2]").fancybox({
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'titlePosition'		: 'inside',
		'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
		return 'サンプル画面 ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '';
		}
	});
	$("a[rel=fb_group3]").fancybox({
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'titlePosition'		: 'inside',
		'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
		return 'サンプル画面 ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '';
		}
	});

	$("a.fancybox_html").fancybox({
		'width'				: '75%',
		'height'			: '75%',
		'autoScale'			: false,
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe'
	});

	$("a.fancybox_html_l").fancybox({
		'width'				: '90%',
		'height'			: '90%',
		'autoScale'			: false,
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'type'				: 'iframe',
		'titleShow'			: false
	});
	
	

	//dl.slideでのスライドメニュー
	//CSSの設定
	$("dl.slide dt").css("cursor","pointer"); //dt要素のカーソルをポインターに変更
	$("dl.slide dd").css("display","none"); //最初のdd要素以外を非表示
	
	$("dl.slide dt.opend+dd").css("display","block"); //opendクラスが指定されている場合は開く
	$("dl.slide dt.opend .img-off").css("display","none");
	$("dl.slide dt.opend .img-on").css("display","block");
	
	//dt要素がクリックされたときの動作
	$("dl.slide dt").click(function(){
		if($("+dd",this).css("display")=="none"){ //クリックされたdt要素に隣接するdd要素が非表示だった場合
			$("+dd",this).slideDown("fast"); //クリックされたdt要素に隣接するdd要素をスライドダウンで表示
		} else {
			$("+dd",this).slideUp("fast"); //クリックされたdt要素に隣接するdd要素が表示されていた場合、スライドアップで非表示
		}
	});



	
});
