
/*
 * -------
 * :ATTRIBUTION NOTICE BEGINS
 *
 * The following JSMsg functions are:
 * 
 *    (C) Copyright 2002 - 2006, 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.0f
*/
/* 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 bbcb_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="_self" \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=\"_self\" \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);
    }
 }

     

}

bbcb = new bbcb_JSMsg();

/* how slow is the with statement */

with( bbcb ) {
/* Meta values
*/
MetaKeys[0] = "MetaCopyright";
MetaVals[0] = "\n        Copyright: (C) British Broadcasting Corporation, \n        see http://news.bbc.co.uk/2/hi/help/rss/4498287.stm\n        for terms and conditions of reuse.\n      ";
MetaKeys[1] = "MetaTitle";
MetaVals[1] = "BBC News - Business";
MetaKeys[2] = "MetaLink";
MetaVals[2] = "http://www.bbc.co.uk/go/rss/int/news/-/news/business/";
MetaKeys[3] = "MetaLinkTitle";
MetaVals[3] = "<A HREF=\"http://www.bbc.co.uk/go/rss/int/news/-/news/business/\" CLASS=\"JSMsg\">BBC News - Business</A>";
MetaKeys[4] = "MetaUpdateDate";
MetaVals[4] = "20100908061650";
MetaKeys[5] = "MetaDesc";
MetaVals[5] = "\n        The latest stories from the Business section of the\n        BBC News web site.\n      ";


/* content vaues:
*/
Title[0] = "House giant faces administration";
Desc[0] = "Property giant Connaught is expected to formally enter administration later, putting thousands of jobs at risk.";
Link[0] = "http://www.bbc.co.uk/go/rss/int/news/-/news/business-11224398";
DateN[0] = "20100907231652";

Title[1] = "Job market growth slows in August";
Desc[1] = "Job appointments grew at their slowest rate in 10 months in August, raising questions about the strength of the UK job market, a survey suggests.";
Link[1] = "http://www.bbc.co.uk/go/rss/int/news/-/news/business-11224407";
DateN[1] = "20100907235757";

Title[2] = "Vodafone makes $6.5bn China sale";
Desc[2] = "Vodafone pockets $6.5bn ion cash following the sale of its 3.2% stake in China\'s biggest wireless operator, China Mobile.";
Link[2] = "http://www.bbc.co.uk/go/rss/int/news/-/news/business-11225509";
DateN[2] = "20100908055413";

Title[3] = "Japan may intervene to curb yen";
Desc[3] = "The Japanese finance minister says there could be market intervention as the yen hits a new 15-year high.";
Link[3] = "http://www.bbc.co.uk/go/rss/int/news/-/news/world-asia-pacific-11225569";
DateN[3] = "20100908061648";

Title[4] = "Cable to signal \'cuts to science\'";
Desc[4] = "Business Secretary Vince Cable is expected to signal a squeeze on government funding for scientific research, urging universities to do \'more for less\'.";
Link[4] = "http://www.bbc.co.uk/go/rss/int/news/-/news/business-11225197";
DateN[4] = "20100908055347";

Title[5] = "Diamond to be new Barclays chief";
Desc[5] = "Bob Diamond is to become chief executive of Barclays, while HSBC chairman Stephen Green steps down to become a government trade minister. ";
Link[5] = "http://www.bbc.co.uk/go/rss/int/news/-/news/uk-11209416";
DateN[5] = "20100907123159";

Title[6] = "EU\'s Barroso laments jobs crisis";
Desc[6] = "The European Commission President, Jose Manuel Barroso, highlights unemployment as a major challenge, in his first \"state of the union\" speech.";
Link[6] = "http://www.bbc.co.uk/go/rss/int/news/-/news/world-europe-11210438";
DateN[6] = "20100907102719";

Title[7] = "Boeing revamps military division";
Desc[7] = "Boeing announces cuts at its military aircraft division in readiness for future reductions in US government defence spending.";
Link[7] = "http://www.bbc.co.uk/go/rss/int/news/-/news/business-11224062";
DateN[7] = "20100907213432";

Title[8] = "Tax error letters start to arrive";
Desc[8] = "UK tax authorities are bracing themselves for a deluge of complaints and enquiries after sending out fresh tax calculations.";
Link[8] = "http://www.bbc.co.uk/go/rss/int/news/-/news/business-11211658";
DateN[8] = "20100907114517";

Title[9] = "Most believe \'retirement is over\'";
Desc[9] = "Seven out of 10 people believe retirement as we know it will not be possible in the future, a BBC Newsnight poll finds.";
Link[9] = "http://news.bbc.co.uk/go/rss/int/news/-/1/hi/programmes/newsnight/8973814.stm";
DateN[9] = "20100907102312";

Title[10] = "HP sues Hurd over new Oracle job";
Desc[10] = "Hewlett Packard files a lawsuit against its former head Mark Hurd to try and stop him joining database software maker Oracle.";
Link[10] = "http://www.bbc.co.uk/go/rss/int/news/-/news/business-11212724";
DateN[10] = "20100907194348";

Title[11] = "Concern over new business groups";
Desc[11] = "The government receives 56 requests to set up local business groups - amid concerns some could be too small and lack clout.";
Link[11] = "http://www.bbc.co.uk/go/rss/int/news/-/news/uk-politics-11221742";
DateN[11] = "20100907184848";

Title[12] = "Obama to back company tax breaks";
Desc[12] = "President Obama is to call for company tax breaks in his bid to regain the initiative as mid-term elections loom.";
Link[12] = "http://www.bbc.co.uk/go/rss/int/news/-/news/business-11216784";
DateN[12] = "20100907154035";

Title[13] = "EU agrees new financial framework";
Desc[13] = "European finance ministers agree a new framework for financial supervision, designed to help prevent future financial crises.";
Link[13] = "http://www.bbc.co.uk/go/rss/int/news/-/news/business-11220469";
DateN[13] = "20100907174928";

Title[14] = "Mozambique bread price climbdown";
Desc[14] = "Mozambique says it will reverse the increase in the price of bread that sparked deadly riots last week.";
Link[14] = "http://www.bbc.co.uk/go/rss/int/news/-/news/business-11216009";
DateN[14] = "20100907132722";

Title[15] = "Workplace accidents \'unreported\'";
Desc[15] = "Union leaders claim some workplace accidents go unreported with 1.2 million people suffering from work-related illnesses.";
Link[15] = "http://www.bbc.co.uk/go/rss/int/news/-/news/business-11217195";
DateN[15] = "20100907150112";

Title[16] = "Scam fear over electricity credit";
Desc[16] = "Criminals have managed to clone prepayment meter keys in order to make money by offering discounted credit to customers.";
Link[16] = "http://www.bbc.co.uk/go/rss/int/news/-/news/business-11201806";
DateN[16] = "20100906230146";

Title[17] = "Demand for Equitable Life payout ";
Desc[17] = "Pensioners hit by the Equitable Life scandal are making a final attempt to persuade the government to pay them full compensation. ";
Link[17] = "http://www.bbc.co.uk/go/rss/int/news/-/news/business-11195727";
DateN[17] = "20100906105239";

Title[18] = "Key Asian interest rates on hold";
Desc[18] = "The cost of borrowing in Australia stays at 4.5% and Japan at near zero amid continuing global economic uncertainty.";
Link[18] = "http://www.bbc.co.uk/go/rss/int/news/-/news/business-11210025";
DateN[18] = "20100907061254";

Title[19] = "UK slipping down graduate league";
Desc[19] = "The UK is slipping behind international rivals in university places, according to figures from the Organisation for Economic Co-operation and Development.";
Link[19] = "http://www.bbc.co.uk/go/rss/int/news/-/news/education-11203790";
DateN[19] = "20100907090948";

} // end with block
