﻿    function insertMovie(editor) {
      editor._save_imageBrows = editor.imageBrows;
      editor.imageBrows = editor.imageBrows.replace(/myImageBrowse/,"myImageBrowseFlv");
      editor.imagePopupName = "flvmovie";
      editor.imageBrowseTitle = "Bläddra efter .flv filmer";
      editor.imageCallback = function(img) {
         if(img != null) {
            var name = /(\w|[-.])+$/.exec(img.src)[0].replace(/([\w-]+)\.\w+$/i,"$1");
            img.id = name;
            img.setAttribute("flyout",name);
         }
         this.imageBrows = this._save_imageBrows;
         this.imagePopupName = null;
         this.imageCallback = null;
         this.imageBrowseTitle = null;
      };editor.insertIMG();}

    if(typeof HTMLEditor._saved_editIMG != "function") {
       HTMLEditor._saved_editIMG = HTMLEditor._editIMG;
       HTMLEditor._editIMG = function(editor,img) {
          var flyout = img.getAttribute("flyout");
          if(flyout && flyout.length > 0) {
             editor._save_imageBrows = editor.imageBrows;
             editor.imageBrows = editor.imageBrows.replace(/myImageBrowse/,"myImageBrowseFlv");
             editor.imagePopupName = "flvmovie";
             editor.imageBrowseTitle = "Bläddra efter .flv filmer";
             editor.imageCallback = function(img) {
                this.imageBrows = this._save_imageBrows;
                this.imagePopupName = null;
                this.imageCallback = null;
                this.imageBrowseTitle = null;
             };
          }HTMLEditor._saved_editIMG(editor,img);};
    }