function color_window()
{
      ma_palette=window.open("/src/ressources/bbcode/palette.html","Palette_de_couleur","height=380,width=400,status=0, scrollbars=0,,menubar=0");
}

function insertTag(startTag, endTag, textareaId, tagType) {
        var field = document.getElementById(textareaId); 
        field.focus();
        
        if (window.ActiveXObject) { // C'est IE
                var textRange = document.selection.createRange();            
                var currentSelection = textRange.text;
                
                textRange.text = startTag + currentSelection + endTag;
                textRange.moveStart("character", -endTag.length - currentSelection.length);
                textRange.moveEnd("character", -endTag.length);
                textRange.select();     
        } else { // Ce n'est pas IE
                var startSelection   = field.value.substring(0, field.selectionStart);
                var currentSelection = field.value.substring(field.selectionStart, field.selectionEnd);
                var endSelection     = field.value.substring(field.selectionEnd);
                
                field.value = startSelection + startTag + currentSelection + endTag + endSelection;
                field.focus();
                field.setSelectionRange(startSelection.length + startTag.length, startSelection.length + startTag.length + currentSelection.length);
        }       
}

function clear_taille(id)
{
      var form_taille = document.getElementById(id);
      
      form_taille.value = "none";
}

