  window.onload = initialization;
  function initialization(){
    var inputName = 'c_name';
    var inputTitle = 'c_title';
    var textarea = 'c_txt';
    var validation = 'c_validation';

    document.getElementById(inputName).setAttribute('onclick','process("'+inputName+'");');
    document.getElementById(inputTitle).setAttribute('onclick','process("'+inputTitle+'");');
    document.getElementById(textarea).setAttribute('onclick','process("'+textarea+'");');
    document.getElementById(validation).setAttribute('onclick','process("'+validation+'");');
  }

  function clickIE4(){
    if (event.button==2||event.button==3)return false;
  }

  function clickNS4(e){
    if (document.layers||document.getElementById&&!document.all)
      if (e.which==2||e.which==3)
        return false;
  }

  if (document.layers){
    document.captureEvents(event.mousedown);
    //document.onmousedown = clickNS4;
    document.onmousedown = new Function ('return false;');
    document.onmouseup = new Function ('return false;');
  }
  else if (document.all&&!document.getElementById){
    document.onmousedown = clickIE4;
    document.onmouseup = clickIE4;
    //document.onselectstart = new Function ('return false;');
  }

  function disableselect(e){
    return false;
  }

  if (window.sidebar){
    document.onmousedown=disableselect;
  }

  function process(tag){
    var area = document.getElementById(tag);
    setCaretPosition(area, area.value.length);
  }

  function setCaretPosition(ctrl, pos)
  {
    if(ctrl.setSelectionRange){
      ctrl.focus();
      ctrl.setSelectionRange(pos,pos);
    }
    else if (ctrl.createTextRange) {
      var range = ctrl.createTextRange();
      range.collapse(true);
      range.moveEnd('character', pos);
      range.moveStart('character', pos);
      range.select();
    }
  }


  function stopcopy(e)
  {
    var nokeys = new Array('a', 'c', 'x', 'j', 'u');
    var key;
    var isCtrl = false;

    if(window.event){
      key = window.event.keyCode;
      if(window.event.ctrlKey) isCtrl = true;
    }
    else {
      key = e.which;
      if(e.ctrlKey) isCtrl = true;
    }
    if(isCtrl)
      for(i=0; i<nokeys.length; i++)
        if(nokeys[i].toLowerCase() == String.fromCharCode(key).toLowerCase()) return false;

    return true;
  }

