Convention map script

From WikiFur
Jump to: navigation, search

// This powers the map of active conventions. Edit events in the "Add map points" section below.

// To get latitude and longitude, find the target on Google Maps, then click the cog and Share (or check the URL) and copy the first two numbers after the '@' (including the decimal bits).

// Reload the map to check it works after you edit! If there's an apostrophe in a name or location, put a backslash (\) in front of it.

var map = null;
var infoWindow = null;
var meets = [];

// number of conventions in different areas, displayed in drop down
var count = 0;
var count_na = 0;
var count_eu = 0; 
var count_oceania = 0;
var count_japan = 0;
var count_others = 0;

//constants specifying which region is selected in the drop down
var FILT_ALL = 0;
var FILT_NA = 1;
var FILT_EU = 2;
var FILT_OCEANIA = 3;
var FILT_JAPAN = 4;
var FILT_OTHERS = 5;

//These functions are used to classify conventions into regions
//They are hacks; function only be accurate for existing data
function is_in_na(lat, lng){
    return (lat > 21 && lat < 75 && 
                lng > -144 && lng < -48);
}
function is_in_eu(lat, lng){
    return (lat > 36 && lat < 75 && 
                lng > -13 && lng < 40);
}
function is_in_oceania(lat, lng){
    return (lat > -50 && lat < -5 && 
                lng > 110 && lng < 180);
}
function is_in_japan(lat, lng){
    return (lat > 30 && lat < 40 && 
                lng > 130 && lng < 145);
}

var is_phone = false;

// Used later when creating markers
var redIcon = new google.maps.MarkerImage("//www.google.com/intl/en_us/mapfiles/ms/micons/red-dot.png");
var purpleIcon = new google.maps.MarkerImage("//www.google.com/intl/en_us/mapfiles/ms/micons/purple-dot.png");
var blueIcon = new google.maps.MarkerImage("//www.google.com/intl/en_us/mapfiles/ms/micons/blue-dot.png");
var yellowIcon = new google.maps.MarkerImage("//www.google.com/intl/en_us/mapfiles/ms/micons/yellow-dot.png");
var greenIcon = new google.maps.MarkerImage("//www.google.com/intl/en_us/mapfiles/ms/micons/green-dot.png");

