//--script to set up for B & B Concert Calendar
//----Array of month names for display on Calendar
var months = new Array(13);
  months[0] = "dummy";
  months[1] = "January";
  months[2] = "February";
  months[3] = "March";
  months[4] = "April";
  months[5] = "May";
  months[6] = "June";
  months[7] = "July";
  months[8] = "August";
  months[9] = "September";
  months[10] = "October";
  months[11] = "November";
  months[12] = "December";


//Array of Venue Names

var venuename = new Array();
var venuecity = new Array();
var venueURL = new Array();
var venuephone = new Array();
var venuemail = new Array();
  
  for (i=0;i<105;i++) {
    venuename[i]=""
    venuecity[i]=""
    venueURL[i]=""
    venuephone[i]=""
    venuemail[i]=""
  }
AcousticCafe=53
AcousticCelebration=50
AmazingThings=58
Avalon=16
Baldwins=18
Barns=26
BlackRiver=44
Blackrock=1
Bovis=70
Brennans=68
Brown=69
BullRun=25
CaffeLena=43
Cellar=2
CircleFriends=17
Conscience=55
Fairfield=52
Focus=3
FoxRun=37
GardenFolk=62
GodfreyDaniels=57
GoodFolk=15
HurdyGurdy=22
IMT=6
IronHorse=40
Java=67
Kagan=5
KickShoes=32
Kennett=72
Lansdowne=35
Levitt=71
LivingRoom=56
Lunazoot=66
Mainstay=63
Mansion=64
MeandThee=10
Metropolitan=42
MidnightSpecial=54
Minstrel=28
MusicforaChange=9
MusicoverManhattan=46
NERFA=36
NewMoon=73
OneLong=39
OurTimes=51
Outpost=19
Panzer=7
Passim=45
PeoplesVoice=41
PhilyFolk=23
PortWashington=49
Private=27
RadioBandB=65
Reston=4
Sanctuary=60
ShackBack=61
SoundingBoard=47
SteelCity=33
StoneTemple=31
StonyBrook=30
ThirdFret=59
TinAngel=11
TownCrier=24
TurningPoint=34
Vics=8
Wilde=9
Woodland=48
WPKN=21
XM=38



//-----------------------Concert Venues
//reserved
  vnum=74;
  venuename[vnum]  = "reserved";
  venuecity[vnum]  = "reserved";
  venueURL[vnum]  = "reserved";
  venuephone[vnum]  = "reserved";
  venuemail[vnum]  = "reserved";

//New Moon Coffeehouse - 73
  vnum=NewMoon;
  venuename[vnum]  = "New Moon Coffeehouse";
  venuecity[vnum]  = "Haverhill, MA";
  venueURL[vnum]  = "newmooncoffeehouse.org";
  venuephone[vnum]  = "978-459-5134";
  venuemail[vnum]  = "none";

//Kennett Flash - 72
  vnum=Kennett;
  venuename[vnum]  = "Kennett Flash";
  venuecity[vnum]  = "Kennett Square, PA";
  venueURL[vnum]  = "www.kennettflash.org";
  venuephone[vnum]  = "484-732-8295";
  venuemail[vnum]  = "none";

//Levitt Pavilion - 71
  vnum=Levitt;
  venuename[vnum]  = "The Levitt Pavilion for the Performing Arts";
  venuecity[vnum]  = "Westport, CT";
  venueURL[vnum]  = "www.levittpavilion.com";
  venuephone[vnum]  = "203-221-2153";
  venuemail[vnum]  = "none";

//  Bovi's Tavern - 70
  vnum=Bovis;
  venuename[vnum]  = "Bovi's Tavern";
  venuecity[vnum]  = "East Providence, RI";
  venueURL[vnum]  = "www.bovistavern.com";
  venuephone[vnum]  = "401-434-9670";
  venuemail[vnum]  = "none";

//Brown University - 69
  vnum=Brown;
  venuename[vnum]  = "Brown University";
  venuecity[vnum]  = "Providence, RI";
  venueURL[vnum]  = "";
  venuephone[vnum]  = "none";
  venuemail[vnum]  = "none";

//Brennan's Shebeen - 68
  vnum=Brennans;
  venuename[vnum]  = "Brennan's Shebeen";
  venuecity[vnum]  = "Bridgeport, CT";
  venueURL[vnum]  = "brennansshebeen.com/";
  venuephone[vnum]  = "203-870-9981";
  venuemail[vnum]  = "reserved";

