$(document).ready(function(){
var str = $("body").attr("id");
if (str=='home'){
var speed = 400; //画像が切り替わるフェードイン・アウトのスピード
$("#home #mv h2 a").mouseover(function(){$(this).animate({opacity:0},speed);}).mouseout(function(){$(this).animate({opacity:1.0},speed);});
};


//共通
$("ul#brum li").each(function(){$(this).find('a').parent().append('<span>&gt;</span>');});
$("#aside ul").each(function(){$(this).find('li:last').addClass('end');});
$('.blank').click(function(){window.open(this.href, '_blank');return false;});
$("a").focus(function(){$(this).blur();});
$('a img.rollover,a.rollover,#pageTop a').mouseover(function(){$(this).animate({opacity:0.6},'fast');}).mouseout(function(){$(this).animate({opacity:1.0},'fast');});
$('#navi li').mouseover(function(){$(this).addClass('on');}).mouseout(function(){$(this).removeClass('on');});
//End.

});


/*  ================================================================================
Include
================================================================================  */
$(function(){
$("#header_inc").load("/common/inc/header.html");
$("#gnavi_inc").load("/common/inc/gnavi.html");
$("#footer_inc").load("/common/inc/footer.html");
$("#footerNotes_inc").load("/common/inc/footer_notes.html");
$("#header_top_inc").load("/common/inc/header_top.html");
});

/*  ================================================================================
heightfix JavaScript MIT-style license.
2011 Kazuya Abe // http://ossi.co.jp/
$('#gallery ul.index li').heightfix();	:	一番高い要素に揃える
$('#gallery ul.index li').heightfix({claer:5});	:	5個ずつ高さ揃え
$('#gallery ul.index li').heightfix({tc:'turn'});	:	折り返し	class="turn"
$('#gallery ul.index li').heightfix({sc:'start'});	:	各行開始	class="start"
================================================================================  */
(function($,s){
var s=0;
$.fn.heightfix=function(options){
var options = jQuery.extend({
clear: 9999,
tc:'turn',
sc:'start'
},options);
var m=0; var n=0; s++;
if(options.clear==0||options.clear==null){clear=9999};

$(this).each(function(i){i++;

if(i%options.clear==0){$(this).addClass(options.tc);}
if(i%options.clear==1){n++; $(this).css('clear','both').addClass(options.sc)}
$(this).addClass('heightfixgroup'+ s + n);
});


for(m=1;m<=n;m++){var mt=0;
$(".heightfixgroup"+s+m).each(function(){
var thisHeight = $(this).height();
if(thisHeight>mt){mt=thisHeight};
});
$(".heightfixgroup"+s+m).height(mt);
};

};

})(jQuery);

/*  ================================================================================
スクロール
================================================================================  */
jQuery.fn.extend({
scrollTo : function(speed, easing) {
if(!$(this)[0].hash || $(this)[0].hash == "#") {
return false;
}
return this.each(function() {
var targetOffset = $($(this)[0].hash).offset().top;
$('html,body').animate({scrollTop: targetOffset}, speed, easing);
});
}
});

$(document).ready(function(){
$('#pageTop a,#mainCol a[href*="#a"]').click(function() {
$(this).scrollTo(1000);
return false;
});
});

