
/*
 * -------
 * :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.Cat = Array([this.ShortListSize]);
this.DateN = Array([this.ShortListSize]);

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



 this.ShortListSize = 17;
 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 Cat Category SubjectDayN Day2N MonthN Month2N Year2N Year4N YearN Year Time Hour2N Minute2N ") ) {
         return(1);

    }
    else if( this.is(msgCmd, "MetaCount") ) {
        return(17);
    }
    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] = "MetaCopyright";
MetaVals[0] = "Copyright 2010 msnbc.com";
MetaKeys[1] = "MetaTitle";
MetaVals[1] = "msnbc.com: World news";
MetaKeys[2] = "MetaLink";
MetaVals[2] = "http://www.msnbc.msn.com/id/3032507/ns/world_news/";
MetaKeys[3] = "MetaLinkTitle";
MetaVals[3] = "<A HREF=\"http://www.msnbc.msn.com/id/3032507/ns/world_news/\" CLASS=\"JSMsg\">msnbc.com: World news</A>";
MetaKeys[4] = "MetaUpdateDate";
MetaVals[4] = "20100905013000";
MetaKeys[5] = "MetaDesc";
MetaVals[5] = "Msnbc.com is a leader in breaking news and original journalism.";


/* content vaues:
*/
Title[0] = "New Zealand quake rips new fault in earth";
Desc[0] = "<![CDATA[<p><a href=\"http://www.msnbc.msn.com/id/39002792/ns/world_news-asiapacific/\"><img align=\"left\" border=\"0\" src=\"http://msnbcmedia.msn.com/j/MSNBC/Components/Photo/_new/100903-Christcurch-before-After-12p.thumb.jpg\" alt=\"Before-and-after images of damaged buildings on Victoria Street in Christchurch, New Zealand.\" style=\"margin:0 5px 5px 0\" /></a>The powerful earthquake that smashed buildings, cracked roads and twisted rail lines around Christchurch, New Zealand, also ripped an 11-foot wide fault line in earth surface.</p><br clear=\"all\" />]]>";
Link[0] = "http://www.msnbc.msn.com/id/39002792/ns/world_news-asiapacific/";
Cat[0] = "News";
DateN[0] = "20100905010713";

Title[1] = "Thieves add to Pakistan flood victims\' misery";
Desc[1] = "Crime and the sale of donated aid supplies are undermining the aid effort for Pakistan\'s flood victims.";
Link[1] = "http://www.msnbc.msn.com/id/39003327/ns/world_news-south_and_central_asia/";
Cat[1] = "News";
DateN[1] = "20100904185420";

Title[2] = "Gaza rocket fire draws Israeli air strikes";
Desc[2] = "Two days after the restart of peace talks, Israeli aircraft strike targets in the Hamas-ruled Gaza Strip after Palestinian militants fire a rocket into Israel.";
Link[2] = "http://www.msnbc.msn.com/id/39008579/ns/world_news-mideastn_africa/";
Cat[2] = "News";
DateN[2] = "20100904214408";

Title[3] = "At least 43 killed in violence in Sudan\'s Darfur";
Desc[3] = "Clashes in a refugee camp in Sudan\'s restive Darfur region left six people dead, U.N.-African Union peacekeepers said Saturday, days after violence elsewhere in the area claimed the lives of at least 37 people dead.";
Link[3] = "http://www.msnbc.msn.com/id/39008771/ns/world_news-mideastn_africa/";
Cat[3] = "News";
DateN[3] = "20100904214720";

Title[4] = "Pakistan bomb toll hits 65; new missile strike";
Desc[4] = "<![CDATA[<p><a href=\"http://www.msnbc.msn.com/id/39003213/ns/world_news-south_and_central_asia/\"><img align=\"left\" border=\"0\" src=\"http://msnbcmedia.msn.com/j/ap/aptopix pakistan-1856843015_v2.thumb.jpg\" alt=\"People who were injured by an explosion lie on a road during a Shiite procession in Quetta, Pakistan on Friday, Sept. 3, 2010.\" style=\"margin:0 5px 5px 0\" /></a>The death toll from a Pakistani Taliban suicide attack on a Shiite Muslim procession rose to 65 Saturday as critically wounded people died in hospitals, while a suspected U.S. missile strike killed seven insurgents in a restive tribal area.</p><br clear=\"all\" />]]>";
Link[4] = "http://www.msnbc.msn.com/id/39003213/ns/world_news-south_and_central_asia/";
Cat[4] = "News";
DateN[4] = "20100904180934";

