Type.registerNamespace("dnn.controls"), dnn.controls.DNNToolBar = function (t, s) { this.ctr = document.createElement("div"), this.ctr.id = t + "_tb", dnn.controls.DNNToolBar.initializeBase(this, [this.ctr]), this.initialize(s), this.css = null, this.cssButton = null, this.cssButtonHover = null, this.moutDelay = null, this.buttons = [], this.relatedCtl = null, this.ctr.style.position = "relative", this.ctl = document.createElement("div"), this.ctr.appendChild(this.ctl), this.ctl.style.display = "none", this.moutDelay = 1e3, this._hideDelegate = dnn.createDelegate(this, this.hide), this.actionHandler = null }, dnn.controls.DNNToolBar.prototype = { loadDefinition: function (t, s, i, n, o, e) { var l = dnn.controls.toolbars[s + ":" + t]; if (null == l && (l = dnn.controls.toolbars[s + "$" + t]), null == l && (l = dnn.controls.toolbars[t]), l) { this.relatedCtl = i, this.css = l.css, this.cssButton = l.cssb, this.cssButtonHover = l.cssbh, this.actionHandler = e; for (var c = 0; c < l.btns.length; c++) { var h = l.btns[c]; this.addButton(h.key, h.ca, h.css, h.cssh, h.img, h.txt, h.alt, h.js, h.url, !0) } if (l.mod && (this.moutDelay = l.mod), o) { var r = dnn.dom.getSibling(o, -1); null != r && 3 == r.nodeType && (o = r), n.insertBefore(this.ctr, o) } else n.appendChild(this.ctr) } }, addButton: function (t, s, i, n, o, e, l, c, h, r) { null == t && (t = this.buttons.length), this.cssButton && (i = this.cssButton + " " + i), this.cssButtonHover && (n = this.cssButtonHover + " " + n), this.buttons[t] = new dnn.controls.DNNToolBarButton(t, s, i, n, o, e, l, c, h, r, this) }, refresh: function () { this.ctl.className = this.css; for (var t in this.buttons) { var s = this.buttons[t]; "function" != typeof s && (null == s.ctl && (s.render(), this.ctl.appendChild(s.ctl)), s.ctl.style.display = s.visible ? "" : "none") } }, show: function (t) { dnn.cancelDelay(this.ns + "mout"), "" != this.ctl.style.display && (this.refresh(), this.ctl.style.display = "", this.ctr.className = this.ctr.className + " visible"), t && this.beginHide() }, beginHide: function () { this.moutDelay > 0 && dnn.doDelay(this.ns + "mout", this.moutDelay, this._hideDelegate) }, hide: function () { this.ctl.style.display = "none", this.ctr.className = this.ctr.className.replace(" visible", "") }, buttonClick: function (t) { var s = this.tb, i = new dnn.controls.DNNToolBarEventArgs(this); return s.invoke_handler("click", i), i.get_cancel() ? void 0 : (this.click(), t && t.preventDefault ? (t.stopPropagation(), t.preventDefault()) : window.event.cancelBubble = !0, !1) }, buttonMouseOver: function (t) { this.tb.show(!1), this.hover() }, buttonMouseOut: function (t) { this.tb.beginHide(), this.unhover() }, dispose: function () { this._hideDelegate = null, this.actionHandler = null, dnn.controls.DNNToolBar.callBaseMethod(this, "dispose") } }, dnn.controls.DNNToolBar.registerClass("dnn.controls.DNNToolBar", dnn.controls.control), dnn.controls.DNNToolBarButton = function (t, s, i, n, o, e, l, c, h, r, a) { this.ctl = null, this.key = t, this.clickAction = s, this.tb = a, this.css = i, this.hoverCss = n, this.img = o, this.tooltip = l, this.txt = e, this.js = c, this.url = h, this.visible = r }, dnn.controls.DNNToolBarButton.prototype = { render: function () { if (!this.ctl) { var t = this.tb; if (this.ctl = t.createChildControl("div", this.key, ""), this.ctl.className = this.css, this.tooltip && (this.ctl.title = this.tooltip), this.img) { var s = document.createElement("img"); s.src = this.img, this.ctl.appendChild(s) } if (this.txt) { var i = document.createElement("span"); i.innerHTML = this.txt, this.ctl.appendChild(i) } var n = "mousedown"; t.addHandlers(this.ctl, t.getDynamicEventObject(n, t.buttonClick), this), t.addHandlers(this.ctl, { mouseover: t.buttonMouseOver, mouseout: t.buttonMouseOut }, this) } }, hover: function () { this.hoverCss && (this.ctl.className = this.css + " " + this.hoverCss) }, unhover: function () { this.hoverCss && (this.ctl.className = this.css) }, click: function () { "js" == this.clickAction ? eval(this.js) : "navigate" == this.clickAction ? dnn.dom.navigate(this.url) : null != this.tb.actionHandler && this.tb.actionHandler(this, this.tb.relatedCtl) }, getVal: function (t, s) { return t ? t : s } }, dnn.controls.DNNToolBarButton.registerClass("dnn.controls.DNNToolBarButton");