$(document).ready(function() {		
	$("img[@src$=png],.png").pngfix();	//共通、PNG対応
	$("#TopSpotBnr ul li:last-child").css({"margin-right":"0"});//トップのスポットバナー
	$("#TopBnr ul li:last-child").css({"margin-bottom":"0"});
	$("#TopBlog dd:lt(1)").append("<span class='red'> new!</span>");
	$("#TopBlog dt:gt(6)").css("display", "none");
	$("#TopBlog dd:gt(6)").css("display", "none");
	$("#FooterR li:last-child").css({"background":"none"});//共通、フッタ最後のボーダー無し
	$("ul.Snav li:last-child").css({"background":"none"});//共通、Snav最後のボーダーは無し
	//$(".AccIdxBox:nth-child(5n)").css({"margin-right":"0"});//ACCのインデックス、4つ目は右マージン0
	$(".AccIdxBox:nth-child(2n)").css({"clear":"both"});//ACCのインデックス、5つ目はclear:both
	$(".gallery li:nth-child(6n)").css({"margin-right":"0"});//ACCのギャラリー、6つ目は右マージン0
	$(".BlogBox:last").css({"background":"none"});//ブログ、最後のボーダーは無し
	$(".BlogBox:last").css({"padding-bottom":"0"});//ブログ、最後のボーダーは無し
	$(".BlogBox:last").css({"margin-bottom":"0"});//ブログ、最後のボーダーは無し
	
	$(".AccIdxBox").fadeTo("slow", 1.0);
	$(".AccIdxBox").hover(function(){
		$(this).fadeTo("fast", 0.7);
		},function(){
		$(this).fadeTo("normal", 1.0);
	});
	
	$("#TopImg p,#TopSpotBnr ul li, #TopBnr ul li").fadeTo("slow", 1.0);
	$("#TopImg p,#TopSpotBnr ul li, #TopBnr ul li").hover(function(){
		$(this).fadeTo("fast", 0.7);
		},function(){
		$(this).fadeTo("normal", 1.0);
	});
		
});	




//==============================================================================
// from jquery.galleria.js
//==============================================================================
	jQuery(function($) {
		
		$('.gallery').addClass('gallery'); // adds new class name to maintain degradability
		
		$('ul.gallery').galleria({
			history   : true, // activates the history object for bookmarking, back-button etc.
			clickNext : true, // helper for making the image clickable
			insert    : '#main_image', // the containing selector for our main image
			onImage   : function(image,caption,thumb) { // let's add some image effects for demonstration purposes
				
				// fade in the image & caption
				if(! ($.browser.mozilla && navigator.appVersion.indexOf("Win")!=-1) ) { // FF/Win fades large images terribly slow
					image.css('display','none').fadeIn(1000);
				}
				caption.css('display','none').fadeIn(1000);
				
				// fetch the thumbnail container
				var _li = thumb.parents('li');
				
				// fade out inactive thumbnail
				_li.siblings().children('img.selected').fadeTo(500,0.3);
				
				// fade in active thumbnail
				thumb.fadeTo('fast',1).addClass('selected');
				
				// add a title for the clickable image
				image.attr('title','Next image >>');
			},
			onThumb : function(thumb) { // thumbnail effects goes here
				
				// fetch the thumbnail container
				var _li = thumb.parents('li');
				
				// if thumbnail is active, fade all the way.
				var _fadeTo = _li.is('.active') ? '1' : '0.3';
				
				// fade in the thumbnail when finnished loading
				thumb.css({display:'none',opacity:_fadeTo}).fadeIn(1500);
				
				// hover effects
				thumb.hover(
					function() { thumb.fadeTo('fast',1); },
					function() { _li.not('.active').children('img').fadeTo('fast',0.3); } // don't fade out if the parent is active
				)
			}
		});
	});


//==============================================================================
// Setup This Year on Copyrights
//==============================================================================
nowyear = new Date();
function ThisYear () {
		document.write(nowyear.getFullYear());
}

//==============================================================================
// Mailaddress
//==============================================================================
function infoMail() {document.write('<a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#105;&#110;&#102;&#111;&#64;&#118;&#105;&#115;&#105;&#116;&#45;&#113;&#97;&#116;&#97;&#114;&#46;&#106;&#112;">&#105;&#110;&#102;&#111;&#64;&#118;&#105;&#115;&#105;&#116;&#45;&#113;&#97;&#116;&#97;&#114;&#46;&#106;&#112;</a>')
}



//==============================================================================
// PRINT
//==============================================================================
function PrintOut() {
if (navigator.userAgent.match(/msie (\d)/i))
v = (eval(RegExp.$1) >= 5) ? 1 : 0;
else if (self.innerWidth)
v = (eval(navigator.appVersion.charAt(0)) >= 4) ? 1 : 0;
else v = 0;

/* print() が使えるブラウザなら印刷を実行 */
if (v) self.print();
else alert("お使いのブラウザではこの機能は利用できません。[メニュー]より印刷をしてください。");
}
