How can I modify this script to use different replacement array based on the ID?
<p>I have this script below.  What I want to do is modify it so that it uses a different set of replacement values depending on what the document.getElementById('something') is.</p>

<p>So ('Headline') would use a different set of replacement characters from ('Body'), etc.</p>

<p>Thanks in advance</p>

<pre><code>function DeGlyph(element) {
// List of replacement rules. 
     replacements= [
        //Single Quote Characters
        ['\u0027', '\''],
        ['\u2018', '\''],
        ['\u2019', '\''],
        ['\u201A', '\''],
        ['\u201B', '\''],
        //Double Quote Characters
        ['\u0022', '"'],
        ['\u201C', '"'],
        ['\u201D', '"'],
        ['\u201E', '"'],
        ['\u201F', '"'],
        ['\u301D', '"'],
        ['\u301E', '"'],
        ['\u301F', '"'],
        //Other Characters      
        ['\u00BC', '1/4'],
        ['\u00BD', '1/2'],
        ['\u00BE', '3/4'],
        ['\u2122', '&lt;sup&gt;TM&lt;/sup&gt;'],        
        ['\u2013', '-'],
        ['\u2014', '&amp;mdash;'],
        ['\u00A9', '&amp;copy;'],
        ['\u00AE', '&amp;reg;']         


    ];


// Only attempt to use replacer behaviour if we can retain the cursor
// position. Setting value by default moves the cursor to the end of the
// input, which is too irritating.
//
    if (getInputSelection(element)!==null) {
        element.onkeyup= function() {
            value= element.value;
            for (var i= 0; i&lt;replacements.length; i++) {
                value= value.split(replacements[i][0]).join(replacements[i][1]);
            }
            if (value!=element.value) {
                var s= getInputSelection(element);
                element.value= value;
                setInputSelection(element, s);
            }
        };
    }
}

// Cross-browser (as much as possible anyway) cursor positioning
//
function getInputSelection(element) {
    if (element.selectionStart!==window.undefined) {
        return [element.selectionStart, element.selectionEnd];
    } else if (document.selection) {
        var BIG= 1000000;
        var range= document.selection.createRange();
        if (range.moveStart===window.undefined)
            return [0, 0];
        var start= -range.moveStart('character', -BIG);
        var end= -range.moveEnd('character', -BIG);
        return [start-1, end-1];
    } else return null;
}
function setInputSelection(element, s) {
    if (element.selectionStart!==window.undefined) {
        element.selectionStart= s[0];
        element.selectionEnd= s[1];
    } else if (document.selection) {
        var range= element.createTextRange();
        range.collapse(true);
        range.moveEnd('character', s[1]);
        range.moveStart('character', s[0]);
        range.select();
    }
}

new DeGlyph(document.getElementById('Headline')); 
new DeGlyph(document.getElementById('Body')); 
</code></pre>
