(function(){tinymce.create('tinymce.plugins.DragMathPlugin',{init:function(ed,url){course_id=tinyMCE.activeEditor.getParam('moodleimage_course_id');ed.addCommand('mceDragMath',function(){ed.windowManager.open({file:url+'/dragmath.php?id='+course_id,width:540,height:380,inline:1},{plugin_url:url,some_custom_arg:'custom arg'});});ed.addButton('dragmath',{title:'Insert Equation',cmd:'mceDragMath',image:url+'/img/dragmath.gif'});ed.onNodeChange.add(function(ed,cm,n){cm.setActive('dragmath',n.nodeName=='IMG');});},createControl:function(n,cm){return null;},getInfo:function(){return{longname:'Moodle Dragmath plugin',author:'Glen Davies',authorurl:'http://www.canterbury.ac.nz',infourl:'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example',version:"1.0"};}});tinymce.PluginManager.add('dragmath',tinymce.plugins.DragMathPlugin);})();