(function(n){"use strict";function t(n,t){$(t).fadeOut("fast",function(){$(n).fadeIn("fast")})}function i(n,t){$(n).fadeOut("fast",function(){$(t).fadeIn("fast")})}n.ShowFullText=t;n.HideFullText=i})(window.CAPITALMVC=window.CAPITALMVC||{}),function(n){n.Jcrop=function(t,i){function h(n){return Math.round(n)+"px"}function ft(n){return r.baseClass+"-"+n}function bi(){return n.fx.step.hasOwnProperty("backgroundColor")}function et(t){var i=n(t).offset();return[i.left,i.top]}function nt(n){return[n.pageX-b[0],n.pageY-b[1]]}function ri(t){typeof t!="object"&&(t={});r=n.extend(r,t);n.each(["onChange","onSelect","onRelease","onDblClick"],function(n,t){typeof r[t]!="function"&&(r[t]=function(){})})}function ui(n,t,i){if(b=et(e),p.setCursor(n==="move"?n:n+"-resize"),n==="move")return p.activateHandlers(di(t),pt,i);var u=s.getFixed(),r=fi(n),f=s.getCorner(fi(r));s.setPressed(s.getCorner(r));s.setCurrent(f);p.activateHandlers(ki(n,u),pt,i)}function ki(n,t){return function(i){if(r.aspectRatio)switch(n){case"e":i[1]=t.y+1;break;case"w":i[1]=t.y+1;break;case"n":i[0]=t.x+1;break;case"s":i[0]=t.x+1}else switch(n){case"e":i[1]=t.y2;break;case"w":i[1]=t.y2;break;case"n":i[0]=t.x2;break;case"s":i[0]=t.x2}s.setCurrent(i);u.update()}}function di(n){var t=n;return kt.watchKeys(),function(n){s.moveOffset([n[0]-t[0],n[1]-t[1]]);t=n;u.update()}}function fi(n){switch(n){case"n":return"sw";case"s":return"nw";case"e":return"nw";case"w":return"ne";case"ne":return"sw";case"nw":return"se";case"se":return"nw";case"sw":return"ne"}}function ei(n){return function(t){return r.disabled?!1:n==="move"&&!r.allowMove?!1:(b=et(e),ut=!0,ui(n,nt(t)),t.stopPropagation(),t.preventDefault(),!1)}}function oi(n,t,i){var r=n.width(),u=n.height();r>t&&t>0&&(r=t,u=t/n.width()*n.height());u>i&&i>0&&(u=i,r=i/n.height()*n.width());l=n.width()/r;a=n.height()/u;n.width(r).height(u)}function ot(n){return{x:n.x*l,y:n.y*a,x2:n.x2*l,y2:n.y2*a,w:n.w*l,h:n.h*a}}function pt(){var n=s.getFixed();n.w>r.minSelect[0]&&n.h>r.minSelect[1]?(u.enableHandles(),u.done()):u.release();p.setCursor(r.allowSelect?"crosshair":"default")}function si(n){if(r.disabled||!r.allowSelect)return!1;ut=!0;b=et(e);u.disableHandles();p.setCursor("crosshair");var t=nt(n);return s.setPressed(t),u.update(),p.activateHandlers(gi,pt,n.type.substring(0,5)==="touch"),kt.watchKeys(),n.stopPropagation(),n.preventDefault(),!1}function gi(n){s.setCurrent(n);u.update()}function hi(){var t=n("<div><\/div>").addClass(ft("tracker"));return ti&&t.css({opacity:0,backgroundColor:"white"}),t}function nr(n){w.removeClass().addClass(ft("holder")).addClass(n)}function tr(n,t){function b(){window.setTimeout(k,d)}var c=n[0]/l,y=n[1]/a,p=n[2]/l,w=n[3]/a,k;if(!bt){var o=s.flipCoords(c,y,p,w),h=s.getFixed(),e=[h.x,h.y,h.x2,h.y2],i=e,d=r.animationDelay,g=o[0]-e[0],nt=o[1]-e[1],tt=o[2]-e[2],it=o[3]-e[3],f=0,rt=r.swingSpeed;c=i[0];y=i[1];p=i[2];w=i[3];u.animMode(!0);k=function(){return function(){f+=(100-f)/rt;i[0]=Math.round(c+f/100*g);i[1]=Math.round(y+f/100*nt);i[2]=Math.round(p+f/100*tt);i[3]=Math.round(w+f/100*it);f>=99.8&&(f=100);f<100?(yi(i),b()):(u.done(),u.animMode(!1),typeof t=="function"&&t.call(v))}}();b()}}function vi(n){yi([n[0]/l,n[1]/a,n[2]/l,n[3]/a]);r.onSelect.call(v,ot(s.getFixed()));u.enableHandles()}function yi(n){s.setPressed([n[0],n[1]]);s.setCurrent([n[2],n[3]]);u.update()}function ir(){return ot(s.getFixed())}function rr(){return s.getFixed()}function ur(n){ri(n);gt()}function pi(){r.disabled=!0;u.disableHandles();u.setCursor("default");p.setCursor("default")}function wi(){r.disabled=!1;gt()}function fr(){u.done();p.activateHandlers(null,null)}function er(){w.remove();c.show();c.css("visibility","visible");n(t).removeData("Jcrop")}function or(n,t){u.release();pi();var i=new Image;i.onload=function(){var u=i.width,s=i.height,h=r.boxWidth,c=r.boxHeight;e.width(u).height(s);e.attr("src",n);k.attr("src",n);oi(e,h,c);o=e.width();f=e.height();k.width(o).height(f);d.width(o+rt*2).height(f+rt*2);w.width(o).height(f);g.resize(o,f);wi();typeof t=="function"&&t.call(v)};i.src=n}function dt(n,t,i){var u=t||r.bgColor;r.bgFade&&bi()&&r.fadeTime&&!i?n.animate({backgroundColor:u},{queue:!1,duration:r.fadeTime}):n.css("backgroundColor",u)}function gt(n){r.allowResize?n?u.enableOnly():u.enableHandles():u.disableHandles();p.setCursor(r.allowSelect?"crosshair":"default");u.setCursor(r.allowMove?"move":"default");r.hasOwnProperty("trueSize")&&(l=r.trueSize[0]/o,a=r.trueSize[1]/f);r.hasOwnProperty("setSelect")&&(vi(r.setSelect),u.done(),delete r.setSelect);g.refresh();r.bgColor!=li&&(dt(r.shade?g.getShades():w,r.shade?r.shadeColor||r.bgColor:r.bgColor),li=r.bgColor);st!=r.bgOpacity&&(st=r.bgOpacity,r.shade?g.refresh():u.setBgOpacity(st));ht=r.maxSize[0]||0;ct=r.maxSize[1]||0;lt=r.minSize[0]||0;at=r.minSize[1]||0;r.hasOwnProperty("outerImage")&&(e.attr("src",r.outerImage),delete r.outerImage);u.refresh()}var r=n.extend({},n.Jcrop.defaults),b,ni=navigator.userAgent.toLowerCase(),ti=/msie/.test(ni),ii=/msie [1-6]\./.test(ni),vt,e,v;typeof t!="object"&&(t=n(t)[0]);typeof i!="object"&&(i={});ri(i);var wt={border:"none",visibility:"visible",margin:0,padding:0,position:"absolute",top:0,left:0},c=n(t),ci=!0;t.tagName=="IMG"?(c[0].width!=0&&c[0].height!=0?(c.width(c[0].width),c.height(c[0].height)):(vt=new Image,vt.src=c[0].src,c.width(vt.width),c.height(vt.height)),e=c.clone().removeAttr("id").css(wt).show(),e.width(c.width()),e.height(c.height()),c.after(e).hide()):(e=c.css(wt).show(),ci=!1,r.shade===null&&(r.shade=!0));oi(e,r.boxWidth,r.boxHeight);var o=e.width(),f=e.height(),w=n("<div />").width(o).height(f).addClass(ft("holder")).css({position:"relative",backgroundColor:r.bgColor}).insertAfter(c).append(e);r.addClass&&w.addClass(r.addClass);var k=n("<div />"),yt=n("<div />").width("100%").height("100%").css({zIndex:310,position:"absolute",overflow:"hidden"}),tt=n("<div />").width("100%").height("100%").css("zIndex",320),it=n("<div />").css({position:"absolute",zIndex:600}).dblclick(function(){var n=s.getFixed();r.onDblClick.call(v,n)}).insertBefore(e).append(yt,tt);ci&&(k=n("<img />").attr("src",e.attr("src")).css(wt).width(o).height(f),yt.append(k));ii&&it.css({overflowY:"hidden"});var rt=r.boundary,d=hi().width(o+rt*2).height(f+rt*2).css({position:"absolute",top:h(-rt),left:h(-rt),zIndex:290}).mousedown(si),li=r.bgColor,st=r.bgOpacity,ht,ct,lt,at,l,a,ut,bt,ai;b=et(e);var y=function(){function n(){var i={},u=["touchstart","touchmove","touchend"],f=document.createElement("div"),t,n,r;try{for(t=0;t<u.length;t++)n=u[t],n="on"+n,r=n in f,r||(f.setAttribute(n,"return;"),r=typeof f[n]=="function"),i[u[t]]=r;return i.touchstart&&i.touchend&&i.touchmove}catch(e){return!1}}function t(){return r.touchSupport===!0||r.touchSupport===!1?r.touchSupport:n()}return{createDragger:function(n){return function(t){return r.disabled?!1:n==="move"&&!r.allowMove?!1:(b=et(e),ut=!0,ui(n,nt(y.cfilter(t)),!0),t.stopPropagation(),t.preventDefault(),!1)}},newSelection:function(n){return si(y.cfilter(n))},cfilter:function(n){return n.pageX=n.originalEvent.changedTouches[0].pageX,n.pageY=n.originalEvent.changedTouches[0].pageY,n},isSupported:n,support:t()}}(),s=function(){function p(r){r=v(r);u=n=r[0];i=t=r[1]}function w(n){n=v(n);s=n[0]-u;h=n[1]-i;u=n[0];i=n[1]}function b(){return[s,h]}function k(r){var e=r[0],s=r[1];0>n+e&&(e-=e+n);0>t+s&&(s-=s+t);f<i+s&&(s+=f-(i+s));o<u+e&&(e+=o-(u+e));n+=e;u+=e;t+=s;i+=s}function d(n){var t=c();switch(n){case"ne":return[t.x2,t.y];case"nw":return[t.x,t.y];case"se":return[t.x2,t.y2];case"sw":return[t.x,t.y2]}}function c(){if(!r.aspectRatio)return g();var c=r.aspectRatio,b=r.minSize[0]/l,w=r.maxSize[0]/l,nt=r.maxSize[1]/a,k=u-n,d=i-t,tt=Math.abs(k),it=Math.abs(d),rt=tt/it,s,h,v,p;return w===0&&(w=o*10),nt===0&&(nt=f*10),rt<c?(h=i,v=it*c,s=k<0?n-v:v+n,s<0?(s=0,p=Math.abs((s-n)/c),h=d<0?t-p:p+t):s>o&&(s=o,p=Math.abs((s-n)/c),h=d<0?t-p:p+t)):(s=u,p=tt/c,h=d<0?t-p:t+p,h<0?(h=0,v=Math.abs((h-t)*c),s=k<0?n-v:v+n):h>f&&(h=f,v=Math.abs(h-t)*c,s=k<0?n-v:v+n)),s>n?(s-n<b?s=n+b:s-n>w&&(s=n+w),h=h>t?t+(s-n)/c:t-(s-n)/c):s<n&&(n-s<b?s=n-b:n-s>w&&(s=n-w),h=h>t?t+(n-s)/c:t-(n-s)/c),s<0?(n-=s,s=0):s>o&&(n-=s-o,s=o),h<0?(t-=h,h=0):h>f&&(t-=h-f,h=f),y(e(n,t,s,h))}function v(n){return n[0]<0&&(n[0]=0),n[1]<0&&(n[1]=0),n[0]>o&&(n[0]=o),n[1]>f&&(n[1]=f),[Math.round(n[0]),Math.round(n[1])]}function e(n,t,i,r){var u=n,f=i,e=t,o=r;return i<n&&(u=i,f=n),r<t&&(e=r,o=t),[u,e,f,o]}function g(){var s=u-n,h=i-t,r;return ht&&Math.abs(s)>ht&&(u=s>0?n+ht:n-ht),ct&&Math.abs(h)>ct&&(i=h>0?t+ct:t-ct),at/a&&Math.abs(h)<at/a&&(i=h>0?t+at/a:t-at/a),lt/l&&Math.abs(s)<lt/l&&(u=s>0?n+lt/l:n-lt/l),n<0&&(u-=n,n-=n),t<0&&(i-=t,t-=t),u<0&&(n-=u,u-=u),i<0&&(t-=i,i-=i),u>o&&(r=u-o,n-=r,u-=r),i>f&&(r=i-f,t-=r,i-=r),n>o&&(r=n-f,i-=r,t-=r),t>f&&(r=t-f,i-=r,t-=r),y(e(n,t,u,i))}function y(n){return{x:n[0],y:n[1],x2:n[2],y2:n[3],w:n[2]-n[0],h:n[3]-n[1]}}var n=0,t=0,u=0,i=0,s,h;return{flipCoords:e,setPressed:p,setCurrent:w,getOffset:b,moveOffset:k,getCorner:d,getFixed:c}}(),g=function(){function nt(n,t){i.left.css({height:h(t)});i.right.css({height:h(t)})}function v(){return y(s.getFixed())}function y(n){i.top.css({left:h(n.x),width:h(n.w),height:h(n.y)});i.bottom.css({top:h(n.y2),left:h(n.x),width:h(n.w),height:h(f-n.y2)});i.right.css({left:h(n.x2),width:h(o-n.x2)});i.left.css({width:h(n.x)})}function l(){return n("<div />").css({position:"absolute",backgroundColor:r.shadeColor||r.bgColor}).appendTo(t)}function p(){c||(c=!0,t.insertBefore(e),v(),u.setBgOpacity(1,0,1),k.hide(),b(r.shadeColor||r.bgColor,1),u.isAwake()?a(r.bgOpacity,1):a(1,1))}function b(n,t){dt(g(),n,t)}function d(){c&&(t.remove(),k.show(),c=!1,u.isAwake()?u.setBgOpacity(r.bgOpacity,1,1):(u.setBgOpacity(1,1,1),u.disableHandles()),dt(w,0,1))}function a(n,i){c&&(r.bgFade&&!i?t.animate({opacity:1-n},{queue:!1,duration:r.fadeTime}):t.css({opacity:1-n}))}function tt(){r.shade?p():d();u.isAwake()&&a(r.bgOpacity)}function g(){return t.children()}var c=!1,t=n("<div />").css({position:"absolute",zIndex:240,opacity:0}),i={top:l(),left:l().height(f),right:l().height(f),bottom:l()};return{update:v,updateRaw:y,getShades:g,setBgColor:b,enable:p,disable:d,resize:nt,refresh:tt,opacity:a}}(),u=function(){function et(t){var i=n("<div />").css({position:"absolute",opacity:r.borderOpacity}).addClass(ft(t));return yt.append(i),i}function l(t,i){var r=n("<div />").mousedown(ei(t)).css({cursor:t+"-resize",position:"absolute",zIndex:i}).addClass("ord-"+t);return y.support&&r.bind("touchstart.jcrop",y.createDragger(t)),tt.append(r),r}function ht(n){var t=r.handleSize,i=l(n,c++).css({opacity:r.handleOpacity}).addClass(ft("handle"));return t&&i.width(t).height(t),i}function ct(n){return l(n,c++).addClass("jcrop-dragbar")}function lt(n){for(var t=0;t<n.length;t++)ut[n[t]]=ct(n[t])}function at(n){for(var t,i=0;i<n.length;i++){switch(n[i]){case"n":t="hline";break;case"s":t="hline bottom";break;case"e":t="vline right";break;case"w":t="vline"}nt[n[i]]=et(t)}}function vt(n){for(var t=0;t<n.length;t++)rt[n[t]]=ht(n[t])}function pt(n,t){r.shade||k.css({top:h(-t),left:h(-n)});it.css({top:h(t),left:h(n)})}function wt(n,t){it.width(Math.round(n)).height(Math.round(t))}function a(){var n=s.getFixed();s.setPressed([n.x,n.y]);s.setCurrent([n.x2,n.y2]);p()}function p(n){if(t)return w(n)}function w(n){var i=s.getFixed();wt(i.w,i.h);pt(i.x,i.y);r.shade&&g.updateRaw(i);t||kt();n?r.onSelect.call(v,ot(i)):r.onChange.call(v,ot(i))}function o(n,i,u){(t||i)&&(r.bgFade&&!u?e.animate({opacity:n},{queue:!1,duration:r.fadeTime}):e.css("opacity",n))}function kt(){it.show();r.shade?g.opacity(st):o(st,!0);t=!0}function dt(){u();it.hide();r.shade?g.opacity(1):o(1);t=!1;r.onRelease.call(v)}function gt(){i&&tt.show()}function b(){return i=!0,r.allowResize?(tt.show(),!0):void 0}function u(){i=!1;tt.hide()}function d(n){n?(bt=!0,u()):(bt=!1,b())}function ni(){d(!1);a()}var t,c=370,nt={},rt={},ut={},i=!1,f;return r.dragEdges&&n.isArray(r.createDragbars)&&lt(r.createDragbars),n.isArray(r.createHandles)&&vt(r.createHandles),r.drawBorders&&n.isArray(r.createBorders)&&at(r.createBorders),n(document).bind("touchstart.jcrop-ios",function(t){n(t.currentTarget).hasClass("jcrop-tracker")&&t.stopPropagation()}),f=hi().mousedown(ei("move")).css({cursor:"move",position:"absolute",zIndex:360}),y.support&&f.bind("touchstart.jcrop",y.createDragger("move")),yt.append(f),u(),{updateVisible:p,update:w,release:dt,refresh:a,isAwake:function(){return t},setCursor:function(n){f.css("cursor",n)},enableHandles:b,enableOnly:function(){i=!0},showHandles:gt,disableHandles:u,animMode:d,setBgOpacity:o,done:ni}}(),p=function(){function c(t){d.css({zIndex:450});t?n(document).bind("touchmove.jcrop",p).bind("touchend.jcrop",w):o&&n(document).bind("mousemove.jcrop",h).bind("mouseup.jcrop",i)}function l(){d.css({zIndex:290});n(document).unbind(".jcrop")}function h(n){return t(nt(n)),!1}function i(n){return n.preventDefault(),n.stopPropagation(),ut&&(ut=!1,f(nt(n)),u.isAwake()&&r.onSelect.call(v,ot(s.getFixed())),l(),t=function(){},f=function(){}),!1}function a(n,i,r){return ut=!0,t=n,f=i,c(r),!1}function p(n){return t(nt(y.cfilter(n))),!1}function w(n){return i(y.cfilter(n))}function b(n){d.css("cursor",n)}var t=function(){},f=function(){},o=r.trackDocument;return o||d.mousemove(h).mouseup(i).mouseout(i),e.before(d),{activateHandlers:a,setCursor:b}}(),kt=function(){function o(){r.keySupport&&(t.show(),t.focus())}function h(){t.hide()}function i(n,t,i){r.allowMove&&(s.moveOffset([t,i]),u.updateVisible(!0));n.preventDefault();n.stopPropagation()}function c(n){if(n.ctrlKey||n.metaKey)return!0;ai=n.shiftKey?!0:!1;var t=ai?10:1;switch(n.keyCode){case 37:i(n,-t,0);break;case 39:i(n,t,0);break;case 38:i(n,0,-t);break;case 40:i(n,0,t);break;case 27:r.allowSelect&&u.release();break;case 9:return!0}return!1}var t=n('<input type="radio" />').css({position:"fixed",left:"-120px",width:"12px"}).addClass("jcrop-keymgr"),f=n("<div />").css({position:"absolute",overflow:"hidden"}).append(t);return r.keySupport&&(t.keydown(c).blur(h),ii||!r.fixedSupport?(t.css({position:"absolute",left:"-20px"}),f.append(t).insertBefore(e)):t.insertBefore(e)),{watchKeys:o}}();return y.support&&d.bind("touchstart.jcrop",y.newSelection),tt.hide(),gt(!0),v={setImage:or,animateTo:tr,setSelect:vi,setOptions:ur,tellSelect:ir,tellScaled:rr,setClass:nr,disable:pi,enable:wi,cancel:fr,release:u.release,destroy:er,focus:kt.watchKeys,getBounds:function(){return[o*l,f*a]},getWidgetSize:function(){return[o,f]},getScaleFactor:function(){return[l,a]},getOptions:function(){return r},ui:{holder:w,selection:it}},ti&&w.bind("selectstart",function(){return!1}),c.data("Jcrop",v),v};n.fn.Jcrop=function(t,i){var r;return this.each(function(){if(n(this).data("Jcrop")){if(t==="api")return n(this).data("Jcrop");n(this).data("Jcrop").setOptions(t)}else this.tagName=="IMG"?n.Jcrop.Loader(this,function(){n(this).css({display:"block",visibility:"hidden"});r=n.Jcrop(this,t);n.isFunction(i)&&i.call(r)}):(n(this).css({display:"block",visibility:"hidden"}),r=n.Jcrop(this,t),n.isFunction(i)&&i.call(r))}),this};n.Jcrop.Loader=function(t,i,r){function e(){f.complete?(u.unbind(".jcloader"),n.isFunction(i)&&i.call(f)):window.setTimeout(e,50)}var u=n(t),f=u[0];u.bind("load.jcloader",e).bind("error.jcloader",function(){u.unbind(".jcloader");n.isFunction(r)&&r.call(f)});f.complete&&n.isFunction(i)&&(u.unbind(".jcloader"),i.call(f))};n.Jcrop.defaults={allowSelect:!0,allowMove:!0,allowResize:!0,trackDocument:!0,baseClass:"jcrop",addClass:null,bgColor:"black",bgOpacity:.6,bgFade:!1,borderOpacity:.4,handleOpacity:.5,handleSize:null,aspectRatio:0,keySupport:!0,createHandles:["n","s","e","w","nw","ne","se","sw"],createDragbars:["n","s","e","w"],createBorders:["n","s","e","w"],drawBorders:!0,dragEdges:!0,fixedSupport:!0,touchSupport:null,shade:null,boxWidth:0,boxHeight:0,boundary:2,fadeTime:400,animationDelay:20,swingSpeed:3,minSelect:[0,0],maxSize:[0,0],minSize:[0,0],onChange:function(){},onSelect:function(){},onDblClick:function(){},onRelease:function(){}}}(jQuery),function(n){n.fn.JcropPreview=function(t){var t=n.extend({jcropImg:null,defaultWidth:100,defaultHeight:100},t);return t.jcropImg=n(t.jcropImg),this.each(function(){var i=n(this),r,u;i.empty();r=i.attr("style")!=null&&i.attr("style").indexOf("width")>-1?i.width():t.defaultWidth;u=i.attr("style")!=null&&i.attr("style").indexOf("height")>-1?i.height():t.defaultHeight;i.css({width:r+"px",height:u+"px",overflow:"hidden"});var f=n("<div />").css({overflow:"hidden"}).addClass("innerPreview").appendTo(i),e=n("<img />").attr("src",t.jcropImg.attr("src")).appendTo(f),o=function(o){var h,c,a,v;if(!(parseInt(o.w)<=0)&&!(parseInt(o.h)<=0)){t.jcropRef==null&&(t.jcropRef=n(t.jcropImg).data("Jcrop"));var y=t.jcropRef.getWidgetSize(),l=t.jcropRef.getOptions,s=o.w/o.h;l!=null&&l().aspectRatio&&(s=l().aspectRatio);h=s>=r/u?r:u*s;c=s<r/u?u:r/s;f.css({width:Math.ceil(h)+"px",height:Math.ceil(c)+"px",marginTop:(u-c)/2+"px",marginLeft:(r-h)/2+"px",overflow:"hidden"});i.css({});a=h/o.w;v=c/o.h;e.css({width:Math.round(a*y[0])+"px",height:Math.round(v*y[1])+"px",marginLeft:"-"+Math.round(a*o.x)+"px",marginTop:"-"+Math.round(v*o.y)+"px"})}};i.data("updateFunc",o)})};n.fn.JcropPreviewUpdate=function(t){return this.each(function(){n(this).data("updateFunc")(t)})};n.fn.JcropPreviewUpdateFn=function(){var t=n(this);return function(n){t.data("updateFunc")(n)}}}(jQuery),function(n){function t(r){if(i[r])return i[r].exports;var u=i[r]={exports:{},id:r,loaded:!1};return n[r].call(u.exports,u,u.exports,t),u.loaded=!0,u.exports}var i={};return t.m=n,t.c=i,t.p="",t(0)}([function(n,t,i){var r;!(r=function(){"use strict";var t=i(1),n=i(2),f=i(3),r=i(4),u=i(5);t.sceditor=n;n.commands=i(6);n.defaultOptions=i(7);n.RangeHelper=i(8);n.dom=i(9);n.ie=r.ie;n.ios=r.ios;n.isWysiwygSupported=r.isWysiwygSupported;n.regexEscape=u.regex;n.escapeEntities=u.entities;n.escapeUriScheme=u.uriScheme;n.PluginManager=f;n.plugins=f.plugins;t.fn.sceditor=function(i){var e,f,u=[];if(i=i||{},i.runWithoutWysiwygSupport||r.isWysiwygSupported)return(this.each(function(){(e=this.jquery?this:t(this),f=e.data("sceditor"),e.parents(".sceditor-container").length>0)||(i==="state"?u.push(!!f):i==="instance"?u.push(f):f||new n(this,i))}),!u.length)?this:u.length===1?u[0]:t(u)}}.call(t,i,t,n),r!==undefined&&(n.exports=r))},function(n){n.exports=jQuery},function(n,t,i){var r;!(r=function(){"use strict";var n=i(1),v=i(3),y=i(8),r=i(9),a=i(5),s=i(4),c=i(10),e=window,f=document,l=n(e),o=n(f),t=s.ie,h=t&&t<11,u=function(i,p){var w=this,ei=i.get?i.get(0):i,ot=n(ei),d,yt,it,st,k,rt,g,nt,ct,ut,ht,dr=[],b,oi=[],bt=[],tt,kt,lt,gt,si,gi,at,dt={},vt=[],ni={},hi,nr,ti,ci,tr,ir,rr,ur,fr,er,or,sr,hr,cr,lr,ar,li,ai,vr,yr,vi,pr,ii,yi,ri,pi,pt,wr,wt,wi,br,bi,ki,kr,di,ft,ui,et,fi;w.commands=n.extend(!0,{},p.commands||u.commands);w.opts=p=n.extend({},u.defaultOptions,p);nr=function(){ot.data("sceditor",w);n.each(p,function(t,i){n.isPlainObject(i)&&(p[t]=n.extend(!0,{},i))});p.locale&&p.locale!=="en"&&ur();d=n('<div class="sceditor-container" />').insertAfter(ot).css("z-index",p.zIndex);t&&d.addClass("ie ie"+t);gi=!!ot.attr("required");ot.removeAttr("required");rr();cr();fr();ir();sr();er();or();s.isWysiwygSupported||w.toggleSourceMode();pt();var i=function(){l.unbind("load",i);p.autofocus&&bi();p.autoExpand&&w.expandToContent();ri();tt.call("ready")};l.load(i);f.readyState&&f.readyState==="complete"&&i()};rr=function(){var t=p.plugins;t=t?t.toString().split(","):[];tt=new v(w);n.each(t,function(t,i){tt.register(n.trim(i))})};ur=function(){var n;ht=u.locale[p.locale];ht||(n=p.locale.split("-"),ht=u.locale[n[0]]);ht&&ht.dateFormat&&(p.dateFormat=ht.dateFormat)};ir=function(){var i,r;g=n("<textarea><\/textarea>").hide();it=n('<iframe frameborder="0" allowfullscreen="true"><\/iframe>');p.spellcheck||g.attr("spellcheck","false");e.location.protocol==="https:"&&it.attr("src","javascript:false");d.append(it).append(g);st=it[0];nt=g[0];w.dimensions(p.width||ot.width(),p.height||ot.height());i=lr();i.open();i.write(c("html",{attrs:t?' class="ie ie"'+t:"",spellcheck:p.spellcheck?"":'spellcheck="false"',charset:p.charset,style:p.style}));i.close();rt=n(i);k=n(i.body);w.readOnly(!!p.readOnly);(s.ios||t)&&(k.height("100%"),t||k.bind("touchend",w.focus));r=ot.attr("tabindex");g.attr("tabindex",r);it.attr("tabindex",r);b=new y(st.contentWindow);w.val(ot.hide().val())};er=function(){p.autoUpdate&&(k.bind("blur",fi),g.bind("blur",fi));p.rtl===null&&(p.rtl=g.css("direction")==="rtl");w.rtl(!!p.rtl);p.autoExpand&&rt.bind("keyup",w.expandToContent);p.resizeEnabled&&hr();d.attr("id",p.id);w.emoticons(p.emoticonsEnabled)};or=function(){var i=t?"selectionchange":"keyup focus blur contextmenu mouseup touchend click",r="keydown keyup keypress focus blur contextmenu";o.click(yi);n(ei.form).bind("reset",vi).submit(w.updateOriginal);l.bind("resize orientationChanged",ri);k.keypress(yr).keydown(ai).keydown(vr).keyup(wt).blur(ui).keyup(et).bind("paste",ar).bind(i,wi).bind(r,ii);p.emoticonsCompat&&e.getSelection&&k.keyup(kr);g.blur(ui).keyup(et).keydown(ai).bind(r,ii);rt.mousedown(pr).blur(ui).bind(i,wi).bind("beforedeactivate keyup mouseup",tr).keyup(wt).focus(function(){ut=null});d.bind("selectionchanged",br).bind("selectionchanged",pt).bind("selectionchanged valuechanged nodechanged",ii)};fr=function(){var i,r=w.commands,u=(p.toolbarExclude||"").split(","),f=p.toolbar.split("|");yt=n('<div class="sceditor-toolbar" unselectable="on" />');n.each(f,function(f,e){i=n('<div class="sceditor-group" />');n.each(e.split(","),function(f,e){var s,h,o=r[e];!o||n.inArray(e,u)>-1||(h=o.shortcut,s=c("toolbarButton",{name:e,dispName:w._(o.tooltip||e)},!0),s.data("sceditor-txtmode",!!o.txtExec).data("sceditor-wysiwygmode",!!o.exec).toggleClass("disabled",!o.exec).mousedown(function(){(!t||t<9)&&(hi=!0)}).click(function(){var t=n(this);return t.hasClass("disabled")||ci(t,o),pt(),!1}),o.tooltip&&s.attr("title",w._(o.tooltip)+(h?"("+h+")":"")),h&&w.addShortcut(h,e),o.state?bt.push({name:e,state:o.state}):typeof o.exec=="string"&&bt.push({name:e,state:o.exec}),i.append(s),ni[e]=s)});i[0].firstChild&&yt.append(i)});n(p.toolbarContainer||d).append(yt)};sr=function(){n.each(w.commands,function(t,i){i.forceNewLineAfter&&n.isArray(i.forceNewLineAfter)&&(oi=n.merge(oi,i.forceNewLineAfter))});wt()};hr=function(){var i,r,u,f,c,l,nt=n('<div class="sceditor-grip" />'),a=n('<div class="sceditor-resize-cover" />'),tt="touchmove mousemove",it="touchcancel touchend mouseup",s=0,v=0,h=0,y=0,b=0,k=0,rt=d.width(),ut=d.height(),g=!1,ft=w.rtl();i=p.resizeMinHeight||ut/1.5;r=p.resizeMaxHeight||ut*2.5;u=p.resizeMinWidth||rt/1.25;f=p.resizeMaxWidth||rt*1.25;c=function(n){n.type==="touchmove"?(n=e.event,h=n.changedTouches[0].pageX,y=n.changedTouches[0].pageY):(h=n.pageX,y=n.pageY);var o=k+(y-v),c=ft?b-(h-s):b+(h-s);f>0&&c>f&&(c=f);u>0&&c<u&&(c=u);p.resizeWidth||(c=!1);r>0&&o>r&&(o=r);i>0&&o<i&&(o=i);p.resizeHeight||(o=!1);(c||o)&&(w.dimensions(c,o),t<7&&d.height(o));n.preventDefault()};l=function(n){g&&(g=!1,a.hide(),d.removeClass("resizing").height("auto"),o.unbind(tt,c),o.unbind(it,l),n.preventDefault())};d.append(nt);d.append(a.hide());nt.bind("touchstart mousedown",function(n){n.type==="touchstart"?(n=e.event,s=n.touches[0].pageX,v=n.touches[0].pageY):(s=n.pageX,v=n.pageY);b=d.width();k=d.height();g=!0;d.addClass("resizing");a.show();o.bind(tt,c);o.bind(it,l);t<7&&d.height(k);n.preventDefault()})};cr=function(){var t,i=p.emoticons,r=p.emoticonsRoot;n.isPlainObject(i)&&p.emoticonsEnabled&&n.each(i,function(u,e){n.each(e,function(n,e){r&&(e={url:r+(e.url||e),tooltip:e.tooltip||n},i[u][n]=e);t=f.createElement("img");t.src=e.url||e;dr.push(t)})})};bi=function(){var i,e,o=rt[0],u=k[0],t=u.firstChild,f=!!p.autofocusEnd;if(d.is(":visible")){if(w.sourceMode()){e=f?nt.value.length:0;nt.setSelectionRange?nt.setSelectionRange(e,e):(i=nt.createTextRange(),i.moveEnd("character",e),i.collapse(!1),i.select());return}if(r.removeWhiteSpace(u),f)for((t=u.lastChild)||(t=o.createElement("p"),k.append(t));t.lastChild;)t=t.lastChild,!h&&n(t).is("br")&&t.previousSibling&&(t=t.previousSibling);o.createRange?(i=o.createRange(),r.canHaveChildren(t)?i.selectNodeContents(t):(i.setStartBefore(t),f&&i.setStartAfter(t))):(i=u.createTextRange(),i.moveToElementText(t.nodeType!==3?t:t.parentNode));i.collapse(!f);b.selectRange(i);gt=i;f&&(rt.scrollTop(u.scrollHeight),k.scrollTop(u.scrollHeight));w.focus()}};w.readOnly=function(n){return typeof n!="boolean"?g.attr("readonly")==="readonly":(k[0].contentEditable=!n,n?g.attr("readonly","readonly"):g.removeAttr("readonly"),pi(n),w)};w.rtl=function(n){var t=n?"rtl":"ltr";return typeof n!="boolean"?g.attr("dir")==="rtl":(k.attr("dir",t),g.attr("dir",t),d.removeClass("rtl").removeClass("ltr").addClass(t),w)};pi=function(t){var i=w.inSourceMode()?"txtmode":"wysiwygmode";n.each(ni,function(n,r){t!==!0&&r.data("sceditor-"+i)?r.removeClass("disabled"):r.addClass("disabled")})};w.width=function(n,t){return!n&&n!==0?d.width():(w.dimensions(n,null,t),w)};w.dimensions=function(n,i,r){var u=t<8||f.documentMode<8?2:0,e;return(n=!n&&n!==0?!1:n,i=!i&&i!==0?!1:i,n===!1&&i===!1)?{width:w.width(),height:w.height()}:(it.data("outerWidthOffset")===e&&w.updateStyleCache(),n!==!1&&(r!==!1&&(p.width=n),i===!1&&(i=d.height(),r=!1),d.width(n),n&&n.toString().indexOf("%")>-1&&(n=d.width()),it.width(n-it.data("outerWidthOffset")),g.width(n-g.data("outerWidthOffset")),s.ios&&k&&k.width(n-it.data("outerWidthOffset")-(k.outerWidth(!0)-k.width()))),i!==!1&&(r!==!1&&(p.height=i),i&&i.toString().indexOf("%")>-1&&(i=d.height(i).height(),d.height("auto")),i-=p.toolbarContainer?0:yt.outerHeight(!0),it.height(i-it.data("outerHeightOffset")),g.height(i-u-g.data("outerHeightOffset"))),w)};w.updateStyleCache=function(){it.data("outerWidthOffset",it.outerWidth(!0)-it.width());g.data("outerWidthOffset",g.outerWidth(!0)-g.width());it.data("outerHeightOffset",it.outerHeight(!0)-it.height());g.data("outerHeightOffset",g.outerHeight(!0)-g.height())};w.height=function(n,t){return!n&&n!==0?d.height():(w.dimensions(null,n,t),w)};w.maximize=function(i){return typeof i=="undefined"?d.is(".sceditor-maximize"):(i=!!i,t<7&&n("html, body").toggleClass("sceditor-maximize",i),d.toggleClass("sceditor-maximize",i),w.width(i?"100%":p.width,!1),w.height(i?"100%":p.height,!1),w)};w.expandToContent=function(n){var i=d.height(),r=i-it.height(),t=k[0].scrollHeight||rt[0].documentElement.scrollHeight,u=p.resizeMaxHeight||(p.height||ot.height())*2;t+=r;(n===!0||t<=u)&&t>i&&w.height(t)};w.destroy=function(){tt&&(tt.destroy(),b=null,ut=null,tt=null,o.unbind("click",yi),l.unbind("resize orientationChanged",ri),n(ei.form).unbind("reset",vi).unbind("submit",w.updateOriginal),k.unbind(),rt.unbind().find("*").remove(),g.unbind().remove(),yt.remove(),d.unbind().find("*").unbind().remove(),d.remove(),ot.removeData("sceditor").removeData("sceditorbbcode").show(),gi&&ot.attr("required","required"))};w.createDropDown=function(t,i,r,u){var f,e="sceditor-"+i,o=ct&&ct.is("."+e);(w.closeDropDown(),o)||(u!==!1&&n(r).find(":not(input,textarea)").filter(function(){return this.nodeType===1}).attr("unselectable","on"),f={top:t.offset().top,left:t.offset().left,marginTop:t.outerHeight()},n.extend(f,p.dropDownCss),ct=n('<div class="sceditor-dropdown '+e+'" />').css(f).append(r).appendTo(n("body")).on("click focusin",function(n){n.stopPropagation()}),setTimeout(function(){ct.find("input,textarea").first().focus()}))};yi=function(n){n.which!==3&&ct&&(fi(),w.closeDropDown())};ar=function(n){var u,e,o,t=k[0],c=rt[0],h=0,i=f.createElement("div"),s=c.createDocumentFragment(),r=n?n.clipboardData:!1;if(p.disablePasting)return!1;if(p.enablePasteFiltering){if(b.saveRange(),f.body.appendChild(i),r&&r.getData&&((u=r.getData("text/html"))||(u=r.getData("text/plain"))))return i.innerHTML=u,li(t,i),!1;for(o=k.scrollTop()||rt.scrollTop();t.firstChild;)s.appendChild(t.firstChild);return e=function(n,t){if(n.childNodes.length>0||h>25){while(n.firstChild)t.appendChild(n.firstChild);while(s.firstChild)n.appendChild(s.firstChild);k.scrollTop(o);rt.scrollTop(o);t.childNodes.length>0?li(n,t):b.restoreRange()}else h++,setTimeout(function(){e(n,t)},20)},e(t,i),w.focus(),!0}};li=function(t,i){r.fixNesting(i);var u=i.innerHTML;tt.hasHandler("toSource")&&(u=tt.callOnlyFirst("toSource",u,n(i)));i.parentNode.removeChild(i);tt.hasHandler("toWysiwyg")&&(u=tt.callOnlyFirst("toWysiwyg",u,!0));b.restoreRange();w.wysiwygEditorInsertHtml(u,null,!0)};w.closeDropDown=function(n){ct&&(ct.unbind().remove(),ct=null);n===!0&&w.focus()};lr=function(){return st.contentDocument?st.contentDocument:st.contentWindow&&st.contentWindow.document?st.contentWindow.document:st.document};w.wysiwygEditorInsertHtml=function(t,i,u){var e,o,f,s=it.height();(w.focus(),u||!n(lt).is("code")&&n(lt).parents("code").length===0)&&(b.insertHTML(t,i),b.saveRange(),ti(k[0]),e=k.find("#sceditor-end-marker").show(),o=k.scrollTop()||rt.scrollTop(),f=r.getOffset(e[0]).top+e.outerHeight(!0)*1.5-s,e.hide(),(f>o||f+s<o)&&(k.scrollTop(f),rt.scrollTop(f)),ft(!1),b.restoreRange(),wt())};w.wysiwygEditorInsertText=function(n,t){w.wysiwygEditorInsertHtml(a.entities(n),a.entities(t))};w.insertText=function(n,t){return w.inSourceMode()?w.sourceEditorInsertText(n,t):w.wysiwygEditorInsertText(n,t),w};w.sourceEditorInsertText=function(n,t){var i,e,r,u=nt.selectionStart,o=nt.selectionEnd;e=nt.scrollTop;nt.focus();typeof u!="undefined"?(r=nt.value,t&&(n+=r.substring(u,o)+t),nt.value=r.substring(0,u)+n+r.substring(o,r.length),nt.selectionStart=u+n.length-(t?t.length:0),nt.selectionEnd=nt.selectionStart):(i=f.selection.createRange(),t&&(n+=i.text+t),i.text=n,t&&i.moveEnd("character",0-t.length),i.moveStart("character",i.End-i.Start),i.select());nt.scrollTop=e;nt.focus();ft()};w.getRangeHelper=function(){return b};w.sourceEditorCaret=function(n){var t,i={};return nt.focus(),typeof nt.selectionStart!="undefined"?n?(nt.selectionStart=n.start,nt.selectionEnd=n.end):(i.start=nt.selectionStart,i.end=nt.selectionEnd):(t=f.selection.createRange(),n?(t.moveEnd("character",n.end),t.moveStart("character",n.start),t.select()):(i.start=t.Start,i.end=t.End)),n?this:i};w.val=function(n,t){return typeof n!="string"?w.inSourceMode()?w.getSourceEditorValue(!1):w.getWysiwygEditorValue(t):(w.inSourceMode()?w.setSourceEditorValue(n):(t!==!1&&tt.hasHandler("toWysiwyg")&&(n=tt.callOnlyFirst("toWysiwyg",n)),w.setWysiwygEditorValue(n)),w)};w.insert=function(t,i,r,u,f){if(w.inSourceMode())return w.sourceEditorInsertText(t,i),w;if(i){var e=b.selectedHtml(),o=n("<div>").appendTo(n("body")).hide().html(e);r!==!1&&tt.hasHandler("toSource")&&(e=tt.callOnlyFirst("toSource",e,o));o.remove();t+=e+i}return r!==!1&&tt.hasHandler("toWysiwyg")&&(t=tt.callOnlyFirst("toWysiwyg",t,!0)),r!==!1&&f===!0&&(t=t.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")),w.wysiwygEditorInsertHtml(t),w};w.getWysiwygEditorValue=function(n){var t,i,u=b.hasSelection();return u?b.saveRange():ut&&ut.getBookmark&&(i=ut.getBookmark()),r.fixNesting(k[0]),t=k.html(),n!==!1&&tt.hasHandler("toSource")&&(t=tt.callOnlyFirst("toSource",t,k)),u?(b.restoreRange(),ut=null):i&&(ut.moveToBookmark(i),ut=null),t};w.getBody=function(){return k};w.getContentAreaContainer=function(){return it};w.getSourceEditorValue=function(n){var t=g.val();return n!==!1&&tt.hasHandler("toWysiwyg")&&(t=tt.callOnlyFirst("toWysiwyg",t)),t};w.setWysiwygEditorValue=function(n){n||(n="<p>"+(t?"":"<br />")+"<\/p>");k[0].innerHTML=n;ti(k[0]);wt();ft()};w.setSourceEditorValue=function(n){g.val(n);ft()};w.updateOriginal=function(){ot.val(w.val())};ti=function(t){var u;if(p.emoticonsEnabled&&!n(t).parents("code").length){var f=t.ownerDocument,e="\\s| | | | |&nbsp;",i=[],o=[],s=n.extend({},p.emoticons.more,p.emoticons.dropdown,p.emoticons.hidden);n.each(s,function(n){p.emoticonsCompat&&(o[n]=new RegExp("(>|^|"+e+")"+a.regex(n)+"($|<|"+e+")"));i.push(n)});u=function(t){for(t=t.firstChild;t;){var v,e,l,b,y,w,a,k=t.parentNode,h=t.nodeValue;if(t.nodeType!==3)n(t).is("code")||u(t);else if(h)for(y=i.length;y--;)e=i[y],a=p.emoticonsCompat?h.search(o[e]):h.indexOf(e),a>-1&&(w=t.nextSibling,l=s[e],v=h.substr(a).split(e),h=h.substr(0,a)+v.shift(),t.nodeValue=h,b=r.parseHTML(c("emoticon",{key:e,url:l.url||l,tooltip:l.tooltip||e}),f),k.insertBefore(b[0],w),k.insertBefore(f.createTextNode(v.join(e)),w));t=t.nextSibling}};u(t);p.emoticonsCompat&&(vt=k.find("img[data-sceditor-emoticon]"))}};w.inSourceMode=function(){return d.hasClass("sourceMode")};w.sourceMode=function(n){var t=w.inSourceMode();return typeof n!="boolean"?t:((t&&!n||!t&&n)&&w.toggleSourceMode(),w)};w.toggleSourceMode=function(){var n=w.inSourceMode();(s.isWysiwygSupported||!n)&&(n||(b.saveRange(),b.clear()),w.blur(),n?w.setWysiwygEditorValue(w.getSourceEditorValue()):w.setSourceEditorValue(w.getWysiwygEditorValue()),ut=null,g.toggle(),it.toggle(),d.toggleClass("wysiwygMode",n).toggleClass("sourceMode",!n),pi(),pt())};wr=function(){return nt.focus(),typeof nt.selectionStart!="undefined"?nt.value.substring(nt.selectionStart,nt.selectionEnd):f.selection.createRange().text};ci=function(t,i){w.inSourceMode()?i.txtExec&&(n.isArray(i.txtExec)?w.sourceEditorInsertText.apply(w,i.txtExec):i.txtExec.call(w,t,wr())):i.exec&&(n.isFunction(i.exec)?i.exec.call(w,t):w.execCommand(i.exec,i.hasOwnProperty("execParam")?i.execParam:null))};tr=function(){t&&(ut=b.selectedRange())};w.execCommand=function(t,i){var u=!1,r=w.commands[t],f=n(b.parentNode());if(w.focus(),!f.is("code")&&f.parents("code").length===0){try{u=rt[0].execCommand(t,!1,i)}catch(e){}!u&&r&&r.errorMessage&&alert(w._(r.errorMessage));pt()}};wi=function(){function i(){b&&!b.compare(gt)&&(gt=b.cloneSelected(),d.trigger(n.Event("selectionchanged")));si=!1}si||(si=!0,t?i():setTimeout(i,100))};br=function(){var i,t=b.parentNode();kt!==t&&(i=kt,kt=t,lt=b.getFirstBlockParent(t),d.trigger(n.Event("nodechanged",{oldNode:i,newNode:kt})))};w.currentNode=function(){return kt};w.currentBlockNode=function(){return lt};pt=function(n){var s,f,e="active",h=rt[0],r=w.sourceMode(),i;if(w.readOnly()){yt.find(e).removeClass(e);return}for(r||(f=n?n.newNode:b.parentNode(),s=b.getFirstBlockParent(f)),i=0;i<bt.length;i++){var t=0,o=ni[bt[i].name],u=bt[i].state,c=r&&!o.data("sceditor-txtmode")||!r&&!o.data("sceditor-wysiwygmode");if(typeof u=="string"){if(!r)try{t=h.queryCommandEnabled(u)?0:-1;t>-1&&(t=h.queryCommandState(u)?1:0)}catch(l){}}else c||(t=u.call(w,f,s));o.toggleClass("disabled",c||t<0).toggleClass(e,t>0)}};yr=function(t){var e,u,f,i,o="li,ul,ol";if(!t.originalEvent.defaultPrevented)return w.closeDropDown(),e=n(lt).closest("code,blockquote,pre,"+o).first(),t.which===13&&e.length&&!e.is(o)?(ut=null,u=rt[0].createElement("br"),b.insertNode(u),h||(f=u.parentNode,i=f.lastChild,i&&i.nodeType===3&&i.nodeValue===""&&(f.removeChild(i),i=f.lastChild),!r.isInline(f,!0)&&i===u&&r.isInline(u.previousSibling)&&b.insertHTML("<br>")),!1):void 0};wt=function(){var i,u,t,f=k[0];r.rTraverse(f,function(e){return i=e.nodeName.toLowerCase(),n.inArray(i,oi)>-1&&(u=!0),e.nodeType===3&&!/^\s*$/.test(e.nodeValue)||i==="br"||h&&!e.firstChild&&!r.isInline(e,!1)?(u&&(t=rt[0].createElement("p"),t.className="sceditor-nlf",t.innerHTML=h?"":"<br />",f.appendChild(t)),!1):void 0})};vi=function(){w.val(ot.val())};pr=function(){w.closeDropDown();ut=null};ri=function(){var n=p.height,t=p.width;w.maximize()?w.dimensions("100%","100%",!1):(n&&n.toString().indexOf("%")>-1||t&&t.toString().indexOf("%")>-1)&&w.dimensions(t,n)};w._=function(){var t,n=arguments;return ht&&ht[n[0]]&&(n[0]=ht[n[0]]),n[0].replace(/\{(\d+)\}/g,function(i,r){return n[+r+1]!==t?n[+r+1]:"{"+r+"}"})};ii=function(t){tt.call(t.type+"Event",t,w);var r=t.target===nt?"scesrc":"scewys",i=n.Event(t);i.type=r+t.type;d.trigger(i,w)};w.bind=function(t,i,r,u){t=t.split(" ");for(var f=t.length;f--;)n.isFunction(i)&&(r||d.bind("scewys"+t[f],i),u||d.bind("scesrc"+t[f],i),t[f]==="valuechanged"&&(ft.hasHandler=!0));return w};w.unbind=function(t,i,r,u){t=t.split(" ");for(var f=t.length;f--;)n.isFunction(i)&&(r||d.unbind("scewys"+t[f],i),u||d.unbind("scesrc"+t[f],i));return w};w.blur=function(t,i,r){return n.isFunction(t)?w.bind("blur",t,i,r):w.sourceMode()?g.blur():k.blur(),w};w.focus=function(t,i,r){if(n.isFunction(t))w.bind("focus",t,i,r);else if(w.inSourceMode())nt.focus();else{var f,u=b.selectedRange();gt||b.hasSelection()||bi();!h&&u&&u.endOffset===1&&u.collapsed&&(f=u.endContainer,f&&f.childNodes.length===1&&n(f.firstChild).is("br")&&(u.setStartBefore(f.firstChild),u.collapse(!0),b.selectRange(u)));st.contentWindow.focus();k[0].focus();ut&&(b.selectRange(ut),ut=null)}return w};w.keyDown=function(n,t,i){return w.bind("keydown",n,t,i)};w.keyPress=function(n,t,i){return w.bind("keypress",n,t,i)};w.keyUp=function(n,t,i){return w.bind("keyup",n,t,i)};w.nodeChanged=function(n){return w.bind("nodechanged",n,!1,!0)};w.selectionChanged=function(n){return w.bind("selectionchanged",n,!1,!0)};w.valueChanged=function(n,t,i){return w.bind("valuechanged",n,t,i)};ki=function(t){var r,f=0,i=w.emoticonsCache,u=String.fromCharCode(t.which);if(!n(lt).is("code")&&!n(lt).parents("code").length)return(i||(i=[],n.each(n.extend({},p.emoticons.more,p.emoticons.dropdown,p.emoticons.hidden),function(n,t){i[f++]=[n,c("emoticon",{key:n,url:t.url||t,tooltip:t.tooltip||n})]}),i.sort(function(n,t){return n[0].length-t[0].length}),w.emoticonsCache=i,w.longestEmoticonCode=i[i.length-1][0].length),r=b.raplaceKeyword(w.emoticonsCache,!0,!0,w.longestEmoticonCode,p.emoticonsCompat,u),r&&p.emoticonsCompat)?(vt=k.find("img[data-sceditor-emoticon]"),/^\s$/.test(u)):!r};kr=function(){if(vt.length){var u,t,f,i,r,o,s=w.currentBlockNode(),e=!1,h=/[^\s\xA0\u2002\u2003\u2009\u00a0]+/;vt=n.map(vt,function(c){return!c||!c.parentNode?null:n.contains(s,c)?(u=c.previousSibling,t=c.nextSibling,r=u.nodeValue,r===null&&(r=u.innerText||""),(!u||!h.test(u.nodeValue.slice(-1)))&&(!t||!h.test((t.nodeValue||"")[0])))?c:(f=c.parentNode,i=b.cloneSelected(),o=i.startContainer,r=r+n(c).data("sceditor-emoticon"),o===t?e=r.length+i.startOffset:o===s&&s.childNodes[i.startOffset]===t?e=r.length:o===u&&(e=i.startOffset),t&&t.nodeType===3||(t=f.insertBefore(f.ownerDocument.createTextNode(""),t)),t.insertData(0,r),f.removeChild(u),f.removeChild(c),e!==!1&&(i.setStart(t,e),i.collapse(!0),b.selectRange(i)),null):c})}};w.emoticons=function(t){return!t&&t!==!1?p.emoticonsEnabled:(p.emoticonsEnabled=t,t?(k.keypress(ki),w.sourceMode()||(b.saveRange(),ti(k[0]),vt=k.find("img[data-sceditor-emoticon]"),ft(!1),b.restoreRange())):(k.find("img[data-sceditor-emoticon]").replaceWith(function(){return n(this).data("sceditor-emoticon")}),vt=[],k.unbind("keypress",ki),ft()),w)};w.css=function(t){return(at||(at=n('<style id="#inline" />',rt[0]).appendTo(rt.find("head"))[0]),typeof t!="string")?at.styleSheet?at.styleSheet.cssText:at.innerHTML:(at.styleSheet?at.styleSheet.cssText=t:at.innerHTML=t,w)};ai=function(n){var t=[],u={"`":"~","1":"!","2":"@","3":"#","4":"$","5":"%","6":"^","7":"&","8":"*","9":"(","0":")","-":"_","=":"+",";":": ","'":'"',",":"<",".":">","/":"?","\\":"|","[":"{","]":"}"},f={109:"-",110:"del",111:"/",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9"},i=n.which,r={8:"backspace",9:"tab",13:"enter",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",91:"win",92:"win",93:"select",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scrolllock",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"}[i]||String.fromCharCode(i).toLowerCase();return n.ctrlKey&&t.push("ctrl"),n.altKey&&t.push("alt"),n.shiftKey&&(t.push("shift"),f[i]?r=f[i]:u[r]&&(r=u[r])),r&&(i<16||i>18)&&t.push(r),t=t.join("+"),dt[t]?dt[t].call(w):void 0};w.addShortcut=function(n,t){return n=n.toLowerCase(),dt[n]=typeof t=="string"?function(){return ci(ni[t],w.commands[t]),!1}:t,w};w.removeShortcut=function(n){return delete dt[n.toLowerCase()],w};vr=function(t){var i,o,f,r,u;if(!p.disableBlockRemove&&t.which===8&&(r=b.selectedRange())&&(e.getSelection?(i=r.startContainer,o=r.startOffset):(i=r.parentElement(),f=rt[0].selection.createRange(),f.moveToElementText(i),f.setEndPoint("EndToStart",r),o=f.text.length),o===0&&(u=di()))){while(i!==u){while(i.previousSibling)if(i=i.previousSibling,i.nodeType!==3||i.nodeValue)return;if(!(i=i.parentNode))return}if(u&&!n(u).is("body"))return w.clearBlockFormatting(u),!1}};di=function(){for(var t=lt;!r.hasStyling(t)||r.isInline(t,!0);)if(!(t=t.parentNode)||n(t).is("body"))return;return t};w.clearBlockFormatting=function(t){return(t=t||di(),!t||n(t).is("body"))?w:(b.saveRange(),t.className="",ut=null,n(t).attr("style",""),n(t).is("p,div,td")||r.convertElement(t,"p"),b.restoreRange(),w)};ft=function(t){if(tt&&(tt.hasHandler("valuechangedEvent")||ft.hasHandler)){var i,r=w.sourceMode(),u=!r&&b.hasSelection();t=t!==!1&&!rt[0].getElementById("sceditor-start-marker");et.timer&&(clearTimeout(et.timer),et.timer=!1);u&&t&&b.saveRange();i=r?g.val():k.html();i!==ft.lastHtmlValue&&(ft.lastHtmlValue=i,d.trigger(n.Event("valuechanged",{rawValue:r?w.val():i})));u&&t&&b.removeMarkers()}};ui=function(){et.timer&&ft()};et=function(n){var t=n.which,i=et.lastChar,r=i===13||i===32,u=i===8||i===46;et.lastChar=t;t===13||t===32?r?et.triggerNextChar=!0:ft():t===8||t===46?u?et.triggerNextChar=!0:ft():et.triggerNextChar&&(ft(),et.triggerNextChar=!1);et.timer&&clearTimeout(et.timer);et.timer=setTimeout(function(){ft()},1500)};fi=function(){hi||w.updateOriginal();hi=!1};nr()};return u.locale={},u.command={get:function(n){return u.commands[n]||null},set:function(t,i){return!t||!i?!1:(i=n.extend(u.commands[t]||{},i),i.remove=function(){u.command.remove(t)},u.commands[t]=i,this)},remove:function(n){return u.commands[n]&&delete u.commands[n],this}},u}.call(t,i,t,n),r!==undefined&&(n.exports=r))},function(n,t,i){var r;!(r=function(){"use strict";var n={},t=function(t){var r=this,i=[],u=function(n){return"signal"+n.charAt(0).toUpperCase()+n.slice(1)},f=function(n,r){n=[].slice.call(n);for(var e,o=u(n.shift()),f=0;f<i.length;f++)if(o in i[f]&&(e=i[f][o].apply(t,n),r))return e};r.call=function(){f(arguments,!1)};r.callOnlyFirst=function(){return f(arguments,!0)};r.hasHandler=function(n){var t=i.length;for(n=u(n);t--;)if(n in i[t])return!0;return!1};r.exists=function(t){return t in n?(t=n[t],typeof t=="function"&&typeof t.prototype=="object"):!1};r.isRegistered=function(t){if(r.exists(t))for(var u=i.length;u--;)if(i[u]instanceof n[t])return!0;return!1};r.register=function(u){return!r.exists(u)||r.isRegistered(u)?!1:(u=new n[u],i.push(u),"init"in u&&u.init.call(t),!0)};r.deregister=function(u){var f,e=i.length,o=!1;if(!r.isRegistered(u))return o;while(e--)i[e]instanceof n[u]&&(f=i.splice(e,1)[0],o=!0,"destroy"in f&&f.destroy.call(t));return o};r.destroy=function(){for(var n=i.length;n--;)"destroy"in i[n]&&i[n].destroy.call(t);i=[];t=null}};return t.plugins=n,t}.call(t,i,t,n),r!==undefined&&(n.exports=r))},function(n,t,i){var r;!(r=function(n,t){"use strict";var u=i(1),r=navigator.userAgent;t.ie=function(){var r,n=3,t=document,i=t.createElement("div"),u=i.getElementsByTagName("i");do i.innerHTML="<!--[if gt IE "+ ++n+"]><i><\/i><![endif]-->";while(u[0]);return t.documentMode&&t.all&&window.atob&&(n=10),n===4&&t.documentMode&&(n=11),n>4?n:r}();t.ios=/iPhone|iPod|iPad| wosbrowser\//i.test(r);t.isWysiwygSupported=function(){var i,n,e,f=u('<p contenteditable="true">')[0].contentEditable;return f===e&&f==="inherit"?!1:(n=/Opera Mobi|Opera Mini/i.test(r),/Android/i.test(r)&&(n=!0,/Safari/.test(r)&&(i=/Safari\/(\d+)/.exec(r),n=!i||!i[1]?!0:i[1]<534)),/ Silk\//i.test(r)&&(i=/AppleWebKit\/(\d+)/.exec(r),n=!i||!i[1]?!0:i[1]<534),t.ios&&(n=/OS [0-4](_\d)+ like Mac/i.test(r)),/Firefox/i.test(r)&&(n=!1),/OneBrowser/i.test(r)&&(n=!1),navigator.vendor==="UCWEB"&&(n=!1),!n)}()}.call(t,i,t,n),r!==undefined&&(n.exports=r))},function(n,t,i){var r;!(r=function(n,t){"use strict";var i=/^(?:https?|s?ftp|mailto|spotify|skype|ssh|teamspeak|tel):|(?:\/\/)/i;t.regex=function(n){return n.replace(/([\-.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")};t.entities=function(n,t){if(!n)return n;var i={"&":"&amp;","<":"&lt;",">":"&gt;","  ":" &nbsp;","\r\n":"\n","\r":"\n","\n":"<br />"};return t!==!1&&(i['"']="&#34;",i["'"]="&#39;",i["`"]="&#96;"),n.replace(/ {2}|\r\n|[&<>\r\n'"`]/g,function(n){return i[n]||n})};t.uriScheme=function(n){var t,r=window.location;return!n||!/^[^\/]*:/i.test(n)||i.test(n)?n:(t=r.pathname.split("/"),t.pop(),r.protocol+"//"+r.host+t.join("/")+"/"+n)}}.call(t,i,t,n),r!==undefined&&(n.exports=r))},function(n,t,i){var r;!(r=function(){"use strict";var n=i(1),f=i(4).ie,r=i(10),u=f&&f<11,t={bold:{exec:"bold",tooltip:"Bold",shortcut:"ctrl+b"},italic:{exec:"italic",tooltip:"Italic",shortcut:"ctrl+i"},underline:{exec:"underline",tooltip:"Underline",shortcut:"ctrl+u"},strike:{exec:"strikethrough",tooltip:"Strikethrough"},subscript:{exec:"subscript",tooltip:"Subscript"},superscript:{exec:"superscript",tooltip:"Superscript"},left:{exec:"justifyleft",tooltip:"Align left"},center:{exec:"justifycenter",tooltip:"Center"},right:{exec:"justifyright",tooltip:"Align right"},justify:{exec:"justifyfull",tooltip:"Justify"},font:{_dropDown:function(t,i,u){for(var f=0,e=t.opts.fonts.split(","),o=n("<div />"),s=function(){return u(n(this).data("font")),t.closeDropDown(!0),!1};f<e.length;f++)o.append(r("fontOpt",{font:e[f]},!0).click(s));t.createDropDown(i,"font-picker",o)},exec:function(n){var i=this;t.font._dropDown(i,n,function(n){i.execCommand("fontname",n)})},tooltip:"Font Name"},size:{_dropDown:function(t,i,u){for(var e=n("<div />"),o=function(i){u(n(this).data("size"));t.closeDropDown(!0);i.preventDefault()},f=1;f<=7;f++)e.append(r("sizeOpt",{size:f},!0).click(o));t.createDropDown(i,"fontsize-picker",e)},exec:function(n){var i=this;t.size._dropDown(i,n,function(n){i.execCommand("fontsize",n)})},tooltip:"Font Size"},color:{_dropDown:function(i,r,u){var e,o,h,c,f={r:255,g:255,b:255},v=n("<div />"),l=i.opts.colors?i.opts.colors.split("|"):new Array(21),s=[],a=t.color;if(!a._htmlCache){for(e=0;e<l.length;++e){for(c=l[e]?l[e].split(","):new Array(21),s.push('<div class="sceditor-color-column">'),o=0;o<c.length;++o)h=c[o]||"#"+f.r.toString(16)+f.g.toString(16)+f.b.toString(16),s.push('<a href="#" class="sceditor-color-option" style="background-color: '+h+'" data-color="'+h+'"><\/a>'),o%5==0?(f.g-=51,f.b=255):f.b-=51;s.push("<\/div>");e%5==0?(f.r-=51,f.g=255,f.b=255):(f.g=255,f.b=255)}a._htmlCache=s.join("")}v.append(a._htmlCache).find("a").click(function(t){u(n(this).attr("data-color"));i.closeDropDown(!0);t.preventDefault()});i.createDropDown(r,"color-picker",v)},exec:function(n){var i=this;t.color._dropDown(i,n,function(n){i.execCommand("forecolor",n)})},tooltip:"Font Color"},removeformat:{exec:"removeformat",tooltip:"Remove Formatting"},cut:{exec:"cut",tooltip:"Cut",errorMessage:"Your browser does not allow the cut command. Please use the keyboard shortcut Ctrl/Cmd-X"},copy:{exec:"copy",tooltip:"Copy",errorMessage:"Your browser does not allow the copy command. Please use the keyboard shortcut Ctrl/Cmd-C"},paste:{exec:"paste",tooltip:"Paste",errorMessage:"Your browser does not allow the paste command. Please use the keyboard shortcut Ctrl/Cmd-V"},pastetext:{exec:function(n){var u,i,t=this;i=r("pastetext",{label:t._("Paste your text inside the following box:"),insert:t._("Insert")},!0);i.find(".button").click(function(n){u=i.find("#txt").val();u&&t.wysiwygEditorInsertText(u);t.closeDropDown(!0);n.preventDefault()});t.createDropDown(n,"pastetext",i)},tooltip:"Paste Text"},bulletlist:{exec:"insertunorderedlist",tooltip:"Bullet list"},orderedlist:{exec:"insertorderedlist",tooltip:"Numbered list"},indent:{state:function(t,i){var r,f,u,e=n(i),o=e.parents("ul,ol,menu"),s=o.first();if(o.length>1||s.children().length>1)return 0;if(e.is("ul,ol,menu"))if(r=this.getRangeHelper().selectedRange(),window.Range&&r instanceof Range){if(f=r.startContainer.parentNode,u=r.endContainer.parentNode,f!==f.parentNode.firstElementChild||n(u).is("li")&&u!==u.parentNode.lastElementChild)return 0}else return e.is("li,ul,ol,menu")?0:-1;return-1},exec:function(){var t=this,i=n(t.getRangeHelper().getFirstBlockParent());t.focus();i.parents("ul,ol,menu")&&t.execCommand("indent")},tooltip:"Add indent"},outdent:{state:function(t,i){return n(i).is("ul,ol,menu")||n(i).parents("ul,ol,menu").length>0?0:-1},exec:function(){var t=this,i=n(t.getRangeHelper().getFirstBlockParent());i.parents("ul,ol,menu")&&t.execCommand("outdent")},tooltip:"Remove one indent"},table:{forceNewLineAfter:["table"],exec:function(n){var t=this,i=r("table",{rows:t._("Rows:"),cols:t._("Cols:"),insert:t._("Insert")},!0);i.find(".button").click(function(n){var f,e,o=i.find("#rows").val()-0,s=i.find("#cols").val()-0,r="<table>";if(!(o<1)&&!(s<1)){for(f=0;f<o;f++){for(r+="<tr>",e=0;e<s;e++)r+="<td>"+(u?"":"<br />")+"<\/td>";r+="<\/tr>"}r+="<\/table>";t.wysiwygEditorInsertHtml(r);t.closeDropDown(!0);n.preventDefault()}});t.createDropDown(n,"inserttable",i)},tooltip:"Insert a table"},horizontalrule:{exec:"inserthorizontalrule",tooltip:"Insert a horizontal rule"},code:{forceNewLineAfter:["code"],exec:function(){this.wysiwygEditorInsertHtml("<code>",(u?"":"<br />")+"<\/code>")},tooltip:"Code"},image:{exec:function(n){var t=this,i=r("image",{url:t._("URL:"),width:t._("Width (optional):"),height:t._("Height (optional):"),insert:t._("Insert")},!0);i.find(".button").click(function(n){var u=i.find("#image").val(),f=i.find("#width").val(),e=i.find("#height").val(),r="";f&&(r+=' width="'+f+'"');e&&(r+=' height="'+e+'"');u&&t.wysiwygEditorInsertHtml("<img"+r+' src="'+u+'" />');t.closeDropDown(!0);n.preventDefault()});t.createDropDown(n,"insertimage",i)},tooltip:"Insert an image"},email:{exec:function(n){var t=this,i=r("email",{label:t._("E-mail:"),desc:t._("Description (optional):"),insert:t._("Insert")},!0);i.find(".button").click(function(n){var r=i.find("#email").val(),u=i.find("#des").val();r&&(t.focus(),!t.getRangeHelper().selectedHtml()||u?(u=u||r,t.wysiwygEditorInsertHtml('<a href="mailto:'+r+'">'+u+"<\/a>")):t.execCommand("createlink","mailto:"+r));t.closeDropDown(!0);n.preventDefault()});t.createDropDown(n,"insertemail",i)},tooltip:"Insert an email"},link:{exec:function(n){var t=this,i=r("link",{url:t._("URL:"),desc:t._("Description (optional):"),ins:t._("Insert")},!0);i.find(".button").click(function(n){var r=i.find("#link").val(),u=i.find("#des").val();r&&(t.focus(),!t.getRangeHelper().selectedHtml()||u?(u=u||r,t.wysiwygEditorInsertHtml('<a href="'+r+'">'+u+"<\/a>")):t.execCommand("createlink",r));t.closeDropDown(!0);n.preventDefault()});t.createDropDown(n,"insertlink",i)},tooltip:"Insert a link"},unlink:{state:function(){var t=n(this.currentNode());return t.is("a")||t.parents("a").length>0?0:-1},exec:function(){var t=n(this.currentNode()),i=t.is("a")?t:t.parents("a").first();i.length&&i.replaceWith(i.contents())},tooltip:"Unlink"},quote:{forceNewLineAfter:["blockquote"],exec:function(n,t,i){var f="<blockquote>",r="<\/blockquote>";t?(i=i?"<cite>"+i+"<\/cite>":"",f=f+i+t+r,r=null):this.getRangeHelper().selectedHtml()===""&&(r=(u?"":"<br />")+r);this.wysiwygEditorInsertHtml(f,r)},tooltip:"Insert a Quote"},emoticon:{exec:function(t){var i=this,r=function(u){var s,h=i.opts.emoticonsCompat,c=i.getRangeHelper(),a=h&&c.getOuterText(!0,1)!==" "?" ":"",v=h&&c.getOuterText(!1,1)!==" "?" ":"",f=n("<div />"),o=n("<div />").appendTo(f),e=0,l=n.extend({},i.opts.emoticons.dropdown,u?i.opts.emoticons.more:{});return n.each(l,function(){e++}),e=Math.sqrt(e),n.each(l,function(t,r){o.append(n("<img />").attr({src:r.url||r,alt:t,title:r.tooltip||t}).click(function(){return i.insert(a+n(this).attr("alt")+v,null,!1).closeDropDown(!0),!1}));o.children().length>=e&&(o=n("<div />").appendTo(f))}),u||(s=n('<a class="sceditor-more">'+i._("More")+"<\/a>").click(function(){return i.createDropDown(t,"more-emoticons",r(!0)),!1}),f.append(s)),f};i.createDropDown(t,"emoticons",r(!1))},txtExec:function(n){t.emoticon.exec.call(this,n)},tooltip:"Insert an emoticon"},youtube:{_dropDown:function(n,t,i){var u,f=r("youtubeMenu",{label:n._("Video URL:"),insert:n._("Insert")},!0);f.find(".button").click(function(t){var r=f.find("#link").val();r&&(u=r.match(/(?:v=|v\/|embed\/|youtu.be\/)(.{11})/),u&&(r=u[1]),/^[a-zA-Z0-9_\-]{11}$/.test(r)?i(r):alert("Invalid YouTube video"));n.closeDropDown(!0);t.preventDefault()});n.createDropDown(t,"insertlink",f)},exec:function(n){var i=this;t.youtube._dropDown(i,n,function(n){i.wysiwygEditorInsertHtml(r("youtube",{id:n}))})},tooltip:"Insert a YouTube video"},date:{_date:function(n){var u=new Date,t=u.getYear(),i=u.getMonth()+1,r=u.getDate();return t<2e3&&(t=1900+t),i<10&&(i="0"+i),r<10&&(r="0"+r),n.opts.dateFormat.replace(/year/i,t).replace(/month/i,i).replace(/day/i,r)},exec:function(){this.insertText(t.date._date(this))},txtExec:function(){this.insertText(t.date._date(this))},tooltip:"Insert current date"},time:{_time:function(){var r=new Date,n=r.getHours(),t=r.getMinutes(),i=r.getSeconds();return n<10&&(n="0"+n),t<10&&(t="0"+t),i<10&&(i="0"+i),n+":"+t+":"+i},exec:function(){this.insertText(t.time._time())},txtExec:function(){this.insertText(t.time._time())},tooltip:"Insert current time"},ltr:{state:function(n,t){return t&&t.style.direction==="ltr"},exec:function(){var r=this,i=r.getRangeHelper().getFirstBlockParent(),t=n(i);(r.focus(),i&&!t.is("body")||(r.execCommand("formatBlock","p"),i=r.getRangeHelper().getFirstBlockParent(),t=n(i),i&&!t.is("body")))&&(t.css("direction")==="ltr"?t.css("direction",""):t.css("direction","ltr"))},tooltip:"Left-to-Right"},rtl:{state:function(n,t){return t&&t.style.direction==="rtl"},exec:function(){var r=this,i=r.getRangeHelper().getFirstBlockParent(),t=n(i);(r.focus(),i&&!t.is("body")||(r.execCommand("formatBlock","p"),i=r.getRangeHelper().getFirstBlockParent(),t=n(i),i&&!t.is("body")))&&(t.css("direction")==="rtl"?t.css("direction",""):t.css("direction","rtl"))},tooltip:"Right-to-Left"},print:{exec:"print",tooltip:"Print"},maximize:{state:function(){return this.maximize()},exec:function(){this.maximize(!this.maximize())},txtExec:function(){this.maximize(!this.maximize())},tooltip:"Maximize",shortcut:"ctrl+shift+m"},source:{state:function(){return this.sourceMode()},exec:function(){this.toggleSourceMode()},txtExec:function(){this.toggleSourceMode()},tooltip:"View source",shortcut:"ctrl+shift+s"},ignore:{}};return t}.call(t,i,t,n),r!==undefined&&(n.exports=r))},function(n,t,i){var r;!(r=function(){"use strict";var n=i(1);return{toolbar:"bold,italic,underline,strike,subscript,superscript|left,center,right,justify|font,size,color,removeformat|cut,copy,paste,pastetext|bulletlist,orderedlist,indent,outdent|table|code,quote|horizontalrule,image,email,link,unlink|emoticon,youtube,date,time|ltr,rtl|print,maximize,source",toolbarExclude:null,style:"jquery.sceditor.default.css",fonts:"Arial,Arial Black,Comic Sans MS,Courier New,Georgia,Impact,Sans-serif,Serif,Times New Roman,Trebuchet MS,Verdana",colors:null,locale:n("html").attr("lang")||"en",charset:"utf-8",emoticonsCompat:!1,emoticonsEnabled:!0,emoticonsRoot:"",emoticons:{dropdown:{":)":"emoticons/smile.png",":angel:":"emoticons/angel.png",":angry:":"emoticons/angry.png","8-)":"emoticons/cool.png",":'(":"emoticons/cwy.png",":ermm:":"emoticons/ermm.png",":D":"emoticons/grin.png","<3":"emoticons/heart.png",":(":"emoticons/sad.png",":O":"emoticons/shocked.png",":P":"emoticons/tongue.png",";)":"emoticons/wink.png"},more:{":alien:":"emoticons/alien.png",":blink:":"emoticons/blink.png",":blush:":"emoticons/blush.png",":cheerful:":"emoticons/cheerful.png",":devil:":"emoticons/devil.png",":dizzy:":"emoticons/dizzy.png",":getlost:":"emoticons/getlost.png",":happy:":"emoticons/happy.png",":kissing:":"emoticons/kissing.png",":ninja:":"emoticons/ninja.png",":pinch:":"emoticons/pinch.png",":pouty:":"emoticons/pouty.png",":sick:":"emoticons/sick.png",":sideways:":"emoticons/sideways.png",":silly:":"emoticons/silly.png",":sleeping:":"emoticons/sleeping.png",":unsure:":"emoticons/unsure.png",":woot:":"emoticons/w00t.png",":wassat:":"emoticons/wassat.png"},hidden:{":whistling:":"emoticons/whistling.png",":love:":"emoticons/wub.png"}},width:null,height:null,resizeEnabled:!0,resizeMinWidth:null,resizeMinHeight:null,resizeMaxHeight:null,resizeMaxWidth:null,resizeHeight:!0,resizeWidth:!0,dateFormat:"year-month-day",toolbarContainer:null,enablePasteFiltering:!1,disablePasting:!1,readOnly:!1,rtl:!1,autofocus:!1,autofocusEnd:!0,autoExpand:!1,autoUpdate:!1,spellcheck:!0,runWithoutWysiwygSupport:!1,id:null,plugins:"",zIndex:null,bbcodeTrim:!1,disableBlockRemove:!1,parserOptions:{},dropDownCss:{}}}.call(t,i,t,n),r!==undefined&&(n.exports=r))},function(n,t,i){var r;!(r=function(){"use strict";var n=i(1),t=i(9),f=i(5),e=i(4),r=e.ie,o=r&&r<11,u=function(t){return n("<p>",t.ownerDocument).append(t).html()};return function(i,e){var a,v,b,c=e||i.contentDocument||i.document,y=i,h=!!i.getSelection,p="sceditor-start-marker",w="sceditor-end-marker",l="character",s=this;s.insertHTML=function(n,t){var r,i,u=s.selectedRange();if(!u)return!1;if(h){for(t&&(n+=s.selectedHtml()+t),i=c.createElement("p"),r=c.createDocumentFragment(),i.innerHTML=n;i.firstChild;)r.appendChild(i.firstChild);s.insertNode(r)}else u.pasteHTML(b(n,t,!0)),s.restoreRange()};b=function(i,u,f){var e,h,l=c.createElement("div"),o=n(l);if(typeof i=="string"?(u&&(i+=s.selectedHtml()+u),o.html(i)):(o.append(i),u&&o.append(s.selectedRange().extractContents()).append(u)),e=l.lastChild){while(!t.isInline(e.lastChild,!0))e=e.lastChild;return(t.canHaveChildren(e)&&(h=n(e),e.lastChild||h.append("​")),r&&r<9&&n(e).is("img")&&o.append("​"),s.removeMarkers(),(h||o).append(a(p)).append(a(w)),f)?o.html():n(c.createDocumentFragment()).append(o.contents())[0]}};s.insertNode=function(n,i){if(h){var f=b(n,i),e=s.selectedRange(),r=e.commonAncestorContainer;if(!f)return!1;e.deleteContents();r&&r.nodeType!==3&&!t.canHaveChildren(r)?r.parentNode.insertBefore(f,r):e.insertNode(f);s.restoreRange()}else s.insertHTML(u(n),i?u(i):null)};s.cloneSelected=function(){var n=s.selectedRange();if(n)return h?n.cloneRange():n.duplicate()};s.selectedRange=function(){var n,i,t=h?y.getSelection():c.selection;if(t){if(t.getRangeAt&&t.rangeCount<=0){for(i=c.body;i.firstChild;)i=i.firstChild;n=c.createRange();n.setStart(i,0);t.addRange(n)}return h&&(n=t.getRangeAt(0)),h||t.type==="Control"||(n=t.createRange()),v(n)?n:null}};v=function(n){var t;return n&&!h&&(t=n.parentElement()),t?t.ownerDocument===c:!0};s.hasSelection=function(){var n=h?y.getSelection():c.selection;return h||!n?n&&n.rangeCount>0:n.type!=="None"&&v(n.createRange())};s.selectedHtml=function(){var t,n=s.selectedRange();if(n){if(h)return t=c.createElement("p"),t.appendChild(n.cloneContents()),t.innerHTML;if(n.text!==""&&n.htmlText)return n.htmlText}return""};s.parentNode=function(){var n=s.selectedRange();if(n)return n.parentElement?n.parentElement():n.commonAncestorContainer};s.getFirstBlockParent=function(n){var i=function(n){return t.isInline(n,!0)?(n=n?n.parentNode:null,n?i(n):n):n};return i(n||s.parentNode())};s.insertNodeAt=function(n,t){var r=s.selectedRange(),i=s.cloneSelected();if(!i)return!1;i.collapse(n);h?i.insertNode(t):i.pasteHTML(u(t));s.selectRange(r)};a=function(n){s.removeMarker(n);var t=c.createElement("span");return t.id=n,t.style.lineHeight="0",t.style.display="none",t.className="sceditor-selection sceditor-ignore",t.innerHTML=" ",t};s.insertMarkers=function(){s.insertNodeAt(!0,a(p));s.insertNodeAt(!1,a(w))};s.getMarker=function(n){return c.getElementById(n)};s.removeMarker=function(n){var t=s.getMarker(n);t&&t.parentNode.removeChild(t)};s.removeMarkers=function(){s.removeMarker(p);s.removeMarker(w)};s.saveRange=function(){s.insertMarkers()};s.selectRange=function(i){var r,e,u,f;if(h){if(e=y.getSelection(),u=i.endContainer,!o&&i.collapsed&&u&&!t.isInline(u,!0)){for(r=u.lastChild;r&&n(r).is(".sceditor-ignore");)r=r.previousSibling;n(r).is("br")&&(f=c.createRange(),f.setEndAfter(r),f.collapse(!1),s.compare(i,f)&&(i.setStartBefore(r),i.collapse(!0)))}e&&(s.clear(),e.addRange(i))}else i.select()};s.restoreRange=function(){var u,o,e,i=s.selectedRange(),r=s.getMarker(p),f=s.getMarker(w);if(!r||!f||!i)return!1;o=r.nextSibling===f;h?(i=c.createRange(),i.setStartBefore(r),i.setEndAfter(f)):(i=c.body.createTextRange(),u=c.body.createTextRange(),e=r.previousSibling,r.nextSibling!==f||e&&t.isInline(e,!0)&&!n(e).is("br")||n(r).before("​"),u.moveToElementText(r),i.setEndPoint("StartToStart",u),i.moveStart(l,0),u.moveToElementText(f),i.setEndPoint("EndToStart",u),i.moveEnd(l,0));o&&i.collapse(!0);s.selectRange(i);s.removeMarkers()};s.selectOuterText=function(n,t){var i=s.cloneSelected();if(!i)return!1;i.collapse(!1);h?(i.setStart(i.startContainer,i.startOffset-n),i.setEnd(i.endContainer,i.endOffset+t)):(i.moveStart(l,0-n),i.moveEnd(l,t));s.selectRange(i)};s.getOuterText=function(n,t){var f,i,u="",r=s.cloneSelected();return r?(r.collapse(!n),h?(f=r.startContainer.textContent,i=r.startOffset,n&&(i=i-t,i<0&&(t+=i,i=0)),u=f.substr(i,t)):(n?r.moveStart(l,0-t):r.moveEnd(l,t),u=r.text),u):""};s.raplaceKeyword=function(n,t,i,r,u,e){i||n.sort(function(n,t){return n[0].length-t[0].length});var w,l,o,a,c,b,v,y,d="[\\s    ]",p=n.length,k=r||n[p-1][0].length;if(u){if(!h)return!1;k++}for(e=e||"",w=s.getOuterText(!0,k),c=w.length,l=w+e,t&&(l+=s.getOuterText(!1,k));p--;)if(v=n[p][0],y=v.length,a=c-1-y,o=u?l.substr(Math.max(0,a-1)).search(new RegExp("(?:"+d+")"+f.regex(v)+"(?="+d+")")):l.indexOf(v,a),o>-1){if(u&&(o+=a+1),o>c||o+y+(u?1:0)<c)continue;return b=c-o,s.selectOuterText(b,y-b-(/^\S/.test(e)?1:0)),s.insertHTML(n[p][1]),!0}return!1};s.compare=function(n,t){var r=h?Range.END_TO_END:"EndToEnd",u=h?Range.START_TO_START:"StartToStart",i=h?"compareBoundaryPoints":"compareEndPoints";return(t||(t=s.selectedRange()),!n||!t)?!n&&!t:v(n)&&v(t)&&n[i](r,t)===0&&n[i](u,t)===0};s.clear=function(){var n=h?y.getSelection():c.selection;n&&(n.removeAllRanges?n.removeAllRanges():n.empty&&n.empty())}}}.call(t,i,t,n),r!==undefined&&(n.exports=r))},function(n,t,i){var r;!(r=function(){"use strict";var t=i(1),u=i(4),r={},n={traverse:function(t,i,r,u,f){if(t)for(t=f?t.lastChild:t.firstChild;t;){var e=f?t.previousSibling:t.nextSibling;if(!r&&i(t)===!1||!u&&n.traverse(t,i,r,u,f)===!1||r&&i(t)===!1)return!1;t=e}},rTraverse:function(n,t,i,r){this.traverse(n,t,i,r,!0)},parseHTML:function(n,i){var r=[],u=(i||document).createElement("div");return u.innerHTML=n,t.merge(r,u.childNodes),r},hasStyling:function(n){var i=t(n);return n&&(!i.is("p,div")||n.className||i.attr("style")||!t.isEmptyObject(i.data()))},convertElement:function(t,i){for(var e,r,o=t.attributes,s=o.length,f=t.ownerDocument.createElement(i);s--;)r=o[s],(!u.ie||r.specified)&&(u.ie<8&&/style/i.test(r.name)?n.copyCSS(t,f):f.setAttribute(r.name,r.value));while(e=t.firstChild)f.appendChild(e);return t.parentNode.replaceChild(f,t),f},blockLevelList:"|body|hr|p|div|h1|h2|h3|h4|h5|h6|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|blockquote|center|",canHaveChildren:function(n){return/11?|9/.test(n.nodeType)?"|iframe|area|base|basefont|br|col|frame|hr|img|input|isindex|link|meta|param|command|embed|keygen|source|track|wbr|".indexOf("|"+n.nodeName.toLowerCase()+"|")<0:!1},isInline:function(t,i){var r,u=(t||{}).nodeType||3;return u!==1?u===3:(r=t.tagName.toLowerCase(),r==="code")?!i:n.blockLevelList.indexOf("|"+r+"|")<0},copyCSS:function(n,t){t.style.cssText=n.style.cssText+t.style.cssText},fixNesting:function(t){var i=function(t){while(n.isInline(t.parentNode,!0))t=t.parentNode;return t};n.traverse(t,function(t){if(t.nodeType===1&&!n.isInline(t,!0)&&n.isInline(t.parentNode,!0)){var r=i(t),u=r.parentNode,e=n.extractContents(r,t),f=t;n.copyCSS(r,f);u.insertBefore(e,r);u.insertBefore(f,r)}})},findCommonAncestor:function(n,i){return t(n).parents().has(t(i)).first()},getSibling:function(t,i){return t?(i?t.previousSibling:t.nextSibling)||n.getSibling(t.parentNode,i):null},removeWhiteSpace:function(i,r){for(var f,h,c,e,o,l,y,a,v=n.getSibling,s=n.isInline,u=i.firstChild;u;){if(y=u.nextSibling,f=u.nodeValue,h=u.nodeType,h===1&&u.firstChild&&(l=t(u).css("whiteSpace"),/pre(\-wrap)?$/i.test(l)||n.removeWhiteSpace(u,/line$/i.test(l))),h===3&&f){for(c=v(u),e=v(u,!0),a=!1;t(e).hasClass("sceditor-ignore");)e=v(e,!0);if(s(u)&&e){for(o=e;o.lastChild;)o=o.lastChild;a=o.nodeType===3?/[\t\n\r ]$/.test(o.nodeValue):!s(o)}f=f.replace(/\u200B/g,"");e&&s(e)&&!a||(f=f.replace(r?/^[\t ]+/:/^[\t\n\r ]+/,""));c&&s(c)||(f=f.replace(r?/[\t ]+$/:/[\t\n\r ]+$/,""));f.length?u.nodeValue=f.replace(r?/[\t ]+/g:/[\t\n\r ]+/g," "):i.removeChild(u)}u=y}},extractContents:function(i,r){var u,o=n.findCommonAncestor(i,r).get(0),f=!1,e=!1;return u=function(o){var h,s=i.ownerDocument.createDocumentFragment();return n.traverse(o,function(n){if(e||n===r)return e=!0,!1;n===i&&(f=!0);t.contains(n,i)||f&&t.contains(n,r)?(h=n.cloneNode(!1),h.appendChild(u(n)),s.appendChild(h)):f&&!t.contains(s,n)&&s.appendChild(n)},!1),s},u(o)},getOffset:function(n){for(var t=0,i=0;n;)t+=n.offsetLeft,i+=n.offsetTop,n=n.offsetParent;return{left:t,top:i}},getStyle:function(n,i){var f,e,u,o=n.style;return o?(r[i]||(r[i]=t.camelCase(i)),i=r[i],u=o[i],"textAlign"===i&&((f=t(n),e=o.direction,u=u||f.css(i),f.parent().css(i)===u||f.css("display")!=="block"||f.is("hr")||f.is("th"))||e&&u&&(/right/i.test(u)&&e==="rtl"||/left/i.test(u)&&e==="ltr")))?"":u:""},hasStyle:function(i,r,u){var f=n.getStyle(i,r);return f?!u||f===u||t.isArray(u)&&t.inArray(f,u)>-1:!1}};return n}.call(t,i,t,n),r!==undefined&&(n.exports=r))},function(n,t,i){var r;!(r=function(){"use strict";var n={html:'<!DOCTYPE html><html{attrs}><head><style>.ie * {min-height: auto !important} .ie table td {height:15px}<\/style><meta http-equiv="Content-Type" content="text/html;charset={charset}" /><link rel="stylesheet" type="text/css" href="{style}" /><\/head><body contenteditable="true" {spellcheck}><p><\/p><\/body><\/html>',toolbarButton:'<a class="sceditor-button sceditor-button-{name}" data-sceditor-command="{name}" unselectable="on"><div unselectable="on">{dispName}<\/div><\/a>',emoticon:'<img src="{url}" data-sceditor-emoticon="{key}" alt="{key}" title="{tooltip}" />',fontOpt:'<a class="sceditor-font-option" href="#" data-font="{font}"><font face="{font}">{font}<\/font><\/a>',sizeOpt:'<a class="sceditor-fontsize-option" data-size="{size}" href="#"><font size="{size}">{size}<\/font><\/a>',pastetext:'<div><label for="txt">{label}<\/label> <textarea cols="20" rows="7" id="txt"><\/textarea><\/div><div><input type="button" class="button" value="{insert}" /><\/div>',table:'<div><label for="rows">{rows}<\/label><input type="text" id="rows" value="2" /><\/div><div><label for="cols">{cols}<\/label><input type="text" id="cols" value="2" /><\/div><div><input type="button" class="button" value="{insert}" /><\/div>',image:'<div><label for="link">{url}<\/label> <input type="text" id="image" placeholder="http://" /><\/div><div><label for="width">{width}<\/label> <input type="text" id="width" size="2" /><\/div><div><label for="height">{height}<\/label> <input type="text" id="height" size="2" /><\/div><div><input type="button" class="button" value="{insert}" /><\/div>',email:'<div><label for="email">{label}<\/label> <input type="text" id="email" /><\/div><div><label for="des">{desc}<\/label> <input type="text" id="des" /><\/div><div><input type="button" class="button" value="{insert}" /><\/div>',link:'<div><label for="link">{url}<\/label> <input type="text" id="link" placeholder="http://" /><\/div><div><label for="des">{desc}<\/label> <input type="text" id="des" /><\/div><div><input type="button" class="button" value="{ins}" /><\/div>',youtubeMenu:'<div><label for="link">{label}<\/label> <input type="text" id="link" placeholder="http://" /><\/div><div><input type="button" class="button" value="{insert}" /><\/div>',youtube:'<iframe width="560" height="315" src="https://www.youtube.com/embed/{id}?wmode=opaque" data-youtube-id="{id}" frameborder="0" allowfullscreen><\/iframe>'};return function(t,i,r){var u=n[t];return $.each(i,function(n,t){u=u.replace(new RegExp("\\{"+n+"\\}","g"),t)}),r&&(u=$(u)),u}}.call(t,i,t,n),r!==undefined&&(n.exports=r))}]),function(n,t,i){"use strict";var e=n.sceditor,f=e.plugins,s=e.escapeEntities,b=e.escapeUriScheme,a=e.ie,h=a&&a<11,l=e.command.get,k={bold:{txtExec:["[b]","[/b]"]},italic:{txtExec:["[i]","[/i]"]},underline:{txtExec:["[u]","[/u]"]},strike:{txtExec:["[s]","[/s]"]},subscript:{txtExec:["[sub]","[/sub]"]},superscript:{txtExec:["[sup]","[/sup]"]},left:{txtExec:["[left]","[/left]"]},center:{txtExec:["[center]","[/center]"]},right:{txtExec:["[right]","[/right]"]},justify:{txtExec:["[justify]","[/justify]"]},font:{txtExec:function(n){var t=this;l("font")._dropDown(t,n,function(n){t.insertText("[font="+n+"]","[/font]")})}},size:{txtExec:function(n){var t=this;l("size")._dropDown(t,n,function(n){t.insertText("[size="+n+"]","[/size]")})}},color:{txtExec:function(n){var t=this;l("color")._dropDown(t,n,function(n){t.insertText("[color="+n+"]","[/color]")})}},bulletlist:{txtExec:function(t,i){var r="";n.each(i.split(/\r?\n/),function(){r+=(r?"\n":"")+"[li]"+this+"[/li]"});this.insertText("[ul]\n"+r+"\n[/ul]")}},orderedlist:{txtExec:function(t,i){var r="";n.each(i.split(/\r?\n/),function(){r+=(r?"\n":"")+"[li]"+this+"[/li]"});f.bbcode.bbcode.get("");this.insertText("[ol]\n"+r+"\n[/ol]")}},table:{txtExec:["[table][tr][td]","[/td][/tr][/table]"]},horizontalrule:{txtExec:["[hr]"]},code:{txtExec:["[code]","[/code]"]},image:{txtExec:function(n,t){var i=this,r=prompt(i._("Enter the image URL:"),t);r&&i.insertText("[img]"+r+"[/img]")}},email:{txtExec:function(n,t){var r=this,u=t&&t.indexOf("@")>-1?null:t,i=prompt(r._("Enter the e-mail address:"),u?"":t),f=prompt(r._("Enter the displayed text:"),u||i)||i;i&&r.insertText("[email="+i+"]"+f+"[/email]")}},link:{txtExec:function(t,i){var u=this,f=/^[a-z]+:\/\//i.test(n.trim(i))?null:i,r=prompt(u._("Enter URL:"),f?"http://":n.trim(i)),e=prompt(u._("Enter the displayed text:"),f||r)||r;r&&u.insertText("[url="+r+"]"+e+"[/url]")}},quote:{txtExec:["[quote]","[/quote]"]},youtube:{txtExec:function(n){var t=this;l("youtube")._dropDown(t,n,function(n){t.insertText("[youtube]"+n+"[/youtube]")})}},rtl:{txtExec:["[rtl]","[/rtl]"]},ltr:{txtExec:["[ltr]","[/ltr]"]}},c=function(n){return n?n.replace(/\\(.)/g,"$1").replace(/^(["'])(.*?)\1$/,"$2"):n},v=function(){var t,n=arguments;return n[0].replace(/\{(\d+)\}/g,function(i,r){return n[+r+1]!==t?n[+r+1]:"{"+r+"}"})},r={OPEN:"open",CONTENT:"content",NEWLINE:"newline",CLOSE:"close"},y=function(n,t,i,r,u,f){var e=this;e.type=n;e.name=t;e.val=i;e.attrs=r||{};e.children=u||[];e.closing=f||null},u;y.prototype={clone:function(n){var t=this;return new y(t.type,t.name,t.val,t.attrs,n?t.children:[],t.closing?t.closing.clone():null)},splitAt:function(t){var u,i=this,f=0,r=i.children.length;if(typeof t!="number"&&(t=n.inArray(t,i.children)),t<0||t>r)return null;while(r--)r>=t?f++:r=0;return u=i.clone(),u.children=i.children.splice(t,f),u}};u=function(t){if(!(this instanceof u))return new u(t);var e=this,rt,w,ut,ft,b,k,d,l,g,nt,v,tt,it,p,o;rt=function(){e.bbcodes=f.bbcode.bbcodes;e.opts=n.extend({},u.defaults,t)};e.tokenize=function(n){var t,e,i,f=[],u=[{type:r.CLOSE,regex:/^\[\/[^\[\]]+\]/},{type:r.OPEN,regex:/^\[[^\[\]]+\]/},{type:r.NEWLINE,regex:/^(\r\n|\r|\n)/},{type:r.CONTENT,regex:/^([^\[\r\n]+|\[)/}];u.reverse();n:while(n.length){for(i=u.length;i--;)if(e=u[i].type,(t=n.match(u[i].regex))&&t[0]){f.push(w(e,t[0]));n=n.substr(t[0].length);continue n}n.length&&f.push(w(r.CONTENT,n));n=""}return f};w=function(t,i){var u,o,e;return t===r.OPEN&&(u=i.match(/\[([^\]\s=]+)(?:([^\]]+))?\]/))&&(e=p(u[1]),u[2]&&(u[2]=n.trim(u[2]))&&(o=ut(u[2]))),t===r.CLOSE&&(u=i.match(/\[\/([^\[\]]+)\]/))&&(e=p(u[1])),t===r.NEWLINE&&(e="#newline"),e&&(t!==r.OPEN&&t!==r.CLOSE||f.bbcode.bbcodes[e])||(t=r.CONTENT,e="#"),new y(t,e,i,o)};ut=function(n){var t,r=/([^\s=]+)=(?:(?:(["'])((?:\\\2|[^\2])*?)\2)|((?:.(?!\s\S+=))*.))/g,i={};if(n.charAt(0)==="="&&n.indexOf("=",1)<0)i.defaultattr=c(n.substr(1));else for(n.charAt(0)==="="&&(n="defaultattr"+n);t=r.exec(n);)i[p(t[1])]=c(t[3])||t[4];return i};e.parse=function(n,t){var i=ft(e.tokenize(n)),r=e.opts;return r.fixInvalidChildren&&g(i),r.removeEmptyTags&&l(i),r.fixInvalidNesting&&k(i),b(i,null,t),r.removeEmptyTags&&l(i),i};tt=function(n,t,i){for(var r=i.length;r--;)if(i[r].type===t&&i[r].name===n)return!0;return!1};d=function(t,i){var u=t?e.bbcodes[t.name]:{},r=u.allowedChildren;return e.opts.fixInvalidChildren&&r?n.inArray(i.name||"#",r)>-1:!0};ft=function(t){for(var i,u,a,v,y,b,c,h=[],w=[],s=[],f=function(){return o(s)},l=function(n){f()?f().children.push(n):w.push(n)},p=function(t){return f()&&(u=e.bbcodes[f().name])&&u.closedBy&&n.inArray(t,u.closedBy)>-1};i=t.shift();){c=t[0];switch(i.type){case r.OPEN:p(i.name)&&s.pop();l(i);u=e.bbcodes[i.name];u&&u.isSelfClosing||!(u.closedBy||tt(i.name,r.CLOSE,t))?u&&u.isSelfClosing||(i.type=r.CONTENT):s.push(i);break;case r.CLOSE:if(f()&&i.name!==f().name&&p("/"+i.name)&&s.pop(),f()&&i.name===f().name)f().closing=i,s.pop();else if(tt(i.name,r.OPEN,s)){while(a=s.pop()){if(a.name===i.name){a.closing=i;break}v=a.clone();h.length>1&&v.children.push(o(h));h.push(v)}for(l(o(h)),y=h.length;y--;)s.push(h[y]);h.length=0}else i.type=r.CONTENT,l(i);break;case r.NEWLINE:f()&&c&&p((c.type===r.CLOSE?"/":"")+c.name)&&(c.type===r.CLOSE&&c.name===f().name||(u=e.bbcodes[f().name],u&&u.breakAfter?s.pop():u&&u.isInline===!1&&e.opts.breakAfterBlock&&u.breakAfter!==!1&&s.pop()));l(i);break;default:l(i)}b=i}return w};b=function(n,t,i){var h,c,l,f,o,v,a,u,y=n.length,s;for(t&&(f=e.bbcodes[t.name]),s=y;s--;)if(h=n[s])if(h.type===r.NEWLINE){if(c=s>0?n[s-1]:null,l=s<y-1?n[s+1]:null,u=!1,!i&&f&&f.isSelfClosing!==!0&&(c?v||l||(f.isInline===!1&&e.opts.breakEndBlock&&f.breakEnd!==!1&&(u=!0),f.breakEnd&&(u=!0),v=u):(f.isInline===!1&&e.opts.breakStartBlock&&f.breakStart!==!1&&(u=!0),f.breakStart&&(u=!0))),c&&c.type===r.OPEN&&(o=e.bbcodes[c.name])&&(i?o.isInline===!1&&(u=!0):(o.isInline===!1&&e.opts.breakAfterBlock&&o.breakAfter!==!1&&(u=!0),o.breakAfter&&(u=!0))),!i&&!a&&l&&l.type===r.OPEN&&(o=e.bbcodes[l.name])&&(o.isInline===!1&&e.opts.breakBeforeBlock&&o.breakBefore!==!1&&(u=!0),o.breakBefore&&(u=!0),a=u,u)){n.splice(s,1);continue}u&&n.splice(s,1);a=!1}else h.type===r.OPEN&&b(h.children,h,i)};k=function(t,i,u,f){var s,h,l,a,v,c,y=function(n){var t=e.bbcodes[n.name];return!t||t.isInline!==!1};for(i=i||[],f=f||t,h=0;h<t.length;h++)if((s=t[h])&&s.type===r.OPEN){if(!y(s)&&u&&(l=o(i),c=l.splitAt(s),v=i.length>1?i[i.length-2].children:f,a=n.inArray(l,v),a>-1)){c.children.splice(n.inArray(s,c.children),1);v.splice(a+1,0,s,c);return}i.push(s);k(s.children,i,u||y(s),f);i.pop(s)}};g=function(n,t){for(var i,f,u=n.length;u--;)(i=n[u])&&(d(t,i)||(i.name=null,i.type=r.CONTENT,d(t,i)?(f=[u+1,0].concat(i.children),i.closing&&(i.closing.name=null,i.closing.type=r.CONTENT,f.push(i.closing)),u+=f.length-1,Array.prototype.splice.apply(n,f)):t.children.splice(u,1)),i.type===r.OPEN&&g(i.children,i))};l=function(t){for(var i,u,o=function(n){for(var i=n.length,t;i--;)if((t=n[i].type,t===r.OPEN||t===r.CLOSE)||t===r.CONTENT&&/\S|\u00A0/.test(n[i].val))return!1;return!0},f=t.length;f--;)(i=t[f])&&i.type===r.OPEN&&(u=e.bbcodes[i.name],l(i.children),o(i.children)&&u&&!u.isSelfClosing&&!u.allowsEmpty&&t.splice.apply(t,n.merge([f,1],i.children)))};e.toHTML=function(n,t){return nt(e.parse(n,t),!0)};nt=function(t,u){for(var d,o,l,y,p,w,v,k,c=[],b=function(n){return(!n||(n.isHtmlInline!==d?n.isHtmlInline:n.isInline))!==!1};t.length>0;)if(o=t.shift()){if(o.type===r.OPEN)k=o.children[o.children.length-1]||{},l=e.bbcodes[o.name],w=u&&b(l),y=nt(o.children,!1),l&&l.html?(b(l)||!b(e.bbcodes[k.name])||l.isPreFormatted||l.skipLastLineBreak||h||(y+="<br />"),n.isFunction(l.html)?p=l.html.call(e,o,o.attrs,y):(o.attrs["0"]=y,p=f.bbcode.formatBBCodeString(l.html,o.attrs))):p=o.val+y+(o.closing?o.closing.val:"");else if(o.type===r.NEWLINE){if(!u){c.push("<br />");continue}v||(c.push("<div>"),(a<8||i.documentMode&&i.documentMode<8)&&c.push(" "));h||c.push("<br />");t.length||c.push("<br />");c.push("<\/div>\n");v=!1;continue}else w=u,p=s(o.val,!0);w&&!v?(c.push("<div>"),v=!0):!w&&v&&(c.push("<\/div>\n"),v=!1);c.push(p)}return v&&c.push("<\/div>\n"),c.join("")};e.toBBCode=function(n,t){return v(e.parse(n,t))};v=function(n){for(var t,o,i,s,h,c,l,a,y,p,f=[];n.length>0;)if(t=n.shift())if(i=e.bbcodes[t.name],s=!(!i||i.isInline!==!1),h=i&&i.isSelfClosing,l=s&&e.opts.breakBeforeBlock&&i.breakBefore!==!1||i&&i.breakBefore,a=s&&!h&&e.opts.breakStartBlock&&i.breakStart!==!1||i&&i.breakStart,y=s&&e.opts.breakEndBlock&&i.breakEnd!==!1||i&&i.breakEnd,p=s&&e.opts.breakAfterBlock&&i.breakAfter!==!1||i&&i.breakAfter,c=(i?i.quoteType:null)||e.opts.quoteType||u.QuoteType.auto,i||t.type!==r.OPEN)if(t.type===r.OPEN){if(l&&f.push("\n"),f.push("["+t.name),t.attrs){t.attrs.defaultattr&&(f.push("=",it(t.attrs.defaultattr,c,"defaultattr")),delete t.attrs.defaultattr);for(o in t.attrs)t.attrs.hasOwnProperty(o)&&f.push(" ",o,"=",it(t.attrs[o],c,o))}f.push("]");a&&f.push("\n");t.children&&f.push(v(t.children));h||i.excludeClosing||(y&&f.push("\n"),f.push("[/"+t.name+"]"));p&&f.push("\n");t.closing&&h&&f.push(t.closing.val)}else f.push(t.val);else f.push(t.val),t.children&&f.push(v(t.children)),t.closing&&f.push(t.closing.val);return f.join("")};it=function(t,i,r){var f=u.QuoteType,e=/\s|=/.test(t);return n.isFunction(i)?i(t,r):i===f.never||i===f.auto&&!e?t:'"'+t.replace("\\","\\\\").replace('"','\\"')+'"'};o=function(n){return n.length?n[n.length-1]:null};p=function(n){return n.toLowerCase()};rt()};u.QuoteType={always:1,never:2,auto:3};u.defaults={breakBeforeBlock:!1,breakStartBlock:!1,breakEndBlock:!1,breakAfterBlock:!0,removeEmptyTags:!0,fixInvalidNesting:!0,fixInvalidChildren:!0,quoteType:u.QuoteType.auto};n.sceditorBBCodePlugin=f.bbcode=function(){var t=this,a,s,l,y;t.bbcodes=f.bbcode.bbcodes;t.stripQuotes=c;var r={},o={},p={ul:["li","ol","ul"],ol:["li","ol","ul"],table:["tr"],tr:["td","th"],code:["br","p","div"]};t.init=function(){t.opts=this.opts;a();this.commands=n.extend(!0,{},k,this.commands);this.toBBCode=t.signalToSource;this.fromBBCode=t.signalToWysiwyg};a=function(){n.each(t.bbcodes,function(i){var u,f=t.bbcodes[i].tags,e=t.bbcodes[i].styles;f&&n.each(f,function(n,f){u=t.bbcodes[i].isInline===!1;r[n]=r[n]||{};r[n][u]=r[n][u]||{};r[n][u][i]=f});e&&n.each(e,function(n,r){u=t.bbcodes[i].isInline===!1;o[u]=o[u]||{};o[u][n]=o[u][n]||{};o[u][n][i]=r})})};s=function(i,r,u){var f,s,h=e.dom.getStyle;return(u=!!u,!o[u])?r:(n.each(o[u],function(u,e){(f=h(i[0],u),f&&h(i.parent()[0],u)!==f)&&n.each(e,function(u,e){(!e||n.inArray(f.toString(),e)>-1)&&(s=t.bbcodes[u].format,r=n.isFunction(s)?s.call(t,i,r):v(s,r))})}),r)};l=function(i,u,f){var w,p,c=i[0],s=c.nodeName.toLowerCase(),l,b,a,y,o;if(f=!!f,r[s]&&r[s][f]&&n.each(r[s][f],function(r,f){(!f||(w=!1,n.each(f,function(t,r){if(i.attr(t)&&(!r||!(n.inArray(i.attr(t),r)<0)))return w=!0,!1}),w))&&(p=t.bbcodes[r].format,u=n.isFunction(p)?p.call(t,i,u):v(p,u))}),l=e.dom.isInline,f&&(!l(c,!0)||s==="br")){for(o=c.previousSibling;o&&(n(o).hasClass("sceditor-ignore")||o.nodeType===1&&!n(o).is("br")&&l(o,!0)&&!o.firstChild);)o=o.previousSibling;do{for(a=c.parentNode,y=a.lastChild;n(y).hasClass("sceditor-ignore");)y=y.previousSibling;b=y===c;c=a}while(a&&b&&l(a,!0));(!b||s==="li"||s==="br"&&h)&&(u+="\n");s!=="br"&&o&&!n(o).is("br")&&l(o,!0)&&(u="\n"+u)}return u};t.signalToSource=function(r,f){var s,o,h=new u(t.opts.parserOptions);return(f||(typeof r=="string"?(s=n("<div />").css("visibility","hidden").appendTo(i.body).html(r),f=s):f=n(r)),!f||!f.jquery)?"":(e.dom.removeWhiteSpace(f[0]),o=t.elementToBbcode(f),s&&s.remove(),o=h.toBBCode(o,!0),t.opts.bbcodeTrim&&(o=n.trim(o)),o)};t.elementToBbcode=function(t){var i=function(t,r){var u="";return e.dom.traverse(t,function(t){var e=n(t),f="",a=t.nodeType,o=t.nodeName.toLowerCase(),v=p[o],y=t.firstChild,c=!0;if(typeof r=="object"&&(c=n.inArray(o,r)>-1,e.is("img")&&e.data("sceditor-emoticon")&&(c=!0),c||(v=r)),a===3||a===1)if(a===1){if(e.hasClass("sceditor-ignore"))return;if(e.hasClass("sceditor-nlf")&&(!y||!h&&t.childNodes.length===1&&/br/i.test(y.nodeName)))return;o!=="iframe"&&(f=i(t,v));c?(o!=="code"&&(f=s(e,f),f=l(e,f),f=s(e,f,!0)),u+=l(e,f,!0)):u+=f}else u+=t.nodeValue},!1,!0),u};return i(t[0])};t.signalToWysiwyg=function(i,r){var e=new u(t.opts.parserOptions),f=e.toHTML(t.opts.bbcodeTrim?n.trim(i):i);return r?y(f):f};y=function(t){var u,o,f,s=n("<div />").hide().appendTo(i.body),r=s[0];return f=function(t,u){if(!e.dom.hasStyling(t)){if(h||t.childNodes.length!==1||!n(t.firstChild).is("br"))while(o=t.firstChild)r.insertBefore(o,t);if(u){var f=r.lastChild;t!==f&&n(f).is("div")&&t.nextSibling===f&&r.insertBefore(i.createElement("br"),t)}r.removeChild(t)}},r.innerHTML=t.replace(/<\/div>\n/g,"<\/div>"),(u=r.firstChild)&&n(u).is("div")&&f(u,!0),(u=r.lastChild)&&n(u).is("div")&&f(u),r=r.innerHTML,s.remove(),r}};f.bbcode.formatBBCodeString=function(n,t){return n.replace(/\{([^}]+)\}/g,function(n,i){var u,r=!0;return(i.charAt(0)==="!"&&(r=!1,i=i.substring(1)),i==="0"&&(r=!1),t[i]===u)?n:r?s(t[i],!0):t[i]})};var p=function(n){return(n=parseInt(n,10),isNaN(n))?"00":(n=Math.max(0,Math.min(n,255)).toString(16),n.length<2?"0"+n:n)},w=function(n){var t;return(n=n||"#000",t=n.match(/rgb\((\d{1,3}),\s*?(\d{1,3}),\s*?(\d{1,3})\)/i))?"#"+p(t[1])+p(t[2]-0)+p(t[3]-0):(t=n.match(/#([0-f])([0-f])([0-f])\s*?$/i))?"#"+t[1]+t[1]+t[2]+t[2]+t[3]+t[3]:n},o={b:{tags:{b:null,strong:null},styles:{"font-weight":["bold","bolder","401","700","800","900"]},format:"[b]{0}[/b]",html:"<strong>{0}<\/strong>"},i:{tags:{i:null,em:null},styles:{"font-style":["italic","oblique"]},format:"[i]{0}[/i]",html:"<em>{0}<\/em>"},u:{tags:{u:null},styles:{"text-decoration":["underline"]},format:"[u]{0}[/u]",html:"<u>{0}<\/u>"},s:{tags:{s:null,strike:null},styles:{"text-decoration":["line-through"]},format:"[s]{0}[/s]",html:"<s>{0}<\/s>"},sub:{tags:{sub:null},format:"[sub]{0}[/sub]",html:"<sub>{0}<\/sub>"},sup:{tags:{sup:null},format:"[sup]{0}[/sup]",html:"<sup>{0}<\/sup>"},font:{tags:{font:{face:null}},styles:{"font-family":null},quoteType:u.QuoteType.never,format:function(n,t){var i;return n.is("font")&&(i=n.attr("face"))||(i=n.css("font-family")),"[font="+c(i)+"]"+t+"[/font]"},html:'<font face="{defaultattr}">{0}<\/font>'},size:{tags:{font:{size:null}},styles:{"font-size":null},format:function(n,t){var i=n.attr("size"),r=2;return i||(i=n.css("fontSize")),i.indexOf("px")>-1?(i=i.replace("px","")-0,i<12&&(r=1),i>15&&(r=3),i>17&&(r=4),i>23&&(r=5),i>31&&(r=6),i>47&&(r=7)):r=i,"[size="+r+"]"+t+"[/size]"},html:'<font size="{defaultattr}">{!0}<\/font>'},color:{tags:{font:{color:null}},styles:{color:null},quoteType:u.QuoteType.never,format:function(n,t){var i;return n.is("font")&&(i=n.attr("color"))||(i=n[0].style.color||n.css("color")),"[color="+w(i)+"]"+t+"[/color]"},html:function(n,t,i){return'<font color="'+s(w(t.defaultattr),!0)+'">'+i+"<\/font>"}},ul:{tags:{ul:null},breakStart:!0,isInline:!1,skipLastLineBreak:!0,format:"[ul]{0}[/ul]",html:"<ul>{0}<\/ul>"},list:{breakStart:!0,isInline:!1,skipLastLineBreak:!0,html:"<ul>{0}<\/ul>"},ol:{tags:{ol:null},breakStart:!0,isInline:!1,skipLastLineBreak:!0,format:"[ol]{0}[/ol]",html:"<ol>{0}<\/ol>"},li:{tags:{li:null},isInline:!1,closedBy:["/ul","/ol","/list","*","li"],format:"[li]{0}[/li]",html:"<li>{0}<\/li>"},"*":{isInline:!1,closedBy:["/ul","/ol","/list","*","li"],html:"<li>{0}<\/li>"},table:{tags:{table:null},isInline:!1,isHtmlInline:!0,skipLastLineBreak:!0,format:"[table]{0}[/table]",html:"<table>{0}<\/table>"},tr:{tags:{tr:null},isInline:!1,skipLastLineBreak:!0,format:"[tr]{0}[/tr]",html:"<tr>{0}<\/tr>"},th:{tags:{th:null},allowsEmpty:!0,isInline:!1,format:"[th]{0}[/th]",html:"<th>{0}<\/th>"},td:{tags:{td:null},allowsEmpty:!0,isInline:!1,format:"[td]{0}[/td]",html:"<td>{0}<\/td>"},emoticon:{allowsEmpty:!0,tags:{img:{src:null,"data-sceditor-emoticon":null}},format:function(n,t){return n.data("sceditor-emoticon")+t},html:"{0}"},hr:{tags:{hr:null},allowsEmpty:!0,isSelfClosing:!0,isInline:!1,format:"[hr]{0}",html:"<hr />"},img:{allowsEmpty:!0,tags:{img:{src:null}},allowedChildren:["#"],quoteType:u.QuoteType.never,format:function(n,t){var o,s,w="",h=n[0],y=function(n){return h.style?h.style[n]:null},e,i,a,v;if(n.attr("data-sceditor-emoticon"))return t;if(o=n.attr("width")||y("width"),s=n.attr("height")||y("height"),h.complete&&(o||s)||o&&s){var r=parseFloat(n.width()),u=parseFloat(n.height()),c=r/u;c>1?r>550&&(r=550,u=r/c):u>412&&(u=412,r=c*u);w="="+r+"x"+u}var l=n.attr("src"),f=550,p=412;return/^(\s*http:\/\/www\.capital\.gr)|^(\s*\/)|^(\s*http:\/\/files\.capital\.gr)/im.test(l)?(e=/(?:\.jpg|\.gif|\.png)(?:[?&].*width=(\d+))/img,i=e.exec(l),i!=null&&parseInt(i[1])<f&&(f=parseInt(i[1])),e=/(?:\.jpg|\.gif|\.png)(?:[?&].*height=(\d+))/img,i=e.exec(l),i!=null&&parseInt(i[1])<f&&(p=parseInt(i[1])),a=n.attr("src").replace(/([&]*maxheight=\d+)/img,"").replace(/([&]*maxwidth=\d+)/img,"").replace(/([&]*scale=\d+)/img,""),v="?",a.indexOf("?")>0&&(v="&"),"[img]"+a+v+"maxWidth="+f.toString()+"&maxHeight="+p.toString()+"&scale=downscaleonly[/img]"):""},html:function(n,t,i){var o,u,f,r,e="";return u=t.width,f=t.height,t.defaultattr&&(r=t.defaultattr.split(/x/i),u=r[0],f=r.length===2?r[1]:r[0]),u!==o&&(e+=' width="'+s(u,!0)+'"'),f!==o&&(e+=' height="'+s(f,!0)+'"'),"<img"+e+' src="'+b(i)+'" />'}},url:{allowsEmpty:!0,tags:{a:{href:null}},quoteType:u.QuoteType.never,format:function(n,t){var i=n.attr("href");return i.substr(0,7)==="mailto:"?'[email="'+i.substr(7)+'"]'+t+"[/email]":"[url="+i+"]"+t+"[/url]"},html:function(n,t,i){return t.defaultattr=s(t.defaultattr,!0)||i,'<a href="'+b(t.defaultattr)+'">'+i+"<\/a>"}},email:{quoteType:u.QuoteType.never,html:function(n,t,i){return'<a href="mailto:'+(s(t.defaultattr,!0)||i)+'">'+i+"<\/a>"}},quote:{tags:{blockquote:null},isInline:!1,quoteType:u.QuoteType.never,format:function(t,i){var r="",u=n(t),f=u.children("cite").first();return(f.length===1||u.data("author"))&&(r=f.text()||u.data("author"),u.data("author",r),f.remove(),i=this.elementToBbcode(n(t)),r="="+r.replace(/(^\s+|\s+$)/g,""),u.prepend(f)),"[quote"+r+"]"+i+"[/quote]"},html:function(n,t,i){return t.defaultattr&&(i="<cite>"+s(t.defaultattr)+"<\/cite>"+i),"<blockquote>"+i+"<\/blockquote>"}},code:{tags:{code:null},isInline:!1,allowedChildren:["#","#newline"],format:"[code]{0}[/code]",html:"<code>{0}<\/code>"},left:{styles:{"text-align":["left","-webkit-left","-moz-left","-khtml-left"]},isInline:!1,format:"[left]{0}[/left]",html:'<div align="left">{0}<\/div>'},center:{styles:{"text-align":["center","-webkit-center","-moz-center","-khtml-center"]},isInline:!1,format:"[center]{0}[/center]",html:'<div align="center">{0}<\/div>'},right:{styles:{"text-align":["right","-webkit-right","-moz-right","-khtml-right"]},isInline:!1,format:"[right]{0}[/right]",html:'<div align="right">{0}<\/div>'},justify:{styles:{"text-align":["justify","-webkit-justify","-moz-justify","-khtml-justify"]},isInline:!1,format:"[justify]{0}[/justify]",html:'<div align="justify">{0}<\/div>'},youtube:{allowsEmpty:!0,tags:{iframe:{"data-youtube-id":null}},format:function(n,t){return n=n.attr("data-youtube-id"),n?"[youtube]"+n+"[/youtube]":t},html:'<iframe width="560" height="315" frameborder="0" src="https://www.youtube.com/embed/{0}?wmode=opaque" data-youtube-id="{0}" allowfullscreen><\/iframe>'},rtl:{styles:{direction:["rtl"]},format:"[rtl]{0}[/rtl]",html:'<div style="direction: rtl">{0}<\/div>'},ltr:{styles:{direction:["ltr"]},format:"[ltr]{0}[/ltr]",html:'<div style="direction: ltr">{0}<\/div>'},ignore:{}};f.bbcode.bbcode={get:function(n){return o[n]||null},set:function(t,i){return!t||!i?!1:(i=n.extend(o[t]||{},i),i.remove=function(){delete o[t]},o[t]=i,this)},rename:function(n,t){if(n in o)o[t]=o[n],delete o[n];else return!1;return this},remove:function(n){return n in o&&delete o[n],this}};n.fn.sceditorBBCodePlugin=function(t){return t=t||{},n.isPlainObject(t)&&(t.plugins=(t.plugins||"")+"bbcode"),this.sceditor(t)};f.bbcode.normaliseColour=w;f.bbcode.formatString=v;f.bbcode.stripQuotes=c;f.bbcode.bbcodes=o;e.BBCodeParser=u}(jQuery,window,document),function(n){"use strict";n.sceditor.locale.el={Bold:"Έντονα",Italic:"Πλάγια",Underline:"Υπογραμμισμένα",Strikethrough:"Διαγραμμισμένα",Subscript:"Δείκτης",Superscript:"Εκθέτης","Align left":"Αριστερή στοίχιση",Center:"Κεντραρισμένα","Align right":"Δεξιά στοίχιση",Justify:"Πλήρης στοίχιση","Font Name":"Γραμματοσειρά","Font Size":"Μέγεθος","Font Color":"Χρώμα","Remove Formatting":"Αφαίρεση μορφοποίησης",Cut:"Αποκοπή","Your browser does not allow the cut command. Please use the keyboard shortcut Ctrl/Cmd-X":"Ο περιηγητής σας δεν επιτρέπει την εντολή αποκοπής. Παρακαλούμε χρησιμοποιήστε τη συντόμευση πληκτρολογίου Ctrl/Cmd-X",Copy:"Αντιγραφή","Your browser does not allow the copy command. Please use the keyboard shortcut Ctrl/Cmd-C":"Ο περιηγητής σας δεν επιτρέπει την εντολή αντιγραφής. Παρακαλούμε χρησιμοποιήστε τη συντόμευση πληκτρολογίου Ctrl/Cmd-C",Paste:"Επικόλληση","Your browser does not allow the paste command. Please use the keyboard shortcut Ctrl/Cmd-V":"Ο περιηγητής σας δεν επιτρέπει την εντολή επικόλλησης. Παρακαλούμε χρησιμοποιήστε τη συντόμευση πληκτρολογίου Ctrl/Cmd-V","Paste your text inside the following box:":"Επικολλήστε το κείμενό σας μέσα στο ακόλουθο πλαίσιο:","Paste Text":"Επικόλληση κειμένου","Bullet list":"Λίστα με κουκίδες","Numbered list":"Λίστα με αρίθμηση",Undo:"Αναίρεση",Redo:"Επανάληψη","Rows:":"Γραμμές","Cols:":"Στήλες","Insert a table":"Εισαγωγή πίνακα","Insert a horizontal rule":"Εισαγωγή οριζόντιας γραμμής",Code:"Κώδικας","Width (optional):":"Πλάτος (Προαιρετικό)","Height (optional):":"Ύψος (Προαιρετικό)","Insert an image":"Εισαγωγή εικόνας","E-mail:":"Ηλεκτρονικό ταχυδρομείο","Insert an email":"Εισαγωγή email","URL:":"Ηλεκτρονική διεύθυνση","Insert a link":"Εισαγωγή συνδέσμου",Unlink:"Κατάργηση σύνδεσης",More:"Περισσότερα","Insert an emoticon":"Εισαγωγή φατσούλας","Video URL:":"Διεύθυνση βίντεο",Insert:"Εισαγωγή","Insert a YouTube video":"Εισαγωγή βίντεο YouTube","Insert current date":"Εισαγωγή τρέχουσας ημερομηνίας","Insert current time":"Εισαγωγή τρέχουσας ώρας",Print:"Εκτύπωση",Maximize:"Μεγιστοποίηση","View source":"Προβολή πηγαίου κώδικα","Description (optional):":"Περιγραφή (προαιρετικό)","Enter the image URL:":"Εισάγετε τη διεύθυνση εικόνας","Enter the e-mail address:":"Εισάγετε τη διεύθυνση e-mail","Enter the displayed text:":"Εισάγετε το εμφανιζόμενο κείμενο","Enter URL:":"Εισάγετε διεύθυνση","Enter the YouTube video URL or ID:":"Εισάγετε τη διεύθυνση του βίντεο YouTube ή το ID","Insert a Quote":"Εισαγωγή παράθεσης","Invalid YouTube video":"Μη έγκυρο βίντεο YouTube",dateFormat:"day-month-year"}}(jQuery),function(){var n,i,t;jQuery.browser||(jQuery.browser={},jQuery.browser.mozilla=!1,jQuery.browser.webkit=!1,jQuery.browser.opera=!1,jQuery.browser.msie=!1,n=navigator.userAgent,jQuery.browser.name=navigator.appName,jQuery.browser.fullVersion=""+parseFloat(navigator.appVersion),jQuery.browser.majorVersion=parseInt(navigator.appVersion,10),-1!=(t=n.indexOf("Opera"))?(jQuery.browser.opera=!0,jQuery.browser.name="Opera",jQuery.browser.fullVersion=n.substring(t+6),-1!=(t=n.indexOf("Version")))&&(jQuery.browser.fullVersion=n.substring(t+8)):-1!=(t=n.indexOf("MSIE"))?(jQuery.browser.msie=!0,jQuery.browser.name="Microsoft Internet Explorer",jQuery.browser.fullVersion=n.substring(t+5)):-1!=(t=n.indexOf("Chrome"))?(jQuery.browser.webkit=!0,jQuery.browser.name="Chrome",jQuery.browser.fullVersion=n.substring(t+7)):-1!=(t=n.indexOf("Safari"))?(jQuery.browser.webkit=!0,jQuery.browser.name="Safari",jQuery.browser.fullVersion=n.substring(t+7),-1!=(t=n.indexOf("Version")))&&(jQuery.browser.fullVersion=n.substring(t+8)):-1!=(t=n.indexOf("Firefox"))?(jQuery.browser.mozilla=!0,jQuery.browser.name="Firefox",jQuery.browser.fullVersion=n.substring(t+8)):(i=n.lastIndexOf(" ")+1)<(t=n.lastIndexOf("/"))&&(jQuery.browser.name=n.substring(i,t),jQuery.browser.fullVersion=n.substring(t+1),jQuery.browser.name.toLowerCase()==jQuery.browser.name.toUpperCase()&&(jQuery.browser.name=navigator.appName)),-1!=(n=jQuery.browser.fullVersion.indexOf(";"))&&(jQuery.browser.fullVersion=jQuery.browser.fullVersion.substring(0,n)),-1!=(n=jQuery.browser.fullVersion.indexOf(" "))&&(jQuery.browser.fullVersion=jQuery.browser.fullVersion.substring(0,n)),jQuery.browser.majorVersion=parseInt(""+jQuery.browser.fullVersion,10),isNaN(jQuery.browser.majorVersion)&&(jQuery.browser.fullVersion=""+parseFloat(navigator.appVersion),jQuery.browser.majorVersion=parseInt(navigator.appVersion,10)),jQuery.browser.version=jQuery.browser.majorVersion)}(jQuery),function(n){n.fn.webkitimageresize=function(t){return this.each(function(){var e;if(n.browser.webkit){var u=n.extend({},t),c,o=!1,f,v,y,l,a,r={guidGenerator:function(){var n=function(){return((1+Math.random())*65536|0).toString(16).substring(1)};return n()+n()+"-"+n()+"-"+n()+"-"+n()+"-"+n()+n()+n()},guidFilter:function(n){return"[data-guid='"+n.guid+"']"},removeResizeElements:function(t){n(".img-resize-selector").filter(r.guidFilter(t)).remove();n(".img-resize-region").filter(r.guidFilter(t)).remove()},imageClick:function(t,i){u.beforeElementSelect&&u.beforeElementSelect(i);r.removeResizeElements(t);f=i;var p=n(i).outerHeight(),w=n(i).outerWidth(),s=t.$ifrm.offset(),e=n(i).offset(),h=t.$ifrmBody.scrollTop(),c=t.$ifrmBody.scrollLeft();t.$docBody.append("<span data-guid='"+t.guid+"' class='img-resize-selector' style='margin:10px;position:absolute;top:"+(s.top+e.top-h+p-10)+"px;left:"+(s.left+e.left-c+w-10)+"px;border:solid 2px red;width:6px;height:6px;cursor:se-resize;z-index:1;'><\/span>");t.$docBody.append("<span data-guid='"+t.guid+"' class='img-resize-region region-top-right' style='position:absolute;top:"+(s.top+e.top-h)+"px;left:"+(s.left+e.left-c)+"px;border:dashed 1px grey;width:"+w+"px;height:0px;'><\/span>");t.$docBody.append("<span data-guid='"+t.guid+"' class='img-resize-region region-top-down' style='position:absolute;top:"+(s.top+e.top-h)+"px;left:"+(s.left+e.left-c)+"px;border:dashed 1px grey;width:0px;height:"+p+"px;'><\/span>");t.$docBody.append("<span data-guid='"+t.guid+"' class='img-resize-region region-right-down' style='position:absolute;top:"+(s.top+e.top-h)+"px;left:"+(s.left+e.left-c+w)+"px;border:dashed 1px grey;width:0px;height:"+p+"px;'><\/span>");t.$docBody.append("<span data-guid='"+t.guid+"' class='img-resize-region region-down-left' style='position:absolute;top:"+(s.top+e.top-h+p)+"px;left:"+(s.left+e.left-c)+"px;border:dashed 1px grey;width:"+w+"px;height:0px;'><\/span>");var b=function(){o&&(n(f).css("width",n(".region-top-right").filter(r.guidFilter(t)).width()+"px").css("height",n(".region-top-down").filter(r.guidFilter(t)).height()+"px"),r.refresh(t),n(f).click(),t.$ifrm.trigger("webkitresize-updatecrc",[r.crc(t.$ifrmBody.html())]),o=!1,u.afterResize&&u.afterResize(f))},k=function(i){var f,b,k,d;return o&&(f=w,b=p,b=i.pageY-e.top,f=i.pageX-e.left,b<1&&(b=1),f<1&&(f=1),(u.keepAspectRatio||i.ctrlKey)&&(k=l-b,k<0&&(k=k*-1),d=a-f,d<0&&(d=d*-1),k>d?f=b*y:b=f*v),n(".img-resize-selector").filter(r.guidFilter(t)).css("top",s.top+e.top-h+b-10+"px").css("left",s.left+e.left-c+f-10+"px"),n(".region-top-right").filter(r.guidFilter(t)).css("width",f+"px"),n(".region-top-down").filter(r.guidFilter(t)).css("height",b+"px"),n(".region-right-down").filter(r.guidFilter(t)).css("left",s.left+e.left-c+f+"px").css("height",b+"px"),n(".region-down-left").filter(r.guidFilter(t)).css("top",s.top+e.top-h+b+"px").css("width",f+"px")),!1},d=function(i){var f,b,k,d;return o&&(f=w,b=p,b=i.pageY-(s.top+e.top-h),f=i.pageX-(s.left+e.left-c),b<1&&(b=1),f<1&&(f=1),(u.keepAspectRatio||i.ctrlKey)&&(k=l-b,k<0&&(k=k*-1),d=a-f,d<0&&(d=d*-1),k>d?f=b*y:b=f*v),n(".img-resize-selector").filter(r.guidFilter(t)).css("top",s.top+e.top-h+b-10+"px").css("left",s.left+e.left-c+f-10+"px"),n(".region-top-right").filter(r.guidFilter(t)).css("width",f+"px"),n(".region-top-down").filter(r.guidFilter(t)).css("height",b+"px"),n(".region-right-down").filter(r.guidFilter(t)).css("left",s.left+e.left-c+f+"px").css("height",b+"px"),n(".region-down-left").filter(r.guidFilter(t)).css("top",s.top+e.top-h+b+"px").css("width",f+"px")),!1};n(".img-resize-selector").filter(r.guidFilter(t)).mousedown(function(){u.beforeResizeStart&&u.beforeResizeStart(f);var t=n(f).height(),i=n(f).width();return v=t/i,y=i/t,t>i?(l=0,a=(t-i)*-1):(a=0,l=(i-t)*-1),o=!0,!1});n(t.ifrm.contentWindow.document).mouseup(function(){o&&b()});n(window.document).mouseup(function(){o&&b()});n(t.ifrm.contentWindow.document).mousemove(function(n){k(n)});n(window.document).mousemove(function(n){d(n)});u.afterElementSelect&&u.afterElementSelect(f)},rebind:function(t){t.$ifrm.contents().find("img").each(function(i,u){n(u).unbind("click");n(u).click(function(n){n.target==u&&r.imageClick(t,u)})})},refresh:function(t){if(r.rebind(t),r.removeResizeElements(t),!f){u.afterRefresh&&u.afterRefresh(null);return}var a=f,h=n(a).outerHeight(),l=n(a).outerWidth(),i=t.$ifrm.offset(),e=n(a).offset(),o=t.$ifrmBody.scrollTop(),s=t.$ifrmBody.scrollLeft();t.$docBody.append("<span data-guid='"+t.guid+"' class='img-resize-selector' style='position:absolute;top:"+(i.top+e.top-o+h)+"px;left:"+(i.left+e.left-s+l)+"px;border:solid 2px red;width:6px;height:6px;cursor:se-resize;z-index:1;'><\/span>");t.$docBody.append("<span data-guid='"+t.guid+"' class='img-resize-region' style='position:absolute;top:"+(i.top+e.top-o)+"px;left:"+(i.left+e.left-s)+"px;border:dashed 1px grey;width:"+l+"px;height:0px;'><\/span>");t.$docBody.append("<span data-guid='"+t.guid+"' class='img-resize-region' style='position:absolute;top:"+(i.top+e.top-o)+"px;left:"+(i.left+e.left-s)+"px;border:dashed 1px grey;width:0px;height:"+h+"px;'><\/span>");t.$docBody.append("<span data-guid='"+t.guid+"' class='img-resize-region' style='position:absolute;top:"+(i.top+e.top-o)+"px;left:"+(i.left+e.left-s+l)+"px;border:dashed 1px grey;width:0px;height:"+h+"px;'><\/span>");t.$docBody.append("<span data-guid='"+t.guid+"' class='img-resize-region' style='position:absolute;top:"+(i.top+e.top-o+h)+"px;left:"+(i.left+e.left-s)+"px;border:dashed 1px grey;width:"+l+"px;height:0px;'><\/span>");c=r.crc(t.$ifrmBody.html());u.afterRefresh&&u.afterRefresh(f)},reset:function(n){f!=null&&(f=null,o=!1,r.removeResizeElements(n),u.afterReset&&u.afterReset());r.rebind(n)},crc:function(n){var t=0;if(n.length==0)return t;for(i=0;i<n.length;i++)char=n.charCodeAt(i),t=(t<<5)-t+char,t=t&t;return t}},s=this,h=n(this),w=n("body"),p=h.contents().find("body");(c=r.crc(p.html()),h.is("iframe"))&&(e={ifrm:s,$ifrm:h,$docBody:w,$ifrmBody:p,guid:r.guidGenerator()},s.contentWindow.addEventListener("scroll",function(){r.reset(e)},!1),n(s.contentWindow.document).mouseup(function(t){var f,h,l,c,i;if(!o){var v=t.x?t.x:t.clientX,y=t.y?t.y:t.clientY,a=s.contentWindow.document.elementFromPoint(v,y);if(a){for(h=e.$ifrm.contents().find(u.selector),l=n(a).parents(),c=0;c<l.length;c++){for(i=0;i<h.length;i++)if(h[i]==l[c]){f=h[i];break}if(f)break}f?r.imageClick(e,f):r.reset(e)}}}),n(document).keyup(function(n){n.keyCode==27&&r.reset(e)}),n(s.contentWindow.document).keyup(function(n){n.keyCode==27&&r.reset(e)}),s.crcChecker||(s.crcChecker=setInterval(function(){var n=r.crc(p.html());c!=n&&h.trigger("webkitresize-crcchanged",[n])},1e3)),n(window).resize(function(){r.reset(e)}),h.bind("webkitresize-crcchanged",function(n,t){c=t;r.reset(e)}),h.bind("webkitresize-updatecrc",function(n,t){c=t}),r.refresh(e))}})};n.fn.webkittableresize=function(t){return this.each(function(){var e;if(n.browser.webkit){var u=n.extend({},t),c,o=!1,f,r={guidGenerator:function(){var n=function(){return((1+Math.random())*65536|0).toString(16).substring(1)};return n()+n()+"-"+n()+"-"+n()+"-"+n()+"-"+n()+n()+n()},guidFilter:function(n){return"[data-guid='"+n.guid+"']"},removeResizeElements:function(t){n(".resize-selector").filter(r.guidFilter(t)).remove();n(".resize-region").filter(r.guidFilter(t)).remove()},tableClick:function(t,i){u.beforeElementSelect&&u.beforeElementSelect(i);r.removeResizeElements(t);f=i;var l=n(i).outerHeight(),a=n(i).outerWidth(),s=t.$ifrm.offset(),e=n(i).offset(),h=t.$ifrmBody.scrollTop(),c=t.$ifrmBody.scrollLeft();t.$docBody.append("<span data-guid='"+t.guid+"' class='resize-selector' style='margin:10px;position:absolute;top:"+(s.top+e.top-h+l-10)+"px;left:"+(s.left+e.left-c+a-10)+"px;border:solid 2px red;width:6px;height:6px;cursor:se-resize;z-index:1;'><\/span>");t.$docBody.append("<span data-guid='"+t.guid+"' class='resize-region region-top-right' style='position:absolute;top:"+(s.top+e.top-h)+"px;left:"+(s.left+e.left-c)+"px;border:dashed 1px grey;width:"+a+"px;height:0px;'><\/span>");t.$docBody.append("<span data-guid='"+t.guid+"' class='resize-region region-top-down' style='position:absolute;top:"+(s.top+e.top-h)+"px;left:"+(s.left+e.left-c)+"px;border:dashed 1px grey;width:0px;height:"+l+"px;'><\/span>");t.$docBody.append("<span data-guid='"+t.guid+"' class='resize-region region-right-down' style='position:absolute;top:"+(s.top+e.top-h)+"px;left:"+(s.left+e.left-c+a)+"px;border:dashed 1px grey;width:0px;height:"+l+"px;'><\/span>");t.$docBody.append("<span data-guid='"+t.guid+"' class='resize-region region-down-left' style='position:absolute;top:"+(s.top+e.top-h+l)+"px;left:"+(s.left+e.left-c)+"px;border:dashed 1px grey;width:"+a+"px;height:0px;'><\/span>");var v=function(){o&&(n(f).css("width",n(".region-top-right").filter(r.guidFilter(t)).width()+"px").css("height",n(".region-top-down").filter(r.guidFilter(t)).height()+"px"),r.refresh(t),n(f).click(),t.$ifrm.trigger("webkitresize-updatecrc",[r.crc(t.$ifrmBody.html())]),t.$ifrm.trigger("webkitresize-table-resized",[]),o=!1,u.afterResize&&u.afterResize(f))},y=function(i){if(o){var u=a,f=l;f=i.pageY-e.top;u=i.pageX-e.left;f<1&&(f=1);u<1&&(u=1);n(".resize-selector").filter(r.guidFilter(t)).css("top",s.top+e.top-h+f-10+"px").css("left",s.left+e.left-c+u-10+"px");n(".region-top-right").filter(r.guidFilter(t)).css("width",u+"px");n(".region-top-down").filter(r.guidFilter(t)).css("height",f+"px");n(".region-right-down").filter(r.guidFilter(t)).css("left",s.left+e.left-c+u+"px").css("height",f+"px");n(".region-down-left").filter(r.guidFilter(t)).css("top",s.top+e.top-h+f+"px").css("width",u+"px")}return!1},p=function(i){if(o){var u=a,f=l;f=i.pageY-(s.top+e.top-h);u=i.pageX-(s.left+e.left-c);f<1&&(f=1);u<1&&(u=1);n(".resize-selector").filter(r.guidFilter(t)).css("top",s.top+e.top-h+f-10+"px").css("left",s.left+e.left-c+u-10+"px");n(".region-top-right").filter(r.guidFilter(t)).css("width",u+"px");n(".region-top-down").filter(r.guidFilter(t)).css("height",f+"px");n(".region-right-down").filter(r.guidFilter(t)).css("left",s.left+e.left-c+u+"px").css("height",f+"px");n(".region-down-left").filter(r.guidFilter(t)).css("top",s.top+e.top-h+f+"px").css("width",u+"px")}return!1};n(".resize-selector").filter(r.guidFilter(t)).mousedown(function(){return u.beforeResizeStart&&u.beforeResizeStart(f),o=!0,!1});n("*").mouseup(function(){o&&v()});n(t.ifrm.contentWindow).mousemove(function(n){y(n)});n(window).mousemove(function(n){p(n)});u.afterElementSelect&&u.afterElementSelect(f)},rebind:function(t){t.$ifrm.contents().find("table").each(function(i,u){n(u).unbind("click");n(u).click(function(i){(i.target==u||n(i.target).is("td")&&n(i.target).parents("table")[0]==u)&&r.tableClick(t,u)})})},refresh:function(t){if(r.rebind(t),r.removeResizeElements(t),!f){u.afterRefresh&&u.afterRefresh(null);return}var a=f,h=n(a).outerHeight(),l=n(a).outerWidth(),i=t.$ifrm.offset(),e=n(a).offset(),o=t.$ifrmBody.scrollTop(),s=t.$ifrmBody.scrollLeft();t.$docBody.append("<span data-guid='"+t.guid+"' class='resize-selector' style='position:absolute;top:"+(i.top+e.top-o+h)+"px;left:"+(i.left+e.left-s+l)+"px;border:solid 2px red;width:6px;height:6px;cursor:se-resize;z-index:1;'><\/span>");t.$docBody.append("<span data-guid='"+t.guid+"' class='resize-region' style='position:absolute;top:"+(i.top+e.top-o)+"px;left:"+(i.left+e.left-s)+"px;border:dashed 1px grey;width:"+l+"px;height:0px;'><\/span>");t.$docBody.append("<span data-guid='"+t.guid+"' class='resize-region' style='position:absolute;top:"+(i.top+e.top-o)+"px;left:"+(i.left+e.left-s)+"px;border:dashed 1px grey;width:0px;height:"+h+"px;'><\/span>");t.$docBody.append("<span data-guid='"+t.guid+"' class='resize-region' style='position:absolute;top:"+(i.top+e.top-o)+"px;left:"+(i.left+e.left-s+l)+"px;border:dashed 1px grey;width:0px;height:"+h+"px;'><\/span>");t.$docBody.append("<span data-guid='"+t.guid+"' class='resize-region' style='position:absolute;top:"+(i.top+e.top-o+h)+"px;left:"+(i.left+e.left-s)+"px;border:dashed 1px grey;width:"+l+"px;height:0px;'><\/span>");c=r.crc(t.$ifrmBody.html());u.afterRefresh&&u.afterRefresh(f)},reset:function(n){f!=null&&(f=null,o=!1,r.removeResizeElements(n),u.afterReset&&u.afterReset());r.rebind(n)},crc:function(n){var t=0;if(n.length==0)return t;for(i=0;i<n.length;i++)char=n.charCodeAt(i),t=(t<<5)-t+char,t=t&t;return t}},s=this,h=n(this),a=n("body"),l=h.contents().find("body");(c=r.crc(l.html()),h.is("iframe"))&&(e={ifrm:s,$ifrm:h,$docBody:a,$ifrmBody:l,guid:r.guidGenerator()},s.contentWindow.addEventListener("scroll",function(){r.reset(e)},!1),n(s.contentWindow.document).mouseup(function(t){var f,h,l,c,i;if(!o){var v=t.x?t.x:t.clientX,y=t.y?t.y:t.clientY,a=s.contentWindow.document.elementFromPoint(v,y);if(a){for(h=e.$ifrm.contents().find(u.selector),l=n(a).parents(),c=0;c<l.length;c++){for(i=0;i<h.length;i++)if(h[i]==l[c]){f=h[i];break}if(f)break}f?r.tableClick(e,f):r.reset(e)}}}),n(document).keyup(function(n){n.keyCode==27&&r.reset(e)}),s.crcChecker||(s.crcChecker=setInterval(function(){var n=r.crc(l.html());c!=n&&h.trigger("webkitresize-crcchanged",[n])},1e3)),n(window).resize(function(){r.reset(e)}),h.bind("webkitresize-crcchanged",function(n,t){c=t;r.reset(e)}),h.bind("webkitresize-updatecrc",function(n,t){c=t}),r.refresh(e))}})};n.fn.webkittdresize=function(t){return this.each(function(){var e;if(n.browser.webkit){var u=n.extend({},t),c,o=!1,f,r={guidGenerator:function(){var n=function(){return((1+Math.random())*65536|0).toString(16).substring(1)};return n()+n()+"-"+n()+"-"+n()+"-"+n()+"-"+n()+n()+n()},guidFilter:function(n){return"[data-guid='"+n.guid+"']"},removeResizeElements:function(t){n(".td-resize-selector").filter(r.guidFilter(t)).remove();n(".td-resize-region").filter(r.guidFilter(t)).remove()},tdClick:function(t,i){u.beforeElementSelect&&u.beforeElementSelect(i);r.removeResizeElements(t);f=i;var l=n(i).outerHeight(),a=n(i).outerWidth(),s=t.$ifrm.offset(),e=n(i).offset(),h=t.$ifrmBody.scrollTop(),c=t.$ifrmBody.scrollLeft();t.$docBody.append("<span data-guid='"+t.guid+"' class='td-resize-selector' style='margin:10px;position:absolute;top:"+(s.top+e.top-h+l-10)+"px;left:"+(s.left+e.left-c+a-10)+"px;border:solid 2px red;width:6px;height:6px;cursor:se-resize;z-index:1;'><\/span>");t.$docBody.append("<span data-guid='"+t.guid+"' class='td-resize-region td-region-top-right' style='position:absolute;top:"+(s.top+e.top-h)+"px;left:"+(s.left+e.left-c)+"px;border:dashed 1px green;width:"+a+"px;height:0px;'><\/span>");t.$docBody.append("<span data-guid='"+t.guid+"' class='td-resize-region td-region-top-down' style='position:absolute;top:"+(s.top+e.top-h)+"px;left:"+(s.left+e.left-c)+"px;border:dashed 1px green;width:0px;height:"+l+"px;'><\/span>");t.$docBody.append("<span data-guid='"+t.guid+"' class='td-resize-region td-region-right-down' style='position:absolute;top:"+(s.top+e.top-h)+"px;left:"+(s.left+e.left-c+a)+"px;border:dashed 1px green;width:0px;height:"+l+"px;'><\/span>");t.$docBody.append("<span data-guid='"+t.guid+"' class='td-resize-region td-region-down-left' style='position:absolute;top:"+(s.top+e.top-h+l)+"px;left:"+(s.left+e.left-c)+"px;border:dashed 1px green;width:"+a+"px;height:0px;'><\/span>");var v=function(){o&&(n(f).css("width",n(".td-region-top-right").filter(r.guidFilter(t)).width()+"px").css("height",n(".td-region-top-down").filter(r.guidFilter(t)).height()+"px"),r.refresh(t),n(f).click(),t.$ifrm.trigger("webkitresize-updatecrc",[r.crc(t.$ifrmBody.html())]),o=!1,u.afterResize&&u.afterResize(f))},y=function(i){if(o){var u=a,f=l;f=i.pageY-e.top;u=i.pageX-e.left;f<1&&(f=1);u<1&&(u=1);n(".td-resize-selector").filter(r.guidFilter(t)).css("top",s.top+e.top-h+f-10+"px").css("left",s.left+e.left-c+u-10+"px");n(".td-region-top-right").filter(r.guidFilter(t)).css("width",u+"px");n(".td-region-top-down").filter(r.guidFilter(t)).css("height",f+"px");n(".td-region-right-down").filter(r.guidFilter(t)).css("left",s.left+e.left-c+u+"px").css("height",f+"px");n(".td-region-down-left").filter(r.guidFilter(t)).css("top",s.top+e.top-h+f+"px").css("width",u+"px")}return!1},p=function(i){if(o){var u=a,f=l;f=i.pageY-(s.top+e.top-h);u=i.pageX-(s.left+e.left-c);f<1&&(f=1);u<1&&(u=1);n(".td-resize-selector").filter(r.guidFilter(t)).css("top",s.top+e.top-h+f-10+"px").css("left",s.left+e.left-c+u-10+"px");n(".td-region-top-right").filter(r.guidFilter(t)).css("width",u+"px");n(".td-region-top-down").filter(r.guidFilter(t)).css("height",f+"px");n(".td-region-right-down").filter(r.guidFilter(t)).css("left",s.left+e.left-c+u+"px").css("height",f+"px");n(".td-region-down-left").filter(r.guidFilter(t)).css("top",s.top+e.top-h+f+"px").css("width",u+"px")}return!1};n(".td-resize-selector").filter(r.guidFilter(t)).mousedown(function(){return u.beforeResizeStart&&u.beforeResizeStart(f),o=!0,!1});n("*").mouseup(function(){o&&v()});n(t.ifrm.contentWindow).mousemove(function(n){y(n)});n(window).mousemove(function(n){p(n)});u.afterElementSelect&&u.afterElementSelect(f)},rebind:function(t){t.$ifrm.contents().find("td").each(function(i,u){n(u).unbind("click");n(u).click(function(n){n.target==u&&r.tdClick(t,u)})})},refresh:function(t){if(r.rebind(t),r.removeResizeElements(t),!f){u.afterRefresh&&u.afterRefresh(null);return}var a=f,h=n(a).outerHeight(),l=n(a).outerWidth(),i=t.$ifrm.offset(),e=n(a).offset(),o=t.$ifrmBody.scrollTop(),s=t.$ifrmBody.scrollLeft();t.$docBody.append("<span data-guid='"+t.guid+"' class='td-resize-selector' style='position:absolute;top:"+(i.top+e.top-o+h)+"px;left:"+(i.left+e.left-s+l)+"px;border:solid 2px red;width:6px;height:6px;cursor:se-resize;z-index:1;'><\/span>");t.$docBody.append("<span data-guid='"+t.guid+"' class='td-resize-region' style='position:absolute;top:"+(i.top+e.top-o)+"px;left:"+(i.left+e.left-s)+"px;border:dashed 1px green;width:"+l+"px;height:0px;'><\/span>");t.$docBody.append("<span data-guid='"+t.guid+"' class='td-resize-region' style='position:absolute;top:"+(i.top+e.top-o)+"px;left:"+(i.left+e.left-s)+"px;border:dashed 1px green;width:0px;height:"+h+"px;'><\/span>");t.$docBody.append("<span data-guid='"+t.guid+"' class='td-resize-region' style='position:absolute;top:"+(i.top+e.top-o)+"px;left:"+(i.left+e.left-s+l)+"px;border:dashed 1px green;width:0px;height:"+h+"px;'><\/span>");t.$docBody.append("<span data-guid='"+t.guid+"' class='td-resize-region' style='position:absolute;top:"+(i.top+e.top-o+h)+"px;left:"+(i.left+e.left-s)+"px;border:dashed 1px green;width:"+l+"px;height:0px;'><\/span>");c=r.crc(t.$ifrmBody.html());u.afterRefresh&&u.afterRefresh(f)},reset:function(n){f!=null&&(f=null,o=!1,r.removeResizeElements(n),u.afterReset&&u.afterReset());r.rebind(n)},crc:function(n){var t=0;if(n.length==0)return t;for(i=0;i<n.length;i++)char=n.charCodeAt(i),t=(t<<5)-t+char,t=t&t;return t}},h=this,s=n(this),a=n("body"),l=s.contents().find("body");(c=r.crc(l.html()),s.is("iframe"))&&(e={ifrm:h,$ifrm:s,$docBody:a,$ifrmBody:l,guid:r.guidGenerator()},h.contentWindow.addEventListener("scroll",function(){r.reset(e)},!1),n(h.contentWindow.document).mouseup(function(t){var f,s,l,c,i;if(!o){var v=t.x?t.x:t.clientX,y=t.y?t.y:t.clientY,a=h.contentWindow.document.elementFromPoint(v,y);if(a){for(s=e.$ifrm.contents().find(u.selector),l=n(a).parents(),c=0;c<l.length;c++){for(i=0;i<s.length;i++)if(s[i]==l[c]){f=s[i];break}if(f)break}f?r.tdClick(e,f):r.reset(e)}}}),n(document).keyup(function(n){n.keyCode==27&&r.reset(e)}),h.crcChecker||(h.crcChecker=setInterval(function(){var n=r.crc(l.html());c!=n&&s.trigger("webkitresize-crcchanged",[n])},1e3)),n(window).resize(function(){r.reset(e)}),s.bind("webkitresize-crcchanged",function(n,t){c=t;r.reset(e)}),s.bind("webkitresize-updatecrc",function(n,t){c=t}),s.bind("webkitresize-table-resized",function(){r.reset(e)}),r.refresh(e))}})}}(jQuery),function(n,t){function e(n,t){var i=this;return i.options=n||f,i.options.keepAspectRatio=i.options.keepAspectRatio||f.keepAspectRatio,i.options.selectedAspectRatioValue=i.options.selectedAspectRatioValue||f.selectedAspectRatioValue,i.options.maxWidth=i.options.maxWidth||f.maxWidth,i.options.maxHeight=i.options.maxHeight||f.maxHeight,i.options.aspectRatios=i.options.aspectRatios||f.aspectRatios,i.options.loadingImagePath=i.options.loadingImagePath||f.loadingImagePath,i.options.errorImagePath=i.options.errorImagePath||f.errorImagePath,i.options.onInitializationComplete=i.options.onInitializationComplete||f.onInitializationComplete,i._container=t instanceof jQuery?t:$(t),i._createUI(),i}var f={imagePath:"",keepAspectRatio:!0,fixedAspectRatio:!1,selectedAspectRatioValue:0,maxWidth:400,maxHeight:300,loadingImagePath:t,errorImagePath:"data:image/gif;base64,R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs=",aspectRatios:[{caption:"Ίδια με εικόνα",value:0},{caption:"1:1",value:1},{caption:"4:3",value:4/3},{caption:"16:9",value:16/9}],onInitializationComplete:t},i="",u,r;i+='<section class="image-cropper">';i+="    <table>";i+="        <tr>";i+='            <td class="imageContainer">';i+='                <img src="" class="image" />';i+="            <\/td>";i+='            <td class="previewContainer">';i+='                <div style="margin: 0 0 0 20px; width: 200px; text-align: center">';i+='                    <div class="preview" style="width: 200px; height: 200px; vertical-align:center;">';i+="                    <\/div>";i+='                    <a class="result" href="#" target="_blank">Κλικ για προεπισκόπιση εικόνας σε νέο παράθυρο<\/a><br />';i+="                <\/div>";i+="            <\/td>";i+="        <\/tr>";i+="        <tr>";i+='           <td style="padding-top:10px;" align="right"><label for="aspectRatiosList" style="display:inline;">Αναλογία: <\/label><select id="aspectRatiosList" class="aspectRatiosList" style="width:auto;"><\/select><\/td>';i+='           <td style="padding-top:10px;position:relative;display:none" align="right"><input id="keepAspectRatio" type="checkbox" class="keepAspectRatio" /><label for="keepAspectRatio" style="display:inline;" class="check">Κλείδωμα αναλογίας<\/label><\/td>';i+="        <\/tr>";i+="    <\/table>";i+="<\/section>";u="";u+="        .image-cropper table {";u+="            width: 100%;";u+="        }";u+="        .image-cropper .previewContainer {";u+="            width:200px;";u+="        }";u+="        .image-cropper .imageContainer,";u+="        .image-cropper .jcrop-holder {";u+="            margin:0 auto;";u+="        };";r=e.prototype;r._container=t;r._image=t;r._originalRatio=t;r._jcrop_reference=t;r._jcrop_preview_reference=t;r._ratioList=t;r._selectedAspectRatio=t;r._keepRatio=t;r.result=t;r.SetImage=function(n){var r=this,t=n,i;t&&(t.indexOf("?")>0&&(t=t.substr(0,t.indexOf("?"))),t.indexOf(";")>0&&(t=t.substr(0,t.indexOf(";"))),t.substr(0,1)=="~"&&(t=t.substr(1,t.length)));var u=$(r._container.find(".imageContainer")),e=u.width(),f=u.height(),o=$("<div><img src='"+r.options.loadingImagePath+"' alt='Loading...' />").css({width:e+"px",height:f+"px","line-height":f+"px","text-align":"center",margin:"0 auto"});return u.append(o),i=$("<img/>"),i.addClass("image"),i.load(function(){i.unbind("load");i.unbind("error");u.empty();u.append(i);r._container.fadeIn(function(){r._init()})}).error(function(){i.unbind("load");i.unbind("error");u.empty();u.append(i);i.prop("src",r.options.errorImagePath).prop("width","400").prop("height","300");r._init()}),i.prop("src",t+"?maxwidth="+r.options.maxWidth+"&maxheight="+r.options.maxHeight),r};r._createUI=function(){var n=this,t;return n._container.empty(),t=$("<style type='text/css'><\/style>"),t.text(u),n._container.append(t),n._container.append(i),n._ratioList=n._container.find(".aspectRatiosList"),n.options.aspectRatios&&n.options.aspectRatios.length>0?($.each(n.options.aspectRatios,function(t,i){n._ratioList.append($("<option><\/option>").val(i.value).html(i.caption))}),n._ratioList.val(n.options.selectedAspectRatioValue)):(n._ratioList.append($("<option><\/option>").val(0).html("Ίδια με εικόνα")),n._ratioList.val(0)),n._ratioList.change(function(){n.options.selectedAspectRatioValue=n._ratioList.val();n._jcrop_reference.setOptions({aspectRatio:n._keepRatio?parseFloat(n._ratioList.val()):null});n._jcrop_reference.focus()}),n};r._init=function(){var n=this,t,u,r,f,i;n._image=n._container.find("img.image");n._originalRatio=n._image.width()/n._image.height();n._container.find(".keepAspectRatio").prop("checked",n.options.keepAspectRatio);n._keepRatio=n._container.find(".keepAspectRatio").size()<1?n.options.keepAspectRatio:n._container.find(".keepAspectRatio").is(":checked");t=n._image.attr("src");t.indexOf("?")>0&&(t=t.substr(0,t.indexOf("?")));t.indexOf(";")>0&&(t=t.substr(0,t.indexOf(";")));u=n._image.attr("src").indexOf(";")>-1;n._jcrop_preview_reference||(r=n._container.find("div.preview"),n._jcrop_preview_reference=r.JcropPreview({jcropImg:n._image}));f=n._container.find("a.result");i=function(i){if(!(parseInt(i.w)<=0)&&!(parseInt(i.h)<=0)){r.JcropPreviewUpdate(i);var e="?",o=n._container.find("input.width"),s=n._container.find("input.height");e+="crop=("+i.x+","+i.y+","+i.x2+","+i.y2+")&cropxunits="+n._image.width()+"&cropyunits="+n._image.height();u&&(e=e.replace(/\?\&/g,";"));f.attr("href",t+e);n.result=t+e;n.result&&n.result.indexOf("data:image/gif")==0&&(n.result=null)}};n._jcrop_reference&&n._jcrop_reference.destroy();n._jcrop_reference=$.Jcrop(n._image);n._jcrop_reference.setOptions({onChange:i,onSelect:i,aspectRatio:n._keepRatio?n._originalRatio:null,bgColor:"black",bgOpacity:.6,setSelect:[0,0,3600,3600]});i({x:0,y:0,x2:n._image.width(),y2:n._image.height(),w:n._image.width(),h:n._image.height()});n._container.find(".keepAspectRatio").change(function(){n._keepRatio=this.checked;n._jcrop_reference.setOptions({aspectRatio:n._keepRatio?n._originalRatio:null});n._jcrop_reference.focus()});n._jcrop_reference.setOptions({setSelect:[0,0,3600]});n.options.onInitializationComplete&&n.options.onInitializationComplete()};r.destroy=function(){var n=this;n._container&&(n._container.remove(),n._container=t);n._jcrop_preview_reference=null;n._jcrop_reference&&(n._jcrop_reference.destroy(),n._jcrop_reference=t)};n.ImageCrop=e}(window.CAPITALMVC=window.CAPITALMVC||{}),function(n,t){function f(n,t){var i=this;return i._container=$(t),n&&(n.url&&(i._url=n.url),n.finishedCallback&&(i._uploadFinishedCallback=n.finishedCallback)),i._createUI()._init(),i}var i="",u,r;i+='    <section class="image-uploader textCenter">';i+='        <span class="errormessage"><\/span>';i+="        <p>";i+='           <label for="fileupload" class="tag block"><strong>ΕΠΙΛΕΞΤΕ ΕΙΚΟΝΑ ΑΠΟ ΤΟ ΔΙΣΚΟ Η ΚΑΝΤΕ DRAG & DROP<strong><\/label><br/>';i+='           <input id="fileupload" type="file" name="files[]" data-url="/FileUpload/Upload" />';i+="        <\/p>";i+='        <div id="progress">';i+='            <div class="bar" style="width: 0%;"><\/div>';i+="        <\/div>";i+="    <\/section>";i+="";u="";u+=".image-uploader #progress .bar {";u+="    height: 18px;";u+="    background: green;";u+="}";r=f.prototype;r._container=t;r._url=t;r._uploadFinishedCallback=t;r._allowedExtensions=t;r._createUI=function(){var n=this,t;return n._container.empty(),t=$("<style type='text/css'><\/style>"),t.text(u),n._container.append(t),n._container.append(i),n};r._init=function(){var n=this;n._container.find(".image-uploader").fileupload({url:n._url,dataType:"json",add:function(t,i){var r=i.files[0];if(!/\.(gif|jpg|jpeg|png)$/i.test(r.name)){n._notifyError("Μη επιτρεπόμενο αρχείο. Ανεβάστε μόνο αρχεία εκόνας τύπου JPG, GIF, PNG.");return}if(r.size>1048576){n._notifyError("Το αρχείο είναι πολύ μεγάλο. Το μέγιστο επιτρεπόμενο μέγεθος αρχείου είναι 1MB");return}i.submit()},start:function(){n._container.find(".image-uploader .errormessage").empty()},done:function(t,i){console&&console.log(i);i.textStatus=="success"&&n._uploadFinishedCallback&&n._uploadFinishedCallback(i.result.data)},fail:function(t,i){i&&i.jqXHR&&i.jqXHR.responseJSON.textStatus=="error"?n._notifyError(i.jqXHR.responseJSON.data):n._notifyError("Παρουσιάστηκε σφάλμα. "+i.jqXHR.statusText)},progressall:function(n,t){var i=parseInt(t.loaded/t.total*100,10);$("#progress .bar").css("width",i+"%")}});r._notifyError=function(t){n._container.find(".image-uploader .errormessage").html(t)}};r.destroy=function(){this._container.find(".image-uploader").fileupload("destroy");this._container.remove()};n.ImageUpload=f}(window.CAPITALMVC=window.CAPITALMVC||{}),function(n){"use strict";typeof define=="function"&&define.amd?define(["jquery"],n):n(window.jQuery)}(function(n){"use strict";var t=0;n.ajaxTransport("iframe",function(i){if(i.async){var r,u,f;return{send:function(e,o){r=n('<form style="display:none;"><\/form>');r.attr("accept-charset",i.formAcceptCharset);f=/\?/.test(i.url)?"&":"?";i.type==="DELETE"?(i.url=i.url+f+"_method=DELETE",i.type="POST"):i.type==="PUT"?(i.url=i.url+f+"_method=PUT",i.type="POST"):i.type==="PATCH"&&(i.url=i.url+f+"_method=PATCH",i.type="POST");t+=1;u=n('<iframe src="javascript:false;" name="iframe-transport-'+t+'"><\/iframe>').bind("load",function(){var t,f=n.isArray(i.paramName)?i.paramName:[i.paramName];u.unbind("load").bind("load",function(){var t;try{if(t=u.contents(),!t.length||!t[0].firstChild)throw new Error;}catch(i){t=undefined}o(200,"success",{iframe:t});n('<iframe src="javascript:false;"><\/iframe>').appendTo(r);window.setTimeout(function(){r.remove()},0)});r.prop("target",u.prop("name")).prop("action",i.url).prop("method",i.type);i.formData&&n.each(i.formData,function(t,i){n('<input type="hidden"/>').prop("name",i.name).val(i.value).appendTo(r)});i.fileInput&&i.fileInput.length&&i.type==="POST"&&(t=i.fileInput.clone(),i.fileInput.after(function(n){return t[n]}),i.paramName&&i.fileInput.each(function(t){n(this).prop("name",f[t]||i.paramName)}),r.append(i.fileInput).prop("enctype","multipart/form-data").prop("encoding","multipart/form-data"));r.submit();t&&t.length&&i.fileInput.each(function(i,r){var u=n(t[i]);n(r).prop("name",u.prop("name"));u.replaceWith(r)})});r.append(u).appendTo(document.body)},abort:function(){u&&u.unbind("load").prop("src","javascript".concat(":false;"));r&&r.remove()}}}});n.ajaxSetup({converters:{"iframe text":function(t){return t&&n(t[0].body).text()},"iframe json":function(t){return t&&n.parseJSON(n(t[0].body).text())},"iframe html":function(t){return t&&n(t[0].body).html()},"iframe xml":function(t){var i=t&&t[0];return i&&n.isXMLDoc(i)?i:n.parseXML(i.XMLDocument&&i.XMLDocument.xml||n(i.body).html())},"iframe script":function(t){return t&&n.globalEval(n(t[0].body).text())}}})}),function(n){"use strict";typeof define=="function"&&define.amd?define(["jquery","jquery.ui.widget"],n):n(window.jQuery)}(function(n){"use strict";n.support.fileInput=!(new RegExp("(Android (1\\.[0156]|2\\.[01]))|(Windows Phone (OS 7|8\\.0))|(XBLWP)|(ZuneWP)|(WPDesktop)|(w(eb)?OSBrowser)|(webOS)|(Kindle/(1\\.0|2\\.[05]|3\\.0))").test(window.navigator.userAgent)||n('<input type="file">').prop("disabled"));n.support.xhrFileUpload=!!(window.XMLHttpRequestUpload&&window.FileReader);n.support.xhrFormDataFileUpload=!!window.FormData;n.support.blobSlice=window.Blob&&(Blob.prototype.slice||Blob.prototype.webkitSlice||Blob.prototype.mozSlice);n.widget("blueimp.fileupload",{options:{dropZone:n(document),pasteZone:n(document),fileInput:undefined,replaceFileInput:!0,paramName:undefined,singleFileUploads:!0,limitMultiFileUploads:undefined,sequentialUploads:!1,limitConcurrentUploads:undefined,forceIframeTransport:!1,redirect:undefined,redirectParamName:undefined,postMessage:undefined,multipart:!0,maxChunkSize:undefined,uploadedBytes:undefined,recalculateProgress:!0,progressInterval:100,bitrateInterval:500,autoUpload:!0,messages:{uploadedBytes:"Uploaded bytes exceed file size"},i18n:function(t,i){return t=this.messages[t]||t.toString(),i&&n.each(i,function(n,i){t=t.replace("{"+n+"}",i)}),t},formData:function(n){return n.serializeArray()},add:function(t,i){(i.autoUpload||i.autoUpload!==!1&&n(this).fileupload("option","autoUpload"))&&i.process().done(function(){i.submit()})},processData:!1,contentType:!1,cache:!1},_specialOptions:["fileInput","dropZone","pasteZone","multipart","forceIframeTransport"],_blobSlice:n.support.blobSlice&&function(){var n=this.slice||this.webkitSlice||this.mozSlice;return n.apply(this,arguments)},_BitrateTimer:function(){this.timestamp=Date.now?Date.now():(new Date).getTime();this.loaded=0;this.bitrate=0;this.getBitrate=function(n,t,i){var r=n-this.timestamp;return(!this.bitrate||!i||r>i)&&(this.bitrate=(t-this.loaded)*(1e3/r)*8,this.loaded=t,this.timestamp=n),this.bitrate}},_isXHRUpload:function(t){return!t.forceIframeTransport&&(!t.multipart&&n.support.xhrFileUpload||n.support.xhrFormDataFileUpload)},_getFormData:function(t){var i;return typeof t.formData=="function"?t.formData(t.form):n.isArray(t.formData)?t.formData:n.type(t.formData)==="object"?(i=[],n.each(t.formData,function(n,t){i.push({name:n,value:t})}),i):[]},_getTotal:function(t){var i=0;return n.each(t,function(n,t){i+=t.size||1}),i},_initProgressObject:function(t){var i={loaded:0,total:0,bitrate:0};t._progress?n.extend(t._progress,i):t._progress=i},_initResponseObject:function(n){var t;if(n._response)for(t in n._response)n._response.hasOwnProperty(t)&&delete n._response[t];else n._response={}},_onProgress:function(n,t){if(n.lengthComputable){var i=Date.now?Date.now():(new Date).getTime(),r;if(t._time&&t.progressInterval&&i-t._time<t.progressInterval&&n.loaded!==n.total)return;t._time=i;r=Math.floor(n.loaded/n.total*(t.chunkSize||t._progress.total))+(t.uploadedBytes||0);this._progress.loaded+=r-t._progress.loaded;this._progress.bitrate=this._bitrateTimer.getBitrate(i,this._progress.loaded,t.bitrateInterval);t._progress.loaded=t.loaded=r;t._progress.bitrate=t.bitrate=t._bitrateTimer.getBitrate(i,r,t.bitrateInterval);this._trigger("progress",n,t);this._trigger("progressall",n,this._progress)}},_initProgressListener:function(t){var r=this,i=t.xhr?t.xhr():n.ajaxSettings.xhr();i.upload&&(n(i.upload).bind("progress",function(n){var i=n.originalEvent;n.lengthComputable=i.lengthComputable;n.loaded=i.loaded;n.total=i.total;r._onProgress(n,t)}),t.xhr=function(){return i})},_isInstanceOf:function(n,t){return Object.prototype.toString.call(t)==="[object "+n+"]"},_initXHRData:function(t){var f=this,i,r=t.files[0],e=t.multipart||!n.support.xhrFileUpload,u=t.paramName[0];t.headers=n.extend({},t.headers);t.contentRange&&(t.headers["Content-Range"]=t.contentRange);e&&!t.blob&&this._isInstanceOf("File",r)||(t.headers["Content-Disposition"]='attachment; filename="'+encodeURI(r.name)+'"');e?n.support.xhrFormDataFileUpload&&(t.postMessage?(i=this._getFormData(t),t.blob?i.push({name:u,value:t.blob}):n.each(t.files,function(n,r){i.push({name:t.paramName[n]||u,value:r})})):(f._isInstanceOf("FormData",t.formData)?i=t.formData:(i=new FormData,n.each(this._getFormData(t),function(n,t){i.append(t.name,t.value)})),t.blob?i.append(u,t.blob,r.name):n.each(t.files,function(n,r){(f._isInstanceOf("File",r)||f._isInstanceOf("Blob",r))&&i.append(t.paramName[n]||u,r,r.name)})),t.data=i):(t.contentType=r.type,t.data=t.blob||r);t.blob=null},_initIframeSettings:function(t){var i=n("<a><\/a>").prop("href",t.url).prop("host");t.dataType="iframe "+(t.dataType||"");t.formData=this._getFormData(t);t.redirect&&i&&i!==location.host&&t.formData.push({name:t.redirectParamName||"redirect",value:t.redirect})},_initDataSettings:function(n){this._isXHRUpload(n)?(this._chunkedUpload(n,!0)||(n.data||this._initXHRData(n),this._initProgressListener(n)),n.postMessage&&(n.dataType="postmessage "+(n.dataType||""))):this._initIframeSettings(n)},_getParamName:function(t){var r=n(t.fileInput),i=t.paramName;return i?n.isArray(i)||(i=[i]):(i=[],r.each(function(){for(var t=n(this),u=t.prop("name")||"files[]",r=(t.prop("files")||[1]).length;r;)i.push(u),r-=1}),i.length||(i=[r.prop("name")||"files[]"])),i},_initFormSettings:function(t){t.form&&t.form.length||(t.form=n(t.fileInput.prop("form")),t.form.length||(t.form=n(this.options.fileInput.prop("form"))));t.paramName=this._getParamName(t);t.url||(t.url=t.form.prop("action")||location.href);t.type=(t.type||n.type(t.form.prop("method"))==="string"&&t.form.prop("method")||"").toUpperCase();t.type!=="POST"&&t.type!=="PUT"&&t.type!=="PATCH"&&(t.type="POST");t.formAcceptCharset||(t.formAcceptCharset=t.form.attr("accept-charset"))},_getAJAXSettings:function(t){var i=n.extend({},this.options,t);return this._initFormSettings(i),this._initDataSettings(i),i},_getDeferredState:function(n){return n.state?n.state():n.isResolved()?"resolved":n.isRejected()?"rejected":"pending"},_enhancePromise:function(n){return n.success=n.done,n.error=n.fail,n.complete=n.always,n},_getXHRPromise:function(t,i,r){var u=n.Deferred(),f=u.promise();return i=i||this.options.context||f,t===!0?u.resolveWith(i,r):t===!1&&u.rejectWith(i,r),f.abort=u.promise,this._enhancePromise(f)},_addConvenienceMethods:function(t,i){var r=this,u=function(t){return n.Deferred().resolveWith(r,[t]).promise()};i.process=function(n,t){return(n||t)&&(i._processQueue=this._processQueue=(this._processQueue||u(this)).pipe(n,t)),this._processQueue||u(this)};i.submit=function(){return this.state()!=="pending"&&(i.jqXHR=this.jqXHR=r._trigger("submit",t,this)!==!1&&r._onSend(t,this)),this.jqXHR||r._getXHRPromise()};i.abort=function(){return this.jqXHR?this.jqXHR.abort():r._getXHRPromise()};i.state=function(){return this.jqXHR?r._getDeferredState(this.jqXHR):this._processQueue?r._getDeferredState(this._processQueue):void 0};i.progress=function(){return this._progress};i.response=function(){return this._response}},_getUploadedBytes:function(n){var i=n.getResponseHeader("Range"),t=i&&i.split("-"),r=t&&t.length>1&&parseInt(t[1],10);return r&&r+1},_chunkedUpload:function(t,i){t.uploadedBytes=t.uploadedBytes||0;var u=this,f=t.files[0],e=f.size,r=t.uploadedBytes,c=t.maxChunkSize||e,l=this._blobSlice,o=n.Deferred(),s=o.promise(),a,h;return!(this._isXHRUpload(t)&&l&&(r||c<e))||t.data?!1:i?!0:r>=e?(f.error=t.i18n("uploadedBytes"),this._getXHRPromise(!1,t.context,[null,"error",f.error])):(h=function(){var i=n.extend({},t),s=i._progress.loaded;i.blob=l.call(f,r,r+c,f.type);i.chunkSize=i.blob.size;i.contentRange="bytes "+r+"-"+(r+i.chunkSize-1)+"/"+e;u._initXHRData(i);u._initProgressListener(i);a=(u._trigger("chunksend",null,i)!==!1&&n.ajax(i)||u._getXHRPromise(!1,i.context)).done(function(f,c,l){r=u._getUploadedBytes(l)||r+i.chunkSize;s+i.chunkSize-i._progress.loaded&&u._onProgress(n.Event("progress",{lengthComputable:!0,loaded:r-i.uploadedBytes,total:r-i.uploadedBytes}),i);t.uploadedBytes=i.uploadedBytes=r;i.result=f;i.textStatus=c;i.jqXHR=l;u._trigger("chunkdone",null,i);u._trigger("chunkalways",null,i);r<e?h():o.resolveWith(i.context,[f,c,l])}).fail(function(n,t,r){i.jqXHR=n;i.textStatus=t;i.errorThrown=r;u._trigger("chunkfail",null,i);u._trigger("chunkalways",null,i);o.rejectWith(i.context,[n,t,r])})},this._enhancePromise(s),s.abort=function(){return a.abort()},h(),s)},_beforeSend:function(n,t){this._active===0&&(this._trigger("start"),this._bitrateTimer=new this._BitrateTimer,this._progress.loaded=this._progress.total=0,this._progress.bitrate=0);this._initResponseObject(t);this._initProgressObject(t);t._progress.loaded=t.loaded=t.uploadedBytes||0;t._progress.total=t.total=this._getTotal(t.files)||1;t._progress.bitrate=t.bitrate=0;this._active+=1;this._progress.loaded+=t.loaded;this._progress.total+=t.total},_onDone:function(t,i,r,u){var f=u._progress.total,e=u._response;u._progress.loaded<f&&this._onProgress(n.Event("progress",{lengthComputable:!0,loaded:f,total:f}),u);e.result=u.result=t;e.textStatus=u.textStatus=i;e.jqXHR=u.jqXHR=r;this._trigger("done",null,u)},_onFail:function(n,t,i,r){var u=r._response;r.recalculateProgress&&(this._progress.loaded-=r._progress.loaded,this._progress.total-=r._progress.total);u.jqXHR=r.jqXHR=n;u.textStatus=r.textStatus=t;u.errorThrown=r.errorThrown=i;this._trigger("fail",null,r)},_onAlways:function(n,t,i,r){this._trigger("always",null,r)},_onSend:function(t,i){i.submit||this._addConvenienceMethods(t,i);var r=this,f,s,e,h,u=r._getAJAXSettings(i),o=function(){return r._sending+=1,u._bitrateTimer=new r._BitrateTimer,f=f||((s||r._trigger("send",t,u)===!1)&&r._getXHRPromise(!1,u.context,s)||r._chunkedUpload(u)||n.ajax(u)).done(function(n,t,i){r._onDone(n,t,i,u)}).fail(function(n,t,i){r._onFail(n,t,i,u)}).always(function(n,t,i){if(r._onAlways(n,t,i,u),r._sending-=1,r._active-=1,u.limitConcurrentUploads&&u.limitConcurrentUploads>r._sending)for(var f=r._slots.shift();f;){if(r._getDeferredState(f)==="pending"){f.resolve();break}f=r._slots.shift()}r._active===0&&r._trigger("stop")})};return(this._beforeSend(t,u),this.options.sequentialUploads||this.options.limitConcurrentUploads&&this.options.limitConcurrentUploads<=this._sending)?(this.options.limitConcurrentUploads>1?(e=n.Deferred(),this._slots.push(e),h=e.pipe(o)):(this._sequence=this._sequence.pipe(o,o),h=this._sequence),h.abort=function(){return(s=[undefined,"abort","abort"],!f)?(e&&e.rejectWith(u.context,s),o()):f.abort()},this._enhancePromise(h)):o()},_onAdd:function(t,i){var s=this,l=!0,u=n.extend({},this.options,i),f=u.limitMultiFileUploads,h=this._getParamName(u),e,c,o,r;if((u.singleFileUploads||f)&&this._isXHRUpload(u))if(!u.singleFileUploads&&f)for(o=[],e=[],r=0;r<i.files.length;r+=f)o.push(i.files.slice(r,r+f)),c=h.slice(r,r+f),c.length||(c=h),e.push(c);else e=h;else o=[i.files],e=[h];return i.originalFiles=i.files,n.each(o||i.files,function(r,u){var f=n.extend({},i);return f.files=o?u:[u],f.paramName=e[r],s._initResponseObject(f),s._initProgressObject(f),s._addConvenienceMethods(t,f),l=s._trigger("add",t,f)}),l},_replaceFileInput:function(t){var i=t.clone(!0);n("<form><\/form>").append(i)[0].reset();t.after(i).detach();n.cleanData(t.unbind("remove"));this.options.fileInput=this.options.fileInput.map(function(n,r){return r===t[0]?i[0]:r});t[0]===this.element[0]&&(this.element=i)},_handleFileTreeEntry:function(t,i){var e=this,r=n.Deferred(),u=function(n){n&&!n.entry&&(n.entry=t);r.resolve([n])},f;return i=i||"",t.isFile?t._file?(t._file.relativePath=i,r.resolve(t._file)):t.file(function(n){n.relativePath=i;r.resolve(n)},u):t.isDirectory?(f=t.createReader(),f.readEntries(function(n){e._handleFileTreeEntries(n,i+t.name+"/").done(function(n){r.resolve(n)}).fail(u)},u)):r.resolve([]),r.promise()},_handleFileTreeEntries:function(t,i){var r=this;return n.when.apply(n,n.map(t,function(n){return r._handleFileTreeEntry(n,i)})).pipe(function(){return Array.prototype.concat.apply([],arguments)})},_getDroppedFiles:function(t){t=t||{};var i=t.items;return i&&i.length&&(i[0].webkitGetAsEntry||i[0].getAsEntry)?this._handleFileTreeEntries(n.map(i,function(n){var t;return n.webkitGetAsEntry?(t=n.webkitGetAsEntry(),t&&(t._file=n.getAsFile()),t):n.getAsEntry()})):n.Deferred().resolve(n.makeArray(t.files)).promise()},_getSingleFileInputFiles:function(t){t=n(t);var r=t.prop("webkitEntries")||t.prop("entries"),i,u;if(r&&r.length)return this._handleFileTreeEntries(r);if(i=n.makeArray(t.prop("files")),i.length)i[0].name===undefined&&i[0].fileName&&n.each(i,function(n,t){t.name=t.fileName;t.size=t.fileSize});else{if(u=t.prop("value"),!u)return n.Deferred().resolve([]).promise();i=[{name:u.replace(/^.*\\/,"")}]}return n.Deferred().resolve(i).promise()},_getFileInputFiles:function(t){return!(t instanceof n)||t.length===1?this._getSingleFileInputFiles(t):n.when.apply(n,n.map(t,this._getSingleFileInputFiles)).pipe(function(){return Array.prototype.concat.apply([],arguments)})},_onChange:function(t){var r=this,i={fileInput:n(t.target),form:n(t.target.form)};this._getFileInputFiles(i.fileInput).always(function(n){i.files=n;r.options.replaceFileInput&&r._replaceFileInput(i.fileInput);r._trigger("change",t,i)!==!1&&r._onAdd(t,i)})},_onPaste:function(t){var i=t.originalEvent&&t.originalEvent.clipboardData&&t.originalEvent.clipboardData.items,r={files:[]};i&&i.length&&(n.each(i,function(n,t){var i=t.getAsFile&&t.getAsFile();i&&r.files.push(i)}),this._trigger("paste",t,r)!==!1&&this._onAdd(t,r))},_onDrop:function(n){n.dataTransfer=n.originalEvent&&n.originalEvent.dataTransfer;var r=this,t=n.dataTransfer,i={};t&&t.files&&t.files.length&&(n.preventDefault(),this._getDroppedFiles(t).always(function(t){i.files=t;r._trigger("drop",n,i)!==!1&&r._onAdd(n,i)}))},_onDragOver:function(t){t.dataTransfer=t.originalEvent&&t.originalEvent.dataTransfer;var i=t.dataTransfer,r={dropEffect:"copy",preventDefault:!0};i&&n.inArray("Files",i.types)!==-1&&this._trigger("dragover",t,r)!==!1&&(i.dropEffect=r.dropEffect,r.preventDefault&&t.preventDefault())},_initEventHandlers:function(){this._isXHRUpload(this.options)&&(this._on(this.options.dropZone,{dragover:this._onDragOver,drop:this._onDrop}),this._on(this.options.pasteZone,{paste:this._onPaste}));n.support.fileInput&&this._on(this.options.fileInput,{change:this._onChange})},_destroyEventHandlers:function(){this._off(this.options.dropZone,"dragover drop");this._off(this.options.pasteZone,"paste");this._off(this.options.fileInput,"change")},_setOption:function(t,i){var r=n.inArray(t,this._specialOptions)!==-1;r&&this._destroyEventHandlers();this._super(t,i);r&&(this._initSpecialOptions(),this._initEventHandlers())},_initSpecialOptions:function(){var t=this.options;t.fileInput===undefined?t.fileInput=this.element.is('input[type="file"]')?this.element:this.element.find('input[type="file"]'):t.fileInput instanceof n||(t.fileInput=n(t.fileInput));t.dropZone instanceof n||(t.dropZone=n(t.dropZone));t.pasteZone instanceof n||(t.pasteZone=n(t.pasteZone))},_getRegExp:function(n){var t=n.split("/"),i=t.pop();return t.shift(),new RegExp(t.join("/"),i)},_isRegExpOption:function(t,i){return t!=="url"&&n.type(i)==="string"&&/^\/.*\/[igm]{0,3}$/.test(i)},_initDataAttributes:function(){var t=this,i=this.options;n.each(n(this.element[0].cloneNode(!1)).data(),function(n,r){t._isRegExpOption(n,r)&&(r=t._getRegExp(r));i[n]=r})},_create:function(){this._initDataAttributes();this._initSpecialOptions();this._slots=[];this._sequence=this._getXHRPromise(!0);this._sending=this._active=0;this._initProgressObject(this);this._initEventHandlers()},active:function(){return this._active},progress:function(){return this._progress},add:function(t){var i=this;t&&!this.options.disabled&&(t.fileInput&&!t.files?this._getFileInputFiles(t.fileInput).always(function(n){t.files=n;i._onAdd(null,t)}):(t.files=n.makeArray(t.files),this._onAdd(null,t)))},send:function(t){if(t&&!this.options.disabled){if(t.fileInput&&!t.files){var e=this,i=n.Deferred(),r=i.promise(),u,f;return r.abort=function(){return(f=!0,u)?u.abort():(i.reject(null,"abort","abort"),r)},this._getFileInputFiles(t.fileInput).always(function(n){if(!f){if(!n.length){i.reject();return}t.files=n;u=e._onSend(null,t).then(function(n,t,r){i.resolve(n,t,r)},function(n,t,r){i.reject(n,t,r)})}}),this._enhancePromise(r)}if(t.files=n.makeArray(t.files),t.files.length)return this._onSend(null,t)}return this._getXHRPromise(!1,t&&t.context)}})}),function(n,t){"use strict";function f(n,t){var i=this;return n&&(i._options.uploadScriptPath=n.uploadScriptPath||i._options.uploadScriptPath,i._options.okButtonCaption=n.okButtonCaption||i._options.okButtonCaption,i._options.okButtonCallback=n.okButtonCallback||i._options.okButtonCallback,i._options.cancelButtonCaption=n.cancelButtonCaption||i._options.cancelButtonCaption,i._options.cancelButtonCallback=n.cancelButtonCallback||i._options.cancelButtonCallback,i._options.closeCallback=n.closeCallback||i._options.closeCallback,i._options.width=n.width||i._options.width,i._options.height=n.height||i._options.height,i._options.minWidth=n.minWidth||i._options.minWidth,i._options.minHeight=n.minHeight||i._options.minHeight,i._options.dialogTitle=n.dialogTitle||i._options.dialogTitle),i._container=$(t),i._createUI()._init(),i}var u="",i,r;u+='    <section id="dialogForCropAndResize">';u+='        <section class="screenForUpload"><\/section>';u+='        <section class="screenForCrop"><\/section>';u+="    <\/section>";u+="";i="";i+="        #dialogForCropAndResize {";i+="            display: none;";i+="        }";i+="";i+="            #dialogForCropAndResize .screenForUpload {";i+="                display: none;";i+="            }";i+="";i+="            #dialogForCropAndResize .screenForCrop {";i+="                display: none;";i+="            }";r=f.prototype;r._container=t;r._imageCropInstance=t;r._dialogInstance=t;r._imageUploadInstance=t;r._options={uploadScriptPath:null,okButtonCaption:"Αποθήκευση",okButtonCallback:t,cancelButtonCaption:"Ακύρωση",cancelButtonCallback:t,closeCallback:t,dialogTitle:"ΕΙΣΑΓΩΓΗ ΕΙΚΟΝΑΣ"};r._createUI=function(){var n=this,t;return n._container.empty(),t=$("<style type='text/css'><\/style>"),t.text(i),n._container.append(t),n._container.append($(u)),n};r._init=function(){var n=this,i=n._options.okButtonCaption,r=n._options.cancelButtonCaption;return n._dialogInstance=$("#dialogForCropAndResize").dialog({autoOpen:!1,height:n._options.height||"auto",width:n._options.width||"auto",minWidth:n._options.minWidth||"auto",minHeight:n._options.minHeight||"auto",position:["center","center"],modal:!0,title:n._options.dialogTitle,autoReposition:!0,resize:"auto",open:function(){var t=$("#dialogForCropAndResize .screenForUpload"),i=$("#dialogForCropAndResize .screenForCrop");$("#button-ok").hide();n._imageUploadInstance=new CAPITALMVC.ImageUpload({url:n._options.uploadScriptPath,finishedCallback:function(r){t.fadeOut(500,function(){n._imageCropInstance=new CAPITALMVC.ImageCrop({onInitializationComplete:function(){$.ui.dialog.forceReposition()}},i).SetImage(r);$("#button-ok").show()})}},t);t.fadeIn("500",function(){$.ui.dialog.forceReposition()})},buttons:[{id:"button-ok",text:i,click:function(){n._imageCropInstance&&n._imageCropInstance.result&&n._options.okButtonCallback&&n._options.okButtonCallback(n._imageCropInstance.result);$(this).dialog("close")}},{id:"button-cancel",text:r,click:function(){n._options.cancelButtonCallback&&n._options.cancelButtonCallback();$(this).dialog("close")}}],close:function(){n._options.closeCallback&&n._options.closeCallback();n._imageUploadInstance&&(n._imageUploadInstance.destroy(),n._imageUploadInstance=t);n._imageCropInstance&&(n._imageCropInstance.destroy(),n._imageCropInstance=t);n._dialogInstance.dialog("destroy")}}),n._dialogInstance.dialog("open"),this};r.destroy=function(){var n=this;n._imageUploadInstance&&(n._imageUploadInstance.destroy(),n._imageUploadInstance=t);n._imageCropInstance&&(n._imageCropInstance.destroy(),n._imageCropInstance=t);n._dialogInstance&&n._dialogInstance.dialog("destroy");n._container&&n._container.remove()};n.ImageUploadAndCrop=f}(window.CAPITALMVC=window.CAPITALMVC||{}),function(n){"use strict";var t=!1;n.fn.pkRate=function(i){var e,s,u;t||(e="",e+="        .rate-user span {",e+="        display: block;",e+="        float: left;",e+="        height: 13px;",e+="        width: 13px;",e+="        cursor: pointer!important;",e+="        }",e+="        .totalVotes { padding-left: 5px; }",e+="",s=n("<style type='text/css'><\/style>"),s.text(e),n("body").append(s),t=!0);var r=n.extend(!0,{totalVotes:0,ratePercentage:0,antiforgeryTokenUrl:null,voteUrl:null,rateImageUrl:null,rateImageWidth:65,rateImageHeight:39,onBeforeVoteCallback:null,onErrorCallback:null,onSuccessCallback:null,onVotesClickCallback:null,headers:null,enableRating:!0,displayTotalVotes:!0,voteCountAppendTextPlural:" ψήφοι",voteCountAppendTextSingular:" ψήφος"},i),o=r.rateImageHeight/3,f="";f+='<span class="rate-container" style="display: block; width: '+r.rateImageWidth+"px; height: "+o+"px; background: url("+r.rateImageUrl+') 0 0;">';f+='<span class="rate-current" style="display: block; float:left; height: '+o+"px; width:{0:ratePercent}%; background: url("+r.rateImageUrl+") 0 -"+o+'px;background-repeat:no-repeat; ">';f+='<span class="rate-user" style="display: block; height: '+o+"px; width:"+r.rateImageWidth+"px; background: url("+r.rateImageUrl+") -"+r.rateImageWidth+"px -"+o*2+'px;background-repeat:no-repeat; ">';f+='<span data-value="1"><\/span>';f+='<span data-value="2"><\/span>';f+='<span data-value="3"><\/span>';f+='<span data-value="4"><\/span>';f+='<span data-value="5"><\/span>';f+="<div class='clear'><\/div>";f+="<\/span>";f+="<\/span>";f+="<\/span>";r.displayTotalVotes&&r.displayTotalVotes==!0&&(f+='<span class="totalVotes">{1:totalVotes}<\/span>');r.totalVotes=r.totalVotes||0;this.html(n(f.replace("{0:ratePercent}",r.ratePercentage).replace("{1:totalVotes}",r.totalVotes<=0?"0"+r.voteCountAppendTextPlural:r.totalVotes===1?"1"+r.voteCountAppendTextSingular:r.totalVotes.formatThousands()+r.voteCountAppendTextPlural)));u=this;r.onVotesClickCallback&&u.find(".totalVotes").click(function(n){n.preventDefault();var t=r.onVotesClickCallback.bind(u);t()}).wrapInner('<a href="" data-dropdown="#votesList"><\/a>');n(this).on("click",this.find("span[data-value]"),function(t){console.log(t.target);var i=n(t.target)});n(this).on("click",this.find("span[data-value]"),function(t){t.preventDefault();var i=n(t.target);i.attr("data-value")&&r.voteUrl&&(console.log(parseInt(i.attr("data-value"),10)),u.find("span[data-value]").unbind("click").unbind("mouseover").unbind("mouseout").css("cursor","default"),n.ajax({cache:!1,dataType:"json",contentType:"application/json; charset=utf-8",url:r.voteUrl,method:"POST",headers:r.headers,beforeSend:function(n,t){if(t.data={Score:parseInt(i.attr("data-value"),10)},r.onBeforeVoteCallback){var u=r.onBeforeVoteCallback(n,t);return t.data=JSON.stringify(t.data),u}},success:function(n,t,i){var f,e;t==="success"&&(n.Error===!1?(u.attr("data-totalVotes",r.totalVotes+1),u.find(".totalVotes a").text(r.totalVotes+1===1?"1"+r.voteCountAppendTextSingular:r.totalVotes+1+r.voteCountAppendTextPlural),u.find(".rate-user").empty(),r.onSuccessCallback&&(f=r.onSuccessCallback.bind(u,n,t,i),f(n,t,i))):(console.log(i.responseJSON.ErrorMessage),r.onErrorCallback&&(e=r.onErrorCallback.bind(u,i,t,i.responseJSON.ErrorMessage),e(i,t,i.responseJSON.ErrorMessage))))},error:function(t,i,f){var e=u.find(".rate-user"),s;e.length>0&&n(e).css({backgroundPosition:"-"+r.rateImageWidth+"px -"+o*2+"px","background-position-x":"-"+r.rateImageWidth+"px","background-position-y":"-"+o*2+"px"});t.statusCode===401||f==="Unauthorized"||console&&console.log("textStatus = "+i+", errorThrown = "+f);r.onErrorCallback&&(s=r.onErrorCallback.bind(u,t,i,f),s(t,i,f))}}))});return n(this).on("mouseover",this.find("span[data-value]"),function(t){var i=n(t.target),f;t.preventDefault();f=u.find(".rate-user");f.css({backgroundPosition:((parseInt(n(i).attr("data-value"),10)-5)*(r.rateImageWidth/5)).toString()+"px -"+o*2+"px","background-position-x":((parseInt(n(i).attr("data-value"),10)-5)*(r.rateImageWidth/5)).toString()+"px","background-position-y":"-"+o*2+"px"})}).mouseout(function(t){t.preventDefault();var i=u.find(".rate-user");i.length>0&&n(i).css({backgroundPosition:"-"+r.rateImageWidth+"px -"+o*2+"px","background-position-x":"-"+r.rateImageWidth+"px","background-position-y":"-"+o*2+"px"})}),(!r.enableRating||!r.voteUrl||r.voteUrl.length<=0)&&(u.find("span[data-value]").unbind("click").unbind("mouseover").unbind("mouseout").css("cursor","default"),u.find("span.totalVotes").css("cursor","default")),this}}(jQuery);$.ajaxPrefilter(function(n){var t,i;if(n.type.toUpperCase()==="POST"){if(t=$("input[name^=__RequestVerificationToken]").first(),!t.length)return;i=t.attr("name");n.headers={__RequestVerificationToken:t.val()};n.contentType&&n.contentType.indexOf("application/json")===0?n.url+=(n.url.indexOf("?")===-1?"?":"&")+t.serialize():typeof n.data=="string"&&n.data.indexOf(i)===-1&&(n.data+=(n.data?"&":"")+t.serialize())}}),function(n){"use strict";var t="",i;t+='<section id="personalMessageDialog" class="personalMessageFormContainer" style="display:none; width:100%;">';t+='    <span id="personalMessageFormContainer"><\/span>';t+='    <div id="loaderAnimation" style="display:none; text-align:center; margin-top:100px;">';t+="        Παρακαλώ περιμένετε ";t+='        <img src="/Content/Images/progress-dots.gif" alt="Παρακαλώ περιμένετε..." />';t+="    <\/div>";t+="<\/section>";i=!1;n.fn.pkPersonalMessage=function(r){return i||(n("body").append(t),i=!0),this.each(function(t,i){function o(t){t&&t.preventDefault();n("#personalMessageDialog").dialog({title:u.dialogTitle||'Αποστολή προσωπικού μηνύματος στον "'+u.recipientNickname+'"',id:"personalMessageDialog",show:250,height:u.dialogHeight,width:u.dialogWidth,modal:!0,buttons:[{id:"button-sendPersonalMessage",text:"Αποστολή",click:function(){var t=n(this);t.find("#formForPersonalMessage").submit()},"class":"buttonS2",css:{display:"none"}},{id:"button-cancelPersonalMessage",text:"Ακύρωση",click:function(){n(this).dialog("close")}},{id:"button-dismissPersonalMessage",text:"Κλείσιμο παραθύρου",click:function(){n(this).dialog("close")},css:{display:"none"}}],open:function(){n("#personalMessageDialog #personalMessageFormContainer").empty();var t=n(this).find("#loaderAnimation");t.show();f.attr("data-originalhtml",f.html()).html(u.workingHtml||f.html()).width(e);n.get(u.formUrl).done(function(i,r){var e,h,o,s;r==="success"?(t.hide(),e=n("#personalMessageDialog #personalMessageFormContainer").html(i),u.readOnly||(e.find("input[name=subject]").val(u.subject||""),e.find("textarea").val(""),u.searchUrl&&u.searchUrl.length>0?(h=e.find("input[name=recipients]").tokenInput(u.searchUrl,{queryParam:"nickname",theme:"facebook",hintText:"Γράψτε το ψευδώνυμο του παραλήπτη",noResultsText:"Δε βρέθηκε το μέλος που ψάχνετε",tokenLimit:10,preventDuplicates:!0,jsonContainer:"ResultData",propertyToSearch:"nickname",searchingText:"Αναζήτηση...",processPrePopulate:!0}),u.recipientId&&u.recipientId>0&&h.tokenInput("add",{id:u.recipientId,nickname:u.recipientNickname,readonly:!0}),n(".token-input-dropdown-facebook").css("z-index","9999")):(e.find("input[name=recipientId]").val(u.recipientId),e.find("input[name=recipients]").hide()),n("#button-sendPersonalMessage").show()),u.hideSubjectInput&&e.find(".subjectInputs").hide(),u.displaySubject&&(o=e.find(".originalMessageContainer .subject"),o.length>0&&o.html(u.displaySubject)),u.displayMessageBody&&(e.find(".originalMessageContainer").show(),s=e.find(".originalMessageContainer .messageBody"),s.length>0&&s.html(u.displayMessageBody))):r=="nocontent"&&(n("#personalMessageDialog").dialog("close"),f.pkNotify("error","Για να στείλετε προσωπικό μήνυμα πρέπει να ανοίξετε δωρεάν λογαριασμό στο Capital.gr"))})},close:function(){var t=n(this);f.html(f.attr("data-originalhtml")).width(e);t.find("input,textarea").val("");t.find("input[name=recipientId]").val(u.recipientId);n(this).dialog("destroy")}})}var u=n.extend(!0,{readOnly:!1,recipientId:0,recipientNickname:null,formUrl:null,dialogTitle:null,dialogWidth:600,dialogHeight:500,subject:null,autoOpen:!1,displaySubject:null,displayMessageBody:null,hideSubjectInput:!1,workingHtml:"Επεξεργασία...",searchUrl:null},r),f=n(i),e=f.width();f.click(o);u.autoOpen&&o()})}}(jQuery),function(n){function h(n){return String(n===null||n===undefined?"":n)}function r(n){return h(n).replace(s,function(n){return o[n]})}var e={method:"GET",queryParam:"q",searchDelay:300,minChars:1,propertyToSearch:"name",jsonContainer:null,contentType:"json",prePopulate:null,processPrePopulate:!1,hintText:"Type in a search term",noResultsText:"No results",searchingText:"Searching...",deleteText:"&times;",animateDropdown:!0,placeholder:null,theme:null,zindex:999,resultsLimit:null,enableHTML:!1,resultsFormatter:function(n){var t=n[this.propertyToSearch];return"<li>"+(this.enableHTML?t:r(t))+"<\/li>"},tokenFormatter:function(n){var t=n[this.propertyToSearch];return"<li><p>"+(this.enableHTML?t:r(t))+"<\/p><\/li>"},tokenLimit:null,tokenDelimiter:",",preventDuplicates:!1,tokenValue:"id",allowFreeTagging:!1,allowTabOut:!1,onResult:null,onCachedResult:null,onAdd:null,onFreeTaggingAdd:null,onDelete:null,onReady:null,idPrefix:"token-input-",disabled:!1},u={tokenList:"token-input-list",token:"token-input-token",tokenReadOnly:"token-input-token-readonly",tokenDelete:"token-input-delete-token",selectedToken:"token-input-selected-token",highlightedToken:"token-input-highlighted-token",dropdown:"token-input-dropdown",dropdownItem:"token-input-dropdown-item",dropdownItem2:"token-input-dropdown-item2",selectedDropdownItem:"token-input-selected-dropdown-item",inputToken:"token-input-input-token",focused:"token-input-focused",disabled:"token-input-disabled"},i={BEFORE:0,AFTER:1,END:2},t={BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,NUMPAD_ENTER:108,COMMA:188},o={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","/":"&#x2F;"},s=/[&<>"'\/]/g,f={init:function(t,i){var r=n.extend({},e,i||{});return this.each(function(){n(this).data("settings",r);n(this).data("tokenInputObject",new n.TokenList(this,t,r))})},clear:function(){return this.data("tokenInputObject").clear(),this},add:function(n){return this.data("tokenInputObject").add(n),this},remove:function(n){return this.data("tokenInputObject").remove(n),this},get:function(){return this.data("tokenInputObject").getTokens()},toggleDisabled:function(n){return this.data("tokenInputObject").toggleDisabled(n),this},setOptions:function(t){return n(this).data("settings",n.extend({},n(this).data("settings"),t||{})),this},destroy:function(){if(this.data("tokenInputObject")){this.data("tokenInputObject").clear();var n=this,t=this.parent();return t.empty(),n.show(),t.append(n),n}}};n.fn.tokenInput=function(n){return f[n]?f[n].apply(this,Array.prototype.slice.call(arguments,1)):f.init.apply(this,arguments)};n.TokenList=function(f,e,o){function rt(t){return n(f).data("settings").enableHTML?t:r(t)}function yt(t){n(f).data("settings").disabled=typeof t=="boolean"?t:!n(f).data("settings").disabled;s.attr("disabled",n(f).data("settings").disabled);l.toggleClass(n(f).data("settings").classes.disabled,n(f).data("settings").disabled);h&&d(n(h),i.END);c.attr("disabled",n(f).data("settings").disabled)}function pt(){if(n(f).data("settings").tokenLimit!==null&&p>=n(f).data("settings").tokenLimit){s.hide();b();return}}function wt(){if(st!==(st=s.val())){var n=l.width()-s.offset().left-l.offset().left;vt.html(r(st)||r(o.placeholder));s.width(Math.min(l.width(),Math.max(n,vt.width()+30)))}}function bt(){var t=n.trim(s.val()),i=t.split(n(f).data("settings").tokenDelimiter);n.each(i,function(t,i){if(i){n.isFunction(n(f).data("settings").onFreeTaggingAdd)&&(i=n(f).data("settings").onFreeTaggingAdd.call(c,i));var r={};r[n(f).data("settings").tokenValue]=r[n(f).data("settings").propertyToSearch]=i;ut(r)}})}function kt(t){var i=n(n(f).data("settings").tokenFormatter(t)),r=t.readonly===!0?!0:!1,u;return r&&i.addClass(n(f).data("settings").classes.tokenReadOnly),i.addClass(n(f).data("settings").classes.token).insertBefore(w),r||n("<span>"+n(f).data("settings").deleteText+"<\/span>").addClass(n(f).data("settings").classes.tokenDelete).appendTo(i).click(function(){if(!n(f).data("settings").disabled)return ft(n(this).parent()),c.change(),!1}),u=t,n.data(i.get(0),"tokeninput",t),a=a.slice(0,v).concat([u]).concat(a.slice(v)),v++,dt(a,c),p+=1,n(f).data("settings").tokenLimit!==null&&p>=n(f).data("settings").tokenLimit&&(s.hide(),b()),i}function ut(t){var r=n(f).data("settings").onAdd,i;if(p>0&&n(f).data("settings").preventDuplicates&&(i=null,l.children().each(function(){var r=n(this),u=n.data(r.get(0),"tokeninput");if(u&&u[o.tokenValue]===t[o.tokenValue])return i=r,!1}),i)){tt(i);w.insertAfter(i);nt(s);return}s.width(0);(n(f).data("settings").tokenLimit==null||p<n(f).data("settings").tokenLimit)&&(kt(t),s.attr("placeholder",null),pt());s.val("");b();n.isFunction(r)&&r.call(c,t)}function tt(t){n(f).data("settings").disabled||(t.addClass(n(f).data("settings").classes.selectedToken),h=t.get(0),s.val(""),b())}function d(t,r){t.removeClass(n(f).data("settings").classes.selectedToken);h=null;r===i.BEFORE?(w.insertBefore(t),v--):r===i.AFTER?(w.insertAfter(t),v++):(w.appendTo(l),v=p);nt(s)}function ii(t){var r=h;h&&d(n(h),i.END);r===t.get(0)?d(t,i.END):tt(t)}function ft(t){var u=n.data(t.get(0),"tokeninput"),r,i;u.readonly||(r=n(f).data("settings").onDelete,i=t.prevAll().length,i>v&&i--,t.remove(),h=null,nt(s),a=a.slice(0,i).concat(a.slice(i+1)),a.length==0&&s.attr("placeholder",o.placeholder),i<v&&v--,dt(a,c),p-=1,n(f).data("settings").tokenLimit!==null&&(s.show().val(""),nt(s)),n.isFunction(r)&&r.call(c,u))}function dt(t,i){var r=n.map(t,function(t){return typeof n(f).data("settings").tokenValue=="function"?n(f).data("settings").tokenValue.call(this,t):t[n(f).data("settings").tokenValue]});i.val(r.join(n(f).data("settings").tokenDelimiter))}function b(){k.hide().empty();y=null}function et(){k.css({position:"absolute",top:l.offset().top+l.outerHeight(),left:l.offset().left,width:l.width(),"z-index":n(f).data("settings").zindex}).show()}function ri(){n(f).data("settings").searchingText&&(k.html("<p>"+rt(n(f).data("settings").searchingText)+"<\/p>"),et())}function ui(){n(f).data("settings").hintText&&(k.html("<p>"+rt(n(f).data("settings").hintText)+"<\/p>"),et())}function ni(n){return n.replace(gt,"\\$&")}function fi(n,t){return n.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+ni(t)+")(?![^<>]*>)(?![^&;]+;)","gi"),function(n,t){return"<b>"+rt(t)+"<\/b>"})}function ei(n,t,i){return n.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)("+ni(t)+")(?![^<>]*>)(?![^&;]+;)","g"),fi(t,i))}function ht(t,i){if(i&&i.length){k.empty();var r=n("<ul>").appendTo(k).mouseover(function(t){ct(n(t.target).closest("li"))}).mousedown(function(t){return ut(n(t.target).closest("li").data("tokeninput")),c.change(),!1}).hide();n(f).data("settings").resultsLimit&&i.length>n(f).data("settings").resultsLimit&&(i=i.slice(0,n(f).data("settings").resultsLimit));n.each(i,function(i,u){var e=n(f).data("settings").resultsFormatter(u);e=ei(e,u[n(f).data("settings").propertyToSearch],t);e=n(e).appendTo(r);i%2?e.addClass(n(f).data("settings").classes.dropdownItem):e.addClass(n(f).data("settings").classes.dropdownItem2);i===0&&ct(e);n.data(e.get(0),"tokeninput",u)});et();n(f).data("settings").animateDropdown?r.slideDown("fast"):r.show()}else n(f).data("settings").noResultsText&&(k.html("<p>"+rt(n(f).data("settings").noResultsText)+"<\/p>"),et())}function ct(t){t&&(y&&oi(n(y)),t.addClass(n(f).data("settings").classes.selectedDropdownItem),y=t.get(0))}function oi(t){t.removeClass(n(f).data("settings").classes.selectedDropdownItem);y=null}function ti(){var t=s.val();t&&t.length&&(h&&d(n(h),i.AFTER),t.length>=n(f).data("settings").minChars?(ri(),clearTimeout(at),at=setTimeout(function(){si(t)},n(f).data("settings").searchDelay)):b())}function si(t){var h=t+lt(),u=ot.get(h),e,i,l,a,r;if(u)n.isFunction(n(f).data("settings").onCachedResult)&&(u=n(f).data("settings").onCachedResult.call(c,u)),ht(t,u);else if(n(f).data("settings").url){if(e=lt(),i={},i.data={},e.indexOf("?")>-1?(l=e.split("?"),i.url=l[0],a=l[1].split("&"),n.each(a,function(n,t){var r=t.split("=");i.data[r[0]]=r[1]})):i.url=e,i.data[n(f).data("settings").queryParam]=t,i.type=n(f).data("settings").method,i.dataType=n(f).data("settings").contentType,n(f).data("settings").crossDomain&&(i.dataType="jsonp"),i.success=function(i){ot.add(h,n(f).data("settings").jsonContainer?i[n(f).data("settings").jsonContainer]:i);n.isFunction(n(f).data("settings").onResult)&&(i=n(f).data("settings").onResult.call(c,i));s.val()===t&&ht(t,n(f).data("settings").jsonContainer?i[n(f).data("settings").jsonContainer]:i)},o.onSend)o.onSend(i);n.ajax(i)}else n(f).data("settings").local_data&&(r=n.grep(n(f).data("settings").local_data,function(i){return i[n(f).data("settings").propertyToSearch].toLowerCase().indexOf(t.toLowerCase())>-1}),ot.add(h,r),n.isFunction(n(f).data("settings").onResult)&&(r=n(f).data("settings").onResult.call(c,r)),ht(t,r))}function lt(){var t=n(f).data("settings").url;return typeof n(f).data("settings").url=="function"&&(t=n(f).data("settings").url.call(n(f).data("settings"))),t}function nt(n){setTimeout(function(){n.focus()},50)}var it,g,gt;n.type(e)==="string"||n.type(e)==="function"?(n(f).data("settings").url=e,it=lt(),n(f).data("settings").crossDomain===undefined&&typeof it=="string"&&(n(f).data("settings").crossDomain=it.indexOf("://")===-1?!1:location.href.split(/\/+/g)[1]!==it.split(/\/+/g)[1])):typeof e=="object"&&(n(f).data("settings").local_data=e);n(f).data("settings").classes?n(f).data("settings").classes=n.extend({},u,n(f).data("settings").classes):n(f).data("settings").theme?(n(f).data("settings").classes={},n.each(u,function(t,i){n(f).data("settings").classes[t]=i+"-"+n(f).data("settings").theme})):n(f).data("settings").classes=u;var a=[],p=0,ot=new n.TokenList.Cache,at,st,s=n('<input type="text"  autocomplete="off" autocapitalize="off">').css({outline:"none"}).attr("id",n(f).data("settings").idPrefix+f.id).focus(function(){if(n(f).data("settings").disabled)return!1;(n(f).data("settings").tokenLimit===null||n(f).data("settings").tokenLimit!==p)&&ui();l.addClass(n(f).data("settings").classes.focused)}).blur(function(){b();n(f).data("settings").allowFreeTagging&&bt();n(this).val("");l.removeClass(n(f).data("settings").classes.focused)}).bind("keyup keydown blur update",wt).keydown(function(r){var u,e,o;switch(r.keyCode){case t.LEFT:case t.RIGHT:case t.UP:case t.DOWN:return n(this).val()?(o=null,o=r.keyCode===t.DOWN||r.keyCode===t.RIGHT?n(y).next():n(y).prev(),o.length&&ct(o)):(u=w.prev(),e=w.next(),u.length&&u.get(0)===h||e.length&&e.get(0)===h?r.keyCode===t.LEFT||r.keyCode===t.UP?d(n(h),i.BEFORE):d(n(h),i.AFTER):(r.keyCode===t.LEFT||r.keyCode===t.UP)&&u.length?tt(n(u.get(0))):(r.keyCode===t.RIGHT||r.keyCode===t.DOWN)&&e.length&&tt(n(e.get(0)))),!1;case t.BACKSPACE:if(u=w.prev(),n(this).val().length)n(this).val().length===1?b():setTimeout(function(){ti()},5);else return h?(ft(n(h)),c.change()):u.length&&tt(n(u.get(0))),!1;break;case t.TAB:case t.ENTER:case t.NUMPAD_ENTER:case t.COMMA:if(y)ut(n(y).data("tokeninput")),c.change();else{if(n(f).data("settings").allowFreeTagging){if(n(f).data("settings").allowTabOut&&n(this).val()==="")return!0;bt()}else if(n(this).val(""),n(f).data("settings").allowTabOut)return!0;r.stopPropagation();r.preventDefault()}return!1;case t.ESCAPE:return b(),!0;default:String.fromCharCode(r.which)&&setTimeout(function(){ti()},5)}});o.placeholder&&s.attr("placeholder",o.placeholder);var c=n(f).hide().val("").focus(function(){nt(s)}).blur(function(){return s.blur(),c}),h=null,v=0,y=null,l=n("<ul />").addClass(n(f).data("settings").classes.tokenList).click(function(t){var r=n(t.target).closest("li");r&&r.get(0)&&n.data(r.get(0),"tokeninput")?ii(r):(h&&d(n(h),i.END),nt(s))}).mouseover(function(t){var i=n(t.target).closest("li");i&&h!==this&&i.addClass(n(f).data("settings").classes.highlightedToken)}).mouseout(function(t){var i=n(t.target).closest("li");i&&h!==this&&i.removeClass(n(f).data("settings").classes.highlightedToken)}).insertBefore(c),w=n("<li />").addClass(n(f).data("settings").classes.inputToken).appendTo(l).append(s),k=n("<div>").addClass(n(f).data("settings").classes.dropdown).appendTo("body").hide(),vt=n("<tester/>").insertAfter(s).css({position:"absolute",top:-9999,left:-9999,width:"auto",fontSize:s.css("fontSize"),fontFamily:s.css("fontFamily"),fontWeight:s.css("fontWeight"),letterSpacing:s.css("letterSpacing"),whiteSpace:"nowrap"});c.val("");g=n(f).data("settings").prePopulate||c.data("pre");n(f).data("settings").processPrePopulate&&n.isFunction(n(f).data("settings").onResult)&&(g=n(f).data("settings").onResult.call(c,g));g&&g.length&&n.each(g,function(n,t){kt(t);pt();s.attr("placeholder",null)});n(f).data("settings").disabled&&yt(!0);n.isFunction(n(f).data("settings").onReady)&&n(f).data("settings").onReady.call();this.clear=function(){l.children("li").each(function(){n(this).children("input").length===0&&ft(n(this))})};this.add=function(n){ut(n)};this.remove=function(t){l.children("li").each(function(){var u,i,r;if(n(this).children("input").length===0){u=n(this).data("tokeninput");i=!0;for(r in t)if(t[r]!==u[r]){i=!1;break}i&&ft(n(this))}})};this.getTokens=function(){return a};this.toggleDisabled=function(n){yt(n)};wt();gt=new RegExp("[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\-]","g")};n.TokenList.Cache=function(t){var u=n.extend({max_size:500},t),i={},r=0,f=function(){i={};r=0};this.add=function(n,t){r>u.max_size&&f();i[n]||(r+=1);i[n]=t};this.get=function(n){return i[n]}}}(jQuery),function(n){"use strict";n.fn.pkMembershipButton=function(t){return this.each(function(i,r){function e(t){t.preventDefault();var i=n(this),r=i.width();i.attr("data-originalhtml",i.html()).html(u.htmlForWait).width(r).unbind("click").css("cursor","default");n.ajax({url:u.followMemberPath,method:"POST",headers:{__RequestVerificationToken:u.verificationToken}}).done(function(n,t){t==="success"&&(i.toggleClass("success").toggleClass("danger").attr("data-originalhtml",u.htmlForUnfollow).css("cursor","pointer").bind("click",o),n.Error&&n.Error===!0&&n.ErrorMessage&&n.ErrorMessage.length>0?i.pkNotify("warning",n.ErrorMessage):(i.pkNotify("success","Το μέλος <strong>"+u.memberNickname+"<\/strong> προστέθηκε στους φίλους σας και μπορείτε στην οθόνη των φίλων σας να ενημερώνεστε για τα μηνύματα που δημοσιεύει."),u.followSuccessCallback&&u.followSuccessCallback(f)))}).fail(function(){i.css("cursor","pointer").bind("click",e);i.pkNotify("error","Σφάλμα κατά τη προσθήκη του μέλους <strong>"+u.memberNickname+"<\/strong> στους φίλους σας.<br/>Παρακαλούμε προσπαθείστε ξανά σε λίγα λεπτά.")}).always(function(){i.html(i.attr("data-originalhtml"))})}function o(t){t.preventDefault();var i=n(this),r=i.width();i.attr("data-originalhtml",i.html()).html(u.htmlForWait).width(r).unbind("click").css("cursor","default");n.ajax({url:u.unfollowMemberPath,method:"POST",headers:{__RequestVerificationToken:n("input[name=__RequestVerificationToken]").val()}}).done(function(n,t){t==="success"&&(i.toggleClass("success").toggleClass("danger").attr("data-originalhtml",u.htmlForFollow).css("cursor","pointer").bind("click",e),n.Error&&n.Error===!0&&n.ErrorMessage&&n.ErrorMessage.length>0?i.pkNotify("warning",n.ErrorMessage):(i.pkNotify("success","Το μέλος αφαιρέθηκε από τους φίλους σας και τα μηνύματα που δημοσιεύει δε θα εμφανίζονται στην οθόνη των φίλων σας."),u.unfollowSuccessCallback&&u.unfollowSuccessCallback(f)))}).fail(function(){i.css("cursor","pointer").bind("click",o);i.pkNotify("error","Σφάλμα κατά την αφαίρεση του μέλους απο τους φίλους σας.<br/>Παρακαλούμε προσπαθείστε ξανά σε λίγα λεπτά.")}).always(function(){i.html(i.attr("data-originalhtml"))})}var u=n.extend(!0,{memberId:null,memberNickname:null,followMemberPath:null,unfollowMemberPath:null,verificationToken:null,htmlForFollow:null,htmlForUnfollow:null,htmlForWait:null,currentState:"follow",unfollowSuccessCallback:null,followSuccessCallback:null},t),f=n(r);switch(u.currentState.toLowerCase()){case"unfollow":f.html(u.htmlForFollow).bind("click",e);break;default:f.html(u.htmlForUnfollow).bind("click",o)}})}}(jQuery),function(n){function c(n){$.requireAntiforgeryToken();var c=CAPITALMVC.Constants.urlForGetThreadDisplayActions+"/"+n;return $.getJSON(c).done(function(c,l){if(l=="success"){var a=c.ResultData;if(a==null)return;$(".message").each(function(c,l){var v=$(l),p=v.data("memberid"),y=v.data("membernickname"),w=v.data("messageid"),st=v.data("memberban")=="True",vt=new Date(v.data("memberbanuntil")),ht=v.data("isthread")==!0,ct=v.data("locked")=="True",ft=new Date(v.data("pubdate")),lt=Date.now()-ft.setMinutes(ft.getMinutes()+a.messageEditPeriod),et;if((lt<0&&p===a.currentMemberId||a.isModerator===!0)&&$(s).appendTo(v.find(".messageActions")).bind("click",function(){document.location.href=CAPITALMVC.Constants.urlEditMessage.replace("{messageId}",w)}),a.isModerator===!0){function k(n){var t;n.preventDefault();t=$(this);t.unbind("click");var r=$('<img src="'+CAPITALMVC.Constants.iconProgressInline+'" />'),i=t.replaceWith(r),u=!0;$.ajax({url:CAPITALMVC.Constants.urlForUnlockMessageApi+"/"+w,method:"POST",headers:{__RequestVerificationToken:$("input[name=__RequestVerificationToken]").val()}}).done(function(n,u){u=="success"&&(n&&n.ResultData&&n.ResultData==="success"?(r.replaceWith(i),i.bind("click",d),t.pkNotify("success","Το θέμα ξεκλειδώθηκε και τα μέλη μπορούν να δημοσιεύσουν μηνύματα σε αυτό.")):(r.replaceWith(i),i.bind("click",k),t.pkNotify("error",n.ErrorMessage)))}).fail(function(){r.replaceWith(i);i.bind("click",k);t.pkNotify("error","Σφάλμα κατά το ξεκλείδωμα του θέματος.<br/>Παρακαλούμε προσπαθείστε ξανά σε λίγα λεπτά.")}).always(function(){u=!1})}function d(n){var t;n.preventDefault();t=$(this);t.unbind("click");var u=$('<img src="'+CAPITALMVC.Constants.iconProgressInline+'" />'),f=t.replaceWith(u),i=!1,r=$('<div><div style="text-align:center;">Παρακαλώ περιμένετε <img src="'+CAPITALMVC.Constants.iconProgressInline+'" /><\/div><\/div>').load(CAPITALMVC.Constants.urlForDialogForLockMessage+w,function(){$.ui.dialog.forceReposition()}).dialog({autoOpen:!0,modal:!0,title:"ΚΛΕΙΔΩΜΑ ΘΕΜΑΤΟΣ",width:"auto",height:"auto",autoReposition:!0,buttons:{"Κλείδωμα":function(){if(!i){i=!0;var n=r.find("#formForLockMessage");r.dialog("close");$.ajax({url:CAPITALMVC.Constants.urlForLockMessageApi,method:"POST",data:n.serialize(),headers:{__RequestVerificationToken:$("input[name=__RequestVerificationToken]").val()}}).done(function(n,r){r==="success"&&(i=!1,n&&n.ResultData&&n.ResultData==="success"?t.pkNotify("success","Το θέμα κλειδώθηκε"):t.pkNotify("error",n.ErrorMessage))}).fail(function(){t.pkNotify("error","Σφάλμα κατά το κλείδωμα του θέματος.<br/>Παρακαλούμε προσπαθείστε ξανά σε λίγα λεπτά.");i=!1})}},"Ακύρωση":function(){i=!1;r.dialog("close")}},beforeClose:function(){u.replaceWith(f);f.bind("click",d)}})}ht&&(ct?$(u).appendTo(v.find(".messageActions")).bind("click",k).find(":first").attr("title","Ξεκλείδωμα θέματος").removeClass("icon-lock").addClass("icon-lock-open"):$(u).appendTo(v.find(".messageActions")).bind("click",d).find(":first").attr("title","Κλείδωμα θέματος").removeClass("icon-lock-open").addClass("icon-lock"));$(o).data("messageid",w).click(function(n){n.preventDefault();var t=g.bind(this);t()}).appendTo(v.find(".messageActions"));function g(){var n=$("#confirmDeleteDialog");n.find(".dialogMessage").show();n.find(".wait").hide();n.data("notifyelement",this).data("messageid",$(this).data("messageid")).dialog("open")}$("#confirmDeleteDialog").dialog({title:"Διαγραφή μηνύματος",autoOpen:!1,modal:!0,buttons:{"Διαγραφή":function(){at($(this).data("messageid"),$(this).data("notifyelement"));$(this).dialog("close")},"Ακύρωση":function(){$(this).dialog("close")}}});function at(n,t){var u=$(t),i,r;$("#confirmDeleteDialog .dialogMessage").hide();i=$('<img src="'+CAPITALMVC.Constants.iconProgressInline+'" />');r=u.replaceWith(i);$.ajax({url:CAPITALMVC.Constants.urlDeleteMessage+"/"+n,method:"POST",headers:{__RequestVerificationToken:$("input[name=__RequestVerificationToken]").val()}}).done(function(n,t){t==="success"&&(n&&n.Error===!0?(i.pkNotify("error",n.ErrorMessage+"<br/>Παρακαλούμε προσπαθείστε ξανά σε λίγο."),i.replaceWith(r),r.bind("click",g.bind(u))):(i.pkNotify("success","Το μήνημα διαγράφηκε."),document.location.href=document.location.href.replace(/([\s\S]+?){1}?(\?[\s\S]*)/img,"$1")+"?rnd="+parseInt(Math.random()*9999999999).toString()))}).fail(function(){i.pkNotify("error","Σφάλμα κατά τη διαγραφή του μηνύματος.<br/>Παρακαλούμε προσπαθείστε ξανά σε λίγο.");i.replaceWith(r);r.bind("click",g.bind(u))})}if(a.currentMemberId!=p){function nt(n){var t,r,i;n.preventDefault();t=$(this);t.unbind("click");r=$('<img src="'+CAPITALMVC.Constants.iconProgressInline+'" />');i=t.replaceWith(r);$.ajax({url:CAPITALMVC.Constants.urlForMemberUnban+"/"+p,method:"POST",headers:{__RequestVerificationToken:$("input[name=__RequestVerificationToken]").val()}}).done(function(n,u){u=="success"&&(r.replaceWith(i),i.find(":first").css("color","red").attr("title","Ban μέλους "+y).bind("click",tt),t.pkNotify("success","Ο χρήστης <strong>"+y+"<\/strong> έγινε UnBan"))}).fail(function(){r.replaceWith(i);i.bind("click",nt);t.pkNotify("error","Σφάλμα κατά το Unban του μέλους <strong>"+y+"<\/strong>")})}function tt(n){n.preventDefault();var u=$(this),r=$('<img src="'+CAPITALMVC.Constants.iconProgressInline+'" />'),t=u.replaceWith(r),i=!1,f=$("<div><\/div>").load(CAPITALMVC.Constants.urlForDialogForBanMemberOptions).dialog({autoOpen:!0,modal:!0,title:'Ban μέλους "'+y+'"',width:500,autoReposition:!0,buttons:{"ΟΚ":function(){var n=f.find("input:radio[name=banInterval]:checked").val(),e;n&&(e=f.find("#banReason").val(),i=!0,u.unbind("click"),$(this).dialog("close"),$.ajax({url:CAPITALMVC.Constants.urlForMemberBan,dataType:"json",data:{memberId:p,interval:n,reason:e},method:"POST",headers:{__RequestVerificationToken:$("input[name=__RequestVerificationToken]").val()}}).done(function(n,u){u=="success"&&(t.find("span:first").css("color","green").attr("title","Unban μέλους "+y).bind("click",nt),r.replaceWith(t),t.pkNotify("success","Ο χρήστης <strong>"+y+"<\/strong> έγινε Ban"),i=!1)}).fail(function(){r.replaceWith(t);t.pkNotify("error","Σφάλμα κατά το ban του μέλους <strong>"+y+"<\/strong>");i=!1}))},"Ακύρωση":function(){i=!1;$(this).dialog("close")}},beforeClose:function(){i||(r.replaceWith(t),t.bind("click",tt))}})}st?$(t).appendTo(v.find(".memberActions")).bind("click",nt).find(":first").attr("title","Unban μέλους").css("color","green"):$(t).appendTo(v.find(".memberActions")).bind("click",tt).find(":first").attr("title","Ban μέλους").css("color","red")}}if(w==n&&a.displayAddToFavorites===!0){function b(n){var r,t,i;n.preventDefault();r=$(this);r.unbind("click");t=$('<img src="'+CAPITALMVC.Constants.iconProgressInline+'" />');i=r.replaceWith(t);$.ajax({url:CAPITALMVC.Constants.urlAddMessageToFavorites+"/"+w,method:"POST",headers:{__RequestVerificationToken:$("input[name=__RequestVerificationToken]").val()}}).done(function(n,r){r==="success"&&(n&&n.Error===!0?(t.pkNotify("error",n.ErrorMessage),t.replaceWith(i),i.bind("click",b)):(t.pkNotify("success","Το θέμα προστέθηκε στα αγαπημένα σας."),t.replaceWith(i),i.bind("click",b).find(":first").css("color","red").attr("title","Αφαίρεση θέματος από τα αγαπημένα").text("-")))}).fail(function(){t.pkNotify("error","Σφάλμα κατά προσθήκη του θέματος από τα αγαπημένα σας.<br/>Παρακαλούμε προσπαθείστε ξανά σε λίγο.");t.replaceWith(i);i.bind("click",b)})}function it(n){var r,t,i;n.preventDefault();r=$(this);r.unbind("click");t=$('<img src="'+CAPITALMVC.Constants.iconProgressInline+'" />');i=r.replaceWith(t);$.ajax({url:CAPITALMVC.Constants.urlRemoveMessageFromFavorites+"/"+w,method:"POST",headers:{__RequestVerificationToken:$("input[name=__RequestVerificationToken]").val()}}).done(function(n,r){r==="success"&&(n&&n.Error===!0?(t.pkNotify("error",n.ErrorMessage),t.replaceWith(i),i.bind("click",it)):(t.pkNotify("success","Το θέμα αφαιρέθηκε από τα αγαπημένα σας."),t.replaceWith(i),i.bind("click",b).find(":first").css("color","green").attr("title","Προσθήκη θέματος στα αγαπημένα").text("+")))}).fail(function(){t.pkNotify("error","Σφάλμα κατά την αφαίρεση του θέματος από τα αγαπημένα σας.<br/>Παρακαλούμε προσπαθείστε ξανά σε λίγο.");t.replaceWith(i);i.bind("click",it)})}a.isFavoriteThread===!0?$(r).appendTo(v.find(".messageActions")).bind("click",it).find(":first").attr("title","Αφαίρεση από τα αγαπημένα").css("color","red").text("-").addClass("icon-heart"):$(r).appendTo(v.find(".messageActions")).bind("click",b).find(":first").attr("title","Προσθήκη στα αγαπημένα").css("color","green").text("+").addClass("icon-heart")}if(a.displayReportMalicious===!0){et=v.find(".messageActions");function ot(n){var t;n.preventDefault();t=$(this);t.unbind("click");var u=$('<img src="'+CAPITALMVC.Constants.iconProgressInline+'" />'),f=t.replaceWith(u),i=!1,r=$('<div><div style="text-align:center;">Παρακαλώ περιμένετε <img src="'+CAPITALMVC.Constants.iconProgressInline+'" /><\/div><\/div>').load(CAPITALMVC.Constants.urlForDialogForReportMessageOptions,function(){$.ui.dialog.forceReposition()}).dialog({autoOpen:!0,modal:!0,title:"ΑΝΑΦΟΡΑ ΜΗΝΥΜΑΤΟΣ ΣΤΟ ΔΙΑΧΕΙΡΙΣΤΗ",width:"auto",height:"auto",autoReposition:!0,buttons:{"Αποστολή":function(){var n,f,u;i||(i=!0,n=r.find("input:radio[name=type]:checked").val(),n)&&(f=r.find("textarea").val(),u=r.find("#formForReportMessage"),r.dialog("close"),$.ajax({url:CAPITALMVC.Constants.urlReportMaliciousMessage+"/"+w,method:"POST",data:u.serialize(),headers:{__RequestVerificationToken:$("input[name=__RequestVerificationToken]").val()}}).done(function(n,r){r==="success"&&(i=!1,n&&n.ResultData&&n.ResultData.message==="success"?t.pkNotify("success","Ο διαχειριστής του forum ενημερώθηκε για το περιεχόμενο του μηνύματος."):t.pkNotify("error",n.ErrorMessage))}).fail(function(){t.pkNotify("error","Σφάλμα κατά την αποστολή της αναφοράς κακόβουλου περιεχομένου.<br/>Παρακαλούμε προσπαθείστε ξανά σε λίγα λεπτά.");i=!1}))},"Ακύρωση":function(){i=!1;r.dialog("close")}},beforeClose:function(){u.replaceWith(f);f.bind("click",ot)}})}$(e).appendTo(et).bind("click",ot)}if(a.displayAddToFriends===!0&&a.currentMemberId!=p){function rt(n){var t,r,i;n.preventDefault();t=$(this);t.unbind("click");r=$('<img src="'+CAPITALMVC.Constants.iconProgressInline+'" />');i=t.replaceWith(r);$.ajax({url:CAPITALMVC.Constants.urlFolowMember+"/"+p,method:"POST",headers:{__RequestVerificationToken:$("input[name=__RequestVerificationToken]").val()}}).done(function(n,u){u==="success"&&(r.replaceWith(i),i.bind("click",ut).find(":first").removeClass("icon-user-follow").addClass("icon-user-unfollow").css("color","red").attr("title","Διαγραφή από τα μέλη που ακολουθώ"),n.Error&&n.Error===!0&&n.ErrorMessage&&n.ErrorMessage.length>0?t.pkNotify("warning",n.ErrorMessage):t.pkNotify("success","Το μέλος <strong>"+y+"<\/strong> προστέθηκε στους φίλους σας και μπορείτε στην οθόνη των φίλων σας να ενημερώνεστε για τα μηνύματα που δημοσιεύει."))}).fail(function(){r.replaceWith(i);i.bind("click",rt);t.pkNotify("error","Σφάλμα κατά τη προσθήκη του μέλους <strong>"+y+"<\/strong> στους φίλους σας.<br/>Παρακαλούμε προσπαθείστε ξανά σε λίγα λεπτά.")})}function ut(n){var t,r,i;n.preventDefault();t=$(this);t.unbind("click");r=$('<img src="'+CAPITALMVC.Constants.iconProgressInline+'" />');i=t.replaceWith(r);$.ajax({url:CAPITALMVC.Constants.urlUnfolowMember+"/"+p,method:"POST",headers:{__RequestVerificationToken:$("input[name=__RequestVerificationToken]").val()}}).done(function(n,u){u==="success"&&(r.replaceWith(i),i.bind("click",rt).find(":first").addClass("icon-user-follow").removeClass("icon-user-unfollow").css("color","green").attr("title","Προσθήκη στα μέλη που ακολουθώ"),n.Error&&n.Error===!0&&n.ErrorMessage&&n.ErrorMessage.length>0?t.pkNotify("warning",n.ErrorMessage):t.pkNotify("success","Το μέλος αφαιρέθηκε από τους φίλους σας και τα μηνύματα που δημοσιεύει δε θα εμφανίζονται στην οθόνη των φίλων σας."))}).fail(function(){r.replaceWith(i);i.bind("click",ut);t.pkNotify("error","Σφάλμα κατά την αφαίρεση του μέλους απο τους φίλους σας.<br/>Παρακαλούμε προσπαθείστε ξανά σε λίγα λεπτά.")})}$.grep(a.fellowMemberIds,function(n){return n===parseInt(p)}).length>0?$(i).appendTo(v.find(".memberActions")).bind("click",ut).find(":first").removeClass("icon-user-follow").addClass("icon-user-unfollow").css("color","red").attr("title","Διαγραφή απο τα μέλη που ακολουθώ"):$(i).appendTo(v.find(".memberActions")).bind("click",rt).find(":first").addClass("icon-user-follow").removeClass("icon-user-unfollow").css("color","green").attr("title","Προσθήκη στα μέλη που ακολουθώ")}a.displaySendPersonalMessage===!0&&a.currentMemberId!=p&&$(f.replace(/{actionTitle}/gi,"Αποστολή προσωπικού μηνύματος στο μέλος "+y)).appendTo(v.find(".memberActions")).pkPersonalMessage({recipientId:p,recipientNickname:y,formUrl:CAPITALMVC.Constants.urlShowFormForPersonalMessage,searchUrl:CAPITALMVC.Constants.urlSearchMember});a.displayReplyToMember===!0&&a.currentMemberId!=p&&$(h.replace(/{memberNickname}/gi,y)).prependTo(v.find(".messageActions")).click(function(n){n.preventDefault();$("#newMessageForm textarea").sceditor("instance").insert('[url="/forum/profile/'+p+'"]@'+y+"[/url]&nbsp;",null,!0,!0,!0);$("html, body").animate({scrollTop:$("#newMessageForm").offset().top},500)})})}}),this}var t='<span class="glyph"><span rel="nofollow" aria-hidden="true" class="item icon-ban"><\/span><\/span>',i='<span class="glyph"><span aria-hidden="true" class="item icon-user-follow"><\/span><\/span>',f='<span class="glyph"><span aria-hidden=\true" title="{actionTitle}" class="item icon-envelope-letter"><\/span><\/span>',r='<span class="glyph isHeart"><span style="color:green;" aria-hidden="true" class="item icon-heart absoluteHeart">+<\/span><\/span>',e='<span class="glyph"><span aria-hidden="true" title="Αναφορά κακόβουλου περιεχομένου" class="item icon-bell"><\/span>',o='<span class="glyph"><span aria-hidden="true" title="Διαγραφή μηνύματος" class="item icon-trash"><\/span><\/span>',s='<span class="glyph"><span aria-hidden="true" title="Επεξεργασία μηνύματος" class="item icon-note"><\/span><\/span>',u='<span class="glyph"><span aria-hidden="true" title="Κλείδωμα θέματος" class="item icon-lock"><\/span><\/span>',h='<span class="glyph"><span aria-hidden="true" title="Απάντηση στον {memberNickname}" class="item icon-bubble"><\/span><\/span>';n.ThreadDisplayActions=c}(window.CAPITALMVC=window.CAPITALMVC||{}),function(){var n=jQuery,t=function(){function n(){this.fadeDuration=500;this.fitImagesInViewport=!0;this.resizeDuration=700;this.positionFromTop=50;this.showImageNumberLabel=!0;this.alwaysShowNavOnTouchDevices=!1;this.wrapAround=!1}return n.prototype.albumLabel=function(n,t){return"Image "+n+" of "+t},n}(),i=function(){function t(n){this.options=n;this.album=[];this.currentImageIndex=void 0;this.init()}return t.prototype.init=function(){this.enable();this.build()},t.prototype.enable=function(){var t=this;n("body").on("click","a[rel^=lightbox], area[rel^=lightbox], a[data-lightbox], area[data-lightbox]",function(i){return t.start(n(i.currentTarget)),!1})},t.prototype.build=function(){var t=this;n("<div id='lightboxOverlay' class='lightboxOverlay'><\/div><div id='lightbox' class='lightbox'><div class='lb-outerContainer'><div class='lb-container'><img class='lb-image' src='' /><div class='lb-nav'><a class='lb-prev' href='' ><\/a><a class='lb-next' href='' ><\/a><\/div><div class='lb-loader'><a class='lb-cancel'><\/a><\/div><\/div><\/div><div class='lb-dataContainer'><div class='lb-data'><div class='lb-details'><span class='lb-caption'><\/span><span class='lb-number'><\/span><\/div><div class='lb-closeContainer'><a class='lb-close'><\/a><\/div><\/div><\/div><\/div>").appendTo(n("body"));this.$lightbox=n("#lightbox");this.$overlay=n("#lightboxOverlay");this.$outerContainer=this.$lightbox.find(".lb-outerContainer");this.$container=this.$lightbox.find(".lb-container");this.containerTopPadding=parseInt(this.$container.css("padding-top"),10);this.containerRightPadding=parseInt(this.$container.css("padding-right"),10);this.containerBottomPadding=parseInt(this.$container.css("padding-bottom"),10);this.containerLeftPadding=parseInt(this.$container.css("padding-left"),10);this.$overlay.hide().on("click",function(){return t.end(),!1});this.$lightbox.hide().on("click",function(i){return"lightbox"===n(i.target).attr("id")&&t.end(),!1});this.$outerContainer.on("click",function(i){return"lightbox"===n(i.target).attr("id")&&t.end(),!1});this.$lightbox.find(".lb-prev").on("click",function(){return t.changeImage(0===t.currentImageIndex?t.album.length-1:t.currentImageIndex-1),!1});this.$lightbox.find(".lb-next").on("click",function(){return t.changeImage(t.currentImageIndex===t.album.length-1?0:t.currentImageIndex+1),!1});this.$lightbox.find(".lb-loader, .lb-close").on("click",function(){return t.end(),!1})},t.prototype.start=function(t){function e(n){l.album.push({link:n.attr("href"),title:n.attr("data-title")||n.attr("title")})}var l=this,o=n(window),i,f,s,r,u,h,c;if(o.on("resize",n.proxy(this.sizeOverlay,this)),n("select, object, embed").css({visibility:"hidden"}),this.sizeOverlay(),this.album=[],f=0,s=t.attr("data-lightbox"),s)for(i=n(t.prop("tagName")+'[data-lightbox="'+s+'"]'),r=0;r<i.length;r=++r)e(n(i[r])),i[r]===t[0]&&(f=r);else if("lightbox"===t.attr("rel"))e(t);else for(i=n(t.prop("tagName")+'[rel="'+t.attr("rel")+'"]'),u=0;u<i.length;u=++u)e(n(i[u])),i[u]===t[0]&&(f=u);h=o.scrollTop()+this.options.positionFromTop;c=o.scrollLeft();this.$lightbox.css({top:h+"px",left:c+"px"}).fadeIn(this.options.fadeDuration);this.changeImage(f)},t.prototype.changeImage=function(t){var u=this,r,i;this.disableKeyboardNav();r=this.$lightbox.find(".lb-image");this.$overlay.fadeIn(this.options.fadeDuration);n(".lb-loader").fadeIn("slow");this.$lightbox.find(".lb-image, .lb-nav, .lb-prev, .lb-next, .lb-dataContainer, .lb-numbers, .lb-caption").hide();this.$outerContainer.addClass("animating");i=new Image;i.onload=function(){var l,f,e,o,s,h,c;r.attr("src",u.album[t].link);l=n(i);r.width(i.width);r.height(i.height);u.options.fitImagesInViewport&&(c=n(window).width(),h=n(window).height(),s=c-u.containerLeftPadding-u.containerRightPadding-20,o=h-u.containerTopPadding-u.containerBottomPadding-120,(i.width>s||i.height>o)&&(i.width/s>i.height/o?(e=s,f=parseInt(i.height/(i.width/e),10),r.width(e),r.height(f)):(f=o,e=parseInt(i.width/(i.height/f),10),r.width(e),r.height(f))));u.sizeContainer(r.width(),r.height())};i.src=this.album[t].link;this.currentImageIndex=t},t.prototype.sizeOverlay=function(){this.$overlay.width(n(window).width()).height(n(document).height())},t.prototype.sizeContainer=function(n,t){function f(){i.$lightbox.find(".lb-dataContainer").width(u);i.$lightbox.find(".lb-prevLink").height(r);i.$lightbox.find(".lb-nextLink").height(r);i.showImage()}var i=this,e=this.$outerContainer.outerWidth(),o=this.$outerContainer.outerHeight(),u=n+this.containerLeftPadding+this.containerRightPadding,r=t+this.containerTopPadding+this.containerBottomPadding;e!==u||o!==r?this.$outerContainer.animate({width:u,height:r},this.options.resizeDuration,"swing",function(){f()}):f()},t.prototype.showImage=function(){this.$lightbox.find(".lb-loader").hide();this.$lightbox.find(".lb-image").fadeIn("slow");this.updateNav();this.updateDetails();this.preloadNeighboringImages();this.enableKeyboardNav()},t.prototype.updateNav=function(){var n=!1;try{document.createEvent("TouchEvent");n=this.options.alwaysShowNavOnTouchDevices?!0:!1}catch(t){}this.$lightbox.find(".lb-nav").show();this.album.length>1&&(this.options.wrapAround?(n&&this.$lightbox.find(".lb-prev, .lb-next").css("opacity","1"),this.$lightbox.find(".lb-prev, .lb-next").show()):(this.currentImageIndex>0&&(this.$lightbox.find(".lb-prev").show(),n&&this.$lightbox.find(".lb-prev").css("opacity","1")),this.currentImageIndex<this.album.length-1&&(this.$lightbox.find(".lb-next").show(),n&&this.$lightbox.find(".lb-next").css("opacity","1"))))},t.prototype.updateDetails=function(){var t=this;"undefined"!=typeof this.album[this.currentImageIndex].title&&""!==this.album[this.currentImageIndex].title&&this.$lightbox.find(".lb-caption").html(this.album[this.currentImageIndex].title).fadeIn("fast").find("a").on("click",function(){location.href=n(this).attr("href")});this.album.length>1&&this.options.showImageNumberLabel?this.$lightbox.find(".lb-number").text(this.options.albumLabel(this.currentImageIndex+1,this.album.length)).fadeIn("fast"):this.$lightbox.find(".lb-number").hide();this.$outerContainer.removeClass("animating");this.$lightbox.find(".lb-dataContainer").fadeIn(this.options.resizeDuration,function(){return t.sizeOverlay()})},t.prototype.preloadNeighboringImages=function(){var n,t;this.album.length>this.currentImageIndex+1&&(n=new Image,n.src=this.album[this.currentImageIndex+1].link);this.currentImageIndex>0&&(t=new Image,t.src=this.album[this.currentImageIndex-1].link)},t.prototype.enableKeyboardNav=function(){n(document).on("keyup.keyboard",n.proxy(this.keyboardAction,this))},t.prototype.disableKeyboardNav=function(){n(document).off(".keyboard")},t.prototype.keyboardAction=function(n){var t=n.keyCode,i=String.fromCharCode(t).toLowerCase();t===27||i.match(/x|o|c/)?this.end():"p"===i||t===37?0!==this.currentImageIndex?this.changeImage(this.currentImageIndex-1):this.options.wrapAround&&this.album.length>1&&this.changeImage(this.album.length-1):("n"===i||t===39)&&(this.currentImageIndex!==this.album.length-1?this.changeImage(this.currentImageIndex+1):this.options.wrapAround&&this.album.length>1&&this.changeImage(0))},t.prototype.end=function(){this.disableKeyboardNav();n(window).off("resize",this.sizeOverlay);this.$lightbox.fadeOut(this.options.fadeDuration);this.$overlay.fadeOut(this.options.fadeDuration);n("select, object, embed").css({visibility:"visible"})},t}();n(function(){var n=new t;new i(n)})}.call(this),function(n){function t(n){var t,i;!n||n<=0||(t=$("a[name='msgId"+n+"$']"),t.length>0&&(i=t.next().find(".text"),i.css("background-color","#FDB031"),$("html,body").animate({scrollTop:t.offset().top},700,"easeInOutQuad",function(){i.animate({"background-color":""},700)})))}n.ScrollAndFlash=t}(window.CAPITALMVC=window.CAPITALMVC||{})