/*
 * -------
 * :ATTRIBUTION NOTICE BEGINS
 *
 * The following JSMsg functions are:
 * 
 *    (C) Copyright 2002 - 2003, Creativyst, Inc.
 *               ALL RIGHTS RESERVED
 * 
 * For more information go to:
 *           http://www.Creativyst.com
 * or email:
 *           Support@Creativyst.com
 * 
 * Licensed under the Open Software License version 1.1
 *
 * END ATTRIBUTION NOTICE:
 * -------
 * 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 its source.
 *
 *
*/
function np_JSMsg() {

this.Title = Array([this.ShortListSize]);
this.Desc = Array([this.ShortListSize]);
this.Link = Array([this.ShortListSize]);
 this.ShortListSize = 10;
 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)
 {
    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,"Year4N") ) {
            return(this.DateN[msgNumber].substr(0,4));
          }
          return(this.DateN[msgNumber].substr(0,4));
        }
    }
    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)
 {
    if( this.is(msgCmd, "Title LinkTitle Desc Description Link LinkTitle ") ) {
         return(1);

    }
    else if( this.is(msgCmd, "MetaCount") ) {
        return(10);
    }
    else {
        return(0);
    }
 }
     
}

np = new np_JSMsg();

/* how slow is the with statement */

with( np ) {
Title[0] = "Canadians\' digital connections";
Desc[0] = " They\'re \"fast becoming a culture of technological chatterboxes,\" the Toronto Star reports. A recent national survey of nearly 1,100 Canadians by Angus Reid Strategies found that only 18% of people in Canada do not own a cellphone but, at the other end of the spectrum, 18% couldn\'t live without their mobile phone. As for email, 64% check it at least daily, and 31% \"can\'t resist the temptation\" to check...";
Link[0] = "http://netfamilynews.org/newsletter.shtml#newsitemEElyVpklFkwFZZPQBA";

Title[1] = "Hacks in social sites";
Desc[1] = " What I mean is, hackers (not malicious ones) have something to say about social-networking sites. Thousands of them gathered at two conferences in Las Vegas this past week, the Associated Press reports. Here\'s the important part: Hackers are seeing intruders in social-networking sites who \"commandeer personal Web pages and possibly inject malicious code.\" They look for flaws in sites\' code that allows...";
Link[1] = "http://netfamilynews.org/newsletter.shtml#newsitemEElyuAAlFAxtvBRSjs";

Title[2] = "More global-socializing data";
Desc[2] = " Once you get past Tagged.com\'s and Facebook.com\'s amazing growth figures this past year (774% and 270%, respectively, with Bebo in third place at a respectable 172%), the worldwide membership of these sites is a little less jawdropping. But that international appeal probably explains a lot of these sites\' growth. Friendster hasn\'t grown as much, but 88.7% of its members are in the Asia/Pacific region,...";
Link[2] = "http://netfamilynews.org/newsletter.shtml#newsitemEElyEuVpyyoFPQXOtu";

Title[3] = "Sex offenders in MySpace: Some context";
Desc[3] = " Last week Larry Magid and I co-wrote a commentary that ran in the San Jose Mercury News Sunday. Hundreds of news outlets worldwide had picked up the story that MySpace has deleted the profiles of 29,000 registered sex offenders. The news may have been shocking to a lot of parents of teen social networkers, so we felt parents deserved some perspective on this. Here\'s a slightly condensed version of...";
Link[3] = "http://netfamilynews.org/newsletter.shtml#newsitemEElyEuulFkaZqAPzEC";

Title[4] = "Facebook &amp; ID theft";
Desc[4] = " This is something for social networkers to be on the alert about: computer security and social engineering on social-networking sites (social engineering is what phishers and identity thieves use to trick people into making themselves and their devices vulnerable to hacks and ID theft). The latest warning signal concerns Facebook, which recently announced it\'s becoming a social-networking platform...";
Link[4] = "http://netfamilynews.org/newsletter.shtml#newsitemEElypyZZlkvsMBUSKG";

Title[5] = "Online-safety hotline in Oz";
Desc[5] = " The US has its CyberTipline.com, Canada its Cybertip.ca, and Britain its hotline at the Child Exploitation &amp; Online Protection Centre. \"Within weeks\" Australians too \"will have access to a national online child protection hotline,\" as well a free filtering software, Australian IT reports. The Communications Ministry put the emphasis on the education part of the $99 million (US) program, saying parents...";
Link[5] = "http://netfamilynews.org/newsletter.shtml#newsitemEElypyVulVhgcUtfGb";

Title[6] = "Disney\'s ClubPenguin now";
Desc[6] = " Penguins at your house might not notice, but ClubPenguin\'s moving into the Disney igloo. \"Disney said it would pay $350 million in cash for the website aimed at 6-to-14-year-old kids. As much as $350 million more will be added if the Canadian company\'s founders reach profit targets through 2009,\" the Los Angeles Times reports. Here\'s the Associated Press on this development.";
Link[6] = "http://netfamilynews.org/newsletter.shtml#newsitemEElypyVEVAhwUjVdCp";

Title[7] = "\'Means streets\' of cyberspace";
Desc[7] = " Most people online are \"kind and supportive\" and respectful community members, but there are some really nasty corners of the social Web, and Janet Kornblum zooms in on the why in a USATODAY article. She quotes Silicon Valley tech forecaster Paul Saffo as saying there are two ways to stand out among the online masses - to be really clever or really mean - and it\'s a lot easier, unfortunately, to be...";
Link[7] = "http://netfamilynews.org/newsletter.shtml#newsitemEElyppElZADQdzzQjz";

Title[8] = "Music downloading unabated";
Desc[8] = " And I had thought file-sharing growth was tapering off. \"Illegal music downloading is at an all-time high and set to rise further,\" The Guardian reports, citing the 4th-annual digital-music survey by Entertainment Media Research. Forty-three percent of respondents said they\'re downloading illegal songs, up from 36% last year and 40% in 2005. Meanwhile, fear of being caught has lessened. \"This year...";
Link[8] = "http://netfamilynews.org/newsletter.shtml#newsitemEElVAkpuykcxDpztQQ";

Title[9] = "Videogame tournament on TV";
Desc[9] = " Watch out, Masters and March Madness. This week CBS Sports broadcast the World Series of Video Games, held in Louisville, Ky., last month. Reporting the day before the series aired (Sunday), the New York Times says that \"viewers flicking channels looking for a ballgame or golf tournament may instead encounter a couple of young guys rocking out on plastic guitars, or some (literally) disembodied digital...";
Link[9] = "http://netfamilynews.org/newsletter.shtml#newsitemEElVlAAEupEfISjUHU";

} // end with block