function load() {
 var useragent = navigator.userAgent;
  is_phone = (useragent.indexOf('iPhone') != -1 || useragent.indexOf('Android') != -1) //TODO support other phones that support tel: protocol?
  
  if (useragent.indexOf('iPhone') != -1 || useragent.indexOf('Android') != -1) {
  //working around Android Browser having no scroll bar (Fennec/Firefox Mobile has no bar, but can scroll inside divs)
//document.getElementById("map").style.position="fixed"; //Google Maps will undo this
document.getElementById("side").style.height="auto";
document.getElementById("side").style.overflow="auto";

  }
 if (true) {

var mapNode = document.getElementById("map");

markers = [];

// Set initial position
// These values are assuming a 1280x800 monitor with 96dpi.
// it would be nice to scale this according to client area size
var centerLatLng = new google.maps.LatLng(40,-40);
var mapOpts = {
    zoom: 3,
    center: centerLatLng,
    mapTypeId: google.maps.MapTypeId.ROADMAP,
    streetViewControl: true
};
// creating map
map = new google.maps.Map(mapNode, mapOpts);
infoWindow = new google.maps.InfoWindow({});

// Add map points
// Format: addLocation(latitude, longitude, 'Name', 'website name [no http[s]://]', 'Place name<br>Street<br>City, State Code<br>Country', 'Phone Number', 'Mon[th] 1-3 20XX', attendance);
addLocation(29.5057863,   -98.5495143, 'Alamo City Furry Invasion', 'furryinvasion.org', 'San Antonio Marriott Northwest<br>3233 NW Loop 410<br>San Antonio, TX 78213<br>USA', '+1 (210) 377-3900', 'Oct 7-8 2017', null);
//addLocation(-37.891950,-57.832850, 'Animales Sueltos', 'furrycamp.com.ar', 'Camping \'La Serranita\'<br>barrio Colinas Verdes<br>Mar del Plata<br>Argentina', '', 41);
addLocation(30.3709252,   -81.4089605, 'Annual JaxFurs Spring Picnic', 'floridafurs.com', 'Kathryn Abbey Hanna Park<br>500 Wonderwood Dr<br>Jacksonville, FL 32233<br>USA', '(+1 (904) 249-4700', 'Apr 22 2017', 127);
addLocation(42.353979,   -71.105356, 'Anthro New England', 'www.anthronewengland.org', 'Hyatt Regency Cambridge, Overlooking Boston<br>575 Memorial Dr<br>Cambridge, MA<br>USA', '1(617) 492-1234', 'Jan 19-22 2017', 965);
addLocation(47.6067596,   -122.3332647, 'Anthro Northwest', 'www.anthronw.com', 'Renaissance Seattle Hotel<br>515 Madison St, Seattle, WA 98104<br>USA', '+1 (206) 583-0300', 'Nov 9-12 2017', null);
addLocation(40.769060, -111.897906, 'Anthro Weekend Utah', 'www.anthroweekendutah.org', 'Radisson Salt Lake City Downtown<br>215 S Temple, Salt Lake City, UT 84101<br>USA', '+1 (801) 531-7500', 'Oct 27-28 2017', null);
addLocation(40.105846,   -83.017244, 'AnthrOhio', 'anthrohio.org', 'Holiday Inn Columbus-Worthington<br>7007 N. High Street<br>Worthington, Ohio 43085<br>USA', '+1 (614) 436-0700', 'May 26-28 2017', 546);
addLocation(40.444334,   -79.995532, 'Anthrocon', 'www.anthrocon.org', 'Westin Convention Center Pittsburgh<br>1000 Penn Avenue<br>Pittsburgh, Pennsylvania 15222<br>USA', '+1 (412) 281-3700', 'Jun 29-Jul 2 2017', 7544);
addLocation(43.569967, -89.769743, 'AquatiFur', 'aquatifur.com', 'Kalahari Resorts Dells<br>1305 Kalahari Drive<br>Wisconsin Dells, WI 53965<br>USA', '+1 (608) 254-5466', 'Oct 20-22 2017', null);
addLocation(33.548246,  -112.046348, 'Arizona Fur Con', 'Arizonafurcon.com', 'Pointe Hilton Squaw Peak Resort<br>N 16th St<br>Phoenix, Arizona 85020<br>USA', '1(602) 997-2626', 'Sep 30-Oct 2 2016', 725);
addLocation(34.745865, -92.400043, 'ArkConsas', 'www.arkconsas.com', 'Embassy Suites Little Rock<br>11301 Financial Centre Pkwy<br>Little Rock, AR 72211<br>USA', '1 (501) 312-9000', 'Jan 5-9 2017', null);
//addLocation(52.597652,   13.22226, 'BerliCon', 'www.berlicon.org', 'Zeltlagerplatz e.V.<br>Rallenweg 4,13505 Berlin-Heiligensee<br>Germany', '', 'Jun 18-21 2015', 89);
addLocation(46.979122,   -112.526529, 'Big Sky Paw Camp', 'www.bigskycampcon.org', 'Aspen Grove Picnic Area<br>Lincoln, Montana 59639<br>USA', '', 'June 23-25 2017', 40);
addLocation(39.523177,   -119.78106, 'Biggest Little Fur Con', 'www.biggestlittlefurcon.org', 'Grand Sierra Resort<br>2500 East 2nd Street<br>Reno, Nevada 89595<br>USA', '+1 (77) YEAH-BLFC', 'May 12-15 2016', 5138);
addLocation(-23.970691,  -46.329962, 'Brasil FurFest', 'brasilfurfest.com.br', 'Hotel Mercure Santos<br>Av. Washington Luiz, 565<br>Santos (SP)<br>Brazil', '','Aug 17-19 2018', 287);
//addLocation(61.599498,   9.750860, 'CabinCon', 'swandog.livejournal.com', 'Vinstra<br>Norway', '');//not on list, website is private
addLocation(34.080577,  -117.762728, 'Califur', 'califur.com', 'Sheraton Fairplex Hotel & Conference Center<br>601 W McKinley Ave<br>Pomona, CA 91768<br>USA', '', 'Jun 3-5 2016', 1317);
addLocation(43.721056,  -121.291552, 'Campfire Tails', 'campfiretails.org', 'Ogden Group Camp C<br>Paulina Lake<br>La Pine, Oregon<br>USA', '', 'Aug 4-8 2016', 143);
addLocation(49.381977,   -121.446555, 'CampFur', 'campfur.ca', 'Near Hope<br>Hope, BC V0X 1L0<br>Canada', '', 'Jun 16-19 2017', null);
addLocation(45.4198698, -75.6989379, 'CanFURence', 'www.canfurence.ca', '185 Slater Street<br>Ottawa ON  K1P OC8<br>Canada', '+1 844-258-6882', 'Nov 10-12 2017', 322);
//addLocation(39.077092, -74.830348, 'Cape May Fur Meet', 'capemayfurmeet.com', 'Middle Township Elementary School #2<br>101 West Pacific Ave, Cape May Court House<br>Middle, New Jersey 08210<br>USA', '', 'May 19-20 2012', 3);
//addLocation(44.858188, -93.221054, 'Cat Days', 'www.mnfurs.org/cat-days', 'Crowne Plaza Hotel and Suites<br>Minneapolis International Airport<br>Appletree Square<br>Bloomington, MN 55425<br>USA', '+1 877-859-5095', 'Aug 3-4 2012');
//addLocation(38.9439,     -95.3385, 'Central Midwest Furmeet', 'cmfurmeet.webs.com', ' Bloomington West Group Camp at Clinton Lake near Lawrence, Kansas', '', 'Sep 14-16 2012', 22);
addLocation(37.686355,   -97.342702, 'Central Plains Furcon', 'cpfurcon.com', 'Drury Plaza Hotel Broadview<br>400 West Douglas Ave<br>Wichita, KS 67202<br>USA', '', 'Sep 1-4 2016', 100)
addLocation(37.611267, -97.631684, 'Central Plains Fur Meet', 'www.centralplainsfurmeet.com', 'near Lake Afton<br>Goddard, KS 67052<br>USA', '', 'May 19-21 2017', null);
addLocation(49.638649,    15.298977, 'ČeSFuR', 'www.cesfur.org', 'Hotel Luna<br>Kouty 77<br>584 01 Kouty<br>Czech Republic', '', 'Jul 6-10 2016', 107);
//addLocation(23.061687, 113.296423, 'China National Furry Party', 'www.fb.com/CNFP2015', ', Guangzhou<br>China', '', 'Jul 8-19 2015', 40);
addLocation(50.935659,     6.965116, 'Cologne Furdance', 'www.crosscombined.de', 'Maritim Hotel, Heumarkt 20, 50667 Köln, Germany', '', 'Jul 30 2016', 201); //Colonge Fur-Dance, Germany, June/November
//addLocation(42.930358, -81.218609, 'Condition', 'www.conditionfurry.ca', 'Four Points Sheraton<br>1150 Wellington Road South<br>London, Ontario N6E 1M3<br>Canada', '+1 (519) 681-0600', 'Aug 1-3 2014', 251);
addLocation(-37.820007,  145.013429, 'ConFurgence', 'confurgence.com', 'Amora Hotel Riverwalk<br>649 Bridge Road<br>Richmond, Melbourne, Victoria, 3121<br>Australia', '+61-3-9027-2000', 'Jan 6-8 2017', 681);
addLocation(52.450713,    -1.715519, 'ConFuzzled', 'confuzzled.org.uk', 'Hilton Birmingham Metropole<br>National Exhibition Centre<br>Birmingham B40 1PP<br>United Kingdom', '+44 (0)121 780-4242', 'May 26-30 2017', 1451);
addLocation(39.771895, -104.806944, 'DenFur', 'www.denfur.co', 'Crowne Plaza Denver Airport Convention Center<br>15500 E 40th Ave<br>Denver, CO 80239<br>USA', '+1 (303) 371-9494', 'Aug 24-26 2018', null);
//addLocation(42.150821, -87.911611, 'Duckon', 'www.duckon.org', 'Westin Chicago North Shore<br>601 N. Milwaukee Avenue<br>Wheeling, IL 60090<br><br>United States', '+1 (847) 777-6500', 'Jun 19-21 2015');
addLocation(51.844531,    12.208828, 'EAST', 'www.east-convention.de.vu', 'DJH Jugendherberge<br>Ebertallee 151, 06846<br>Dessau-Roßlau<br>Germany', '+49 034743 8257', 'Jul 13-17 2016');
addLocation(28.33704,    -81.587777, 'Elliott\'s Live Events', 'elliottsliveevents.org', 'Radisson Resort Worldgate<br>3011 Maingate Lane, Kissimmee, FL 34747, United States','', "Year-round", 215);//May21-23, Aug7-8, Oct30-31
addLocation(30.475459,-87.201477, 'Emerald\'s Fur Summit', 'emeraldfurcon.org', 'Homewood Suites by Hilton Pensacola-Arpt<br>5049 Corporate Woods Dr, Pensacola, FL 32504, USA', '+1 (850) 474-3777', 'Apr 29 2017', 126);
addLocation(52.474897,    13.459467, 'Eurofurence', 'eurofurence.org', 'Estrel Hotel Berlin<br>Sonnenallee 225<br>12057 Berlin<br>Germany', '+49 (0) 3915949-0', 'Aug 17-21 2016', 2322);
//addLocation(37.247901, -93.259639, 'F3 Convention', 'www.f3con.com', 'Lamplighter Inn & Suites, North<br>2820 N Glenstone Ave<br>Springfield, MO 65803<br>USA', '+1 (417) 869-3900', 'Nov 20-23 2014', 55);
addLocation(38.960831,   -77.423238, 'FA: United', 'faunited.org', 'Hyatt Regency Dulles<br>2300 Dulles Corner Blvd.<br>Herndon, Virginia 20171<br>USA', '+1 703 713 1234', 'Aug 12-14 2016', 539);
addLocation(33.43743,    -86.726235, 'Fangcon', 'fangcon.org', 'Hilton Hotel Perimeter Park<br>8 Perimeter Park S<br>Birmingham, AL 35243<br>USA', '+1 (205) 967-2700', 'Oct 27-31 2016', 427);
addLocation(45.880449,   -78.564606, 'Feral!', 'campferal.org', 'Camp Arowhon<br>Algonquin Park, Ontario P1H 2G6<br>Canada', '+1 (705) 633-5651', 'Aug 25-29 2016', 94);
addLocation(60.412912,    25.038261, 'FinFur Animus', 'animus.finfur.net', 'Kokoushotelli Gustavelund, Tuusula, Finland', '', 'Jun 16-19 2016', 124);
//addLocation(62.02209,     30.0185, 'FinFur Summer Camp', 'ffsc.finfur.net', '', '', 'Jul 11-15 2012');
//addLocation(35.454262, 139.638556, 'Fullmoff', 'www.fullmoff.com', 'Yokohama World Porters<br>2-2-1 Shinko, Naka-ku, <br>Yokohama, Kanagawa <br>Japan', '', 'Oct 25 2014', 0);
addLocation(43.027227,   -88.108102, 'Fur Squared', 'www.fursquared.com', 'Sheraton Milwaukee Brookfield Hotel<br>375 S Moorland Rd<br>Brookfield, WI 53005<br>USA', '+1 (262) 364-1100', 'Feb 24-26 2017', 791);
addLocation(51.2764173,  -3.0125542, 'Furcation', 'furcation.org.uk', 'Sandy Glade Holiday Park<br>Brean Sands, Somerset<br>UK', '', 'Oct 14-17 2016', 0);
addLocation(44.150581, -89.164606, 'FURconsin', 'www.furconsin.com', 'near Little Hills Lake<br>Wild Rose, WI 54984<br>USA', 'N/A', 'Oct 12-16 2017', 28);
addLocation(-41.239835,  174.980063, 'FurcoNZ', 'www.furconz.org.nz', 'Brookfield Outdoor Education Centre<br>Wainuiomata<br>Wellington<br>New Zealand', '', 'Feb 5-8 2016', 50);
addLocation(-23.668839,  -46.577533, 'Furboliche', 'furboliche.com.br', 'Bomboliche Extra Anchieta<br>R. García Lorca, 301<br>São Bernardo do Campo (SP)<br>Brazil', '','Jan 20 2018', 261);
addLocation(-27.997818,  153.429297, 'FurDU', 'www.furdu.com', 'Outrigger Hotel Surfers Paradise<br>22 View Avenue,<br>Surfers Paradise, QLD 4217<br>Australia', '', 'May 27-29 2016', 490);
addLocation(53.5687483,-113.5238331, 'Fur-eh!', 'fureh.ca', 'Ramada Inn & Conference Center<br>11834 Kingsway Avenue<br>Edmonton, Alberta<br>Canada, T5G 3J5', '+1 (780) 454-5454', 'June 1-4 2017', 625);
addLocation(27.3354428,-82.575817, 'Furight Night', 'furightnight.weebly.com', 'Ken Thompson Park<br>1799 Ken Thompson Parkway<br>Sarasota, FL 34236<br>USA', '+1 (941) 735-4035', 'Oct 14 2017', null);
addLocation(46.183333, 11.266667, 'Furizon', 'www.furizon.net', 'Segonzano, TN 38047<br> Italy', '', 'June 1-4 2017', '')
addLocation(42.134573,   -72.6314187, 'Fur-Xoticon', 'www.fur-xoticon.org', 'Clarion Hotel & Aqua Lagoon Waterpark<br>1080 Riverdale St<br>West Springfield, MA 01089<br>USA', '+1 (413) 781-8750', 'May 26-28, 2017', null);
addLocation(-33.859972,  151.211111, 'FurJam', 'www.furjam.org', ' Forresters Hotel<br>336 Riley Street<br>Surry Hills NSW 2010<br>Australia', '(02) 9212 3035', 'Sep 16-18 2016', 227);
addLocation(45.582910,  -122.575732, 'Furlandia', 'furlandia.org', 'Sheraton Hotel at PDX Airport <br>8235 NE Airport Way<br>Portland, Oregon 97220<br>USA', '+1 (503) 281-2500', 'May 26-28 2017', 763);
//addLocation(39.983333, -82.983333, 'Furlaxation', 'furlaxation.org', 'Columbus, Ohio', '', 'Sep 12-14 2014', 241); //attendance for 2012
addLocation(28.542401, -81.347945, 'Furloween', 'www.furhold.org/furloween', 'Orlando Elks Lodge<br>12 North Primrose Dr.<br>Orlando, Florida 32803<br>USA', '+1 (407) 282-3900', 'Oct 22 2016', 188);
addLocation(43.6866,    -79.5893597, 'Furnal Equinox', 'furnalequinox.com', 'Sheraton Toronto Airport Hotel & Conference Centre<br>801 Dixon Road<br>Toronto, ON M9W 1J3<br>Canada', '+1 (416) 675-6100', 'Mar 17-19 2017', 1322);
addLocation(41.6042521, -72.7027335, 'Furpocalypse', 'furpocalypse.org', 'Radisson Hotel Cromwell<br>100 Berlin Road<br>Cromwell, CT 06416<br>USA', '+1 860-635-2000', 'Oct 27-29 2017', 1455);
addLocation(43.156351,   -77.610020, 'FurryCon', 'www.furrycon.com', 'Radisson Riverside Rochester<br>120 E Main st<br>Rochester, New York<br>USA', '+1 (585) 546-6400', 'Sept 15-18 2016', 294);
addLocation(40.091453,   -75.3716987, 'Furrydelphia', 'www.furrydelphia.com', 'DoubleTree by Hilton Hotel Philadelphia - Valley Forge<br>301 W Dekalb Pike, King of Prussia, PA 19406<br>USA', '+1 (610) 337-1200', 'Aug 17-20 2017', null);
addLocation(28.401971,   -80.618792, 'Furry Cruise', 'www.furrycruise.com', 'Royal Caribbean\'s <i>Freedom of the Seas</i><br>Port Canaveral, Florida<br>USA', '+1 (734) 340-4553', 'Nov 5-12 2016', 27);
addLocation(32.956751,  -96.8252737, 'Furry Fiesta', 'www.furryfiesta.org', 'Intercontinental Dallas Hotel<br>15201 Dallas Pkwy<br>Addison, Texas 75001<br>USA', '+1 (972) 386-6000', 'Mar 24-26 2017', 2820);
addLocation(1.2877475,  103.846800, 'Furry Lah', 'furrylah.com', 'Quarters Hostel<br>12 Circular Road<br>Singapore 049368', '+65 6438 5627', 'Nov 25-27 2016');
addLocation(44.971198,    -93.27774, 'Furry Migration', 'www.furrymigration.org', 'Hyatt Regency Minneapolis<br>1300 Nicollet Mall<br>Minneapolis, Minnesota,<br>USA, 55403', '+1 (612) 370-1234', 'Sept 9-11 2016', 701);
addLocation(41.7838208,   -72.5803353, 'Furry Picnic', 'www.furrypicnic.com', 'Wickham Park<br>1329 Middle Turnpike W<br>Manchester, CT 06040<br>USA', '+1 (860) 528-0856', 'Jun 3 2017', null);
addLocation(35.642936, -96.419021, 'Furry Retreat', 'www.furryretreat.com', 'Knight\'s Rest Retreat<br>37701 W 361st St S<br>Bristow, OK 74010<br>USA', 'N/A', 'Oct 20-22 2017', null);
addLocation(39.502173, -106.151042, 'Furry Ski Weekend', 'furryskiweekend.com', 'Copper Mountain Resort<br>209 Ten Mile Cir<br>Frisco, CO 80443<br>USA', '+1 (866) 841-2481', 'Feb 9-12 2017', null);
addLocation(32.9451,    -96.8401881, 'Furry Siesta', 'furrysiesta.com', 'Crowne Plaza – Addison<br>14315 Midway Road<br>Addison, TX 75001<br>USA', '+1 (972) 980-8877', 'Jul 15-16 2016', 306);
addLocation(33.761999,   -84.383352, 'Furry Weekend Atlanta', 'furryweekend.com', 'Atlanta Marriott Marquis<br>265 Peachtree Center Ave NE<br>Atlanta, GA 30303<br>USA', '+1 (404) 521-0000', 'Apr 6-9 2017', 3252);
addLocation(52.775556,     6.801771, 'Furry Weekend Holland', 'furryweekend.nl', 'Het Labyrint<br>Brink 9 7841 CE<br>Sleen<br>Netherlands', '', 'Mar 31-Apr 3 2017', 57);
//addLocation(51.40328,     5.95940, 'Furs on Fire', 'www.fursonfire.eu', 'Evertsoord, The Netherlands', '', 'Dec 29-Jan 1 2013', 66); //ended in 2013.
addLocation(37.036680,   -76.382842, 'FursonaCon', 'www.fursonacon.com', 'Hampton Roads Convention Center<br>1610 Coliseum Dr<br>Hampton, Virginia<br>USA', '+1 (757) 315-1610', 'Mar 18-20 2016');
addLocation(52.588333,        14.65, 'Furstock', 'www.polfurs.org', '', '', 'Jul 14-16 2016', 45);
addLocation(57.05,         9.916667, 'Furtastic', 'www.furtastic.dk', 'Sondrupvej 58<br>8350 Hundslund<br>Denmark', '', 'Jul 4-7 2016', 50);
addLocation(37.330294,  -121.888375, 'Further Confusion', 'furtherconfusion.org', 'San Jose Mariott<br>301 South Market Street<br>San Jose, CA 95113<br>USA', '+1 408-280-1300', 'Jan 12-16 2017', 3536);
addLocation(53.509966,  -118.006813, 'Furthest North', 'furthestnorth.ca', 'Wildhay Group Campground<br>north of Hinton<br>Canada', '+1 (403) 637-2229', 'Sept 2-5 2016', 63);
addLocation(3.104127, 101.640800, 'Furum', 'furum.org', 'Hotel Armada<br> Lot 6 <br> Lorong Utara C <br>Section 52<br> 46200 Petaling Jaya Selangor <br>Malaysia', '+60 3-7954 6888', 'Dec 9-10 2017');
//addLocation(53.407281,  -2.989201, 'FurVention', 'furvention.org.uk', 'Aloft Liverpool<br>1 North John Street<br>Liverpool, L2 5QW<br>United Kingdom', '+44 151 294 3970', '22-24 Jan 2016', 64);
//addLocation(35.559328,   139.723602, 'Fur-st', 'fur-st.com', '志ら井<br>1 Chome-20-28 Minamikamata<br>Ota, Tokyo<br>Japan', '', 'Oct 18 2014', 144);
addLocation(39.283286,   -84.466442, 'Fur Reality', 'www.furreality.org', 'Atrium Hotel<br>30 Tri-County Parkway<br>Cincinnati, OH 45246<br>USA', '513 771 7171', 'Oct 7-9 2016', 382);
addLocation(39.273020, -84.438956, 'Fur Reality New Year\'s Eve Event', 'www.furreality.org', 'Hilton Garden Inn Cincinnati/Sharonville<br>11149 Dowlin Dr<br>Cincinnati, OH 45241<br>USA', '(513) 772-2837', 'Dec 31, 2016-Jan 1, 2017', null);
addLocation(38.930864,   -77.245601, 'Fur the \'More', 'furthemore.org', 'Sheraton Premiere at Tysons Corner<br>8661 Leesburg Pike<br>Vienna, VA<br>USA', '+1 (410) 785-7000', 'Apr 28-30 2017', 990);
addLocation(20.688831, -103.330578, 'Furmeet Guadalajara', 'vidafur.byethost8.com/furmeet', 'Centro Cultural Luis Paez Brotchíe<br>Centro Médico 208<br>Independencia Oriente<br>44340 Guadalajara, Jalisco<br>Mexico', '+52 33 1201 8728', 'Aug 4-6 2017', null);
addLocation(40.294208,        -3.796594, 'Furrnion', 'furrnion.org', 'Hotel Las Provincias<br>C/Zaragoza, 2<br>28941 Fuenlabrada (Madrid)<br>Spain', '+34 607654483', 'Jan 27-29 2017', 0);
addLocation(19.435967, -99.151094, 'Furry Summer Mexico', 'facebook.com/FurrySummer', 'Centro de Espectáculos Plaza<br>Avenida de la República 127-A<br>Cuauhtémoc, Tabacalera, 06030 Ciudad de México, CDMX<br>Mexico', '+52 55 5514 2565', 'Jul 29-30 2017', null);
addLocation(51.93180,        19.407, 'Futerkon', 'futerkon.pl', 'Municipal Cultural Center<br>95-001 Dzierżązna<br>Poland', '42 717 84 66', 'Aug 10-14 2016', 93);
//addLocation(49.8954237,  5.080949, 'Fuzzcon', 'fuzzcon.be', 'Au pays de mon pere<br>Rue des Combattants 1<br>6850 Paliseul<br>Belgium', '', 'Aug 22-25 2013', 14);
addLocation(38.6329283,  -90.184827, 'Gateway Furmeet', 'gatewayfurmeet.org', 'Lumière Place Casino and Hotels<br>999 N 2nd St<br>St. Louis, Missouri 63119<br>USA', '+1 (314) 881-7777', 'May 13-15 2016', 223);
addLocation(54.358288,    18.621243, 'Gdakon', 'gdakon.org', 'Amber Hotel<br>Gdańsk<br>Poland', '', 'March 1-5 2017', 252);
addLocation(42.774481, -86.079661, 'Great Lakes Fur Con', 'greatlakesfurcon.com', 'DoubleTree by Hilton Hotel Holland<br>650 E 24th St<br>Holland, MI 49423<br>USA', '+1 (616) 394-0111', 'May 26-28 2017', 308);
addLocation(47.35016,       7.76123, 'Golden Leaves Con', 'glc.furry.ch', 'Baselbieter Chinderhus<br>Bachtalenstrasse 10<br>4438 Langenbruck<br>Switzerland', '062 390 12 24', 'Nov 3-6 2016');//
//addLocation(52.505369,  13.353882, 'Herbstcon', 'herbstcon.de', 'Sozialistische Jugend Deutschlands – Die Falken<br>Haus am Lützowplatz<br>Lützowplatz 9<br>10785 Berlin<br>Germany', '+49 030-261030-0', 'Oct 11-14 2012', 20);//Invite only
addLocation(49.616848,     8.826463, 'H-Con', 'h-con.org', 'Petershof<br>Talweg 5<br>64711 Erbach/Erbuch<br>Germany', '+49 06 2 07/1 22-1', 'Sep 28-Oct 2 2016', 64);
addLocation(49.26716,   -123.010021, 'Howloween', 'howloween.ca', 'Burnaby Executive Hotel<br>4201 Lougheed Highway<br>Burnaby, BC<br>Canada', '', '2016', 278);
//addLocation(38.866200,  -0.406165, 'Ibercamp', 'ibercamp.es', 'Salem, Valencia<br>Spain', '', 'Oct 11-13 2013');
//addLocation(25.034847,   121.546979, 'Infurnity', 'infurnity.com', 'SMAJO House<br>Ln. 279, Sec. 1, Fuxing S. Rd.<br>Da’an Dist., Taipei', '', 'Oct 31 2015', 62); // first Taiwan furcon
addLocation(39.797248,   -86.041109, 'IndyFurCon', 'indyfurcon.com', 'Indianapolis Marriott East<br>7202 E 21st St<br>Indianapolis, IN 46219<br>USA', '+1 (317) 352-1231', 'Aug 26-28 2016', 735);
addLocation(33.643368,  -112.119356, 'Itty Bitty FurCon', 'ittybittyfurcon.com', 'La Princesa<br>2710 W Bell Road #1205<br>Phoenix, AZ 85053<br>USA', '+1 (602) 518-5990', 'Jul 17 2016', 0);
addLocation(34.743463,   137.370965, 'Japan Meeting of Furries', 'www.j-mof.org', 'Loisir Hotel Toyohashi<br>141 Fujisawacho<br>Toyohashi, Aichi<br>Japan', '', 'Jan 6-8 2017', 588);
addLocation(51.505072,   -2.536662, 'Just Fur The Weekend', 'http://justfurtheweekend.org.uk/', 'Holiday Inn Filton <br> Filton Road<br> Winterbourne<br>Bristol', '', 'April 14-16 2017', 319);
addLocation(39.114216, -94.626925, 'KCFur Howl', 'www.kchowl.com', 'near Kansas City Metro Area<br>Kansas City, MO<br>USA', 'N/A', 'Oct 29 2016', null);
addLocation(25.00814,     121.53604, 'Kemono & Jingai Only 2', 'jk2016.furry.tw', 'Jhongjheng Hall<br>88 Tingzhou Road Section 4<br>Wenshan District<br>Taipei City 116<br>Taiwan<br>116台北市文山區汀州路四段88號', '', 'Jul 16 2016', 0); // The name of the hall at http://en.ntnu.edu.tw/gongguan-campus.php#tab-1 seems to be in Tongyong Pinyin, while the street address seems to be in Hanyu Pinyin?
//addLocation(35.3334755, 139.9891955, 'Kemocon', 'www.kemocon.com', 'Kasuza Akademia Hall<br>2 Chome-3-9 Kazusakamatari<br>Kisarazu, Chiba Prefecture<br>Japan', '', 'Nov 21-22 2015', 420);
addLocation(34.985692,   138.417148, 'Kemono Square', 'kemono-square.com', 'Shizuoka Convention & Arts Center "Granship" 7F<br>79-4 Ikeda, Suruga Ward, Shizuoka City<br>Japan', '', 'Jun 4 2016', 107);
//addLocation(35.654685, 139.761096, 'Kemoket', 'kemoket.com', 'Tokyo Metropolitan Industrial Trade Center Hamamastucho-kan<br>1 Chome-7-8 Kaigan<br>Minato, Tokyo<br>Japan', '', 'Apr 29 2014', 0);  //259 vendors from 246 circles confirmed for 2014
//addLocation(34.6693,   135.476103, 'Kemoket', 'kemoket.com', 'Sky Hall D Block<br>Osaka Dome<br>Osaka<br>Japan', '', 'Oct 13 2014', 0);
//addLocation(35.1584991, 136.9298391, 'Kigukemo', 'kigukemo.jp', 'Nagoya Trade & Industry Center <br>2-6-3 Fukiage<br>Chikusa Ward, Nagoya, Aichi<br>Japan ', 'Phone Number', 'Aug 29, 2015', 141); //only attendees signed up from Twipla
addLocation(41.845931,   -87.942533, 'LAFF New Year\'s Eve', 'newyearsevecon.com', 'Residence Inn Oak Brook<br>790 Jorie Boulevard<br>Oak Brook, IL 60523<br>USA', '+1 (630) 571-1200', 'Dec 31 2016-Jan 1 2017', 87);
addLocation(47.336284,    12.855555, 'Lakeside Furs', 'lakesidefurs.at', 'Zell am See<br>Talstr. 159, 5700 Thumersbach<br>Austria', '+43 (0)6542/73734', 'Jul 9-16 2016', 40);
addLocation(28.418215,   -81.465091, 'Megaplex', 'megaplexcon.org', 'DoubleTree by Hilton Orlando at SeaWorld<br>10100 International Drive<br>Orlando, Florida, 32821<br>USA', '+1 (407) 352-1100', 'Aug 4-Aug 6 2017', 1860);
addLocation(34.966572,   -89.791608, 'Mephit Furmeet', 'mephitfurmeet.org', 'Whispering Woods Hotel & Conference Center<br>11200 Goodman Rd<br>Olive Branch, MS 38654-4212<br>USA', '+1 (662) 895-2941', 'Sep 2-Sep 4 2016', 432);
addLocation(50.825484,     7.887068, 'Mephit Mini Con', 'mmc.furcon.eu', 'Freusburg, Seigen<br>Germany', '', 'May 12-16 2016', 200);
//addLocation(35.656854,139.7351909, 'Metamore Generation V', 'www.metamor.jp', 'Village<br>B1F, Fukao Bldg. 1-4-5 Azabu-juban, Minato-ku, Tokyo, Japan', '', 'Oct 5 2013', 0);
addLocation(42.322128, -71.646046, 'Micro Fur Con', 'microfurcon.com', 'First Parish Church Unitarian<br>40 Church St<br>Northborough, MA 01532<br>USA', '+1 (508) 393-6422', 'Apr 1 2017', 150);
addLocation(41.981284,   -87.859078, 'Midwest FurFest', 'furfest.org', 'Hyatt Regency O\'Hare<br>9300 Bryn Mawr Avenue<br>Rosemont, Illinois 60018<br>USA', '+1 (847) 696-1234', 'Nov 30-Dec 3 2017', 7075);
addLocation(45.017750, -93.143750, 'MNFurs Spring Picnic', 'mnfurs.org', 'Central Park - Lexington<br>2540 Lexington Avenue<br>Roseville, MN 55113<br>USA', '', 'May 20 2017', null);
//addLocation(35.754914,139.7366338, 'Mofukai', 'twipla.jp/events/84157', '北とぴあ 14F Sky Hall<br>1 Chome-11 Oji Kita Tokyo <br>Japan', '', 'May 2 2015', 66); //only attendees signed up from Twipla - 6 people over venue capacity
addLocation(13.705699,   100.604295, 'Morph Parade', 'fb.me/MOFU.PARADE', 'KV Mansion<br>90 สุขุมวิท 81 บางจาก<br>[Near BTS On-Nut station]<br>Bangkok 10260<br>Thailand', '+66 2-33 222 11', 'Oct 29 2016');
addLocation(42.443047,   -83.435667, 'Motor City Furry Con', 'motorcityfurrycon.org', '21111 Haggerty Road<br>Novi, MI 48375<br>USA', '+1 (248) 349-4000', 'Apr 7-9 2017', 1028);
addLocation(39.65924,   -75.75286, 'New Year\'s Furry Ball', 'www.ticketderby.com/innerindex.php?eventid=3505', 'Embassy Suites Newark-Wilmington/South<br>854 S College Ave<br>Newark, DE 19713<br>USA', '(302) 368-8000', 'Dec 31 2015-Jan 1 2016', 211) 
addLocation(58.9143217,   17.953672, 'NordicFuzzCon', 'nordicfuzzcon.org', 'Utsikten Meetings Hotel<br>Nynäshamn<br>Sweden', '', 'Mar 9-12 2017', 513);
addLocation(18.454343, -66.090161, 'NorthAmeriCon', 'northamericon17.com', 'Sheraton Puerto Rico Hotel & Casino<br>200 Convention Blvd<br>San Juan, PR 00907<br>Puerto Rico', '+1 787-993-3500', 'Jul 6-9 2017', null);
addLocation(47.3680236,   -121.1057155, 'NorthWest CampCon', 'www.nwcampcon.com', 'Okanogan-Wenatchee National Forest<br>Wenatchee, WA 98807<br>USA', 'N/A', 'Jun 16-18 2017', null);
//addLocation(35.933888, -98.429604, 'Oklacon', 'oklacon.com', 'Roman Nose State Park<br>Rt 1 Box 2-2<br>Watonga, Oklahoma 73772<br>USA', '+1 (580) 623-4215', 'Oct 29-Nov 1 2014', 352);
addLocation(37.3718553,   -121.9248902, 'Pacific Anthropomorphics Weekend', 'www.pacanthro.org', 'DoubleTree by Hilton Hotel San Jose<br>2050 Gateway Pl, San Jose, CA 95110<br>USA', '+1 (408) 453-4000', 'Nov 4-7 2016', null);
addLocation(43.635466, -70.338801, 'Pine Fur Con', 'www.pinefurcon.org', 'DoubleTree by Hilton Hotel Portland<br>363 Maine Mall Rd<br>Portland, ME 04106<br>USA', '+1 (207) 775-6161', 'Apr 27-29 2018', null);
addLocation(-31.944444,  115.863842, 'FurWAG', 'furwag.com.au', 'Hotel Ibis Styles Perth<br>15 Robinson Avenue<br>Northbridge 6003<br>Western Australia', '+61 8 9328 0000', 'Sept 30-Oct 2 2016', 177);
//addLocation(47.444579,-122.293807, 'RainFurrest', 'rainfurrest.org', 'Hilton Seattle Airport<br>17620 International Boulevard<br>Seattle, WA 98188<br>USA', '+1 (206) 244-4800', 'Sep 22-25 2016', 2704);
addLocation(-27.467778,  153.027778, 'RivFur', 'www.southbankfurmeet.com/home/m/36617225/article/3714600', 'Brisbane, Queensland, Australia', '', 'Jul 29-31, 2016', 200);
//addLocation(39.762235,  -104.900293, 'Rocky Mountain Fur Con', 'rockymountainfurcon.org', 'Denver Marriott Tech Center<br>4900 South Syracuse Street<br>Denver, Colorado 80237<br>USA', '+1 (303) 779-1100', 'Aug 12-14 2016', 1670);
addLocation(56.050627,    36.823576, 'Rusfurence', 'rusfurence.ru', 'РАН "Авантель Клаб Истра" (RAS "Avantel Club Istra")<br>ЗИстринское Водохранилище (Istra Reservoir), Moscow<br>Russian Federation', '', 'Feb 1-5 2017', 286);
addLocation(57.478307,     -4.22672, 'ScotiaCon', 'scotiacon.co.uk', 'Mercure Inverness Hotel<br>Church Street<br>Inverness, IV1 1QY<br>Inverness-shire, United Kingdom', '', 'Nov 4-6 2016', 152);
addLocation(31.27268,     121.55447, 'Shanghai Furry Summer Festival', 'furryeventchina.top', 'Jinqianbao Hotel<br>2866 Yangshupu Rd<br>Shanghai, China<br>中国上海市杨树浦路2866号金钱豹大酒店', '', 'Jul 23 2016', null); // co-located with Shanghai Jingai Only 2016. At the Golden Leopard hotel. Website down for maintenance every day 3am-5am Beijing Time (3pm-5pm U.S./Canada Eastern Daylight Savings Time).
addLocation(33.7963444,   -117.7547691, 'SoCal FurBQ', 'twitter.com/SoCalFurBQ', 'Irvine Regional Pk<br>1 Irvine Park Rd<br> Orange, CA 92869<br>USA', '+1 (714) 973-6835', 'Sep 17 2016', null);
addLocation(-25.957300, 27.439744, 'South Afrifur', 'south-afrifur.co.za', 'Magalies Retreat<br>RN20 New Thorndale Road<br>Krugersdorp, NorthWest Province, 1791<br>South Africa', '+27 82 377 0219', 'Jul 14-17 2017', null);
//addLocation(-26.201,       28.046, 'South Afrifur meet', 'forum.zafur.co.za/viewtopic.php?f=53&t=1330', '', '', 'Dec 2012?', 0);
addLocation(49.278252,   -125.041257, 'Surfur', 'surfur.ca', 'Taylor Arm Provincial Park<br>Pacific Rim Hwy<br>Alberni-Clayoquot D, BC V0R 1W0<br>Canada', '+1 250-474-1336', 'Jul 7-11 2017', 81);
addLocation(35.836281, -78.672837, 'Tarpaw Furmeet', 'tarpawfurmeet.com', 'Hampton Inn & Suites Raleigh Crabtree Valley<br>3920 Arrow Drive<br>Raleigh, NC 27612<br>USA', '+1 (919) 881-7080', 'May 19-21 2017', 141);
addLocation(13.746076,   100.562432, 'Thai Tails', 'www.thaitails.net', 'Asok Towers<br>BLDG 219, Soi Sukhumvit 21, Asok Road<br>Klongtoey Nua, Wattana<br>Bangkok, Thailand 10110', '+66 2 120 9600', 'Jan 30 2016', 0);
addLocation(41.388786, -73.515143, 'Tiny Paws Con', 'www.tinypawscon.org', 'Crowne Plaza Danbury<br>18 Old Ridgebury Rd, Danbury, CT 06810<br>USA', '+1 (203) 794-0600', 'Sep 8-10 2017', null); 
//addLocation(40.769163,-111.897349, 'Unthrocon', 'www.unthrocon.org', ' Salt Lake City Radisson Hotel<br>215 W South Temple<br>Salt Lake City, Utah 84101<br>USA', '+1 (801) 531-7500', 'Oct 31-Nov 2 2014', 126);
addLocation(49.170696,-123.145162, 'VancouFur', 'vancoufur.org', 'Executive Airport Plaza Hotel Richmond<br>7311 Westminster Hwy<br>Richmond, British Columbia, V6X 1A3<br>Canada', '', 'Mar 9-12 2017', 810);
addLocation(45.499474,   -73.562801, 'What The Fur', 'whatthefur.ca', 'Delta Centre-Ville<br>777 University Street<br>Montreal, Quebec<br>H3C 3Z7, Canada', '+1 (514) 879-1370', 'May 20-22 2016', 439);
addLocation(40.4612,       -79.7509, 'Western Pennsylvania Furry Weekend', 'wpafw.org', ' North Park Lodge, N Ridge Dr<br>Allison Park, PA 15101<br>USA', '+1 (724) 327-0338', 'Oct 7-9 2016', 133);
addLocation(35.042611,   -95.317672, 'Wild Nights', 'wildnights.org', 'Robbers Cave State Park<br>Wilburton, Oklahoma 74578<br>USA', '+1 (918) 465-2565', 'Apr 21-26 2016', 190);
addLocation(49.891660, -97.194377, 'Wild Prairie Fur Con', 'wpfcon.ca', 'Canad Inns Destination Centre Polo Park<br>1405 St Matthews Ave<br>Winnipeg, MB R3G 3P7<br>Canada', '+1 204-775-8791', 'Aug 11-12 2018', null);
addLocation(37.783995, -122.410405, 'Wild Things', ' ', 'SF Citadel<br>181 Eddy St<br>San Francisco, CA 94102<br>USA', 'N/A', 'Feb 25 2017', null);
addLocation(50.456309,    30.504819, 'WUFF', 'wuff.org.ua', 'Hotel «Sofiyevsky Posad»<br>81/2 Kyivs\'ka Str., Sofiivs\'ka Borshchahivka<br>Kiev, Ukraine', '', 'May 4-8 2016', 160)
addLocation(44.148964,    12.464516, 'Zampacon', 'zampacon.org', 'Via Ragusa 20<br>Bellaria-Igea Marina (RN)<br>47814 <br>Italy', '', 'Sep 2-6 2016', 60);
addLocation(47.503095,    12.190969, 'Zillercon', '', 'Wörgl, Tyrol<br>Austria', '', 'Jan 23-30 2016', 40);
addLocation(50.773040,    15.311701, 'ZodiaCon', 'zodiacon.org', 'Vršovská Brána<br>Vršov 19<br>539 53 Horní Bradlo<br>Czech Republic', '+420 483 300 335', 'May 26-29 2016', 74);

// convert textual dates to numbers for sorting.
for(var i = 0, meet; meet = meets[i]; i++){
	meet.datev=(v=getmonthvalue(meet.date))?v:3000;
}

// adds or rearranges meets in the side bar.
function refresh(f){
	for(var i = 0, meet; meet = meets[i]; i++){
		addLocation1(meet, f);
	}
}

// comparison functions, those decide the order meetups are listed
function compare_name(a, b){
	return a.name?(b.name?a.name.localeCompare(b.name):-1):1;
}
function compare_date(a,b){
	var d = a.datev - b.datev;
	return (d == 0)? compare_name(a, b) : d;
}
function compare_attendance(a,b){
	if (a.attendance){
		if (b.attendance){
			return b.attendance - a.attendance;
		} else {
			return -1;
		}
	} else {
		if (b.attendance){
			return 1;
		} else {
			return compare_name(a,b);
		}		
	}
}
// assigning functionality to sort buttons
document.getElementById("bydate").onclick=function(){
	meets.sort(compare_date);
	refresh(function(meet){return meet.date?(meet.date + " " + meet.name):meet.name;});
	}
document.getElementById("byname").onclick=function(){
	meets.sort(compare_name);
	refresh();
	}
document.getElementById("byattendance").onclick=function(){
	meets.sort(compare_attendance);
	refresh(function (meet){return meet.name + (meet.attendance?" ("+meet.attendance+")":"");});
	}

meets.sort(function (a,b){
	return a.datev - b.datev;
	})
refresh(function(meet){return meet.date?(meet.date + " " + meet.name):meet.name;});

// add drop-down options
opt = document.createElement("option");
opt.innerHTML = "Everywhere ("+count+")";
opt.value = FILT_ALL;
opt.selected=true;

document.getElementById("filter").appendChild(opt);

opt = document.createElement("option");
opt.innerHTML = "North America ("+count_na+")";
opt.value = FILT_NA;

document.getElementById("filter").appendChild(opt);

opt = document.createElement("option");
opt.innerHTML = "Europe ("+count_eu+")";
opt.value = FILT_EU;

document.getElementById("filter").appendChild(opt);

opt = document.createElement("option");
opt.innerHTML = "Oceania ("+count_oceania+")";
opt.value = FILT_OCEANIA;

document.getElementById("filter").appendChild(opt);

opt = document.createElement("option");
opt.innerHTML = "Japan ("+count_japan+")";
opt.value = FILT_JAPAN;

document.getElementById("filter").appendChild(opt);

opt = document.createElement("option");
opt.innerHTML = "Rest of the World ("+count_others+")";
opt.value = FILT_OTHERS;

document.getElementById("filter").appendChild(opt);

document.getElementById("filter").onchange = function(){
    opts = document.getElementById("filter").firstChild;
    selection = 0;
    while(opts != null){
        if (opts.selected) {
            selection = opts.value;
        }
        opts = opts.nextSibling;
    }

    filter_func = null;
    switch(Number(selection)){
        case FILT_NA:
            filter_func = is_in_na; break;
        case FILT_EU:
            filter_func = is_in_eu; break;
        case FILT_OCEANIA:
            filter_func = is_in_oceania; break;
        case FILT_JAPAN:
            filter_func = is_in_japan; break;            
        case FILT_OTHERS:
            filter_func = function(lat, lng){
                return !(is_in_na(lat, lng)) && 
                            !(is_in_eu(lat, lng)) && 
                            !(is_in_oceania(lat, lng)) && 
                            !(is_in_japan(lat, lng))
                ;
            }
            break;
        case FILT_ALL:
        default:
            filter_func = function(lat, lng){return true;}
            break;
    }

    bounds = null;
    for(var i = 0, meet; meet = meets[i]; i++){

        //only show those that pass filter_func
        visible = filter_func(meet.lat, meet.lng);
        meet.marker.setVisible(visible);
        meet.li.style.display = visible ? "": "none";

        if (visible) {
            if (bounds){
                bounds.extend(meet.marker.getPosition());
            } else {
            pos = meet.marker.getPosition();
            bounds = new google.maps.LatLngBounds(pos, pos);
            }
        }
    }
    if (bounds) {map.fitBounds(bounds);} //zoom to include in the viewport all markers if there are any
}
} //if (true)
footnote = document.createElement("p");
footnote.innerHTML = '<a href="//pool.wikifur.com/w/index.php?title=Convention_map_script&action=edit">Edit data on WikiFur</a> or <a href="//pool.wikifur.com/wiki/Talk:Convention_map_script">discuss</a>';
document.getElementById("side").appendChild(footnote);
} //load()

