
/*
 * -------
 * :ATTRIBUTION NOTICE BEGINS
 *
 * The following JSMsg functions are:
 * 
 *    (C) Copyright 2002 - 2004, Creativyst, Inc.
 *               ALL RIGHTS RESERVED
 * 
 * For more information go to:
 *   http://www.Creativyst.com/Doc/Std/JSMsg/JSMsg.htm
 * or email:
 *            Support@Creativyst.com
 * 
 * Licensed under the Open Software License version 1.1
 *
 * END ATTRIBUTION NOTICE:
 * -------
 *
 * The following version token is 
 * required by aggregators
 * -------
 * JSMsgVersion:1.0a
 * -------
 *
 * Made by: JSMFeed.pl v1.0e
*/
/* JSCpragma:StartCompress
*/
/* These functions are free software; you can redistribute 
 * them and/or modify them under the terms of the Open 
 * Software License (OSL) version 1.1 as published by
 * the Open Source Initiative;
 * 
 * This program 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 Open Software License
 * version 1.1 for more details.
 * 
 * For the complete details of the Open Software License
 * please visit the Open Source Initiative website.
 *
 * 
 * These functions are part of a shared convention.
 * called JSMsg.  Please see the JSMsg document
 * for more details.
 *
 * www.creativyst.com/Doc/Std/JSMsg/JSMsg.htm
 *
 * -------------------------------------------
 * Parts of this code were automatically
 * generated and may contain copyrighted
 * content from other sources as well.
 * Such content may not be used without
 * first obtaining explicit permissions
 * from their sources.
 *
 *
*/

