
var viewMode = 1;
  function initEditor()
  {
    iView.document.designMode = 'On';
  }
  function selOn(ctrl)
  {
        ctrl.style.borderColor = '#CCCCCC';
		ctrl.style.backgroundColor = '#FFFFFF';
        ctrl.style.cursor = 'hand';
  }
  function selOff(ctrl)
  {
        ctrl.style.borderColor = '#D6D3CE';
        ctrl.style.backgroundColor = '#D6D3CE';
  }
  function selDown(ctrl)
  {
        ctrl.style.backgroundColor = '#CCCCCC';
  }
  function selUp(ctrl)
  {
        ctrl.style.borderColor = '#D6D3CE';
        ctrl.style.backgroundColor = '#D6D3CE';
  }
  function doBold()
  {
        iView.document.execCommand('bold', false, null);
  }
  function doCopy()
  {
        iView.document.execCommand('copy', false, null);
  }
  function doSall()
  {
        iView.document.execCommand('selectall', false, null);
  }
   function doPaste()
  {
        iView.document.execCommand('paste', false, null);
  }
  function doItalic()
  {
        iView.document.execCommand('italic', false, null);
  }
  function doUnderline()
  {
        iView.document.execCommand('underline', false, null);
  }
  function doLeft()
  {
    iView.document.execCommand('justifyleft', false, null);
  }
  function doCenter()
  {
    iView.document.execCommand('justifycenter', false, null);
  }
  function doRight()
  {
    iView.document.execCommand('justifyright', false, null);
  }
  function doOrdList()
  {
    iView.document.execCommand('insertorderedlist', false, null);
  }
  function doCUT()
  {
    iView.document.execCommand('cut', false, null);
  }
  function doPrint()
  {
    iView.document.execCommand('print', false, null);
  }
  function doRef()
  {
    iView.document.execCommand('refresh', false, null);
  }
  function doIndent()
  {
    iView.document.execCommand('indent', false, null);
  }
  function doOutdent()
  {
    iView.document.execCommand('outdent', false, null);
  }
  function doBulList()
  {
    iView.document.execCommand('insertunorderedlist', false, null);
  }
  function doForeCol()
  {
    var fCol = prompt('Typ een kleu voor je teskt (bv: Darkblue, Fuchsia, Chocolate, Darkorange, ...)', '');
    if(fCol != null)
      iView.document.execCommand('forecolor', false, fCol);
  }
  function doBackCol()
  {
    var bCol = prompt('Typ een achtergrondkleur (bv: Silver, Pink, Darksalmon, Khaki, Orange, Guava, ...)', '');
    if(bCol != null)
      iView.document.execCommand('backcolor', false, bCol);
  }
  function doLink()
  {
    iView.document.execCommand('createlink');
  }
  function doImage()
  {
    var imgSrc = prompt('Typ hier de plaats waar de figuur online staat.', 'http://www.');
    if(imgSrc != null)
     iView.document.execCommand('insertimage', false, imgSrc);
  }
  function doRule()
  {
    iView.document.execCommand('inserthorizontalrule', false, null);
  }
  function doFont(fName)
  {
	var fName = prompt('Typ een Lettertype (bv: Arial, Tahoma, Times New Roman, Comic Sans, ...)', 'Arial');
    if(fName != '')
      iView.document.execCommand('fontname', false, fName);
  }
  function doSize(fSize)
  {
	var fSize = prompt('Groote (tussen 1 en 7)', '');
    if(fSize != '')
      iView.document.execCommand('fontsize', false, fSize);
  }
  function doHead(hType)
  {
  var hType = prompt('titel (tussen 1 en 5)', '');
    if(hType != '')
    {
      iView.document.execCommand('formatblock', false, hType);
      doFont(selFont.options[selFont.selectedIndex].value);
    }
  }
   function copyValue(f) {
     f.elements.Content.value = "" + iView.document.body.innerHTML + "";

  }
  function doToggleView()
  {
    if(viewMode == 1)
    {
      iHTML = iView.document.body.innerHTML;
      iView.document.body.innerText = iHTML;
      tblCtrls.style.display = 'none';
          //tblCtrls2.style.display = 'none';
      iView.focus();
      viewMode = 2; // Code
    }
    else
    {
      iText = iView.document.body.innerText;
      iView.document.body.innerHTML = iText;
      tblCtrls.style.display = 'inline';
          //tblCtrls2.style.display = 'inline';
      iView.focus();
      viewMode = 1;
    }
  }

  function verstuurForm(){
    iHTML = iView.document.body.innerHTML;
    document.forms.nieuwsForm.inhoud.value = iHTML;
    document.forms.nieuwsForm.submit();
  }
