
var ani = 1;
var anu = 0;
var newsuse;
var name;
var x=0;
var nsloc;
var artype;
var newstotal = 88;
function newsitem(date, title, county, area, url) {
  this.date = date;
  this.title = title;
  this.county = county;
  this.area = area;
  this.url = url;
}

ni = new Array(newstotal);ni[1] = new newsitem("12/06/2011", "From Christchurch to Canada", "", "", "http://www.canadianunderwriter.ca/news/from-christchurch-to-canada/1000807704/?type=Print%20Archives");
ni[2] = new newsitem("11/08/2011", "Photo Tuesday: Shake It Out Baby", "", "", "http://redcrosstalks.wordpress.com/2011/11/08/photo-tuesday-shake-it-out-baby/");
ni[3] = new newsitem("10/27/2011", "EDITORIAL: Be quake-ready", "", "", "http://www.bclocalnews.com/tri_city_maple_ridge/tricitynews/opinion/132653548.html");
ni[4] = new newsitem("10/26/2011", "Schools get ready to rock and roll", "", "", "http://www.bclocalnews.com/bc_cariboo/100milefreepress/news/132570063.html");
ni[5] = new newsitem("10/26/2011", "Mile 108 Elementary School a beehive of activity", "", "", "http://www.bclocalnews.com/bc_cariboo/100milefreepress/community/132310788.html");
ni[6] = new newsitem("10/25/2011", "Second Great Canadian Shakeout raises awareness", "", "", "http://www.bclocalnews.com/vancouver_island_central/parksville_qualicumbeachnews/news/132491773.html");
ni[7] = new newsitem("10/24/2011", "Dave Dickson\'s Comment", "", "", "http://www.cfax1070.com/index.php?option=com_content&view=article&id=3495:dave-dicksons-comment&catid=52:editorials&Itemid=115");
ni[8] = new newsitem("10/24/2011", "Great BC Shakeout shakes Douglas College", "", "", "http://www.theotherpress.ca/?p=703");
ni[9] = new newsitem("10/23/2011", "New IBHS Article Highlights Risks Posed by Fire Following Earthquakes", "", "", "http://pr-canada.net/index.php?option=com_content&task=view&id=458073&Itemid=55");
ni[10] = new newsitem("10/23/2011", "The Great British Columbia Shakeout", "", "", "http://www.royalcityrecord.com/Scripts/Sp6Query.aspx/Great British Columbia Shakeout/5594582/story.html");
ni[11] = new newsitem("10/22/2011", "Thumbs up/ thumbs down", "", "", "http://www.timescolonist.com/opinion/Thumbs thumbs down/5594317/story.html");
ni[12] = new newsitem("10/22/2011", "Numbers grow for earthquake drill", "", "", "http://www.bclocalnews.com/vancouver_island_central/nanaimonewsbulletin/news/132326263.html");
ni[13] = new newsitem("10/21/2011", "ShakeOut: prepare for the Big One", "", "", "http://www2.canada.com/albernivalleytimes/news/story.html?id=885d7997-59da-47ff-b5d0-f556fb4a4da4");
ni[14] = new newsitem("10/21/2011", "Thousands of Nanaimoites take part in Great B.C. Shakeout event", "", "", "http://www2.canada.com/nanaimodailynews/news/story.html?id=fc6e5f5b-65d3-44fc-ab4c-b2deac360807");
ni[15] = new newsitem("10/21/2011", "Politicians join in earthquake drill", "", "", "http://ca.news.yahoo.com/politicians-join-earthquake-drill-060731636.html");
ni[16] = new newsitem("10/21/2011", "IBC promotes earthquake safety", "", "", "http://www.citopbroker.com/news/ibc-promotes-earthquake-safety-2850");
ni[17] = new newsitem("10/21/2011", "GISuser Today newsletter, Oct 20 - Atanas, Telmap, SuperGeo, Esri making news", "", "", "http://www.gisuser.com/content/view/24875/2/");
ni[18] = new newsitem("10/20/2011", "The Canadian Press News Agenda for Oct. 20", "", "", "http://satellite.tmcnet.com/news/2011/10/20/5870543.htm");
ni[19] = new newsitem("10/20/2011", "Vancouver\'s earthquake response plan", "", "", "http://vancouver.openfile.ca/vancouver/video/vancouvers-earthquake-response-plan");
ni[20] = new newsitem("10/20/2011", "City of Victoria among today\'s participants in province wide earthquake drill", "", "", "http://www.cfax1070.com/index.php?option=com_content&view=article&id=3447:city-of-victoria-among-todays-participants-in-province-wide-earthquake-drill&catid=45:mainlocal-news&Itemid=155");
ni[21] = new newsitem("10/20/2011", "Insurance Bureau of Canada promotes earthquake safety", "", "", "http://www.newswire.ca/en/story/862321/insurance-bureau-of-canada-promotes-earthquake-safety");
ni[22] = new newsitem("10/20/2011", "Ministers Toews and Moore Encourage British Columbians to ShakeOut", "", "", "http://pr-usa.net/index.php?option=com_content&task=view&id=925790&Itemid=29");
ni[23] = new newsitem("10/20/2011", "Great British Columbia ShakeOut this morning", "", "", "http://www.news1130.com/news/local/article/290536--great-british-columbia-shakeout-this-morning");
ni[24] = new newsitem("10/20/2011", "Are you ready for the big one? ShakeOut drill set to go this morning", "", "", "http://www.theprovince.com/news/ready ShakeOut drill this morning/5580875/story.html");
ni[25] = new newsitem("10/20/2011", "B.C Shakeout On The Way", "", "", "http://golden.myezrock.com/News/Story.aspx?ID=1558855");
ni[26] = new newsitem("10/20/2011", "Shake it out", "", "", "http://www.castanet.net/edition/news-story-66291-3-.htm");
ni[27] = new newsitem("10/20/2011", "Drop, Cover and Hold On!", "", "", "http://www.canadaviews.ca/2011/10/20/drop-cover-and-hold-on/");
ni[28] = new newsitem("10/20/2011", "New classrooms for a growing John Stubbs Memorial", "", "", "http://www.canadaviews.ca/2011/10/20/new-classrooms-for-a-growing-john-stubbs-memorial/");
ni[29] = new newsitem("10/20/2011", "Great British Columbia ShakeOut today", "", "", "http://www.news1130.com/news/local/article/290536--great-british-columbia-shakeout-today");
ni[30] = new newsitem("10/20/2011", "Minster George reads Curious George", "", "", "http://www.bclocalnews.com/vancouver_island_south/goldstreamgazette/news/132258108.html");
ni[31] = new newsitem("10/20/2011", "UES takes part in ShakeOut BC", "", "", "http://www2.canada.com/westerly/news/story.html?id=fc7a40b2-16b9-4e61-911e-4229ecc13731");
ni[32] = new newsitem("10/20/2011", "Earthquake means \'drop, cover, hold on\'", "", "", "http://www.bclocalnews.com/vancouver_island_north/campbellrivermirror/lifestyles/132267543.html");
ni[33] = new newsitem("10/20/2011", "Quake drill &#8216;second nature&#8217; for students", "", "", "http://vancouver.24hrs.ca/News/local/2011/10/20/18855761.html");
ni[34] = new newsitem("10/20/2011", "ShakeOut in West May Raise Disaster Awareness", "", "", "http://www.infotumbler.com/?p=6182");
ni[35] = new newsitem("10/19/2011", "Get ready for ShakeOut", "", "", "http://www.bclocalnews.com/vancouver_island_south/sookenewsmirror/news/132148883.html");
ni[36] = new newsitem("10/19/2011", "Time to shake, rattle and roll tomorrow", "", "", "http://www.bclocalnews.com/bc_north/terracestandard/community/131923848.html");
ni[37] = new newsitem("10/19/2011", "&#8220;ShakeOut&#8221; Earthquake Drills To Take Place This Week", "", "", "http://www.redorbit.com/news/science/1112404353/shakeout-earthquake-drills-to-take-place-this-week/index.html");
ni[38] = new newsitem("10/19/2011", "Ministers Toews and Moore Encourage British Columbians to ShakeOut / Earthquake preparedness will help save lives", "", "", "http://www.finanznachrichten.de/nachrichten-2011-10/21684531-ministers-toews-and-moore-encourage-british-columbians-to-shakeout-earthquake-preparedness-will-help-save-lives-256.htm");
ni[39] = new newsitem("10/19/2011", "Be ready for the big one", "", "", "http://www.richmond-news.com/news/ready/5572379/story.html");
ni[40] = new newsitem("10/19/2011", "Get ready for Great Canadian ShakeOut", "", "", "http://watchtower-mayah.newsvine.com/_news/2011/10/19/8398520-get-ready-for-great-canadian-shakeout");
ni[41] = new newsitem("10/19/2011", "The Canadian Press News Agenda for Thursday, Oct. 20", "", "", "http://www.tmcnet.com/usubmit/-canadian-press-news-agenda-thursday-oct-20-/2011/10/19/5869117.htm");
ni[42] = new newsitem("10/19/2011", "Shake up your routine", "", "", "http://www.bclocalnews.com/vancouver_island_south/peninsulanewsreview/news/132085803.html");
ni[43] = new newsitem("10/19/2011", "Shake up your routine", "", "", "http://www.bclocalnews.com/news/132085803.html");
ni[44] = new newsitem("10/19/2011", "Ministers Toews and Moore Encourage British Columbians to ShakeOut Earthquake preparedness will help save lives", "", "", "http://www.pr-inside.com/ministers-toews-and-moore-encourage-british-r2866425.htm");
ni[45] = new newsitem("10/19/2011", "Ministers Toews and Moore Encourage British Columbians to ShakeOut Earthquake preparedness will help save lives", "", "", "http://www.live-pr.com/en/ministers-toews-and-moore-encourage-british-r1049152193.htm");
ni[46] = new newsitem("10/19/2011", "Be part of the largest Canadian earthquake drill", "", "", "http://thenelsondaily.com/news-brief/be-part-largest-canadian-earthquake-drill-0");
ni[47] = new newsitem("10/19/2011", "Shake it up on Thursday", "", "", "http://www2.canada.com/courierislander/story.html?id=66b6e357-f0b0-492a-aba7-332405d7a554");
ni[48] = new newsitem("10/18/2011", "Drop! Cover! Hold On! \"ShakeOut\" Earthquake Drills to Take Place This Week", "", "", "http://www.nsf.gov/news/news_summ.jsp?cntn_id=122002");
ni[49] = new newsitem("10/18/2011", "Get ready for Great Canadian ShakeOut", "", "", "http://www2.canada.com/comoxvalleyecho/news/story.html?id=fe3cc03e-68c5-498f-a1dd-71fcdc7cea9f");
ni[50] = new newsitem("10/18/2011", "Get ready for Great Canadian ShakeOut", "", "", "http://www2.canada.com/comoxvalleyecho/news/story.html?id=fe3cc03e-68c5-498f-a1dd-71fcdc7cea9f");
ni[51] = new newsitem("10/18/2011", "Richmond gets set to Drop and Cover", "", "", "http://www.richmond-news.com/Richmond+gets+Drop+Cover/5569580/story.html");
ni[52] = new newsitem("10/17/2011", "The Great British Columbia ShakeOut Oct 20 #yyj", "", "", "http://www.villagenow.net/2011/10/great-british-columbia-shakeout-oct-20.html");
ni[53] = new newsitem("10/17/2011", "Earthquake drill", "", "", "http://www.bclocalnews.com/surrey_area/peacearchnews/community/132015928.html");
ni[54] = new newsitem("10/17/2011", "Millions To Partake In Earthquake Drill In Canada And USA", "", "", "http://www.irishweatheronline.com/news/earth-science/geology/millions-to-partake-in-earthquake-drill-in-canada-and-usa/42264.html");
ni[55] = new newsitem("10/17/2011", "Not that kind of shake, rattle and roll", "", "", "http://www.qr77.com/Channels/News/Vancouver/Story.aspx?ID=1557857");
ni[56] = new newsitem("10/16/2011", "Another Earthquake Drill Scheduled", "", "", "http://www.opinion250.com/blog/view/21748/1/another+earthquake+drill+scheduled");
ni[57] = new newsitem("10/13/2011", "Being ready for the \'big one\'", "", "", "http://www.bclocalnews.com/richmond_southdelta/southdeltaleader/news/131809668.html");
ni[58] = new newsitem("10/13/2011", "Schools readying for tremor", "", "", "http://www.bclocalnews.com/news/131816198.html");
ni[59] = new newsitem("10/13/2011", "Second annual Shakeout huge earthquake drill", "", "", "http://www.bclocalnews.com/news/131830253.html");
ni[60] = new newsitem("10/12/2011", "Are you prepared?", "", "", "http://www2.canada.com/courierislander/news/story.html?id=3662d32e-9d75-48b1-a066-b3778c24ea6c");
ni[61] = new newsitem("10/12/2011", "Get prepared, not scared", "", "", "http://www.bclocalnews.com/vancouver_island_south/oakbaynews/news/131563363.html");
ni[62] = new newsitem("10/11/2011", "ShakeOut Drill puts emergency response to the test in RDN", "", "", "http://www2.canada.com/nanaimodailynews/news/story.html?id=ad2f3a51-faab-46c8-94bf-090216317d3b");
ni[63] = new newsitem("10/11/2011", "Transit drivers, RDN staff ready to shake out", "", "", "http://www.bclocalnews.com/news/131520733.html");
ni[64] = new newsitem("10/06/2011", "World\'s largest quake drill Oct. 20", "", "", "http://www.sfu.ca/sfunews/stories/worlds-largest-quake-drill-oct-20.html");
ni[65] = new newsitem("10/05/2011", "Prepare for the Great Bristish Columbia ShakeOut on Oct. 20", "", "", "http://www.bclocalnews.com/kootenay_rockies/grandforksgazette/community/131155553.html");
ni[66] = new newsitem("10/04/2011", "Shakout drill Oct. 20", "", "", "http://www.bclocalnews.com/vancouver_island_north/comoxvalleyrecord/community/131099288.html");
ni[67] = new newsitem("10/04/2011", "Getting ready for the &#8220;big one&#8221;: UBC takes part in province-wide ShakeOut Day", "", "", "http://ubyssey.ca/news/shake-out-day749/");
ni[68] = new newsitem("09/28/2011", "Holy cow! A one in a million birth", "", "", "http://www.bclocalnews.com/vancouver_island_central/cowichannewsleader/community/130672133.html");
ni[69] = new newsitem("09/27/2011", "Shakeout B.C. quake drill to take place this year on Oct. 20", "", "", "http://www2.canada.com/albernivalleytimes/news/story.html?id=5b9948aa-7b5e-4512-a186-14d9cc41b98b");
ni[70] = new newsitem("09/23/2011", "Earthquake drill in U.S., New Zealand, B.C.", "", "", "http://www.bclocalnews.com/tri_city_maple_ridge/mapleridgenews/news/130381238.html");
ni[71] = new newsitem("09/20/2011", "Quake a reminder to be prepared", "", "", "http://www.bclocalnews.com/surrey_area/peacearchnews/community/130226828.html");
ni[72] = new newsitem("08/25/2011", "Less than three months to go: the Great ShakeOutBC countdown is on", "", "", "http://www.bclocalnews.com/vancouver_island_north/campbellrivermirror/community/128416673.html");
ni[73] = new newsitem("06/27/2011", "Emergency Planning", "", "", "http://www.canadianunderwriter.ca/news/emergency-planning/1000494215/?type=Print%20Archives");
ni[74] = new newsitem("03/18/2011", "Do we need another Great BC ShakeOut?", "", "", "http://www.news1130.com/news/local/article/199510--do-we-need-another-great-bc-shakeout");
ni[75] = new newsitem("03/11/2011", "B.C. and the Big One", "", "", "http://www2.macleans.ca/2011/03/11/b-c-and-the-big-one-assessing-the-provinces-earthquake-preparedness/");
ni[76] = new newsitem("02/16/2011", "This little shake can be seen as a wake-up call", "", "", "http://www.canada.com/This+little+shake+seen+wake+call/4291236/story.html");
ni[77] = new newsitem("02/16/2011", "Protecting schools B.C.\'s top seismic priority", "", "", "http://vancouver.24hrs.ca/News/local/2011/02/15/17288171.html");
ni[78] = new newsitem("02/16/2011", "Earthquake rattles Valley, reminds us we\'re in tremor zone", "", "", "http://www.canada.com/Earthquake+rattles+Valley+reminds+tremor+zone/4291231/story.html");
ni[79] = new newsitem("02/15/2011", "Mild earthquake felt in Richmond", "", "", "http://www.bclocalnews.com/richmond_southdelta/richmondreview/news/116231879.html");
ni[80] = new newsitem("02/15/2011", "Small shaker centred in Cow Bay", "", "", "http://www.bclocalnews.com/vancouver_island_central/cowichannewsleader/news/116238429.html");
ni[81] = new newsitem("02/14/2011", "Getting ready for the Big One", "", "", "http://www.timescolonist.com/Getting+ready/4274148/story.html");
ni[82] = new newsitem("02/12/2011", "QUAKE SAFETY SUCCESS ", "", "", "http://www.canada.com/Nanaimo+track+renamed+honour+Marie+Davidson/4271694/story.html");
ni[83] = new newsitem("02/09/2011", "Knox: Rumbler a reminder to be ready", "", "", "http://www.timescolonist.com/news/Knox+Rumbler+reminder+ready/4249230/story.html");
ni[84] = new newsitem("02/09/2011", "Students drop for cover", "", "", "http://www.bclocalnews.com/bc_cariboo/100milefreepress/community/115607419.html");
ni[85] = new newsitem("02/09/2011", "Minor earthquake hits San Juan Islands region", "", "", "http://www.theprovince.com/news/Minor+earthquake+hits+Juan+Islands+region/4244156/story.html?cid=megadrop_story");
ni[86] = new newsitem("02/08/2011", "Mild earthquake rattles Victoria ", "", "", "http://www.theglobeandmail.com/news/national/british-columbia/mild-earthquake-rattles-victoria/article1898875/");
ni[87] = new newsitem("02/03/2011", "The Great British Columbia ShakeOut emphasizes earthquake preparedness - February 3, 2011", "", "", "http://jeancrowder.ndp.ca/node/1020");
ni[88] = new newsitem("02/03/2011", "Earthquake safety techniques debated", "", "", "http://www.bclocalnews.com/opinion/letters/115180674.html");

