User:Kakurady/Convention map script

From WikiFur, the furry encyclopedia.
Jump to: navigation, search
// This powers Kakurady's copy of the map of active conventions. You probably want to edit this one instead.

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_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_OTHERS = 4;

//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 < 32);
}
function is_in_oceania(lat, lng){
    return (lat > -50 && lat < -5 && 
                lng > 110 && lng < 180);
}
var is_phone = false;
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', 'Place name<br>Street<br>City, State Code<br>Country', 'Phone Number', 'Mon[th] 1-3 20XX', attendance);
addLocation(-24.097951,-48.371558, 'Abando', 'abando.com.br', 'São Roque, São Paulo<br>Brazil', '', 'Feb 9-12 2013', 50);
//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(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', 'Jul 4-7 2013', '5179');
addLocation(52.597652, 13.22226, 'BerliCon', 'www.berlicon.org', 'Zeltlagerplatz e.V.<br>Rallenweg 4,13505 Berlin-Heiligensee<br>Germany', '', 'Jun 21-24 2012', 35);
//addLocation(61.599498,   9.750860, 'CabinCon', 'swandog.livejournal.com', 'Vinstra<br>Norway', '');//not on list, website is private
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(33.679673,-117.852488, 'Califur', 'califur.com', 'Irvine Marriott<br>18000 Von Karman Avenue<br>Irvine, California, 92614<br>USA', '+1 (949) 553-0100', 'Jun 1-3 2012', 919);
addLocation(43.721056,-121.291552, 'Campfire Tails', 'campfiretails.com', 'Ogden Group Camp C<br>Paulina Lake<br>La Pine, Oregon<br>USA', '', 'Aug 2-6 2012', 100);
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(50.176635,  14.355700, 'ČeSFuR', 'www.cesfur.org', 'Hotel Vltava<br>250 68 Rez u Prahy<br>Czech Republic', '+420 220 940 759', 'Jul 5-8 2012', 86);
addLocation(50.94149, 6.94651, 'Cologne Furdance', 'www.cologne-cfd.de', 'Zeughaus24, Zeughausstraße 24, 50667 Köln, Germany', '', 'Nov 10 2012'); //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', 'Jul 27-29 2012', 251);
addLocation(53.415679,	-2.247281, 'ConFuzzled', 'confuzzled.org.uk', 'Britannia Country House Hotel<br>Palatine Road<br>Didsbury<br>Manchester M20 2WG<br>England', 'N/A', 'May 25-28 2012', 725);
addLocation(41.80347,-88.120222, 'Duckon', 'www.duckon.org', 'Naperville Holiday Inn Select<br>1801 Naper Blvd<br>Naperville, IL 60563<br>United States', '', 'Jun 1-3 2012');
addLocation(51.283333, 11.566667, 'EAST', 'www.east-con.de.vu', '', '', 'Sep 27-30');
addLocation(28.33704,-81.587777, 'Elliott\'s Live Events', 'ele.furryhost.com', 'Radisson Resort Worldgate<br>3011 Maingate Lane, Kissimmee, FL 34747, United States','', "Year-round", 215);//May21-23, Aug7-8, Oct30-31
addLocation(50.616714,  10.723858, 'Eurofurence', 'eurofurence.org', 'Ringberg Resort Hotel<br>Ringberg 10<br>D-98527 Suhl<br>Germany', '+49 36 81/3 89-0', 'Aug 29-Sep 2 2012', 1066);
addLocation(40.703546, -74.184279, 'FA: United', 'faunited.org', 'Hanover Marriott<br>1401 Rt 10 E<br>Whippany, NJ 07981<br>USA', '+1 (973) 538 8811 ', 'Aug 17-19 2012', 531);
addLocation(45.880449, -78.564606, 'Feral!', 'campferal.org', 'Camp Arowhon<br>Algonquin Park, Ontario P1H 2G6<br>Canada', '+1 (705) 633-5651', 'Aug 24-28 2012', 94);
addLocation(62.02209, 30.0185, 'FinFur', 'ffsc.finfur.net', '', '', 'Jul 11-15');
addLocation(-38.625454,176.090927, 'FurcoNZ', 'www.furconz.org.nz', 'Kiwanis and Huia Lodges, Huia<b>Waitakere Ranges Regional Park<br>Auckland<br>New Zealand', '', 'Dec 14-17 2012', 50);
addLocation(-28.00041, 153.4264, 'FurDU', 'www.furrydownunder.com', 'Vibe Hotel Gold Coast<br>42 Ferny Avenue,<br>Surfers Paradise, QLD 4217<br>Australia', '', 'Apr 27-29 2012', 246);
addLocation(53.541723, -113.625262, 'Fur-eh!', 'fureh.ca', 'Hilton Garden Inn<br>17610 Stony Plain Road<br>Edmonton, Alberta, T5S 1A2<br>Canada', '+1 (780) 443-2233', 'May 4-6 2012', 200);
addLocation(41.542706, -72.970258, 'FurFright', 'furfright.org', 'Crowne Plaza Cromwell<br>100 Berlin Road<br>Cromwell, CT 06416<br>USA', '+1 (888) 233-9527', 'Oct 26-28 2012', 1485);
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', 'Oct 7-9 2012');
addLocation(39.983333, -82.983333, 'Furlaxation', 'furlaxation.org', '', '', 'Sept 28-30 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 29 2011', 148);
addLocation(43.689551, -79.586356, '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 8-10 2013', 651);
addLocation(42.441891, -83.434789, 'Furry Connection North', 'furryconnectionnorth.com', 'Shearton Detroit Novi<br>21111 Haggerty Road<br>Novi, Michigan 48375<br>USA', '+1 (248) 349-4000', 'Apr 13-15 2012', 1179);
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', 'Dec 2-7 2012', 24);
addLocation(32.9455, -96.8398, 'Furry Fiesta', 'www.furryfiesta.org', 'Crowne Plaza Hotel<br>14315 Midway Road<br>Addison, Texas 75001<br>USA','+1 (972) 980-8877', 'Feb 22-24 2013', 1210);
addLocation(33.626091, -84.451776, 'Furry Weekend Atlanta', 'furryweekend.com', 'Westin Peachtree Plaza<br>210 Peachtree St<br>Atlanta, GA 30303<br>USA', '+1 (404) 659-1400', 'Mar 14-17 2012', 1902);
addLocation(51.40328, 5.95940, 'Furs on Fire', 'www.fursonfire.eu', 'Evertsoord, The Netherlands', '', 'Dec 29-Jan 1 2013');
addLocation(52.588333, 14.65, 'Furstock', 'www.polfurs.org', '', '', 'Aug 4-6 2011');
addLocation(57.05, 9.916667, 'Furtastic', 'www.furtastic.dk', 'Denmark', '', 'Jul 2012?');
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 17-21 2013', 3021);
addLocation(51.388923,-115.784912, 'Furthest North', 'furthestnorth.ca', 'Deer Creek Provincial Recreation Area<br>Alberta<br>Canada', '+1 (403) 637-2229', 'Aug 3-6 2012', 63);
addLocation(51.93180, 19.407, 'Futrzakon', 'www.futrzakon.org', 'Municipal Cultural Center<br>95-001 Dzierżązna<br>Poland', '42 717 84 66', 'Aug 8-11 2012', 67);
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 15-18 2012');//
//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', '030-261030-0', 'Oct 11-14 2012', 20);//Invite only
addLocation(49.616848,   8.826463, 'H-Con', 'h-con.afc-group.org', 'Gerhart-Hauptmann-Haus<br>Außerhalb 1-3<br>64689 Grasellenbach-Scharbach<br>Germany', '+49 06 2 07/1 22-1', 'Oct 3-7 2012');
addLocation(49.26716,-123.010021, 'Howloween', 'howloween.org', 'Burnaby Executive Hotel<br>4201 Lougheed Highway<br>Burnaby, BC<br>Canada', '', '5-6 Nov 2011', 151);
addLocation(39.768971, -86.160601, 'IndyFurCon', 'indyfurcon.com', 'Sheraton at Keystone Crossing<br>8787 Keystone Crossing<br>Indianapolis, IN 46240<br>USA', '+1 (317) 846-2700', 'Aug 10-12 2012', 369);
addLocation(35.694742, 139.816679, 'Kemocon', 'www.kemocon.com', 'Sumida Industrial Centre<br>〒130-0022<br>Sumida, Tokyo<br>Japan', '', 'Nov 19 2011', 400);
addLocation(47.336284,  12.855555, 'Lakeside Furs', 'lakesidefurs.at', 'Zell am See<br>Talstr. 159, 5700 Thumersbach<br>Austria', '+43 (0)6542/73734', 'Aug 8-11 2012', 20);
addLocation(28.333938, -81.587638, 'Megaplex', 'megaplexcon.org', 'Worldgate Resort Hotel<br>3011 Maingate Lane<br>Kissimmee, FL 34747-2302<br>USA', '+1 (866) 705-7676', 'Jul 27-29 2012', 553);
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', 'Aug 31-Sep 2 2012', 546);
addLocation(50.825484,   7.887068, 'Mephit Mini Con', 'mmc.furcon.de', 'Freusburg, Seigen<br>Germany', '', 'May 9-12 2013', 200);
addLocation(-37.80541, 144.963291, 'MiDFur', 'www.midfur.com.au', 'Arrow on Swanston<br>488 Swanston Street<br>Carlton, VIC<br>Australia', '(613) 9225 9000', 'Dec 4-8 2012', 372);
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 16-18 2012', 2600);
addLocation(40.105846, -83.017244, 'Morphicon', 'morphicon.org', 'Holiday Inn Columbus-Worthington<br>7007 N. High Street<br>Worthington, Ohio 43085<br>USA', '+1 (614) 436-0700', 'May 3-6 2012', 275);
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 30-Jan 1 2011', 146) // Was replaced by Furstivus in 2012, but planned to resume for 2013
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 17-22 2012', 300);
addLocation(-31.952222, 115.858889, 'Perthfur Gathering', 'gathering.perthfurs.net', 'Perth, Western Australia', '', 'Aug 13 2011', 76);//"3rd qtr, 2010"
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 27-30 2012', 1424);
addLocation(-27.467778, 153.027778, 'RivFur', 'www.rivfur.org', 'Brisbane, Queensland, Australia', '', 'June 29-Jul 2 2012', 50);
addLocation(34.6701,  -86.577759, 'Rocket City FurMeet', 'rcfm.net', 'Hilton Garden Inn Huntsville South<br>301 Boulevard South SW<br>Huntsville, Alabama 35802<br>USA', '+1 (256) 881-4170', 'May 25-27 2012', 302);
addLocation(39.762235,-104.900293, 'Rocky Mountain Fur Con', 'rockymountainfurcon.org', 'Doubletree Hotel Denver<br>3203 Quebec Street<br>Denver, Colorado 80207<br>USA', '+1 (303) 321-3333', 'Aug 10-12 2012', 643);
addLocation(55.734529,  36.882262, 'Rusfurrence', 'rusfurrence.ru', 'РАН "Звенигородский" (RAS "Zvenigorodsky")<br>Звенигород (Zvenigorod), Moscow<br>Russian Federation', '', 'Jan 31-Feb 5 2012', 190);
addLocation(57.478307, -4.22672, 'ScotiaCon', 'www.scotiacon.com', 'Mercure Inverness Hotel<br>Church Street<br>Inverness, IV1 1QY<br>Inverness-shire, United Kingdom', '', 'Jul 27-30 2012', 123);
addLocation(-33.932, 25.571, 'South Afrifur meet', 'forum.zafur.co.za/viewtopic.php?f=53&t=1330', '', '', 'Dec 2012?');
addLocation(50.456309, 30.504819, 'WUFF (UA Furence)', 'furry.org.ua/index.php?page=meetings', 'Kiev, Ukraine', '', '28 April-2 May 2012', 95)
addLocation(49.266323,-123.011509, 'VancouFur', 'vancoufur.ca', 'Executive Hotel & Conference Centre Burnaby<br>4201 Lougheed Hwy<br>Burnaby, British Columbia, V5C 3Y6<br>Canada', '', 'March 9–11 2012');//check date, no clue for 2013
addLocation(45.493191,-73.5736397, 'What The Fur', 'whatthefur.ca', 'The Days Hotel & Conference Centre of Montreal<br>1005 rue Guy, Montréal, QC H3H 2K4, Canada', '514-938-4611', 'May 2013?', 282);
addLocation(40.538786, -79.830565, 'Western Pennsylvania Furry Weekend', 'wpafw.org', 'Quality Inn Pittsburgh North<br>2801 Freeport Road<br>Pittsburgh, Pennsylvania 15238<br>USA', '+1 (412) 828-9400', 'Sep 28-30 2012', 116);
addLocation(35.042611, -95.317672, 'Wild Nights', 'wildnights.org', 'Robbers Cave State Park<br>Wilburton, Oklahoma 74578<br>USA', '+1 (918) 465-2565', 'Apr 25-29 2013', 122);
addLocation(47.405582,  12.040372, 'Zillercon', '', 'Wildschönau, Tyrol<br>Austria', '', 'Jan 21-28 2012', 40);
addLocation(50.773040,  15.311701, 'ZodiaCon', 'zodiacon.org', 'Hotel Emilka<br>Na Novině 401<br>468 61 Desná III<br>Czech Republic', '+420 483 300 335', 'May 2012?');


