Portlet_editor=function(){
  this.doBold=function(){
    document.execCommand('bold',false,null);
  }
  
  this.doItalic=function(){
    document.execCommand('italic',false,null);
  }
  
  this.doUnderline=function(){
    document.execCommand('underline',false,null);
  }
  
  this.doStrikeThrough=function(){
    document.execCommand('strikethrough',false,null);
  }
  
  this.doLeftAlign=function(){
    document.execCommand('justifyleft',false,null);
  }
  
  this.doRightAlign=function(){
    document.execCommand('justifyright',false,null);
  }
  
  this.doCenterAlign=function(){
    document.execCommand('justifycenter',false,null);
  }
  
  this.doOrderedList=function(){
    document.execCommand('insertorderedlist',false,null);
  }
  
  this.doUnorderedList=function(){
    document.execCommand('insertunorderedlist',false,null);
  }
  
  this.doLink=function(){
    var s=window.prompt("Vložte odkaz: ");
    document.execCommand('createlink',true,s);
  }
  
  this.doInterLink=function(){
    var e=document.createElement('div');
    e.setAttribute('id','portlet_fileTree_wrapper');
    portlet_fileTree=new Portlet_fileTree('insertInterLink');
    e.innerHTML=portlet_fileTree.html;
    document.getElementById('portlet_editor_editable').appendChild(e);
  }
  
  this.insertInterLink=function(link){
    document.execCommand('createlink',true,link);
  }
  
  this.doImage=function(){
    var s=window.prompt("Cesta ku obrázku: ");
    document.execCommand('insertimage',true,s);
  }
  
  this.doInterImage=function(){
    //var s=window.prompt("Cesta ku obrázku: ");
    //document.execCommand('insertimage',true,s);
    
    var e=document.createElement('div');
    e.setAttribute('id','portlet_fileTree_wrapper');
    portlet_fileTree=new Portlet_fileTree('insertInterImage');
    e.innerHTML=portlet_fileTree.html;
    document.getElementById('portlet_editor_editable').appendChild(e);
  }
  
  this.insertInterImage=function(link){
    document.execCommand('insertimage',true,link);
  }
  
  this.doColor=function(color){
    document.execCommand('forecolor',false,color);
  }
  
  this.doUndo=function(){
    document.execCommand('undo',false,null);  
  }
  
  this.prepareToSubmit=function(elementFrom, elementTo){
    elementTo.value=elementFrom.innerHTML;
  }
  
}
