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

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

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



 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);
    }
 }

     

}

ansa = new ansa_JSMsg();

/* how slow is the with statement */

with( ansa ) {
/* Meta values
*/
MetaKeys[0] = "MetaCopyright";
MetaVals[0] = "Copyright: (C) ANSA, http://www.ansa.it/web/static/disclaimer.html";
MetaKeys[1] = "MetaTitle";
MetaVals[1] = "News di Topnews - ANSA.it\n				";
MetaKeys[2] = "MetaLink";
MetaVals[2] = "http://www.ansa.it/web/notizie/rubriche/topnews/topnews.shtml";
MetaKeys[3] = "MetaLinkTitle";
MetaVals[3] = "<A HREF=\"http://www.ansa.it/web/notizie/rubriche/topnews/topnews.shtml\" CLASS=\"JSMsg\">News di Topnews - ANSA.it\n				</A>";
MetaKeys[4] = "MetaDesc";
MetaVals[4] = "Updated every day - FOR PERSONAL USE ONLY";


/* content vaues:
*/
Title[0] = "Bossi: vedo un premier dimezzato";
Desc[0] = "\'\'Comunque il federalismo passera\'\'\' ha aggiunto il Senatur";
Link[0] = "http://www.ansa.it/web/notizie/rubriche/topnews/2010/09/03/visualizza_new.html_1787109889.html";
DateN[0] = "03 S0303030000";

Title[1] = "Euro 2012: Estonia-Italia 1-2";
Desc[1] = "Gol di Cassano e Bonucci nella ripresa. Due invasioni di campo";
Link[1] = "http://www.ansa.it/web/notizie/rubriche/topnews/2010/09/03/visualizza_new.html_1787110697.html";
DateN[1] = "03 S0303030000";

Title[2] = "Borsa: Wall Street chiude positiva";
Desc[2] = "Dow Jones +1,24%, Nasdaq +1,53%. Euro a 1,28 sul dollaro";
Link[2] = "http://www.ansa.it/web/notizie/rubriche/topnews/2010/09/03/visualizza_new.html_1787110792.html";
DateN[2] = "03 S0303030000";

Title[3] = "Bimbi caduti in lago Iseo, uno e\' morto";
Desc[3] = "Ancora gravi le condizioni della sorella";
Link[3] = "http://www.ansa.it/web/notizie/rubriche/topnews/2010/09/03/visualizza_new.html_1787111845.html";
DateN[3] = "03 S0303030000";

Title[4] = "EAU: aereo precipitato era cargo Ups";
Desc[4] = "Era diretto a Colonia, morti i due membri dell\'equipaggio";
Link[4] = "http://www.ansa.it/web/notizie/rubriche/topnews/2010/09/03/visualizza_new.html_1787112587.html";
DateN[4] = "03 S0303030000";

Title[5] = "Mo: negoziati, appello Hillary Clinton";
Desc[5] = "Segretario di Stato, la pace e\' anche un interesse americano";
Link[5] = "http://www.ansa.it/web/notizie/rubriche/topnews/2010/09/03/visualizza_new.html_1787113547.html";
DateN[5] = "03 S0303030000";

Title[6] = "Talebani Pakistan,colpiremo Usa e Europa";
Desc[6] = "Mehsud ha gia\' rivendicato bombe di Lahore e attacco a Quetta";
Link[6] = "http://www.ansa.it/web/notizie/rubriche/topnews/2010/09/03/visualizza_new.html_1787113773.html";
DateN[6] = "03 S0303030000";

Title[7] = "Nuova Zelanda: panico e danni a edifici";
Desc[7] = "Testimone, crollata chiesa nel centro di Christchurch";
Link[7] = "http://www.ansa.it/web/notizie/rubriche/topnews/2010/09/03/visualizza_new.html_1787115689.html";
DateN[7] = "03 S0303030000";

Title[8] = "Premier: non respinto candidato Sviluppo";
Desc[8] = "Premier chiarisce: io non ho mai proposto nessuno al Quirinale";
Link[8] = "http://www.ansa.it/web/notizie/rubriche/topnews/2010/09/03/visualizza_new.html_1787137517.html";
DateN[8] = "03 S0303030000";

Title[9] = "Due bambini cadono nel lago d\'Iseo";
Desc[9] = "In arresto cardiaco dopo rianimazione, cuore riprende a battere";
Link[9] = "http://www.ansa.it/web/notizie/rubriche/topnews/2010/09/03/visualizza_new.html_1787137607.html";
DateN[9] = "03 S0303030000";

Title[10] = "Mo: negoziati, per Peres inizio buono";
Desc[10] = "\'Spero che questa volta l\'esito sia a favore della pace\'";
Link[10] = "http://www.ansa.it/web/notizie/rubriche/topnews/2010/09/03/visualizza_new.html_1787137728.html";
DateN[10] = "03 S0303030000";

Title[11] = "Terremoti: Nuova Zelanda, sisma 7.2";
Desc[11] = "Epicentro sulla terraferma, a 30 km a nordovest di Christchurch";
Link[11] = "http://www.ansa.it/web/notizie/rubriche/topnews/2010/09/03/visualizza_new.html_1787138598.html";
DateN[11] = "03 S0303030000";

Title[12] = "EAU: cargo Usa si schianta a Dubai";
Desc[12] = "Tutti morti i membri dell\'equipaggio";
Link[12] = "http://www.ansa.it/web/notizie/rubriche/topnews/2010/09/03/visualizza_new.html_1787140582.html";
DateN[12] = "03 S0303030000";

Title[13] = "Palazzo Chigi, mai sottovalutata crisi";
Desc[13] = "Al ministero dello Sviluppo nessun vuoto di potere";
Link[13] = "http://www.ansa.it/web/notizie/rubriche/topnews/2010/09/03/visualizza_new.html_1787140618.html";
DateN[13] = "03 S0303030000";

Title[14] = "Grecia: Virus Nilo, si aggrava bilancio";
Desc[14] = "Trasmesso da zanzare infettate, non esiste vaccino";
Link[14] = "http://www.ansa.it/web/notizie/rubriche/topnews/2010/09/03/visualizza_new.html_1787142412.html";
DateN[14] = "03 S0303030000";

Title[15] = "Bersani: interim a sviluppo vuoto totale";
Desc[15] = "Segretario del Pd, se possibile andrebbe sfiduciato";
Link[15] = "http://www.ansa.it/web/notizie/rubriche/topnews/2010/09/03/visualizza_new.html_1787142506.html";
DateN[15] = "03 S0303030000";

Title[16] = "Milano chiude in rialzo, Ftse Mib +1,1%";
Desc[16] = "Positive anche Londra e Parigi. Vola la piazza di Atene";
Link[16] = "http://www.ansa.it/web/notizie/rubriche/topnews/2010/09/03/visualizza_new.html_1787143406.html";
DateN[16] = "03 S0303030000";

Title[17] = "Berlusconi: presto il nuovo ministro";
Desc[17] = "\'Il mio interim allo Sviluppo non vuoto ma pieno\'";
Link[17] = "http://www.ansa.it/web/notizie/rubriche/topnews/2010/09/03/visualizza_new.html_1787143533.html";
DateN[17] = "03 S0303030000";

Title[18] = "P3: finito giro interrogatori arrestati";
Desc[18] = "Forse altri nominativi finiranno nel registro degli indagati";
Link[18] = "http://www.ansa.it/web/notizie/rubriche/topnews/2010/09/03/visualizza_new.html_1787144423.html";
DateN[18] = "03 S0303030000";

Title[19] = "Per italiani meno auto e piu\' web";
Desc[19] = "Lo rivela l\'Indicatore dei consumi di Confcommercio (Icc)";
Link[19] = "http://www.ansa.it/web/notizie/rubriche/topnews/2010/09/03/visualizza_new.html_1787145328.html";
DateN[19] = "03 S0303030000";

} // end with block