Title[5] = "Afghans continue pulling money from troubled bank";
Desc[5] = "<![CDATA[<p><a href=\"http://www.msnbc.msn.com/id/39003572/ns/world_news-south_and_central_asia/\"><img align=\"left\" border=\"0\" src=\"http://msnbcmedia.msn.com/j/ap/afghanistan bank-133685454_v2.thumb.jpg\" alt=\"Afghan men wait to enter the Kabul Bank to withdraw money, in Kabul, Afghanistan, Saturday, Sept. 4, 2010. Crowds gathered at Kabul Bank branches around the capital to withdraw dollar and Afghan currency savings, with customers saying they had lost faith in the bank\'s solvency following a change in leadership and reports that tens of millions of dollars had been lent to political elites for risky real estate investments.(AP Photo/ Ahmad Massoud)\" style=\"margin:0 5px 5px 0\" /></a>Nervous Afghans pulled more deposits out of the nation\'s largest bank despite assurances from government leaders that their money was safe.</p><br clear=\"all\" />]]>";
Link[5] = "http://www.msnbc.msn.com/id/39003572/ns/world_news-south_and_central_asia/";
Cat[5] = "News";
DateN[5] = "20100905011610";

Title[6] = "‘We were all screaming — we got the animals and ran’";
Desc[6] = "Wen Baragrey, a writer who lives by the sea in Christchurch, New Zealand, shares her chaotic escape from her swaying home during the early morning earthquake that struck.";
Link[6] = "http://www.msnbc.msn.com/id/38996925/ns/world_news-asiapacific/";
Cat[6] = "News";
DateN[6] = "20100903212944";

Title[7] = "Earl ends with a punch in Halifax, Canada";
Desc[7] = "<![CDATA[<p><a href=\"http://www.msnbc.msn.com/id/39003957/ns/weather/\"><img align=\"left\" border=\"0\" src=\"http://msnbcmedia.msn.com/j/MSNBC/Components/Photo/_new/100904-earl-hlg-2p.thumb.jpg\" alt=\"A vehicle navigates around a downed tree on highway 103 near Shelburne, Nova Scotia, on Saturday as the storm arrives.\" style=\"margin:0 5px 5px 0\" /></a>After toying with tens of millions of coastal residents and tourists along the East Coast, Earl finally made landfall Saturday morning — but in Canada\'s Nova Scotia province.</p><br clear=\"all\" />]]>";
Link[7] = "http://www.msnbc.msn.com/id/39003957/ns/weather/";
Cat[7] = "News";
DateN[7] = "20100904201735";

Title[8] = "Protesters hurl eggs, shoes at Tony Blair";
Desc[8] = "Anti-war protesters hurled shoes and eggs at Tony Blair on Saturday as he arrived for the first public signing of his fast-selling memoir.";
Link[8] = "http://www.msnbc.msn.com/id/39003719/ns/world_news-europe/";
Cat[8] = "News";
DateN[8] = "20100904231142";

Title[9] = "Tourists killed in New Zealand plane crash";
Desc[9] = "<![CDATA[<p><a href=\"http://www.msnbc.msn.com/id/39002036/ns/world_news-asiapacific/\"><img align=\"left\" border=\"0\" src=\"http://msnbcmedia.msn.com/j/MSNBC/Components/Photo/_new/100904_fox_glacier_crash.thumb.jpg\" alt=\"Nine people, including four foreign tourists, were killed when the skydiving plane crashed and burst into flames, officials said. \" style=\"margin:0 5px 5px 0\" /></a>Nine people were killed after a light aircraft used for skydiving crashed in New Zealand\'s South Island, police said Saturday.</p><br clear=\"all\" />]]>";
Link[9] = "http://www.msnbc.msn.com/id/39002036/ns/world_news-asiapacific/";
Cat[9] = "News";
DateN[9] = "20100905013000";