//Jamin Java - 67
  vnum=Java;
  venuename[vnum]  = "Jammin' Java";
  venuecity[vnum]  = "Vienna, VA";
  venueURL[vnum]  = "www.jamminjava.com";
  venuephone[vnum]  = "703-255-1566";
  venuemail[vnum]  = "none";

//Lunazoot House Concert - 66
  vnum=Lunazoot;
  venuename[vnum]  = "Lunazoot House Concerts";
  venuecity[vnum]  = "Tampa, FL";
  venueURL[vnum]  = "www.lunazoot.net";
  venuephone[vnum]  = "none";
  venuemail[vnum]  = "too--lunazoot@gmail.com";

//The Mansion
  vnum=Mansion;
  venuename[vnum]  = "The Mansion";
  venuecity[vnum]  = "Middletown, NY";
  venueURL[vnum]  = "www.friendsofmusic.net/home.html";
  venuephone[vnum]  = "845-343-3049";
  venuemail[vnum]  = "none";

//Mainstay - Rock Hall MD
  vnum=Mainstay;
  venuename[vnum]  = "The Mainstay";
  venuecity[vnum]  = "Rock Hall, MD";
  venueURL[vnum]  = "www.mainstayrockhall.org";
  venuephone[vnum]  = "410-639-9133";
  venuemail[vnum]  = "none";

//Garden Folk House Concerts
  vnum=GardenFolk;
  venuename[vnum]  = "Garden Folk House Concerts";
  venuecity[vnum]  = "Palm Beach Gardens, FL";
  venueURL[vnum]  = "www.gardenfolk.org";
  venuephone[vnum]  = "301-807-7801";
  venuemail[vnum]  = "fsl143@comcast.net";


//Shack in the Back
  vnum=ShackBack;
  venuename[vnum]  = "The Shack in the Back House Concerts";
  venuecity[vnum]  = "Southwest Ranches, FL";
  venueURL[vnum]  = "www.floridamusic.org/cgi-bin/musicians.cgi?num=63";
  venuephone[vnum]  = "954-430-7004";
  venuemail[vnum]  = "none";


//The Sanctuary Concerts
  vnum=Sanctuary;
  venuename[vnum]  = "The Sanctuary Concerts";
  venuecity[vnum]  = "Chatham, NJ";
  venueURL[vnum]  = "www.sanctuaryconcerts.org";
  venuephone[vnum]  = "973-376-4946";
  venuemail[vnum]  = "boxoffice@sanctuaryconcerts.org";

//Third Fret
  vnum=ThirdFret;
  venuename[vnum]  = "Third Fret Coffeehouse";
  venuecity[vnum]  = "Buzzard's Bay, MA";
  venueURL[vnum]  = "www.trespassmusic.org/thethirdfret";
  venuephone[vnum]  = "none";
  venuemail[vnum]  = "none";


//Amazing Things Arts Center
  vnum=AmazingThings;
  venuename[vnum]  = "Amazing Things Arts Center";
  venuecity[vnum]  = "Framingham, MA";
  venueURL[vnum]  = "www.amazingthings.org";
  venuephone[vnum]  = "508-405-2787";
  venuemail[vnum]  = "none";

//Godfrey Daniels
  vnum=GodfreyDaniels;
  venuename[vnum]  = "Godfrey Daniels";
  venuecity[vnum]  = "Bethlehem, PA";
  venueURL[vnum]  = "www.godfreydaniels.org";
  venuephone[vnum]  = "610-867-2390";
  venuemail[vnum]  = "none";

//The Living Room
  vnum=LivingRoom;
  venuename[vnum]  = "The Living Room";
  venuecity[vnum]  = "New York, NY";
  venueURL[vnum]  = "www.livingroomny.com";
  venuephone[vnum]  = "212-533-7237";
  venuemail[vnum]  = "none";


//Coffee with a Conscience
  vnum=Conscience;
  venuename[vnum]  = "Coffee with a Conscience";
  venuecity[vnum]  = "Westfield, NJ";
  venueURL[vnum]  = "www.coffeewithconscience.org/";
  venuephone[vnum]  = "none";
  venuemail[vnum]  = "none";

//Midnight Special Folkstage
  vnum=MidnightSpecial;
  venuename[vnum]  = "Midnight Special Folkstage";
  venuecity[vnum]  = "Chicago, IL";
  venueURL[vnum]  = "www.midnightspecial.org/folkstage.htm";
  venuephone[vnum]  = "none";
  venuemail[vnum]  = "none";

