var dialogcounter=0;function arkiaDialog(a){this.config=a;var f=this.config.title;if(f==undefined){f=""}var c=this.config.resizable;if(c==undefined){c=false}dlgwidth=600;dlgheight=400;if(this.config.height!=undefined){dlgheight=this.config.height}if(this.config.width!=undefined){dlgwidth=this.config.width}this.dialogShownCallback=null;this.dialogClosingCallback=null;if(this.config.showCallback!=undefined){this.dialogShownCallback=this.config.showCallback}if(this.config.closeCallback!=undefined){this.dialogClosingCallback=this.config.closeCallback}maxW=YAHOO.util.Dom.getViewportWidth(),maxH=YAHOO.util.Dom.getViewportHeight();var k=35;dialogBodyWidth="";dialogBodyHeight="";if(maxW<650-k){dlgwidth=maxW+"px";dialogBodyWidth="width:"+(maxW-k-15)+"px"}else{dlgwidth=dlgwidth+"px"}if(maxH<390-k){dlgheight=maxH+"px";dialogBodyHeight="height:"+(maxH-k-90)+"px"}else{dlgheight=dlgheight+"px"}var d=this;buttonsarray=[{text:"Sluiten",handler:function(){try{console.log(this);this.cancel()}catch(l){alert(l)}$(d.dialogBodyDiv).innerHTML=""},isDefault:false}];if(this.config.buttons!=undefined){buttonsarray=this.config.buttons.concat(buttonsarray)}var j="Dialog"+dialogcounter++;if(a.id!=undefined){j=a.id}this.dialog=new YAHOO.widget.Dialog(j,{width:dlgwidth,height:dlgheight,effect:{effect:YAHOO.widget.ContainerEffect.FADE,duration:0.25},fixedcenter:true,modal:true,draggable:true,constraintoviewport:true,buttons:buttonsarray});this.dialogBodyDiv="dialog"+dialogcounter;this.dialog.setHeader(f);h=this.dialog.cfg.getProperty("height");t=(h-50-100)/2;if(t<0){t=0}this.dialog.setBody('<div class="dialogbody" id="'+this.dialogBodyDiv+'" style="text-align:left;'+dialogBodyHeight+";"+dialogBodyWidth+'"><div style=text-align:center;padding-top:'+t+'px;><img src="/icons/loading/loading7.gif"/></div></div>');this.dialog.render(document.body);if(c){try{var b=new YAHOO.util.Resize(this.dialog.id,{handles:["br"],autoRatio:false,minWidth:dlgheight,minHeight:dlgwidth,status:false})}catch(g){alert(this.dialog.id);alert(g)}try{if(b){b.on("startResize",function(e){if(this.cfg.getProperty("constraintoviewport")){var l=YAHOO.util.Dom;var n=l.getClientRegion();var m=l.getRegion(this.element);b.set("maxWidth",n.right-m.left-YAHOO.widget.Overlay.VIEWPORT_OFFSET);b.set("maxHeight",n.bottom-m.top-YAHOO.widget.Overlay.VIEWPORT_OFFSET)}else{b.set("maxWidth",null);b.set("maxHeight",null)}},this.dialog,true)}}catch(g){alert(g)}if(b){b.on("resize",function(e){var l=e.height;this.cfg.setProperty("height",l+"px")},this.dialog,true)}}dialogref=this;this.showEvent=function(){try{if(dialogref.config.src!=undefined){dialogref.load(dialogref.config.src)}}catch(l){alert(l)}};this.closeEvent=function(e){if(dialogref.dialogClosingCallback!=null){return dialogref.dialogClosingCallback.call()}return true};this.dialog.showEvent.subscribe(this.showEvent);this.dialog.beforeHideEvent.subscribe(this.closeEvent);this.dialog.show()}arkiaDialog.prototype.setShowCallback=function(a){this.dialogShownCallback=a};arkiaDialog.prototype.refresh=function(){this.load(this.config.src)};arkiaDialog.prototype.load=function(b){try{dialogref=this;YAHOO.util.Connect.asyncRequest("GET",b,{success:function(c){if(c.responseText!==undefined){$(dialogref.dialogBodyDiv).innerHTML=c.responseText;event.onContentReady(dialogref.dialogBodyDiv,function(){if(typeof initCalenders=="function"){initCalenders(dialogref.dialog.element.style.zIndex)}if(typeof setSelectors=="function"){setSelectors()}if(!(dialogref.dialogShownCallback==undefined)){if(typeof dialogref.dialogShownCallback=="function"){dialogref.dialogShownCallback.call(dialogref)}}checkboxes=dom.getElementsByClassName("required",null,dialogref.dialogBodyDiv);for(i=0;i<checkboxes.length;i++){var e=true;var d=checkboxes[i];sibling=d.nextSibling;if(sibling){if(sibling.className&&sibling.className.indexOf("verplicht")!=-1){e=false}}if(e){var f=document.createElement("span");f.innerHTML="*";f.title="Dit veld is verplicht";f.className="verplicht";if(sibling){d.parentNode.insertBefore(f,sibling)}else{d.parentNode.appendChild(f)}}}})}}})}catch(a){alert(a)}};arkiaDialog.prototype.show=function(a){visible=this.dialog.cfg.getProperty("visible");dialogref=this;h=this.dialog.cfg.getProperty("height");t=(h-50-100)/2;if(t<0){t=0}$(this.dialogBodyDiv).innerHTML="<div style=text-align:center;padding-top:"+t+'px;><img src="/icons/loading/loading7.gif"/></div>';this.config.src=a;this.dialog.show();if(visible){this.showEvent.call()}};arkiaDialog.prototype.hide=function(){this.dialog.hide()};arkiaDialog.prototype.setSize=function(b,a){this.dialog.cfg.setProperty("height",a+"px");this.dialog.cfg.setProperty("width",b+"px")};function checkForYuiMask(){};
