/* 
 * function highlightNewsResearch
 * Finds the News & Research link in the top navigation
 * and adds the CSS class that is used to highlight the current link.
 * This is only called on the single.php and archive.php pages,
 * because they are not associated with this parent page in wordpress.
 */
function highlightNewsResearch()
{
    var ul = document.getElementById('top_navigation');
    var children = ul.getElementsByTagName('li');
    var value;
    for( var i=0; i<children.length; i++)
    {
        var liChildren = children[i].childNodes;
        for( var j=0; j<liChildren.length; j++)
        {
            value=null;
            if( liChildren[j].childNodes[0])
            {
                value = liChildren[j].childNodes[0].nodeValue;
            }

            /* apply the class current_page_item to News & Research link for highlighting */
            if( value!=null && value.indexOf('News', 0) != -1)
            {
                /* check to see if IE is being used */
                var classAttribute;
                if( children[i].getAttribute('className'))
                {
                    classAttribute = 'className';
                }
                else
                {
                    classAttribute = 'class';
                }

                /* add current_page_item to the class attribute */
                var liClass = children[i].getAttribute(classAttribute);
                liClass += liClass?' current_page_item':'current_page_item';
                children[i].setAttribute(classAttribute, liClass);
            }
        }
    }
}

/*
 * Homepage Featured Logos
 */

jQuery(document).ready(function() {
    jQuery('#featured_logos img').hoverpulse( {
		size: 5,  // number of pixels to pulse element (in each direction)
		speed: 100 // speed of the animation 
    });
	jQuery('#featured_logos_carousel').jcarousel({
        scroll: 4,
        auto: 4,
		wrap: 'circular',
		animation: 'slow'
    });
});

