// ==UserScript==
// @name           Re-enable Autocomplete for Forms that have been broken.
// @namespace      http://spig.net/userscripts/
// @description    Allow any form that has auto-complete disabled to work again and allow the browser to save the username/password in forms.
// @date          2009-1-28
// @GM_version    0.7.20070607.0
// @version       0.1.4
// ==/UserScript==

for (var i=0; i<document.forms.length; i++) {
  if (document.forms[i].attributes.getNamedItem("autocomplete") != undefined)
  {
    document.forms[i].attributes.getNamedItem("autocomplete").value = "on";
  }

  // remove auto-complete disabled for any element in the form
  var elements = document.forms[i].elements;
  for(var j=0; j<elements.length; j++) {
    if (elements[j].attributes.getNamedItem("autocomplete") != undefined) {
      elements[j].attributes.getNamedItem("autocomplete").value = "on";
    }
  }
}
