var D = YAHOO.util.Dom;
var E = YAHOO.util.Event;
Wizazzle = window.Wizazzle || {};
Wizazzle.Interaction = {};
Wizazzle.Constants = {
    POPUPS_DISABLED_MESSAGE: "It appears that you may have a popup blocker enabled that is preventing Wizazzle from opening a new window.  You should either disable your popup blocker, or explicitly allow this site to create popups.\n\nMore information on this problem is available in the Troubleshooting area of the FAQ from our front website.",
    UNSAVED_CHANGES_MESSAGE: "Are you sure you wish to navigate away from this page?\n\nYou have unsaved changes.  These changes will be lost if you leave this page\n\nPress OK to continue, or Cancel to stay on the current page.",
    NO_SAVE_WARNING: "Warning!  Some dynamic changes have not been saved, as your request has failed to reach the server.  You might want to check your connection to the internet before proceeding with more changes.",
    ASYNC_FAIL_WARNING: "Unable to complete connection.  Some data may not have been properly sent to the server.",
    BROWSER_UPGRADE: '<strong>Internet Explorer 6 is not supported.</strong><br/><br/>Wizazzle is an advanced web application that can not be deployed to web browsers that were released almost 7 years ago (IE6 was released in 2001).  While we do not support system logins from IE6, all Wizazzle accounts will be guaranteed to be readable from IE6 browsers for the foreseeable future.<br/><br/><strong>Please install any modern web browser.  This includes Internet Explorer 7+, Safari 3+, Firefox 2+ or Opera 9+ to log into Wizazzle.</strong><br/><br/><a href="http://www.firefox.com/">Click here to download Firefox (Free/Recommended) &raquo;</a><br/><a href="http://www.apple.com/safari/">Click here to download Safari (Free) &raquo;</a><br/><a href="http://www.microsoft.com/ie/">Click here to download IE7 (Free) &raquo;</a>',
    BROWSER_UPGRADE_WARN: '<strong>Internet Explorer 6 is not fully supported.</strong><br/><br/>While we do allow you to log in to this site using IE6, many editing functions will not work, and the site may appear slightly visually distorted.<br/><br/><strong>Please install any modern web browser.  This includes Internet Explorer 7+, Safari 3+, Firefox 2+ or Opera 9+ to log into Wizazzle.</strong><br/><br/><a href="http://www.firefox.com/">Click here to download Firefox (Free/Recommended) &raquo;</a><br/><a href="http://www.apple.com/safari/">Click here to download Safari (Free) &raquo;</a><br/><a href="http://www.microsoft.com/ie/">Click here to download IE7 (Free) &raquo;</a>',
    BROWSER_UPGRADE_ALERT: "Internet Explorer 6 is not supported.\n\nWizazzle is an advanced web application that can not be deployed to web browsers that were released almost 7 years ago (IE6 was released in 2001).\n\nPlease install any modern web browser in order to use our editor.  This includes Internet Explorer 7+, Safari 3+, Firefox 2+ or Opera 9+",
    DEGRADED_EXPERIENCE: (YAHOO.env.ua.ie > 0),
    MODERN_EXPERIENCE: (YAHOO.env.ua.webkit > 0),
    USE_GLOBAL_LIGHTBOX: false,
    SS_AUTHKEY: "X",
    VERSION_6_LAYOUT: false
};
var Class = {
    create: function (A) {
        var B;
        if (A.initialize) {
            B = function () {
                this.initialize.apply(this, arguments);
            };
        } else {
            B = function () {};
        }
        B.prototype = A;
        B.extend = function (C) {
            return Class.extend(this, C);
        };
        B.prototype.loadProperties = function (F, C) {
            this.properties = F;
            for (key in C) {
                this.properties[key] = C[key];
            }
        };
        return B;
    },
    extend: function (A, B) {
        var C = Class.create(B);
        for (property in A.prototype) {
            if (!C.prototype[property]) {
                C.prototype[property] = A.prototype[property];
            }
        }
        return C;
    }
};
Function.prototype.bind = function (I, N, M, L, J, H, G, F, C, B, A) {
    var K = this;
    return function () {
        K.apply(I, [N, M, L, J, H, G, F, C, B, A]);
    };
};
Function.prototype.bindEventListener = function (I, N, M, L, J, H, G, F, C, B, A) {
    var K = this;
    return function (O) {
        return K.call(I, O || window.event, N, M, L, J, H, G, F, C, B, A);
    };
};

