Capture the next main block element using JS
<p>The line in question is the var el2. I'm looking to hilite both the h element the script scrolls to <strong>* and *</strong> the next main block element (h, p, div, pre etc) below it. The best I've done so far is this:</p>

<pre><code>/* ScrollToThenFlash */(function(){var d=document;d.body.appendChild(d.createElement('script')).text="(function(){var d=document;function findPos(obj){var curtop=0;if(obj.offsetParent){do{curtop+=obj.offsetTop}while(obj=obj.offsetParent);return [curtop]}};d.onclick=function(){var dael=d.activeElement;dael.style.background='#ff9 !important';dael.style.color='#444 !important';if(dael.href.indexOf('#')!=-1 &amp;&amp; d.all[dael.href.split('#')[1]]){function flash(rep, delay){for(var i=rep;i&gt;0;i--){setTimeout('el.style.background=\"yellow !important\";el2.style.background=\"yellow !important\";', delay*i*2);setTimeout('el.style.background=elbg;el2.style.background=elbg2;', delay*((i*2)+1))};};el=d.all[d.all[dael.href.split('#')[1]].sourceIndex];

el2=d.all[d.all[dael.href.split('#')[1]].sourceIndex+1];elbg=el.style.background;elbg2=el2.style.background;scroll(0, findPos(el));flash(7,130);return false}else return true;/* alert('leaving this page!'); */};})()";})();
</code></pre>

<p>It works as intended here (click on the nav links at the top of the pg): <a href="http://jibbering.com/faq/notes/closures/" rel="nofollow">http://jibbering.com/faq/notes/closures/</a></p>

<p>But it only hilites the h element here: www.opera.com/docs/userjs/specs/</p>

<p>I've experimented with variations on:</p>

<pre><code>el2=el.nextSibling? d.all[el.nextSibling.sourceIndex] : el.parentNode.nextSibling? d.all[el.parentNode.nextSibling.sourceIndex] : d.all[d.all[dael.href.split('#')[1]].sourceIndex+1];
</code></pre>

<p>But the browser (IE6 Moz4) won't have any of it. Any advice html or js related is welcome.</p>
