/*
 * jQuery resize event - v1.1 - 3/14/2010
 * http://benalman.com/projects/jquery-resize-plugin/
 * 
 * Copyright (c) 2010 "Cowboy" Ben Alman
 * Dual licensed under the MIT and GPL licenses.
 * http://benalman.com/about/license/
 */
(function ($, h, c) {
    var a = $([]),
        e = $.resize = $.extend($.resize, {}),
        i, k = "setTimeout",
        j = "resize",
        d = j + "-special-event",
        b = "delay",
        f = "throttleWindow";
    e[b] = 250;
    e[f] = true;
    $.event.special[j] = {
        setup: function () {
            if (!e[f] && this[k]) {
                return false
            }
            var l = $(this);
            a = a.add(l);
            $.data(this, d, {
                w: l.width(),
                h: l.height()
            });
            if (a.length === 1) {
                g()
            }
        },
        teardown: function () {
            if (!e[f] && this[k]) {
                return false
            }
            var l = $(this);
            a = a.not(l);
            l.removeData(d);
            if (!a.length) {
                clearTimeout(i)
            }
        },
        add: function (l) {
            if (!e[f] && this[k]) {
                return false
            }
            var n;

            function m(s, o, p) {
                var q = $(this),
                    r = $.data(this, d);
                r.w = o !== c ? o : q.width();
                r.h = p !== c ? p : q.height();
                n.apply(this, arguments)
            }
            if ($.isFunction(l)) {
                n = l;
                return m
            } else {
                n = l.handler;
                l.handler = m
            }
        }
    };

    function g() {
        i = h[k](function () {
            a.each(function () {
                var n = $(this),
                    m = n.width(),
                    l = n.height(),
                    o = $.data(this, d);
                if (m !== o.w || l !== o.h) {
                    n.trigger(j, [o.w = m, o.h = l])
                }
            });
            g()
        }, e[b])
    }
})(jQuery, this);
/*
 * jQuery hashchange event - v1.3 - 7/21/2010
 * http://benalman.com/projects/jquery-hashchange-plugin/
 * 
 * Copyright (c) 2010 "Cowboy" Ben Alman
 * Dual licensed under the MIT and GPL licenses.
 * http://benalman.com/about/license/
 */
