//

/*
 * Deluxe Bar
 *
 * Barra d'espleches d'edicion espandida
 *
 * Autor : Dake
 * Darrièra revision : 3 de novembre de 2006
 */

//////////////////////ZÒNA PERSONALISABLA//////////////////////
var deluxebarMessages = new Array();
var deluxebarImages = new Array();
var deluxebarCommentaires = new Array();

with (deluxebarMessages) {
        push("{{subst:" + "Benvengut sus ta pagina"  + "}}" +  "~~" + "~~");
        push("{{subst:" + "Benvenguda" + "}}" +  "~~" + "~~");
        push("{{subst:" + "Vandal blocat" + "}}" +  "~~" + "~~");
        push("{{subst:" + "Vandalisme|pagina" + "}}" +  "~~" + "~~");
        push("{{subst:" + "Benvenguda spamaire" + "}}" +  "~~" + "~~");
        push("{{subst:" + "Fach}}" + "~~" + "~~");
}
with (deluxebarImages) {
        push("//upload.wikimedia.org/wikipedia/oc/1/12/Button_acuèlhA.png");
        push("//upload.wikimedia.org/wikipedia/oc/e/eb/Button_acuèlhB.png");
        push("//upload.wikimedia.org/wikipedia/oc/0/00/Button_vandal.png");
        push("//upload.wikimedia.org/wikipedia/oc/a/ad/Button_vandal2.png");
        push("//upload.wikimedia.org/wikipedia/oc/f/fb/Button_spam2.png");
        push("//upload.wikimedia.org/wikipedia/oc/d/d9/Button_tractat.png");
}

with (deluxebarComentaris) {
        push("Benvenguda sus ta pagina !");
        push("Benvenguda !");
        push("Blocatge d'un vandal");
        push("Avertiment vandalisme");
        push("Avertiment spam" );
        push("Fach");
}
/////////////////FIN DE LA ZÒNA PERSONALISABLA/////////////////

function DeluxeBar() {
        if (document.createTextNode) {
                var toolbar = document.getElementById("toolbar");
                if (!toolbar) return;


                for (var i=0;i<deluxebarMessages.length;i++) {
                        var img = document.createElement("img");
                        img.setAttribute("src", deluxebarImages[i]);

                        var ref = document.createElement("a");
                        ref.setAttribute("href", "javascript:insertTags('', \"" + deluxebarMessages[i] + "\", '');" +
                                        "javascript:changeSummary(\"" + deluxebarComentaris[i] + "\");" );
                        ref.appendChild(img);

                        toolbar.appendChild(ref);
                }
        }
}

function changeSummary(sampleText) {
        var resum = document.editform.wpSummary.value;
        if(resum != 0 && resum.indexOf("*/") < resum.length - 3) {
                document.editform.wpSummary.value += " - ";
        }
        document.editform.wpSummary.value += sampleText;
}
       
}
addLoadEvent(DeluxeBar);
//