$(function(){
$(".jpng").jQIR("png", "/img/");
$(".jjpg").jQIR("jpg", "/img/");
$(".jgif").jQIR("gif", "/img/");
});

jQuery.fn.extend({
scrollTo : function(speed, easing) {
<!-- hashの取得が出来なければ、処理を中断 -->
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(){
$('a[href*=#]').click(function() {
$(this).scrollTo(1000);
return false;
});
});

$(function(){
$("#sitemap h3").each(function(){
$("#sitemap div").css("display","none");
$(this).addClass("resting");
$(this).click(function(){
var question = $(this).attr("class");
var answer = $(this).next();
if(question === "resting"){
$(this).removeClass("resting");
$(this).addClass("active");
}
else{
$(this).removeClass("active");
$(this).addClass("resting");
}
$(answer).slideToggle();
});
});
});

$(function() {
$('#ui-tab > ul').tabs({ fx: { opacity: 'toggle', duration: 1000  } });
});

    jQuery.fn.protectImage = function(settings) {
        settings = jQuery.extend({image: '/img/blank.gif',zIndex: 10}, settings);
        return this.each(function() {
            var position = $(this).position();
            var height = $(this).height();
            var width = $(this).width();
            $('<img/>').attr({width: width, height: height, src: settings.image}).css({
                top: position.top,
                left: position.left,
                position: 'absolute',
                zIndex: settings.zIndex
            }).appendTo('body')
         });
    };
    $(window).bind('load', function() {
        $('img.protect').protectImage().parents('a').removeAttr('href');
    });
