if(typeof KAJONA=="undefined"){alert("load kajona.js before!")}KAJONA.admin.ModalDialog=function(c,d,a,b){this.dialog;this.containerId=c;this.iframeId;this.iframeURL;this.setTitle=function(e){if(e==""){e="&nbsp;"}$("#"+this.containerId+"_title").html(e)};this.setContent=function(g,h,e){if(d==1){$("#"+this.containerId+"_content").html(g);var f=$("#"+this.containerId+"_confirmButton");f.html(h);f.click(function(){window.location=e;return false})}};this.setContentRaw=function(e){$("#"+this.containerId+"_content").html(e)};this.setContentIFrame=function(e){this.iframeId=this.containerId+"_iframe";this.iframeURL=e};this.init=function(g,f){var e=$("#"+this.containerId).modal({backdrop:true,keyboard:false,show:false});if(!f){if($("#"+this.containerId).hasClass("fullsize")){f=$(window).height()*0.6}else{f=""}}var h=!!(window.frameElement&&window.frameElement.nodeName&&window.frameElement.nodeName.toLowerCase()=="iframe");if(!h){if(!g){if($("#"+this.containerId).hasClass("fullsize")){g=$(window).width()*0.6}else{g=400}}e.css({width:g,"margin-left":function(){return -($(this).width()/2)}})}else{if(this.iframeURL!=null){window.open(this.iframeURL,$("#"+this.containerId+"_title").text(),"scrollbars=yes,resizable=yes,width=500,height=500");return}e.css({width:"97%","margin-left":0,"padding-top":5,left:10});f=$(window).height()}if(this.iframeURL!=null){$("#"+this.containerId+"_content").html('<iframe src="'+this.iframeURL+'" width="100%" height="'+(f)+'" name="'+this.iframeId+'" id="'+this.iframeId+'" class="seamless" seamless></iframe>');this.iframeURL=null}$("#"+this.containerId).modal("show");if(a){this.enableDragging()}if(b){this.enableResizing()}};this.hide=function(){$("#"+this.containerId).modal("hide")};this.enableDragging=function(){};this.enableResizing=function(){$("#"+this.containerId).resizable().on("resize",function(e,f){f.element.css("margin-left",-f.size.width/2);f.element.css("margin-top",-f.size.height/2);f.element.css("top","50%");f.element.css("left","50%");f.element.css("height",f.size.height+$(".modal-footer").outerHeight());$(f.element).find(".modal-body").each(function(){$(this).css("max-height",f.size.height-$(".modal-header").outerHeight()-$(".modal-footer").outerHeight());$(f.element).find("iframe.seamless").each(function(){$(this).css("height",f.size.height-$(".modal-header").outerHeight()-$(".modal-footer").outerHeight()-12-15)})})})}};