
/*
 * -------
 * :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] = "New Compound Improves Obesity-Related Health Complications in NIH-Led Study";
Desc[0] = "An experimental compound appears to improve metabolic abnormalities associated with obesity, according to a preliminary study led by researchers at the National Institutes of Health. A report of the study, which was conducted with obese mice, appears online today in the Journal of Clinical Investigation.";
Link[0] = "http://www.nih.gov/news/health/jul2010/niaaa-26.htm";
DateN[0] = "20100726120300";

Title[1] = "NIH Director Announces Appointment of Alan Guttmacher as Director of NICHD";
Desc[1] = "National Institutes of Health Director Francis S. Collins M.D., Ph.D., announced today the appointment of Alan E. Guttmacher, M.D., as director of the Eunice Kennedy Shriver National Institute of Child Health and Human Development (NICHD), one of the 27 institutes and centers that comprise the National Institutes of Health. The appointment follows an extensive national search.";
Link[1] = "http://www.nih.gov/news/health/jul2010/nichd-22.htm";
DateN[1] = "20100722183600";

Title[2] = "Scientists Identify Brain Circuits Related to the Initiation and Termination of Movement Sequences in NIH-Supported Study";
Desc[2] = "In humans, throwing a ball, typing on a keyboard, or engaging in most other physical activities involves the coordination of numerous discrete movements that are organized as action sequences. Scientists at the National Institutes of Health and the Gulbenkian Institute in Portugal have identified brain activity in mice that can signal the initiation and termination of newly learned action sequences. The findings appear online today in the current issue of Nature.";
Link[2] = "http://www.nih.gov/news/health/jul2010/niaaa-22.htm";
DateN[2] = "20100722161600";

Title[3] = "Hyperthermia: Too Hot for Your Health";
Desc[3] = "Hot summer weather can pose special health risks to older adults. The National Institute on Aging (NIA), part of the National Institutes of Health, has some advice for helping older people avoid heat-related illnesses, known as hyperthermia.";
Link[3] = "http://www.nih.gov/news/health/jul2010/nia-22.htm";
DateN[3] = "20100722161600";

Title[4] = "NIH-Funded Study Finds Early HAART during TB Treatment Boosts Survival Rate in People Co-Infected with HIV and TB";
Desc[4] = "A clinical trial in Cambodia has found it possible to prolong the survival of untreated HIV-infected adults with very weak immune systems and newly diagnosed tuberculosis (TB) by starting anti-HIV therapy two weeks after beginning TB treatment, rather than waiting eight weeks, as has been standard. This finding by scientists co-funded by the National Institute of Allergy and Infectious Diseases (NIAID), part of the National Institutes of Health, and the French National Agency for Research on AIDS and Viral Hepatitis, brings physicians closer to optimizing the treatment of severely immunosuppressed individuals with HIV-TB co-infection. The findings were presented today at the XVIII International AIDS Conference in Vienna by principal investigators Francois-Xavier Blanc, M.D., Anne E. Goldfeld, M.D., and Sok Thim, M.D. ";
Link[4] = "http://www.nih.gov/news/health/jul2010/niaid-22.htm";
DateN[4] = "20100722091600";

Title[5] = "NIHSeniorHealth Site Offers Tips on Creating a Family Health History";
Desc[5] = "At your next family reunion or gathering, consider discussing a different type of family tree--the family health history. Find out how to collect, organize and use information about your family&apos;s health at Creating a Family Health History, the newest topic on the NIHSeniorHealth website. NIHSeniorHealth is a health and wellness website designed especially for older adults from the National Institute on Aging (NIA) and the National Library of Medicine (NLM), both part of the National Institutes of Health. ";
Link[5] = "http://www.nih.gov/news/health/jul2010/nia-21.htm";
DateN[5] = "20100721125600";

Title[6] = "Statement of Anthony S. Fauci, M.D. Director, National Institute of Allergy and Infectious Diseases National Institutes of Health on Results from the CAPRISA 004 Microbicide HIV Prevention Study";
Desc[6] = "Today we congratulate the Centre for the AIDS Programme of Research in South Africa (CAPRISA) and the people of South Africa on the positive findings from the CAPRISA 004 microbicide study, which marks a significant milestone both for the microbicide research field and HIV prevention as a whole.";
Link[6] = "http://www.nih.gov/news/health/jul2010/niaid-20.htm";
DateN[6] = "20100720160600";

Title[7] = "NIDA NewsScan #67";
Desc[7] = "To coincide with the 2010 International AIDS Conference in Vienna, NIDA has written a special issue of NewsScan on HIV/AIDS which features recent articles on the connection between drug abuse and HIV/AIDS and prevention and treatment strategies,  authored by researchers supported by NIDA and other leading research organizations.";
Link[7] = "http://www.nih.gov/news/health/jul2010/NS-67.pdf";
DateN[7] = "20100720160600";

Title[8] = "Five New Members Named to NIH Advisory Committee on Research on Women&apos;s Health";
Desc[8] = "The National Institutes of Health Advisory Committee on Research on Women&apos;s Health announces the appointment of five new members: Francisco Garcia, M.D., M.P.H., Ronda S. Henry-Tillman, M.D., F.A.C.S., Karen E. Kim, M.D., Claire Pomeroy, M.D., and Paul F. Terranova, Ph.D. ";
Link[8] = "http://www.nih.gov/news/health/jul2010/od-20.htm";
DateN[8] = "20100720090600";

Title[9] = "NIH Announces New Awards in Program to Expand Interdisciplinary Research Careers\n\n      in Women&apos;s Health";
Desc[9] = "Almost $6 million has been awarded to investigators and programs to help researchers in the early stages of careers in women&apos;s health research.  The funding is from the National Institutes of Health&apos;s Office of Research on Women&apos;s Health (ORWH) and other co-sponsors. The money will go to 12 new and continuing Building Interdisciplinary Research Careers in Women&apos;s Health (BIRCWH) programs nationwide. This is the fifth funding round of an innovative, interdisciplinary career development program for men and women junior faculty in women&apos;s health research.";
Link[9] = "http://www.nih.gov/news/health/jul2010/od-19.htm";
DateN[9] = "20100719100100";

Title[10] = "Federal Report Details Health and Economic Status of Older Americans ";
Desc[10] = "Today&apos;s older Americans enjoy longer lives and better health than did previous generations. These and other trends are reported in Older Americans 2010: Key Indicators of Well-Being, a unique, comprehensive look at aging in the United States from the Federal Interagency Forum on Aging-Related Statistics.";
Link[10] = "http://www.nih.gov/news/health/jul2010/nia-19.htm";
DateN[10] = "20100719100100";

Title[11] = "HIV/AIDS Treatment Curbs Spread of HIV Among Drug Users, According to NIH Supported Study ";
Desc[11] = "Highly active antiretroviral therapy (HAART), currently known for its therapeutic benefits against HIV, also reduced the spread of the virus among people with a history of injection drug use, according to a population-based study funded by the National Institute on Drug Abuse (NIDA), a component of the National Institutes of Health. The study was published today in the Lancet.";
Link[11] = "http://www.nih.gov/news/health/jul2010/nida-18.htm";
DateN[11] = "20100719092400";

} // end with block
