It works! Hallelujah. For others who may be interested the key was to explicitly use quot; around the html id and name as in
<a id="1000" name="MyName"></a>
Thanks for the help Adam, you suggestion that I look at custombuttons-popup pushed me to figure this out.