var store = {
    common: {
        init: (function () {
            (function () {
                return function () {
                    $('span.external').click(function () {
                        console.log($(this).parent().get(0).href)
                        window.open($(this).parent().get(0).href);
                        return false;
                    });
                    $('a.external').click(function () {
                        window.open(this.href);
                        return false;
                    });
                    $('a.blank').click(function () {
                        window.open(this.href);
                        return false;
                    });
                };
            }()());
        })
    },
    shop_index: {
        init: (function (region_id) {
            (function () {
                var _initShop = function () {
                    $('div#area_menu div').css('display', 'none');
                    if (region_id !== '') {
                        $('div#region_' + region_id).css('display', 'block');
                    }
                    
                    $('div#area_menu h2.collapsible').click(function () {
                        var index = $('div#area_menu h2').index(this) + 1;
                        _collapsMenu(index);
                        return false;
                    });
                };
                
                var _collapsMenu = function (index) {
                    $('div#region_' + index).show(400);
                    $('div#area_menu div:not(div#region_' + index + ')').hide(400);
                };
                
                return function () {
                    store.common.init();
                    _initShop();
                };
            }()());
        })
    }
};
