﻿function ucFirst(string)
{
	var firstChar = string.substring(0, 1).toUpperCase();
	var restChars = string.substring(1).toLowerCase();
	var word = firstChar + restChars;
	
	return word;
}

function insertAtCursor(myValue) {
  if (document.selection) {
	document.frmNieuwBericht.txtBericht.focus();
	sel = document.selection.createRange();
	sel.text = myValue;
  } else if (document.frmNieuwBericht.txtBericht.selectionStart || document.frmNieuwBericht.txtBericht.selectionStart == '0') {
	var startPos = document.frmNieuwBericht.txtBericht.selectionStart;
	var endPos = document.frmNieuwBericht.txtBericht.selectionEnd;
	document.frmNieuwBericht.txtBericht.value = document.frmNieuwBericht.txtBericht.value.substring(0, startPos) + myValue + document.frmNieuwBericht.txtBericht.value.substring(endPos, document.frmNieuwBericht.txtBericht.value.length);
  } else {
	document.frmNieuwBericht.txtBericht.value += myValue;
  }
}
