$(function(){
var myurl = document.URL.split('/');
    $('ul#navimage li a').each(function(){
    var gnavi_href = $(this).attr('href').split('/');
  if (gnavi_href[1] == myurl[3]) {
    $(this).addClass("active");

    }
  });
});

$(function() {
$(".breadcrumb ul li").each(function() {
$("li:last-child").addClass("GrayColor");
});
});


$(function(){
var myurl = document.URL.split('/');
    $('#sub-menu li a').each(function(){
    var gnavi_href = $(this).attr('href').split('/');
  if (gnavi_href[2] == myurl[4]) {
    $(this).addClass("active");

    }
  });
});

$(function() {
$('#top-left a[target=_blank]').addClass('link-icon');
$('#top-left a[target=_blank] img').closest('a').removeClass('link-icon');
});


function rollover() {
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", rollover, false);
}
else if(window.attachEvent) {
window.attachEvent("onload", rollover);
}

jQuery.easing.quart = function (x, t, b, c, d) {
    return -c * ((t=t/d-1)*t*t*t - 1) + b;
};



/*-------------------------------------
 ページ読み込み中
-------------------------------------*/
jQuery(document).ready(function(){
 
    //
    // <a href="#***">の場合、スクロール処理を追加
    //
    jQuery('a[href*=#]').click(function() {
        if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
            var $target = jQuery(this.hash);
            $target = $target.length && $target || jQuery('[name=' + this.hash.slice(1) +']');
            if ($target.length) {
                var targetOffset = $target.offset().top;
                jQuery('html,body').animate({ scrollTop: targetOffset }, 1200, 'quart');
                return false;
            }
        }
    });
 
});



