/*
 * Copyright (C) 2005 Stephen Ostermiller
 * http://ostermiller.org/contact.pl?regarding=Bookmarklets
 * Copyright (C) 2005 Reed Meyer
 *
 * This bookmarklet is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This bookmarklet is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */

/**
 * Highlight all the heading (h1 through h6) on a page.
 *
 * @name Highlight Headings
 *
 * @substitute heading_index a
 * @substitute heading_list b
 * @substitute headinglist_index c
 * @substitute current_heading d
 * @substitute heading_style e
 * @substitute color_array f
 *
 * @compatible Firefox
 * @compatible Internet Explorer
 * @compatible Mozilla
 *
 * @category Meta
 *
 */
void(
    (function(){
        var heading_index,heading_list,headinglist_index,current_heading,heading_style,color_array;
        color_array=new Array("pink","orange","yellow","aquamarine","lightskyblue","plum");        
        for(heading_index=1;heading_index<=6;heading_index++){
            heading_list=document.getElementsByTagName("h"+heading_index);
            for(headinglist_index=0;headinglist_index<heading_list.length;headinglist_index++){
                current_heading=heading_list[headinglist_index];
                heading_style=current_heading.style;
                heading_style.backgroundColor=color_array[heading_index-1];
                heading_style.border="1px solid black";
                heading_style.color="black";
                current_heading.innerHTML="H"+heading_index+" "+current_heading.innerHTML;
            }       
        }
    })()
)
