text: (function(){var e=tinymce.DOM,t=tinymce.dom.Element,i=tinymce.dom.Event,n=tinymce.each,r=tinymce.is;tinymce.create("tinymce.plugins.InlinePopups",{init:function(t,i){t.onBeforeRenderUI.add(function(){t.windowManager=new tinymce.InlineWindowManager(t),e.loadCSS(i+"/skins/"+(t.settings.inlinepopups_skin||"clearlooks2")+"/window.css")})},getInfo:function(){return{longname:"InlinePopups",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups",version:tinymce.majorVersion+"."+tinymce.minorVersion}}}),tinymce.create("tinymce.InlineWindowManager:tinymce.WindowManager",{InlineWindowManager:function(e){var t=this;t.parent(e),t.zIndex=3e5,t.count=0,t.windows={}},open:function(n,r){var s,o,a,l,h,c,u,d=this,p="",f=d.editor,m=0,g=0;return n=n||{},r=r||{},n.inline?(u=d._frontWindow(),u&&e.get(u.id+"_ifr")&&(u.focussedElement=e.get(u.id+"_ifr").contentWindow.document.activeElement),n.type||(d.bookmark=f.selection.getBookmark(1)),s=e.uniqueId(),o=e.getViewPort(),n.width=parseInt(n.width||320),n.height=parseInt(n.height||240)+(tinymce.isIE?8:0),n.min_width=parseInt(n.min_width||150),n.min_height=parseInt(n.min_height||100),n.max_width=parseInt(n.max_width||2e3),n.max_height=parseInt(n.max_height||2e3),n.left=n.left||Math.round(Math.max(o.x,o.x+o.w/2-n.width/2)),n.top=n.top||Math.round(Math.max(o.y,o.y+o.h/2-n.height/2)),n.movable=n.resizable=!0,r.mce_width=n.width,r.mce_height=n.height,r.mce_inline=!0,r.mce_window_id=s,r.mce_auto_focus=n.auto_focus,d.features=n,d.params=r,d.onOpen.dispatch(d,n,r),n.type&&(p+=" mceModal",n.type&&(p+=" mce"+n.type.substring(0,1).toUpperCase()+n.type.substring(1)),n.resizable=!1),n.statusbar&&(p+=" mceStatusbar"),n.resizable&&(p+=" mceResizable"),n.minimizable&&(p+=" mceMinimizable"),n.maximizable&&(p+=" mceMaximizable"),n.movable&&(p+=" mceMovable"),d._addAll(e.doc.body,["div",{id:s,role:"dialog","aria-labelledby":n.type?s+"_content":s+"_title","class":(f.settings.inlinepopups_skin||"clearlooks2")+(tinymce.isIE&&window.getSelection?" ie9":""),style:"width:100px;height:100px"},["div",{id:s+"_wrapper","class":"mceWrapper"+p},["div",{id:s+"_top","class":"mceTop"},["div",{"class":"mceLeft"}],["div",{"class":"mceCenter"}],["div",{"class":"mceRight"}],["span",{id:s+"_title"},n.title||""]],["div",{id:s+"_middle","class":"mceMiddle"},["div",{id:s+"_left","class":"mceLeft",tabindex:"0"}],["span",{id:s+"_content"}],["div",{id:s+"_right","class":"mceRight",tabindex:"0"}]],["div",{id:s+"_bottom","class":"mceBottom"},["div",{"class":"mceLeft"}],["div",{"class":"mceCenter"}],["div",{"class":"mceRight"}],["span",{id:s+"_status"},"Content"]],["a",{"class":"mceMove",tabindex:"-1",href:"javascript:;"}],["a",{"class":"mceMin",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceMax",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceMed",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceClose",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{id:s+"_resize_n","class":"mceResize mceResizeN",tabindex:"-1",href:"javascript:;"}],["a",{id:s+"_resize_s","class":"mceResize mceResizeS",tabindex:"-1",href:"javascript:;"}],["a",{id:s+"_resize_w","class":"mceResize mceResizeW",tabindex:"-1",href:"javascript:;"}],["a",{id:s+"_resize_e","class":"mceResize mceResizeE",tabindex:"-1",href:"javascript:;"}],["a",{id:s+"_resize_nw","class":"mceResize mceResizeNW",tabindex:"-1",href:"javascript:;"}],["a",{id:s+"_resize_ne","class":"mceResize mceResizeNE",tabindex:"-1",href:"javascript:;"}],["a",{id:s+"_resize_sw","class":"mceResize mceResizeSW",tabindex:"-1",href:"javascript:;"}],["a",{id:s+"_resize_se","class":"mceResize mceResizeSE",tabindex:"-1",href:"javascript:;"}]]]),e.setStyles(s,{top:-1e4,left:-1e4}),tinymce.isGecko&&e.setStyle(s,"overflow","auto"),n.type||(m+=e.get(s+"_left").clientWidth,m+=e.get(s+"_right").clientWidth,g+=e.get(s+"_top").clientHeight,g+=e.get(s+"_bottom").clientHeight),e.setStyles(s,{top:n.top,left:n.left,width:n.width+m,height:n.height+g}),c=n.url||n.file,c&&(tinymce.relaxedDomain&&(c+=(-1==c.indexOf("?")?"?":"&")+"mce_rdomain="+tinymce.relaxedDomain),c=tinymce._addVer(c)),n.type?(e.add(s+"_wrapper","a",{id:s+"_ok","class":"mceButton mceOk",href:"javascript:;",onmousedown:"return false;"},"Ok"),"confirm"==n.type&&e.add(s+"_wrapper","a",{"class":"mceButton mceCancel",href:"javascript:;",onmousedown:"return false;"},"Cancel"),e.add(s+"_middle","div",{"class":"mceIcon"}),e.setHTML(s+"_content",n.content.replace("\n","<br />")),i.add(s,"keyup",function(e){var t=27;return e.keyCode===t?(n.button_func(!1),i.cancel(e)):void 0}),i.add(s,"keydown",function(t){var n,r=9;return t.keyCode===r?(n=e.select("a.mceCancel",s+"_wrapper")[0],n&&n!==t.target?n.focus():e.get(s+"_ok").focus(),i.cancel(t)):void 0})):(e.add(s+"_content","iframe",{id:s+"_ifr",src:'javascript:""',frameBorder:0,style:"border:0;width:10px;height:10px"}),e.setStyles(s+"_ifr",{width:n.width,height:n.height}),e.setAttrib(s+"_ifr","src",c)),a=i.add(s,"mousedown",function(t){var n,r,o=t.target;if(n=d.windows[s],d.focus(s),"A"==o.nodeName||"a"==o.nodeName){if("mceClose"==o.className)return d.close(null,s),i.cancel(t);if("mceMax"==o.className)n.oldPos=n.element.getXY(),n.oldSize=n.element.getSize(),r=e.getViewPort(),r.w-=2,r.h-=2,n.element.moveTo(r.x,r.y),n.element.resizeTo(r.w,r.h),e.setStyles(s+"_ifr",{width:r.w-n.deltaWidth,height:r.h-n.deltaHeight}),e.addClass(s+"_wrapper","mceMaximized");else if("mceMed"==o.className)n.element.moveTo(n.oldPos.x,n.oldPos.y),n.element.resizeTo(n.oldSize.w,n.oldSize.h),n.iframeElement.resizeTo(n.oldSize.w-n.deltaWidth,n.oldSize.h-n.deltaHeight),e.removeClass(s+"_wrapper","mceMaximized");else{if("mceMove"==o.className)return d._startDrag(s,t,o.className);if(e.hasClass(o,"mceResize"))return d._startDrag(s,t,o.className.substring(13))}}}),l=i.add(s,"click",function(e){var t=e.target;if(d.focus(s),"A"==t.nodeName||"a"==t.nodeName)switch(t.className){case"mceClose":return d.close(null,s),i.cancel(e);case"mceButton mceOk":case"mceButton mceCancel":return n.button_func("mceButton mceOk"==t.className),i.cancel(e)}}),i.add([s+"_left",s+"_right"],"focus",function(t){var i=e.get(s+"_ifr");if(i){var n=i.contentWindow.document.body,r=e.select(":input:enabled,*[tabindex=0]",n);t.target.id===s+"_left"?r[r.length-1].focus():r[0].focus()}else e.get(s+"_ok").focus()}),h=d.windows[s]={id:s,mousedown_func:a,click_func:l,element:new t(s,{blocker:1,container:f.getContainer()}),iframeElement:new t(s+"_ifr"),features:n,deltaWidth:m,deltaHeight:g},h.iframeElement.on("focus",function(){d.focus(s)}),0==d.count&&"modal"==d.editor.getParam("dialog_type","modal")?(e.add(e.doc.body,"div",{id:"mceModalBlocker","class":(d.editor.settings.inlinepopups_skin||"clearlooks2")+"_modalBlocker",style:{zIndex:d.zIndex-1}}),e.show("mceModalBlocker"),e.setAttrib(e.doc.body,"aria-hidden","true")):e.setStyle("mceModalBlocker","z-index",d.zIndex-1),(tinymce.isIE6||/Firefox\/2\./.test(navigator.userAgent)||tinymce.isIE&&!e.boxModel)&&e.setStyles("mceModalBlocker",{position:"absolute",left:o.x,top:o.y,width:o.w-2,height:o.h-2}),e.setAttrib(s,"aria-hidden","false"),d.focus(s),d._fixIELayout(s,1),e.get(s+"_ok")&&e.get(s+"_ok").focus(),d.count++,h):d.parent(n,r)},focus:function(t){var i,n=this;(i=n.windows[t])&&(i.zIndex=this.zIndex++,i.element.setStyle("zIndex",i.zIndex),i.element.update(),t+="_wrapper",e.removeClass(n.lastId,"mceFocus"),e.addClass(t,"mceFocus"),n.lastId=t,i.focussedElement?i.focussedElement.focus():e.get(t+"_ok")?e.get(i.id+"_ok").focus():e.get(i.id+"_ifr")&&e.get(i.id+"_ifr").focus())},_addAll:function(e,t){var i,n=this,s=tinymce.DOM;if(r(t,"string"))e.appendChild(s.doc.createTextNode(t));else if(t.length)for(e=e.appendChild(s.create(t[0],t[1])),i=2;t.length>i;i++)n._addAll(e,t[i])},_startDrag:function(n,r,s){function o(){h||(C._fixIELayout(n,0),e.add(S.body,"div",{id:"mceEventBlocker","class":"mceEventBlocker "+(C.editor.settings.inlinepopups_skin||"clearlooks2"),style:{zIndex:C.zIndex+1}}),(tinymce.isIE6||tinymce.isIE&&!e.boxModel)&&e.setStyles("mceEventBlocker",{position:"absolute",left:f.x,top:f.y,width:f.w-2,height:f.h-2}),h=new t("mceEventBlocker"),h.update(),c=O.getXY(),u=O.getSize(),m=p.x+c.x-f.x,g=p.y+c.y-f.y,e.add(h.get(),"div",{id:"mcePlaceHolder","class":"mcePlaceHolder",style:{left:m,top:g,width:u.w,height:u.h}}),d=new t("mcePlaceHolder"))}var a,l,h,c,u,d,p,f,m,g,y,v,b,x,L,w,C=this,S=e.doc,E=C.windows[n],O=E.element;return O.getXY(),p={x:0,y:0},f=e.getViewPort(),f.w-=2,f.h-=2,y=r.screenX,v=r.screenY,b=x=L=w=0,a=i.add(S,"mouseup",function(t){return i.remove(S,"mouseup",a),i.remove(S,"mousemove",l),h&&h.remove(),O.moveBy(b,x),O.resizeBy(L,w),u=O.getSize(),e.setStyles(n+"_ifr",{width:u.w-E.deltaWidth,height:u.h-E.deltaHeight}),C._fixIELayout(n,1),i.cancel(t)}),"Move"!=s&&o(),l=i.add(S,"mousemove",function(e){var t,n,r;switch(o(),t=e.screenX-y,n=e.screenY-v,s){case"ResizeW":b=t,L=0-t;break;case"ResizeE":L=t;break;case"ResizeN":case"ResizeNW":case"ResizeNE":"ResizeNW"==s?(b=t,L=0-t):"ResizeNE"==s&&(L=t),x=n,w=0-n;break;case"ResizeS":case"ResizeSW":case"ResizeSE":"ResizeSW"==s?(b=t,L=0-t):"ResizeSE"==s&&(L=t),w=n;break;case"mceMove":b=t,x=n}return(r=E.features.min_width-u.w)>L&&(0!==b&&(b+=L-r),L=r),(r=E.features.min_height-u.h)>w&&(0!==x&&(x+=w-r),w=r),L=Math.min(L,E.features.max_width-u.w),w=Math.min(w,E.features.max_height-u.h),b=Math.max(b,f.x-(m+f.x)),x=Math.max(x,f.y-(g+f.y)),b=Math.min(b,f.w+f.x-(m+u.w+f.x)),x=Math.min(x,f.h+f.y-(g+u.h+f.y)),0!==b+x&&(0>m+b&&(b=0),0>g+x&&(x=0),d.moveTo(m+b,g+x)),0!==L+w&&d.resizeTo(u.w+L,u.h+w),i.cancel(e)}),i.cancel(r)},resizeBy:function(e,t,i){var n=this.windows[i];n&&(n.element.resizeBy(e,t),n.iframeElement.resizeBy(e,t))},close:function(t,n){var r,s,n,o=this,a=e.doc;return n=o._findId(n||t),o.windows[n]?(o.count--,0==o.count&&(e.remove("mceModalBlocker"),e.setAttrib(e.doc.body,"aria-hidden","false"),o.editor.focus()),(r=o.windows[n])&&(o.onClose.dispatch(o),i.remove(a,"mousedown",r.mousedownFunc),i.remove(a,"click",r.clickFunc),i.clear(n),i.clear(n+"_ifr"),e.setAttrib(n+"_ifr","src",'javascript:""'),r.element.remove(),delete o.windows[n],s=o._frontWindow(),s&&o.focus(s.id)),void 0):(o.parent(t),void 0)},_frontWindow:function(){var e,t=0;return n(this.windows,function(i){i.zIndex>t&&(e=i,t=i.zIndex)}),e},setTitle:function(t,i){var n;t=this._findId(t),(n=e.get(t+"_title"))&&(n.innerHTML=e.encode(i))},alert:function(t,i){var n,r=this;n=r.open({title:r,type:"alert",button_func:function(e){i&&i.call(e||r,e),r.close(null,n.id)},content:e.encode(r.editor.getLang(t,t)),inline:1,width:400,height:130})},confirm:function(t,i){var n,r=this;n=r.open({title:r,type:"confirm",button_func:function(e){i&&i.call(e||r,e),r.close(null,n.id)},content:e.encode(r.editor.getLang(t,t)),inline:1,width:400,height:130})},_findId:function(t){var i=this;return"string"==typeof t?t:(n(i.windows,function(i){var n=e.get(i.id+"_ifr");return n&&t==n.contentWindow?(t=i.id,!1):void 0}),t)},_fixIELayout:function(t,i){var r,s;tinymce.isIE6&&(n(["n","s","w","e","nw","ne","sw","se"],function(n){var r=e.get(t+"_resize_"+n);e.setStyles(r,{width:i?r.clientWidth:"",height:i?r.clientHeight:"",cursor:e.getStyle(r,"cursor",1)}),e.setStyle(t+"_bottom","bottom","-1px"),r=0}),(r=this.windows[t])&&(r.element.hide(),r.element.show(),n(e.select("div,a",t),function(e){"none"!=e.currentStyle.backgroundImage&&(s=new Image,s.src=e.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/,"$1"))}),e.get(t).style.filter=""))}}),tinymce.PluginManager.add("inlinepopups",tinymce.plugins.InlinePopups)})();