/*--------------------------------------------------
MODAL
Version:   0.0.2
Generated: 22/3/2010
--------------------------------------------------*/
UKISA.namespace("UKISA.widget.Modal");UKISA.widget.Container=null;UKISA.widget.Modal=function(c,h,k){var a,e,g,d,b,j,f,i,b;a=document.getElementById(c);b=UKISA.widget.Container;j=function(){var l=document.createElement("p");l.id=c+"-loading";l.className="loading";l.innerHTML="Please wait...";return l};f=h||j();if(a&&b&&(c===b.id)){b.setBody(f);return b}else{if(b&&c!==b.id){b.hide();b.destroy()}a=document.createElement("div");e=a.cloneNode(false);g=a.cloneNode(false);d=a.cloneNode(false);a.id=c;a.className="yui-panel-container yui-dialog shadow";e.className="hd";g.className="bd";d.className="ft";a.appendChild(e);a.appendChild(g);a.appendChild(d);document.body.appendChild(a);UKISA.widget.Container=new YAHOO.widget.Panel(c,{fixedcenter:true,modal:true,visible:false,close:true,underlay:"shadow",constraintoviewport:true,zIndex:500,autofillheight:"body"});b=UKISA.widget.Container;b.setBody(f);b.render(document.body);b.hideAndDestroy=function(){b.hide();YAHOO.lang.later(100,b,function(){this.destroy()},null,false)};b.load=function(n,m,o,l){o=o||{success:function(p){b.setBody(p.responseText)},failure:function(p){b.setBody(['<p class="error">',"Sorry, there was a problem when trying to fetch something. Please close this down and try again.","</p>"].join(""))},timeout:5000};this.ajax=YAHOO.util.Connect.asyncRequest(n,m,o,l)};return b}};