function bind(I, O, N, M, L, J, H, G, F, C, B, A) {
    var K = O;
    return function () {
        K.apply(I, [N, M, L, J, H, G, F, C, B, A]);
    };
}
Wizazzle.URL = {
    reload: function (B, A) {
        if (!B) {
            B = window;
        }
        var C = Wizazzle.URL.cleanUrl(B.location.href);
        C = Wizazzle.URL.adjustQueryParameter(C, "SSScrollPosition", D.getDocumentScrollTop(B.document));
        C = Wizazzle.URL.adjustQueryParameter(C, "VK", parseInt(Math.random() * 99999999));
        if (A) {
            C = A(C);
        }
        B.location.href = C;
    },
    getServerName: function () {
        var A = document.location.href.indexOf("://");
        return (document.location.href.substring(0, document.location.href.indexOf("/", A + 3)));
    },
    removeDirectUrlPrefix: function (A) {
        var B = Wizazzle.URL.getServerName();
        if (A.startsWith(B)) {
            return (A.substring(B.length));
        } else {
            return (A);
        }
    },
    cleanUrl: function (A) {
        A = A.replace(new RegExp("(\\?|\\&)(firstLogin|SSLoginOk)=true", "g"), "");
        if (A.indexOf("?") == -1 && A.indexOf("&") != -1) {
            A = A.replace(/&/, "?");
        }
        var B = A.indexOf("#");
        return (B == -1 ? A : A.substring(0, B));
    },
    adjustQueryParameter: function (B, A, C) {
        if (B.match(new RegExp("(\\?|\\&)" + A + "=([^&]*)", "g"))) {
            B = B.replace(new RegExp("(\\?|\\&)" + A + "=([^&]*)", "g"), "$1" + A + "=" + C);
        } else {
            if (B.indexOf("?") == -1) {
                B = B + "?" + A + "=" + C;
            } else {
                B = B + "&" + A + "=" + C;
            }
        }
        return (B);
    },
    removeQueryParameter: function (B, A) {
        if (B.match(new RegExp("(\\?|\\&)" + A + "=([^&]*)", "g"))) {
            B = B.replace(new RegExp("(\\?|\\&)" + A + "=([^&]*)", "g"), "");
        }
        if (B.indexOf("?") == -1 && B.indexOf("&") != -1) {
            B = B.replace(/&/, "?");
        }
        return (B);
    },
    constructUrlParameters: function (B) {
        var A = "";
        for (i in B) {
            if (A.length > 0) {
                A += "&";
            }
            A += i;
            A += "=";
            A += encodeURIComponent(B[i]);
        }
        return (A);
    },
    fastCall: function (A, C, B) {
        YAHOO.util.Connect.asyncRequest("POST", A, {
            timeout: (B ? B : 10000),
            success: (C ? C : function (F) {}),
            failure: function (F) {
                alert(Wizazzle.NO_SAVE_WARNING);
            }
        });
    },
    _parseLevelToArray: function (A) {
        var B = [];
        var C = A.firstChild;
        while (C != null) {
            if (C.firstChild.childNodes.length > 0) {
                B.push(this._parseLevelToObject(C));
            } else {
                if (C.firstChild != null) {
                    B.push(C.firstChild.data);
                }
            }
            C = C.nextSibling;
        }
        return (B);
    },
    _parseLevelToObject: function (A) {
        var B = {};
        var C = A.firstChild;
        while (C != null) {
            if (C.firstChild == null) {
                B[C.tagName] = [];
            } else {
                if (C.firstChild.childNodes.length > 0) {
                    B[C.tagName] = this._parseLevelToArray(C);
                } else {
                    if (C.firstChild != null) {
                        B[C.tagName] = C.firstChild.data;
                    }
                }
            }
            C = C.nextSibling;
        }
        return (B);
    },
    getObjectFromXML: function (A) {
        return (this._parseLevelToObject(A.responseXML.documentElement));
    },
    loadContentBackground: function (A) {
        var B = document.createElement("iframe");
        D.setStyle(B, "visibility", "visible");
        D.setStyle(B, "height", "1px");
        D.setStyle(B, "width", "1px");
        D.setStyle(B, "opacity", "0");
        document.body.appendChild(B);
        B.src = A;
    },
    loadContent: function (targetElement, url, customTimeout) {
        YAHOO.util.Connect.asyncRequest("GET", url, {
            timeout: (customTimeout ? customTimeout : 20000),
            failure: function (o) {
                alert(Wizazzle.Constants.ASYNC_FAIL_WARNING);
            },
            success: function (o) {
                var textPortion = o.responseText;
                var scripts = [];
                while (true) {
                    var sidx = textPortion.indexOf("<script>");
                    if (sidx == -1) {
                        break;
                    }
                    var seidx = textPortion.indexOf("<\/script>");
                    if (seidx == -1) {
                        break;
                    }
                    var snippet = textPortion.substring(sidx + 8, seidx).trim();
                    textPortion = textPortion.substring(0, sidx) + textPortion.substring(seidx + 9);
                    if (snippet.length > 0) {
                        scripts.push(snippet);
                    }
                    textPortion = textPortion.trim();
                }
                if (textPortion.length > 0) {
                    D.get(targetElement).innerHTML = textPortion;
                }
                eval(scripts.join(";"));
            }
        });
    }
};
Wizazzle.Form = {
    manageFormEffects: function (C) {
        var G = "0123456789";
        var I = null;
        var H = document.forms[C != null ? C : "dataform"];
        var B = document.getElementById(C != null ? C : "dataform");
        if (H) {
            I = H.elements;
        } else {
            if (B) {
                I = B.getElementsByTagName("input");
            }
        }
        if (!I) {
            return;
        }
        var F = I.length;
        for (var A = 0; A < F; A++) {
            el = I[A];
            if (el.ssEnhanced) {
                continue;
            }
            el.ssEnhanced = true;
            if (el.type == "checkbox" || el.type == "radio") {
                E.addListener(el, "focus", function () {
                    var J = D.get(this.id + "_title");
                    if (J) {
                        D.addClass(J, "checkbox-title-selected");
                    }
                });
                E.addListener(el, "blur", function () {
                    var J = D.get(this.id + "_title");
                    if (J) {
                        D.removeClass(J, "checkbox-title-selected");
                    }
                });
                if (el.type == "radio") {
                    el.sschange = function (M, N) {
                        var L = Wizazzle.Form.getRadioValue("dataform", M);
                        if (L == N) {
                            return;
                        }
                        var J = D.get(M + "_" + L + "_title");
                        var K = D.get(M + "_" + N + "_title");
                        D.removeClass(J, "checkbox-option-active");
                        D.addClass(K, "checkbox-option-active");
                    };
                } else {
                    E.addListener(el, "change", function () {
                        var J = D.get(this.id + "_title");
                        if (J) {
                            if (this.checked) {
                                D.addClass(J, "checkbox-option-active");
                            } else {
                                D.removeClass(J, "checkbox-option-active");
                            }
                        }
                    });
                }
                if (el.checked) {
                    D.addClass(el.id + "_title", "checkbox-option-active");
                }
            } else {
                if (el.type == "text" || el.type == "edit" || el.type == "password" || el.type == "textarea" || el.type == "select-one" || el.type == "input") {
                    if (el.type != "textarea") {
                        if (D.hasClass(el, "custom-return-behavior")) {
                            E.addListener(el, "keydown", function (J) {
                                return Wizazzle.Form.remapEnter(J, function () {});
                            });
                        } else {
                            E.addListener(el, "keydown", function (J) {
                                return Wizazzle.Form.remapEnter(J);
                            });
                        }
                    }
                    E.addListener(el, "keydown", Wizazzle.Form._captureControlSHandler);
                    E.addListener(el, "focus", function () {
                        if (this.readOnly || this.disabled) {
                            return;
                        }
                        var J = D.get(this.name + "_title");
                        if (J) {
                            D.addClass(J, "input-title-selected");
                        }
                        if (!Wizazzle.Form.fieldHasError(this)) {
                            D.addClass(this, "input-selected");
                        }
                    });
                    E.addListener(el, "blur", function () {
                        if (this.readOnly || this.disabled) {
                            return;
                        }
                        var J = D.get(this.name + "_title");
                        if (J) {
                            D.removeClass(J, "input-title-selected");
                        }
                        D.removeClass(this, "input-selected");
                    });
                    if ((el.type == "textarea" || el.type == "text" || el.type == "password") && Wizazzle.Form.fieldHasError(el)) {
                        D.addClass(el, "input-with-error");
                    }
                } else {
                    if (el.type == "button" || el.type == "submit") {
                        E.addListener(el, "focus", function () {
                            D.addClass(this, "button-selected");
                        });
                        E.addListener(el, "blur", function () {
                            D.removeClass(this, "button-selected");
                        });
                    }
                }
            }
        }
        setTimeout(function () {
            var K = null;
            for (var J = 0; J < I.length; ++J) {
                var L = I[J];
                if ((L.type == "password" || L.type == "text" || L.type == "select-one" || L.type == "textarea") && !L.disabled && !L.readOnly) {
                    if (K == null && (D.getY(L) < (D.getViewportHeight() - 50))) {
                        K = L;
                    }
                    if (Wizazzle.Form.fieldHasError(L)) {
                        K = L;
                        break;
                    }
                }
            }
            if (K && D.getDocumentScrollTop() == 0) {
                try {
                    K.focus();
                } catch (M) {}
            }
        }, 5);
    },
    fieldHasError: function (B) {
        if (B.name) {
            var A = D.get(B.name + "_title");
            if (A && A.innerHTML.indexOf("errorText") != -1) {
                return (true);
            }
        }
        return (false);
    },
    smartSubmit: function (A) {
        if (!A) {
            A = "dataform";
        }
        confirmPageExit = false;
        Wizazzle.Form.disableButtons(A);
        document.forms[A].submit();
        return true;
    },
    smartLocation: function (B, A) {
        confirmPageExit = false;
        Wizazzle.Form.disableButtons(B);
        document.location = A;
        return true;
    },
    smartGoBack: function (A) {
        confirmPageExit = false;
        Wizazzle.Form.disableButtons(A);
        history.go(-1);
        return true;
    },
    smartCancel: function () {
        if (confirmPageExit && !confirm(Wizazzle.Constants.UNSAVED_CHANGES_MESSAGE)) {
            return;
        }
        confirmPageExit = false;
        if (window.parent.closeWindow) {
            window.parent.closeWindow();
        } else {
            window.close();
        }
    },
    disableButton: function (B, C) {
        var A = D.get(B);
        D.addClass(A, "button-disabled");
        D.removeClass(A, "button");
        if (C) {
            A.getElementsByTagName("span")[0].innerHTML = C;
        }
    },
    enableButton: function (B, C) {
        var A = D.get(B);
        D.addClass(A, "button");
        D.removeClass(A, "button-disabled");
        if (C) {
            A.getElementsByTagName("span")[0].innerHTML = C;
        }
    },
    disableButtons: function (C) {
        var A;
        if (!document.forms[C]) {
            return;
        }
        A = document.forms[C].getElementsByTagName("input");
        for (var B = 0; B < A.length; ++B) {
            if (A[B].type == "button" || A[B].type == "submit") {
                A[B].disabled = "true";
            }
        }
        A = document.getElementsByTagName("a");
        for (var B = 0; B < A.length; ++B) {
            if (D.hasClass(A[B], "button")) {
                D.addClass(A[B], "button-disabled");
                D.removeClass(A[B], "button");
            }
        }
    },
    setRadioValue: function (A, C, F) {
        var B = document.forms[A][C];
        for (i = 0; i < B.length; i++) {
            if (B[i].value == F) {
                B[i].checked = true;
            }
        }
    },
    setRadioHighlight: function (C, G, B, A) {
        var F = document.forms[C][G];
        for (i = 0; i < F.length; i++) {
            F[i].parentNode.parentNode.style.color = (F[i].checked ? B : A);
            F[i].parentNode.style.color = F[i].parentNode.parentNode.style.color;
        }
    },
    getRadioValue: function (A, C) {
        var B = document.forms[A][C];
        for (i = 0; i < B.length; i++) {
            if (B[i].checked) {
                return (B[i].value);
            }
        }
    },
    getRadio: function (A, C, F) {
        var B = document.forms[A][C];
        for (i = 0; i < B.length; i++) {
            if (B[i].value == F) {
                return (B[i]);
            }
        }
    },
    getSelectOptionTitleByValue: function (B, G, F) {
        var C = document.forms[B][G];
        for (var A = 0; A < C.length; ++A) {
            if (C[A].value == F) {
                return (C[A].text);
            }
        }
        return (null);
    },
    setFieldValue: function (B, F, C) {
        obj = document.forms[B][F];
        if (obj.tagName.toLowerCase() == "select") {
            for (var A = 0; A < obj.length; ++A) {
                if (obj[A].value == C) {
                    obj.selectedIndex = A;
                    break;
                }
            }
        } else {
            obj.value = C;
        }
    },
    setFieldDisabled: function (A, C) {
        var B = document.forms[A][C];
        B.style.color = "#727272 !important";
        B.style.backgroundColor = "#F9F9F9 !important";
        B.readOnly = 1;
        B.disabled = 1;
    },
    setFieldEnabled: function (A, C) {
        var B = document.forms[A][C];
        B.style.color = "#000000 !important";
        B.style.backgroundColor = "#FFFFFF !important";
        B.readOnly = 0;
        B.disabled = 0;
    },
    _returnException: false,
    remapEnter: function (C, F, B, A, G) {
        if (!C) {
            C = window.event;
        }
        if (C.keyCode == 13) {
            if (Wizazzle.Form._returnException) {
                Wizazzle.Form._returnException = false;
                return true;
            }
            E.stopEvent(C);
            if (F) {
                F(B, A, G);
            } else {
                Wizazzle.Form.onSave();
            }
            return false;
        }
        if (YAHOO.env.ua.gecko > 0) {
            if (C.keyCode == 40) {
                Wizazzle.Form._returnException = true;
            }
            if (C.keyCode == 39 || C.keyCode == 37) {
                Wizazzle.Form._returnException = false;
            }
        }
        return true;
    },
    reportFieldError: function (A) {
        Wizazzle.Dom.fastLoad(function () {
            D.addClass(A, "input-with-error");
            D.addClass(A + "_title", "errorText");
        });
    },
    captureControlS: function (A) {
        Wizazzle.Dom.fastLoad(function () {
            E.addListener(A, "keydown", Wizazzle.Form._captureControlSHandler);
        });
    },
    _captureControlSHandler: function (A) {
        if (A.ctrlKey && A.keyCode == 83) {
            Wizazzle.Form.onSave();
            E.stopEvent(A);
        }
    },
    onSave: function () {
        Wizazzle.Form.smartSubmit();
    }
};
Wizazzle.Cookie = {
    set: function (F, G, A, C, B) {
        document.cookie = F + "=" + escape(G) + "; expires=" + (A == null ? new Date("January 1, 2023").toGMTString() : A) + "; path=" + ((C == null) ? "/" : C) + ((B == null) ? "" : "; domain=" + B);
    },
    remove: function (C, B, A) {
        document.cookie = C + "=" + escape(Wizazzle.Cookie.get(C)) + ";expires=" + new Date("December 31, 1975").toGMTString() + "; path=" + ((B == null) ? "/" : B) + ((A == null) ? "" : "; domain=" + A);
    },
    get: function (F) {
        var B = document.cookie.split(";");
        for (var C = 0; C < B.length; C++) {
            var A = B[C].split("=");
            if (F == unescape(A[0]).trim()) {
                return (unescape(A[1]));
            }
        }
        return (null);
    }
};
Wizazzle.Degraded = {
    filterAnimation: function (A) {
        if (Wizazzle.Constants.DEGRADED_EXPERIENCE) {
            var B = A.getEl();
            if (A.attributes.top) {
                D.setStyle(B, "top", A.attributes.top.to + "px");
            }
            if (A.attributes.left) {
                D.setStyle(B, "left", A.attributes.left.to + "px");
            }
            if (A.attributes.height) {
                D.setStyle(B, "height", A.attributes.height.to + "px");
            }
            if (A.attributes.width) {
                D.setStyle(B, "width", A.attributes.width.to + "px");
            }
            if (A.attributes.marginLeft) {
                D.setStyle(B, "margin-left", A.attributes.marginLeft.to + "px");
            }
            if (A.attributes.opacity) {
                if (YAHOO.env.ua.ie > 0) {
                    B.style.filter = "";
                } else {
                    D.setStyle(B, "opacity", 1);
                }
            }
            if (A.attributes.scroll) {
                B.scrollLeft = A.attributes.scroll.to;
            }
            A.onComplete.fire();
        } else {
            A.animate();
        }
    },
    filterOpacity: function (A, B) {
        if (YAHOO.env.ua.ie == 0) {
            D.setStyle(A, "opacity", B);
        }
    }
};
Wizazzle.CSS = {
    appendCss: function (C, A, G) {
        if (!G) {
            G = document;
        }
        var B = G.getElementsByTagName("head")[0];
        if (A) {
            var F = G.getElementById(A);
            if (F) {
                B.removeChild(F);
            }
        }
        var H = G.createElement("style");
        H.setAttribute("type", "text/css");
        if (A) {
            H.setAttribute("id", A);
        }
        if (H.styleSheet) {
            H.styleSheet.cssText = C;
        } else {
            H.appendChild(G.createTextNode(C));
        }
        B.appendChild(H);
    },
    _onLoadStyle: function (B) {
        var A = B.win.D.get("primaryStylesheet");
        if (!A.disabled) {
            A.disabled = true;
        }
        if (B.win.temporaryCss) {
            B.win.temporaryCss.purge();
            B.win.YAHOO.util.Get.css("/universal/styles/neutral.css", {
                win: window.parent
            });
        }
        B.win.temporaryCss = B;
        if (Wizazzle.CSS._chained) {
            Wizazzle.CSS._chained();
        }
    },
    clearLoadedStyles: function (C) {
        var B = C.document.getElementsByTagName("link");
        for (var A = 0; A < B.length; ++A) {
            if (B[A].rel == "stylesheet" && B[A].id != "managerStylesheet") {
                B[A].disabled = (B[A].id == "primaryStylesheet" ? false : true);
            }
        }
    },
    cachedStyleLoad: function (A, C, B) {
        if (!C) {
            C = window;
        }
        Wizazzle.CSS._chained = B;
        YAHOO.util.Connect.asyncRequest("GET", A, {
            timeout: 10000,
            success: function (F) {
                C.YAHOO.util.Get.css(A, {
                    win: window.parent,
                    onSuccess: Wizazzle.CSS._onLoadStyle
                });
            }
        });
    },
    styleLoad: function (A, C, B) {
        if (!C) {
            C = window;
        }
        Wizazzle.CSS._chained = B;
        C.YAHOO.util.Get.css(A, {
            win: window.parent,
            onSuccess: (Wizazzle.CSS._chained ? Wizazzle.CSS._chained : null)
        });
    }
};
Wizazzle.Dom = {
    getHeight: function (B) {
        var A = B.offsetHeight;
        if (B.firstChild) {
            A += parseInt(D.getStyle(B.firstChild, "margin-bottom"));
        }
        return (A);
    },
    fastLoad: function (A) {
        if (YAHOO.env.ua.ie > 0) {
            E.addListener(window, "load", A);
        } else {
            E.onDOMReady(A);
        }
    }
};
Wizazzle.HTML = {
    createButton: function (H, F, A, B, C, G) {
        return ("<a " + (B ? 'id="' + B + '" ' : "") + ' class="button ' + (A ? "button-important" : "") + " " + (C ? "button-disabled" : "") + (G ? "button-focused" : "") + '" href="javascript:noop()" onmouseout="this.blur();" onclick="this.blur(); ' + F + '; return false;"><span>' + H + "</span></a>");
    }
};