// convert textual dates like "Jan 17 - Feb 2, 2014" into an integer like 20140117 for sorting
// should accept anything that looks like a date.
function getmonthvalue(s){
    "use strict";
    var x; 
    var v;
    var y;
    var day; 
    var month; 
    var year;
    
	if (!s) {return 200004001;}

	//automatically generate these for i18n and l10n extensibility?
	x = /(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)[A-Za-z]*(?: )?([0-9]*)/.exec(s);
	if (x && x[1]) {
	    day = (v=parseInt(x[2]))?v:0;
	    if (day > 1980) {day = 40;}
	
	    switch (x[1]){
		    case "Jan": month = 1; break;
		    case "Feb": month = 2; break;
		    case "Mar": month = 3; break;
		    case "Apr": month = 4; break;
		    case "May": month = 5; break;
		    case "Jun": month = 6; break;
		    case "Jul": month = 7; break;
		    case "Aug": month = 8; break;
		    case "Sep": month = 9; break;
		    case "Oct": month = 10; break;
		    case "Nov": month = 11; break;
		    case "Dec": month = 12; break;
		    default:	month = 20;
	    }//switch
	} else {
	    month = 40;
	    day = 0;
	} 
	
	y = /[0-9]{4}$/.exec(s);
	if (y) {
		year = (v=parseInt(y[0]))?v:0;
    	if (year > 9999) {year = 10000;}
	}

	return year * 10000 + month * 100 + day;
}

