/* specific JS hacks for htsoft.com */

function setMenuWidth(sectionURI, width) {
        /* used to set just the width of the C Compilers sub menu 
        sectionURI = regex matching the URI of the main menu item (eg. /products/compilers/)
        width = desired width
        */

        aElements = document.getElementById('treemenu1').getElementsByTagName('a');
                for (var i=0; i < aElements.length; i++) {
                        sectionLink = aElements[i];
                        if (sectionLink != null && sectionLink.href.match(sectionURI)) {
				menuItems = sectionLink.nextSibling.nextSibling.getElementsByTagName('a');
                                for (var m=0; m < menuItems.length; m++) {
                                        menuItems[m].style.width = width+'px';
                                };
                                spanItems = sectionLink.nextSibling.nextSibling.getElementsByTagName('span');
                                for (var m=0; m < spanItems.length; m++) {
                                        spanItems[m].style.width = width+'px';
                                };
                        };
                };
}

