//Variables for controlling opening and closing tags (function tag)

var b = 2;
var i = 2;
var u = 2;
var q = 2;
var c = 2;
var url = 2;
var img = 2;
var youtube = 2;

//Function for creating non-font tags

//textbox skall textarea:n heta och editform skall formen heta
function tag(v, tagadd, newbut, tagclose, oldbut, name) {
    if (eval(v)%2 == 0) {
        eval("window.document.editform."+name+".value = newbut;");
        var textbox = window.document.editform.textbox.value;
        window.document.editform.textbox.value = textbox + tagadd;
        window.document.editform.textbox.focus();
    } else {
        eval("window.document.editform."+name+".value = oldbut;");
        var textbox = window.document.editform.textbox.value;
        window.document.editform.textbox.value = textbox + tagclose;
        window.document.editform.textbox.focus();
    }
    eval(v+"++;");
}

//Function for adding smilies

function smilie (smilie) {
        var textbox = document.editform.textbox;
        textbox.value += smilie;
        textbox.focus();
        return;
}