function nn_JSMsg() {

this.Title = Array([this.ShortListSize]);
this.Desc = Array([this.ShortListSize]);
this.Link = Array([this.ShortListSize]);
this.DateN = Array([this.ShortListSize]);

this.MetaKeys = Array([4]);
this.MetaVals = Array([4]);



 this.ShortListSize = 12;
 this.BeenLoaded = 0;
 this.dispNumb;

 this.Msg = function(msgPart, msgOffset)
 {
    document.write( this.Get(msgPart, msgOffset) );
 }

 this.MsgDay = function(msgPart)
 {
    document.write( this.GetDay(msgPart) );
 }

 this.MsgN = function(msgPart, msgNumber)
 {
    document.write( this.GetN(msgPart, msgNumber) );
 }


 this.Get = function(msgPart, msgOffset)
 {
    if(!msgOffset) {
        msgOffset = 0;
    }
    if(!this.BeenLoaded) {
        this.BeenLoaded = 1;
        dispNumb = 
           this.getRandInt(this.ShortListSize);
    }
    return( this.GetN(msgPart, (dispNumb + msgOffset)) );
 }

 this.GetMsgN = function()
 {
	return(this.ShortListSize);
 }

 this.GetDay = function(msgPart)
 {
    var d = new Date();
    var x = d.getDate();
    return( this.GetN(msgPart, x) );
 }


 this.GetN = function(msgPart, msgNumber)
 {
    return( this.GetNCore(msgPart, msgNumber) );
 }

 this.GetNCore = function(msgPart, msgNumber)
 {
    var myTmp;

    if(!msgPart) {
        msgPart = "Body";
    }
    if(!msgNumber) {
        msgNumber = 0;
    }

    if(msgNumber >= this.ShortListSize) {
        msgNumber = msgNumber % this.ShortListSize;
    }

    if(  this.ok(msgPart,"Type") ) {
        return(this.Type[msgNumber]);
    }
    if(  this.ok(msgPart,"Title") ) {
        return(this.Title[msgNumber]);
    }
    if(  this.ok(msgPart, "Desc Description Content") ) {
        return(this.Desc[msgNumber]);
    }
    if(  this.ok(msgPart,"Body") ) {
        return(this.Body[msgNumber]);
    }
    if(  this.ok(msgPart, "Attrib Attribute Source") ) {
        return(this.Attrib[msgNumber]);
    }
    if(  this.ok(msgPart, "Author") ) {
        if(!this.Author[msgNumber]) {
            return(this.Attrib[msgNumber]);
        }
        return(this.Author[msgNumber]);
    }

    if(  this.ok(msgPart,"DayN Day2N Day") ) {
        myTmp = this.DateN[msgNumber];
        if(myTmp.length) { 
          myTmp = myTmp.substr(6,2);
          if(  this.ok(msgPart,"Day2N") ) {
            return(myTmp);
          }
          if(myTmp.charAt(0) == "0") {
            return(myTmp.substr(1,1))
          }
          return(myTmp);
        }
    }
    if(  this.ok(msgPart, "MonthN Month2N") ) {
        myTmp = this.DateN[msgNumber];
        if(myTmp.length) {
          myTmp = myTmp.substr(4,2)
          if(  this.ok(msgPart,"Month2N") ) {
            return(myTmp);
          }
          if(myTmp.charAt(0) == "0") {
            return(myTmp.substr(1,1))
          }
          return(myTmp);
        }
    }
    if(  this.ok(msgPart, "Year2N Year4N YearN Year") ) {
        if(this.DateN[msgNumber].length) {
          if(  this.ok(msgPart,"Year2N") ) {
            return(this.DateN[msgNumber].substr(2,2));
          }
          return(this.DateN[msgNumber].substr(0,4));
        }
    }

    if(  this.ok(msgPart,"Time") ) {
      myTmp = this.DateN[msgNumber];
      return(myTmp.substr(8,6));
    }
    if(  this.ok(msgPart,"Hour2N") ) {
      myTmp = this.DateN[msgNumber];
      return(myTmp.substr(8,2));
    }
    if(  this.ok(msgPart,"Minute2N") ) {
      myTmp = this.DateN[msgNumber];
      return(myTmp.substr(10,2));
    }

    if(  this.ok(msgPart,"Link") ) {
        return(this.Link[msgNumber]);
    }
    if( this.ok(msgPart,"LinkTitle") ) {
        if(this.MetaMsg(msgPart,"Link") && this.MetaMsg(msgPart,"Title") ) {
          if( !this.Link[msgNumber] ) {
              return(this.Title[msgNumber]);
          }

          if( !this.Title[msgNumber] ) {
            this.Title[msgNumber] =  this.Link[msgNumber];              
          }
          myTmp = '<A TARGET="_blank" \n'; 
          myTmp = myTmp + 'HREF="' + this.Link[msgNumber] + '">\n';
          myTmp = myTmp + this.Title[msgNumber] + '</A>\n';

          return(myTmp);

        }
        if( this.MetaMsg(msgPart,"Title") ) {
          return(this.Title[msgNumber]);
        }
        if( this.MetaMsg(msgPart,"Link") ) {
          if( this.Link[msgNumber] ) {
            myTmp = "<A TARGET=\"_blank\" \n"; 
            myTmp = myTmp + "HREF=\"" + this.Link[msgNumber] + "\">\n";
            myTmp = myTmp + this.Link[msgNumber] + "</A>\n";
            return(myTmp);
          }
        }
        return("");
    }
    if( this.ok(msgPart,"Cat Category Subject") ) {
        return(this.Cat[msgNumber]);
    }
    if( this.ok(msgPart,"Thumb") ) {
        return(this.Thumb[msgNumber]);
    }
    if( this.ok(msgPart,"Alt") ) {
        return(this.Alt[msgNumber]);
    }

    return("");
 }




 this.getRandInt = function(RandSz)
 {
    var t, t2, t3;

    t = 0;
    while(t < .000001) {
        t = Math.random();
        t = Math.abs(t);
    }
    t2 = t * 1000000;
    t2 = Math.round(t2);
    t3 = t2 % RandSz;
    return(t3);
 }



 this.ok = function(a, b)
 {
    var t, t2;

    if(!this.is(a,b)) {
        return(0);
    }
    return(this.MetaMsg(a));
 }

 this.is = function(a, b)
 {
    var t, t2;

    t = a + " ";
    t2 = b + " ";
    t2 = t2.toUpperCase();
    t = t.toUpperCase();

    if(t2.indexOf(t) == -1) {
        return(0);
    }
    return(1);
 }


 this.MetaMsg = function(msgCmd)
 {
    var i,l;

    if( this.is(msgCmd, "Title LinkTitle Desc Description Link LinkTitle DayN Day2N MonthN Month2N Year2N Year4N YearN Year Time Hour2N Minute2N ") ) {
         return(1);

    }
    else if( this.is(msgCmd, "MetaCount") ) {
        return(12);
    }
    else {
        if(this.MetaKeys) {
            l = this.MetaKeys.length;
            for(i = 0;i < l;i++) {
                if(this.MetaKeys[i] == msgCmd) {
                    return(this.MetaVals[i]);
                }
            }
        }
        return(0);
    }
 }

     

}

