//
//
//
// @ shinji suetsugu



// days
document.write("</style>\n");
function copyYear() {
	year = new Date().getFullYear();
	document.write(year);
}

//print
function PrintPage(){
	if(document.getElementById || document.layers){
		window.print();	
	}
}

function openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

//scroll pageTop for jQuery 
jQuery.easing.quart = function(x,t,b,c,d){
        return (t==d) ? b+c : c*(-Math.pow(2,-10*t/d)+1)+b;
}
$(document).ready(function(){
        $('a[href^=#]').click(function(){
                if(location.pathname.replace(/^\//,'')==this.pathname.replace(/^\//,'') && location.hostname==this.hostname){
                        var $target = $(this.hash);
                        var targetObj = navigator.appName.match(/Opera/) ? 'html':'html,body';
                        $target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
                        if($target.length){
                                var targetOffset = $target.offset().top;
                                $(targetObj).animate({scrollTop:targetOffset},1200,'quart');
                                return false;
                        }
                }
        });
});


$(function(){
	//現在居るファイル名	   
	var currentFile = location.href.split('/').pop();
	
	//ua取得
	var ua = navigator.userAgent;

	/* ウィンク効果 */
	
	$("#side_link li a img").hover(function(){
		$(this).css("opacity", "0.2");
		$(this).css("filter", "alpha(opacity=20)");
		$(this).fadeTo("slow", 1.0);
	});
	
	$("#other p a img").hover(function(){
		$(this).css("opacity", "0.2");
		$(this).css("filter", "alpha(opacity=20)");
		$(this).fadeTo("slow", 1.0);
	});
	
	$('div[class$="unitList clearfix"] div:nth-child(even)').addClass('even');
	
	//rollover
	$('a img').each(function(){
		var imgSrc = $(this).attr('src');
		//smartRollover
		if(imgSrc.match(/(.*)_off(\..*)/)){
			var repSrc = RegExp.$1+'_on'+RegExp.$2;
			$('<img />').attr('src',repSrc);
			$(this).hover(function(){
				$(this).attr('src',repSrc);
				$(this).css({opacity: '1',filter: 'alpha(opacity=100)'});
			},function(){
				$(this).attr('src',imgSrc);
			});
		//ロールオーバーが無い場合は、透明度80%
		}else if(!$(this).hasClass('not')){
			$(this).hover(function(){
					$(this).css({
						opacity: '0.7',
						filter: 'alpha(opacity=70)'
					});
			},function(){
					$(this).css({
						opacity: '1',
						filter: 'alpha(opacity=100)'
					});
			}
			
			);
		}
	});

});
