
/*
 * -------
 * :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 rss_JSMsg() {

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





 this.ShortListSize = 14;
 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(14);
    }
    else {
        return(0);
    }
 }


     

}

rss = new rss_JSMsg();

/* how slow is the with statement */

with( rss ) {
Title[0] = "TheStreet.com: the latest in personal finance news, covering such topics as insurance, taxes, mutual funds, 401(k)s, credit cards, bank rates, mortgages, home equity and other consumer loans.";
Desc[0] = "Reports\nMutual Fund Finder\nStreaming Quotes\nEconomic Calendar\nTop  Mutual Funds\nStock Quotes and Research Tools\nRisk Analysis Tools\nCredit";
Link[0] = "http://www.thestreet.com/funds";

Title[1] = "More Funds Are Hedging Their Bets";
Desc[1] = "has seen more mutual funds employ hedge fund strategies in recent years as a  means to appease both investors and portfolio managers.\n\"From an investor";
Link[1] = "http://www.thestreet.com/mutualfundmonday/mutualfundmondaygg/10162846.html";

Title[2] = "TheStreet.com: Exchange-Traded Funds";
Desc[2] = "funds over mutual funds, plus much more.\nThe Lowdown on ETFs\nBy Charles  L. Norton \nHave questions about exchange-traded funds? You\'ve come to the";
Link[2] = "http://www.thestreet.com/etf/index.html?s=left";

Title[3] = "Forbes.com : Funds";
Desc[3] = "Warns Fund Industry To Back Reforms\nThe SEC\'s Paul Roye delivers a  \"wake-up call\" at the Investment Company Institute annual meeting.\nMoney";
Link[3] = "http://www.forbes.com/funds";

Title[4] = "BusinessWeek Online: Personal Investing";
Desc[4] = "In Mutual Funds\nAfter the tough times and the scandals, this year\'s Scoreboard  will come in especially handy\nBW INVESTOR\nBW\'s Annual Retirement Guide\nThe";
Link[4] = "http://www.businessweek.com/investor/funds.html";

Title[5] = "Exponential Diversification";
Desc[5] = "provided by mutual funds simply isn\'t enough. Some want an extra layer of  protection.\nThat\'s why a number of fund families offer \"fund of funds\" to";
Link[5] = "http://www.thestreet.com/mutualfundmonday/mutualfundmondaygg/10161467.html";

Title[6] = "Equity Fund Inflows Up Again";
Desc[6] = "Finance : Mutual Funds\n\nEquity Fund Inflows Up Again\nBy Will  Swarts\nTheStreet.com Staff Reporter\n6/4/2004 9:15 AM EDT\n\n\nMoney continued to";
Link[6] = "http://www.thestreet.com/funds/funds/10164575.html";

Title[7] = "usnews.com: Business";
Desc[7] = "| Mutual Funds | Tools\nQUICK QUOTES\nEnter a symbol or  name:\n\nStocks\n\nSix New York Stock Exchange firms will list on Nasdaq, too";
Link[7] = "http://www.usnews.com/usnews/biztech/btinvest.htm";

Title[8] = "BusinessWeek Online: BW Magazine";
Desc[8] = "Funds in Crisis\nStreet Wise\n\nAnnual Retirement Guide\n\nNeed Help?  Find experts in your area in:\nAccounting\nAdvertising\nMarketing\nPublic";
Link[8] = "http://www.businessweek.com/magazine/toc/03_52/B38640352yeinvest.htm";

Title[9] = "Fool.com: To Educate, Amuse and Enrich -- Main Page";
Desc[9] = "Funds\nMutual Funds\nStock Ideas\nMore...\nPersonal  Finance\n401(k)\nCalculators\nCredit Reports\nFinancial Advisors\nHome";
Link[9] = "http://www.fool.com/index.htm";

Title[10] = "Fool.com: To Educate, Amuse and Enrich -- Main Page";
Desc[10] = "Funds\nMutual Funds\nStock Ideas\nMore...\nPersonal  Finance\n401(k)\nCalculators\nCredit Reports\nFinancial Advisors\nHome";
Link[10] = "http://www.fool.com/";

Title[11] = "The American Reporter Vol. 10, No. 2,381W - June 5, 2004";
Desc[11] = "that the mutual funds industry lacked official oversight and internal  awareness of widespread and longstanding abuses at its leading firms and";
Link[11] = "http://www.american-reporter.com/2,381W/secnoframes2.html";

Title[12] = "Markets";
Desc[12] = "eement\nAlthough mutual funds escaped relatively unscathed from the scandal  surrounding the industry in 2003, its managers are being tempted away by the";
Link[12] = "http://news.ft.com/markets";

Title[13] = "Fool.com: Help";
Desc[13] = "Funds\nMutual Funds\nStock Ideas\nMore...\nPersonal  Finance\n401(k)\nCalculators\nCredit Reports\nFinancial Advisors\nHome";
Link[13] = "http://www.fool.com/help/index.htm?display=about02&amp;ref=BTMP";

} // end with block
