if (typeof Popup === 'undefined') {
var Popup = function(_options, e) {
if (!(this instanceof Popup)) {
return new Popup(_options, e); }
var ev; if (typeof e !== 'undefined') {
ev = new eventObject(e); }
if (typeof _options === 'undefined') {
_options = {}; }
var SELF = this; var id = "Popup_" + (Math.random() * (new Date().getTime())).toString().replace(/\./,""); Popup.Count++; Popup.Items[id] = this; var options = new PopupOptions({ "Animation": true, "place":			document.body, "zIndex":			Popup.Count - 1, "width":			10, "height":			10, "title":			"", "content":			"", "type":				Popup.Simple, "shadowOffset":		5, "className":		"", "moveable":			true, "hideContent":		false, "disabledESCkey":	false, "buttons":			[ {
"type" : Popup.Buttons.Close
}
] }); if (!ev) {
options.top = 10; options.left = 10; }
var i; for(i in _options) {
options[i] = _options[i]; }
delete i; this.OnClose = function() {}; this.OnRender = function() {}; this.OnMove = function() {}; this.OnDragEnd = function() {}; var place; var cont = Element.Create('div'); cont.id = id; cont.setAttribute('popup',1); cont.GetObject = function() {
return SELF; }; cont.className = 'popup ' + options.className; cont.style.position = "absolute"; var clickEvent = eventObject(cont).addEvent("click", function(e) {
Popup.BringTop(id); }); var contextMenuEvent = eventObject(cont).addEvent("contextmenu", function(e) {
var ev = new eventObject(e); ev.cancelBubble(); ev.preventDefault(); }); if (options.hideContent) {
var hider = Element.Create('div'); hider.className = 'popupHider ' + options.className; hider.style.position = "absolute"; hider.style.width = '100%'; hider.style.height = '100%'; hider.style.top = '0px'; hider.style.left = '0px'; }
var isRendered = false; function CalculateMousePositions() {
options.top = ev.mouseY; options.left = ev.mouseX; var tmp = options.place; while(tmp) {
options.top -= tmp.offsetTop; options.left -= tmp.offsetLeft; tmp = tmp.offsetParent; }}
function CreateButtons() {
var tmpIMG, tmpSPAN; var buttons = Element.Create('div'); buttons.className = "popupButtonsCont"; if (options.buttons.length > 0) {
var i, button, tmp, name; for(i = 0; i < options.buttons.length; i++) {
button = options.buttons[i]; switch(button.type) {
case Popup.Buttons.Close: tmpIMG = Element.Create('img'); tmpIMG.align = "absmiddle"; tmpIMG.src = "images/transparent.gif"; tmpSPAN = Element.Create('span'); tmpSPAN.className = "popupButtonWithoutText close"; tmpSPAN.onclick = function() {
SELF.Close(); }; tmpSPAN.appendChild(tmpIMG); buttons.appendChild(tmpSPAN); break; case Popup.Buttons.Custom: tmpIMG = Element.Create('img'); tmpIMG.align = "absmiddle"; tmpIMG.src = "images/transparent.gif"; tmpSPAN = Element.Create('span'); tmpSPAN.className = "popupButtonWithoutText"; for(name in button) {
switch(name) {
case "type": break; case "className": tmpSPAN.className += button[name]; break; case 'onclick': case 'ondblclick': case 'onmouseover': case 'onmouseout': case 'onmousedown': case 'onmouseup': if (typeof button[name] !== 'function') {
eval("tmpSPAN[name] = function(e) { " + button[name] + " };"); } else {
tmpSPAN[name] = button[name]; }
break; default: tmpSPAN[name] = button[name]; break; }}
tmpSPAN.appendChild(tmpIMG); buttons.appendChild(tmpSPAN); break; case Popup.Buttons.CustomWithText: tmpSPAN = Element.Create('span'); for(name in button) {
switch(name) {
case "text": case "type": break; case "className": tmpSPAN.className = "popupButtonWithText " + button[name]; break; case 'onclick': case 'ondblclick': case 'onmouseover': case 'onmouseout': case 'onmousedown': case 'onmouseup': if (typeof button[name] !== 'function') {
eval("tmpSPAN[name] = function(e) { " + button[name] + " };"); } else {
tmpSPAN[name] = button[name]; }
break; default: tmpSPAN[name] = button[name]; break; }}
if (typeof button.className === 'undefined') {
tmpSPAN.className = "popupButtonWithText"
}
tmpSPAN.innerHTML = "<img align=\"absmiddle\" src=\"images/transparent.gif\">" + (typeof button.text !== 'undefined' ? button.text : ""); buttons.appendChild(tmpSPAN); break; }}
}
return buttons; }
function SetMoveParams(obj) {
eventObject(obj).addEvent("mouseover",function(e) {
var ev = new eventObject(e); ev.cancelBubble(); ev.preventDefault(); if (options.moveable) {
obj.style.cursor = "move"; }}); eventObject(obj).addEvent("mouseout",function(e) {
var ev = new eventObject(e); ev.cancelBubble(); ev.preventDefault(); obj.style.cursor = "default"; }); eventObject(obj).addEvent("mousedown",function(e) {
var ev = new eventObject(e); ev.cancelBubble(); ev.preventDefault(); if (options.moveable) {
Popup.StartDrag(SELF, e); }}); }
this.GetID = function() {
return id; }; this.Get = function(name) {
switch(name) {
case 'offsetParent': return cont.offsetParent; break; case "ContentScrollHeight": if (isRendered) {
switch(options.type) {
case Popup.Simple: return cont.childNodes[1].scrollHeight; break; case Popup.SimpleWithShadow: return cont.firstChild.childNodes[1].scrollHeight; break; case Popup.Designed: return cont.popupCenter.scrollHeight; break; }} else {
return 0; }
break; case "ContentScrollWidth": if (isRendered) {
switch(options.type) {
case Popup.Simple: return cont.childNodes[1].scrollWidth; break; case Popup.SimpleWithShadow: return cont.firstChild.childNodes[1].scrollWidth; break; case Popup.Designed: return cont.popupCenter.scrollWidth; break; }} else {
return 0; }
break; case "ContentOffsetHeight": if (isRendered) {
switch(options.type) {
case Popup.Simple: return cont.childNodes[1].offsetHeight; break; case Popup.SimpleWithShadow: return cont.firstChild.childNodes[1].offsetHeight; break; case Popup.Designed: return cont.popupCenter.offsetHeight; break; }} else {
return 0; }
break; case "ContentOffsetWidth": if (isRendered) {
switch(options.type) {
case Popup.Simple: return cont.childNodes[1].offsetWidth; break; case Popup.SimpleWithShadow: return cont.firstChild.childNodes[1].offsetWidth; break; case Popup.Designed: return cont.popupCenter.offsetWidth; break; }} else {
return 0; }
break; default: if (typeof options[name] !== 'undefined') {
return options[name]; } else {
return cont[name]; }
break; }}; this.Set = function(name, value) {
switch(name) {
case 'zIndex': case 'top': case 'left': case 'width': case 'height': options[name] = value; if (isRendered) {
this.Render(); }
break; case 'title': options[name] = value; this.SetTitle(value); break; case 'content': options[name] = value; this.SetContent(value); break; case 'type': if (options.type !== value) {
switch(value) {
case Popup.Simple: case Popup.SimpleWithShadow: case Popup.Designed: options[name] = value; if (isRendered) {
isRendered = false; cont.innerHTML = ""; cont.parentNode.removeChild(cont); this.Render(); }
break; }; }
break; case 'buttons': options[name] = value; if (isRendered) {
switch(options.type) {
case Popup.Simple: cont.firstChild.innerHTML = options.title; cont.firstChild.appendChild(CreateButtons()); break; case Popup.SimpleWithShadow: cont.firstChild.firstChild.innerHTML = options.title; cont.firstChild.firstChild.appendChild(CreateButtons()); break; case Popup.Designed: cont.popupTop.innerHTML = options.title; cont.popupTop.appendChild(CreateButtons()); break; }}
break; default: options[name] = value; break; }}; this.GetTitle = function() {
return options.title; }; this.SetTitle = function(_title) {
options.title = _title; if (isRendered) {
switch(options.type) {
case Popup.Simple: cont.firstChild.innerHTML = _title; cont.firstChild.appendChild(CreateButtons()); break; case Popup.SimpleWithShadow: cont.firstChild.firstChild.innerHTML = _title; cont.firstChild.firstChild.appendChild(CreateButtons()); break; case Popup.Designed: cont.popupTop.innerHTML = _title; cont.popupTop.appendChild(CreateButtons()); break; }}
}; this.AddEvent = function(event, func) {
return eventObject(cont).addEvent(event, func); }; this.RemoveEvent = function(event, func) {
eventObject(cont).removeEvent(event, func); }; this.AppendToContent = function(child) {
if (isRendered) {
switch(options.type) {
case Popup.Simple: cont.childNodes[1].appendChild(child); break; case Popup.SimpleWithShadow: cont.firstChild.childNodes[1].appendChild(child); break; case Popup.Designed: cont.popupCenter.appendChild(child); break; }}
}; this.InsertBeforeToContent = function(child, child2) {
if (isRendered) {
switch(options.type) {
case Popup.Simple: cont.childNodes[1].insertBefore(child, child2); break; case Popup.SimpleWithShadow: cont.firstChild.childNodes[1].insertBefore(child, child2); break; case Popup.Designed: cont.popupCenter.insertBefore(child, child2); break; }}
}; this.RemoveFromContent = function(child) {
if (isRendered) {
switch(options.type) {
case Popup.Simple: cont.childNodes[1].removeChild(child); break; case Popup.SimpleWithShadow: cont.firstChild.childNodes[1].removeChild(child); break; case Popup.Designed: cont.popupCenter.removeChild(child); break; }}
}; this.GetNodeContentToSave = function(type, deletePrefix) {
if (isRendered) {
switch(options.type) {
case Popup.Simple: return GetNodeContentToSave(cont.childNodes[1], type, deletePrefix); break; case Popup.SimpleWithShadow: return GetNodeContentToSave(cont.firstChild.childNodes[1], type, deletePrefix); break; case Popup.Designed: return GetNodeContentToSave(cont.popupCenter, type, deletePrefix); break; }}
return null; }; this.getElementsByTagName = function(_name) {
if (isRendered) {
switch(options.type) {
case Popup.Simple: return cont.childNodes[1].getElementsByTagName(_name); break; case Popup.SimpleWithShadow: return cont.firstChild.childNodes[1].getElementsByTagName(_name); break; case Popup.Designed: return cont.popupCenter.getElementsByTagName(_name); break; }} else {
return null; }}; this.GetChildNodes = function() {
if (isRendered) {
switch(options.type) {
case Popup.Simple: return cont.childNodes[1].childNodes; break; case Popup.SimpleWithShadow: return cont.firstChild.childNodes[1].childNodes; break; case Popup.Designed: return cont.popupCenter.childNodes; break; }} else {
return null; }}; this.GetFirstChild = function() {
if (isRendered) {
switch(options.type) {
case Popup.Simple: return cont.childNodes[1].firstChild; break; case Popup.SimpleWithShadow: return cont.firstChild.childNodes[1].firstChild; break; case Popup.Designed: return cont.popupCenter.firstChild; break; }} else {
return null; }}; this.GetLastChild = function() {
if (isRendered) {
switch(options.type) {
case Popup.Simple: return cont.childNodes[1].lastChild; break; case Popup.SimpleWithShadow: return cont.firstChild.childNodes[1].lastChild; break; case Popup.Designed: return cont.popupCenter.lastChild; break; }} else {
return null; }}; this.GetContent = function() {
return options.content; }; this.SetContent = function(_content) {
options.content = _content; if (isRendered) {
switch(options.type) {
case Popup.Simple: cont.childNodes[1].innerHTML = _content; break; case Popup.SimpleWithShadow: cont.firstChild.childNodes[1].innerHTML = _content; break; case Popup.Designed: cont.popupCenter.innerHTML = options.content; break; }}
}; this.Render = function() {
if (typeof options.place !== 'undefined') {
var firstRender = false; if (!isRendered) {
firstRender = true; place = Element(options.place); if (options.hideContent) {
place.appendChild(hider); eventObject(place == document.body ? window : place).addEvent(EventTypes.Scroll, function(e) {
var tmp; if (UA.isChrome() || UA.isSafari()) {
tmp = (place == document.body ? document.body : place); } else {
tmp = (place == document.body ? document.body.parentNode : place); }
hider.style.top = tmp.scrollTop + 'px'; hider.style.left = tmp.scrollLeft + 'px'; }); var tmp; if (UA.isChrome() || UA.isSafari()) {
tmp = (place == document.body ? document.body : place); } else {
tmp = (place == document.body ? document.body.parentNode : place); }
hider.style.top = tmp.scrollTop + 'px'; hider.style.left = tmp.scrollLeft + 'px'; }
place.appendChild(cont); if (options.Animation) {
if (UA.isChrome() || UA.isSafari()) {
cont.style.visibility = "hidden"; }}
switch(options.type) {
case Popup.Simple: cont.innerHTML = "<div class=\"popupTitle\"></div><div class=\"popupCont\"></div>"; cont.firstChild.style.position = "relative"; cont.firstChild.style.zIndex = 2; cont.firstChild.style.overflow = 'auto'; cont.childNodes[1].style.position = "relative"; cont.childNodes[1].style.zIndex = 3; cont.childNodes[1].style.overflow = 'auto'; SetMoveParams(cont.firstChild); break; case Popup.SimpleWithShadow: var HTMLCont = "<div class=\"popupContWithShadow\">"; HTMLCont += "<div class=\"popupTitle\"></div><div class=\"popupCont\"></div>"; HTMLCont += "</div>"; HTMLCont += "<div class=\"popupShadow\"></div>"; cont.innerHTML = HTMLCont; cont.firstChild.firstChild.style.position = "relative"; cont.firstChild.firstChild.style.zIndex = 2; cont.firstChild.firstChild.style.overflow = 'auto'; cont.firstChild.childNodes[1].style.position = "relative"; cont.firstChild.childNodes[1].style.zIndex = 3; cont.firstChild.childNodes[1].style.overflow = 'auto'; cont.childNodes[1].style.position = "absolute"; cont.childNodes[1].style.width = '100%'; cont.childNodes[1].style.height = '100%'; cont.childNodes[1].style.zIndex = 1; SetMoveParams(cont.firstChild.firstChild); break; case Popup.Designed: var HTMLCont = "<div class=\"popupTopLeft\"></div><div class=\"popupTop\"></div><div class=\"popupTopRight\"></div>"; HTMLCont += "<div class=\"popupLeft\"></div><div class=\"popupCenter\"></div><div class=\"popupRight\"></div>"; HTMLCont += "<div class=\"popupBottomLeft\"></div><div class=\"popupBottom\"></div><div class=\"popupBottomRight\"></div>"; cont.innerHTML = HTMLCont; var i; for(i = 0; i < cont.childNodes.length; i++) {
if (cont.childNodes[i].nodeName.toUpperCase() === 'DIV') {
cont[cont.childNodes[i].className] = cont.childNodes[i]; }}
SetMoveParams(cont.popupTop); break; }}
if (typeof options.top === 'undefined' && typeof options.left === 'undefined' && ev) {
CalculateMousePositions(); }
cont.style.zIndex = options.zIndex + 10000; if (hider) hider.style.zIndex = options.zIndex + 9999; if (cont.offsetWidth > 0) {
cont.style.width = options.width + 'px'; cont.style.height = options.height + 'px'; cont.style.top = options.top + 'px'; cont.style.left = options.left + 'px'; switch(options.type) {
case Popup.Simple: cont.childNodes[1].style.height = (cont.offsetHeight - Element(cont.firstChild).offsetHeight - Element(cont.firstChild).GetStyle('border-top-width', 'int') - Element(cont.firstChild).GetStyle('border-bottom-width', 'int')) + 'px'; break; case Popup.SimpleWithShadow: cont.firstChild.style.height = cont.offsetHeight + 'px'; cont.firstChild.childNodes[1].style.height = (cont.firstChild.offsetHeight - Element(cont.firstChild.firstChild).offsetHeight - Element(cont.firstChild.firstChild).GetStyle('border-top-width', 'int') - Element(cont.firstChild.firstChild).GetStyle('border-bottom-width', 'int')) + 'px'; cont.childNodes[1].style.top = options.shadowOffset + 'px'; cont.childNodes[1].style.left = options.shadowOffset + 'px'; break; case Popup.Designed: cont.popupTopLeft.style.position = 'absolute'; cont.popupTopLeft.style.top = '0px'; cont.popupTopLeft.style.left = '0px'; cont.popupTopRight.style.position = 'absolute'; cont.popupTopRight.style.top = '0px'; cont.popupTopRight.style.right = '0px'; cont.popupBottomLeft.style.position = 'absolute'; cont.popupBottomLeft.style.bottom = '0px'; cont.popupBottomLeft.style.left = '0px'; cont.popupBottomRight.style.position = 'absolute'; cont.popupBottomRight.style.bottom = '0px'; cont.popupBottomRight.style.right = '0px'; cont.popupTop.style.position = 'absolute'; cont.popupTop.style.overflow = 'hidden'; cont.popupTop.style.top = '0px'; cont.popupTop.style.left = cont.popupTopLeft.offsetWidth + 'px'; cont.popupTop.style.width = (cont.offsetWidth - cont.popupTopLeft.offsetWidth - cont.popupTopRight.offsetWidth) + 'px'; cont.popupBottom.style.position = 'absolute'; cont.popupBottom.style.bottom = '0px'; cont.popupBottom.style.left = cont.popupTopLeft.offsetWidth + 'px'; cont.popupBottom.style.width = (cont.offsetWidth - cont.popupBottomLeft.offsetWidth - cont.popupBottomRight.offsetWidth) + 'px'; cont.popupLeft.style.position = 'absolute'; cont.popupLeft.style.left = '0px'; cont.popupLeft.style.top = cont.popupTopLeft.offsetHeight + 'px'; cont.popupLeft.style.height = (cont.offsetHeight - cont.popupTopLeft.offsetHeight - cont.popupBottomLeft.offsetHeight) + 'px'; cont.popupRight.style.position = 'absolute'; cont.popupRight.style.right = '0px'; cont.popupRight.style.top = cont.popupTopRight.offsetHeight + 'px'; cont.popupRight.style.height = (cont.offsetHeight - cont.popupTopRight.offsetHeight - cont.popupBottomRight.offsetHeight) + 'px'; cont.popupCenter.style.position = "absolute"; cont.popupCenter.style.overflow = "auto"; cont.popupCenter.style.left = cont.popupLeft.offsetWidth + 'px'; cont.popupCenter.style.width = (cont.offsetWidth - cont.popupLeft.offsetWidth - cont.popupRight.offsetWidth) + 'px'; cont.popupCenter.style.top = cont.popupTop.offsetHeight + 'px'; cont.popupCenter.style.height = (cont.offsetHeight - cont.popupTop.offsetHeight - cont.popupBottom.offsetHeight) + 'px'; break; }}
if (!isRendered) {
isRendered = true; switch(options.type) {
case Popup.Simple: cont.firstChild.innerHTML = options.title; cont.firstChild.appendChild(CreateButtons()); cont.childNodes[1].innerHTML = options.content; break; case Popup.SimpleWithShadow: cont.firstChild.firstChild.innerHTML = options.title; cont.firstChild.firstChild.appendChild(CreateButtons()); cont.firstChild.childNodes[1].innerHTML = options.content; break; case Popup.Designed: cont.popupTop.innerHTML = options.title; cont.popupTop.appendChild(CreateButtons()); cont.popupCenter.innerHTML = options.content; break; }}
if (options.Animation && firstRender) {
if (UA.isChrome() || UA.isSafari()) {
cont.className += " onAnimeStart"; cont.style.visibility = "visible"; window.setTimeout("Element('" + id + "').className = Element('" + id + "').className.replace(' onAnimeStart','');",1); }}
if (typeof this.OnRender === 'function') {
try {
this.OnRender(); } catch(e) {
if (typeof console !== 'undefined' && typeof console.log !== 'undefined') {
console.log(e.message); }}
}}
}; this.Close = function() {
if (typeof Popup.Items[id] !== 'undefined') {
var Animate = false; if (options.Animation) {
if ( (UA.isChrome() || UA.isSafari()) && cont.GetStyle("-webkit-transition-duration", "float") > 0 ) {
cont.className += " onAnimeClose"; Animate = true; }}
if (Animate) {
eventObject(cont).addEvent("webkitTransitionEnd", function() {
if (isRendered) {
cont.parentNode.removeChild(cont); }
Popup.Count--; delete Popup.Items[id]; if (options.hideContent) {
hider.parentNode.removeChild(hider); }
Popup.FixZIndexes(); SELF.OnClose(); }); } else {
if (isRendered) {
cont.parentNode.removeChild(cont); }
Popup.Count--; delete Popup.Items[id]; if (options.hideContent) {
hider.parentNode.removeChild(hider); }
Popup.FixZIndexes(); this.OnClose(); }}
}}
Popup.Simple = 1; Popup.SimpleWithShadow = 2; Popup.Designed = 3; Popup.Buttons = {}; Popup.Buttons.Close = 1; Popup.Buttons.Custom = 2; Popup.Buttons.CustomWithText = 3; Popup.Count = 0; Popup.Items = {}; Popup.Close = function(_id) {
if (typeof this.Items[_id] !== 'undefined') {
this.Items[_id].Close(); }}; Popup.Get = function(_id) {
if (typeof this.Items[_id] !== 'undefined') {
return this.Items[_id]; }
return; }; Popup.FixZIndexes = function() {
var i; var popups = []; for(i in this.Items) {
popups[this.Items[i].Get('zIndex')] = i; }
var j = 0; for(i = 0; i < popups.length; i++) {
if (typeof popups[i] !== 'undefined') {
this.Items[popups[i]].Set('zIndex',j); j++; }}
}; Popup.BringTop = function(_id) {
var i; var popups = []; Popup.FixZIndexes(); if (typeof this.Items[_id] !== 'undefined') {
for(i in this.Items) {
if (i !== _id) {
if (this.Items[i].Get('zIndex') > this.Items[_id].Get('zIndex')) {
popups[this.Items[i].Get('zIndex') - 1] = i; } else {
popups[this.Items[i].Get('zIndex')] = i; }}
}
popups[this.Count - 1] = _id; for(i = 0; i < popups.length; i++) {
if (typeof popups[i] !== 'undefined') {
this.Items[popups[i]].Set('zIndex',i); }}
}}; Popup.StartDrag = function(_popup, e) {
var place = Element(_popup.Get('place')); var ev = new eventObject(e); if (place && typeof this.movePanel === 'undefined') {
this.BringTop(_popup.GetID()); this.movePanel = Element.Create('div'); this.movePanel.style.position = "absolute"; this.movePanel.style.top = '0px'; this.movePanel.style.left = '0px'; this.movePanel.style.width = '100%'; this.movePanel.style.height = '100%'; this.movePanel.style.zIndex = 9000; this.movePanel.style.backgroundColor = "silver"; this.movePanel.style.filter = "alpha(opacity=0)"; this.movePanel.style.mozOpacity = 0; this.movePanel.style.opacity = 0; this.movePanel.style.oOpacity = 0; place.appendChild(this.movePanel); var diffLeft = ev.mouseX - _popup.Get('left'); var diffTop = ev.mouseY - _popup.Get('top'); var tmp = _popup.Get('parentNode'); while(tmp) {
diffLeft -= tmp.offsetLeft; diffTop -= tmp.offsetTop; tmp = tmp.offsetParent; }
var FMoveIndex = eventObject(UA.isIE() ? document.body : window).addEvent('mousemove', function(e) {
var ev = new eventObject(e); ev.cancelBubble(); ev.preventDefault(); var top = ev.mouseY; var left = ev.mouseX; var tmp = _popup.Get('place'); while(tmp) {
top -= tmp.offsetTop; left -= tmp.offsetLeft; tmp = tmp.offsetParent; }
_popup.Set('top',top - diffTop); _popup.Set('left',left - diffLeft); if (typeof _popup.OnMove === 'function') {
_popup.OnMove(_popup); }}); var FUpIndex = eventObject(UA.isIE() ? document.body : window).addEvent('mouseup', function(e) {
var ev = new eventObject(e); ev.cancelBubble(); ev.preventDefault(); eventObject(UA.isIE() ? document.body : window).removeEvent('mousemove',FMoveIndex); eventObject(UA.isIE() ? document.body : window).removeEvent('mouseup',FUpIndex); Popup.movePanel.parentNode.removeChild(Popup.movePanel); delete Popup.movePanel; if (typeof _popup.OnDragEnd === 'function') {
_popup.OnDragEnd(_popup); }}); }}
Popup.CloseTopItem = function() {
}; function PopupOptions(_data) {
if (this instanceof PopupOptions) {
this.place; this.zIndex; this.width; this.height; this.title; this.content; this.type; this.shadowOffset; this.className; this.moveable; this.hideContent; this.disabledESCkey; this.buttons; if (typeof _data !== 'undefined') {
var i; for(i in _data) {
this[i] = _data[i]; }}
} else {
throw new Error("This is not an function!"); }}
eventObject(window).addEvent('load',function(){
eventObject(UA.isIE() ? document.body : window).addEvent('keydown', function(e) {
var ev = new eventObject(e); switch(ev.keyCode) {
case 27: var nodeName = ev.getTargetObject().nodeName.toUpperCase(); if (nodeName != "SELECT" && nodeName != "INPUT" && nodeName != "TEXTAREA") {
var i, item = null, tmpItem; for(i in Popup.Items) {
tmpItem = Popup.Items[i]; if (tmpItem.Get('offsetWidth') > 0) {
if (!tmpItem.Get('disabledESCkey')) {
if (!item) {
item = tmpItem; } else {
if (tmpItem.Get("zIndex") > item.Get("zIndex")) {
item = tmpItem; }}
}}
}
if (item) {
item.Close(); }}
break; }}); }); }