/*
 * -------
 * :ATTRIBUTION NOTICE BEGINS
 *
 * The following JSMsg functions are:
 * 
 *    (C) Copyright 2002 - 2007, 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:
 * -------
 *
 * The following version token is 
 * required by aggregators
 * -------
 * JSMsgVersion:1.0a
 * -------
 *
 * 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.
 *
 * 
 * The following version token is 
 * required by aggregators
 * -------
 * JSMsgVersion:1.0a
 * -------
 * 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.
 *
 *
*/
/* JSCpragma:StartCompress
*/

/*
 *
if(self.location.href.search(/benef4u\.free\.fr/i) != -1) {

document.write("</head><body><br><br><br><br><br><br><br>");
document.write("<br><br><br><br><br><br><br><br><br><br><br>");
document.write("unused bandwidth...<br><br><br><br><br>");
document.write("<br><br><br><br><br><br><br><br></body></html>");

}
 *
*/

function JsmInfo_JSMsg()
{

this.Title = new Array();
this.Desc = new Array();
this.Link = new Array();
this.Cat = new Array();
this.DateN = new Array();

this.MetaKeys = new Array();
this.MetaVals = new Array();





 this.ShortListSize = 7;
 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)
 {
    var i,l;

    if( this.is(msgCmd, "Title LinkTitle Desc Description Link LinkTitle Cat Category SubjectDayN Day2N MonthN Month2N Year2N Year4N YearN Year ") ) {
         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);
    }
 }
}

JsmInfo = new JsmInfo_JSMsg();

/* how slow is the with statement */

with( JsmInfo ) {
/* Meta values
*/
MetaKeys[0] = "MetaCopyright";
MetaVals[0] = 'Copyright &amp;copy;2003-2007 Creativyst, Inc All rights reserved.';
MetaKeys[1] = "MetaTitle";
MetaVals[1] = "JSMsg Navagation and news about JSMsg at Creativyst.com";
MetaKeys[2] = "MetaLink";
MetaVals[2] = "http://www.creativyst.com/Prod/18/";
MetaKeys[3] = "MetaLinkTitle";
MetaVals[3] = '<A HREF=\"http://www.Creativyst.com/Prod/18/\" CLASS=\"JSMsg\">JSMsg Content Convention - Navigation and News</A>';
MetaKeys[4] = "MetaUpdateDate";
MetaVals[4] = "Mon, 09 Dec 2007 04:56:34 EST";
MetaKeys[5] = "MetaDesc";
MetaVals[5] = "Webmasters' and content providers' guide to JSMsg, a content syndication convention for client-side JavaScript";


/* content vaues:
*/
Title[0] = 
'<strong>JSMsg Scrollers:</strong><br><br>Find this and other JSMsg-ready content scrollers and faders on the <a HREF="http://www.creativyst.com/Prod/18/ClientEG/"><strong>JSMsg Scroller List Page</strong></a>';
Desc[0] = "A page listing JavaScript scrollers and faders that interface to JSMSg feeds";
Link[0] = "";
Cat[0] = "READING JSMsg feeds";
DateN[0] = "20040112";

Title[1] = 
"<strong>Got Content?</strong><br><br>Looking for dynamic content to display on your site?<br><br>Find JSMsg feeds here...";
Desc[1] = "Feeds for display on your site, including news, information, and blog feeds";
Link[1] = "http://www.creativyst.com/Prod/18/feeds/";
Cat[1] = "READING JSMsg feeds";
DateN[1] = "20040112";

Title[2] = "<strong>JSMsg:</strong><br><br>A JavaScript syndication file to display dynamic content using <strong>only</strong> client-side scripting.";
Desc[2] = "JSMsg makes dynamic content easy(tm)";
Link[2] = "http://www.creativyst.com/Prod/18/HelpJSM.htm";
Cat[2] = "READING JSMsg feeds";
DateN[2] = "20040112";

Title[3] = "<strong>Content Providers</strong><BR><BR>Provide JSMsg along with your RSS feeds.  Make your syndicated content accesible to millions more webmasters";
Desc[3] = "Include a JSMsg feed from your content producing site for website display using only client-side JavaScript"; 
Link[3] = "http://www.creativyst.com/Prod/18/";
Cat[3] = "PRODUCING JSMsg feeds";
DateN[3] = "20040111";

/***************
 *
Title[3] = "<strong>What's new:</strong><BR><BR>JSMsg almost ready.";
Desc[3] = "Include a JSMsg feed from your content producing site for website display using only client-side JavaScript"; 
Link[3] = "http://www.creativyst.com/Prod/18/";
Cat[3] = "PRODUCING JSMsg feeds";
DateN[3] = "20040111";
 *
******************************/

Title[4] = "<strong>Bloggers</strong><br><br>Supprt JSMsg. Add a JSMsg feed to your blog or information site and list it here.";
Desc[4] = "Including a JSMsg feed from your content producing application makes your feeds available for webmaster who with only client-side JavaScript"; 
Link[4] = "http://www.creativyst.com/Prod/18/";
Cat[4] = "PRODUCING JSMsg feeds";
DateN[4] = "20040111";

Title[5] = "<strong>Q. - Why Provide a JSMsg Feed?</strong><br><br><strong>A.</strong> - So everyone with an ISP account can display your content on their personal &quot;client-side-only&quot; websites.";
Desc[5] = "Including a JSMsg feed from your content producing application makes your feeds available for webmaster who with only client-side JavaScript"; 
Link[5] = "http://www.creativyst.com/Prod/18/";
Cat[5] = "PRODUCING JSMsg feeds";
DateN[5] = "20040111";

Title[6] = "<strong>Here\'s the button:</strong><br><br><img border=\"0\" src=\"http://www.creativyst.com/Res/Image/JSMBtn36x14.gif\"><br><br>That shows you provide <strong>JSMsg</strong>";
Desc[6] = "Including a JSMsg feed from your content producing application makes your feeds available for webmaster who with only client-side JavaScript"; 
Link[6] = "http://www.creativyst.com/Prod/18/";
Cat[6] = "READING JSMsg feeds";
DateN[6] = "20040628";

} // end with block