Title[10] = "Mexico arrests 6 in deadly Cancun bar blaze";
Desc[10] = "<![CDATA[<p><a href=\"http://www.msnbc.msn.com/id/39002501/ns/world_news-americas/\"><img align=\"left\" border=\"0\" src=\"http://msnbcmedia.msn.com/j/ap/mexico bar fire--94245538_v2.thumb.jpg\" alt=\"Judicial police and Mexican army present to the press the six suspects late, Thursday, Sept. 3, 2010. The men allegedly participated in an Aug. 31 attack with gasoline bombs inside a bar where six women and two men died in Cancun. One of the detainees, left, accidentally burned his hands and legs in the attack, which led police to their arrest. (AP Photo/Israel Leal) \" style=\"margin:0 5px 5px 0\" /></a>Mexican police have arrested six suspects in a bar fire that killed eight in the resort city of Cancun.</p><br clear=\"all\" />]]>";
Link[10] = "http://www.msnbc.msn.com/id/39002501/ns/world_news-americas/";
Cat[10] = "News";
DateN[10] = "20100904035125";

Title[11] = "French security protest kicks off week of unrest";
Desc[11] = "French trade unions protested on Saturday against a clampdown on immigrants, launching a week of action against tightening security and pension reforms on which President Nicolas Sarkozy has staked his political reputation.";
Link[11] = "http://www.msnbc.msn.com/id/39005049/ns/business-us_business/";
Cat[11] = "News";
DateN[11] = "20100904174658";

Title[12] = "Zoo attack: Sea lion mauls 11-year-old boy";
Desc[12] = "An 11-year-old boy was recovering Saturday after a sea lion mauled him at a popular Sydney zoo\'s aquarium show as horrified visitors looked on.";
Link[12] = "http://www.msnbc.msn.com/id/39003302/ns/world_news-asiapacific/";
Cat[12] = "News";
DateN[12] = "20100904092921";

Title[13] = "NASA advises Chile on trapped, isolated miners";
Desc[13] = "<![CDATA[<p><a href=\"http://www.msnbc.msn.com/id/39000893/ns/world_news-americas/\"><img align=\"left\" border=\"0\" src=\"http://msnbcmedia.msn.com/j/ap/chile mine collapse--300062823_v2.thumb.jpg\" alt=\"Dr. Michael Duncan, NASA\'s deputy chief medical officer, left, accompanied by other experts, speaks during a press conference outside San Jose mine in Copiapo, Chile, on Friday.\" style=\"margin:0 5px 5px 0\" /></a>A team of NASA doctors and engineers recommended Friday that Chilean authorities regulate the day-and-night sleep patterns of 33 trapped miners, boost their Vitamin D intake and phase in an exercise program as their nutrition improves.</p><br clear=\"all\" />]]>";
Link[13] = "http://www.msnbc.msn.com/id/39000893/ns/world_news-americas/";
Cat[13] = "News";
DateN[13] = "20100904010017";

Title[14] = "Newsweek: Did the World Cup wreck South Africa?";
Desc[14] = "A spending bonanza before the tournament made it look as though the government cares about glitzy showmanship more than its workers. This week their frustration boiled over.";
Link[14] = "http://www.newsweek.com/2010/09/03/how-the-world-cup-wrecked-south-africa.html";
Cat[14] = "News";
DateN[14] = "20100903194753";

Title[15] = "Amazon may be headed for another bad drought";
Desc[15] = "Drought has cut Peru\'s Amazon River to its lowest level in 40 years and it is already below the minimum set in 2005, when a devastating dry spell damaged vast swaths of South American rainforest in the worst drought in decades.";
Link[15] = "http://www.msnbc.msn.com/id/38999896/ns/world_news-americas/";
Cat[15] = "News";
DateN[15] = "20100903230256";

Title[16] = "Mexican drug kingpin gets 27 years in Ariz. prison";
Desc[16] = "A Mexican man who prosecutors say headed a major drug-smuggling ring that shipped tons of marijuana into the U.S. was sentenced Friday to 27 years in prison and ordered to forfeit $4 million to the American government.";
Link[16] = "http://www.msnbc.msn.com/id/38999534/ns/us_news/";
Cat[16] = "News";
DateN[16] = "20100903230013";

} // end with block
