function insertAtCursor(myField, myValue)
{
if (document.selection) {myField.focus(); document.selection.createRange().text = myValue;}
else if (myField.selectionStart || myField.selectionStart == '0') {myField.value = myField.value.substring(0,myField.selectionStart) + myValue + myField.value.substring(myField.selectionEnd,myField.value.length);}
else {myField.value += myValue;}
}