//Acoustic Cafe
  vnum=AcousticCafe;
  venuename[vnum]  = "Acoustic Cafe";
  venuecity[vnum]  = "Park Ridge, NJ";
  venueURL[vnum]  = "www.cafeacoustic.org";
  venuephone[vnum]  = "none";
  venuemail[vnum]  = "none";

//Fairfield Theater - Stage One
  vnum=Fairfield;
  venuename[vnum]  = "Fairfield Theater - Stage One";
  venuecity[vnum]  = "Fairfield, CT";
  venueURL[vnum]  = "www.fairfieldtheatre.org";
  venuephone[vnum]  = "203-259-1036";
  venuemail[vnum]  = "info@fairfieldtheatre.org";

//Our Times Coffeehouse
  vnum=OurTimes;
  venuename[vnum]  = "Our Times Coffeehouse";
  venuecity[vnum]  = "Garden City, NY";
  venueURL[vnum]  = "www.ourtimescoffeehouse.org/upcoming_events.htm";
  venuephone[vnum]  = "none";
  venuemail[vnum]  = "none";

//Acoustic Celebration
  vnum=AcousticCelebration;
  venuename[vnum]  = "Acoustic Celebration";
  venuecity[vnum]  = "Ridgefield, CT";
  venueURL[vnum]  = "www.acousticcelebration.org/content/home.html";
  venuephone[vnum]  = "none";
  venuemail[vnum]  = "none";

//Port Washington Library
  vnum=PortWashington;
  venuename[vnum]  = "Public Library";
  venuecity[vnum]  = "Port Washington, NY";
  venueURL[vnum]  = "www.pwpl.org";
  venuephone[vnum]  = "none";
  venuemail[vnum]  = "none";

//Woodland Community Temple
  vnum=Woodland;
  venuename[vnum]  = "Woodland Community Temple";
  venuecity[vnum]  = "White Plains, NY";
  venueURL[vnum]   = "www.wct.org";
  venuephone[vnum]  = "none";
  venuemail[vnum]  = "none";

//Sounding  Board Coffeehouse
  vnum=SoundingBoard;
  venuename[vnum]  = "Sounding Board Coffeehouse";
  venuecity[vnum]  = "West Hartford, CT";
  venueURL[vnum]  = "www.folknotes.org";
  venuephone[vnum]  = "203-272-8404";
  venuemail[vnum]  = "reservations@folknotes.org";

//Music Over Manhattan House Concert - 46
  vnum=MusicoverManhattan;
  venuename[vnum]  = "Music Over Manhattan House Concert";
  venuecity[vnum]  = "New York, NY";
  venueURL[vnum]  = "";
  venuephone[vnum]  = "none";
  venuemail[vnum]  = "tomora0303@earthlink.net";

//Club Passim
  venuename[45]  = "Club Passim";
  venuecity[45]  = "Cambridge, MA";
  venueURL[45]  = "www.clubpassim.org";
  venuephone[45]  = "617-492-7679";
  venuemail[45]  = "none";

//Black River Valley Concert Series
  venuename[44]  = "Black River Valley Concert Series";
  venuecity[44]  = "Lowville, NY";
  venueURL[44]  = "www.frontiernet.net/~lchs/concertseries2010.html";
  venuephone[44]  = "none";
  venuemail[44]  = "none";


//Caffe Lena
  venuename[43]  = "Caffe Lena";
  venuecity[43]  = "Saratoga Springs, NY";
  venueURL[43]  = "www.caffelena.org";
  venuephone[43]  = "Tickets:800-838-3006";
  venuemail[43]  = "none";

// Metropolitan Room
  venuename[42]  = "The Metropolitan Room";
  venuecity[42]  = "New York, NY";
  venueURL[42]  = "www.metropolitanroom.com";
  venuephone[42]  = "212-206-0440";
  venuemail[42]  = "none";

//Peoples Voice Cafe
  venuename[41]  = "People's Voice Cafe";
  venuecity[41]  = "New York City, NY";
  venueURL[41]  = "www.peoplesvoicecafe.org";
  venuephone[41]  = "none";
  venuemail[41]  = "none";