function ql_nt(A) {
    n = new Array();
    qidx = A.indexOf("?");
    if (qidx == -1) {
        return (A);
    }
    p = A.substring(0, qidx);
    s = A.substring(qidx + 1).split("&");
    for (i = 0; i < s.length; ++i) {
        if (!(s[i].indexOf("returnUrl") == 0) && !(s[i].indexOf("SS_CSAT") == 0)) {
            n[n.length] = s[i];
        }
    }
    if (p.indexOf("/process/") != -1) {
        p = "/";
    }
    return (p + (n.length ? "?" : "") + n.join("&"));
}
function ql_csat() {
    var C = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
    var B = 30;
    var A = String();
    while (B-- > 0) {
        A += C.charAt(Math.round(Math.random() * 25));
    }
    return (A);
}
function ql_sifs() {
    return ("");
}
function ql_sfs() {
    return ("");
}
Date.prototype.getFullYear = function () {
    return ((YAHOO.env.ua.gecko > 0 || YAHOO.env.ua.webkit > 0) ? this.getYear() + 1900 : this.getYear());
};
String.prototype.trim = function () {
    return (YAHOO.lang.trim(this));
};
String.prototype.endsWith = function (A) {
    return (this.substr(this.length - A.length) == A);
};
String.prototype.startsWith = function (A) {
    return (this.substr(0, A.length) == A);
};
String.prototype.substitute = function (F) {
    var H = arguments.length;
    var G = "";
    var B = this.split("%S");
    for (var C = 0, A = B.length; C < A; C++) {
        G += B[C] + (((C < H) && (arguments[C] != undefined)) ? arguments[C] : "");
    }
    return G;
};
String.prototype.replaceIndex = function (B, F) {
    var A = new RegExp("#" + B);
    var C = this;
    C = C.replace(A, F);
    return C;
};
String.prototype.truncate = function (B, A) {
    B = B || 30;
    A = YAHOO.lang.isUndefined(A) ? "..." : A;
    return (this.length > B) ? this.slice(0, B - A.length) + A : new String(this);
};
Number.prototype.formatBytes = function (C, J) {
    var G = parseInt(this / 1024 + 0.5);
    var B = parseInt(G / 1024);
    var I = parseInt(G / 1024) > 0;
    var F = "";
    var H = (YAHOO.lang.isValue(J) && J == false) ? "%SM" : "%S M";
    var A = (YAHOO.lang.isValue(J) && J == false) ? "%SK" : "%S K";
    if (I) {
        C = (typeof(C) == "number" && isFinite(C)) ? C : 1;
        F = H.substitute((G / 1024).toFixed(C));
    } else {
        if (G == 0 && this > 0) {
            G = 1;
        }
        F = A.substitute((G));
    }
    return F;
};

