function emoty(text)
{
  text = ' ' + text + ' ';
  if (document.getElementById("wpis").createTextRange && document.getElementById("wpis").caretPos)
  {
    var caretPos = document.getElementById("wpis").caretPos;
    caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;
    document.getElementById("wpis").focus();
  } 
  else
  {
    document.getElementById("wpis").value  += text;
	document.getElementById("wpis").focus();
  }
}