/*@cc_on _d=document;eval('var document=_d')@*/
var isIE  = /*@cc_on!@*/false
  , isIE6 = typeof document.documentElement.style.maxHeight == 'undefined'
;

$(function()
{
    if (isIE) {
        $('#head').hide();
    }




    /**
     *
     *  認証フォームを開く
     *
     **/
    $('#navi ul li#navi-auth a').click(
        function () {
            var $auth = $('#auth');
            $auth.css({display: 'block',
                       top:     $(this).offset().top + 12
                      });
            $('ul.tabs-head li a:first', $auth).click();
            return false;
        });
    /**
     *
     *  開いた認証フォームを閉じる
     *
     **/
    $('#auth .title h3 a').click(
        function () {
            $('#auth').css('display', 'none');
            return false;
        });

    /**
     *
     *  ログインフォームのタイプを切り替える
     *
     **/
    $('#auth ul.tabs-head li a').each(
        function () {
            $(this).click(
                function () {
                    var $this = $(this);
                    $('#auth .content ul.tabs-head li a').removeClass('active');
                    $this.addClass('active');

                    var type = $this.attr('id').split('--')[2];
                    //$('#auth .content .tabs-body').css('display', 'none !important');
                    $('[id*="auth--tabs-body--"]', '#auth').hide();
                    $('#auth--tabs-body--' + type)
                        .show()
                        .find('input[type="text"]:first')
                            .focus()
                            .end()
                    ;

                    return false;
                });
        });






    /**
     *
     *
     *
     **/
    window.highlight = function (target) {
        var $target = $(target);
        $target.show();
        setTimeout(
            function () { $target.fadeOut(); },
            1000);
    };
});