nn = new nn_JSMsg();

/* how slow is the with statement */

with( nn ) {
/* Meta values
*/
MetaKeys[0] = "MetaTitle";
MetaVals[0] = "National Institutes of Health (NIH) News Releases";
MetaKeys[1] = "MetaLink";
MetaVals[1] = "http://www.nih.gov/news/";
MetaKeys[2] = "MetaLinkTitle";
MetaVals[2] = "<A HREF=\"http://www.nih.gov/news/\" CLASS=\"JSMsg\">National Institutes of Health (NIH) News Releases</A>";
MetaKeys[3] = "MetaDesc";
MetaVals[3] = "News Releases from the National Institutes of Health (NIH)";


/* content vaues:
*/
Title[0] = "NCCAM&apos;s Advisory Council Welcomes Five New Members";
Desc[0] = "The National Center for Complementary and Alternative Medicine (NCCAM) welcomes five new members to the National Advisory Council for Complementary and Alternative Medicine (NACCAM). The council serves as the principal advisory body to NCCAM, the lead Federal agency for complementary and alternative medicine (CAM) research, and a component of the National Institutes of Health. \n\n ";
Link[0] = "http://www.nih.gov/news/health/feb2010/nccam-05.htm";
DateN[0] = "20100205130100";

Title[1] = "NIA Funds Roybal Centers for Translational Research in Aging";
Desc[1] = "The National Institute on Aging (NIA), part of the National Institutes of Health, today announced that it has renewed funding for nine Edward R. Roybal Centers for Research on Applied Gerontology and designated four new centers. The goal of the centers is to move promising social and behavioral research findings out of the laboratory and into programs and practices that will improve the lives of older people and help society adapt to an aging population. The centers focus on a range of projects, including maintaining mobility and physical function, enhancing driving performance, understanding financial and medical decision making, and sharpening cognitive function. \n\n ";
Link[1] = "http://www.nih.gov/news/health/feb2010/nia-04.htm";
DateN[1] = "20100204123600";

Title[2] = "Four New Members Appointed to National Neurological Disorders and Stroke Advisory Council ";
Desc[2] = "The National Institute of Neurological Disorders and Stroke (NINDS) announced that four new members have joined its National Advisory Neurological Disorders and Stroke Council. The council serves as the principal advisory body to NINDS regarding the Institute&apos;s research program planning and priorities. \n\n ";
Link[2] = "http://www.nih.gov/news/health/feb2010/ninds-04.htm";
DateN[2] = "20100204123600";

Title[3] = "Panel Calls for Reducing Colorectal Cancer Deaths by Striking Down Barriers to Screening";
Desc[3] = "Colorectal cancer is the second leading cause of cancer-related deaths in the United States. Despite evidence and guidelines supporting the value of screening for this disease, rates of screening for colorectal cancer are consistently lower than those for other types of cancer, particularly breast and cervical. Although the screening rates in the target population of adults over age 50, have increased from 20-30 percent in 1997 to nearly 55 percent in 2008 - the rates are still too low. An NIH state-of-the-science panel was convened this week to identify ways to further increase the use and quality of colorectal cancer screening in the United States.\n\n ";
Link[3] = "http://www.nih.gov/news/health/feb2010/od-04.htm";
DateN[3] = "20100204153100";

Title[4] = "NIH Scientists Identify Maternal and Fetal Genes That Increase Preterm Birth Risk ";
Desc[4] = "Researchers at the National Institutes of Health have identified DNA variants\n\n        in mothers and fetuses that appear to increase the risk for preterm labor\n\n        and delivery. The DNA variants were in genes involved in the regulation\n\n        of inflammation and of the extracellular matrix, the mesh-like material\n\n        that holds cells within tissues. \n\n ";
Link[4] = "http://www.nih.gov/news/health/feb2010/nichd-04.htm";
DateN[4] = "20100204113100";

Title[5] = "Effectiveness of a Second Cochlear Implant, New Life for Damaged Hair Cells Among Topics to be Featured at International Conference of Ear, Nose, and Throat Researchers";
Desc[5] = "Scientists supported by the National Institute on Deafness and Other Communication Disorders (NIDCD), one of the National Institutes of Health, will be presenting their latest research findings at the 2010 Midwinter Meeting of the Association for Research in Otolaryngology (ARO).\n\n ";
Link[5] = "http://www.nih.gov/news/health/feb2010/nidcd-04.htm";
DateN[5] = "20100204105100";

Title[6] = "NHLBI Funds Preclinical Tests on Devices for Infants and Children with\n\n        Congenital Heart Defects";
Desc[6] = "The National Heart, Lung, and Blood Institute (NHLBI), part of the National Institutes of Health, has awarded four contracts totaling $23.6 million to begin preclinical testing of devices to help children born with congenital heart defects or those who develop heart failure. The four-year program is called Pumps for Kids, Infants, and Neonates (PumpKIN).\n\n ";
Link[6] = "http://www.nih.gov/news/health/feb2010/nhlbi-04.htm";
DateN[6] = "20100204100600";

Title[7] = "SIDS Linked to Low Levels of Serotonin";
Desc[7] = "The brains of infants who die of sudden infant death syndrome (SIDS)\n\n        produce low levels of serotonin, a brain chemical that conveys messages\n\n        between cells and plays a vital role in regulating breathing, heart rate,\n\n        and sleep, reported researchers funded by the National Institutes of\n\n        Health.\n\n ";
Link[7] = "http://www.nih.gov/news/health/feb2010/nichd-02.htm";
DateN[7] = "20100202160600";

Title[8] = "Even With Heart Disease Awareness on the Rise, Prevention Remains Critically Important for American Women";
Desc[8] = "In recognition of American Heart Month, the National Heart, Lung, and Blood Institute (NHLBI) and its heart disease awareness campaign -- The Heart Truth -- is reminding all American women that heart disease prevention remains critically important, despite that fact that awareness is at an all time high. More women than ever know that heart disease is their leading killer, yet millions of women are at risk, at increasingly younger ages.\n\n ";
Link[8] = "http://www.nih.gov/news/health/feb2010/nhlbi-02.htm";
DateN[8] = "20100202154600";

Title[9] = "Antibodies Against Abnormal Glycoproteins Identified as Possible Biomarkers for Cancer Detection";
Desc[9] = "Scientists have found that cancer patients produce antibodies that target abnormal glycoproteins (proteins with sugar molecules attached) made by their tumors. The result of this work suggests that antitumor antibodies in the blood may provide a fruitful source of sensitive biomarkers for cancer detection. The study, supported in part by the National Cancer Institute (NCI), part of the National Institutes of Health, appears in the Feb. 15, 2010 issue of the journal Cancer Research.\n\n ";
Link[9] = "http://www.nih.gov/news/health/feb2010/nci-02.htm";
DateN[9] = "20100202130600";

Title[10] = "NIA Funds Centers to Study Demography of Aging";
Desc[10] = "The National Institute on Aging (NIA), part of the National Institutes of Health, today announced that it has committed more than $36.7 million over the next five years to support and expand its Centers on the Demography and Economics of Aging. The Centers form a network of universities and organizations leading innovative studies on the characteristics of the aging population. The awards, which include some support from the American Recovery and Reinvestment Act, renewed support for 11 Centers and established three new ones.\n\n ";
Link[10] = "http://www.nih.gov/news/health/feb2010/nia-02.htm";
DateN[10] = "20100202092100";

Title[11] = "Statement of Anthony S. Fauci, M.D. Director, National Institute of Allergy and Infectious Diseases National Institutes of Health on National Black HIV/AIDS Awareness Day February 7, 2010";
Desc[11] = "African-Americans continue to bear the largest and most disproportionate burden of HIV/AIDS of all racial and ethnic groups in the United States. While black men and women made up 13 percent of the U.S. population in 2007, they accounted for more than half of all new HIV/AIDS diagnoses that year and nearly half of all Americans living with HIV/AIDS. For black women ages 35 to 44, HIV was the third leading cause of death in 2006. In our nation&apos;s capital, whose HIV/AIDS epidemic is among the worst in the United States, 6.5 percent of black men are living with the virus -- a percentage higher than that of any other racial, ethnic or gender group in the city, and higher than in many countries in Africa.\n\n ";
Link[11] = "http://www.nih.gov/news/health/feb2010/niaid-01.htm";
DateN[11] = "20100201120600";

} // end with block