(function ($, e, b) {
    var c = "hashchange",
        h = document,
        f, g = $.event.special,
        i = h.documentMode,
        d = "on" + c in e && (i === b || i > 7);

    function a(j) {
        j = j || location.href;
        return "#" + j.replace(/^[^#]*#?(.*)$/, "$1")
    }
    $.fn[c] = function (j) {
        return j ? this.bind(c, j) : this.trigger(c)
    };
    $.fn[c].delay = 50;
    g[c] = $.extend(g[c], {
        setup: function () {
            if (d) {
                return false
            }
            $(f.start)
        },
        teardown: function () {
            if (d) {
                return false
            }
            $(f.stop)
        }
    });
    f = (function () {
        var j = {},
            p, m = a(),
            k = function (q) {
                return q
            },
            l = k,
            o = k;
        j.start = function () {
            p || n()
        };
        j.stop = function () {
            p && clearTimeout(p);
            p = b
        };

        function n() {
            var r = a(),
                q = o(m);
            if (r !== m) {
                l(m = r, q);
                $(e).trigger(c)
            } else {
                if (q !== m) {
                    location.href = location.href.replace(/#.*/, "") + q
                }
            }
            p = setTimeout(n, $.fn[c].delay)
        }
        return j
    })()
})(jQuery, this);
(function (e, b) {
    function d() {}
    function t(C) {
        c = [C]
    }
    function m(C) {
        f.insertBefore(C, f.firstChild)
    }
    function l(E, C, D) {
        return E && E.apply(C.context || C, D)
    }
    function k(C) {
        return new RegExp(/\?/).test(C) ? "&" : "?"
    }
    var n = "async",
        s = "charset",
        q = "",
        A = "error",
        r = "_jqjsp",
        w = "on",
        o = w + "click",
        p = w + A,
        a = w + "load",
        i = w + "readystatechange",
        z = "removeChild",
        g = "<script/>",
        v = "success",
        y = "timeout",
        x = e.browser,
        f = e("head")[0] || document.documentElement,
        u = {},
        j = 0,
        c, h = {
            callback: r,
            url: location.href
        };

    function B(C) {
        C = e.extend({}, h, C);
        var Q = C.complete,
            E = C.dataFilter,
            M = C.callbackParameter,
            R = C.callback,
            G = C.cache,
            J = C.pageCache,
            I = C.charset,
            D = C.url,
            L = C.data,
            P = C.timeout,
            O, K = 0,
            H = d;
        C.abort = function () {
            !K++ && H()
        };
        if (l(C.beforeSend, C, [C]) === false || K) {
            return C
        }
        D = D || q;
        L = L ? ((typeof L) == "string" ? L : e.param(L, C.traditional)) : q;
        D += L ? (k(D) + L) : q;
        M && (D += k(D) + encodeURIComponent(M) + "=?");
        !G && !J && (D += k(D) + "_" + (new Date()).getTime() + "=");
        D = D.replace(/=\?(&|$)/, "=" + R + "$1");

        function N(S) {
            !K++ && b(function () {
                H();
                J && (u[D] = {
                    s: [S]
                });
                E && (S = E.apply(C, [S]));
                l(C.success, C, [S, v]);
                l(Q, C, [C, v])
            }, 0)
        }
        function F(S) {
            !K++ && b(function () {
                H();
                J && S != y && (u[D] = S);
                l(C.error, C, [C, S]);
                l(Q, C, [C, S])
            }, 0)
        }
        J && (O = u[D]) ? (O.s ? N(O.s[0]) : F(O)) : b(function (T, S, U) {
            if (!K) {
                U = P > 0 && b(function () {
                    F(y)
                }, P);
                H = function () {
                    U && clearTimeout(U);
                    T[i] = T[o] = T[a] = T[p] = null;
                    f[z](T);
                    S && f[z](S)
                };
                window[R] = t;
                T = e(g)[0];
                T.id = r + j++;
                if (I) {
                    T[s] = I
                }
                function V(W) {
                    (T[o] || d)();
                    W = c;
                    c = undefined;
                    W ? N(W[0]) : F(A)
                }
                if (x.msie) {
                    T.event = o;
                    T.htmlFor = T.id;
                    T[i] = function () {
                        T.readyState == "loaded" && V()
                    }
                } else {
                    T[p] = T[a] = V;
                    x.opera ? ((S = e(g)[0]).text = "jQuery('#" + T.id + "')[0]." + p + "()") : T[n] = n
                }
                T.src = D;
                m(T);
                S && m(S)
            }
        }, 0);
        return C
    }
    B.setup = function (C) {
        e.extend(h, C)
    };
    e.jsonp = B
})(jQuery, setTimeout);
(function (v, H) {
    var w = {
        transition: "elastic",
        speed: 200,
        width: 550,
        initialWidth: 550,
        innerWidth: false,
        maxWidth: false,
        height: 72,
        initialHeight: 72,
        innerHeight: false,
        maxHeight: false,
        scalePhotos: true,
        scrolling: false,
        inline: false,
        html: false,
        iframe: false,
        photo: false,
        href: false,
        title: false,
        rel: false,
        opacity: 0.4,
        preloading: true,
        close: "×",
        open: false,
        returnFocus: true,
        onOpen: false,
        onLoad: false,
        onComplete: false,
        onCleanup: false,
        onClosed: false,
        overlayClose: true,
        escKey: true,
        arrowKey: true
    },
        p = "colorbox",
        E = "cbox",
        G = E + "_open",
        d = E + "_load",
        F = E + "_complete",
        l = E + "_cleanup",
        L = E + "_closed",
        g = E + "_purge",
        C = E + "_loaded",
        m = v.browser.msie && !v.support.opacity,
        O = m && v.browser.version < 7,
        K = E + "_IE6",
        D, P, Q, c, b, J, z, i, f, q, o, R, j, h, a, n, u, M, s, I, y = false,
        x, k = E + "Element";

    function B(T, S) {
        T = T ? ' id="' + E + T + '"' : "";
        S = S ? ' style="' + S + '"' : "";
        return v("<div" + T + S + "/>")
    }
    function A(S, T) {
        T = T === "x" ? J.width() : J.height();
        return (typeof S === "string") ? Math.round((/%/.test(S) ? (T / 100) * parseInt(S, 10) : parseInt(S, 10))) : S
    }
    function r(S) {
        return M.photo || /\.(gif|png|jpg|jpeg|bmp)(?:\?([^#]*))?(?:#(\.*))?$/i.test(S)
    }
    function N(T) {
        for (var S in T) {
            if (v.isFunction(T[S]) && S.substring(0, 2) !== "on") {
                T[S] = T[S].call(n)
            }
        }
        T.rel = T.rel || n.rel || "nofollow";
        T.href = T.href || v(n).attr("href");
        T.title = T.title || n.title;
        return T
    }
    function t(S, T) {
        if (T) {
            T.call(n)
        }
        v.event.trigger(S)
    }
    function e(S) {
        if (!y) {
            n = S;
            M = N(v.extend({}, v.data(n, p)));
            b = v(n);
            u = 0;
            if (M.rel !== "nofollow") {
                b = v("." + k).filter(function () {
                    var U = v.data(this, p).rel || this.rel;
                    return (U === M.rel)
                });
                u = b.index(n);
                if (u === -1) {
                    b = b.add(n);
                    u = b.length - 1
                }
            }
            if (!s) {
                s = I = true;
                P.show();
                if (M.returnFocus) {
                    try {
                        n.blur();
                        v(n).one(L, function () {
                            try {
                                this.focus()
                            } catch (U) {}
                        })
                    } catch (T) {}
                }
                D.css({
                    opacity: +M.opacity,
                    cursor: M.overlayClose ? "pointer" : "auto"
                }).show();
                M.w = A(M.initialWidth, "x");
                M.h = A(M.initialHeight, "y");
                x.position(0);
                if (O) {
                    J.bind("resize." + K + " scroll." + K, function () {
                        D.css({
                            width: J.width(),
                            height: J.height(),
                            top: J.scrollTop(),
                            left: J.scrollLeft()
                        })
                    }).trigger("scroll." + K)
                }
                t(G, M.onOpen);
                q.html(M.close).show()
            }
            x.load(true)
        }
    }
    x = v.fn[p] = v[p] = function (S, V) {
        var T = this,
            U;
        if (!T[0] && T.selector) {
            return T
        }
        S = S || {};
        if (V) {
            S.onComplete = V
        }
        if (!T[0] || T.selector === undefined) {
            T = v("<a/>");
            S.open = true
        }
        T.each(function () {
            v.data(this, p, v.extend({}, v.data(this, p) || w, S));
            v(this).addClass(k)
        });
        U = S.open;
        if (v.isFunction(U)) {
            U = U.call(T)
        }
        if (U) {
            e(T[0])
        }
        return T
    };
    x.init = function () {
        J = v(H);
        P = B().attr({
            id: p,
            "class": m ? E + "IE" : ""
        });
        D = B("Overlay", O ? "position:absolute" : "").hide();
        Q = B("Wrapper");
        c = B("Content").append(z = B("LoadedContent", "width:0; height:0; overflow:hidden"), f = B("LoadingOverlay").add(B("LoadingGraphic")), q = B("Close"));
        Q.append(c);
        i = B(false, "position:absolute; width:9999px; visibility:hidden; display:none");
        v("body").prepend(D, P.append(Q, i));
        c.children().hover(function () {
            v(this).addClass("hover")
        }, function () {
            v(this).removeClass("hover")
        }).addClass("hover");
        R = c.outerHeight(true) - c.height();
        j = c.outerWidth(true) - c.width();
        h = z.outerHeight(true);
        a = z.outerWidth(true);
        P.css({
            "padding-bottom": R,
            "padding-right": j
        }).hide();
        q.click(x.close);
        c.children().removeClass("hover");
        v("." + k).live("click", function (S) {
            if (!((S.button !== 0 && typeof S.button !== "undefined") || S.ctrlKey || S.shiftKey || S.altKey)) {
                S.preventDefault();
                e(this)
            }
        });
        D.click(function () {
            if (M.overlayClose) {
                x.close()
            }
        });
        v(document).bind("keydown", function (S) {
            if (s && M.escKey && S.keyCode === 27) {
                S.preventDefault();
                x.close()
            }
        })
    };
    x.remove = function () {
        P.add(D).remove();
        v("." + k).die("click").removeData(p).removeClass(k)
    };
    x.position = function (W, T) {
        var V, U = Math.max(document.documentElement.clientHeight - M.h - h - R, 0) / 2 + J.scrollTop(),
            S = Math.max(J.width() - M.w - a - j, 0) / 2 + J.scrollLeft();
        V = (P.width() === M.w + a && P.height() === M.h + h) ? 0 : W;
        Q[0].style.width = Q[0].style.height = "9999px";

        function X(Y) {
            c[0].style.width = Y.style.width;
            f[0].style.height = f[1].style.height = c[0].style.height = Y.style.height
        }
        P.dequeue().animate({
            width: M.w + a,
            height: M.h + h,
            top: U,
            left: S
        }, {
            duration: V,
            complete: function () {
                X(this);
                I = false;
                Q[0].style.width = (M.w + a + j) + "px";
                Q[0].style.height = (M.h + h + R) + "px";
                if (T) {
                    T()
                }
            },
            step: function () {
                X(this)
            }
        })
    };
    x.resize = function (S) {
        if (s) {
            S = S || {};
            if (S.width) {
                M.w = A(S.width, "x") - a - j
            }
            if (S.innerWidth) {
                M.w = A(S.innerWidth, "x")
            }
            z.css({
                width: M.w
            });
            if (S.height) {
                M.h = A(S.height, "y") - h - R
            }
            if (S.innerHeight) {
                M.h = A(S.innerHeight, "y")
            }
            if (!S.innerHeight && !S.height) {
                var T = z.wrapInner("<div style='overflow:auto'></div>").children();
                M.h = T.height();
                T.replaceWith(T.children())
            }
            z.css({
                height: M.h
            });
            x.position(M.transition === "none" ? 0 : M.speed)
        }
    };
    x.resizeIframe = function (T, S) {
        if (!s) {
            return
        }
        var U = M.transition === "none" ? 0 : M.speed;
        M.h = T || M.h;
        M.w = S || M.w;
        z.css({
            width: M.w,
            height: M.h
        });
        x.position(U)
    };
    x.prep = function (V) {
        if (!s) {
            return
        }
        var U, W = M.transition === "none" ? 0 : M.speed;
        J.unbind("resize." + E);
        z.remove();
        z = B("LoadedContent").html(V);

        function S() {
            M.w = M.w || z.width();
            M.w = M.mw && M.mw < M.w ? M.mw : M.w;
            return M.w
        }
        function X() {
            M.h = M.h || z.height();
            M.h = M.mh && M.mh < M.h ? M.mh : M.h;
            return M.h
        }
        z.hide().appendTo(i.show()).css({
            width: S(),
            overflow: M.scrolling ? "auto" : "hidden"
        }).css({
            height: X()
        }).prependTo(c);
        i.hide();
        v("#" + E + "Photo").css({
            cssFloat: "none",
            marginLeft: "auto",
            marginRight: "auto"
        });
        if (O) {
            v("select").not(P.find("select")).filter(function () {
                return this.style.visibility !== "hidden"
            }).css({
                visibility: "hidden"
            }).one(l, function () {
                this.style.visibility = "inherit"
            })
        }
        function T(ab) {
            var ad, ae, aa, Z, ac = b.length,
                Y = M.loop;
            x.position(ab, function () {
                function af() {
                    if (m) {
                        P[0].style.filter = false
                    }
                }
                if (!s) {
                    return
                }
                if (m) {
                    if (U) {
                        z.fadeIn(100)
                    }
                }
                z.show();
                t(C);
                f.hide();
                if (M.transition === "fade") {
                    P.fadeTo(W, 1, function () {
                        af()
                    })
                } else {
                    af()
                }
                J.bind("resize." + E, function () {
                    x.position(0)
                });
                t(F, M.onComplete)
            })
        }
        if (M.transition === "fade") {
            P.fadeTo(W, 0, function () {
                T(0)
            })
        } else {
            T(W)
        }
    };
    x.load = function (V) {
        var U, T, W, S = x.prep;
        I = true;
        n = b[u];
        if (!V) {
            M = N(v.extend({}, v.data(n, p)))
        }
        t(g);
        t(d, M.onLoad);
        M.h = M.height ? A(M.height, "y") - h - R : M.innerHeight && A(M.innerHeight, "y");
        M.w = M.width ? A(M.width, "x") - a - j : M.innerWidth && A(M.innerWidth, "x");
        M.mw = M.w;
        M.mh = M.h;
        if (M.maxWidth) {
            M.mw = A(M.maxWidth, "x") - a - j;
            M.mw = M.w && M.w < M.mw ? M.w : M.mw
        }
        if (M.maxHeight) {
            M.mh = A(M.maxHeight, "y") - h - R;
            M.mh = M.h && M.h < M.mh ? M.h : M.mh
        }
        U = M.href;
        f.show();
        if (M.inline) {
            B().hide().insertBefore(v(U)[0]).one(g, function () {
                v(this).replaceWith(z.children())
            });
            S(v(U))
        } else {
            if (M.iframe) {
                P.one(C, function () {
                    var X = v("<iframe name='" + new Date().getTime() + "' frameborder=0" + (M.scrolling ? "" : " scrolling='no'") + (m ? " allowtransparency='true'" : "") + " style='width:100%; height:100%; border:0; display:block;'/>");
                    X[0].src = M.href;
                    X.appendTo(z).one(g, function () {
                        X[0].src = "//about:blank"
                    })
                });
                S(" ")
            } else {
                if (M.html) {
                    S(M.html)
                } else {
                    if (r(U)) {
                        T = new Image();
                        T.onload = function () {
                            var X;
                            T.onload = null;
                            T.id = E + "Photo";
                            v(T).css({
                                border: "none",
                                display: "block",
                                cssFloat: "left"
                            });
                            if (M.scalePhotos) {
                                W = function () {
                                    T.height -= T.height * X;
                                    T.width -= T.width * X
                                };
                                if (M.mw && T.width > M.mw) {
                                    X = (T.width - M.mw) / T.width;
                                    W()
                                }
                                if (M.mh && T.height > M.mh) {
                                    X = (T.height - M.mh) / T.height;
                                    W()
                                }
                            }
                            if (M.h) {
                                T.style.marginTop = Math.max(M.h - T.height, 0) / 2 + "px"
                            }
                            if (b[1] && (u < b.length - 1 || M.loop)) {
                                v(T).css({
                                    cursor: "pointer"
                                }).click(x.next)
                            }
                            if (m) {
                                T.style.msInterpolationMode = "bicubic"
                            }
                            setTimeout(function () {
                                S(T)
                            }, 1)
                        };
                        setTimeout(function () {
                            T.src = U
                        }, 1)
                    } else {
                        if (U) {
                            i.load(U, function (Y, X, Z) {
                                S(X === "error" ? "Request unsuccessful: " + Z.statusText : v(this).children())
                            })
                        }
                    }
                }
            }
        }
    };
    x.close = function () {
        if (s && !y) {
            y = true;
            s = false;
            t(l, M.onCleanup);
            J.unbind("." + E + " ." + K);
            D.fadeTo("fast", 0);
            P.stop().fadeTo("fast", 0, function () {
                t(g);
                z.remove();
                P.add(D).css({
                    opacity: 1,
                    cursor: "auto"
                }).hide();
                setTimeout(function () {
                    y = false;
                    t(L, M.onClosed)
                }, 1)
            })
        }
    };
    x.element = function () {
        return v(n)
    };
    x.settings = w;
    v(x.init)
}(jQuery, this));
if (typeof (console) == "undefined") {
    var console = {
        log: function () {}
    }
}
var tbwaClass = (function (d) {
    var c = {
        LINEAR_MODE: 1,
        GRID_MODE: 2,
        FULL_MODE: 3,
        BACKGROUND_COLORS: {
            light: "#ffffff",
            dark: "#141414",
            IFRAMED: {
                light: "#f8f8f8",
                dark: "#313131"
            }
        },
        BASE_URL: __BASEURL__,
        ENABLE_DRAGGING: true,
        FEED_ITEM_COUNTS: {
            TWEETS: {
                linear_mode: 10,
                grid_mode: 10,
                full_mode: 10
            }
        },
        FULLSCREEN_IMAGE: {
            full_height: 768,
            nav_height: 54,
            nav_width: 140
        },
        GRID_IMAGES: {
            width: 274,
            height: 214,
            margin_tb: 24,
            margin_lr: 20
        },
        IMAGE_URL: {
            device: "",
            base: __ASSETSURL__.matrix,
            thumb: "thumbnails/",
            small: "grid/",
            medium: "linear/",
            large: "fullscreen/"
        },
        JSONP: {
            get: "/api/projeqt/get/" + __token__ + "/index.asp?container_id=",
            getDefault: "/api/projeqt/get_default/" + __token__ + "/index.asp",
            getFeed: "/api/feeds/get/" + __token__ + "/",
            searchResults: "/api/projeqt/search/" + __token__ + "/index.asp",
            searchSuggestions: "/api/search/get/" + __token__ + "/",
            timeout: 10000
        },
        MOUSE_THRESHOLD: 10,
        NUM_SLIDES_TO_LOAD: 10,
        NUM_IMAGES_TO_SHOW: {
            linear: 5,
            full: 5
        },
        OFFICE_MATCH_TERM: "Global Networks",
        OVERLAY: {
            ERROR: {
                width: 180,
                height: 135
            },
            HELP: {
                width: 480
            }
        },
        PRELOAD: {
            linear: ["shell_loader.gif", "blank_slide_projeqt_logo_white.png", "blank_slide_center_linear_white.png", "blank_slide_left_edge_linear_white.png", "blank_slide_right_edge_linear_white.png", "slide_borders_curls.png"],
            grid: ["slide_borders_curls.png", "shell_loader_small.gif"],
            fullscreen: ["blank_slide_projeqt_logo_white.png", "blank_slide_corners_edges_full.png", "blank_slide_topbottom_full.png", "slide_borders_curls.png", "shell_loader.gif"]
        },
        SEARCH: {
            autoSuggestTimeout: 500
        },
        SCROLL_EASING: "easeOutCirc",
        SCROLL_SPEED: {
            web: 500,
            mobile: 500
        },
        SHELL_OFFSETS: {
            linear: {
                width: -14
            },
            fullscreen: {
                width: -24,
                height: -16
            }
        },
        VIDEO_CONTROLS_HEIGHT: {
            vimeo: 0,
            youtube: 30
        }
    };

    function a(e) {
        var j, g;
        g = function (k) {
            return k.split(".")
        };
        e = g(e);
        for (var f = 0, h = e.length; f < h; f++) {
            if (f > 0) {
                j = (j != undefined) ? j[e[f]] : null
            } else {
                j = c[e[f]] || null
            }
        }
        return j
    }
    function b(f) {
        var e = a("IMAGE_URL")["base"] + a("IMAGE_URL")["device"];
        switch (f) {
        case a("LINEAR_MODE"):
            e += a("IMAGE_URL")["medium"];
            break;
        case a("GRID_MODE"):
            e += a("IMAGE_URL")["small"];
            break;
        case a("FULL_MODE"):
            e += a("IMAGE_URL")["large"];
            break;
        case "thumb":
            e += a("IMAGE_URL")["thumb"];
            break;
        default:
            throw new Error("Unknown user mode in getURL function.");
            return false
        }
        return e
    }
    return function () {
        var o = 0,
            j = 0,
            f = null,
            h = 0,
            m = false,
            n = null,
            k = null,
            e = {
                linear: false,
                grid: false,
                fullscreen: false
            };
        this.getConstant = function (p) {
            return a(p)
        };
        this.getURL = function (p) {
            return b(p)
        };
        this.application = {
            header: {
                init: function () {
                    this.titleBar.setTitle("navigation", true)
                },
                titleBar: {
                    setTitle: function (t, x) {
                        x = x || false;
                        var s = d("#top_bar").find(".title_bar"),
                            B = g.htmlTemplates.titleBarLevel,
                            A = g.htmlTemplates.titleBarActive,
                            q = "",
                            u = "",
                            v = g.htmlTemplates.titleBarSlash,
                            p, y;
                        if (x) {
                            s.children().remove()
                        }
                        switch (t) {
                        case "search":
                        case "navigation":
                            for (var w = 0, r = n.breadcrumbs, z = r.length; w < z; w++) {
                                y = r[w];
                                if (w + 1 == z) {
                                    u = (z == 1) ? "" : v;
                                    q += B.replaceVars({
                                        content: u + A.replaceVars({
                                            content: y.name
                                        }),
                                        "container-id": y.container_id
                                    })
                                } else {
                                    u = (w == 0) ? "" : v;
                                    q += B.replaceVars({
                                        content: u + y.name,
                                        "container-id": y.container_id
                                    })
                                }
                            }
                            p = d(q);
                            s.append(p);
                            break
                        }
                    }
                },
                searchBar: {
                    query: "",
                    slideIndex: null,
                    clear: function () {
                        this.query = "";
                        d("#search_box").find(".search_text").val("").trigger("blur");
                        d("#searchResultsWrapper").remove();
                        g.updateHash()
                    },
                    clearSuggestions: function () {
                        d("#search_box").find(".in_progress").removeClass("in_progress");
                        window.setTimeout(function () {
                            d("#searchResultsWrapper").remove()
                        }, 300)
                    },
                    lookUp: function (q) {
                        var p = g.header.searchBar,
                            r = q;
                        if (typeof (q) === "undefined") {
                            return
                        }
                        p.query = d.trim(r);
                        g.XHR.getJSON(a("JSONP.searchResults"), {
                            terms: p.query
                        }, function (t) {
                            if (t.slides.length==0) {  // 2011. 4. 17 by rainygirl
                               return false; 
                            }
                            g.updateHash();
                            n = t;
                            var s = n.slides.length;
                            g.activeSlide.id = (!s) ? 0 : n.slides[0].slide_id || "0" + n.slides[0].container_id;
                            g.activeContainer.id = 0;
                            g.activeSlide.index = (!s) ? null : 0;
                            g.activeSlide.relativePosition = 0;
                            if (g.getCurrentMode() === "full_mode") {
                                d(".view_panel .slide_view a").trigger("click")
                            } else {
                                g.updateHash();
                                g.viewport.render()
                            }
                            g.header.titleBar.setTitle("search", true)
                        })
                    },
                    suggest: function () {
                        var r = d("#search_box").find(".search_text"),
                            p = r.data("lastQuery"),
                            q = r.val();
                        r.data("lastQuery", q);
                        /*검색관련코드가림 g.XHR.getJSON(a("JSONP.searchSuggestions"), {
                            terms: q
                        }, function (z) {
                            d("#search_box").find(".search_button").removeClass("in_progress");
                            var x = "",
                                t = d(g.htmlTemplates.searchResults),
                                y = z.terms,
                                v = y.length,
                                u = d("<li onclick='void(0)'></li>");
                            d("#searchResultsWrapper").remove();
                            for (var w = 0, s = ""; w < v; w++) {
                                s = y[w].name.replace(new RegExp(q, "i"), "<strong>" + q + "</strong>");
                                x += u.html("<a href='#' class='result' onclick='void(0)'>" + s + "</a>").outerHTML()
                            }
                            t.find("ul").append(x);
                            d("#search_box").append(t)
                        })*/
                    }
                }
            },
            viewport: {
                windowHeight: 0,
                windowWidth: 0,
                documentHeight: 0,
                documentWidth: 0,
                backgroundColor: 0,
                numSlidesFillWidth: 0,
                init: function () {
                    var s = d(window),
                        r = d(document),
                        p = d("body");
                    //if (__FB__ || __EMBED__) { //수정코드에는 없었음
                    //    this.windowHeight = 700
                    //} else {
                        this.windowHeight = s.height()
                    //}
                    this.windowWidth = s.width();
                    this.documentHeight = r.height();
                    this.documentWidth = r.width();
                    if (window.navigator.standalone) {
                        p.addClass("kiosk")
                    }
                    if (p.hasClass("mobile")) {
                        try {
                            window.scrollTo(0, 1)
                        } catch (q) {}
                    }
                },
                displayHelp: function () {
                    d("#footer .help").trigger("click")
                },
                entranceAnimation: function () {
                    var r = d(".slide_container"),
                        s = r.find(".active");
                    switch (j) {
                    case a("LINEAR_MODE"):
                        if (s.length) {
                            var q = Math.floor((g.viewport.windowWidth / 2) - (s.width() / 2)),
                                p = s.position().left,
                                t = (q - p);
                            s.parents(".slides").css("left", t);
                            g.events.viewport.slide.loadSlideInfo.call(s, true);
                            if (d.browser.ie6 || d.browser.ie7 || d.browser.ie8) {
                                r.find(".shell_contents img").each(function () {
                                    this.style.filter = "alpha(opacity=100)";
                                    this.style.display = "block"
                                })
                            }
                        }
                        break;
                    case a("GRID_MODE"):
                        break;
                    case a("FULL_MODE"):
                        if (s.length) {
                            s.fadeIn();
                            g.events.viewport.slide.loadSlideInfo.call(s[0], true)
                        }
                        d("#top_bar").animate({
                            "margin-top": -31
                            //opacity: 0
                        });
                        d("#footer").hide();//원래코드d("#footer").add("#top_bar .logo").hide();
                        break
                    }
                },
                exitAnimation: function (p) {
                    p = (typeof p !== "undefined") ? p : o;
                    switch (p) {
                    case a("LINEAR_MODE"):
                        break;
                    case a("GRID_MODE"):
                        break;
                    case a("FULL_MODE"):
                        d("#top_bar").animate({
                            "margin-top": "+=31"
                            //opacity: 1
                        });
                        //d("#footer").add("#top_bar .logo").show();
												d("#footer").show();
                        break
                    }
                },
                render: function (u, p) {
                    /*if (d("#outerWrapper").hasClass("tbwa")) {
                        if (n.container.length && n.container[0].name.toLowerCase() == a("OFFICE_MATCH_TERM").toLowerCase()) {
                            try {
                                tbwa.offices.init(n)
                            } catch (t) {
                                throw new Error("Function: Render. Unable to load TBWA Contact Us.")
                            }
                            return false
                        }
                    }*/
                    var s = {
                        entranceAnimation: true
                    },
                        r = d("#content_area"),
                        q = a("FULL_MODE");
                    u = u || s;
                    p = (typeof p === "boolean") ? p : true;
                    if (j == 0) {
                        g.setCurrentMode(a("LINEAR_MODE"));
                        d(".slide_view a").addClass("selected")
                    }
                    d(".view_panel").find(".disabled").removeClass("disabled");
                    r.removeClass("offices");
                    r.children().remove();
                    switch (j) {
                    case a("LINEAR_MODE"):
                        r.append(g.htmlTemplates.linearTemplate);
                        r.append(g.htmlTemplates.slideInfoTemplate);
                        r.append(g.htmlTemplates.paginateTemplate);
                        g.viewport.loadLinear();
                        g.viewport.paginate.loadSlidePage();
                        g.events.viewport.bindLinearEvents();
                        d(".slide").eq(parseInt(g.activeSlide.relativePosition, 10)).addClass("active");
                        break;
                    case a("GRID_MODE"):
                        r.append(g.htmlTemplates.gridTemplate);
                        r.append(g.htmlTemplates.gridPaginateTemplate);
                        g.viewport.loadGrid(p);
                        g.viewport.paginate.loadGridPages();
                        g.events.viewport.bindGridEvents();
                        break;
                    case q:
                        r.append(g.htmlTemplates.fullTemplate);
                        r.append(g.htmlTemplates.slideInfoTemplate);
                        r.append(g.htmlTemplates.paginateTemplate);
                        g.viewport.loadFullscreen(p);
                        g.events.viewport.bindFullscreenEvents();
                        d(".slide").eq(parseInt(g.activeSlide.index, 10)).addClass("active");
                        break
                    }
                    if (u.entranceAnimation) {
                        g.viewport.entranceAnimation()
                    }
                    if (j === q && !g.getSlidesFromIndex(g.activeSlide.index).length) {
                        g.viewport.exitAnimation(q)
                    }
                },
                resizeGrid: function (r) {
                    g.viewport.init();
                    var C = g.viewport.documentHeight,
                        x = g.viewport.documentWidth,
                        u = g.viewport.windowHeight,
                        t = d(".vertically_centered"),
                        q = d("#content_area"),
                        A = d("#top_bar"),
                        v = d("#footer"),
                        B = d(".view_panel"),
                        s = (true) ? v.height() + parseInt(v.css("margin-top"), 10) : 0,
                        z = (true) ? A.height() + parseInt(A.css("padding-top"), 10) : 0,
                        p, w, y = function (F) {
                            F = (typeof (F) == "undefined") ? z + B.height() + q.height() + s : F;
                            var E, G, D;
                            if (F - u >= 10) {
                                t.stop().animate({
                                    top: z
                                }, "fast", function () {
                                    t.css("position", "static");
                                    v.css("position", "relative")
                                });
                                d("body").css("overflow", "hidden");
                                d("#outerWrapper").css("overflow-y", "auto").css("overflow-x", "hidden")
                            } else {
                                G = u - (z + s) - t.height();
                                D = z + (G / 2);
                                v.css("position", "absolute");
                                t.stop().css("position", "absolute").animate({
                                    top: D
                                }, "fast");
                                d("body").css("overflow", "hidden")
                            }
                            E = {
                                fold: F,
                                footerOffset: s,
                                headerOffset: z
                            };
                            return E
                        };
                    switch (j) {
                    case a("LINEAR_MODE"):
                        t.css("height", "auto");
                        y();
                        d(".slide.active").removeClass("snapped").addClass("noAnimation").trigger("load");
                        break;
                    case a("GRID_MODE"):
                        d(".vertically_centered, #footer").css("position", "static");
                        w = (arguments.length && typeof (arguments[0]) !== "object") ? arguments[0] : true;
                        (w) ? g.viewport.render() : null;
                        p = y();
                        if (p.fold > u) {
                            d("body, #outerWrapper").css("overflow-y", "auto").css("overflow-x", "hidden")
                        } else {
                            d("body, #outerWrapper").css("overflow", "hidden")
                        }
                        break;
                    case a("FULL_MODE"):
                        y();
                        if (typeof arguments[0] === "object" && arguments[0].type && arguments[0].type === "resize") {
                            g.viewport.render(false, false)
                        }
                        if (!d("body").hasClass("mobile")) {
                            p = [];
                            p.viewPanel = 31;
                            p.totalContentHeight = q.outerHeight(true) + p.viewPanel;
                            p.newTopPos = Math.floor((u - p.totalContentHeight) / 2);
                            t.stop().animate({
                                top: p.newTopPos
                            }, "fast")
                        }
                        break
                    }
                },
                loadLinear: function () {
                    var t = d(".vertically_centered"),
                        r = d(".slide_container"),
                        s = d(".slide_info"),
                        E = t.find(".slides").html(),
                        G, B = (g.activeSlide.index == null) ? g.getSlidesFromId(g.activeSlide.id) : g.getSlidesFromIndex(g.activeSlide.index),
                        y = B.length,
                        H = a("SHELL_OFFSETS.linear.width"),
                        C = 0;
                    if (s.length) {
                        s.makeHidden()
                    }
                    if (!e.linear) {
                        d(".view_panel, .pagination").makeHidden()
                    }
                    t.find(".slides").children().remove();
                    if (y == 0) {
                        t.css("height", "auto");
                        r.find(".slides").children().remove();
                        r.addClass("no_results").append(g.htmlTemplates.noResults);
                        s.add(".pagination").css("display", "none");
                        d("#footer").css("position", "absolute");
                        d(".view_panel").makeHidden();
                        return
                    }
                    for (var D = 0; D < y; D++) {
                        var p = B[D].object,
                            x = g.viewport.processSlideInfo(p),
                            A = x.imageWidth + H,
                            F = B[D].index,
                            u, q, z, v, w;
                        G = d(E);
                        switch (x.type) {
                        case "container":
                        case "image":
                            g.viewport.slides.imageSlide.apply(G, [x]);
                            break;
                        case "rss":
                        case "twitter":
                            g.viewport.slides.feedSlide.apply(G, [x]);
                            break;
                        case "text":
                            g.viewport.slides.textSlide.apply(G, [x]);
                            break;
                        case "video":
                            g.viewport.slides.videoSlide.apply(G, [x]);
                            break;
			case "iframe":
			    g.viewport.slides.iframeSlide.apply(G, [x]);
                            break;
			case "load":
			    g.viewport.slides.loadSlide.apply(G, [x]);
                            break;
                        }
                        G.find(".slide").attr("data-title", x.title).attr("data-tags", x.tags).attr("data-id", x.slideId).attr("data-container-id", x.containerId).attr("data-container-name", x.containerName).attr("data-slideindex", F).attr("data-index", D).attr("data-type", x.type).attr("data-image", x.img);
                        G.appendTo(t.find(".slides"));
                        if (x.type === "video") {
                            w = G.find("iframe");
                            z = (x.video_aspect_ratio === "16:9");
                            customAspectRatio = false, q;
                            if (!z && typeof x.video_aspect_ratio === "string" && x.video_aspect_ratio !== "4:3") {
                                customAspectRatio = x.video_aspect_ratio.split(":");
                                customAspectRatio = parseInt(customAspectRatio[0], 10) / parseInt(customAspectRatio[1], 10);
		                            u = g.viewport.slides.calculateVideoPlayerWidth(x.video_url, w.height(), z, customAspectRatio);
																q = u.width-2;
                            } else {
															u = g.viewport.slides.calculateVideoPlayerWidth(x.video_url, w.height(), z, customAspectRatio);
															q = u.width-1;
														}
                            w.add(G.find("img")).width(q);
                            A = q + H
                        }
                        G.find(".shell").css("width", A)
                    }
                    r.find(".slides li").each(function () {
                        C += d(this).outerWidth(true)
                    });
                    r.find(".slides").width(C);
                    if (y == 1 && n.slides.length == 1) {
                        d(".slide .prev, .slide .next").makeHidden()
                    }
                    if (!e.linear) {
                        g.preloadImageGroup(a("PRELOAD.linear"), function () {
                            d(".view_panel, .pagination").makeVisible();
                            r.makeVisible();
                            e.linear = true
                        })
                    } else {
                        r.makeVisible()
                    }
                    d(".view_panel, .pagination").makeVisible();
                    r.makeVisible();
                    g.events.viewport.loadLinearImages();
                    window.setTimeout(function () {
                        var I = d(".slide.active"),
                            K = I.attr("data-title"),
                            J = I.attr("data-type");
                        //트래커 g.tracker.recordView("Slide View - Linear", K + " (" + J + ")")
                    }, 500)
                },
                loadGrid: function (G) {
                    G = (typeof G === "boolean") ? G : true;
                    var u = a("GRID_IMAGES"),
                        z = u.width,
                        O = u.height,
                        N = u.margin_tb,
                        K = u.margin_lr,
                        y = 60 * 2,
                        B = d(window),
                        J = d("#top_bar"),
                        t = d(".view_panel"),
                        s = d(".pagination"),
                        M = d("#footer"),
                        T = d(".vertically_centered"),
                        w = B.height(),
                        A = w - (J.height() + parseInt(J.css("margin-top"), 10)) - (t.height() + parseInt(t.css("margin-top"), 10)) - (s.height() + parseInt(s.css("margin-top"), 10) + parseInt(s.css("padding-bottom"), 10)) - (M.height() + parseInt(M.css("margin-top"), 10)),
                        x = Math.floor((B.width() - y) / (z + K)) || 1,
                        v = Math.floor(A / (O + N)) || 1,
                        I = (z + K) * x,
                        E = (v || 1) * (O + N),
                        C = d(".slide_container"),
                        r = d(".grid"),
                        q = d("#grid_wrapper"),
                        Q = C.find(".grid").html(),
                        S, H = (g.activeSlide.index == null) ? g.getSlidesFromId(g.activeSlide.id) : g.getSlidesFromIndex(g.activeSlide.index),
                        F = H.length,
                        P;
                    if (d("body").hasClass("mobile") && !d("body").hasClass("ipad")) {
                        x = v = 2;
                        I = (z + K) * x;
                        E = (v || 1) * (O + N)
                    }
                    h = x * v;
                    g.preloadImageGroup(a("PRELOAD.grid"));
                    if (!e.grid) {
                        d(".view_panel, .pagination, .slide_container > .arrow").makeHidden()
                    }
                    C.attr("data-cols", x).attr("data-rows", v).height(E).width(I - (K / 2));
                    r.height(E).width(I);
                    T.height(d("#content_area").height());
                    if (H.length == 0) {
                        q.add(d("a.arrow")).remove();
                        C.addClass("no_results").append(g.htmlTemplates.noResults);
                        d(".vertically_centered").css("height", "auto");
                        d(".pagination, .slide_info, .arrow").css("display", "none");
                        d("#footer").css("position", "absolute");
                        d(".view_panel").makeHidden();
                        return
                    }
                    C.find(".grid").children().remove();
                    for (var L = 0, p, D, R; L < F; L++) {
                        p = H[L].object;
                        D = g.viewport.processSlideInfo(p);
                        R = H[L].index;
                        S = d(Q);
                        switch (D.type) {
                        case "container":
                        case "image":
                            callback = g.viewport.slides.imageSlide.apply(S, [D]);
                            break;
                        case "rss":
                        case "twitter":
                            g.viewport.slides.feedSlide.apply(S, [D]);
                            break;
                        case "text":
                            g.viewport.slides.textSlide.apply(S, [D]);
                            break;
                        case "video":
                            g.viewport.slides.videoSlide.apply(S, [D]);
                            break;
			case "iframe":
                            g.viewport.slides.iframeSlide.apply(S, [D]);
                            break;
			case "load":
                            g.viewport.slides.loadSlide.apply(S, [D]);
                            break;
                        }
                        S.find(".slide").attr("data-id", D.slideId).attr("data-container-id", D.containerId).attr("data-slideindex", R).attr("data-title", D.title).attr("data-container-name", D.containerName).find(".grid_slide_info").html(g.viewport.slides.set_title(D.title, 75));
                        (function (V, U) {
                            d.preloadImage(U, function () {
                                V.find("img").attr("src", U).fadeIn(400).end().addClass("loaded").find(".shell_loader").remove()
                            })
                        })(S, b(j) + D.img);
                        S.appendTo(r)
                    }
                    r.eq(0).addClass("selectedPage");
                    if (!e.grid) {
                        g.preloadImageGroup(a("PRELOAD.grid"), function () {
                            e.grid = true
                        })
                    }
                    d("#grid_wrapper, .view_panel, .pagination, .slide_container > .arrow").makeVisible();
                    P = q.find(".selectedPage li");
                    P.each(function (U) {
                        var V = this,
                            W = function () {
                                if (d.browser.ie6 || d.browser.ie7 || d.browser.ie8) {
                                    d(V).find("img").css({
                                        display: "block",
                                        opacity: 0
                                    }).animate({
                                        opacity: 1
                                    }, 250)
                                } else {
                                    d(V).animate({
                                        opacity: 1
                                    }, 250)
                                }
                            };
                        window.setTimeout(W, 80 * parseInt(U, 10))
                    });
                    if (G) {
                        window.setTimeout(function () {
                            var V = n.slides.length,
                                W = g.activeSlide.index + 1 || 1,
                                U = W + F - 1;
                            //트래커g.tracker.recordView("Slide View - Grid", "Viewing slides " + W + "–" + U + " of " + V)
                        }, 500)
                    }
                },
                loadFullscreen: function (z) {
                    var u = d(".vertically_centered"),
                        r = d(".slide_container"),
                        s = d(".view_panel"),
                        F = u.find(".slides").html(),
                        A = (g.activeSlide.index == null) ? g.getSlidesFromId(g.activeSlide.id) : g.getSlidesFromIndex(g.activeSlide.index),
                        y = A.length,
                        C = g.activeSlide.relativePosition,
                        H, v, w, E = true,
                        I = 128,
                        q, t = a("SHELL_OFFSETS.fullscreen");
                    if (!e.fullscreen) {
                        d(".view_panel, .pagination").makeHidden()
                    }
                    u.find(".slides").children().remove();
                    v = g.viewport.windowHeight - I;
                    u.height(v);
                    if (v > a("FULLSCREEN_IMAGE.full_height")) {
                        w = a("FULLSCREEN_IMAGE.full_height")
                    } else {
                        w = a("FULLSCREEN_IMAGE.scaled_height");
                        E = false
                    }
                    if (y == 0) {
                        u.css("height", "auto");
                        r.find(".slides").children().remove();
                        r.addClass("no_results").append(g.htmlTemplates.noResults);
                        d(".pagination, .slide_info").css("display", "none");
                        s.makeHidden();
                        return
                    }
                    for (var D = 0; D < y; D++) {
                        var p = A[D].object,
                            x = g.viewport.processSlideInfo(p),
                            G = A[D].index,
                            B;
                        H = d(F);
                        switch (x.type) {
                        case "container":
                        case "image":
                            callback = g.viewport.slides.imageSlide.apply(H, [x]);
                            break;
                        case "rss":
                        case "twitter":
                            g.viewport.slides.feedSlide.apply(H, [x]);
                            break;
                        case "text":
                            g.viewport.slides.textSlide.apply(H, [x]);
                            break;
                        case "video":
                            g.viewport.slides.videoSlide.apply(H, [x]);
                            break;
						case "iframe":
							g.viewport.slides.iframeSlide.apply(H, [x]);
							break;
						case "load":
							g.viewport.slides.loadSlide.apply(H, [x]);
							break;
                        }
                        H.find(".slide").attr("data-title", x.title).attr("data-tags", x.tags).attr("data-id", x.slideId).attr("data-container-id", x.containerId).attr("data-slideindex", G).attr("data-index", D).attr("data-type", x.type).attr("data-image", x.img);
                        (function (Y, J, O, P, W) {
                            if (O == P) {
                                Y.find(".slide").addClass("active")
                            }
                            var T = Y.find("iframe"),
                                U = d(window),
                                Q = d(".slide_info"),
                                N = U.width(),
                                X = a("FULLSCREEN_IMAGE"),
                                K = W.imageWidth,
                                V = X.full_height,
                                S, Z = 0,
                                R, aa, L, M;
                            if (W.type == "video") {
                                R = (W.video_aspect_ratio === "16:9");
                                aa = false;
                                if (!R && typeof W.video_aspect_ratio === "string" && W.video_aspect_ratio !== "4:3") {
                                    aa = W.video_aspect_ratio.split(":");
                                    aa = parseInt(aa[0], 10) / parseInt(aa[1], 10)
                                }
                                S = g.viewport.slides.calculateVideoPlayerWidth(W.video_url, V, R, aa);
                                //K = W.imageWidth;
																K = S.width;
                                Z = 0;
                                //Z = S.controlBarHeight
                            }
                            L = K;
                            K = Math.min((N - X.nav_width), K);
                            V = Math.round(((K / L) * (V - Z)) + Z);
                            M = V;
                            V = Math.min(d(".vertically_centered").height() - X.nav_height, V);
                            K = Math.round(((V - Z) / (M - Z)) * K);
                            Y.find(".slide, .shell").css("width", K + t.width).end().find(".shell").height(V + t.height).end().find(".slide").height(V + 10).end().find(".shell img, .shell iframe").width(K).height(V);
                            if (Y.find(".slide.active").length && Q.length) {
                                Q.width(K).makeVisible()
                            }
                        })(H, b(j) + x.img, C, D, x);
                        if (x.type == "container") {
                            H.addClass(x.type).find(".slide").append(g.htmlTemplates.pageCurl).append(g.htmlTemplates.containerBorders)
                        }
                        H.appendTo(u.find(".slides"));
                        q = H.find(".bgimage");
                        if (q.length) {
                            q.css({
                                width: q.width() + Math.abs(t.width),
                                height: q.height() + Math.abs(t.height)
                            })
                        }
                        B = H.find(".text-content");
                        if (B.length) {
                            B.height(H.height() - parseInt(B.css("padding-top"), 10) - parseInt(B.css("padding-bottom"), 10) - 11)
                        }
                    }
                    if (y == 1) {
                        d(".slide .prev, .slide .next").remove()
                    }
                    d(".view_panel, .pagination").makeVisible();
                    r.makeVisible();
                    g.preloadImageGroup(a("PRELOAD.fullscreen"), function () {
                        d(".view_panel, .pagination").makeVisible();
                        r.makeVisible();
                        e.fullscreen = true
                    });
                    g.events.viewport.loadFullImages();
                    if (z) {
                        window.setTimeout(function () {
                            var J = d(".slide.active"),
                                L = J.attr("data-title"),
                                K = J.attr("data-type");
                            //트래커g.tracker.recordView("Slide View - Fullscreen", L + " (" + K + ")")
                        }, 500)
                    }
                },
                paginate: {
                    prevOffset: 0,
                    completed: true,
                    totalThumbs: null,
                    loadSlidePage: function (F) {
                        F = F || g.activePage;
                        var x = d(".pagination"),
                            G = a("NUM_SLIDES_TO_LOAD"),
                            C = x.find(".thumb").outerHTML(),
                            z = n.slides.length - 1,
                            H = Math.floor(z / G) + 1,
                            p, y, t = 36,
                            v = t * G,
                            w = (f == 1) ? "black" : "white";
                        this.currPage = F;
                        x.find("ul").remove();
                        for (var A = 0, u = 0, J, s, q, E; A < H; A++) {
                            J = A;
                            s = J * G;
                            q = (s + G) - 1;
                            E = d("<ul></ul>");
                            E.attr("data-page", J);
                            if (J == F) {
                                E.addClass("active")
                            }
                            for (var B = s, I, D, r; B <= q; B++, u++) {
                                y = d(C);
                                p = n.slides[B];
                                if (p) {
                                    r = p.type || "image";
                                    I = p.image_name || p.container_image;
                                    D = false;
                                    switch (r) {
                                    case "image":
                                        I = b("thumb") + I;
                                        break;
                                    case "facebook":
                                        D = "rss_icon_" + w + ".png";
                                        y.addClass("facebook overlay");
                                    case "rss":
                                        D = "rss_icon_" + w + ".png";
                                        y.addClass("rss overlay");
                                        break;
                                    case "text":
                                        D = "text_icon_" + w + ".png";
                                        y.addClass("text overlay");
                                        break;
                                    case "twitter":
                                        D = "twitter_icon_" + w + ".png";
                                        y.addClass("twitter overlay");
                                        break;
                                    case "video":
                                        D = "video_icon_" + w + ".png";
                                        y.addClass("video overlay");
                                        break
                                    }
                                    if (D) {
                                        if (I) {
                                            y.find("a").css({
                                                "background-image": "url(" + b("thumb") + I + ")",
                                                "background-position": "0 0"
                                            });
                                            I = b("thumb") + D
                                        } else {
                                            I = (I) ? I : "/assets/images/1x1.gif";
                                            y.find("a").css("background-image", "url(" + b("thumb") + D + ")")
                                        }
                                    }
                                    y.find("img").attr("src", I);
                                    if (u == 0) {
                                        y.attr("data-caption", "start").addClass("highlight")
                                    } else {
                                        if (u == z) {
                                            y.attr("data-caption", "end").addClass("highlight")
                                        }
                                    }
                                } else {
                                    y.addClass("blank").find("img").remove()
                                }
                                E.append(y)
                            }
                            x.width(v).find(".thumbWrapper").css("left", -(F * v)).append(E)
                        }
                        this.showIndicator();
                        if (H == 1) {
                            x.find(".arrow").css("display", "none")
                        }
                    },
                    loadGridPages: function (x) {
                        x = x || g.activePage;
                        h = (h == 0) ? 1 : h;
                        var q = d(".slide_container"),
                            v = Math.floor((n.slides.length - 1) / h),
                            u = d(".pagination"),
                            w = u.find("a").outerHTML(),
                            r = 15;
                        u.children().remove();
                        if (v == 0) {
                            q.find(".arrow").remove();
                            u.remove();
                            return
                        }
                        for (var s = 0; s <= v; s++) {
                            var t = d(w);
                            t.attr("data-page", s);
                            if (s == x) {
                                t.addClass("selected")
                            }
                            u.append(t)
                        }
                        var p = r * (v + 1);
                        u.width(p)
                    },
                    showIndicator: function (v) {
                        var u = d(".pagination"),
                            s = u.find(".indicator"),
                            A = 32,
                            p = 5,
                            q;
                        v = (typeof (v) === "undefined") ? g.activeSlide.relativePosition : v;
                        var B = u.find(".active .thumb").eq(v),
                            D = u.find("ul:first .thumb").eq(v),
                            r = (D.length) ? D.position().left : 0,
                            z = this,
                            C = a("NUM_SLIDES_TO_LOAD"),
                            x = parseInt(d(".slides .active").attr("data-slideindex"), 10),
                            w = Math.floor(x / C),
                            t, y = d(".thumbWrapper");
                        y.find(".active").removeClass("active");
                        t = y.find("ul:eq(" + w + ")").addClass("active").position();
                        if (t) {
                            y.css("left", "-" + t.left + "px")
                        }
                        if (!B.length) {
                            var u = d(".pagination");
                            v = v - (C * w);
                            B = u.find(".active .thumb").eq(v);
                            D = u.find("ul:first .thumb").eq(v);
                            r = (D.length) ? D.position().left : 0
                        }
                        if (B.length) {
                            this.completed = false;
                            s.attr("data-page", B.parent("ul").attr("data-page"));
                            q = r + (A / 2) + p;
                            s.text("");
                            if (this.completed) {
                                s.css("left", this.prevOffset)
                            }
                            s.stop();
                            this.prevOffset = s.css("left");
                            s.show().animate({
                                left: q
                            }, "normal", function () {
                                var E = B.attr("data-caption") || "";
                                s.text(E);
                                z.prevOffset = d(this).css("left");
                                z.completed = true
                            })
                        }
                    }
                },
                processSlideInfo: function (B) {
									//checkHash();
                    var z = {},
                        p = B,
                        x = n.container[0],
                        F = p.name || p.container_name || "",
                        y = p.tags || p.container_tags || "",
                        G = p.image_name || p.container_image || "",
                        t = (p.container_id) ? "container" : p.type,
                        A = (p.container_id) ? p.container_id : "",
                        s = (p.container_name) ? p.container_name : "",
                        r = (p.slide_id) ? p.slide_id : "0" + String(A),
                        v = p.link || "",
                        E = p.video_url || "",
                        C = p.video_aspect_ratio,
                        D = p.feed_url || "",
                        q = {},
                        w, u;
                    if (t == "text" && G == "") {
                        G = (f == 1) ? "default_background_black.jpg" : "default_background_white.jpg"
                    }
                    if (t == "video" && G == "") {
                        if (C == "4:3") {
                            G = (f == 1) ? "default_4x3_poster_dark.jpg" : "default_4x3_poster_light.jpg"
                        } else {
                            G = (f == 1) ? "default_16x9_poster_dark.jpg" : "default_16x9_poster_light.jpg"
                        }
                    }
                    switch (j) {
                    case a("LINEAR_MODE"):
                        w = p.linear_width || p.container_linear_width;
                        break;
                    case a("GRID_MODE"):
                        w = a("GRID_IMAGES.width");
                        break;
                    case a("FULL_MODE"):
                        w = p.fullscreen_width || p.container_fullscreen_width;
                        break
                    }
                    if (!x) {
                        x = {
                            name: "",
                            tags: ""
                        }
                    }
                    if (x.name) {
                        F = (F) ? x.name + "\\" + F : x.name
                    }
                    if (x.tags) {
                        y = (y) ? x.tags + ", " + y : x.tags
                    }
                    y = y.split(",");
                    y = y.unique().join(", ");
                    y = y || "none";
                    z = {
                        title: F,
                        tags: y,
                        img: G,
                        type: t,
                        containerId: A,
                        containerName: s,
                        slideId: r,
                        imageWidth: parseInt(w, 10),
                        link: v
                    };
                    switch (t) {
                    case "text":
                        z.body = p.body;
                        z.headline = p.headline;
                    case "rss":
                    case "twitter":
                        z.base_color = p.base_color || z.base_color || "";
                        z.feed_url = D;
                        z.highlight_color = p.highlight_color || z.highlight_color || "";
                        z.link_color = p.link_color || "";
                        z.link_hover_color = p.link_hover_color || "";
                        break;
                    case "video":
                        z.video_url = E;
                        z.video_aspect_ratio = C;
                        break
                    }
                    return z
                },
                slides: {
                    imageSlide: function (r) {
                        var q = this;
                        q.find(".shell_contents").append("<img class='shell_img' src='/assets/images/1x1.gif' />");
                        if (r.link) {
                            var p = d(g.htmlTemplates.externalLinks.replaceVars({
                                content: r.link
                            }));
                            p.attr("href", r.link).click(function (s) {
                                //트래커g.tracker.recordExitClick(r.link, s)
                            });
                            q.find(".shell_contents").append(p)
                        }
                        switch (j) {
                        case a("FULL_MODE"):
                        case a("LINEAR_MODE"):
                            if (r.type == "container") {
                                q.addClass(r.type).find(".slide").append(g.htmlTemplates.pageCurl).append(g.htmlTemplates.containerBorders)
                            }
                            break;
                        case a("GRID_MODE"):
                            if (r.type == "container") {
                                q.find(".slide").addClass("has_children").append(g.htmlTemplates.pageCurl)
                            }
                            break
                        }
												checkID(q);//수정코드
                    },
		    iframeSlide: function (r) {
                        var q = this;
			q.find(".shell_logo, .shell_loader").remove();
                        q.find(".shell_contents").append("<iframe class='shell_iframe' src='"+r.link+"'></iframe>");
                        switch (j) {
                        case a("FULL_MODE"):
			    q.find('.shell_innerSolid').remove();
			    
                        case a("LINEAR_MODE"):
				
                            if (r.type == "container") {
                                q.addClass(r.type).find(".slide").append(g.htmlTemplates.pageCurl).append(g.htmlTemplates.containerBorders)
                            }
                            break;
                        case a("GRID_MODE"):
                            if (r.type == "container") {
                                q.find(".slide").addClass("has_children").append(g.htmlTemplates.pageCurl)
                            }
                            break
                        }
                    },
		    loadSlide: function (r) {
                        var q = this;
			q.find(".shell_logo, .shell_loader").remove();
			q.find(".shell_contents").load(r.link,function(){
				recruitFn(q.find('.slide').attr('data-id'));
			});
                        switch (j) {
                        case a("FULL_MODE"):
       											q.find('.shell_innerSolid').remove();
                        case a("LINEAR_MODE"):
                            if (r.type == "container") {
                                q.addClass(r.type).find(".slide").append(g.htmlTemplates.pageCurl).append(g.htmlTemplates.containerBorders)
                            }
                            break;
                        case a("GRID_MODE"):
                            if (r.type == "container") {
                                q.find(".slide").addClass("has_children").append(g.htmlTemplates.pageCurl)
                            }
                            break
                        }
                    },
                    textSlide: function (r) {
                        var p = this,
                            q = function (x) {
                                var B = this,
                                    t = B.closest(".slide"),
                                    v = B.closest(".shell"),
                                    u, C = "bgimage",
                                    w = a("BASE_URL"),
                                    A, s, y = d("<div></div>"),
                                    z = (x.headline && x.headline !== "") ? g.htmlTemplates.textHeader.replaceVars({
                                        headline: x.headline
                                    }) : "";
				if(x.body.indexOf('iframe')>-1) {
					B.append(x.body);
				} else {
					                          if (!v.length) {
                                    v = B.removeClass("text-content");
                                    B = d(document.createElement("div")).addClass("text-content").appendTo(B);
                                    if (v.hasClass(C)) {
                                        v.removeClass(C);
                                        B.addClass(C)
                                    }
                                }
                                B.append(z, x.body);
				}
                                u = t.find(".bgimage");
                                A = x.link;
                                if (A && A !== "") {
                                    s = d(g.htmlTemplates.siteVisitLink.replaceVars({
                                        "site-link": A
                                    }));
                                    s.click(function (D) {
                                        //트래커g.tracker.recordExitClick(d(this).attr("href"), D)
                                    }).attr("target", "_blank");
                                    v.append(s)
                                }
                                t.find(".shell_logo, .shell_loader").remove();
                                if (typeof iScroll !== "undefined") {
                                    B.wrap('<div class="wrapper"></div>');
                                    window.setTimeout(function () {
                                        var D = new iScroll(B[0], {
                                            hScrollbar: false,
                                            vScrollbar: true,
                                            checkDOMChanges: false
                                        });
                                        B.data("scroller", D)
                                    }, 0)
                                }
                                if (u.length) {
                                    u.css({
                                        display: "block",
                                        opacity: 0
                                    }).animate({
                                        opacity: 1
                                    }, 500, "linear")
                                }
                                B.css({
                                    display: "block",
                                    opacity: 0
                                }).animate({
                                    opacity: 1
                                }, 500, "linear")
                            };
                        g.viewport.slides.setupSlideContentContainer(p, r, function () {
                            q.call(this, r)
                        })
                    },
                    feedSlide: function (r) {
                        var p = this,
                            q = function (y) {
                                var z = this,
                                    w = z.closest(".shell"),
                                    A = a("FEED_ITEM_COUNTS.TWEETS"),
                                    x = a("BASE_URL"),
                                    u, B, t, v = function (H) {
                                        var I = H.tweets,
                                            C = d("<ul></ul>").appendTo(z),
                                            G, E, F, D;
                                        for (D = 0, u = A[g.getCurrentMode()]; D < u; D++) {
                                            G = I[D];
                                            if (!G) {
                                                break
                                            }
                                            E = G.in_reply_to;
                                            F = E.status_id ? g.htmlTemplates.tootInReplyTo.replaceVars({
                                                username: E.screen_name,
                                                "toot-id": E.status_id
                                            }) : "";
                                            C.append(d("<li></li>").addClass("tweet").attr("data-index", "tweet-" + D).append(G.text, g.htmlTemplates.tootMeta.replaceVars({
                                                date: G.date,
                                                source: G.source,
                                                "in-reply": F
                                            })))
                                        }
                                    },
                                    s = function (F) {
                                        var C = F.rssitems,
                                            D, G, E;
                                        for (i = 0; i < C.length; i++) {
                                            E = C[i];
                                            z.append(g.htmlTemplates.rssHeadline.replaceVars({
                                                item_link: E.link,
                                                item_title: E.title
                                            }), g.htmlTemplates.rssMeta.replaceVars({
                                                item_meta: E.pubDate
                                            }), d('<div class="content"></div>').html(E.description))
                                        }
                                    };
                                g.XHR.getJSON(a("JSONP.getFeed") + y.slideId, {}, function (F) {
																	try{console.warn(a("JSONP.getFeed") + y.slideId);}catch(e){}//추가
                                    var C, E, D = "bgimage";
                                    if (F.error) {
                                        g.XHR.__displayError();
                                        return
                                    }
                                    if (!w.length) {
                                        w = z.removeClass("text-content");
                                        z = d(document.createElement("div")).addClass("text-content").appendTo(z);
                                        if (w.hasClass(D)) {
                                            w.removeClass(D);
                                            z.addClass(D)
                                        }
                                    }
                                    w.append(g.htmlTemplates.feedBadge);
                                    if (F.tweets) {
                                        v(F)
                                    }
                                    if (F.rssitems) {
                                        s(F)
                                    }
                                    E = y.link;
                                    if (E && E !== "") {
                                        C = d(g.htmlTemplates.feedVisitLink.replaceVars({
                                            "feed-link": E
                                        }));
                                        C.click(function (G) {
                                            //트래커g.tracker.recordExitClick(d(this).attr("href"), G)
                                        }).attr("target", "_blank");
                                        w.append(C)
                                    }
                                    z.find("a").each(function () {
                                        var H = d(this).attr("href"),
                                            G = function (I) {
                                                return RegExp("^mailto:").test(I)
                                            };
                                        if (!G(H)) {
                                            d(this).attr("target", "_blank")
                                        }
                                    }).click(function (G) {
                                        //트래커g.tracker.recordExitClick(d(this).attr("href"), G)
                                    });
                                    if (typeof iScroll !== "undefined") {
                                        z.wrap('<div class="wrapper"></div>');
                                        window.setTimeout(function () {
                                            var G = new iScroll(z[0], {
                                                hScrollbar: false,
                                                vScrollbar: true,
                                                checkDOMChanges: false
                                            });
                                            z.data("scroller", G)
                                        }, 0)
                                    }
                                    w.find(".bgimage, .text-content").fadeIn(500, function () {
                                        w.find(".shell_logo, .shell_loader").remove()
                                    });
                                    w.addClass("loaded")
                                })
                            };
                        g.viewport.slides.setupSlideContentContainer(p, r, function () {
                            q.call(this, r)
                        })
                    },
                    videoSlide: function (r) {
                        var p = this,
                            q = r.video_url;
                        p.find(".slide").addClass("video").find(".shell_contents").append("<img class='shell_img' src='/assets/images/1x1.gif' />");
                        if (r.video_url) {
                            p.find(".shell_contents").append(g.htmlTemplates.videoIcon, g.htmlTemplates.videoSlide);
                            p.find("iframe").data("video_url",'videoplayer.html?vodURL='+q).load(function () {
                                d("body").focus()
                            })
                        }
                    },
                    calculateVideoPlayerWidth: function (w, p, q, t, v) {
                        if (typeof w !== "string" || typeof p !== "number" || typeof q !== "boolean") {
                            return
                        }
                        var u = a("VIDEO_CONTROLS_HEIGHT"),
                            s = d("body"),
                            r;
                        if (typeof t === "number") {
                            r = t
                        } else {
                            r = (q) ? (16 / 9) : (4 / 3)
                        }
                        if (!/ip(ad|od|hone)/.test(s.attr("class"))) {
                            if (typeof v === "number") {
                                p -= v
                            } else {
                                if (/youtube\.com/.test(w)) {
                                    v = u.youtube;
                                    p -= v
                                } else {
                                    if (/vimeo\.com/.test(w)) {
                                        v = u.vimeo;
                                        p -= v
                                    }
                                }
                            }
                        }
                        return {
                            width: Math.round(p * r),
                            controlBarHeight: v
                        }
                    },
                    setupSlideContentContainer: function (s, x, y) {
                        var z = s.find(".shell_contents"),
                            q = z.closest(".slide"),
                            v = z.closest(".shell"),
                            u = g.getCurrentMode(),
                            w = "slide_" + x.slideId,
                            r, p, t, A;
                        A = function (B) {
                            if (typeof B !== "string") {
                                return B
                            }
                            return (B.match(/^([0-9a-f]{3}){1,2}$/i)) ? "#" + B : B
                        };
                        if (!g.isTBWA || (g.isTBWA && x.img && !/default_background/.test(x.img))) {
                            p = g.htmlTemplates.userSlideCSS.replaceVars({
                                base_id: w,
                                background_image: (x.img === "") ? "none" : "url(" + b(j) + x.img + ")",
                                highlight_color: A(x.highlight_color),
                                base_color: A(x.base_color),
                                link_color: A(x.link_color),
                                link_hover_color: A(x.link_hover_color)
                            });
                            d("<style>" + p + "</style>").insertBefore(z)
                        }
                        if (x.img !== "") {
                            if (g.getCurrentMode(j) === "grid_mode") {
                                z.addClass("bgimage")
                            } else {
                                r = d(document.createElement("div")).addClass("bgimage");
                                z.css("background-color", "transparent");
                                v.append(r);
                                r.fadeIn()
                            }
                        } else {
                            q.addClass("nobg")
                        }
                        q.attr("id", w).addClass(x.type);
                        z.addClass("text-content");
                        if (typeof y === "function") {
                            y.call(z)
                        }
                        return z
                    },
                    set_title: function (s, q) {
                        s = s || "";
                        if (typeof q === "number") {
                            var r = s.match(new RegExp("^.{0," + q + "}"))[0];
                            if (r.length === q) {
                                s = r.replace(/\s+\w*$/, "…")
                            } else {
                                s = r
                            }
                        }
                        s = s.split("\\");
                        if (s.length > 1) {
                            var p = s.shift();
                            return "<span class='highlight'>" + p + "&nbsp;\\&nbsp;</span>" + s.join("\\")
                        }
                        return s[0]
                    }
                }
            },
            footer: {
                init: function () {
                    var p = d("#footer");
                    p.find(".overlay").each(function () {
                        var r = d(this),
                            s = a("OVERLAY.HELP.width"),
                            q = {
                                iframe: true
                            };
                        if (r.hasClass("help")) {
                            q.initialWidth = s;
                            q.width = s
                        }
                        r.colorbox(q)
                    });
                    p.find("a:external").click(function (q) {
                        //트래커g.tracker.recordExitClick(d(this).attr("href"), false, "Footer")
                    });
                    p.find(".filters li:not('.logout') a").bind("click", function (v) {
                        var u = d(this).attr("href"),
                            y = location.protocol,
                            z = location.host,
                            A = location.search,
                            x = d(this),
                            r, w, s, t = function (B) {
                                return RegExp("^mailto:").test(B)
                            },
                            q = function (B) {
                                return RegExp("^/|^#$").test(B)
                            };
                        if (!x.attr("target")) {
                            r = u.match(/^#([lgf]si\d+ci\d+(b\d)?q.*)$/i);
                            if (r) {
                                v.preventDefault();
                                w = g.getURLHashValues(r[1]);
                                if (w.searchQuery) {
                                    s = a("JSONP.searchResults");
                                    g.XHR.getJSON(s, {
                                        terms: w.searchQuery
                                    }, function (B) {
                                        n = B;
                                        g.activeSlide.id = 0;
                                        g.activeSlide.index = null;
                                        g.header.searchBar.query = w.searchQuery;
                                        g.header.titleBar.setTitle("navigation", true);
                                        g.viewport.render();
                                        window.focus()
                                    })
                                } else {
                                    g.events.viewport.slide.loadChildSlides({}, {
                                        containerId: w.containerId,
                                        slideId: w.slideId,
                                        containerName: ""
                                    })
                                }
                                return
                            }
                            if (x.is(":external")) {
                                x.attr("target", "_blank")
                            } else {
                                if (x.is(":internal")) {
                                    if (d("#outerWrapper").hasClass("tbwa")) {
                                        v.preventDefault();
                                        location.href = "http://" + location.hostname //추가코드
																			}
                                }
                            }
                        }
                    })
                }
            },
            events: {
                init: function () {
                    this.window.init();
                    this.header.init();
                    this.viewpanel.init();
                    this.viewport.init();
                    if (d("body").hasClass("mobile") && document.addEventListener) {
                        document.addEventListener("touchmove", function (p) {
                            p.preventDefault()
                        })
                    }
                },
                header: {
                    init: function () {
                        var p = d("#search_box"),
                            q = d(".title_bar");
                        p.find(".search_text").focus(function () {
                            var r = d(this);
                            this.select();
                            r.attr("data-focused", true);
                            if (r.val().toLowerCase() == r.attr("data-default_value")) {
                                r.val("")
                            }
                        }).blur(function () {
                            var r = d(this);
                            r.attr("data-focused", false);
                            if (r.val() == "") {
                                r.val(r.attr("data-default_value"))
                            }
                            g.header.searchBar.clearSuggestions()
                        }).keydown(function (s) {
                            var r = d(this).siblings(".search_button");
                            r.addClass("in_progress");
                            window.clearTimeout(k);
                            k = window.setTimeout(g.header.searchBar.suggest, a("SEARCH.autoSuggestTimeout"));
                            switch (s.keyCode) {
                            case 13:
                                s.preventDefault();
                                s.stopPropagation();
                                s.stopImmediatePropagation();
                                r.click();
                                this.blur();
                                break;
                            case 27:
                                g.header.searchBar.clearSuggestions();
                                break
                            }
                        }).end().find(".search_button").click(function (t) {
                            var s = d("#search_box").find(".search_text"),
                                r = s.val();
                            if (r === s.attr("data-default_value")) {
                                return
                            }
                            g.header.searchBar.lookUp(r)
                        });
                        p.delegate(".result", "click", function (s) {
                            s.preventDefault();
                            var r = d("#search_box").find(".search_text");
                            r.val(d(this).text());
                            d("#searchResultsWrapper").remove();
                            g.header.searchBar.lookUp(r.val())
                        });
                        q.bind("click", function (v, w) {
                            var s = d(v.target),
                                r, u, t;
                            if (!s.hasClass("breadcrumb")) {
                                s = s.parents(".breadcrumb")
                            }
                            if (typeof w != "undefined") {
                                u = w.parent_container_id || w.container_id
                            }
                            r = s.attr("data-containerid") || null;
                            r = (typeof w === "object") ? parseInt(u, 10) : r;
                            t = s.attr("data-slideid") || 0;
                            t = (typeof w === "object") ? "0" + parseInt(g.activeContainer.id, 10) : t;
                            if (r == null) {
                                return
                            }
                            g.header.searchBar.clear();
                            s.nextAll().remove();
                            g.activeSlide.id = t;
                            g.activeSlide.index = null;
                            g.activeContainer.id = r;
                            g.activeSlide.relativePosition = 0;
                            g.XHR.getJSON(a("JSONP.get") + r, "", function (x) {
                                n = x;
                                g.header.titleBar.setTitle("navigation", true);
                                g.viewport.render();
                                g.updateHash();
                                g.viewport.resizeGrid(false)
                            })
														if(g.activeContainer.id == 5 || g.activeContainer.id == 6) jQuery('div.vertically_centered').removeClass('recruit_wrap'); //추가
                        })
                    }
                },
                viewpanel: {
                    init: function () {
                        var u = d(".view_panel"),
                            r = d("body"),
                            t = r.hasClass("ipad"),
                            p = (r.hasClass("mobile") && !t),
                            s, q = this;
                        if (typeof window.orientation !== "undefined" && typeof window.addEventListener !== "undefined") {
                            s = "onorientationchange" in window ? "orientationchange" : "resize";
                            window.addEventListener(s, function () {
                                switch (g.getCurrentMode()) {
                                case "linear_mode":
                                    q.linearView();
                                    g.events.viewpanel.runPostCommonCode();
                                    break;
                                case "grid_mode":
                                    q.gridView();
                                    g.events.viewpanel.runPostCommonCode();
                                    break
                                }
                            });
                            if (p) {
                                window.addEventListener(s, function () {
                                    switch (window.orientation) {
                                    case 90:
                                    case -90:
                                        g.events.viewpanel.runPreCommonCode.call(u.find(".slide_view a").get(0));
                                        q.linearView();
                                        g.events.viewpanel.runPostCommonCode()
                                    }
                                })
                            }
                            if (t) {
                                window.addEventListener(s, function () {
                                    if (g.getCurrentMode() !== "full_mode") {
                                        return
                                    }
                                    switch (window.orientation) {
                                    case 0:
                                    case 180:
                                        g.events.viewpanel.runPreCommonCode.call(u.find(".slide_view a").get(0));
                                        q.linearView();
                                        g.events.viewpanel.runPostCommonCode()
                                    }
                                })
                            }
                        }
                        u.find("a").bind("click", function (v) {
                            v.preventDefault();
                            v.stopPropagation();
                            if (d(this).hasClass("selected") || d(this).parent().hasClass("disabled")) {
                                v.stopImmediatePropagation()
                            }
                        }).end().find(".slide_view a").bind("click", q.linearView).end().find(".grid_view a").bind("click", q.gridView).end().find(".full_screen a").bind("click", q.fullscreenView).end().find(".background a").bind("click", q.colorToggle)
                    },
                    runPreCommonCode: function () {
                        d(".view_panel").find(".selected").removeClass("selected");
                        d(this).addClass("selected");
                        if (d.browser.msie) {
                            d("#content_area iframe").remove()
                        }
                    },
                    runPostCommonCode: function () {
                        g.updateHash();
                        g.viewport.resizeGrid()
                    },
                    linearView: function () {
                        g.events.viewpanel.runPreCommonCode.call(this);
                        g.setCurrentMode(a("LINEAR_MODE"));
                        g.viewport.render();
                        g.events.viewpanel.runPostCommonCode()
                    },
                    gridView: function () {
                        g.events.viewpanel.runPreCommonCode.call(this);
                        g.setCurrentMode(a("GRID_MODE"));
                        g.viewport.render(false, false);
                        g.events.viewpanel.runPostCommonCode()
                    },
                    fullscreenView: function () {
                        g.events.viewpanel.runPreCommonCode.call(this);
                        g.setCurrentMode(a("FULL_MODE"));
                        g.viewport.render();
                        g.events.viewpanel.runPostCommonCode.call(this)
                    },
                    colorToggle: function () {
                        var u = a("BACKGROUND_COLORS"),
                            p = 0,
                            x = 1,
                            B = "bgdark",
                            v = d(".pagination"),
                            w = d("#search_box"),
                            q = d(".title_bar"),
                            y = d(".slide_info"),
                            r = d(".slide_container"),
                            s = 1000,
                            t = d("#outerWrapper"),
                            A = function () {
                                q.add(w).add(y).fadeIn();
                                v.add(y).add(r).animate({
                                    opacity: 1
                                })
                            },
                            z = function (G) {
                                var C = v.find(".thumb a"),
                                    E = v.find(".thumb img"),
                                    D = new RegExp(".*icon_white.png.*|.*icon_black.png.*"),
                                    F, H;
                                if (G == p) {
                                    C.each(function () {
                                        var I = d(this);
                                        F = D.exec(I.css("background-image"));
                                        if (F !== null) {
                                            I.css("background-image", F[0].replace("icon_white", "icon_black"))
                                        }
                                    });
                                    E.each(function () {
                                        var I = d(this);
                                        H = D.exec(I.attr("src"));
                                        if (H !== null) {
                                            I.attr("src", H[0].replace("icon_white", "icon_black"))
                                        }
                                    })
                                } else {
                                    C.each(function () {
                                        var I = d(this);
                                        F = D.exec(I.css("background-image"));
                                        if (F !== null) {
                                            I.css("background-image", F[0].replace("icon_black", "icon_white"))
                                        }
                                    });
                                    E.each(function () {
                                        var I = d(this);
                                        H = D.exec(I.attr("src"));
                                        if (H !== null) {
                                            I.attr("src", H[0].replace("icon_black", "icon_white"))
                                        }
                                    })
                                }
                            };
                        q.add(w).fadeOut("fast");
                        v.add(y).add(r).css("opacity", 0);
                        if (g.viewport.backgroundColor == 0) {
                            d("body").animate({
                                backgroundColor: u.dark
                            }, s, function () {
                                t.addClass(B);
                                z(p);
                                A()
                            });
                            f = g.viewport.backgroundColor = 1;
                            g.updateHash()
                        } else {
                            d("body").animate({
                                backgroundColor: u.light
                            }, s, function () {
                                t.removeClass(B);
                                z(x);
                                A()
                            });
                            f = g.viewport.backgroundColor = 0;
                            g.updateHash()
                        }
                    }
                },
                viewport: {
                    init: function () {
                        d("#content_area").bind("click", function (p) {
                            if (g.events.isTextSlide(p.target)) {
                                return
                            }
                            p.preventDefault();
                            window.focus()
                        });
                        d(".video_button a.button").live("click", function (u) {
                            u.preventDefault();
                            if (g.getCurrentMode() === "grid_mode") {
                                d(".view_panel .slide_view a").trigger("click")
                            } else {
                                var t = d(this),
                                    s = t.parents(".slide:first"),
                                    r, w = (g.getCurrentMode() === "full_mode") ? "Fullscreen" : "Linear",
                                    q = 0,
                                    v, p;
                                p = function () {
																	var wVal = t.parent().parent().find('img.shell_img').width();//추가코드
																	var hVal = t.parent().parent().find('img.shell_img').height();//추가코드
                                    t.parent().add(t.parent().siblings("img")).fadeOut(function () {
                                        if (q) {
                                            return
                                        }
                                        q++;
                                        r = t.parent().siblings("iframe");
																				var videoSrc = r.data("video_url")+'&width='+wVal+'&height='+hVal;//추가코드
                                        r.attr("src", videoSrc).addClass("playing");//코드수정
                                        v = s.attr("data-title");
                                        //트래커g.tracker.recordView("Video Playback - " + w, v)
                                    })
                                };
                                window.setTimeout(p, 500)
                            }
                        })
                    },
                    bindLinearEvents: function () {
                        var p = g.events.viewport,
                            q = p.slide.currSlide.mouse,
                            r;
                        if (a("ENABLE_DRAGGING")) {
                            d(".slide_container").bind("touchstart", function (u) {
                                var v = u.originalEvent.touches,
                                    t = (v.length == 1) ? true : false,
                                    s = v[0];
                                d(this).trigger("mousedown", [s])
                            }).bind("touchmove", function (u) {
                                var v = u.originalEvent.touches,
                                    t = (v.length == 1) ? true : false,
                                    s = v[0];
                                if (!t) {
                                    return
                                }
                                d(this).trigger("mousemove", [s])
                            }).bind("touchend", function (u) {
                                var v = u.originalEvent.touches,
                                    t = (v.length == 1) ? true : false,
                                    s = v[0];
                                d(this).trigger("mouseup", [s])
                            });
                            d(".slide_container").bind("mousemove", function (z, s) {
                                z.preventDefault();
                                z = (typeof (s) !== "undefined") ? s : z;
                                if (q.capture) {
                                    var x = z.pageX - q.start.x,
                                        v = a("MOUSE_THRESHOLD"),
                                        A, u, y, C = a("NUM_SLIDES_TO_LOAD"),
                                        w = g.activePage * C,
                                        t = (w + C) - 1,
                                        B = n.slides.length - 1;
                                    if (x > v) {
                                        q.capture = false;
                                        u = d(".active", ".slide_container");
                                        A = parseInt(u.attr("data-slideindex"), 10);
                                        y = parseInt(u.attr("data-index"), 10);
                                        A--;
                                        y--
                                    } else {
                                        if (x < -v) {
                                            q.capture = false;
                                            u = d(".active", ".slide_container");
                                            A = parseInt(u.attr("data-slideindex"), 10);
                                            y = parseInt(u.attr("data-index"), 10);
                                            A++;
                                            y++
                                        } else {
                                            return false
                                        }
                                    }
                                    d(this).trigger("loadSlideFromIndex", [A, y])
                                }
                            })
                        } else {
                            d(".slide_container").bind("mousemove", function (s) {
                                s.preventDefault()
                            })
                        }
                        d(".slide_container").bind("dblclick", function (s) {
                            s.preventDefault();
                            d(".view_panel .full_screen a").trigger("click")
                        }).bind("mousedown", function (u, s) {
                            var t = d(u.target).parents(".slide");
                            if (g.events.isTextSlide(u.target) && t.hasClass("active")) {
                                return
                            }
                            u.preventDefault();
                            u = (typeof (s) !== "undefined") ? s : u;
                            q.capture = true;
                            q.start.x = u.pageX;
                            q.target = u.target
                        }).bind("mouseup", function (w, t) {
                            w.preventDefault();
                            w = t || w;
                            q.capture = false;
                            q.end.x = w.pageX;
                            var s = 3,
                                x = Math.abs(q.end.x - q.start.x),
                                u, v;
                            if (x <= 3) {
                                u = w.target.className;
                                v = d(w.target).parents(".slide");
                                if (v.hasClass("active")) {
                                    if (u.indexOf("prev") == -1 && u.indexOf("next") == -1) {
                                        p.slide.loadChildSlides.call(v[0], w);
                                        return
                                    }
                                }
                                d(this).trigger("slideclick", [q]);
                                d("#search_box").find(".search_text").trigger("blur")
                            }
                            q.target = undefined;
                            d("body").focus()
                        }).bind("loadSlideFromIndex", function (w, x, C) {
                            var B = a("NUM_SLIDES_TO_LOAD"),
                                u = g.activePage * B,
                                t = (u + B) - 1,
                                y = n.slides.length - 1,
                                v, A = (typeof (C) === "undefined") ? false : true,
                                z = function () {
                                    g.activeSlide.index = x;
                                    g.viewport.render({
                                        entranceAnimation: false
                                    });
                                    d(".slides").css("left", "200%").find(".active").trigger("load")
                                },
                                s = function () {
                                    g.activeSlide.index = x;
                                    g.viewport.render({
                                        entranceAnimation: false
                                    });
                                    d(".slides").css("left", "-200%").find(".active").trigger("load")
                                };
                            if (x > y) {
                                C = 0
                            } else {
                                if (x < 0) {
                                    C = y
                                }
                            }
                            if (A) {
                                g.activeSlide.relativePosition = C
                            }
                            p.slide.loadSlideIndex(C);
                            g.viewport.paginate.showIndicator(C);
                            if (!r) {
                                r = window.setTimeout(function () {
                                    var D = d(".slide.active"),
                                        F = D.attr("data-title"),
                                        E = D.attr("data-type");
                                    //트래커g.tracker.recordView("Slide View - Linear", F + " (" + E + ")");
                                    r = false
                                }, 500)
                            }
                        }).bind("slideclick", function (x, s) {
                            if (!s.target) {
                                throw new Error("Invalid event passed to 'slideclick' event handler.");
                                return
                            }
                            if (g.events.isTextSlide(s.target)) {}
                            var t = s.target.tagName.toLowerCase(),
                                u = d(".snapped", ".slide_container").attr("data-index"),
                                w;
                            x.stopPropagation();
                            switch (t) {
                            case "img":
                                w = d(s.target).parents(".slide").attr("data-index");
                                if (w != u) {
                                    p.slide.loadSlideIndex(w, s);
                                    g.viewport.paginate.showIndicator(w)
                                }
                                break;
                            default:
                                var y = d(s.target),
                                    v = y.parents(".slide");
                                w = v.attr("data-index");
                                if (v.length) {
                                    if (y.hasClass("next")) {
                                        w = parseInt(v.attr("data-slideindex"), 10);
                                        index = parseInt(v.attr("data-index"), 10);
                                        w++;
                                        index++;
                                        d(this).trigger("loadSlideFromIndex", [w, index]);
                                        break
                                    } else {
                                        if (y.hasClass("prev")) {
                                            w = parseInt(v.attr("data-slideindex"), 10);
                                            index = parseInt(v.attr("data-index"), 10);
                                            w--;
                                            index--;
                                            d(this).trigger("loadSlideFromIndex", [w, index]);
                                            break
                                        }
                                    }
                                    if (v.attr("data-index") != u) {
                                        var w = parseInt(v.attr("data-index"), 10);
                                        p.slide.loadSlideIndex(w);
                                        g.viewport.paginate.showIndicator(w)
                                    }
                                }
                                break
                            }
                        });
                        d(".slide").bind("load", function () {
                            d(".slide_container").trigger("slideclick", [{
                                target: d(this).find(".shell_contents").get(0)
                            }])
														//editBtn2(jQuery(this).attr('data-id'))//수정코드
                        });
                        d(".pagination .thumb a").bind("click", function (z) {
                            z.preventDefault();
                            if (d(this).parent().hasClass("blank")) {
                                return
                            }
                            var w = a("NUM_SLIDES_TO_LOAD"),
                                s = d(".pagination"),
                                t = s.find(".indicator"),
                                v = g.viewport.paginate.totalThumbs,
                                u, y, x;
                            if (v == null) {
                                v = s.find(".thumb a")
                            }
                            u = v.index(this);
                            x = Math.floor(u / w);
                            if (x == 0) {
                                y = u
                            } else {
                                y = u - (x * w)
                            }
                            g.activeSlide.relativePosition = u;
                            g.activeSlide.index = u;
                            d(".slide_container").trigger("loadSlideFromIndex", [u, u]);
                            g.viewport.paginate.showIndicator(y)
                        });
                        d(".pagination .arrow a").bind("click", function (A) {
                            A.preventDefault();
                            var E = d(this).parent(),
                                z = d(".pagination"),
                                F = z.find(".thumbWrapper"),
                                C = z.find("ul.active"),
                                H, x, D = "",
                                w, y, v, s, t, u = z.find("ul").length,
                                G = C.width(),
                                B = z.find(".indicator"),
                                I = function () {
                                    if (D != "") {
                                        if (D == "next") {
                                            v.remove();
                                            z.find("ul:first").addClass("active");
                                            F.css("left", 0)
                                        } else {
                                            if (D == "prev") {
                                                t = z.find("ul:last");
                                                t.addClass("active");
                                                w = t.prev().position().left;
                                                F.css("left", -w + "px");
                                                v.remove()
                                            }
                                        }
                                    }
                                };
                            if (C.length == 0) {
                                C = z.find("ul.active")
                            }
                            if (E.hasClass("next")) {
                                y = C.next();
                                if (!y.length) {
                                    D = "next";
                                    y = z.find("ul:first");
                                    y = v = y.clone();
                                    F.append(v)
                                }
                            } else {
                                y = C.prev();
                                if (!y.length) {
                                    D = "prev";
                                    y = z.find("ul:last");
                                    y = v = y.clone();
                                    s = F.find("ul:first");
                                    v.insertBefore(s);
                                    F.css("left", -G + "px")
                                }
                            }
                            z.find(".active").removeClass("active");
                            y.addClass("active");
                            x = y.position();
                            F.animate({
                                left: -x.left
                            }, 500, a("SCROLL_EASING"), I);
                            if (B.attr("data-page") == y.attr("data-page")) {
                                B.fadeIn()
                            } else {
                                B.fadeOut()
                            }
                            z.find("li.highlight img").fadeOut("normal", function () {
                                d(this).fadeIn("normal")
                            })
                        });
                        d(".slide_info").bind("click", function (t) {
                            t.preventDefault();
                            var s = d(t.target);
                            if (s.hasClass("tag")) {
                                tbwa.application.header.searchBar.lookUp(s.text())
                            }
                        })
                    },
                    loadLinearImages: function () {
                        var w = parseInt(g.activeSlide.relativePosition, 10),
                            s = d(".slide"),
                            p = s.eq(w),
                            r = a("NUM_IMAGES_TO_SHOW.linear"),
                            u = s.length,
                            t, q, v;
                        if (w < r) {
                            v = s.slice(0, r + 1)
                        } else {
                            if (w == u) {
                                v = s.slice(-r)
                            } else {
                                t = Math.max(w - Math.ceil(r / 2), 0);
                                q = Math.min(w + Math.ceil(r / 2), u);
                                v = s.slice(t, q)
                            }
                        }
                        v.each(function () {
                            var y = d(this),
                                x = y.attr("data-image") || false;
                            if (!x) {
                                return
                            }(function (A, z) {
                                d.preloadImage(z, function () {
                                    A.find(".shell_contents").show().find("img").attr("src", z).fadeIn().end().addClass("loaded");
                                    A.find(".shell_loader").remove();
                                    A.removeAttr("data-image")
                                })
                            })(y, b(j) + x)
                        })
                    },
                    bindGridEvents: function () {
                        var p = g.events.viewport,
                            q = p.slide.currSlide.mouse,
                            r;
                        if (a("ENABLE_DRAGGING")) {
                            d(".grid").bind("touchstart", function (u) {
                                var v = u.originalEvent.touches,
                                    t = (v.length == 1) ? true : false,
                                    s = v[0];
                                d(this).trigger("mousedown", [s])
                            }).bind("touchmove", function (u) {
                                var v = u.originalEvent.touches,
                                    t = (v.length == 1) ? true : false,
                                    s = v[0];
                                if (!t) {
                                    return
                                }
                                d(this).trigger("mousemove", [s])
                            }).bind("touchend", function (u) {
                                var v = u.originalEvent.touches,
                                    t = (v.length == 1) ? true : false,
                                    s = v[0];
                                d(this).trigger("mouseup", [s])
                            });
                            d(".grid").bind("mousedown", function (t, s) {
                                if (g.events.isTextSlide(t.target)) {
                                    return
                                }
                                t.preventDefault();
                                t = (typeof (s) !== "undefined") ? s : t;
                                q.capture = true;
                                q.start.x = t.pageX;
                                q.target = t.target
                            }).bind("mouseup", function (t, s) {
                                t.preventDefault();
                                t = (typeof (s) !== "undefined") ? s : t;
                                q.capture = false;
                                q.end.x = t.pageX;
                                q.target = undefined;
                                d("body").focus()
                            }).bind("mousemove", function (u, t) {
                                u.preventDefault();
                                u = (typeof (t) !== "undefined") ? t : u;
                                if (q.capture) {
                                    var v = u.pageX - q.start.x,
                                        s = a("MOUSE_THRESHOLD");
                                    if (v > s) {
                                        q.capture = false;
                                        d(".arrow.prev").trigger("click")
                                    } else {
                                        if (v < -s) {
                                            q.capture = false;
                                            d(".arrow.next").trigger("click")
                                        } else {
                                            return false
                                        }
                                    }
                                }
                            })
                        } else {
                            d(".grid").bind("mousemove", function (s) {
                                s.preventDefault()
                            })
                        }
                        d(".pagination a").bind("click", function (u) {
                            u.preventDefault();
                            var s = d(this).attr("data-page"),
                                t = h * s;
                            g.activeSlide.index = t;
                            g.activeSlide.id = n.slides[t].slide_id || "0" + String(n.slides[t].container_id);
                            g.updateHash();
                            g.viewport.render();
                            g.viewport.resizeGrid(false)
                        });
                        d(".next, .prev").bind("click", function (v) {
                            v.preventDefault();
                            var s = d(".pagination"),
                                u = (d(this).hasClass("next")) ? "next" : "prev",
                                t = s.find("a.selected")[u]();
                            if (t.length) {
                                t.click()
                            } else {
                                if (u == "next") {
                                    s.find("a:first").click()
                                } else {
                                    s.find("a:last").click()
                                }
                            }
                        });
                        d("#grid_wrapper").bind("click", function (u) {
                            u.preventDefault();
                            var t = d(u.target).parents(".slide"),
                                s;
                            d("#search_box").find(".search_text").trigger("blur");
                            if (g.events.isTextSlide(u.target) && u.target.tagName === "A" && !u.target.href.match(/^mailto:/)) {
                                window.open(u.target.href);
                                return
                            }
                            if (t.length) {
                                d(".grid").find(".active").removeClass(".active");
                                t.addClass("active");
                                s = t.attr("data-slideindex");
                                g.activeSlide.index = s;
                                g.activeSlide.id = String(t.attr("data-id"));
                                g.updateHash();
                                if (t.hasClass("has_children")) {
                                    g.events.viewport.slide.loadChildSlides.call(t[0], u)
                                }
                            }
                        }).bind("dblclick", function (s) {
                            d(".view_panel .slide_view a").trigger("click")
                        });
                        d("#grid_wrapper").find(".link").bind("click", function (s) {
                            s.stopPropagation()
                        })
                    },
                    bindFullscreenEvents: function () {
                        var p = g.events.viewport,
                            q = p.slide.currSlide.mouse,
                            r;
                        if (a("ENABLE_DRAGGING")) {
                            d(".slide_container").bind("touchstart", function (u) {
                                var v = u.originalEvent.touches,
                                    t = (v.length == 1) ? true : false,
                                    s = v[0];
                                d(this).trigger("mousedown", [s])
                            }).bind("touchmove", function (u) {
                                var v = u.originalEvent.touches,
                                    t = (v.length == 1) ? true : false,
                                    s = v[0];
                                if (!t) {
                                    return
                                }
                                d(this).trigger("mousemove", [s])
                            }).bind("touchend", function (u) {
                                var v = u.originalEvent.touches,
                                    t = (v.length == 1) ? true : false,
                                    s = v[0];
                                d(this).trigger("mouseup", [s])
                            });
                            d(".slide_container").bind("mousedown", function (t, s) {
                                if (g.events.isTextSlide(t.target)) {
                                    return
                                }
                                t.preventDefault();
                                t = (typeof (s) !== "undefined") ? s : t;
                                q.capture = true;
                                q.start.x = t.pageX;
                                q.target = t.target
                            }).bind("mouseup", function (t, s) {
                                t.preventDefault();
                                t = (typeof (s) !== "undefined") ? s : t;
                                q.capture = false;
                                q.end.x = t.pageX;
                                q.target = undefined;
                                d("body").focus()
                            }).bind("mousemove", function (u, t) {
                                u.preventDefault();
                                u = (typeof (t) !== "undefined") ? t : u;
                                if (q.capture) {
                                    var v = u.pageX - q.start.x,
                                        s = a("MOUSE_THRESHOLD");
                                    if (v > s) {
                                        q.capture = false;
                                        d(".slide .prev").trigger("click")
                                    } else {
                                        if (v < -s) {
                                            q.capture = false;
                                            d(".slide .next").trigger("click")
                                        } else {
                                            return false
                                        }
                                    }
                                }
                            })
                        } else {
                            d(".slide_container").bind("mousemove", function (s) {
                                s.preventDefault()
                            })
                        }
                        d(".slide").bind("load", function () {
                            var u = d(".slide_container"),
                                s = u.find(".active"),
                                t = d(this);
                            s.fadeOut(300, function () {
                                d(this).removeClass("active");
                                u.find(".video iframe").each(function () {
                                    var v = d(this),
                                        w = v.parents(".slide:first");
                                    if (!w.hasClass("active") && v.hasClass("playing")) {
                                        v.attr("src", "").removeClass("playing");
                                        w.find(".shell_contents").find("img").show().end().find(".video_button").show()
                                    }
                                });
                                t.addClass("active").fadeIn(400, function () {
                                    g.viewport.resizeGrid();
                                    g.events.viewport.loadFullImages()
                                })
                            });
                            g.events.viewport.slide.loadSlideInfo.call(t[0], true)
                        });
                        d(".slide .next, .slide .prev").bind("click", function (y) {
                            y.preventDefault();
                            var u = d(".slide_container"),
                                x = (d(this).hasClass("next")) ? "next" : "prev",
                                t = u.find(".active"),
                                s = u.find(".active").parent()[x](),
                                w = s.attr("data-slideindex"),
                                v;
                            if (s.length) {
                                v = s.find(".slide");
                                v.trigger("load");
                                g.activeSlide.id = v.attr("data-id");
                                g.activeSlide.index = w;
                                g.activeSlide.relativePosition = v.attr("data-index");
                                g.updateHash()
                            } else {
                                if (x == "next") {
                                    w = u.find(".slide:first").attr("data-index")
                                } else {
                                    w = u.find(".slide:last").attr("data-index")
                                }
                                g.activeSlide.index = w;
                                g.activeSlide.relativePosition = t.attr("data-index");
                                g.viewport.render();
                                g.updateHash()
                            }
                            if (!r) {
                                r = window.setTimeout(function () {
                                    var z = d(".slide.active"),
                                        B = z.attr("data-title"),
                                        A = z.attr("data-type");
                                    //트래커g.tracker.recordView("Slide View - Fullscreen", B + " (" + A + ")");
                                    r = false
                                }, 500)
                            }
                        });
                        d(".full_mode .container .shell").bind("click", function (u) {
                            u.preventDefault();
                            u.stopPropagation();
                            var t = d(".slide_container"),
                                s = t.find(".active");
                            d("#search_box").find(".search_text").trigger("blur");
                            g.events.viewport.slide.loadChildSlides.call(s[0])
                        });
                        d(".full_mode .slide").bind("click", function (t) {
                            var s = d(t.target);
                            switch (t.target.tagName.toLowerCase()) {
                            case "a":
                                if (s.hasClass("link")) {
                                    window.open(s.attr("href")).focus()
                                }
                                break
                            }
                        });
                        d(".slide_info").bind("click", function (t) {
                            t.preventDefault();
                            var s = d(t.target);
                            if (s.hasClass("tag")) {
                                tbwa.application.header.searchBar.lookUp(s.text())
                            }
                        })
                    },
                    loadFullImages: function () {
                        var w = parseInt(g.activeSlide.relativePosition, 10),
                            s = d(".slide"),
                            p = s.eq(w),
                            r = a("NUM_IMAGES_TO_SHOW.full"),
                            u = s.length,
                            t, q, v;
                        if (w < r) {
                            v = s.slice(0, r)
                        } else {
                            if (w == u) {
                                v = s.slice(-r)
                            } else {
                                t = Math.max(w - Math.ceil(r / 2), 0);
                                q = Math.min(w + Math.ceil(r / 2), u);
                                v = s.slice(t, q)
                            }
                        }
                        v.each(function () {
                            var D = d(this),
                                y = D.attr("data-image") || false,
                                A = a("SHELL_OFFSETS"),
                                C = D.find(".video_button .button"),
                                B = D.find(".text-content"),
                                z, x;
                            if (B.length) {
                                B.height(D.height() - parseInt(B.css("padding-top"), 10) - parseInt(B.css("padding-bottom"), 10) - 11)
                            }(function () {
                                window.setTimeout(function () {
                                    C.animate({
                                        opacity: 1
                                    }, "normal")
                                }, 1000)
                            })();
                            if (!y) {
                                return
                            }(function (F, E) {
                                d.preloadImage(E, function () {
                                    F.find(".shell_contents").show().find("img").attr("src", E).fadeIn().end().addClass("loaded");
                                    F.find(".shell_loader").remove()
                                })
                            })(D, b(j) + y)
                        })
                    },
                    slide: {
                        currSlide: {
                            slideWidth: 0,
                            mouse: {
                                start: {
                                    x: 0,
                                    y: 0
                                },
                                end: {
                                    x: 0,
                                    y: 0
                                }
                            }
                        },
                        loadChildSlides: function (u, p) {
                            var t = d(".slide_container"),
                                v = d("#grid_wrapper"),
                                s, r = (typeof p === "undefined") ? false : true,
                                p = p || false,
                                q;
                            loadContainer = function () {
                                if (!p) {
                                    p = {
                                        containerId: parseInt(s.attr("data-container-id"), 10),
                                        containerName: s.attr("data-container-name")
                                    }
                                }
                                g.activeContainer.id = p.containerId;
                                g.activeSlide.id = 0;
                                g.activeSlide.index = 0;
                                g.activeSlide.relativePosition = 0;
                                g.header.searchBar.clear();
                                g.updateHash();
                                q = s.attr("data-title") || "";																
                                if (d("#outerWrapper").hasClass("tbwa") && q.toLowerCase() == "contact us\\"+a("OFFICE_MATCH_TERM").toLowerCase()) {
                                    g.activeContainer.id = p.containerId;
                                    g.activeContainer.name = p.containerName;
                                    try {
                                        g.XHR.getJSON(a("JSONP.get") + p.containerId, "", function (x) {
                                            n = x;
                                            tbwa.offices.init(n);
                                            window.focus()
                                        })
                                    } catch (w) {
                                        throw new Error("Function: loadChildSlides. Unable to load TBWA Contact Us.")
                                    }
                                    return false
                                }
                                g.XHR.getJSON(a("JSONP.get") + p.containerId, "", function (x) {
                                    if (typeof p.slideId !== "undefined") {
                                        g.activeSlide.id = p.slideId;
                                        g.activeSlide.index = null
                                    }
                                    n = x;
                                    g.header.titleBar.setTitle("navigation", true);
                                    g.viewport.render();
                                    g.updateHash();
                                    g.viewport.resizeGrid(false);
                                    window.focus()
                                })
                            };
                            switch (j) {
                            case a("FULL_MODE"):
                                s = t.find(".slides .active");
                                if (d(this).parent().hasClass("container") || r) {
                                    d(".slide_info").animate({
                                        opacity: 0
                                    });
                                    d(".slides").fadeOut(500, function () {
                                        loadContainer()
                                    })
                                }
                                break;
                            case a("LINEAR_MODE"):
                                s = t.find(".slides .active");
                                if (d(this).parent().hasClass("container") || r) {
                                    d(".slide_info, .pagination").animate({
                                        opacity: 0
                                    });
                                    d(".slides").animate({
                                        opacity: 0
                                    }, "fast", function () {
                                        loadContainer();
                                        d(this).makeHidden().css("opacity", 1)
                                    })
                                }
                                break;
                            case a("GRID_MODE"):
                                s = v.find(".active");
                                if (!s.length) {
                                    s = d(".slide").eq(parseInt(g.activeSlide.index, 10)).addClass("active")
                                }
                                v.find(".selectedPage").fadeOut("fast", function () {
                                    loadContainer()
                                });
                                break
                            }
                        },
                        loadSlideIndex: function (v, y) {
                            v = parseInt(v, 10);
                            y = (typeof (y) !== "function") ? tbwa.fn : y;
                            var s = d(".slide_container"),
                                u = d("body"),
                                t = s.find(".slide").eq(v),
                                z = Math.floor((g.viewport.windowWidth / 2) - (t.width() / 2)),
                                p = t.position().left,
                                x = (z - p),
                                q = (u.hasClass("mobile")) ? "mobile" : "web",
                                r = a("SCROLL_SPEED")[q],
                                w = s.find(".slide.active");
                            if (!t.hasClass("noAnimation")) {
                                w.add(t).find("a.prev, a.next").makeHidden();
                                s.find(".slides").stop().animate({
                                    left: x
                                }, r, a("SCROLL_EASING"), function () {
                                    t.find("a.prev, a.next").css({
                                        display: "none",
                                        visibility: "visible"
                                    }).stop().fadeIn();
                                    y()
                                })
                            } else {
                                s.find(".slides").css("left", x)
                            }
                            s.find(".snapped, .active").removeClass("snapped active");
                            t.addClass("snapped active");
                            this.loadSlideInfo.call(t[0], !t.hasClass("noAnimation"));
                            t.removeClass("noAnimation");
                            g.activeSlide.id = t.attr("data-id");
                            g.activeSlide.index = t.attr("data-slideindex");
                            g.activeSlide.relativePosition = t.attr("data-index");
                            g.updateHash();
                            switch (j) {
                            case a("LINEAR_MODE"):
                                g.viewport.paginate.showIndicator();
                                break
                            }
                            s.find(".video iframe").each(function () {
                                var A = d(this),
                                    B = A.parents(".slide:first");
                                if (!B.hasClass("active") && A.hasClass("playing")) {
                                    A.attr("src", "").removeClass("playing");
                                    B.find(".shell_contents").find("img").show().end().find(".video_button").show()
                                }
                            });
                            g.events.viewport.loadLinearImages()
                        },
                        loadSlideInfo: function (r) {
                            r = r || false;
                            var s = d(".slide_info"),
                                q = d(this),
                                t = function () {
                                    var u = q.attr("data-tags").split(","),
                                        x = g.htmlTemplates.tagWrapper;
                                    for (var v = 0, w = u.length; v < w; v++) {
                                        u[v] = x.replaceVars({
                                            content: u[v]
                                        })
                                    }
                                    return u.join(",")
                                },
                                p = function () {
                                    var u = 18;
                                    if (s.length) {
                                        s.width(q.width() + u).find(".title").html(g.viewport.slides.set_title(q.attr("data-title"))).end().find(".tags").html(t())
                                    }
                                    if (!q.hasClass("noAnimation") && s.length) {
                                        s.animate({
                                            opacity: 1
                                        }, {
                                            easing: "linear",
                                            complete: function () {
                                                if (d.browser.msie) {
                                                    s.css("filter", "")
                                                }
                                            }
                                        })
                                    } else {
                                        q.removeClass("noAnimation")
                                    }
                                };
                            if (q.hasClass("noAnimation")) {
                                g.viewport.slides.set_title(q.attr("data-title"));
                                p();
                                if (s.length) {
                                    s.css("opacity", 1)
                                }
                                if (r && s.length) {
                                    s.makeVisible()
                                }
                            } else {
                                if (s.length && q.get(0) !== window) {
                                    s.stop().animate({
                                        opacity: 0
                                    }, "normal", function () {
                                        g.viewport.slides.set_title(q.attr("data-title"));
                                        p();
                                        if (r) {
                                            d(this).makeVisible()
                                        }
                                    })
                                }
                            }
                        },
                        mousemove: function (p) {}
                    }
                },
                onhashchange: function () {
                    if (!m) {
                        var q = g.getURLHashValues(location.hash.replace("#", "")),
                            p = (q.containerId == g.activeContainer.id) ? true : false,
                            r;
                        if (q && p && q.searchQuery == "") {
                            switch (q.appMode) {
                            case "l":
                                r = a("LINEAR_MODE");
                                break;
                            case "g":
                                r = a("GRID_MODE");
                                break;
                            case "f":
                                r = a("FULL_MODE");
                                break
                            }
                            g.activeSlide.index = g.getSlideIndex(q.slideId);
                            g.activeSlide.id = q.slideId;
                            g.activeContainer.id = q.containerId;
                            if (r == j) {
                                d(".slide").eq(g.activeSlide.index).trigger("load");
                                m = false
                            } else {
                                location.reload()
                            }
                        } else {
                            location.reload()
                        }
                    } else {
                        m = false
                    }
                },
                window: {
                    lastEvent: null,
                    init: function () {
                        var p = g.events.viewport.slide;
                        d.resize.throttleWindow = true;
                        d.resize.delay = 1000;
                        d(window).bind("resize", tbwa.application.viewport.resizeGrid).hashchange(g.events.onhashchange);
                        d(document).bind("keyup", function (v) {//코드틀린부분
                            var u = function () {
                                    var y = d("#top_bar .title_bar"),
                                        x = y.find(".breadcrumb:last");
                                    x = (x.prev().length) ? x.prev() : x;
                                    x.trigger("click")
                                },
                                r = function () {
                                    var x = d("#top_bar .title_bar .breadcrumb:last");
                                    if (d("#top_bar .title_bar .breadcrumb").length > 1) {
                                        x.trigger("click", [n.parent])
                                    }
                                };
                            if (d("#search_box .search_text").attr("data-focused") == "true") {
                                if (v.keyCode == 13) {
                                    v.preventDefault();
                                    v.stopPropagation();
                                    v.stopImmediatePropagation()
                                }
                                return
                            }
                            if (this.lastEvent != null) {
                                var q = v.timeStamp - this.lastEvent;
                                if (q < 300) {
                                    return
                                }
                            }
                            this.lastEvent = v.timeStamp;
                            var w = function (B) {
                                    if (typeof addthis !== "undefined" && addthis.open) {
                                        return
                                    }
                                    if (typeof B === "undefined") {
                                        return
                                    }
                                    var z = d(".slide_container"),
                                        x = z.find(".active"),
                                        y, A;
                                    switch (B.keyCode) {
                                    case 13:
                                        if (x.attr("data-type") == "video") {
                                            x.find(".video_button a.button").trigger("click")
                                        } else {
                                            g.events.viewport.slide.loadChildSlides.call(x[0])
                                        }
                                        break;
                                    case 27:
                                        B.preventDefault();
                                        B.stopPropagation();
                                        u();
                                        break;
                                    case 37:
                                        A = x.find(".prev")[0];
                                        z.trigger("slideclick", [{
                                            target: A
                                        }]);
                                        break;
                                    case 38:
                                        r();
                                        break;
                                    case 39:
                                        y = x.find(".next")[0];
                                        z.trigger("slideclick", [{
                                            target: y
                                        }]);
                                        break;
                                    case 40:
                                        g.events.viewport.slide.loadChildSlides.call(x[0]);
                                        break;
                                    case 66:
                                        d(".view_panel .background a").trigger("click");
                                        break;
                                    case 70:
                                        d(".view_panel .full_screen a").trigger("click");
                                        break;
                                    case 83:
                                        if (typeof addthis_open === "function") {
                                            try {
                                                addthis_open(document.body, "more", null, null)
                                            } catch (B) {}
                                        }
                                        break;
                                    case 71:
                                        d(".view_panel .grid_view a").trigger("click");
                                        break
                                    }
                                };
                            var t = function (A) {
                                    if (typeof addthis !== "undefined" && addthis.open) {
                                        return
                                    }
                                    if (typeof A === "undefined") {
                                        return
                                    }
                                    var z = d(".slide_container"),
                                        y, x;
                                    switch (A.keyCode) {
                                    case 27:
                                        A.preventDefault();
                                        A.stopPropagation();
                                        u();
                                        break;
                                    case 37:
                                        y = z.find(".arrow.prev");
                                        y.trigger("click");
                                        break;
                                    case 38:
                                        r();
                                        break;
                                    case 39:
                                        x = z.find(".arrow.next");
                                        x.trigger("click");
                                        break;
                                    case 40:
                                        g.events.viewport.slide.loadChildSlides.call($active[0]);
                                        break;
                                    case 66:
                                        d(".view_panel .background a").trigger("click");
                                        break;
                                    case 70:
                                        d(".view_panel .full_screen a").trigger("click");
                                        break;
                                    case 76:
                                        d(".view_panel .slide_view a").trigger("click");
                                        break;
                                    case 83:
                                        if (typeof addthis_open === "function") {
                                            try {
                                                addthis_open(document.body, "more", null, null)
                                            } catch (A) {}
                                        }
                                        break
                                    }
                                };
                            var s = function (B) {
                                    if (typeof addthis !== "undefined" && addthis.open) {
                                        return
                                    }
                                    if (typeof B === "undefined") {
                                        return
                                    }
                                    var A = d(".slide_container"),
                                        x = A.find(".active"),
                                        C = d("#top_bar .title_bar"),
                                        z, y;
                                    switch (B.keyCode) {
                                    case 13:
                                        if (x.attr("data-type") == "video") {
                                            x.find(".video_button a.button").trigger("click")
                                        } else {
                                            g.events.viewport.slide.loadChildSlides.call(x[0])
                                        }
                                        break;
                                    case 27:
                                        d(".view_panel .slide_view a").trigger("click");
                                        break;
                                    case 37:
                                        z = x.find(".prev");
                                        z.trigger("click");
                                        break;
                                    case 38:
                                        r();
                                        break;
                                    case 39:
                                        y = x.find(".next");
                                        y.trigger("click");
                                        break;
                                    case 40:
                                        g.events.viewport.slide.loadChildSlides.call(x[0]);
                                        break;
                                    case 66:
                                        d(".view_panel .background a").trigger("click");
                                        break;
                                    case 71:
                                        d(".view_panel .grid_view a").trigger("click");
                                        break;
                                    case 76:
                                        d(".view_panel .slide_view a").trigger("click");
                                        break;
                                    case 83:
                                        if (typeof addthis_open === "function") {
                                            try {
                                                addthis_open(document.body, "more", null, null)
                                            } catch (B) {}
                                        }
                                        break
                                    }
                             };
                            if (v.keyCode) {
                                switch (v.keyCode) {
                                case 76:
                                case 71:
                                case 70:
                                    if (g.activeSlide.index == null && g.activeSlide.id == 0 && g.header.searchBar.query) {
                                        return
                                    }
                                    break
                                }
                            }
                            switch (j) {
                            case a("LINEAR_MODE"):
                                w(v);
                                break;
                            case a("GRID_MODE"):
                                t(v);
                                break;
                            case a("FULL_MODE"):
                                s(v);
                                break
                            }
                        })
                    }
                },
                isTextSlide: function (t) {
                    var p = d(t),
                        q = "text-content",
                        u = "vcard",
                        r = "link",
                        s = false;
                    if (p.hasClass(q) || p.parents("." + q).length) {
                        s = true
                    } else {
                        if (p.parents("." + u).length) {
                            s = true
                        } else {
                            if (p.hasClass(r)) {
                                s = true
                            } else {
                                if (p.siblings("." + q).length) {
                                    s = true
                                }
                            }
                        }
                    }
                    return s
                }
            },
            activeContainer: {
                id: 0,
                name: ""
            },
            activeSlide: {
                id: 0,
                index: null,
                relativePosition: null
            },
            activePage: 0,
            end: function () {},
            extend: function () {
                var p = (arguments.length) ? arguments[0] : undefined;
                if (typeof (p) !== "object") {
                    return
                }
                for (var t in p) {
                    var u = tbwa;
                    for (var q = 0, s = t.split("."), r = s.length - 1; q <= r; q++) {
                        if (typeof u[s[q]] !== "undefined" && q != r) {
                            u = u[s[q]]
                        }
                        if (q == r) {
                            u[s[q]] = p[t]
                        }
                    }
                }
            },
            getCurrentMode: function (q) {
                var p;
                q = (typeof q === "undefined") ? j : q;
                switch (q) {
                case a("LINEAR_MODE"):
                    p = "linear_mode";
                    break;
                case a("GRID_MODE"):
                    p = "grid_mode";
                    break;
                case a("FULL_MODE"):
                    p = "full_mode";
                    break;
                default:
                    throw new Error("Invalid mode passed in getCurrentMode.");
                    return false
                }
                return p
            },
            getSlideIndex: function (u) {
                if (typeof (u) == "undefined") {
                    throw new Error("Must pass id when calling function getSlideIndex");
                    return
                }
                var r = n.slides,
                    s = 0,
                    p = (u.length > 0 && u.substring(0, 1) == "0") ? "container_id" : "slide_id";
                u = parseInt(u, 10);
                for (var q = 0, t = r.length; q < t; q++) {
                    if (r[q][p] == u) {
                        s = q;
                        break
                    }
                }
                return s
            },
            getSlidesFromId: function (q) {
                var p;
                if (typeof (q) == "undefined") {
                    throw new Error("Must pass id when calling function getSlidesFromId");
                    return
                }
                p = g.getSlideIndex(q);
                return g.getSlidesFromIndex(p)
            },
            getSlidesFromIndex: function (x) {
                if (typeof (x) === "undefined") {
                    throw new Error("Must pass index in getSlidesFromIndex.");
                    return
                }
                var q = n.slides,
                    w = q.length,
                    p, y = x,
                    u, v = [],
                    z = w - 1,
                    A = 0,
                    B, t;
                switch (j) {
                case a("LINEAR_MODE"):
                    p = w;
                    break;
                case a("GRID_MODE"):
                    p = h;
                    break;
                case a("FULL_MODE"):
                    p = w;
                    break
                }
                pageNum = Math.floor(Math.abs(y / p));
                B = pageNum * p;
                t = B + (p - 1);
                for (var s = B, r = 0; s <= t; s++, r++) {
                    if (s == y) {
                        g.activeSlide.relativePosition = r
                    }
                    u = q[s];
                    if (u) {
                        v[r] = {
                            index: s,
                            object: u
                        }
                    } else {
                        break
                    }
                }
                A = Math.floor(y / p);
                g.activePage = A;
                return v
            },
            htmlTemplates: {
                ajaxError: '<div id="XHRError"><p>{error_message}</p></div>',
                blankIframe: "<iframe frameborder='0' src='{domain}/docs/blank'></iframe>",
                containerBorders: "<div class='child_border_top'></div><div class='child_border_right'></div><div class='child_border_bottom'></div><div class='child_border_left'></div>",
                feedBadge: '<div class="badge"></div>',
                feedVisitLink: '<a href="{feed-link}" class="visit-feed hideText">Visit the Feed</a>',
                fullTemplate: null,
                gridPaginateTemplate: "<div class='pagination'><a href='#'>&nbsp;</a></div>",
                gridTemplate: null,
                linearTemplate: null,
                linkCSS: "<link rel='stylesheet' type='text/css' media='all' href='{href}'/>",
                externalLinks: "<a class='link hideText' href='#' onclick='void(0)' target='_blank'>{content}</a>",
                noResults: "<p class='message'>No Results</p>",
                pageCurl: "<div class='page_curl'></div>",
                paginateTemplate: null,
                privacyPolicy: null,
                searchResults: "<div id='searchResultsWrapper'><ul></ul><div class='shadow'></div></div>",
                shareDescription: "Learn more about {title} projeqt. Powered by projeqt.com",
                siteVisitLink: '<a href="{site-link}" class="visit-site hideText">Visit Site</a>',
                slideInfoTemplate: null,
                tagWrapper: "<span class='tag'>{content}</span>",
                rssHeadline: '<h1><a href="{item_link}">{item_title}</a></h1>',
                rssMeta: '<h2 class="meta">{item_meta}</h2>',
                textHeader: "<h1>{headline}</h1>",
                titleBarLevel: "<span class='breadcrumb header{container-id}' data-containerid='{container-id}' data-slideid=''>{content}</span>",//코드수정
                titleBarActive: "<span class='highlight'>{content}</span>",
                titleBarSlash: "&nbsp;\\&nbsp;",
                tootInReplyTo: '<a href="http://twitter.com/{username}/status/{toot-id}/">in reply to {username}</a>',
                tootMeta: '<span class="meta">{date} via {source} {in-reply}</span>',
                userSlideCSS: "#{base_id} p, #{base_id} ol, #{base_id} ul, #{base_id}.rss .meta, #{base_id}.rss .content, #{base_id} .tweet .meta, #{base_id} .text-content{ color:{base_color};} #{base_id} .bgimage {background-image:{background_image};} #{base_id} a, #{base_id} a:visited, #{base_id} .tweet .meta a, #{base_id} .tweet .meta a:visited {color:{link_color}; text-decoration:none;} #{base_id} a:hover, #{base_id} .tweet .meta a:hover {color:{link_hover_color}; text-decoration:underline;} #{base_id} h1, #{base_id} .tweet {color:{highlight_color};} #{base_id} h1 a, #{base_id} .tweet a{color:{highlight_color}; text-decoration:none;} #{base_id} h1 a:hover, #{base_id} .tweet a:hover{color:{link_hover_color}; text-decoration:underline;}",
                videoIcon: "<div class='video_button'><a href='#' class='button noEffect'></a></div>",
                videoSlide: "<iframe src='' frameborder='0'></iframe>"
            },
            getURLHashValues: function (q) {
                if (typeof (q) === "undefined") {
                    return ""
                }
                var p = "";
                q = q.match(/^(l|g|f)(si\d+)(ci\d+)(b\d)?(q.*)$/i) || [];
                if (q && q.length === 6) {
                    bgColor = (typeof has);
                    p = {
                        appMode: q[1].toLowerCase(),
                        slideId: String(q[2].match(/\d+/)[0]),
                        containerId: q[3].match(/\d+/)[0],
                        searchQuery: unescape(q[q.length - 1]).substring(1),
                        backgroundColor: ((typeof q[4] === "string" && g.isTBWA) ? q[4].match(/\d+/)[0] : (d("#outerWrapper").hasClass("bgdark") ? 1 : 0))
                    }
                }
                return p
            },
            checkURL: function () {//없던코드
                if (location.hash === "") {
                    return
                }
                var r = location.href,
                    s = location.hash,
                    p = location.search,
                    u = location.protocol,
                    v = location.host,
                    x = location.pathname,
                    q = /^([^q]+)q(%3F.*)$/,
                    w, t;
                if (/q%3F/.test(s)) {
                    w = s.replace(q, "$1q");
                    t = decodeURIComponent(s.replace(q, "$2"));
                    if (p.indexOf("?") > -1) {
                        p += t.replace(/^\?/, "&")
                    } else {
                        p = t
                    }
                    location.replace(u + "//" + v + x + p + w)
                }
            },
            loadURL: function () {
                var s = d("#outerWrapper").attr("class").split(" "),
                    p = location.hash.replace("#", ""),
                    u = d(".view_panel"),
                    r = null;
                for (var q = 0, t = s.length; q < t; q++) {
                    switch (s[q]) {
                    case "linear_mode":
                        r = "l";
                        break;
                    case "grid_mode":
                        r = "g";
                        break;
                    case "full_mode":
                        r = "f";
                        break
                    }
                    if (r) {
                        break
                    }
                }
                p = this.getURLHashValues(p);
                if (typeof (p) === "object") {
                    r = p.appMode;
                    g.activeSlide.id = p.slideId;
                    g.activeSlide.index = null;
                    g.activeContainer.id = p.containerId;
                    g.viewport.backgroundColor = f = p.backgroundColor;
                    g.header.searchBar.query = p.searchQuery
                }
                switch (r) {
                case "l":
                    g.setCurrentMode(a("LINEAR_MODE"));
                    u.find(".slide_view a").addClass("selected");
                    break;
                case "g":
                    g.setCurrentMode(a("GRID_MODE"));
                    u.find(".grid_view a").addClass("selected");
                    break;
                case "f":
                    g.setCurrentMode(a("FULL_MODE"));
                    u.find(".full_screen a").addClass("selected");
                    break
                }
            },
            preloadImageGroup: function (p, u) {
                u = u || tbwa.fn;
                var q = p || false,
                    t;
                if (!q) {
                    throw new Error("Invalid parameter passed to preloadImageGroup function.");
                    return
                } else {
                    q = p.join(",").split(",")
                }
                for (var s = 0, r = (q) ? q.length : 0; s < r; s++) {
                    t = "/assets/images/" + q[s];
                    (function (w, v) {
                        d.preloadImage(t, function () {
                            if (v !== undefined) {
                                v[w] = undefined;
                                var x = v.join(",").replace(/,/g, "").length;
                                if (x == 0) {
                                    v = undefined;
                                    jQuery.isFunction(u) ? u() : null
                                }
                            }
                        })
                    })(s, q)
                }
            },
            start: function () {
                var p = d(".vertically_centered");
                if (p.css("display") == "none") {
                    p.fadeIn("slow")
                }
                g.viewport.resizeGrid()
            },
            setCurrentMode: function (s) {
                var r = d(".slide_container"),
                    p = d("#outerWrapper"),
                    q;
                q = this.getCurrentMode(s);
                r.children().remove();
                d("#outerWrapper").removeClass("linear_mode grid_mode full_mode");
                p.addClass(q);
                o = j;
                j = s;
                this.viewport.exitAnimation()
            },
            storeTemplates: function () {
                var t = tbwa.application.htmlTemplates,
                    s = d("#linear_template"),
                    q = d("#grid_template"),
                    p = d("#fullscreen_template"),
                    r = d(".pagination"),
                    u = d(".slide_info");
                t.linearTemplate = s.html();
                t.gridTemplate = q.html();
                t.fullTemplate = p.html();
                t.paginateTemplate = r.wrap("<div></div>").parent().html();
                t.slideInfoTemplate = u.wrap("<div></div>").parent().html();
                s.remove();
                q.remove();
                p.remove();
                r.parent().remove();
                u.parent().remove()
            },
            trigger: function (p) {
                switch (p) {
                case "fullscreenExit":
                    g.viewport.exitAnimation();
                    break
                }
            },
            updateHash: function () {
                var v, u, q, p, t, s, r;
                switch (j) {
                case a("LINEAR_MODE"):
                    v = "l";
                    break;
                case a("GRID_MODE"):
                    v = "g";
                    break;
                case a("FULL_MODE"):
                    v = "f";
                    break
                }
                u = String(this.activeSlide.id);
                q = this.activeContainer.id;
                p = f;
                //t = encodeURIComponent(this.header.searchBar.query) || ""; 코드수정
                t = escape(this.header.searchBar.query) || "";
                if (t) {
                    g.activeContainer.id = 0;
                    d("#search_box").find(".search_text").val(unescape(t))
                }
                m = true;
                location.hash = v + ("si" + u) + ("ci" + q) + (g.isTBWA ? ("b" + p) : "") + ("q" + t);
                s = d("#scriptAddThis");
                if (s.length) {
                    r = s.attr("src");
                    d.ajax({
                        url: r,
                        dataType: "script",
                        cache: true
                    })
                }
            },
            XHR: {
                cacheJSON: function (r, q, p, s, t) {
                    this._ajax({
                        url: r,
                        dataParams: q,
                        jsonCallback: p,
                        successFunc: s,
                        errorFunc: t
                    })
                },
                getJSON: function (q, p, r, s) {
                    this._ajax({
                        url: q,
                        dataParams: p,
                        successFunc: r,
                        errorFunc: s
                    })
                },
                _ajax: function (s) {
                    var q = s.url,
                        u = s.dataParams,
                        v = s.successFunc,
                        x = s.errorFunc,
                        w = s.jsonCallback || false,
                        t, r = a("BASE_URL"),
                        p = a("JSONP.timeout");
                    if (typeof (v) === "undefined") {
                        throw new Error("Success function undefined in tbwa.application.XHR.getJSON request!");
                        return false
                    }
                    if (q.indexOf(r) == -1) {
                        if (r.substring(r.length - 1) == "/" && q.substring(0, 1) == "/") {
                            q = q.substring(1)
                        }
                        q = r + q
                    }
                    u = u || false;
										try{console.warn('3928:'+q);}catch(e){}//추가코드
                    if (u) {
                        t = {
                            url: q,
                            data: u,
                            callbackParameter: "jsoncallback",
                            timeout: p,
                            success: v,
                            error: x || this._displayError,
                            pageCache: true
                        }
                    } else {
                        t = {
                            url: q,
                            callbackParameter: "jsoncallback",
                            timeout: p,
                            success: v,
                            error: x || this._displayError,
                            pageCache: true
                        }
                    }
                    if (w) {
                        t.jsonpCallback = w
                    }
                    d.jsonp(t)
                },
                _displayError: function (r, q) {
                    var p = a("OVERLAY.ERROR");
                    d.colorbox({
                        initialWidth: p.width,
                        width: p.width,
                        initialHeight: p.height,
                        height: p.height,
                        html: g.htmlTemplates.ajaxError.replaceVars({
                            error_message: "We're sorry but the server has encountered an error."
                        })
                    })
                }
            },
            /*tracker: {
                recordView: function (u, s, p) {
                    if (typeof u !== "string") {
                        return
                    }
                    var w = jQuery(".title_bar"),
                        q = jQuery("#top_bar img"),
                        t = p || jQuery.trim(w.text()) || q.attr("alt") || "Uncategorized",
                        r = s || "";
                    try {
                        if (__GA__.user && __GA__.user !== "") {
                            _gaq.push(["_setAccount", __GA__.projeqt], ["_trackEvent", t, u, r], ["b._setAccount", __GA__.user], ["b._trackEvent", t, u, r])
                        } else {
                            _gaq.push(["_trackEvent", t, u, r])
                        }
                    } catch (v) {} finally {
                        if (__DEV__) {
                            try {
                                if (__GA__.user && __GA__.user !== "") {
                                    console.log("Tracking ( accounts %s, %s ): %s | %s | %s", __GA__.projeqt, __GA__.user, t, u, r)
                                } else {
                                    console.log("Tracking ( account %s ): %s | %s | %s", __GA__.projeqt, t, u, r)
                                }
                            } catch (v) {}
                        }
                    }
                },
                recordExitClick: function (r, u, w) {
                    if (!r || typeof r !== "string") {
                        return
                    }
                    var t = r,
                        v, p, q, s;
                    if (u && u.target) {
                        p = d(u.target).closest(".slide");
                        q = p.attr("data-title");
                        s = p.attr("data-type");
                        t = "From slide " + q + " (" + s + ") to " + r
                    }
                    w = w || d.trim(d(".title_bar").text());
                    switch (g.getCurrentMode()) {
                    case "linear_mode":
                        v = "Linear";
                        break;
                    case "grid_mode":
                        v = "Grid";
                        break;
                    case "full_mode":
                        v = "Fullscreen";
                        break
                    }
                    tbwa.application.tracker.recordView("External Link Click - " + v, t, w)
                }
            },*/
            init: function () {
                var u = d("body"),
                    q = d("#outerWrapper"),
                    p, t, s, r;
                g.isTBWA = q.hasClass("tbwa");
                c.IMAGE_URL.device = (u.hasClass("mobile") ? "mobile" : "web") + "/";
                if (c.IMAGE_URL.device != "web/") {
                    c.IMAGE_URL.device = "web/"
                }
                this.events.init();
                this.storeTemplates();
                this.loadURL();
                if (f == null) {
                    if (q.hasClass("bgdark")) {
                        g.viewport.backgroundColor = f = 1
                    } else {
                        g.viewport.backgroundColor = f = 0
                    }
                }
                if (g.isTBWA) {
                    if (f == 1) {
                        u.css("background-color", a("BACKGROUND_COLORS.dark"));
                        q.addClass("bgdark")
                    } else {
                        u.css("background-color", a("BACKGROUND_COLORS.light"));
                        q.removeClass("bgdark")
                    }
                    g.viewport.backgroundColor = f
                }
                g.updateHash();
                s = g.header.searchBar.query;
                if (s) {
                    p = a("JSONP.searchResults");
                    t = {
                        terms: s
                    }
                } else {
                    p = (g.activeContainer.id != 0) ? a("JSONP.get") + g.activeContainer.id : a("JSONP.getDefault");
                    t = null
                }
                this.XHR.getJSON(p, t, function (v) {
                    n = v;
                    g.viewport.init();
                    g.viewport.render();
                    g.header.init();
                    g.start();
                    // 2011-05-20  thyang@crea-m.com 
                    // 초기화면에서만 팝업을 띄울 함수를 추가
                    if(g.activeContainer.id == 0)
                    {
                    		tbwapopup();	
                    }
                    //window.focus()			//	2011-05-20  thyang@crea-m.com  팝업을 띄울시에 포커스 문제로 주석처리
                });
                g.footer.init()
            }
        };
        var l = this,
            g = this.application
    }
})(jQuery);
(function (a) {
    tbwaClass.prototype.core = {
        init: function () {
            tbwa.application.checkURL();//없던코드
            var b = a("base").attr("href");
            if (typeof b === "string") {
                b = b.replace(/^https?:\/\/([^\/]*).*$/, "$1")
            }
            a.expr[":"].internal = function (d) {
                return (d.hostname === location.hostname || d.hostname === b)
            };
            a.expr[":"].external = function (d) {
                return (d.hostname !== location.hostname && d.hostname !== b)
            };
            if (a.fn.outerHTML) {
                try {
                    console.warn("Attempting to overwrite existing jQuery function outerHTML!")
                } catch (c) {}
            }
            a.fn.outerHTML = function () {
                var f = this.clone(),
                    e = a("<div />"),
                    d = "";
                e.append(f);
                d = e.html();
                f.remove();
                e.remove();
                f = undefined;
                e = undefined;
                return d
            };
            if (a.fn.makeVisible) {
                try {
                    console.warn("Attempting to overwrite existing jQuery function makeVisible!")
                } catch (c) {}
            }
            a.fn.makeVisible = function () {
                return this.css("visibility", "visible")
            };
            if (a.fn.makeHidden) {
                try {
                    console.warn("Attempting to overwrite existing jQuery function makeHidden!")
                } catch (c) {}
            }
            a.fn.makeHidden = function () {
                return this.css("visibility", "hidden")
            };
            if (a.preloadImage) {
                try {
                    console.warn("Attempting to overwrite existing jQuery function preloadImage!")
                } catch (c) {}
            }
            a.extend(jQuery, {
                preloadImage: function (h, j) {
                    if (typeof h !== "string" || typeof h === "string" && !(/\.(gif|jpg|jpeg|png)$/.test(h))) {
                        return
                    }
                    var d = a(document.createElement("img")),
                        g = false,
                        e;
                    d.addClass("preload_image");
                    d.each(function () {
                        var f, l, k = a(this);
                        k.bind("load readystatechange", function () {
                            g = true;
                            k.addClass("complete");
                            if (typeof j === "function") {
                                j.call(this);
                                k.remove()
                            }
                        });
                        if (!g) {
                            k.css({
                                display: "none",
                                width: 0,
                                height: 0
                            }).appendTo(document.body);
                            l = h;
                            this.src = "#";
                            this.src = l
                        }
                    })
                }
            });
            a.extend(a.browser, {
                ie6: !! (a.browser.msie && parseInt(a.browser.version, 10) === 6),
                ie7: !! (a.browser.msie && parseInt(a.browser.version, 10) === 7 && !a.support.tbody && !a.support.style && !a.support.hrefNormalized),
                ie8: !! (a.browser.msie && ((parseInt(a.browser.version, 10) === 8) || (parseInt(a.browser.version, 10) === 7 && a.support.tbody && a.support.style && a.support.hrefNormalized)))
            });
            jQuery.extend(jQuery.easing, {
                easeOutCirc: function (f, g, e, j, h) {
                    return j * Math.sqrt(1 - (g = g / h - 1) * g) + e
                }
            });
            if ("replaceVars" in String.prototype) {
                try {
                    console.warn("Attempting to overwrite existing String function replaceVars!")
                } catch (c) {}
            }
            String.prototype.replaceVars = function (h, g, e) {
                var f = this,
                    j, d;
                d = function (k, l, m) {
                    return k.replace(new RegExp(l, "g"), m)
                };
                if (typeof h == "undefined") {
                    return this
                }
                g = (typeof (g) == "undefined") ? "{" : g;
                e = (typeof (e) == "undefined") ? "}" : e;
                for (j in h) {
                    f = d(f, g + j + e, h[j])
                }
                return f
            };
            if (!Array.prototype.indexOf) {
                Array.prototype.indexOf = function (e) {
                    var d, f;
                    d = this.length >>> 0;
                    f = Number(arguments[1]) || 0;
                    f = (f < 0) ? Math.ceil(f) : Math.floor(f);
                    if (f < 0) {
                        f += d
                    }
                    for (; f < d; f++) {
                        if (f in this && this[f] === e) {
                            return f
                        }
                    }
                    return -1
                }
            }
            if ("unique" in String.prototype) {
                try {
                    console.warn("Attempting to overwrite existing Array function unique!")
                } catch (c) {}
            }
            Array.prototype.unique = function (f) {
                f = f || true;
                var e = [],
                    d = this.length;
                for (var g = 0; g < d; g++) {
                    this[g] = (f) ? this[g].replace(/^\s+|\s+$/, "") : this[g];
                    if (e.indexOf(this[g], 0) < 0) {
                        e.push(this[g])
                    }
                }
                return e
            }
        }
    }
})(jQuery);
var tbwa = tbwa || undefined;
if (tbwa == undefined) {
    tbwa = new tbwaClass();
    tbwa.fn = function () {};
    tbwaClass = undefined;
    jQuery(function () {
        tbwa.core.init();
        tbwa.application.init()
    })
}
jQuery.noConflict();
