$(function(){
	// ロールオーバー
	$('a img').hover(
		function() {
			if ($(this).parent().parent().parent().attr("class") != "roll") {
				if ($(this).parent().attr("class") != "fade") {
					$(this).fadeTo(1, 0.7);
				}
			}
		},function() {
			$(this).fadeTo(100, 1);
		}
	);
	$('.fade').hover(
		function() {
			$(this).fadeTo(1, 0.7);
		},function() {
			$(this).fadeTo(100, 1);
		}
	);

	// ロールオーバーなしイメージ
	$('.roll a img').hover(function(){
		$(this).fadeTo(1, 1.0);
		$(this).attr('src', $(this).attr('src').replace('_off', '_on'));
	}, function(){
		if (!$(this).hasClass('currentPage')) {
			$(this).attr('src', $(this).attr('src').replace('_on', '_off'));
		}
	});
	$('.roll input').hover(function(){
		$(this).attr('src', $(this).attr('src').replace('_off', '_on'));
	}, function(){
		if (!$(this).hasClass('currentPage')) {
			$(this).attr('src', $(this).attr('src').replace('_on', '_off'));
		}
	});

	// ページ内リンク
	$('a[href^=#]').click(function(){
		var target;
		target = $($(this).attr('href'));
		if (target.length == 0) {
			return;
		}
		$('html, body').animate({scrollTop: target.offset().top});
	return false;
	});

	// 外部リンク
	$("a[href^='http:']").not("[href*='http://www.goodfellas']").not("[href*='http://www.youtube.com']").attr("target","_blank");
	$("a[href^='http:']").not("[href*='http://www.goodfellas']").not("[href*='http://www.youtube.com']").not($("a[href^=http]").find('img').parents('a')).addClass("blank");

	// PDF別ウィンドウ表示
	$("a[href$='.pdf']").attr("target","_blank");

	// Facebok
	var url = "http%3A%2F%2Fwww.facebook.com%2Fpages%2FGOODFELLASCLUB%2F146959512042755";
	$('#facebook').append("<iframe src=\"http://www.facebook.com/plugins/likebox.php?href=" + url + "&amp;width=215&amp;colorscheme=light&amp;show_faces=false&amp;stream=false&amp;header=true&amp;height=100\" scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:215px; height:100px;\" allowTransparency=\"true\"></iframe>");
});


// 月送りプルダウン
function nav(sel) {
	if (sel.selectedIndex == -1) return;
	var opt = sel.options[sel.selectedIndex];
	if (opt && opt.value)
	location.href = opt.value;
}