function openWindow(F, G, A, C) {
    var B = window.open(F, "EditWindow" + Math.round(Math.random() * 100000), "width=" + G + ",height=" + A + ",scrollbars=no,resizable=yes,titlebar=yes,menubar=no,toolbar=no");
    if (!B) {
        alert(Wizazzle.Constants.POPUPS_DISABLED_MESSAGE);
    }
}
function getOpenerWindow() {
    return window.opener;
}
function closeWindow() {
    window.close();
}
function scrollToElement(A) {
    window.scrollTo(0, D.getY(A) - 70);
}
function isVisible(A) {
    return (A.style.display != "none");
}
function hideObject(A) {
    if (A) {
        A.style.display = "none";
    }
}
function showObject(A) {
    if (A) {
        A.style.display = "";
    }
}
function noop() {}
function smartSubmit(A, B) {
    return Wizazzle.Form.smartSubmit(B);
}
function smartLocation(B, A) {
    return Wizazzle.Form.smartLocation("dataform", A);
}
function setCookie(F, G, A, C, B) {
    return Wizazzle.Cookie.set(F, G, A, C, B);
}
function delCookie(C, B, A) {
    return Wizazzle.Cookie.remove(C, B, A);
}
function getCookie(A) {
    return Wizazzle.Cookie.get(A);
}
function addEvent(C, B, A) {
    E.addListener(C, B, A);
}
function getWindowScroll(A) {
    return D.getDocumentScrollTop(A ? A.document : null);
}
function toggleContentElement(F, C) {
    if (F.checked) {
        showObject(C);
    } else {
        hideObject(C);
    }
}
function isDefined(v) {
    return (eval("(typeof(" + v + ') != "undefined");'));
}
function isLetter(A) {
    return ("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".indexOf(A) != -1);
}
function isDigit(A) {
    return ("0123456789".indexOf(A) != -1);
}
if (isDefined("restoreFolderStates")) {
    Wizazzle.Dom.fastLoad(restoreFolderStates);
}
var StringTokenizer = Class.create({
    initialize: function (B, A) {
        this.exp = B;
        this.tokens = A;
        this.hasMore = true;
        this.idx = 0;
        this.nt = null;
    },
    hasMoreTokens: function () {
        return (this.hasMore);
    },
    nextToken: function () {
        if (this.nt) {
            var B = this.nt;
            this.nt = null;
            return (B);
        }
        for (var A = this.idx; A < this.exp.length; ++A) {
            if (this.tokens.indexOf(this.exp[A]) != -1) {
                if (A == (this.exp.length - 1)) {
                    this.hasMore = false;
                }
                var B = this.exp.substring(this.idx, A);
                this.idx = A + 1;
                if (B == "") {
                    return (this.exp[A]);
                } else {
                    this.nt = this.exp[A];
                    return (B);
                }
            }
        }
        this.hasMore = false;
        return (this.exp.substring(this.idx, this.exp.length));
    }
});
Wizazzle.FixedPositionTip = Class.create({
    initialize: function (C, B, A) {
        this.loadProperties({
            showDelay: 500,
            hideDelay: 30,
            yMargin: 0,
            xMargin: 0,
            orientation: "floating",
            className: "helptip-style-dialog",
            anchored: true,
            icon: null,
            autoHide: null,
            viewportConstrained: false,
            viewportFixed: false,
            viewportBuffer: 10
        }, A);
        this.title = C;
        this.text = B;
        this.activeAnimation = null;
        this.scheduleShow = false;
        this.tipVisible = false;
        this.init = false;
    },
    createControl: function () {
        if (!this.init) {
            this.init = true;
            this.container = document.createElement("div");
            D.addClass(this.container, this.properties.className);
            this.setHTML(this.title, this.text);
            document.body.appendChild(this.container);
            if (this.scheduleShow) {
                this.show();
            }
            if (this.properties.viewportFixed) {
                D.setStyle(this.container, "position", "fixed");
            } else {
                D.setStyle(this.container, "position", "absolute");
            }
        }
    },
    setHTML: function (B, A) {
        this.title = B;
        this.text = A;
        this.createControl();
        this.container.innerHTML = '<div class="helptip-title-wrapper"><div ' + (this.properties.icon ? 'style="background-image: url(' + this.properties.icon + ');"' : "") + ' class="helptip-title">' + this.title + '</div></div><div class="helptip-text">' + this.text + "</div>";
    },
    getInterfaceTopPadding: function () {
        var A = D.get("siteNoticeAreaWrapper");
        if (!A) {
            A = D.get("siteMemberNoticeAreaWrapper");
        }
        return ((A ? A.offsetHeight : 0));
    },
    getInterfaceBottomPadding: function () {
        return ((Wizazzle.EditingEnvironment.checkMode("style") ? Wizazzle.StyleEditor.height : 0));
    },
    position: function () {
        if (this.init) {
            this.calcXY();
            D.setStyle(this.container, "left", this.lastX + "px");
            D.setStyle(this.container, "top", this.lastY + "px");
        }
    },
    show: function (A, B) {
        this.createControl();
        this.args = A;
        if (this.clearTimers) {
            this.clearTimers();
        }
        if (this.properties.autoHide && this.hideTimeout) {
            clearTimeout(this.hideTimeout);
            this.hideTimeout = setTimeout(this.hide.bind(this), this.properties.autoHide);
        }
        if (this.tipVisible) {
            if (this.properties.orientation == "targeted") {
                this.setPosition(this.args.x, this.args.y);
            }
            return;
        }
        if (!this.container) {
            this.scheduleShow = true;
            return;
        }
        D.setStyle(this.container, "display", "block");
        D.setStyle(this.container, "z-index", "5000");
        Wizazzle.Degraded.filterOpacity(this.container, "0");
        this.position();
        if (this.enterDirection == "top") {
            this.activeAnimation = new YAHOO.util.Anim(this.container, {
                opacity: {
                    to: 1
                },
                top: {
                    from: this.lastY - 15,
                    to: this.lastY
                }
            }, 0.3, YAHOO.util.Easing.easeOutStrong);
        } else {
            this.activeAnimation = new YAHOO.util.Anim(this.container, {
                opacity: {
                    to: 1
                },
                left: {
                    from: this.lastX + (this.enterDirection == "left" ? -15 : 15),
                    to: this.lastX
                }
            }, 0.3, YAHOO.util.Easing.easeOutStrong);
        }
        this.activeAnimation.onComplete.subscribe(function (F, C, G) {
            G.activeAnimation = null;
        }, this);
        this.activeAnimation.animate();
        this.tipVisible = true;
        if (this.properties.autoHide) {
            this.hideTimeout = setTimeout(this.hide.bind(this), this.properties.autoHide);
        }
    },
    calcXY: function () {
        var A = 0;
        if (!this.properties.viewportFixed) {
            A = D.getDocumentScrollTop();
        }
        if (this.properties.orientation == "tracking") {
            this.lastX = Wizazzle.ConfirmationDialog.mouseX + this.properties.xMargin;
            this.lastY = Wizazzle.ConfirmationDialog.mouseY + this.properties.yMargin;
            this.enterDirection = "top";
        } else {
            if (this.properties.orientation == "mouse") {
                this.lastX = Wizazzle.ConfirmationDialog.mouseX + this.properties.xMargin - (this.container.offsetWidth / 2);
                this.lastY = Wizazzle.ConfirmationDialog.mouseY + this.properties.yMargin - (this.container.offsetHeight / 2);
                this.enterDirection = "left";
            } else {
                if (this.properties.orientation == "lower-right") {
                    this.lastX = D.getViewportWidth() - this.properties.xMargin - this.container.offsetWidth;
                    this.lastY = D.getViewportHeight() + A - this.properties.yMargin - this.getInterfaceBottomPadding() - this.container.offsetHeight;
                    this.enterDirection = "left";
                } else {
                    if (this.properties.orientation == "upper-right") {
                        this.lastX = D.getViewportWidth() - this.properties.xMargin - this.container.offsetWidth;
                        this.lastY = this.properties.yMargin + this.getInterfaceTopPadding() + A;
                        this.enterDirection = "left";
                    } else {
                        if (this.properties.orientation == "bottom-left") {
                            this.lastX = this.properties.xMargin;
                            this.lastY = D.getViewportHeight() - this.container.offsetHeight - this.properties.yMargin - this.getInterfaceBottomPadding() + A;
                            this.enterDirection = "left";
                        } else {
                            if (this.properties.orientation == "targeted") {
                                this.lastX = this.args.x;
                                this.lastY = this.args.y;
                                this.enterDirection = "left";
                            } else {
                                this.lastX = this.properties.xMargin;
                                this.lastY = this.properties.yMargin + this.getInterfaceTopPadding() + A;
                                this.enterDirection = "left";
                            }
                        }
                    }
                }
            }
        }
        if (this.properties.orientation == "tracking") {
            if ((this.lastX + this.container.offsetWidth + 30) > D.getViewportWidth()) {
                this.lastX -= this.container.offsetWidth + 15;
            } else {
                this.lastX += 15;
            }
            if ((this.lastY + this.container.offsetHeight + 30) > D.getViewportHeight()) {
                this.lastY -= this.container.offsetHeight + 15;
            } else {
                this.lastY += 15;
            }
        } else {
            if (this.properties.viewportConstrained) {
                if ((this.lastX + this.container.offsetWidth + this.properties.viewportBuffer) > (D.getViewportWidth() + D.getDocumentScrollLeft())) {
                    this.lastX = D.getViewportWidth() - this.container.offsetWidth - this.properties.viewportBuffer + D.getDocumentScrollLeft();
                }
                if ((this.lastX + this.properties.viewportBuffer) < 0) {
                    this.lastX = this.properties.viewportBuffer;
                }
                if ((this.lastY + this.container.offsetHeight + this.properties.viewportBuffer - A) > (D.getViewportHeight())) {
                    this.lastY = D.getViewportHeight() - this.container.offsetHeight - this.properties.viewportBuffer;
                }
                if ((this.lastY + this.properties.viewportBuffer - A) < 0) {
                    this.lastY = this.properties.viewportBuffer;
                }
            }
        }
    },
    setPosition: function (A, B) {
        this.lastX = A;
        new YAHOO.util.Anim(this.container, {
            left: {
                to: A
            },
            top: {
                to: B
            }
        }, 0.3, YAHOO.util.Easing.easeOutStrong).animate();
    },
    hide: function (A) {
        if (this.enterDirection == "top") {
            this.activeAnimation = new YAHOO.util.Anim(this.container, {
                opacity: {
                    to: 0
                },
                top: {
                    from: this.lastY,
                    to: this.lastY + 15
                }
            }, 0.3, YAHOO.util.Easing.easeOutStrong);
        } else {
            this.activeAnimation = new YAHOO.util.Anim(this.container, {
                opacity: {
                    to: 0
                },
                left: {
                    from: this.lastX,
                    to: this.lastX + (A == "left" ? -15 : 15)
                }
            }, 0.3, YAHOO.util.Easing.easeOutStrong);
        }
        this.activeAnimation.onComplete.subscribe(function (C, B, F) {
            D.setStyle(F.container, "display", "none");
            F.activeAnimation = null;
            F.tipVisible = false;
        }, this);
        this.activeAnimation.animate();
        this.hideTimeout = null;
    }
});
Wizazzle.HelpTip = Class.extend(Wizazzle.FixedPositionTip, {
    initialize: function (B, F, C, A) {
        this.loadProperties({
            showDelay: 500,
            hideDelay: 30,
            yMargin: 0,
            xMargin: 0,
            orientation: "tracking",
            className: "helptip-style-dialog",
            anchored: true,
            icon: "/universal/images/helptip-help.png",
            autoHide: null,
            viewportConstrained: false,
            viewportFixed: false,
            viewportBuffer: 10
        }, A);
        this.context = B;
        this.title = F;
        this.text = C;
        this.activeAnimation = null;
        this.scheduleShow = false;
        this.tipVisible = false;
        this.init = false;
        this.attached = false;
        Wizazzle.Dom.fastLoad(this.attachToContext.bind(this));
    },
    attachToContext: function () {
        this.createControl();
        this.setHTML(this.title, this.text);
        if (this.context && !this.attached) {
            var C = [];
            if (this.context.startsWith("class:")) {
                C = D.getElementsByClassName(this.context.substring(6));
            } else {
                if (this.context.indexOf("[") != -1) {
                    var G = this.context.indexOf("[");
                    var B = this.context.substring(0, G);
                    var A = this.context.substring(G + 1, this.context.indexOf("]")).split("|");
                    for (var F = 0; F < A.length; ++F) {
                        var H = D.get(B + A[F]);
                        if (H) {
                            C.push(H);
                        }
                    }
                } else {
                    var H = D.get(this.context);
                    if (H) {
                        C.push(H);
                    }
                }
            }
            D.setStyle(C, "cursor", "help");
            E.addListener(C, "mouseover", this.timedShow.bindEventListener(this));
            E.addListener(C, "mouseout", this.timedHide.bindEventListener(this));
            E.addListener(C, "mousemove", this.move.bindEventListener(this));
            if (this.properties.clickActivate) {
                E.addListener(C, "click", this.show.bind(this));
            }
            this.attached = true;
        }
    },
    move: function (A) {
        this.calcXY();
        if (this.tipVisible) {
            D.setXY(this.container, [this.lastX, this.lastY]);
        } else {
            D.setX(this.container, this.lastX);
        }
    },
    timedShow: function (A) {
        this.clearTimers();
        this.lagTimer = window.setTimeout(this.show.bind(this), this.properties.showDelay);
    },
    timedHide: function (A) {
        this.clearTimers();
        this.lagTimer = window.setTimeout(this.hide.bind(this), this.properties.hideDelay);
    },
    clearTimers: function () {
        if (this.lagTimer) {
            window.clearTimeout(this.lagTimer);
            this.lagTimer = null;
        }
    }
});
Wizazzle.ConfirmationDialog = {
    action: null,
    keyCheckInstalled: false,
    show: function (G, F, C, A) {
        this.cancel();
        var B = '<div style="height: 24px; padding-top: 15px;">' + Wizazzle.HTML.createButton("Cancel", "Wizazzle.ConfirmationDialog.cancel();") + '<div style="float: left; padding-left: 8px;">' + Wizazzle.HTML.createButton(A ? A : "Confirm &raquo;", "Wizazzle.ConfirmationDialog.proceed();", true, null, false, true) + "</div>" + "</div>";
        this.action = C;
        this.active = true;
        this.win = new Wizazzle.FixedPositionTip(G, F + B, {
            icon: "/universal/images/helptip-warning.png",
            orientation: "mouse",
            xMargin: -20,
            viewportConstrained: true,
            viewportBuffer: 15,
            anchored: false
        });
        this.win.show();
        if (!this.keyCheckInstalled) {
            E.addListener(window, "keydown", Wizazzle.ConfirmationDialog.keyCheck);
            this.keyCheckInstalled = false;
        }
    },
    keyCheck: function (A) {
        if (Wizazzle.ConfirmationDialog.active) {
            if (A.keyCode == 13) {
                Wizazzle.Interaction.__quickAction = null;
                Wizazzle.ConfirmationDialog.proceed();
                E.stopEvent(A);
                return false;
            }
            if (A.keyCode == 27) {
                Wizazzle.Interaction.__quickAction = null;
                Wizazzle.ConfirmationDialog.cancel();
                E.stopEvent(A);
                return false;
            }
        }
    },
    proceed: function () {
        if (this.win) {
            this.action();
            this.win.hide("right");
            this.active = false;
        }
    },
    cancel: function () {
        if (this.win) {
            this.win.hide("left");
            this.active = false;
        }
    }
};
YAHOO.util.Event.addListener(window, "load", function () {
    YAHOO.util.Event.addListener(document, "mousemove", function (A) {
        Wizazzle.ConfirmationDialog.mouseX = E.getPageX(A);
        Wizazzle.ConfirmationDialog.mouseY = E.getPageY(A);
    });
});
Wizazzle.Interaction.SOCIAL_SERVICES = [{
    name: "Digg",
    url: "http://digg.com/submit?phase=2&url=#URL#&title=#TITLE#"
}, {
    name: "Facebook",
    url: "http://www.facebook.com/share.php?u=#URL#"
}, {
    name: "Twitter",
    url: "http://twitter.com/home?status=#TITLE#+#URL#"
}, {
    name: "MySpace",
    url: "http://www.myspace.com/Modules/PostTo/Pages/?l=3&u=#URL#&t=#TITLE#"
}, {
    name: "Delicious",
    url: "http://del.icio.us/post?url=#URL#&title=#TITLE#"
}, {
    name: "StumbleUpon",
    url: "http://www.stumbleupon.com/submit?url=#URL#&title=#TITLE#"
}, {
    name: "Reddit",
    url: "http://reddit.com/login?dest=%2Fsubmit%3Furl%3D#URL#%26title%3D#TITLE#"
}, {
    name: "Technorati",
    url: "http://www.technorati.com/faves?add=#URL#"
}, {
    name: "Propeller",
    url: "http://www.propeller.com/submit/?U=#URL#&T=#TITLE#"
}, {
    name: "Mixx",
    url: "http://www.mixx.com/submit?page_url=#URL#"
}, {
    name: "Newsvine",
    url: "http://www.newsvine.com/_tools/seed&save?popoff=0&u=#URL#&h=#TITLE#"
}, {
    name: "Google Bookmarks",
    url: "http://www.google.com/bookmarks/mark?op=edit&bkmk=#URL#&title=#TITLE#"
}, {
    name: "Yahoo MyWeb",
    url: "http://myweb2.search.yahoo.com/myresults/bookmarklet?u=#URL#&t=#TITLE#"
}, {
    name: "Windows Live",
    url: "https://favorites.live.com/quickadd.aspx?marklet=1&mkt=en-us&url=#URL#&title=#TITLE#&top=1"
}, {
    name: "Kirtsy",
    url: "http://www.kirtsy.com/submit.php?url=#URL#"
}];
Wizazzle.Interaction.closeShareLink = function () {
    if (Wizazzle._currentShareLink) {
        var A = new YAHOO.util.Anim(Wizazzle._currentShareLink, {
            height: {
                to: 0
            }
        }, 0.3, YAHOO.util.Easing.easeOutStrong);
        A.onComplete.subscribe(function () {
            Wizazzle._currentShareLink.parentNode.removeChild(Wizazzle._currentShareLink);
            Wizazzle._currentShareLink = null;
        });
        A.animate();
    }
};
Wizazzle.Interaction.shareLink = function (K, B, J) {
    if (Wizazzle._currentShareLink) {
        var F = new YAHOO.util.Anim(Wizazzle._currentShareLink, {
            height: {
                to: 0
            }
        }, 0.3, YAHOO.util.Easing.easeOutStrong);
        F.onComplete.subscribe(function (O, N, M) {
            M.parentNode.removeChild(M);
        }, Wizazzle._currentShareLink);
        F.animate();
        if (Wizazzle._currentShareLink.sourceLink == K) {
            Wizazzle._currentShareLink = null;
            return;
        }
        Wizazzle._currentShareLink = null;
    }
    B = Wizazzle.URL.getServerName() + B;
    var H = '<div class="social-link-controls"><div class="social-block-title">Share this on ...</div>';
    for (var G = 0; G < Wizazzle.Interaction.SOCIAL_SERVICES.length; ++G) {
        var I = Wizazzle.Interaction.SOCIAL_SERVICES[G];
        var L = Wizazzle.Interaction.SOCIAL_SERVICES[G].name.replace(/ /g, "-").toLowerCase();
        H += '<div id="social-link-item-' + L + '" class="social-block"><a href="javascript:noop();" onclick="javascript:Wizazzle.Interaction.closeShareLink();window.open(\'' + I.url.replace(/#URL#/g, B).replace(/#TITLE#/g, J) + '\');"><img style="text-align: center;" alt="' + I.name + '" src="' + (I.icon ? I.icon : "/universal/images/social/" + L + ".png") + '" height="16" width="16" border="0"/> ' + I.name + "</a></div>";
    }
    H += '<div class="social-block"><a href="javascript:noop();" onclick="javascript:Wizazzle.Interaction.closeShareLink();"><img style="text-align: center;" src="/universal/images/transparent.png" height="16" width="16" border="0"/> Close</a></div>';
    H += "</div>";
    var C = document.createElement("div");
    D.addClass(C, "social-link-controls-wrapper");
    C.innerHTML = H;
    C.sourceLink = K;
    document.body.appendChild(C);
    var A = D.getXY(K);
    D.setXY(C, [A[0], A[1] + K.offsetHeight]);
    Wizazzle._currentShareLink = C;
    Wizazzle._currentShareLink.anim = new YAHOO.util.Anim(C, {
        opacity: {
            to: 1
        },
        height: {
            from: 0,
            to: C.offsetHeight
        }
    }, 0.4, YAHOO.util.Easing.easeOutStrong);
    Wizazzle._currentShareLink.anim.animate();
};
Wizazzle.FolderStates = [];
Wizazzle.Folders = {
    activeMenu: null,
    init: function () {
        var F = D.getElementsByClassName("folder-link", "a");
        for (var C = 0; C < F.length; ++C) {
            var G = F[C];
            if (G.href.startsWith("javascript:")) {
                G.href = "javascript:noop();";
                G.saveable = true;
                E.addListener(G, "click", Wizazzle.Folders.toggleLink, G);
            }
            var B = G.parentNode.getElementsByTagName("a");
            for (var A = 0; A < B.length; ++A) {
                if (!D.hasClass(B[A])) {
                    E.addListener(B[A], "mouseover", Wizazzle.Folders.mouseover, G);
                    E.addListener(B[A], "mouseout", Wizazzle.Folders.mouseout, G);
                }
            }
        }
    },
    extractModuleIdFromLink: function (A) {
        return (A.id.substring(10));
    },
    toggleLink: function (F, C, B) {
        if (!C) {
            return;
        }
        var A = C.parentNode.parentNode;
        if (D.hasClass(A, "folder-open") && !B) {
            D.addClass(A, "folder-closed");
            D.removeClass(A, "folder-open");
            if (C.saveable) {
                Wizazzle.FolderStates[Wizazzle.Folders.extractModuleIdFromLink(C)] = false;
            }
        } else {
            if (D.hasClass(A, "folder-closed")) {
                D.addClass(A, "folder-open");
                D.removeClass(A, "folder-closed");
                if (C.saveable) {
                    Wizazzle.FolderStates[Wizazzle.Folders.extractModuleIdFromLink(C)] = true;
                }
            }
        }
        if (!B) {
            Wizazzle.Folders.saveStates();
        }
    },
    mouseover: function (H, G) {
        if (!G) {
            return;
        }
        var B = G.parentNode.parentNode;
        var A = G.parentNode.parentNode.parentNode.parentNode;
        if (D.hasClass(A, "horizontalNavigationBar")) {
            if (!D.hasClass(B, "folder-open")) {
                var C = D.getElementsByClassName("folder-wrapper", "div", B)[0];
                D.setStyle(C, "position", "absolute");
                D.setStyle(C, "display", "block");
                D.setStyle(C, "width", "300px");
                D.setStyle(C, "height", "300px");
                D.setStyle(C, "top", "50px");
                D.setStyle(C, "left", "50px");
                D.removeClass(B, "folder-closed");
                D.addClass(B, "folder-open");
                if (!C.realHeight) {
                    var I = B.getElementsByTagName("UL")[0];
                    C.realHeight = I.offsetHeight;
                    C.realWidth = I.offsetWidth;
                }
                var F = D.getXY(B);
                D.setXY(C, [parseInt(F[0]), parseInt(F[1]) + B.offsetHeight]);
                D.setStyle(C, "overflow", "hidden");
                D.setStyle(C, "height", "0px");
                D.setStyle(C, "width", (C.realWidth + 50) + "px");
                new YAHOO.util.Anim(C, {
                    height: {
                        to: (C.realHeight + 50)
                    }
                }, 0.3, YAHOO.util.Easing.easeOutStrong).animate();
            }
        }
        if (Wizazzle.Folders.activeMenu && Wizazzle.Folders.activeMenu != G) {
            Wizazzle.Folders.hideMenu(Wizazzle.Folders.activeMenu);
        }
        Wizazzle.Folders.activeMenu = G;
        Wizazzle.Folders._timedHide(G, true);
    },
    mouseout: function (B, A) {
        Wizazzle.Folders._timedHide(A, false);
    },
    hideMenu: function (G) {
        if (Wizazzle.Orderable && Wizazzle.Orderable.__isDragging) {
            G.autoHideTimer = window.setTimeout(function () {
                Wizazzle.Folders.hideMenu(G);
            }, 1000);
            return;
        }
        var C = G.parentNode.parentNode;
        var B = G.parentNode.parentNode.parentNode.parentNode;
        if (D.hasClass(B, "horizontalNavigationBar")) {
            var F = D.getElementsByClassName("folder-wrapper", "div", C)[0];
            F.realHeight = null;
            var A = new YAHOO.util.Anim(F, {
                height: {
                    to: 0
                }
            }, 0.3, YAHOO.util.Easing.easeOutStrong);
            A.onComplete.subscribe(function (J, I, H) {
                D.removeClass(H, "folder-open");
                D.addClass(H, "folder-closed");
            }, C);
            A.animate();
        }
        Wizazzle.Folders._timedHide(G, true);
        Wizazzle.Folders.activeMenu = null;
    },
    _timedHide: function (B, A) {
        if (A) {
            if (B.autoHideTimer) {
                window.clearTimeout(B.autoHideTimer);
                B.autoHideTimer = null;
            }
        } else {
            if (!B.autoHideTimer) {
                B.autoHideTimer = window.setTimeout(function () {
                    Wizazzle.Folders.hideMenu(B);
                }, 1000);
            }
        }
    },
    saveStates: function () {
        var A = "";
        for (s in Wizazzle.FolderStates) {
            if (Wizazzle.FolderStates[s] == true) {
                A += ",";
                A += s;
            }
        }
        var B = A.substr(1).trim();
        if (B.length > 0) {
            Wizazzle.Cookie.set("SS_FOLDERSTATE", B, null, "/");
        } else {
            Wizazzle.Cookie.remove("SS_FOLDERSTATE");
        }
    }
};
Wizazzle.Dom.fastLoad(function () {
    Wizazzle.Folders.init();
    var B = null;
    if (typeof(Wizazzle.Constants.CURRENT_MODULE_ID) != "undefined") {
        B = Wizazzle.Constants.CURRENT_MODULE_ID;
    }
    if (B) {
        var F = D.get("folderContent" + B);
        if (F != null) {
            Wizazzle.Folders.toggleLink(null, D.get("moduleLink" + B), true);
        }
        var F = D.get("moduleContent" + B);
        while (F != null) {
            if (F.id != null && F.id.indexOf("folderContent") == 0) {
                var A = F.id.substring(13);
                Wizazzle.Folders.toggleLink(null, D.get("moduleLink" + A), true);
            }
            F = F.parentNode;
        }
    }
    var C = Wizazzle.Cookie.get("SS_FOLDERSTATE");
    if (C) {
        C = C.split(",");
        for (moduleId in C) {
            Wizazzle.Folders.toggleLink(null, D.get("moduleLink" + C[moduleId]), true);
        }
    }
    Wizazzle.Folders.saveStates();
});

function showFullImage(H, B, G) {
    if (Wizazzle.Constants.USE_GLOBAL_LIGHTBOX) {
        var A = H.indexOf("imageUrl=");
        if (A != -1 && showImage) {
            showImage(H.substring(A + 9));
            return;
        }
    }
    var F = H.replace(new RegExp("[^a-zA-Z0-9]", "g"), "") + "ssimg";
    if (F.length > 20) {
        F = F.substring(20);
    }
    if (B) {
        var C = window.open(H, F, "height=" + B + ",width=" + G);
    } else {
        var C = window.open(H, F);
    }
}
function showPackedPosts(B) {
    var A = D.get("packedPostsExpandLink" + B);
    if (A.innerHTML == "Hide") {
        D.setStyle(D.getElementsByClassName("packed-post-date", "div", "item" + B), "display", "none");
        D.setStyle(D.get("packedPosts" + B), "display", "none");
        A.innerHTML = A.originalHTML;
    } else {
        D.setStyle(D.getElementsByClassName("packed-post-date", "div", "item" + B), "display", "block");
        D.setStyle(D.get("packedPosts" + B), "display", "block");
        A.originalHTML = A.innerHTML;
        A.innerHTML = "Hide";
    }
}
if (!isDefined("console")) {
    console = {
        log: function () {},
        dir: function () {}
    };
}
if (navigator.userAgent.indexOf("OS X") != -1) {
    Wizazzle.CSS.appendCss("#configuration-container-title-text, #pageHeaderTitle, #manager-top-bar-wrapper, #manager-top-bar .main-site-title { font-family: 'HelveticaNeue-Light', 'Helvetica Neue Light', 'Helvetica Neue', sans-serif; font-weight: 300; letter-spacing: 0.4px; }");
}
Wizazzle.Formatting = {
    humanizeDate: function (H) {
        var K = parseInt(new Date().getTime() - parseInt(H)) + (new Date().getTimezoneOffset() * 60),
            F;
        var G = Math.floor(K / (1000 * 60 * 60 * 24 * 365));
        var B = Math.floor(K / (1000 * 60 * 60 * 24 * 30));
        var A = Math.floor(K / (1000 * 60 * 60 * 24 * 7));
        var J = Math.floor(K / (1000 * 60 * 60 * 24));
        var I = Math.floor(K / (1000 * 60 * 60));
        var C = Math.floor(K / (1000 * 60));
        if (G > 0) {
            F = Wizazzle.Formatting.plur(G, "year");
        } else {
            if (B > 0) {
                F = Wizazzle.Formatting.plur(B, "month");
            } else {
                if (A > 0) {
                    F = Wizazzle.Formatting.plur(A, "week");
                } else {
                    if (J > 0) {
                        F = Wizazzle.Formatting.plur(J, "day");
                    } else {
                        if (I > 0) {
                            F = Wizazzle.Formatting.plur(I, "hour");
                        } else {
                            if (C > 0) {
                                F = Wizazzle.Formatting.plur(C, "minute");
                            } else {
                                F = "less than a minute ago";
                            }
                        }
                    }
                }
            }
        }
        return F;
    },
    plur: function (B, A) {
        return "about " + (B == 1 ? ((A === "hour" ? "an " : "a ") + A) : (B + " " + A + "s")) + " ago";
    }
};
Wizazzle.Session = {
    isLoggedIn: function () {
        return (Wizazzle.Constants.AUTHENTICATED_USER_LOGIN);
    }
};
