// JavaScript Document

function getBlogEntriesByCategory1(inCategory1, inNumber1)
            {
                var theBlogPath1 = "/health/feed-resources/blogs-rss/rss/health-fullfeed.xml";
                createXMLHttp1(theBlogPath1, inCategory1, inNumber1);
            }
            
            function createXMLHttp1(inURL1, inCategory1, inNumber1)
            {
                theReqObj1 = false; 
                if (window.XMLHttpRequest) 
                    theReqObj1 = new XMLHttpRequest();  
                if (window.ActiveXObject)   
                    theReqObj1 = new ActiveXObject("Microsoft.XMLHTTP");
                theReqObj1.open("GET", inURL1, true);
                theReqObj1.onreadystatechange = function()
                {
                    if (theReqObj1.readyState == 2)
                    {
                    }
                    if (theReqObj1.readyState == 4)
                    {
                        var theXmlDoc1 = theReqObj1.responseXML;
                        var theObj1 = processBlog1(theXmlDoc1, inCategory1, inNumber1);
                    }
                }
                theReqObj1.send(null);
            }
            
            function processBlog1(inXmlDoc1, inCategory1, inNumber1)
            {
                var theOutputDiv1 = document.getElementById('rssContent1');
                var theNode1 = inXmlDoc1.documentElement;
                var theItems1 = theNode1.getElementsByTagName('item');
                var theCount1 = 0;
                for (var i = 0; (i < theItems1.length); i++)
                {
                    var theItem1 = theItems1[i];
                    var theCategories1 = theItem1.getElementsByTagName('category');
                    for (var j = 0; (j < theCategories1.length); j++)
                    {
                        var theCategory1 = theCategories1[j].firstChild.data;
                        if (theCategory1 == inCategory1)
                        {
                            var theTitle1 = theItem1.getElementsByTagName('title')[0].firstChild.data;
                            var theLink1 = theItem1.getElementsByTagName('link')[0].firstChild.data;
                            theOutputDiv1.innerHTML += '<a class="latest-news-links" href="' + theLink1 + '">' + theTitle1 + '<\/a>';
               theCount1++;
                        }
                    }
                    if (theCount1 >= inNumber1)
                    {
                        break; // already reached the maximum number of items to display
                    }
                }
            }
