var JS_BASE_PATH    = '/js/pages/',
    JS_PARTS_PATH   = '/js/pages/parts/',
    JS_LIBRARY_PATH = '/js/library/',
    JS_NO_CACHE     = true,
    JS_PLUGINS      = {
        carousel    : JS_LIBRARY_PATH + 'jquery.carouselsuperlitestatic.js',
        carousel_act: JS_LIBRARY_PATH + 'jquery.carouselsuperlite.js',
        floatingbox : JS_PARTS_PATH + 'floatingboxmulti.js',
        fillinMsg   : JS_LIBRARY_PATH + 'jquery.fillinMsg.js'
    };

var commonParts = [];
commonParts.push(JS_PARTS_PATH+'input-focus.js');
if ( document.getElementById('float-login') ) commonParts.push(JS_PARTS_PATH+'float-login.js');

var page = JSManager.commonProcess(function () {
    if ( typeof window.console == 'undefined' ) {
        window.console = {};
        window.console.log = function (data) {
            // alert(data);
        }
    }
}, commonParts).setPages(location.pathname, {
    'guest_index' : {
        pattern: function (path) {
            return path == '/' && document.getElementById('float-pref-btn');
        },
        plugins: [JS_PLUGINS.carousel_act],
        page_js: JS_BASE_PATH + 'guest_index.js',
        no_cache: JS_NO_CACHE
    },
    'register_input' : {
        pattern: '/register/input',
        plugins: [],
        page_js: JS_BASE_PATH + 'register_input.js',
        no_cache: JS_NO_CACHE
    },
    'profile_index' : {
        pattern: /^\/profile\/\d+\/$/,
        plugins: [JS_PLUGINS.floatingbox],
        page_js: JS_BASE_PATH + 'profile_index.js',
        no_cache: JS_NO_CACHE
    },
    'my_mail_box_history' : {
        pattern: /^(\/my\/mail_box\/history\/)$/,
        plugins: [JS_PLUGINS.floatingbox],
        page_js: '',
        no_cache: JS_NO_CACHE
    },
    'bbs_common_article' : {
        pattern: /^(\/bbs\/(pure|adult)\/article)$/,
        plugins: [JS_PLUGINS.floatingbox],
        page_js: '',
        no_cache: JS_NO_CACHE
    },
    'my_memo' : {
        pattern: /^(\/my\/memo\/)$/,
        plugins: [JS_PLUGINS.floatingbox],
        page_js: '',
        no_cache: JS_NO_CACHE
    },
    'my_member_deny' : {
        pattern: /^(\/my\/member_deny\/)$/,
        plugins: [JS_PLUGINS.floatingbox],
        page_js: '',
        no_cache: JS_NO_CACHE
    },
    'lp_area_index' : {
        pattern: /^(\/lp\/area\/)/,
        plugins: [JS_PLUGINS.carousel_act],
        page_js: JS_BASE_PATH + 'guest_index.js',
        no_cache: JS_NO_CACHE
    },
    'lp_standard' : {
        pattern: /^(\/lp\/standard\/)/,
        plugins: [JS_PLUGINS.carousel_act],
        page_js: JS_BASE_PATH + 'guest_index.js',
        no_cache: JS_NO_CACHE
    },
    'lp_courtesy' : {
        pattern: /^(\/lp\/courtesy\/)/,
        plugins: [JS_PLUGINS.carousel_act],
        page_js: JS_BASE_PATH + 'guest_index.js',
        no_cache: JS_NO_CACHE
    },
    'lp_game' : {
        pattern: /^(\/lp\/game\/)/,
        plugins: [JS_PLUGINS.carousel_act],
        page_js: JS_BASE_PATH + 'guest_index.js',
        no_cache: JS_NO_CACHE
    },
    'short_message' : {
        pattern: /^(\/short_message\/)/,
        plugins: [JS_PLUGINS.fillinMsg],
        page_js: JS_BASE_PATH + 'short_message.js',
        no_cache: JS_NO_CACHE
    },
    'diary' : {
        pattern: /^(\/diary\/)/,
        plugins: [],
        page_js: JS_BASE_PATH + 'diary.js',
        no_cache: JS_NO_CACHE
    },
    'lp_newyear' : {
        pattern: /^(\/lp\/newyear\/)/,
        plugins: [JS_PLUGINS.carousel_act],
        page_js: JS_BASE_PATH + 'guest_index.js',
        no_cache: JS_NO_CACHE
    }
});

page.exec();


