﻿function FormatovaciZnaky(obj,startVal,endVal){
var o = obj;
o.focus();
if (document.selection)
{
    sel = document.selection.createRange();
    var selText = sel.text;
    sel.text = startVal + selText + endVal;
}
else if (o.selectionStart || o.selectionStart == '0')
{
var startPos = o.selectionStart;
var endPos = o.selectionEnd;
o.value = o.value.substring(0,startPos) + startVal + o.value.substring(startPos,endPos) + endVal + o.value.substring(endPos,o.value.length);
    setCursorPos (document.formular.text, startPos,startPos);
}
else
{
o.value += startVal + endVal;
    setCursorPos (document.formular.text, startPos, startPos);
}
} 

