// Easing の追加  
$.easing.quart = function (x, t, b, c, d) {  
    return -c * ((t=t/d-1)*t*t*t - 1) + b;  
};  

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

    $('a').each(function() {
        $(this).bind('focus', function() {
            this.blur();
        });
    });

    $("a[rel^='prettyPhoto']").prettyPhoto({
        allowresize: false,
        modal: false
    }); 

    if ($('div#content.contact').length > 0) {
        $('input#contactAttachment').attr('size', '44');
    }

    if ($('div#content.recruit').length > 0) {
        $('li.recruitBoxButton1 a').click(function(e){
            $('li.recruitBoxButton1 a').css('background-image', 'url(/imgs/recruit/btn_recruit1_1.gif)');
            $('li.recruitBoxButton1 a').css('border', '1px solid #999999');
            $('li.recruitBoxButton1 a').css('border-bottom', '1px solid #FFFFFF');
            $('li.recruitBoxButton1 a').hover(function(){
                $(this).css('background-image', 'url(/imgs/recruit/btn_recruit1_3.gif)');
            }, function(){
                $(this).css('background-image', 'url(/imgs/recruit/btn_recruit1_1.gif)');
            });

            $('li.recruitBoxButton2 a').css('background-image', 'url(/imgs/recruit/btn_recruit2_2.gif)');
            $('li.recruitBoxButton2 a').css('border', 'none');
            $('li.recruitBoxButton2 a').hover(function(){
                $(this).css('background-image', 'url(/imgs/recruit/btn_recruit2_3.gif)');
            }, function(){
                $(this).css('background-image', 'url(/imgs/recruit/btn_recruit2_2.gif)');
            });
            $('div.recruitBoxContent1').show();
            $('div.recruitBoxContent2').hide();
            return false;
        });

        $('li.recruitBoxButton2 a').click(function(e){
            $('li.recruitBoxButton1 a').css('background-image', 'url(/imgs/recruit/btn_recruit1_2.gif)');
            $('li.recruitBoxButton1 a').css('border', 'none');
            $('li.recruitBoxButton1 a').hover(function(){
                $(this).css('background-image', 'url(/imgs/recruit/btn_recruit1_3.gif)');
            }, function(){
                $(this).css('background-image', 'url(/imgs/recruit/btn_recruit1_2.gif)');
            });

            $('li.recruitBoxButton2 a').css('background-image', 'url(/imgs/recruit/btn_recruit2_1.gif)');
            $('li.recruitBoxButton2 a').css('border', '1px solid #999999');
            $('li.recruitBoxButton2 a').css('border-bottom', '1px solid #FFFFFF');
            $('li.recruitBoxButton2 a').hover(function(){
                $(this).css('background-image', 'url(/imgs/recruit/btn_recruit2_3.gif)');
            }, function(){
                $(this).css('background-image', 'url(/imgs/recruit/btn_recruit2_1.gif)');
            });

            $('div.recruitBoxContent2').show();
            $('div.recruitBoxContent1').hide();
            return false;
        });
    }

});  

