Index: bridge/lib/extras/style.js =================================================================== --- bridge/lib/extras/style.js (revision 91) +++ bridge/lib/extras/style.js (working copy) @@ -89,22 +89,25 @@ Ice.modal = Class.create(); Ice.modal = { - running:{}, isRunning:function(target) { - return (this.running[target]!= null); + for (m in this.running) { + if (m == target) + return true; + } + return false; }, //caller Ice.modal.start() setRunning:function(target) { //register modal popup - this.running[target] = target; + this.running.push(target); this.disableTabindex(target); }, //caller Ice.modal.stop() stopRunning:function(target) { //de-register modal popup - delete this.running[target]; + this.running.pop() //if there are more than one modal popups then this will enable the focus on //last opened modal popup and if there is no modal popup left then it will //enable the focus on the document. @@ -113,12 +116,14 @@ //returns last modal popup on the stack, null if there isn't any getRunning:function() { - var modal = null; - for (m in this.running) - modal = m; - return modal; + if (typeof(this.running)=="undefined") { + return null; + } else { + return this.running[this.running.length-1]; + } }, target:null, + running: new Array(), zIndexCount: 25000, start:function(target, iframeUrl,trigger, manualPosition) { var modal = document.getElementById(target);