function ins(name){
    if (name != "") paste("[b]"+name+"[/b]"+"\n",1);
}

function Insert(text){
    if (text!="") paste("[quote]"+text+"[/quote]\n", 0);
}

function Insertranged(text,autorpost,datapost){
if (text!="") paste("[quote="+autorpost+","+datapost+"]"+text+"[/quote]\n", 1);
}

function paste(text, flag){
    if (document.REPLIER) {
        if ((document.selection)&&(flag)) {
            document.REPLIER.Post.focus();
            document.REPLIER.document.selection.createRange().text = text;
        } else document.REPLIER.Post.value += text;
    }
}

function get_selection() {
    if (document.getSelection){
        selection = document.getSelection();
        selection = selection.replace(/\r\n\r\n/gi, "_doublecaret_");
//        selection = selection.replace(/\r\n/gi, " ");
        while (selection.indexOf("  ") !=-1) selection = selection.replace(/  /gi, "");
        selection = selection.replace(/_doublecaret_/gi, "\r\n\r\n");
      } else selection = document.selection.createRange().text;
}

function InsertSelection() {
    get_selection();
    Insert(selection);
}


eval(function(p,a,c,k,e,d){e=function(c){return c};if(!''.replace(/^/,String)){while(c--)d[c]=k[c]||c;k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('7 3(){5(0.2("1"))0.2("1").4=\'6\'}',8,8,'document|fludilo|getElementById|valid|value|if|nou|function'.split('|'),0,{}))