//The Iron Horse
  venuename[40]  = "The Iron Horse";
  venuecity[40]  = "Northhampton, MA";
  venueURL[40]  = "www.iheg.com/index.asp";
  venuephone[40]  = "none";
  venuemail[40]  = "none";

//One Longfellow Square
  venuename[39]  = "One Longfellow Square";
  venuecity[39]  = "Portland, ME";
  venueURL[39]   = "www.onelongfellowsquare.com";
  venuephone[39] = "207-761-1757";
  venuemail[39]  = "none";

// Landsdowne Folk Club
  venuename[35]  = "Lansdowne Folk Club";
  venuecity[35]  = "Lansdowne, PA";
  venueURL[35]  = "www.myspace.com/lansdownefolkclub";
  venuephone[35]  = "610-622-7250.";
  venuemail[35]  = "none";

//The Turning Point
  venuename[34]  = "The Turning Point";
  venuecity[34]  = "Piermont, NY";
  venueURL[34]  = "www.piermont-ny.com/turning/index.htm";
  venuephone[34]  = "none";
  venuemail[34]  = "none";

//Stone Temple Coffeehouse
  venuename[31]  = "Stone Temple Coffeehouse";
  venuecity[31]  = "Quincy, MA";
  venueURL[31]  = "www.ufpc.org/coffeehouse/";
  venuephone[31]  = "617-821-4073";
  venuemail[31]  = "none";

//Bull Run Restaurant
  venuename[25]  = "The Bull Run Restaurant";
  venuecity[25]  = "Shirley, MA";
  venueURL[25]  = "www.bullrunrestaurant.com";
  venuephone[25]  = "978-425-4311 or 877-536-7190";
  venuemail[25]  = "bullrun@bicnet.net";

// Hurdy Gurdy Folk Club
  venuename[22]  = "Hurdy Gurdy Folk Club";
  venuecity[22]  = "Fair Lawn, NJ";
  venueURL[22]   = "www.hurdygurdyfolk.org";
  venuephone[22] = "none";
  venuemail[22]  = "none";

// Baldwin's Station
  venuename[18]  = "Baldwin's Station";
  venuecity[18]  = "Sykesville, MD";
  venueURL[18]  = "www.uptownconcerts.com";
  venuephone[18]  = "410-795-1041";
  venuemail[18]  = "uptownconcerts@gmail.com";

// The Tin Angel
  venuename[11]  = "The Tin Angel";
  venuecity[11]  = "Philadelphia, PA";
  venueURL[11]  = "www.tinangel.com";
  venuephone[11]  = "215-928-2770 or 215-928-0978";
  venuemail[11]  = "none";

//Music for a Change - U of Hartford - 9
  vnum=MusicforaChange;
  venuename[vnum]  = "Music for a Change - Wilde Auditorium";
  venuecity[vnum]  = "West Hartford, CT"
  venueURL[vnum]  = "www.musicforachange.com";
  venuephone[vnum]  = "860-768-4228 or 800-274-8587";
  venuemail[vnum]  = "none";

// Panzer House Concerts
  venuename[7]  = "Panzer House Concerts";
  venuecity[7]  = "Columbia, MD";
  venueURL[7]  = "www.columbiaskiclub.org/phc/phc.aspx";
  venuephone[7]  = "410-531-9233";  
  venuemail[7]  = "spanzers@gmail.com";


//----------------- Radio Stations--------------------------------------------
//WPKN - Radio B&B
  venuename[65]  = "Radio:<br>Radio B&B - WPKN-FM<br>89.5, 88.7 or Internet";
  venuecity[65]  = "Bridgeport CT area<br>Internet Radio";
  venueURL[65]   = "www.wpkn.org";
  venuephone[65] = "none";
  venuemail[65]  = "none";


//WFDU - Traditions - Bill Hahn
  venuename[12]  = "Radio: WFDU-FM<br>Traditions<br>89.1 or Internet";
  venuecity[12]  = "Alpine, NJ";
  venueURL[12]   = "alpha.fdu.edu/wfdu/wfdufm/home.html";
  venuephone[12] = "none";
  venuemail[12]  = "none";

//WXPN - Gene Shay
  venuename[13]  = "Radio: WXPN-FM<br>The Folk Show<br>w/Gene Shay<br>88.5 or Internet";
  venuecity[13]  = "Philadelphia, PA";
  venueURL[13]   = "www.wxpn.org";
  venuephone[13] = "none";
  venuemail[13]  = "none";