// 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_attendence(a,b){
	if (a.attendence){
		if (b.attendence){
			return b.attendence - a.attendence;
		} else {
			return -1;
		}
	} else {
		if (b.attendence){
			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("byattendence").onclick=function(){
	meets.sort(compare_attendence);
	refresh(function (meet){return meet.name + (meet.attendence?" ("+meet.attendence+")":"");});
	}

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 = "All events ("+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 = "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_OTHERS:
            filter_func = function(lat, lng){
                return !(is_in_na(lat, lng)) && 
                            !(is_in_eu(lat, lng)) && 
                            !(is_in_oceania(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="http://en.wikifur.com/w/index.php?title=User:Kakurady/Convention_map_script&action=edit">Edit data on WikiFur</a> or <a href="http://en.wikifur.com/wiki/User_talk:Kakurady/Convention_map_script">discuss</a>';
document.getElementById("side").appendChild(footnote);
} //load()

// convert textual dates into numbers for sorting
// Might benefit from also parsing years.
function getmonthvalue(s){
	if (!s) {return 4001;}

	//automatically generate these for i18n and l10n extensibility?
	x = /(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)(?: )?([0-9]*)/.exec(s);
	if (!x || !x[1]) return 4000;
	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
	return month * 100 + day;
}

//returns the text to be displayed in info window
function getLocationHTML(name, url, address, tel, date, attendence) {
  return '<p><b><a href="http://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:'') +
	(attendence? " Past atnd. "+ attendence:"") +
	"</p>";

}

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

//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
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
        markerOpts = {
            position: new google.maps.LatLng(a.lat, a.lng),
            map: map,
            title: name
        }
        a.marker = new google.maps.Marker(markerOpts);
        fn =  function() {
            infoWindow.setContent(getLocationHTML(a.name, a.url, a.address, a.tel, a.date, a.attendence));
            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 {
            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;
    }

}
//