(function(settings)
{
    jQuery.fn.tabMaker = function(settings)
    {
        settings = jQuery.extend({
            hideFocus: false,   // tabLink 時にフォーカス枠消去
            openPage: 0,        // 最初に開くページ (0 base)
            tabLink: true       // タブに <A> リンク設定
        }, settings);

        function showPage(_index, _pages, _tab)
        {
            var tabs = _index.children();
            var pages = _pages.children();

            if ($(_tab).is(".open"))
                return;

            tabs.each(function(i)
            {
                $(this)[this == _tab ? "addClass" : "removeClass"]("open");
                $(pages[i]).css("display", this == _tab ? "" : "none");
            });
        }

        return this.each(function()
        {
            var index = jQuery("UL:first", this);
            var pages = jQuery("DIV:first", this);

            if (settings.tabLink)
            {
                index.children("LI:not([a])").each(function()
                {
                    var focus = settings.hideFocus ?
                        " hideFocus style='outline:0'" : "";
                    this.innerHTML = "<A href='javascript:void(0)'" +
                        focus + ">" + this.innerHTML + "</A>";
                });
            }

            showPage(index, pages, index.children()[settings.openPage]);

            index.children().click(function()
            {
                showPage(index, pages, this);
            });
        });
    }
})(jQuery);


window.onload = function(){
    GnavActiveChange();
		RO();	
		ChangeCss();
		$("#tabContent").tabMaker({hideFocus:true})
};
