﻿$(document).ready(function(){



// ページトップ・アンカー
// -------------------------------------------------------------------------------
$("#pagetop a,.pagetop a, #anchor a, .anchor a").click(function(){
	$('html,body').animate({ scrollTop: $($(this).attr("href")).offset().top },'fast');
	return false;
});





// ロールオーバー
// -------------------------------------------------------------------------------
$('a img').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'));
	}
});



// アコーディオン
// -------------------------------------------------------------------------------
$(function() {
	$('#accordion dd').hide();
	$('#accordion dt a').click(function(){
		$('#accordion dd').slideUp('fast');
		$(this).parent().next().slideDown('fast');
		return false;
	});
});



// ブックマークに追加
// -------------------------------------------------------------------------------
// add a "rel" attrib if Opera 7+
if(window.opera) {
	if ($(".bookmark").attr("rel") != ""){
		$(".bookmark").attr("rel","sidebar");
	} 
}
$(".bookmark").click(function(event){
	event.preventDefault();
	var url = this.href;
	var title = this.title;
	
	if (window.sidebar) { // Mozilla Firefox Bookmark
		window.sidebar.addPanel(title, url,"");
	} else if( window.external ) { // IE Favorite
		window.external.AddFavorite( url, title);
	} else if(window.opera) { // Opera 7+
		return false; // do nothing
	} else { 
		 alert('Unfortunately, this browser does not support the requested action,'
		 + ' please bookmark this page manually.');
	}
});



});



// ロールオーバー
// -------------------------------------------------------------------------------
function smartRollover() {
	if(document.getElementsByTagName) {
		var images = document.getElementsByTagName("img");
		for(var i=0; i < images.length; i++) {
			if(images[i].getAttribute("src").match("_off."))
			{
				images[i].onmouseover = function() {this.setAttribute("src", this.getAttribute("src").replace("_off.", "_on."));}
				images[i].onmouseout = function() {this.setAttribute("src", this.getAttribute("src").replace("_on.", "_off."));}
			}
		}
	}
}
if(window.addEventListener) {window.addEventListener("load", smartRollover, false);}
else if(window.attachEvent) {window.attachEvent("onload", smartRollover);}



// Biggerlink
// ------------------------------------------------------------------------------------------
(function(a){a.fn.biggerlink=function(b){var c={biggerclass:"bl-bigger",hoverclass:"bl-hover",hoverclass2:"bl-hover2",clickableclass:"bl-hot",otherstriggermaster:true,follow:"auto"};if(b){a.extend(c,b)}a(this).filter(function(){return a("a",this).length>0}).addClass(c.clickableclass).css("cursor","pointer").each(function(g){var d=a(this).data("biggerlink",{hovered:false,focused:false,hovered2:false,focused2:false});var e={all:a("a",this),big:a(this),master:a("a:first",this).data("biggerlink",{status:"master"}).addClass(c.biggerclass),other:a("a",this).not(a("a:first",this)).data("biggerlink",{status:"other"})};a("a",this).andSelf().each(function(){var i=a.extend(a(this).data("biggerlink"),e);a(this).data("biggerlink",i)});var h=d.attr("title");var f=d.data("biggerlink").master.attr("title");if(f&&!h){d.attr("title",f)}d.mouseover(function(i){window.status=a(this).data("biggerlink").master.get(0).href;a(this).addClass(c.hoverclass);a(this).data("biggerlink").hovered=true}).mouseout(function(i){window.status="";if(!a(this).data("biggerlink").focused){a(this).removeClass(c.hoverclass)}a(this).data("biggerlink").hovered=false}).bind("click",function(i){if(!a(i.target).closest("a").length){a(this).data("biggerlink").master.trigger({type:"click",source:"biggerlink"});i.stopPropagation()}});e.all.bind("focus",function(){a(this).data("biggerlink").big.addClass(c.hoverclass);a(this).data("biggerlink").big.data("biggerlink").focused=true}).bind("blur",function(){if(!a(this).data("biggerlink").big.data("biggerlink").hovered){a(this).data("biggerlink").big.removeClass(c.hoverclass)}a(this).data("biggerlink").big.data("biggerlink").focused=false});e.master.bind("click",function(i){if(i.source=="biggerlink"){if(c.follow===true||c.follow=="auto"&&i.result!==false){window.location=a(this).attr("href")}else{i.stopPropagation()}}});if(c.otherstriggermaster){e.other.addClass(c.biggerclass).bind("click",function(i){a(this).data("biggerlink").master.trigger({type:"click",source:"biggerlink"});i.preventDefault();i.stopPropagation()})}else{e.other.bind("focus",function(){a(this).data("biggerlink").big.addClass(c.hoverclass2);a(this).data("biggerlink").big.data("biggerlink").focused2=true}).bind("blur",function(){if(!a(this).data("biggerlink").big.data("biggerlink").hovered2){a(this).data("biggerlink").big.removeClass(c.hoverclass2)}a(this).data("biggerlink").big.data("biggerlink").focused2=false}).bind("mouseover",function(i){a(this).data("biggerlink").big.addClass(c.hoverclass2);a(this).data("biggerlink").big.data("biggerlink").hovered2=true;i.stopPropagation()}).bind("mouseout",function(i){if(!a(this).data("biggerlink").big.data("biggerlink").focused2){a(this).data("biggerlink").big.removeClass(c.hoverclass2)}a(this).data("biggerlink").big.data("biggerlink").hovered2=false;i.stopPropagation()});if(!e.other.attr("title")){e.other.attr("title","")}}});return this}})(jQuery);

$(function(){
	$('.biggerlink > li').biggerlink();
});



// コピーライトの年号取得
// ------------------------------------------------------------------------------------------
function printDate() {
	myDate = new Date();
	myYear = myDate.getFullYear();
	document.write(myYear);
}



