function insertAtCursor(el, myValue) {
    //IE support
    if (document.selection) {
        el.focus();
        sel = document.selection.createRange();
        sel.text = myValue;
    } else if (el.selectionStart || el.selectionStart == '0') {
        //MOZILLA/NETSCAPE support
        var startPos = el.selectionStart;
        var endPos = el.selectionEnd;
        el.value = el.value.substring(0, startPos) + myValue + el.value.substring(endPos, el.value.length);
    } else {
        el.value += myValue;
    }
} 