//returns the text to be displayed in info window
function getLocationHTML(name, url, address, tel, date, attendance) {
  return '<p><b><a href="//en.wikifur.com/wiki/' + name + '">' + name + '</a></b>' + 
	(url?('<br><a href="http://' + url + '">' + url + '</a>'):'') + '</p><p class="smaller">' +
	address +
	 (tel?
		('<br>Phone: ' + 
			(is_phone? 
				('<a href="tel:' + tel.replace(/\s/g, "") + '">' + tel + '</a>')
				:tel))
		:'') + 

	(date?'<br>'+date:'') +
	(attendance? " Past atnd. "+ attendance:"") +
	"</p>";

}

function addLocation(lat, lng, name, url, address, tel, date, attendance){
meets.push({'lat':lat, 'lng': lng, 'name':name, 'url': url, 'address': address, 'tel': tel, 'date':date, 'attendance': attendance});
}

//this is called to add markers as well as to sort markers.
//this takes advantage of the fact that when adding a child to a DOM node, if the child is already in the document, it is removed from its original location first.
//lat, lng, name, url, address, tel, date, attendance
function addLocation1(a, f) {
    if (!f) {f = function(meet){return meet.date? (meet.name + " " + meet.date) : meet.name;}};
    if (!a.marker || !a.li){

        //make the marker
        a.marker = new google.maps.Marker({
            position: new google.maps.LatLng(a.lat, a.lng),
            map: map,
            title: a.name,
            icon: (a.attendance >= 5000 ? greenIcon : (a.attendance >= 2500 ? yellowIcon : (a.attendance >= 1000 ? redIcon : (a.attendance >= 250 ? purpleIcon : blueIcon ) ) ) ),
            zIndex: a.attendance
        });
        fn =  function() {
            //if we can't see the marker, show it in the center
            if (!map.getBounds().contains(a.marker.getPosition())){
                map.panTo(a.marker.getPosition());
            }
            infoWindow.setContent(getLocationHTML(a.name, a.url, a.address, a.tel, a.date, a.attendance));
            infoWindow.open(map, a.marker);
        }
        google.maps.event.addListener(a.marker, "click",fn);
        
        link = document.createElement("A");
        link.innerHTML = f(a);
	    link.href = "#";
        link.onclick = fn;
        
        //clean up this on unload!
        a.li = document.createElement("LI");
        a.li.appendChild(link);

        count++;
        if      (is_in_na(a.lat, a.lng)){
            count_na++;
        } else if (is_in_eu(a.lat, a.lng)) {
            count_eu++;
        } else if (is_in_oceania(a.lat, a.lng)){
            count_oceania ++; 
        } else if (is_in_japan(a.lat, a.lng)) {
	    count_japan ++; 
        } else {
            count_others ++;
        }
    } else {
        //only change the label text
        a.li.firstChild.innerHTML = f(a);
    }
          //(re)insert the item into list
          document.getElementById("list").appendChild(a.li);

}

function unload(){
    for(var i = 0, meet; meet = meets[i]; i++){
	    meet.marker=null;
	    meet.li=null;
    }

}
//