window.addEvent("domready",function(){var b=[];$each(Igloo.asset_delayLoadWidget,function(a,e){var f=$(e);if(!f.dataobj||$type(f.dataobj)!="hash"){f.dataobj=new Hash(f.dataobj||a)}f.dataobj.combine(a);b.push(f)});b.each(function(m){var k=m.get("registryid");var l=m.get("treeitemid");var a=m.get("objectid");var n={};var j="widgets/instances/"+l+"/render";m.widgetcontainer=new Element("div",{}).inject(m,"after");var i=new ApiClient({method:"get",apimethod:j,queryparams:{objectId:a},postdata:n,onRequest:function(c){m.widgetcontainer.set("html",'<div style="padding:30px;text-align:center;"><span class="busy show"><embed height="16" width="16" scale="noscale" wmode="transparent" movie="/cmedia/swf/loader.swf" quality="high" name="movie" id="movie" src="/cmedia/swf/loader.swf" type="application/x-shockwave-flash" webdeveloper-inline-style=""/></span> '+window.translations["media-js-loading_ellp"]+"</div>")},onFailure:function(c){m.widgetcontainer.set("html",window.translations["media-js-Error_loading_content"])},onSuccess:function(c,g){var e=JSON.decode(c,true);if(e==null){alert("No JSON was returned.\r\n  Got: "+c);return}var f=e.response.items[0].value;f.stripScripts(true);m.widgetcontainer.set("html",f);var d={};d=m.widgetcontainer.getChildren();d.each(function(h,p){h.inject(m,"after")});m.widgetcontainer.dispose()}})})});
