Let's start by addressing the issue of having two elements with the same IDs. Your markup should be structured like this:
<button name='name_of_button' id='id_of_button1' ondblclick="runFunction( this );">Enabled Button</button>
<br>
<button name='name_of_button' id='id_of_button2' ondblclick="runFunction( this );" disabled>Disabled Button</button>
Secondly, it is recommended to avoid using inline javascript. You can solve your problem by organizing your code in the following way:
HTML:
<div class="wrapper">
<button name='name_of_button'>Enabled Button</button>
<div class="over"></div>
</div>
<div class="wrapper">
<button name='name_of_button' disabled="disabled">Disabled Button</button>
<div class="over"></div>
</div>
JS:
window.onload = function() {
var dblClicked = function() {
console.log(this.parentNode.childNodes[1].removeAttribute("disabled"));
}
var overlays = document.querySelectorAll(".wrapper .over");
for(var i=0; i<overlays.length; i++) {
var over = overlays[i];
over.addEventListener("dblclick", dblClicked);
}
}
http://jsfiddle.net/NRKLG/12/
If an element is disabled, it cannot trigger events. To work around this, you can place a transparent overlay div over the button to capture the events.