
/*
 * -------
 * :ATTRIBUTION NOTICE BEGINS
 *
 * The following JSMsg functions are:
 * 
 *    (C) Copyright 2002 - 2005, 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 demo_JSMsg() {

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

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



 this.ShortListSize = 20;
 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.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(20);
    }
    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);
    }
 }

     

}

demo = new demo_JSMsg();

/* how slow is the with statement */

with( demo ) {
/* Meta values
*/
MetaKeys[0] = "MetaCopyright";
MetaVals[0] = "2009 CBS Interactive Inc. All rights reserved";
MetaKeys[1] = "MetaTitle";
MetaVals[1] = "CNET News.com - CNETNews.com";
MetaKeys[2] = "MetaLink";
MetaVals[2] = "http://news.cnet.com/";
MetaKeys[3] = "MetaLinkTitle";
MetaVals[3] = "<A HREF=\"http://news.cnet.com/\" CLASS=\"JSMsg\">CNET News.com - CNETNews.com</A>";
MetaKeys[4] = "MetaUpdateDate";
MetaVals[4] = "FebrFeFe000000";
MetaKeys[5] = "MetaDesc";
MetaVals[5] = "Tech news and business reports by CNET News. Focused oninformation technology, core topics include computers, hardware, software,networking, and Internet media..";


/* content vaues:
*/
Title[0] = "Apple\'s smartphone share rises, but Android still on top";
Desc[0] = "Google\'s Android remained the dominant platform in the U.S. last quarter, even as Apple gained ground in the market thanks to the iPhone 4S, according to ComScore.";
Link[0] = "http://news.cnet.com/8301-13579_3-57371030-37/apples-smartphone-share-rises-but-android-still-on-top/?part=rss&subj=news&tag=2547-1_3-0-5";
DateN[0] = "20120203062613";

Title[1] = "Apple dealt legal setbacks against Motorola in Germany";
Desc[1] = "Motorola Mobility wins a permanent ban against Apple\'s push e-mail service, part of its iCloud offering. Apple has also begun removing older iPhones and iPad from its German online store.";
Link[1] = "http://news.cnet.com/8301-13579_3-57370994-37/apple-dealt-legal-setbacks-against-motorola-in-germany/?part=rss&subj=news&tag=2547-1_3-0-5";
DateN[1] = "20120203051440";

Title[2] = "Touchdown dance! On finding lost gems from the Muppets\' Henson";
Desc[2] = "\"Charlie Magnetico\" is the second lost Henson film to be posted online in as many weeks. Crave hears from the AT&T archivist who unearthed these little jewels.";
Link[2] = "http://news.cnet.com/8301-17938_105-57370725-1/touchdown-dance-on-finding-lost-gems-from-the-muppets-henson/?part=rss&subj=news&tag=2547-1_3-0-5";
DateN[2] = "20120203050000";

Title[3] = "iPhone 5 could see June debut at Apple confab, report says";
Desc[3] = "Apple could announce its next-gen phone at its Worldwide Developers Conference in June, according to the latest scuttlebut from Daiwa Securities.";
Link[3] = "http://news.cnet.com/8301-13579_3-57370985-37/iphone-5-could-see-june-debut-at-apple-confab-report-says/?part=rss&subj=news&tag=2547-1_3-0-5";
DateN[3] = "20120203045616";

Title[4] = "No potty-mouth lyrics for iTunes Match";
Desc[4] = "A glitch is causing iTunes Match to scrub explicit lyrics from some rap songs. Apple is working to fix the issue.";
Link[4] = "http://news.cnet.com/8301-31001_3-57370984-261/no-potty-mouth-lyrics-for-itunes-match/?part=rss&subj=news&tag=2547-1_3-0-5";
DateN[4] = "20120203045148";

Title[5] = "Bail denied again for MegaUpload\'s Kim DotCom";
Desc[5] = "The founder of the cyberlocker service will remain in jail at least until his extradition hearing is held on Feb. 22.";
Link[5] = "http://news.cnet.com/8301-31001_3-57370967-261/bail-denied-again-for-megauploads-kim-dotcom/?part=rss&subj=news&tag=2547-1_3-0-5";
DateN[5] = "20120203032243";

Title[6] = "Mystery and mayhem surrounding MegaUpload (roundup)";
Desc[6] = "Hackers down government and entertainment Web sites after piracy arrest of people including Kim DotCom connected with the hosting site.";
Link[6] = "http://news.cnet.com/8301-1009_3-57362515-83/mystery-and-mayhem-surrounding-megaupload-roundup/?part=rss&subj=news&tag=2547-1_3-0-5";
DateN[6] = "20120203032200";

Title[7] = "Will Verizon ever get a 4G Windows Phone?";
Desc[7] = "It may not be the most popular smartphone operating system, but some wireless subscribers on Verizon Wireless and Sprint Nextel want more choices.";
Link[7] = "http://news.cnet.com/8301-30686_3-57370809-266/will-verizon-ever-get-a-4g-windows-phone/?part=rss&subj=news&tag=2547-1_3-0-5";
DateN[7] = "20120203000000";

Title[8] = "AMD spells out Windows 8 tablet strategy";
Desc[8] = "Advanced Micro Devices has a Windows 8 tablet strategy predicated on new power-efficient chips.";
Link[8] = "http://news.cnet.com/8301-13924_3-57370936-64/amd-spells-out-windows-8-tablet-strategy/?part=rss&subj=news&tag=2547-1_3-0-5";
DateN[8] = "20120202230024";

Title[9] = "Super Bowl XLVI launches free app for game day";
Desc[9] = "Hoping to help fans navigate Indianapolis during Super Bowl Week, the NFL releases the Super Bowl XLVI Guide app for iOS and Android yesterday.";
Link[9] = "http://news.cnet.com/8301-1023_3-57370930-93/super-bowl-xlvi-launches-free-app-for-game-day/?part=rss&subj=news&tag=2547-1_3-0-5";
DateN[9] = "20120202212643";

Title[10] = "Kelihos botnet makes a comeback";
Desc[10] = "New variants resurrect the malware four months after Microsoft and Kaspersky Lab took down the original, which was capable of sending nearly 4 billion spam e-mails each day.";
Link[10] = "http://news.cnet.com/8301-1009_3-57370926-83/kelihos-botnet-makes-a-comeback/?part=rss&subj=news&tag=2547-1_3-0-5";
DateN[10] = "20120202205003";

Title[11] = "Survey cites Amazon Kindle Fire likes and dislikes";
Desc[11] = "Amazon sold about 5 million Kindles in the first couple months of sales. So, what do users like and dislike about it?  A survey provides some answers.";
Link[11] = "http://news.cnet.com/8301-13924_3-57370148-64/survey-cites-amazon-kindle-fire-likes-and-dislikes/?part=rss&subj=news&tag=2547-1_3-0-5";
DateN[11] = "20120202202427";

Title[12] = "Apple CEO Tim Cook donates $100 million to charity";
Desc[12] = "Apple\'s CEO announces that he spent $100 million of Apple\'s money on charitable giving--something Steve Jobs would not have done.";
Link[12] = "http://news.cnet.com/8301-13579_3-57370922-37/apple-ceo-tim-cook-donates-$100-million-to-charity/?part=rss&subj=news&tag=2547-1_3-0-5";
DateN[12] = "20120202201744";

Title[13] = "Feds seize illegal sports-streaming sites";
Desc[13] = "Just in time for Super Bowl Sunday, the federal agents announce they have seized and shuttered 307 Web sites that either live-streamed sports or sold fake NFL paraphernalia.";
Link[13] = "http://news.cnet.com/8301-1009_3-57370912-83/feds-seize-illegal-sports-streaming-sites/?part=rss&subj=news&tag=2547-1_3-0-5";
DateN[13] = "20120202192235";

Title[14] = "MyAssistant app teaches Siri some new tricks";
Desc[14] = "Looking to get more out of Siri? There\'s an app for that--if you\'ve got a jailbroken iPhone, that is.";
Link[14] = "http://news.cnet.com/8301-27076_3-57370895-248/myassistant-app-teaches-siri-some-new-tricks/?part=rss&subj=news&tag=2547-1_3-0-5";
DateN[14] = "20120202174858";

Title[15] = "Judge rules Honda overstated hybrid fuel economy";
Desc[15] = "Heather Peters won a suit in small claims court against Honda, claiming the company misled her through fraudulent advertising into buying a Civic Hybrid.";
Link[15] = "http://reviews.cnet.com/8301-13746_7-57370905-48/judge-rules-honda-overstated-hybrid-fuel-economy/?part=rss&subj=news&tag=2547-1_3-0-5";
DateN[15] = "20120202174610";

Title[16] = "Stanford pioneering a wireless electric highway";
Desc[16] = "Stanford researches may have solved the problem of range anxiety by wireless charging technology that could one day create an electric highway.";
Link[16] = "http://reviews.cnet.com/8301-13746_7-57370810-48/stanford-pioneering-a-wireless-electric-highway/?part=rss&subj=news&tag=2547-1_3-0-5";
DateN[16] = "20120202171713";

Title[17] = "MegaUpload founder: Police punched and kicked me";
Desc[17] = "The MegaUpload founder, who wants to be freed on bail, said during a court hearing today that he is the victim of \"the biggest disregard of basic rights in internet history.\"";
Link[17] = "http://news.cnet.com/8301-31001_3-57370892-261/megaupload-founder-police-punched-and-kicked-me/?part=rss&subj=news&tag=2547-1_3-0-5";
DateN[17] = "20120202170401";

Title[18] = "Does Facebook deserve its astronomical valuation?";
Desc[18] = "Pundits square off over whether the social network has the chops to deliver revenue from its massive user base to support its valuation.";
Link[18] = "http://news.cnet.com/8301-1023_3-57370891-93/does-facebook-deserve-its-astronomical-valuation/?part=rss&subj=news&tag=2547-1_3-0-5";
DateN[18] = "20120202170002";

Title[19] = "Facebook IPO: Social network makes its move";
Desc[19] = "<b style=\"color:#900;\">roundup</b> Silicon Valley and Wall Street had been watching since forever, it seems, for Facebook to go public. Now the IPO filing is finally upon us, and we\'re learning a lot about the social network.";
Link[19] = "http://news.cnet.com/8301-1023_3-57368412-93/facebook-ipo-social-network-makes-its-move/?part=rss&subj=news&tag=2547-1_3-0-5";
DateN[19] = "20120202170000";

} // end with block