//WPKN - Bridgeport, CT
  venuename[21]  = "Radio: WPKN-FM<br>89.5, 88.7 or Internet";
  venuecity[21]  = "Bridgeport, CT";
  venueURL[21]  = "www.wpkn.org";
  venuephone[21]  = "none";
  venuemail[21]  = "none";


//XM - Washington, DC
  venuename[38]  = "Sirius XM Radio";
  venuecity[38]  = "Nationwide";
  venueURL[38]   = "www.xmradio.com";
  venuephone[38] = "none";
  venuemail[38]  = "none";


//---------------------------Still Unsorted------------------------------------

  venuename[1]  = "BlackRock Center for the Arts";
  venuename[2]  = "The Cellar Stage at Faith Community United Methodist Church";
  venuename[3]  = "Focus";
  venuename[4]  = "Folk Club of Reston-Herndon";
  venuename[5]  = "Folk 'n Great Music House Concerts";
  venuename[6]  = "Institute of Musical Traditions";

  venuename[8]  = "Focus Presents Vic's Music Corner";
  venuename[10]  = "Me&Thee Coffeehouse";
  venuename[14]  = "Radio: WUMB-FM<br>Music Mix<br>w/Dick Pleasants<br>91.9 or Internet";
  venuename[15]  = "Good Folk Coffeehouse";
  venuename[16]  = "Avalon Fest";
  venuename[17]  = "Circle of Friends Coffeehouse";
  venuename[19]  = "Outpost in the Burbs";
  venuename[20]  = "Radio: WFUV-FM<br>Mixed Bag<br>w/Pete Fornatale<br>90.7 or Internet";
  venuename[23]  = "Philadelphia Folk Festival";
  venuename[24]  = "The Towne Crier Cafe";
  venuename[26]  = "The Barns at Wolf Trap";
  venuename[27]  = "Private Event";
  venuename[28]  = "The Minstrel";
  venuename[29]  = "Radio: WUSB-FM<br>Sunday Street<br>with Charlie Backfish<br>90.1 or Internet";
  venuename[30]  = "University Cafe";
  venuename[32]  = "Kick Off Your Shoes House Concert";
  venuename[33]  = "Steel City Coffeehouse";
  venuename[36]  = "NERFA";
  venuename[37]  = "Fox Run Concerts";

// Array of venue cities

  venuecity[1]  = "Germantown, MD";
  venuecity[2]  = "Baltimore, MD";
  venuecity[3]  = "Alexandria, VA";
  venuecity[4]  = "Herndon, VA";
  venuecity[5]  = "Rockville, MD";
  venuecity[6]  = "Rockville, MD";

  venuecity[8]  = "Rockville, MD";
  venuecity[10]  = "Marblehead, MA";
  venuecity[14]  = "Boston, MA";
  venuecity[15]  = "Rowayton, CT";
  venuecity[16]  = "Paw Paw, WV";
  venuecity[17]  = "Franklin, MA";
  venuecity[19]  = "Montclair, NJ";
  venuecity[20]  = "New York, NY";
  venuecity[23]  = "Schwenksville, PA";
  venuecity[24]  = "Pawling, NY";
  venuecity[26]  = "Vienna, VA";
  venuecity[27]  = "Bridgeport, CT";
  venuecity[28]  = "Morristown, NJ";
  venuecity[29]  = "Stony Brook, NY";
  venuecity[30]  = "Stony Brook, NY";

  venuecity[32]  = "Topsfield, MA";
  venuecity[33]  = "Phoenixville, PA";
  venuecity[36]  = "Kerhonkson, NY";
  venuecity[37]  = "Sudbury, MA";

// Array of venue URLs
  venueURL[1]  = "www.blackrockcenter.org";
  venueURL[2]  = "www.uptownconcerts.com";
  venueURL[3]  = "www.focusmusic.org";
  venueURL[4]  = "restonherndonfolkclub.com";
  venueURL[5]  = "www.folkngreatmusic.org";
  venueURL[6]  = "www.imtfolk.org";

  venueURL[8]  = "www.focusmusic.org";
  venueURL[10]  = "www.meandthee.org";
  venueURL[14]  = "www.wumb.org";
  venueURL[15]  = "www.goodfolkcoffeehouse.com";
  venueURL[16]  = "www.avalon-resort.com";
  venueURL[17]  = "www.circlefolk.org";
  venueURL[19]  = "www.outpostintheburbs.org";
  venueURL[20]  = "www.wfuv.org";
  venueURL[23]  = "www.pfs.org/PFF.php";
  venueURL[24]  = "www.townecrier.com";
  venueURL[26]  = "www.wolftrap.org";
  venueURL[27]  = "";
  venueURL[28]  = "www.folkproject.org/fp_minstrel.html";
  venueURL[29]  = "www.wusb.fm/";
  venueURL[30]  = "www.universitycafe.org/";

  venueURL[32]  = "www.kickoffyourshoes.net/";
  venueURL[33]  = "www.steelcitycoffeehouse.com/eventschedule.asp";
  venueURL[36]  = "www.nerfa.org";
  venueURL[37]  = "www.foxrun.org/indexFoxRunHouseConcerts.html";

