<!--
//// BEVITELI MEZOBE SZURAS PROMPTTAL START ////
function refocus_msg() {
    obj.focus();
}

function savecaret_msg(obj) {
    if (!document.all) return;
    if (obj.isTextEdit)
    obj.caretPos = document.selection.createRange();
}

function instext_msg(obj, txt) {
    if (isie) {
        if (!obj.isTextEdit) return;
        if ( obj.caretPos ) obj.caretPos.text = txt;
        else obj.value = obj.value + txt;
    } else {
        otext = obj.value; ss = obj.selectionStart;
        obj.value = otext.substring(0,ss) + txt + otext.substring(ss,obj.value.length);
        obj.selectionStart = ss + txt.length;
        obj.selectionEnd = obj.selectionStart;
    }
}

function savecaret_msg_() {
    savecaret_msg(obj);
}

function insertcode_msg(code) {
    if (isopera)
    with (obj)
    value += code;
    else
    instext_msg(obj,code);
    return true;
}

function replaceSubstring_msg(text,expression,value) {
    var exp = new RegExp(expression,'g');
    return text.replace(exp,value);
}

function myquery_msg(promptcaption, defvalue) {
    return window.prompt(promptcaption,defvalue);
}

function insertCode(myform, myinput, code, promptcaption, defvalue) {
    x = window.prompt(promptcaption,defvalue);
    obj = document.eval(myform).eval(myinput);
    obj.onselect = savecaret_msg_;
    obj.onclick  = savecaret_msg_;
    obj.onkeyup  = savecaret_msg_;
    if(!x) return false;
    if (x!="undefined") {
        code = replaceSubstring_msg(code,'%input%',x);
        refocus_msg();
        return insertcode_msg(code);
    }
    refocus_msg();
}

var isie = (document.all);
var isopera = (navigator.userAgent.indexOf('Opera')!=-1);
var obj;
//// BEVITELI MEZOBE SZURAS PROMPTTAL STOP ////
-->
