/*  
 * JCE Editor                 2.2.8.4
 * @package                 JCE
 * @url                     http://www.joomlacontenteditor.net
 * @copyright               Copyright (C) 2006 - 2012 Ryan Demmer. All rights reserved
 * @license                 GNU/GPL Version 2 or later - http://www.gnu.org/licenses/gpl-2.0.html
 * @date                    15 October 2012
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.

 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * NOTE : Javascript files have been compressed for speed and can be uncompressed using http://jsbeautifier.org/
 */
(function($){var standalone=typeof tinyMCEPopup=='undefined';var $tmp=document.createElement('div');$.support.canvas=!!document.createElement('canvas').getContext;$.support.backgroundSize=(function(){var s=false;$.each(['backgroundSize','MozBackgroundSize','WebkitBackgroundSize','OBackgroundSize'],function(){if(typeof $tmp.style[this]!=='undefined'){s=true;}});return s;})();$.support.pdfjs=$.support.canvas&&window.ArrayBuffer;$.support.pdf=(function(){try{if(!$.support.cssFloat){var control=null;try{control=new ActiveXObject('AcroPDF.PDF');}
catch(e){}
if(!control){try{control=new ActiveXObject('PDF.PdfCtrl');}
catch(e){}}
return control?true:false;}else if(navigator.plugins){for(var n in navigator.plugins){if(n=='Adobe Acrobat'){return true;}
if(navigator.plugins[n].name&&(navigator.plugins[n].name=='Adobe Acrobat'||navigator.plugins[n].name=='Chrome PDF Viewer')){return true;}}}else if(navigator.mimeTypes){var mime=navigator.mimeTypes["application/pdf"];if(mime&&mime.enabledPlugin){return true;}}}
catch(e){}
return false;})();$.Plugin={i18n:{},language:'',options:{selectChange:$.noop,site:'',root:'',help:$.noop,alerts:''},getURI:function(absolute){if(!standalone){return tinyMCEPopup.editor.documentBaseURI.getURI(absolute);}
return(absolute)?this.options.root:this.options.site;},init:function(options){var self=this;$.extend(this.options,options);if($.browser.webkit){$('#jce').addClass('webkit');}
if($.browser.opera){$('#jce').addClass('opera');}
if($.browser.msie){$('#jce').addClass('ie');}
if($.browser.gecko){$('#jce').addClass('gecko');}
if(!$.support.cssFloat&&document.querySelector){$('#jce').addClass('ie8');}
if(!$.support.cssFloat&&!!window.XMLHttpRequest&&!document.querySelector){$('#jce').addClass('ie7');}
if(!$.support.cssFloat&&!window.XMLHttpRequest){$('#jce').addClass('ie6');}
$('button#cancel').click(function(e){if(!standalone){tinyMCEPopup.close();}
e.preventDefault();});$('#jce').addClass('ui-widget-content');$('#tabs').tabs();$('button#insert, input#insert, button#update, input#update').button({icons:{primary:'ui-icon-check'}});$('button#apply, input#apply').button({icons:{primary:'ui-icon-plus'}});$('button#refresh, input#refresh').button({icons:{primary:'ui-icon-refresh'}});$('button#cancel, input#cancel').button({icons:{primary:'ui-icon-close'}});$('button#help, input#help').button({icons:{primary:'ui-icon-help'}});this.createColourPickers();this.createBrowsers();$('select.editable, select.mceEditableSelect').combobox({label:self.translate('select_label','Add Value'),change:this.options.change});$('.hastip, .tip, .tooltip').tips();this._formWidgets();},_formWidgets:function(){var self=this;$('input[placeholder], textarea[placeholder]').placeholder();$(':input[pattern]').pattern();$(':input[max]').max();$(':input[min]').min();},getName:function(){return $('body').data('plugin');},getPath:function(plugin){if(!standalone){return tinyMCEPopup.getParam('site_url')+'components/com_jce/editor/tiny_mce/plugins/'+this.getName();}
return this.options.site+'components/com_jce/editor/tiny_mce/plugins/'+this.getName();},loadLanguage:function(){if(!standalone){var ed=tinyMCEPopup.editor,u=ed.getParam('document_base_url')+'components/com_jce/editor/tiny_mce';if(u&&ed.settings.language&&ed.settings.language_load!==false){u+='/langs/'+ed.settings.language+'_dlg.js';if(!tinymce.ScriptLoader.isDone(u)){document.write('<script type="text/javascript" src="'+tinymce._addVer(u)+'"></script>');tinymce.ScriptLoader.markDone(u);}}}},help:function(){if(!standalone){var ed=tinyMCEPopup.editor;ed.windowManager.open({url:tinyMCEPopup.getParam('site_url')+'index.php?option=com_jce&view=help&tmpl=component&lang='+ed.settings.language+'&section=editor&category='+this.getName(),width:780,height:560,resizable:1,inline:1,close_previous:0});}else{this.options.help.call(this,this.getName());}},setDimensions:function(wo,ho,prefix){prefix=prefix||'';var w=$('#'+prefix+wo).val();var h=$('#'+prefix+ho).val();if(!w||!h)
return;var th=$('#'+prefix+'tmp_'+ho).val();var tw=$('#'+prefix+'tmp_'+wo).val();if(th&&tw){if($('#'+prefix+'constrain').is(':checked')){var temp=(w/$('#'+prefix+'tmp_'+wo).val())*$('#'+prefix+'tmp_'+ho).val();h=temp.toFixed(0);$('#'+prefix+ho).val(h);}}
$('#'+prefix+'tmp_'+ho).val(h);$('#'+prefix+'tmp_'+wo).val(w);},setDefaults:function(s){var n,v;for(n in s){v=s[n];if(v=='default'){v='';}
if($('#'+n).is(':checkbox')){$('#'+n).prop('checked',parseFloat(v));}else{$('#'+n).val(v).change();}}},setClasses:function(v,n){n=n||'classes';var $tmp=$('<span/>').addClass($('#'+n).val()).addClass(v);$('#'+n).val($tmp.attr('class'));},createColourPickers:function(){var self=this;$('input.color, input.colour').each(function(){var id=$(this).attr('id');var ev=$(this).get(0).onchange;$('<span role="button" class="pickcolor_icon" title="'+self.translate('browse')+'" id="'+id+'_pick"></span>').click(function(e){if($(this).hasClass('disabled')){return;}
return tinyMCEPopup.pickColor(e,id);}).insertAfter(this).css('background-color',$(this).val()).toggleClass('disabled',$(this).is(':disabled')).attr('aria-disabled',function(){return $(this).hasClass('disabled');});$(this).bind('pick',function(){$(this).next('span.pickcolor_icon').css('background-color',$(this).val());});$(this).get(0).onchange=function(){$(this).trigger('pick');if($.isFunction(ev)){ev.call(this);}};});},createBrowsers:function(){var self=this;$('input.browser').each(function(){var input=this,type=$(this).hasClass('image')?'image':'file';var ev=$(this).get(0).onchange;$('<span role="button" class="browser_icon" title="'+self.translate('browse')+'"></span>').click(function(){return TinyMCE_Utils.openBrowser(this,$(input).attr('id'),type,'file_browser_callback');}).insertAfter(this);$(this).get(0).onchange=function(){if($.isFunction(ev)){ev.call(this);}};});},getLanguage:function(){if(!this.language){var s=$('body').attr('lang')||'en';if(s.length>2){s=s.substr(0,2);}
this.language=s;}
return this.language;},sizeToFit:function(o,c){var x=c.width;var y=c.height;var w=o.width;var h=o.height;var ratio=x/w;if(w/h>ratio){h=h*(x/w);w=x;if(h>y){w=w*(y/h);h=y;}}else{w=w*(y/h);h=y;if(w>x){h=h*(x/w);w=x;}}
return{width:Math.round(w),height:Math.round(h)};},addI18n:function(p,o){var i18n=this.i18n;if($.type(p)=='string'){$.each(o,function(k,o){i18n[p+'.'+k]=o;});}else{$.each(p,function(lc,o){$.each(o,function(g,o){$.each(o,function(k,o){if(g==='common')
i18n[lc+'.'+k]=o;else
i18n[lc+'.'+g+'.'+k]=o;});});});}},translate:function(s,ds){if(!standalone){return tinyMCEPopup.getLang('dlg.'+s,ds);}
if(!$.isPlainObject(this.i18n))
this.i18n={};return this.i18n[this.getLanguage()+'.dlg.'+s]||ds;}};$.Cookie={get:function(n,s){var c=document.cookie,e,p=n+"=",b,v;if(!c){return s;}
b=c.indexOf("; "+p);if(b==-1){b=c.indexOf(p);if(b!=0){return s;}}else{b+=2;}
e=c.indexOf(";",b);if(e==-1){e=c.length;}
v=unescape(c.substring(b+p.length,e));if(typeof v=='undefined'){return s;}
return v;},set:function(n,v,e,p,d,s){document.cookie=n+"="+escape(v)+
((e)?"; expires="+e.toGMTString():"")+
((p)?"; path="+escape(p):"")+
((d)?"; domain="+d:"")+
((s)?"; secure":"");}};$.JSON={queue:function(o){var _old=o.complete;o.complete=function(){if(_old)
_old.apply(this,arguments);};$([$.JSON.queue]).queue("ajax",function(){window.setTimeout(function(){$.ajax(o);},500);});$.dequeue($.JSON.queue,"ajax");},request:function(func,data,callback,scope){var json={'fn':func};callback=callback||$.noop;var args={'format':'raw'};var fields=$(':input','form').serializeArray();$.each(fields,function(i,field){args[field.name]=field.value;});if($.type(data)=='string'||$.type(data)=='array'){$.extend(json,{'args':$.type(data)=='string'?$.String.encodeURI(data):$.map(data,function(s){return $.String.encodeURI(s);})});}else{if(typeof data=='object'&&data.json){$.extend(json,{'args':data.json});delete data.json;}
$.extend(args,data);}
var url=document.location.href;url=url.replace(/&wf([a-z0-9]+)=1/,'');function showError(e){var txt=$.type(e)=='array'?e.join('\n'):e;txt=txt.replace(/<br([^>]+?)>/,'');$.Dialog.alert(txt);}
$.JSON.queue({context:scope||this,type:'POST',url:url,data:'json='+$.JSON.serialize(json)+'&'+$.param(args),success:function(o){if($.type(o)=='string'){var s=$.parseJSON(o);if(s){o=s;}}
if($.isPlainObject(o)){if(o.error){showError(o.text||o.error||'');}
var r=o.result||null;if(r&&r.error&&r.error.length){showError(r.error);}}else{if(o){showError(o);}
return false;}
if($.isFunction(callback)){callback.call(scope||this,r);}else{return r;}},error:function(e,txt,status){$.Dialog.alert(status||('SERVER ERROR - '+txt.toUpperCase()));}});},serialize:function(o){var i,v,s=$.JSON.serialize,t;if(o==null)
return'null';t=typeof o;if(t=='string'){v='\bb\tt\nn\ff\rr\""\'\'\\\\';return'"'+o.replace(/([\u0080-\uFFFF\x00-\x1f\"])/g,function(a,b){i=v.indexOf(b);if(i+1)
return'\\'+v.charAt(i+1);a=b.charCodeAt().toString(16);return'\\u'+'0000'.substring(a.length)+a;})+'"';}
if(t=='object'){if(o.hasOwnProperty&&o instanceof Array){for(i=0,v='[';i<o.length;i++)
v+=(i>0?',':'')+s(o[i]);return v+']';}
v='{';for(i in o){v+=typeof o[i]!='function'?(v.length>1?',"':'"')+i+'":'+s(o[i]):'';}
return v+'}';}
return''+o;}},$.URL={toAbsolute:function(url){if(!standalone){return tinyMCEPopup.editor.documentBaseURI.toAbsolute(url);}
if(/http(s)?:\/\//.test(url)){return url;}
return $.Plugin.getURI(true)+url.substr(0,url.indexOf('/'));},toRelative:function(url){if(!standalone){return tinyMCEPopup.editor.documentBaseURI.toRelative(url);}
if(/http(s)?:\/\//.test(url)){return url.substr(url.indexOf('/'));}
return url;}},$.Dialog={counter:0,_uid:function(p){return(!p?'wf_':p)+(this.counter++);},dialog:function(title,data,options){var div=document.createElement('div');options=$.extend(options,{minWidth:options.minWidth||options.width||300,minHeight:options.minHeight||options.height||150,modal:(typeof options.modal==='undefined')?true:options.modal,open:function(){$(div).dialog('widget').next('div.ui-widget-overlay').css({width:'100%',height:'100%'});$('div.ui-dialog-buttonset button[icons]',$(div).dialog('widget')).each(function(){var icon=$(this).attr('icons');$(this).prepend('<span class="ui-button-icon-primary ui-icon '+icon+'"/>');}).addClass('ui-button-text-icon-primary').removeClass('ui-button-text-only');if($.isFunction(options.onOpen)){options.onOpen.call();}},close:function(){$(this).dialog('destroy').remove();}});$(div).attr({'title':title,id:options.id||'dialog'+this._uid()}).append(data).dialog(options);return div;},confirm:function(s,cb,options){var html='<div class="confirm"><span class="icon"></span>'+s+'</div>';options=$.extend({resizable:false,buttons:[{text:$.Plugin.translate('yes','Yes'),click:function(){cb.call(this,true);$(this).dialog("close");}},{text:$.Plugin.translate('no','No'),click:function(){cb.call(this,false);$(this).dialog("close");}}]},options);return $.Dialog.dialog($.Plugin.translate('confirm','Confirm'),html,options);},alert:function(s){var html='<div class="alert"><span class="icon"></span>'+s+'</div>';var options={resizable:false,buttons:[{text:$.Plugin.translate('ok','OK'),click:function(){$(this).dialog("close");}}]};return $.Dialog.dialog($.Plugin.translate('alert','Alert'),html,options);},prompt:function(title,options){var html='<p>';var id=options.id||'dialog-prompt',name=options.name||'prompt',v=options.value||'';if(options.text){html+='<label for="'+id+'">'+options.text+'</label>';}
if(options.multiline){html+='<textarea id="'+id+'" style="width:200px;height:75px;">'+v+'</textarea>';}else{html+='<input id="'+id+'" name="'+name+'" type="text" value="'+v+'" style="width:200px;" />';}
html+='</p>';if(options.elements){html+=options.elements;}
options=$.extend({resizable:false,width:320,buttons:[{text:$.Plugin.translate('ok','Ok'),click:function(){if($.isFunction(options.confirm)){options.confirm.call(this,$('#'+id).val());}else{$(this).dialog("close");}}}],onOpen:function(){$('#'+options.id).focus();}},options);return $.Dialog.dialog(title,html,options);},upload:function(options){var div=document.createElement('div');$(div).attr('id','upload-body').append('<div id="upload-queue-block">'+'  <ul id="upload-queue"><li style="display:none;"></li></ul>'+' <input type="hidden" id="upload-dir" name="upload-dir" />'+' <input type="file" name="file" size="40" style="position:relative;" />'+'</div>'+'<div id="upload-options"></div>');$(div).find('#upload-options').append(options.elements);options=$.extend({minWidth:460,minHeight:350,resizable:false,buttons:[{text:$.Plugin.translate('browse','Browse'),id:'upload-browse',icons:'ui-icon-search'},{text:$.Plugin.translate('upload','Upload'),click:function(){if($.isFunction(options.upload)){options.upload.call();}},icons:'ui-icon-arrowthick-1-n'},{text:$.Plugin.translate('close','Close'),click:function(){$(this).dialog("close");},icons:'ui-icon-close'}]},options);return $.Dialog.dialog($.Plugin.translate('upload','Upload'),div,options);},iframe:function(name,url,options){var div=document.createElement('div');options=$.extend({width:$(window).width()-100,height:$(window).height()-50,onOpen:function(){var iframe=document.createElement('iframe');$(div).addClass('loading');$(iframe).attr({'src':url,'scrolling':'auto','frameborder':0}).css({width:'99%',height:'95%'}).load(function(){if($.isFunction(options.onFrameLoad)){options.onFrameLoad.call();}
$(div).removeClass('loading');});$(div).addClass('iframe-preview').append(iframe);$(div.parentNode).dialog("option","position",'center');}},options);var name=name||$.Plugin.translate('preview','Preview');return $.Dialog.dialog(name,div,options);},media:function(name,url,options){var self=this;options=options||{};var div=document.createElement('div');var ww=$(window).width(),wh=$(window).height();$.extend(options,{width:ww-Math.round(ww/100*10),height:wh-Math.round(wh/100*10),resizable:false,close:function(){$(div).empty();$(this).dialog('destroy').remove();},dialogClass:'ui-preview',onOpen:function(){var parent=div.parentNode;if(/\.(jpg|jpeg|gif|png)/i.test(url)){$(div).addClass('image-preview big-loader');var img=new Image(),loaded=false;var dw=$(parent).width(),dh=$(parent).height();img.onload=function(){if(loaded)
return false;if($.support.backgroundSize){$('div.image-preview').removeClass('loader').addClass('background').css({'background-image':'url("'+img.src+'")'});if(img.width>dw||img.height>dh){$('div.image-preview').addClass('resize');}}else{if(img.width>dw||img.height>dh){var dim=$.Plugin.sizeToFit(img,{width:Math.round($(window).width())-160,height:Math.round($(window).height())-190});$('div.image-preview').removeClass('loader').append('<img src="'+url+'" width="'+dim.width+'" height="'+dim.height+'" alt="'+$.Plugin.translate('preview','Preview')+'" />');$('div.image-preview').css('margin-top',($(parent).height()-dim.height)/2);}else{$('div.image-preview').removeClass('loader').addClass('background').css({'background-image':'url('+url+')'});}}
$(parent).click(function(){$(div.parentNode).dialog('close');});$(parent).dialog("option","position",'center');loaded=true;$(div).removeClass('big-loader');};img.src=url+(/\?/.test(url)?'&':'?')+new Date().getTime();}else if(/\.pdf$/i.test(url)){$(div).addClass('media-preview big-loader').height($(parent).height()-20);if($.support.pdfjs&&!$.support.pdf){$.getScript($.Plugin.getURI(true)+'components/com_jce/editor/libraries/js/pdf.js',function(){var $canvas=$('<canvas/>').attr({'id':'pdf'}).appendTo(div);PDFJS.disableWorker=true;var pdfDoc=null,pageNum=1,scale=0.8,canvas=$canvas.get(0),ctx=canvas.getContext('2d');function renderPage(num){pdfDoc.getPage(num).then(function(page){var viewport=page.getViewport(scale);canvas.height=viewport.height;canvas.width=viewport.width;var renderContext={canvasContext:ctx,viewport:viewport};page.render(renderContext);$(div).removeClass('big-loader');});}
PDFJS.getDocument(url).then(function getPdf(_pdfDoc){pdfDoc=_pdfDoc;renderPage(pageNum);});});}else{$(div).html('<object data="'+url+'" type="application/pdf" width="'+$(div).innerWidth()+'" height="'+$(div).innerHeight()+'"></object>').removeClass('big-loader');}}else{$(div).addClass('media-preview big-loader').height($(parent).height()-20);var mediaTypes={"flash":{classid:"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000",type:"application/x-shockwave-flash",codebase:"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"},"shockwave":{classid:"clsid:166b1bca-3f9c-11cf-8075-444553540000",type:"application/x-director",codebase:"http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0"},"windowsmedia":{classid:"clsid:6bf52a52-394a-11d3-b153-00c04f79faa6",type:"application/x-mplayer2",codebase:"http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701"},"quicktime":{classid:"clsid:02bf25d5-8c17-4b23-bc80-d3488abddc6b",type:"video/quicktime",codebase:"http://www.apple.com/qtactivex/qtplugin.cab#version=6,0,2,0"},"divx":{classid:"clsid:67dabfbf-d0ab-41fa-9c46-cc0f21721616",type:"video/divx",codebase:"http://go.divx.com/plugin/DivXBrowserPlugin.cab"},"realmedia":{classid:"clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa",type:"audio/x-pn-realaudio-plugin"},"java":{classid:"clsid:8ad9c840-044e-11d1-b3e9-00805f499d93",type:"application/x-java-applet",codebase:"http://java.sun.com/products/plugin/autodl/jinstall-1_5_0-windows-i586.cab#Version=1,5,0,0"},"silverlight":{classid:"clsid:dfeaf541-f3e1-4c24-acac-99c30715084a",type:"application/x-silverlight-2"},"video":{type:'video/mp4'}};var mimes={};(function(data){var items=data.split(/,/),i,y,ext;for(i=0;i<items.length;i+=2){ext=items[i+1].split(/ /);for(y=0;y<ext.length;y++)
mimes[ext[y]]=items[i];}})("application/x-director,dcr,"+"application/x-mplayer2,wmv wma avi,"+"video/divx,divx,"+"application/x-shockwave-flash,swf swfl,"+"audio/mpeg,mpga mpega mp2 mp3,"+"audio/ogg,ogg spx oga,"+"audio/x-wav,wav,"+"video/mpeg,mpeg mpg mpe,"+"video/mp4,mp4 m4v,"+"video/ogg,ogg ogv,"+"video/webm,webm,"+"video/quicktime,qt mov,"+"video/x-flv,flv,"+"video/vnd.rn-realvideo,rv,"+"video/3gpp,3gp,"+"video/x-matroska,mkv");var ext=$.String.getExt(url);var mt=mimes[ext];var type,props;$.each(mediaTypes,function(k,v){if(v.type&&v.type==mt){type=k;props=v;}});if(/^(mp4|m4v|og(g|v)|webm)$/i.test(ext)){type='video';props={type:mt};}
if(/^(mp3|oga)$/i.test(ext)){type='audio';props={type:mt};}
if(/^(flv|f4v)$/i.test(ext)){type='flv';props={};}
var swf=$.Plugin.getURI(true)+'components/com_jce/editor/libraries/mediaplayer/mediaplayer.swf';if(type&&props){switch(type){case'audio':case'video':if(type=='video'){$(div).append('<video autoplay="autoplay" controls="controls" type="'+props.type+'" style="width:100%;height:100%;" src="'+url+'"></video>');}else{$(div).append('<audio autoplay="autoplay" controls="controls" src="'+url+'"></audio>');}
var fb,ns='<p style="margin-left:auto;">'+$.Plugin.translate('media_not_supported','Media type not supported by this browser')+'</p>';if((!$.browser.webkit||/Chrome/.test(navigator.appName))&&/(mp4|mp3|m4v)$/i.test(ext)){fb=true;}
if(!/chrome/.test(navigator.userAgent)&&/^(webm)$/i.test(ext)){$(div).html(ns).removeClass('loader');}
if(!$.browser.mozilla&&/^(og(g|v))$/i.test(ext)){$(div).html(ns).removeClass('loader');}
if(fb){url=$.URL.toAbsolute(url);$(div).html('<object type="application/x-shockwave-flash" data="'+swf+'">'+'<param name="movie" value="'+swf+'" />'+'<param name="flashvars" value="src='+url+'&autoPlay=true&controlBarAutoHide=false&playButtonOverlay=false" />'+'</object>');if(ext=='mp3'){$('object',div).addClass('audio');}}
break;case'flv':url=$.URL.toAbsolute(url);$(div).append('<object type="application/x-shockwave-flash" data="'+swf+'">'+'<param name="movie" value="'+swf+'" />'+'<param name="flashvars" value="src='+url+'&autoPlay=true&controlBarAutoHide=false" />'+'</object>');break;case'flash':$(div).append('<object type="'+props.type+'" data="'+url+'" style="width:100%;height:100%;"><param name="movie" value="'+url+'" /></object>');break;default:$(div).append('<object classid="'+props.classid+'" style="width:100%;height:100%;">'+'<param name="src" value="'+url+'" />'+'<embed src="'+url+'" style="width:100%;height:100%;" type="'+props.type+'"></embed>'+'</object>');break;}
$(div).removeClass('big-loader');}}}});return $.Dialog.dialog($.Plugin.translate('preview','Preview')+' - '+name,div,options);}};$.String={utf8_chars:['À','Á','Â','Ã','Ä','Å','Æ','Ç','È','É','Ê','Ë','Ì','Í','Î','Ï','Ð','Ñ','Ò','Ó','Ô','Õ','Ö','Ø','Ù','Ú','Û','Ü','Ý','ß','à','á','â','ã','ä','å','æ','ç','è','é','ê','ë','ì','í','î','ï','ñ','ò','ó','ô','õ','ö','ø','ù','ú','û','ü','ý','ÿ','Ā','ā','Ă','ă','Ą','ą','Ć','ć','Ĉ','ĉ','Ċ','ċ','Č','č','Ď','ď','Đ','đ','Ē','ē','Ĕ','ĕ','Ė','ė','Ę','ę','Ě','ě','Ĝ','ĝ','Ğ','ğ','Ġ','ġ','Ģ','ģ','Ĥ','ĥ','Ħ','ħ','Ĩ','ĩ','Ī','ī','Ĭ','ĭ','Į','į','İ','ı','Ĳ','ĳ','Ĵ','ĵ','Ķ','ķ','Ĺ','ĺ','Ļ','ļ','Ľ','ľ','Ŀ','ŀ','Ł','ł','Ń','ń','Ņ','ņ','Ň','ň','ŉ','Ō','ō','Ŏ','ŏ','Ő','ő','Œ','œ','Ŕ','ŕ','Ŗ','ŗ','Ř','ř','Ś','ś','Ŝ','ŝ','Ş','ş','Š','š','Ţ','ţ','Ť','ť','Ŧ','ŧ','Ũ','ũ','Ū','ū','Ŭ','ŭ','Ů','ů','Ű','ű','Ų','ų','Ŵ','ŵ','Ŷ','ŷ','Ÿ','Ź','ź','Ż','ż','Ž','ž','ſ','ƒ','Ơ','ơ','Ư','ư','Ǎ','ǎ','Ǐ','ǐ','Ǒ','ǒ','Ǔ','ǔ','Ǖ','ǖ','Ǘ','ǘ','Ǚ','ǚ','Ǜ','ǜ','Ǻ','ǻ','Ǽ','ǽ','Ǿ','ǿ'],ascii_chars:['A','A','A','A','A','A','AE','C','E','E','E','E','I','I','I','I','D','N','O','O','O','O','O','O','U','U','U','U','Y','s','a','a','a','a','a','a','ae','c','e','e','e','e','i','i','i','i','n','o','o','o','o','o','o','u','u','u','u','y','y','A','a','A','a','A','a','C','c','C','c','C','c','C','c','D','d','D','d','E','e','E','e','E','e','E','e','E','e','G','g','G','g','G','g','G','g','H','h','H','h','I','i','I','i','I','i','I','i','I','i','IJ','ij','J','j','K','k','L','l','L','l','L','l','L','l','l','l','N','n','N','n','N','n','n','O','o','O','o','O','o','OE','oe','R','r','R','r','R','r','S','s','S','s','S','s','S','s','T','t','T','t','T','t','U','u','U','u','U','u','U','u','U','u','U','u','W','w','Y','y','Y','Z','z','Z','z','Z','z','s','f','O','o','U','u','A','a','I','i','O','o','U','u','U','u','U','u','U','u','U','u','A','a','AE','ae','O','o'],basename:function(s){return s.replace(/^.*[\/\\]/g,'');},dirname:function(s){return s.replace(/\\/g,'/').replace(/\/[^\/]*\/?$/,'');},filename:function(s){return this.stripExt(this.basename(s));},getExt:function(s){return s.substring(s.length,s.lastIndexOf('.')+1).toLowerCase();},stripExt:function(s){return s.replace(/\.[^.]+$/i,'');},pathinfo:function(s){var info={'basename':this.basename(s),'dirname':this.dirname(s),'extension':this.getExt(s),'filename':this.filename(s)};return info;},path:function(a,b){a=this.clean(a);b=this.clean(b);if(a.substring(a.length-1)!='/')
a+='/';if(b.charAt(0)=='/')
b=b.substring(1);return a+b;},clean:function(s){if(!/:\/\//.test(s)){return s.replace(/\/+/g,'/');}
return s;},utf8_to_ascii:function(s){var utf8=this.utf8_chars;var ascii=this.ascii_chars;for(var i=0,ln=utf8.length;i<ln;i++){s=s.replace(utf8[i],ascii[i],'g');}
return s;},_toUnicode:function(s){var c=s.toString(16).toUpperCase();while(c.length<4){c='0'+c;}
return'\\u'+c;},safe:function(s,mode,spaces){mode=mode||'utf-8';s=s.replace(/(\.){2,}/g,'');if(!spaces){s=s.replace(/[\s ]/g,'_');}
if(mode=='ascii'){s=this.utf8_to_ascii(s);s=s.replace(/[^\w\.\-~\s ]/gi,'');}else{s=s.replace(/[+\\\/\?\#%&<>"\'=\[\]\{\},;@^\(\)]/g,'');var r='';for(var i=0,ln=s.length;i<ln;i++){var ch=s[i];if(/[^\w\.\-~\s ]/.test(ch)){if(this._toUnicode(ch.charCodeAt(0))<'\\u007F'){continue;}}
r+=ch;}
s=r;}
s=s.replace(/^\./,'');return this.basename(s);},query:function(s){var p={};s=this.decode(s);if(/\?/.test(s)){s=s.substring(s.indexOf('?')+1);}
if(/([^=]+)=(.+)/.test(s)){var pairs=s.replace(/&amp;/g,'&').split(/&/g)||[s];$.each(pairs,function(){var pair=this.split('=');p[pair[0]]=pair[1];});}
return p;},encode:function(s){var baseEntities={'"':'&quot;',"'":'&#39;','<':'&lt;','>':'&gt;','&':'&amp;'};return(''+s).replace(/[<>&\"\']/g,function(chr){return baseEntities[chr]||chr;});},decode:function(s){var reverseEntities={'&lt;':'<','&gt;':'>','&amp;':'&','&quot;':'"','&apos;':"'"};return s.replace(/&(#)?([\w]+);/g,function(all,numeric,value){if(numeric)
return String.fromCharCode(value);return reverseEntities[all];});},escape:function(s){return encodeURI(s);},unescape:function(s){return decodeURI(s);},encodeURI:function(s,preserve_urls){if(/^(file:\/\/)?[A-Z]+:/.test(s)){return s;}
s=encodeURIComponent(decodeURIComponent(s)).replace(/%2F/g,'/');if(preserve_urls){s=s.replace(/%(21|2A|27|28|29|3B|3A|40|26|3D|2B|24|2C|3F|25|23|5B|5D)/g,function(a,b){return String.fromCharCode(parseInt(b,16));});}
return s;},buildURI:function(s){if(/^\s*www\./.test(s)){s='http://'+s;}
return s.replace(/ /g,'%20');},toHex:function(color){var re=new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)","gi");var rgb=color.replace(re,"$1,$2,$3").split(',');if(rgb.length==3){r=parseInt(rgb[0]).toString(16);g=parseInt(rgb[1]).toString(16);b=parseInt(rgb[2]).toString(16);r=r.length==1?0+r:r;g=g.length==1?0+g:g;b=b.length==1?0+b:b;return"#"+r+g+b;}
return color;},toRGB:function(color){if(color.indexOf('#')!=-1){color=color.replace(new RegExp('[^0-9A-F]','gi'),'');r=parseInt(color.substring(0,2),16);g=parseInt(color.substring(2,4),16);b=parseInt(color.substring(4,6),16);return"rgb("+r+","+g+","+b+")";}
return color;},ucfirst:function(s){return s.charAt(0).toUpperCase()+s.substring(1);},formatSize:function(s){if(s>1048576){return Math.round((s/1048576)*100)/100+" "+$.Plugin.translate('size_mb','MB');}
if(s>1024){return Math.round((s/1024)*100)/100+" "+$.Plugin.translate('size_kb','KB');}
return s+" "+$.Plugin.translate('size_bytes','Bytes');},formatDate:function(time,fmt){var date=new Date(time*1000);fmt=fmt||'%d/%m/%Y, %H:%M';function addZeros(value,len){var i;value=""+value;if(value.length<len){for(i=0;i<(len-value.length);i++)
value="0"+value;}
return value;}
fmt=fmt.replace("%D","%m/%d/%y");fmt=fmt.replace("%r","%I:%M:%S %p");fmt=fmt.replace("%Y",""+date.getFullYear());fmt=fmt.replace("%y",""+date.getYear());fmt=fmt.replace("%m",addZeros(date.getMonth()+1,2));fmt=fmt.replace("%d",addZeros(date.getDate(),2));fmt=fmt.replace("%H",""+addZeros(date.getHours(),2));fmt=fmt.replace("%M",""+addZeros(date.getMinutes(),2));fmt=fmt.replace("%S",""+addZeros(date.getSeconds(),2));fmt=fmt.replace("%I",""+((date.getHours()+11)%12+1));fmt=fmt.replace("%p",""+(date.getHours()<12?"AM":"PM"));fmt=fmt.replace("%%","%");return fmt;}};$.Plugin.loadLanguage();})(jQuery);