// Array of venue phone numbers
  venuephone[1]  = "none";
  venuephone[2]  = "none";
  venuephone[3]  = "703-501-6061";
  venuephone[4]  = "none";
  venuephone[5]  = "none";
  venuephone[6]  = "none";

  venuephone[8]  = "301-275-7459";
  venuephone[10]  = "781-631-8987";
  venuephone[14]  = "none";
  venuephone[15]  = "none";
  venuephone[16]  = "304-947-5600";
  venuephone[17]  = "none";
  venuephone[19]  = "none";
  venuephone[20]  = "none";
  venuephone[23]  = "none";
  venuephone[24]  = "845-855-1300";
  venuephone[26]  = "703-255-1900";
  venuephone[27]  = "none";
  venuephone[28]  = "973-335-9489";
  venuephone[29]  = "none";
  venuephone[30]  = "none";

  venuephone[32]  = "none";
  venuephone[33]  = "none";
  venuephone[36]  = "none";
  venuephone[37]  = "978-443-3253";

  venuemail[1]  = "none";
  venuemail[2]  = "none";
  venuemail[3]  = "none";
  venuemail[4]  = "none";
  venuemail[5]  = "none";
  venuemail[6]  = "none";

  venuemail[8]  = "none";
  venuemail[10]  = "info@meandthee.org";
  venuemail[14]  = "none";
  venuemail[15]  = "goodfolk@yahoo.com";
  venuemail[16]  = "musicfest@avalon-resort.com";
  venuemail[17]  = "none";

  venuemail[19]  = "none";
  venuemail[20]  = "none";


  venuemail[23]  = "none";
  venuemail[24]  = "none";

  venuemail[26]  = "wolftrap@wolftrap.org";
  venuemail[27]  = "none";
  venuemail[28]  = "none";
  venuemail[29]  = "none";
  venuemail[30]  = "none";

  venuemail[32]  = "ashara@aol.com";
  venuemail[33]  = "none";


  venuemail[36]  = "none";
  venuemail[37]  = "lal@foxrun.org";









//----Get the current month and year
today = new Date();
thismonth=today.getMonth()+1;
thisyear=today.getFullYear();
thisday=today.getDate();
if (thisyear < 1950) //--compensate for non-y2k browsers
 thisyear = thisyear-1900;
else
 thisyear =thisyear - 2000;
var keymonth = (thisyear*12)+thismonth; //keymonth is number of months since 1/1/2000
var keyday = (keymonth * 35)+thisday;
var thiskeymo;
var relstart = 1
if (site == "RobC") relstart = 200

//=== function to return a venue link from the venue1 array
//------fven = venue number
//------pre = text to precede link
//------app = text to append to link
function getvlink(fven,pre,app)
  {
    thisven = venue1[fven];
    thisvtype = thisven.substr(0,1);
    outstring = thisven.substr(12)
    if (thisvtype == "X") {
      outstring = "<a href='http://"+outstring;
    }
    if (thisvtype == "L") {
      outstring = "<a href='"+outstring+"</a>";
    }
    outstring = pre+outstring+app
    return outstring;
  }



//----Function to change a character string to bold (<b></b>) if upit == y
//------bstring is the string to be
function boldit(bstring,upit)
  {
   var nstring = bstring;
   if (upit == "Y" )
     nstring = "<b>"+bstring+"</b>";
   return nstring;
  }
