Appcelerator.Module.Modaldialog={getName:function(){return"appcelerator modaldialog"},getDescription:function(){return"modaldialog widget"},getVersion:function(){return 1},getSpecVersion:function(){return 1},getAuthor:function(){return"Jeff Haynie"},getModuleURL:function(){return"http://www.appcelerator.org"},isWidget:function(){return true},getWidgetName:function(){return"app:modaldialog"},execute:function(id,parameterMap,data,scope){var compiled=parameterMap["compiled"];var propertyName=parameterMap["property"];var array=null;if(!compiled){compiled=eval(parameterMap["template"]+"; init_"+id);parameterMap["compiled"]=compiled}if(propertyName){array=Object.getNestedProperty(data,propertyName)||[]}var html="";if(!array||array.length==0){html=compiled(data)}else{html=compiled(array[0])}html='
'+html+"
";var overlay=$("overlay");var overlaydata=$("overlay_data");overlaydata.innerHTML=html;Appcelerator.Compiler.dynamicCompile(overlaydata);var arrayPageSize=Element.getDocumentSize();overlay.style.height=arrayPageSize[3]+250+"px";Element.show(overlay);var dataTop=0;if(!parameterMap["top"]){var arrayPageScroll=Element.getPageScroll();var dataTop=Math.min(80,arrayPageScroll+(arrayPageSize[3]/5));$D("modaldialog: dataTop="+dataTop+",arrayPageScroll="+arrayPageScroll+",arrayPageSize[3]="+arrayPageSize[3])}else{dataTop=parseInt(parameterMap["top"])}overlaydata.style.top=dataTop+"px";Element.show(overlaydata)},getAttributes:function(){return[{name:"on",optional:false,description:"Used to show the modal dialog"},{name:"property",optional:true},{name:"top",optional:true}]},buildWidget:function(D,E,G){var A="l:appcelerator.modaldialog.hide";var C=$("overlay");if(!C){var B='';new Insertion.Bottom(document.body,B);C=$("overlay");C.modaldialog_compiled=1;Appcelerator.Compiler.compileElement(C,G)}else{if(!C.modaldialog_compiled){C.setAttribute("scope","*");C.setAttribute("on",A+" then hide");Appcelerator.Compiler.compileElement(C,G);C.modaldialog_compiled=1}}var H=$("overlay_data");if(!H){var F='';new Insertion.Bottom(document.body,F);H=$("overlay_data");Appcelerator.Compiler.compileElement(H,G)}E["template"]=Appcelerator.Compiler.compileTemplate(Appcelerator.Compiler.getWidgetHTML(D),true,"init_"+D.id);return{"position":Appcelerator.Compiler.POSITION_REMOVE,"functions":["execute"],"parameters":E,"wire":true}}};Appcelerator.Core.registerModule("app:modaldialog",Appcelerator.Module.Modaldialog);Appcelerator.Core.loadModuleCSS("app:modaldialog","modaldialog.css")