tinymce.create("tinymce.plugins.InsertDateTime",{init:function(e,t){var n=this;n.editor=e,e.addCommand("mceInsertDate",(function(){var t=n._getDateTime(new Date,e.getParam("plugin_insertdate_dateFormat",e.getLang("insertdatetime.date_fmt")));e.execCommand("mceInsertContent",!1,t)})),e.addCommand("mceInsertTime",(function(){var t=n._getDateTime(new Date,e.getParam("plugin_insertdate_timeFormat",e.getLang("insertdatetime.time_fmt")));e.execCommand("mceInsertContent",!1,t)})),e.addButton("insertdate",{title:"insertdatetime.insertdate_desc",cmd:"mceInsertDate"}),e.addButton("inserttime",{title:"insertdatetime.inserttime_desc",cmd:"mceInsertTime"})},getInfo:function(){return{longname:"Insert date/time",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/insertdatetime",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_getDateTime:function(e,t){var n=this.editor;function a(e,t){if((e=""+e).length<t)for(var n=0;n<t-e.length;n++)e="0"+e;return e}return t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=(t=t.replace("%D","%m/%d/%y")).replace("%r","%I:%M:%S %p")).replace("%Y",""+e.getFullYear())).replace("%y",""+e.getYear())).replace("%m",a(e.getMonth()+1,2))).replace("%d",a(e.getDate(),2))).replace("%H",""+a(e.getHours(),2))).replace("%M",""+a(e.getMinutes(),2))).replace("%S",""+a(e.getSeconds(),2))).replace("%I",""+((e.getHours()+11)%12+1))).replace("%p",e.getHours()<12?"AM":"PM")).replace("%B",""+n.getLang("insertdatetime.months_long").split(",")[e.getMonth()])).replace("%b",""+n.getLang("insertdatetime.months_short").split(",")[e.getMonth()])).replace("%A",""+n.getLang("insertdatetime.day_long").split(",")[e.getDay()])).replace("%a",""+n.getLang("insertdatetime.day_short").split(",")[e.getDay()])).replace("%%","%")}}),tinymce.PluginManager.add("insertdatetime",tinymce.plugins.InsertDateTime);