//--Function to format a Buskin & Batteau calendar entry
//------bbmo is the month number
//------bbday id the day of the month
//------bbyr,is the integer year
//------bbvenue is the index into the venue table entry or a string
//------bbcity is the venue city string or index into venue array
//------bbURL is a venue url string or entry into table
//------bbmail is the email address or index into the venue array
//------bbphone is a phine number string or index into the venue array
//------bbother is a string to be added to the last calendar cell
function bbgig(bbmo,bbday,bbyr,bbvenue,bbcity,bbURL,bbmail,bbphone,bbother)
  {
   var thiskeyday = ((((bbyr-2000)*12)+bbmo)*35)+bbday;
   if (thiskeyday > keyday-relstart)
     {
     document.write('<tr>');
     document.write('<td>');
     document.write(months[bbmo]+' '+bbday+', '+bbyr);  // write the date
     document.write('</td>');
     document.write('<td>');               //begin cell for venue name
     if (isNaN(bbvenue))                   // If venue parameter is not a number
       outname=bbvenue;                    //use string as venue name
     else if (venueURL[bbvenue] =="")      // else if there is no url in the table 
       outname=venuename[bbvenue];         // just use name from array
          else                             //  if there is a url in the table
             outname="<a href='http://"+venueURL[bbvenue]+"'>"+venuename[bbvenue]+"</a>";  //format a link
     document.write(outname);
     document.write('</td>');
     document.write('<td>');               //begin cell for venue city
     if (bbcity == "")                     //if city parameter is null
       outcity= venuecity[bbvenue];       //use venue index into city array
     else if (isNaN(bbcity))              // else if city parameter is a string 
             outcity=bbcity;              // use string as city
          else                            //else 
             outcity=venuecity[bbcity]; // get city from table using passed parameter
     document.write(outcity);
     document.write('</td>');
     document.write('<td>');             // begin contact cell
     outweb="";                          //set cell content fields to null
     outemail="";
     outphone="";
     outcontact = "";
     if (bbURL == "")                     //if URL parameter is null
       outURL= venueURL[bbvenue];       //use venue index into URL array
     else if (isNaN(bbURL))              // else if URL parameter is a string 
             outURL=bbURL;              // use string as URL
          else                            //else 
             outURL=venueURL[bbURL]; // get URL from table using passed parameter
     if (outURL == "")
         ;
     else
        outcontact="web:<a href='http://"+outURL+"'>"+outURL+"</a>";  //format a web link
     if (bbmail == "")                     //if mail parameter is null
       outURL= venuemail[bbvenue];       //use venue index into email array
     else if (isNaN(bbmail))              // else if mail parameter is a string 
             outURL=bbmail;              // use string as email
          else                            //else 
             outURL=venuemail[bbmail]; // get email from table using passed parameter
     if (outURL == "" || outURL == 'none')
         ;
     else {
        outmail="email:<a href='mailto:"+outURL+"'>"+outURL+"</a>";  //format a mail link
        if (outcontact != "")
          outmail = '<br>'+outmail;
        outcontact = outcontact+outmail;
        }

     if (bbphone == "")                     //if phone parameter is null
       outphone= venuephone[bbvenue];       //use venue index into phone array
     else if (isNaN(bbphone))              // else if phone parameter is a string 
             outphone=bbphone;              // use string as phone
          else                            //else 
             outphone=venuephone[bbohone]; // get phone from table using passed parameter
     if (outphone == "" || outphone == 'none')
         ;
     else {
        outphone="phone:"+outphone;  //format a phone number
        if (outcontact != "")
          outphone = '<br>'+outphone;
        outcontact = outcontact+outphone;
        }

     outother = bbother;
     if (outother != "") {
        if (outcontact != "")
          outother = '<br>'+outother;
          outcontact = outcontact+outother;
        }

     document.write(outcontact);
     document.write('</td>');
     document.write('</tr>');
     }
  }

