AUI.add("aui-dialog-iframe",function(c){var g=c.Lang,d=c.ClassNameManager.getClassName,f="iframe",i=d("dialog",f,"node"),e=[i],h="<div></div>",b='<iframe class="{cssClass}" frameborder="0" id="{id}" name="{id}" src="{uri}"></iframe>';var a=c.Component.create({ATTRS:{closeOnEscape:{value:true},iframeCssClass:{value:"",setter:"_setIframeCssClass"},iframeId:{valueFn:function(){return c.guid();}},uri:{}},EXTENDS:c.Plugin.Base,NAME:f,NS:f,prototype:{initializer:function(k){var j=this;j._host=j.get("host");j.publish("load",{defaultFn:j._defaultLoadIframeFn});j.afterHostMethod("renderUI",j.renderUI);j.afterHostMethod("bindUI",j.bindUI);j.afterHostMethod("render",j._afterRender);},renderUI:function(){var j=this;j._previousBodyContent=j._host.get("bodyContent");var m=c.Node.create(h);var k=g.sub(b,{cssClass:j.get("iframeCssClass"),id:j.get("iframeId"),uri:j.get("uri")});var l=c.Node.create(k);m.append(l);j._host.set("bodyContent",m);j._bodyNode=j._host.bodyNode;j.node=l;},bindUI:function(){var j=this;j.afterHostEvent("heightChange",j._updateIframeSize,j);j.afterHostEvent("widthChange",j._updateIframeSize,j);j.after("uriChange",j._afterUriChange);j.node.on("load",c.bind(j.fire,j,"load"));},destructor:function(){var j=this;j._host.set("bodyContent",j._previousBodyContent);j.node.remove(true);},_adjustSize:c.cached(function(j){return((parseInt(j,10)||0)-5);}),_afterRender:function(){var j=this;j._bodyNode.plug(c.LoadingMask).loadingmask.show();},_afterUriChange:function(k){var j=this;j._uiSetUri(k.newVal);},_defaultLoadIframeFn:function(m){var j=this;var l=j.node;try{var o=l.get("contentWindow.document");o.get("documentElement").setStyle("overflow","visible");var k=o.get("body");l.set("height",k.get("scrollHeight")+5);if(j.get("closeOnEscape")){c.on("key",function(p){j._host.close();},[o],"down:27");}}catch(n){}j._bodyNode.loadingmask.hide();},_setIframeCssClass:function(j){e[1]=j;return e.join(" ");},_uiSetUri:function(k){var j=this;if(j._bodyNode.loadingmask){j._bodyNode.loadingmask.show();}j.node.attr("src",k);},_updateIframeSize:function(n){var j=this;var l=j._adjustSize;var k=j._bodyNode;var m=j.node;var o=j._updateIframeSizeUI;if(!o){o=function(){var p=k.getStyle("height");m.setStyle("height",l(p));k.loadingmask.refreshMask();};j._updateIframeSizeUI=o;}setTimeout(o,50);}}});c.Plugin.DialogIframe=a;},"1.0.1",{requires:["aui-base","aui-loading-mask","plugin"],skinnable:true});