function writeNewslist(newsuse) {
  for (nsi = 1; nsi < newsuse ; nsi++) {
  if (ni[nsi].url != "") {
    document.write("\n<tr><td valign=\"top\" align=\"right\">" + ni[nsi].date + ":</td><td valign=\"top\" align=\"left\"><a href=\"" + ni[nsi].url + "\" target=\"_blank\">" + ni[nsi].title + "</a></td></tr>");
  }
  else {
    document.write("\n<tr><td valign=\"top\" align=\"right\">" + ni[nsi].date + ":</td><td valign=\"top\" align=\"left\">" + ni[nsi].title + "</td></tr>");
  }
  }
}




function writeArealist(newsuse, nsloc, artype) {
  while (anu < newsuse) {
      document.write("\n<tr><td valign=\"top\" align=\"right\">" + ni[ani].date + ":</td><td valign=\"top\" align=\"left\"><a href=\"" + ni[ani].url + "\">" + ni[ani].title + "</a></td></tr>");
    if (artype == 'area' && ni[ani].area.IndexOf(nsloc) > -1) {
      anu++;
      document.write("\n<tr><td valign=\"top\" align=\"right\">" + ni[ani].date + ":</td><td valign=\"top\" align=\"left\"><a href=\"" + ni[ani].url + "\">" + ni[ani].title + "</a></td></tr>");
    } else if (artype == 'county' && ni[ani].county.IndexOf(nsloc) > -1) {
      anu++;
      document.write("\n<tr><td valign=\"top\" align=\"right\">" + ni[ani].date + ":</td><td valign=\"top\" align=\"left\"><a href=\"" + ni[ani].url + "\">" + ni[ani].title + "</a></td></tr>");
    }
  ani++;
    if (ani > newstotal) {
      anu = newsuse;
    }
  }
}


function writecountyNewslist(newsuse,name) {
  for (nsi = 1,x=0; nsi < newsuse ; nsi++) {
	  if(ni[nsi].county.match(name)!=null){
	  x++;
	  if(x<=5){
  if (ni[nsi].url != "") {
    document.write("\n<tr><td valign=\"top\" align=\"right\">" + ni[nsi].date + ":</td><td valign=\"top\" align=\"left\"><a href=\"" + ni[nsi].url + "\" target=\"_blank\">" + ni[nsi].title + "</a></td></tr>");
  }
  else {
    document.write("\n<tr><td valign=\"top\" align=\"right\">" + ni[nsi].date + ":</td><td valign=\"top\" align=\"left\">" + ni[nsi].title + "</td></tr>");
  }
	  }
	  }
  }
}

