
/*
 * -------
 * :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 wsj_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 = 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 Cat Category SubjectDayN 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);
    }
 }

     

}

wsj = new wsj_JSMsg();

/* how slow is the with statement */

with( wsj ) {
/* Meta values
*/
MetaKeys[0] = "MetaCopyright";
MetaVals[0] = "copyright  &#169; 2010 Dow Jones &amp; Company, Inc.";
MetaKeys[1] = "MetaTitle";
MetaVals[1] = "WSJ.com: What's News US";
MetaKeys[2] = "MetaLink";
MetaVals[2] = "http://online.wsj.com";
MetaKeys[3] = "MetaLinkTitle";
MetaVals[3] = "<A HREF=\"http://online.wsj.com\" CLASS=\"JSMsg\">WSJ.com: What's News US</A>";
MetaKeys[4] = "MetaUpdateDate";
MetaVals[4] = "20100903200131";
MetaKeys[5] = "MetaDesc";
MetaVals[5] = "What's News US";


/* content vaues:
*/
Title[0] = "Oil Remains King at Cajun Festival";
Desc[0] = "In Cajun country, where families have been sustained by the bounties of the Gulf of Mexico for generations, you won\'t find much resentment against the offshore oil industry.";
Link[0] = "http://online.wsj.com/article/SB10001424052748704855104575469904146769826.html?mod=rss_whats_news_us";
Cat[0] = "FREE";
DateN[0] = "20100903200111";

Title[1] = "Obama to Link Tax Cuts, Hiring";
Desc[1] = "The Obama administration is moving toward using the revenue from expiring tax cuts for the wealthy to finance about $35 billion of tax cuts for small businesses and workers.";
Link[1] = "http://online.wsj.com/article/SB10001424052748704855104575470063205601090.html?mod=rss_whats_news_us";
Cat[1] = "FREE";
DateN[1] = "20100903185458";

Title[2] = "Seven Careers in a Lifetime? Think Twice";
Desc[2] = "A belief that Americans will average seven careers over their lifetimes has gained traction despite little evidence, say researchers. While job changes are common, the notion of multiple major career changes seems implausible.";
Link[2] = "http://online.wsj.com/article/SB10001424052748704206804575468162805877990.html?mod=rss_whats_news_us";
Cat[2] = "FREE";
DateN[2] = "20100903192459";

Title[3] = "As Gold Climbs, So Do the Deals";
Desc[3] = "                Gold prices are edging up toward a high, at $1,249.20 an ounce, triggering multibillion-dollar deals by miners doubling down on the staying power of bullion\'s nearly decadelong rally.";
Link[3] = "http://online.wsj.com/article/SB10001424052748704855104575469982112990238.html?mod=rss_whats_news_us";
Cat[3] = "PAID";
DateN[3] = "20100903194827";

Title[4] = "Stocks Snap 3-Week Skid";
Desc[4] = "The Dow Jones Industrial Average finished up 127.83 points, or 1.24%, to 10447.93, putting the Dow up 2.9% on the week&#8212;its first positive weekly showing since the beginning of August.";
Link[4] = "http://online.wsj.com/article/SB10001424052748703946504575469164106909470.html?mod=rss_whats_news_us";
Cat[4] = "FREE";
DateN[4] = "20100903185346";

Title[5] = "Goldman to Shut Principal Strategies Unit";
Desc[5] = "Goldman Sachs has decided to close its principal-strategies unit, which does its proprietary trading, in the wake of financial-overhaul regulation passed by Congress.";
Link[5] = "http://online.wsj.com/article/SB10001424052748703946504575469952837595726.html?mod=rss_whats_news_us";
Cat[5] = "PAID";
DateN[5] = "20100903172547";

Title[6] = "Texas Probes Google\'s Search Engine";
Desc[6] = "Google said the Texas attorney general\'s office is conducting an antitrust review of the Web giant\'s core search-engine business, another sign of growing government scrutiny of the company.";
Link[6] = "http://online.wsj.com/article/SB10001424052748703946504575470031054111778.html?mod=rss_whats_news_us";
Cat[6] = "FREE";
DateN[6] = "20100903191849";

Title[7] = "Cuomo Looks at Schools\' Role in Student Credit Cards";
Desc[7] = "New York State Attorney General Andrew Cuomo announced a statewide investigation of credit-card companies marketing to college students through schools.";
Link[7] = "http://online.wsj.com/article/SB10001424052748704855104575470040614786402.html?mod=rss_whats_news_us";
Cat[7] = "FREE";
DateN[7] = "20100903174314";

Title[8] = "Enron\'s Skilling Denied Bail";
Desc[8] = "A federal appellate court judge turned down former Enron President Jeffrey Skilling\'s request for bail pending the continuing judicial review of his 2006 conspiracy and fraud conviction.";
Link[8] = "http://online.wsj.com/article/SB10001424052748703946504575470193509398532.html?mod=rss_whats_news_us";
Cat[8] = "FREE";
DateN[8] = "20100903185706";

Title[9] = "Goldcorp to Buy Andean";
Desc[9] = "Canadian miner Goldcorp said it had reached a deal to buy Andean Resources in a deal that values the gold company at around $3.42 billion. ";
Link[9] = "http://online.wsj.com/article/SB10001424052748703946504575469012479320660.html?mod=rss_whats_news_us";
Cat[9] = "FREEASIA";
DateN[9] = "20100903151200";

Title[10] = "After Labor Day, the Deluge";
Desc[10] = "Corporate bond markets are preparing for a hectic week and month amid ripe conditions for companies to issue debt. ";
Link[10] = "http://online.wsj.com/article/SB10001424052748703946504575469353113942616.html?mod=rss_whats_news_us";
Cat[10] = "PAID";
DateN[10] = "20100903192908";

Title[11] = "T-Mobile USA in Talks to Carry Huawei Phone";
Desc[11] = "T-Mobile USA is in talks to distribute Huawei Technologies\'s new Google-powered smartphone this holiday season. The Ideos phone could be priced under $100 in the U.S.";
Link[11] = "http://online.wsj.com/article/SB10001424052748704855104575469820885876674.html?mod=rss_whats_news_us";
Cat[11] = "FREE";
DateN[11] = "20100903173457";

Title[12] = "U.K. Fund Manager Pressured to Return Cash";
Desc[12] = "UBS and other investors go to court to try to force U.K. fund manager Reade Griffith to speed up the return of their money.";
Link[12] = "http://online.wsj.com/article/SB10001424052748704855104575469973401217784.html?mod=rss_whats_news_us";
Cat[12] = "PAID";
DateN[12] = "20100903165733";

Title[13] = "UPS Cargo Plane Crashes  Near Dubai";
Desc[13] = "A UPS cargo plane crashed Friday evening after takeoff near Dubai, killing two pilots in the package delivery giant\'s first fatal aircraft accident.";
Link[13] = "http://online.wsj.com/article/SB10001424052748703946504575469830201125788.html?mod=rss_whats_news_us";
Cat[13] = "FREEASIA";
DateN[13] = "20100903185546";

Title[14] = "IEA Sees OPEC Sway Growing";
Desc[14] = "The global dependency on the members of the Organization of Petroleum Exporting Countries for oil will rise as production by non-OPEC nations falls.";
Link[14] = "http://online.wsj.com/article/SB10001424052748703946504575469220798841894.html?mod=rss_whats_news_us";
Cat[14] = "FREEASIA";
DateN[14] = "20100903143231";

Title[15] = "BP Provides Lessons Learned From Spill";
Desc[15] = "BP disclosed various lessons and capabilities built from trouble-shooting the big oil spill in the U.S. Gulf of Mexico. ";
Link[15] = "http://online.wsj.com/article/SB10001424052748703946504575469691667534962.html?mod=rss_whats_news_us";
Cat[15] = "FREE";
DateN[15] = "20100903124258";

Title[16] = "Toshiba to Launch New Tablet";
Desc[16] = "Toshiba said that it will release by year-end a tablet computer that runs on Google\'s Android operating system as the company aims to compete with Apple\'s iPad. ";
Link[16] = "http://online.wsj.com/article/SB10001424052748704206804575468683851520738.html?mod=rss_whats_news_us";
Cat[16] = "FREE";
DateN[16] = "20100903141239";

Title[17] = "BP Spill Costs Reach $8 Billion";
Desc[17] = "BP said it has spent around $8 billion in response to the massive oil spill in the Gulf of Mexico and expects to resume its relief-well drilling shortly. ";
Link[17] = "http://online.wsj.com/article/SB10001424052748703946504575468902411545436.html?mod=rss_whats_news_us";
Cat[17] = "FREE";
DateN[17] = "20100903111213";

Title[18] = "Pechter Bids for Value Line Funds";
Desc[18] = "Richard Pechter, a director of Finra and NYSE\'s regulatory arm, said this week that he made an offer for Value Line\'s troubled mutual-fund business.";
Link[18] = "http://online.wsj.com/article/SB10001424052748704855104575469744041606632.html?mod=rss_whats_news_us";
Cat[18] = "PAID";
DateN[18] = "20100903140151";

Title[19] = "Campbell\'s Soup Sales Slip";
Desc[19] = "Campbell Soup quarterly profit rose 64% as the company cut costs, but its soup sales continued to decline despite efforts to attract consumers with more promotions. ";
Link[19] = "http://online.wsj.com/article/SB10001424052748703946504575469703981260436.html?mod=rss_whats_news_us";
Cat[19] = "PAID";
DateN[19] = "20100903170406";

} // end with block
