jQuery(function(){
	jQuery("a[href^='http']").not("[href*='"+location.hostname+"']").attr("target","_blank");
	jQuery("a[href$='.pdf']").attr("target","_blank").addClass("pdf");
	jQuery("#back-top").hide();

	//スクロールされたら
	jQuery(window).scroll(function () {
		IE = navigator.userAgent.indexOf("MSIE");
		//100pxいったら
		if (jQuery(this).scrollTop() > 500) {
			//トップに戻るをフェードイン
			if(IE != -1) {
				jQuery('#back-top').show();
			}else{
				jQuery('#back-top').fadeIn();
			}
			//100pxいかなかったら
		} else {
			//隠す
			if(IE != -1) {
				jQuery('#back-top').hide();
			}else{
				jQuery('#back-top').fadeOut();
			}
		}
	});

	//トップに戻るをクリックしたら
	jQuery('#back-top a').click(function () {
		//スムーズに上に戻る
		jQuery('body,html').animate({
			scrollTop: 0
		}, 500);
		return false;
	});

	jQuery("a.hover img").hover(
		    function(){jQuery(this).fadeTo(100, 0.6);return false;},
		    function(){jQuery(this).fadeTo(500, 1);return false;}
	);
	jQuery("#primary-nav a img").hover(
		    function(){jQuery(this).fadeTo(100, 0.7);return false;},
		    function(){jQuery(this).fadeTo(100, 1);return false;}
	);

	jQuery("#content h2").addClass("meiryo").prepend('<div class="h2-icon"></div>');
	jQuery("#content-top + h2").addClass("first");

	jQuery("#content h3,#content h4,#content h5,#content h6").addClass("meiryo");

	jQuery(document).bind("contextmenu",function(e){
		return false;
	});

});

