
/*
 * -------
 * :ATTRIBUTION NOTICE BEGINS
 *
 * The following JSMsg functions are:
 * 
 *    (C) Copyright 2002 - 2004, 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 nn_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([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.GetMsgN = function()
 {
	return(this.ShortListSize);
 }

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

     

}

nn = new nn_JSMsg();

/* how slow is the with statement */

with( nn ) {
/* Meta values
*/
MetaKeys[0] = "MetaCopyright";
MetaVals[0] = "Copyright 2010 The Seattle Times Company";
MetaKeys[1] = "MetaTitle";
MetaVals[1] = "The Seattle Times: Food &amp; wine";
MetaKeys[2] = "MetaLink";
MetaVals[2] = "http://seattletimes.nwsource.com/html/foodwine/index.html";
MetaKeys[3] = "MetaLinkTitle";
MetaVals[3] = "<A HREF=\"http://seattletimes.nwsource.com/html/foodwine/index.html\" CLASS=\"JSMsg\">The Seattle Times: Food &amp; wine</A>";
MetaKeys[4] = "MetaUpdateDate";
MetaVals[4] = "20100904191002";


/* content vaues:
*/
Title[0] = "It may be a boffo year for Beaujolais&#39; best";
Desc[0] = " While Beaujolais can be thin and sharp, megaproducer Georges Duboeuf says the 2009 cru Beaujolais coming out soon may be the vintage of a lifetime for these quaffable, chillable French-cafe-style wines.";
Link[0] = "http://seattletimes.nwsource.com/html/wineadviser/2012711697_pacificpadviser05.html?syndication=rss";
Cat[0] = "Wine Adviser";
DateN[0] = "20100824153103";

Title[1] = "Forager Langdon Cook writes recipes and essays to feed our soul";
Desc[1] = " In &quot;Fat of the Land: Adventures of a 21st Century Forager,&quot; author Langdon Cook takes us to the special places of the Pacific Northwest. In essays and recipes, Cook celebrates everything from shrimping in Hood Canal to scooping up chanterelles in the deepest Northwest forest.";
Link[1] = "http://seattletimes.nwsource.com/html/pacificnw/2012711702_pacificptaste05.html?syndication=rss";
Cat[1] = "Pacific NW";
DateN[1] = "20100831105002";

Title[2] = " &#39;Dancing shrimp&#39; taken off California menu";
Desc[2] = "A Sacramento restaurant agreed to stop serving live prawns after an animal-rights group said the practice was cruel to the ...";
Link[2] = "http://seattletimes.nwsource.com/html/nationworld/2012805467_shrimp04.html?syndication=rss";
Cat[2] = "Nation & World";
DateN[2] = "20100904171522";

Title[3] = "Pub fare a cut above at friendly Mulleady&#39;s";
Desc[3] = "Mulleady&#39;s Irish Pub & Restaurant opened in 2001 in Magnolia, and has since moved a block west into a two-story, shiny pub house that still exudes Old World charm &#8212; a perfect respite at the end of a long week.";
Link[3] = "http://seattletimes.nwsource.com/html/restaurants/2012790176_deal03.html?syndication=rss";
Cat[3] = "Restaurants";
DateN[3] = "20100903210103";

Title[4] = "Bite-size buffalo burgers";
Desc[4] = "Recipe: Buffalo sliders are a slick way to enjoy a burger without the guilt.";
Link[4] = "http://seattletimes.nwsource.com/html/foodwine/2012805300_eatforlife04.html?syndication=rss";
Cat[4] = "Food & wine";
DateN[4] = "20100903210104";

Title[5] = "&#39;Booze Cakes&#39; spikes desserts with spirits";
Desc[5] = "A look at &quot;Booze Cakes: Confections Spiked With Spirits, Wine, and Beer&quot; by Krystina Castella and Terry Lee Stone. Plus, a recipe for Rum and Coke Whoopie Pies.";
Link[5] = "http://seattletimes.nwsource.com/html/foodwine/2012804403_boozecakesbook04.html?syndication=rss";
Cat[5] = "Food & wine";
DateN[5] = "20100903180103";

Title[6] = "Quick fix: Add chicken for a main-course Caesar salad";
Desc[6] = "Recipe: Chicken Caeser Salad. This classic salad becomes a main course with the addition of spicy coated chicken.";
Link[6] = "http://seattletimes.nwsource.com/html/foodwine/2012804148_quickfixsalad04.html?syndication=rss";
Cat[6] = "Food & wine";
DateN[6] = "20100903180102";

Title[7] = "Direct trade coffee gains ground; Fair Trade exec calls it &#39;doomed to be small&#39;";
Desc[7] = "About half of the green coffee that spins and pops in Mark Barany&#39;s roaster in Bellevue comes from farms he knows. Barany (in photo by Seattle Times photographer Steve Ringman) has not visited them yet. His roastery and Seattle cafe, Kuma Coffee, are just a few years old and do not throw off lots of cash and free time for trips abroad.";
Link[7] = "http://seattletimes.nwsource.com/html/coffeecity/2012795613_direct_trade_seeks_integrity_f.html?syndication=rss";
Cat[7] = "Coffee City";
DateN[7] = "20100903003103";

Title[8] = "Can home cooking be hazardous to your health?\n    ";
Desc[8] = "Could your kitchen at home pass a restaurant inspection?";
Link[8] = "http://seattletimes.nwsource.com/html/health/2012789368_apusmeddirtykitchens.html?syndication=rss";
Cat[8] = "Food & wine";
DateN[8] = "20100902210104";

Title[9] = "Remember Starbucks saying it would put Seattle&#39;s Best in 30,000 locations by fall? It happened.";
Desc[9] = "When Starbucks unveiled the new Seattle&#39;s Best Coffee logo in May, it reiterated what had become a matter of math: Once it finished rolling into 9,000 Subway stores last year, the other 14,000 this year, 7,250 Burger King locations and 300 AMC Theatres, its grand total would top 30,000 locations.";
Link[9] = "http://seattletimes.nwsource.com/html/coffeecity/2012794785_remember_starbucks_saying_it_w.html?syndication=rss";
Cat[9] = "Coffee City";
DateN[9] = "20100902201602";

Title[10] = "Bumbershoot-goers: Check out these restaurants near the Needle";
Desc[10] = "Nancy Leson, The Seattle Times food writer, has plenty of suggestions on places to eat when you&#39;re headed to or from the Seattle Center for Bumbershoot.";
Link[10] = "http://seattletimes.nwsource.com/html/restaurants/2012790266_leson03.html?syndication=rss";
Cat[10] = "Restaurants";
DateN[10] = "20100902170833";

Title[11] = "Oh snap! New baby carrot campaign mimics junk food\n    ";
Desc[11] = "Baby carrot farmers are launching a campaign that pitches the little, orange, crunchy snacks as daring, fun and naughty - just like junk food.";
Link[11] = "http://seattletimes.nwsource.com/html/businesstechnology/2012785240_apusextremebabycarrots.html?syndication=rss";
Cat[11] = "Food & wine";
DateN[11] = "20100902083549";

Title[12] = "Brier Dudley: Starbucks announces BlackBerry app";
Desc[12] = "Starbucks announced an application for BlackBerry smartphones tonight. There&#39;s already an app for iPhones, and Starbucks tells The Seattle Times&#39; Brier Dudley that it may eventually offer apps for Android and Windows phones.";
Link[12] = "http://seattletimes.nwsource.com/html/coffeecity/2012784723_brier_dudley_starbucks_announc.html?syndication=rss";
Cat[12] = "Coffee City";
DateN[12] = "20100902010104";

Title[13] = "Organic strawberries given a thumbs up in WSU study";
Desc[13] = "Organic produce has more nutrients than conventionally-grown, according to a Washington State University study published Wednesday.";
Link[13] = "http://seattletimes.nwsource.com/html/localnews/2012784106_organic2m.html?syndication=rss";
Cat[13] = "Local News";
DateN[13] = "20100902153104";

Title[14] = "How Stuff Works: Organic food prices";
Desc[14] = "A paper entitled, &quot;Organic potatoes: they can be grown, but can they be profitable?&quot; is enlightening.";
Link[14] = "http://seattletimes.nwsource.com/html/foodwine/2012762181_webworks31.html?syndication=rss";
Cat[14] = "Food & wine";
DateN[14] = "20100901210103";

Title[15] = "Recipe: Cool Watermelon Soup With Thai Chili and Lime";
Desc[15] = "Serves 2 to 4 as a first course 2 &#189; to 2 &#190; pounds sweet watermelon flesh, seeds removed 1 &#189; cups ice cubes Generous pinch...";
Link[15] = "http://seattletimes.nwsource.com/html/foodwine/2012771110_splendidtablerecipe01.html?syndication=rss";
Cat[15] = "Food & wine";
DateN[15] = "20100831210104";

Title[16] = "Recipes: Firecracker Ice Pops, Peanut Butter-Chocolate Semifreddo and Apricot Cheesecake Bars";
Desc[16] = "Everyday Food offers some cool desserts for end of summer eating.";
Link[16] = "http://seattletimes.nwsource.com/html/foodwine/2012771142_web01marthastewart.html?syndication=rss";
Cat[16] = "Food & wine";
DateN[16] = "20100831210104";

Title[17] = "Recipes: Apricot Cheesecake Bars";
Desc[17] = "Makes 24 bars18 graham crackers 1 cup plus 2 tablespoons sugar, divided Coarse salt 1/2 cup (1 stick) unsalted butter, melted 10 ounces...";
Link[17] = "http://seattletimes.nwsource.com/html/foodwine/2012771112_marthastewart01.html?syndication=rss";
Cat[17] = "Food & wine";
DateN[17] = "20100831210104";

Title[18] = "Find out how your favorite restaurants did when they were inspected by Public Health-Seattle & King County";
Desc[18] = "Readers can get easy access to the restaurant inspection reports done by Public Health Seattle & King County via seattletimes.com.";
Link[18] = "http://seattletimes.nwsource.com/html/restaurants/2012771131_foodinspect01.html?syndication=rss";
Cat[18] = "Restaurants";
DateN[18] = "20100831210104";

Title[19] = "Happy Hour: Redmond&#39;s Black Raven brewery makes what may be Washington&#39;s first cult beer";
Desc[19] = "Happy Hour: Redmond&#39;s Black Raven Brewing Company.";
Link[19] = "http://seattletimes.nwsource.com/html/restaurants/2012771101_happyraven01.html?syndication=rss";
Cat[19] = "Restaurants";
DateN[19] = "20100904162604";

} // end with block