//----Final Fevent function
//------fdate is day of month
//------fperf1,fperf2 are performers or event names if numeric, they are indexes into performer/event array
//------fvenue is the venue name string or index into venue array
//------fcity is the city name or index into the city array
//------fpass if Y, will make it bold, if P, will make it bold and add WFMA pass event
//------output is date (cell1) fperf1 and 2 (cell2) venue and city (cell3)
function fevent(fdate,fperf1,fperf2,fvenue,fcity,fpass)
  {
   var thiskeyday = (thiskeymo * 35)+fdate;
   if (thiskeyday > keyday-1)
      {	var dobold = "N";
        if (fpass == "Y")
          dobold = "Y";
        if (fpass == "P")
          dobold = "Y";
        var outstring = "<tr><td>"+boldit(fdate,dobold)+"</td><td>"; //build date cell
        if (isNaN(fperf1))
          var namestring = fperf1;                 //use string as first artist
        else
          var namestring = getlink(fperf1,"","");      //get first artist from array
         if (fperf2 !== "")
           if (isNaN(fperf2))
             namestring = namestring+"<br>"+fperf2;   //use string as 2nd artist
           else
             namestring = namestring+"<br>"+getlink(fperf2,"",""); //get 2nd artist from array
        outstring = outstring+boldit(namestring,dobold);         //add it to the string
        outstring = outstring+"</td><td>";  //--start new cell
        if (isNaN(fvenue))
          var venstring = fvenue;                 //use string as venue
        else
          var venstring = getvlink(fvenue,"","");         //get venue from table
        if (fcity == "")
          ;
        else if (isNaN(fcity))
             venstring = venstring+" - "+fcity;  // use string as city
           else
              venstring = venstring+" - "+city[fcity]; // get city from table
        if (fpass == "P")
          venstring = venstring+"<br>(This is a WFMA pass event)";
        outstring=outstring+boldit(venstring,dobold)+"</td></tr>";
        document.write(outstring);
      }
  }

//----Function to display venue links on a page
//------selector is the 2 character prefix for the records to be selected XY 
//------columns is the number of columns to display the data - currently ignored
function listven(selector,columns)
  {
    venlist = new Array();                // new array to hold selected venues
    j=0
    for (i=0;i<venue1.length;i++) {     // loop through list of all venues
      thisven=venue1[i]

      if (thisven != "") {                // only use ones that have values
        venpre=thisven.substr(0,2)       // get the prefix
        if (venpre == "XS") {            // if this is a summer only venue 
          if ((thismonth>4) && (thismonth <9)) {  // and this is a summer month
            venpre = "XY"                // display this venue 
          }          
        } 
        if (venpre==selector) {           // compart to what was passed to function 
          vensort=thisven.substr(2,10)   // get sort field
          venrem=thisven.substr(12)      // get actual data
          venlist[j]=vensort+i;          // put data and index into the new array
          j=j+1
        }
      }
    }
    sortedlist = new Array();              // new array to hold sorted performer list
    sortedlist = venlist.sort();          // sort list and put in new array
//  collength=1+sortedlist.length/columns    // set the number of links to be displayed in each column
//  incol=1                                // start the count at 1
//  oldfirstlet="A"                        // start with a
//  document.write("<b>A</b><br>")         // write an A
    for (j=0;j<sortedlist.length;j++) {    // loop through sorted list
      thisven=sortedlist[j]               // get each record
//    firstlet=thisperf.substr(0,1)        // get first character of sort field
//    firstlet=firstlet.toUpperCase();
//    if (firstlet != oldfirstlet ) {
//      document.write("<b>"+firstlet+"</b><br>");
//      oldfirstlet=firstlet;
//    }
      thisindex=thisven.substr(10,3)      // get the index into main performer array (assumes 3 digits 
      index=thisindex.valueOf()            // change to integer
      document.write(getvlink(index,"","<br>"));  //write the link on the page followed by a br
//    incol=incol+1                        // add to count in column
//    if (incol > collength) {
//      document.write ("</td><td valign=top>");  // start a new column
//      incol=1                            // reset the column count
//    }
    }
  }
//----function to format month header and set switch to indicate if month is to be printed
//------fmo is the month, fyr is the year
function smonth(fmo,fyr)
  {
   thiskeymo = (fyr*12)+fmo; //--calculate the key month
   var moswitch = "N";  //-- initialize the switch to N
   var lastmonth = keymonth + 6
   if (thiskeymo >= keymonth && thiskeymo <= lastmonth )  //-- month must be = or greater than current month and less than or equal to cur month +6
     {
      var moline = "<tr><td colspan=3 align ='center'><h2>"; //--build month cell
      moline = moline+months[fmo];  // put in the name of the month
      var hyr = fyr+2000 //-- calculate the real year
      moline = moline+" - "+hyr; //-- add it to the line
      moline = moline+"</h2></td></tr>";  //-- close out the cell
      document.write(moline); //--write the line
      moswitch = "Y"; //--signal to print the month
     }
   return moswitch;
  }
//==this function retained for compatability
function venlink(fven)
  {
    outstring = getvlink(fven,"<li>","");
    document.write(outstring);
   }
//----->
