add:  if (!methods) { Object.extend(Form, Form.Methods); Object.extend(Form.Element, Form.Element.Methods); Object.extend(Element.Methods.ByTag, { "FORM":     Object.clone(Form.Methods), "INPUT":    Object.clone(Form.Element.Methods), "SELECT":   Object.clone(Form.Element.Methods), "TEXTAREA": Object.clone(Form.Element.Methods) }); }  
context: Element.addMethods = function(methods) {  var F = Prototype.BrowserFeatures, T = Element.Methods.ByTag;  if (arguments.length == 2) {    var tagName = methods;    methods = arguments[1];  }    if (!tagName) Object.extend(Element.Methods, methods || {});    else {    if (tagName.constructor == Array) tagName.each(extend);    else extend(tagName);  }    function extend(tagName) {    tagName = tagName.toUpperCase();    if (!Element.Methods.ByTag[tagName])      Element.Methods.ByTag[tagName] = {};    Object.extend(Element.Methods.ByTag[tagName], methods);  }  function copy(methods, destination, onlyIfAbsent) {    onlyIfAbsent = onlyIfAbsent || false;    var cache = Element.extend.cache;    for (var property in methods) {      var value = methods[property];      if (!onlyIfAbsent || !(property in destination))        destination[property] = cache.findOrStore(value);    }  }    function findDOMClass(tagName) {    var klass;    var trans = {             "OPTGROUP": "OptGroup", "TEXTAREA": "TextArea", "P": "Paragraph",       "FIELDSET": "FieldSet", "UL": "UList", "OL": "OList", "DL": "DList",      "DIR": "Directory", "H1": "Heading", "H2": "Heading", "H3": "Heading",      "H4": "Heading", "H5": "Heading", "H6": "Heading", "Q": "Quote",       "INS": "Mod", "DEL": "Mod", "A": "Anchor", "IMG": "Image", "CAPTION":       "TableCaption", "COL": "TableCol", "COLGROUP": "TableCol", "THEAD":       "TableSection", "TFOOT": "TableSection", "TBODY": "TableSection", "TR":      "TableRow", "TH": "TableCell", "TD": "TableCell", "FRAMESET":       "FrameSet", "IFRAME": "IFrame"    };    if (trans[tagName]) klass = 'HTML' + trans[tagName] + 'Element';    if (window[klass]) return window[klass];    klass = 'HTML' + tagName + 'Element';    if (window[klass]) return window[klass];    klass = 'HTML' + tagName.capitalize() + 'Element';    if (window[klass]) return window[klass];        window[klass] = {};    window[klass].prototype = document.createElement(tagName).__proto__;    return window[klass];  }    if (F.ElementExtensions) {    copy(Element.Methods, HTMLElement.prototype);    copy(Element.Methods.Simulated, HTMLElement.prototype, true);  }    if (F.SpecificElementExtensions) {    for (var tag in Element.Methods.ByTag) {      var klass = findDOMClass(tag);      if (typeof klass == "undefined") continue;      copy(T[tag], klass.prototype);    }  }    Object.extend(Element, Element.Methods);  delete Element.ByTag;};
meta: 3332	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/3332/b76d34e7bb1f952fa1f3cfa2f8a4de5bfc4ab2be/dom.js/buggy/src/dom.js