
var showdates = new Array();

showdates[0] = {
	date:          "February 24",
	year:			"2007",
	day_of_week:   "Saturday",
	time:          "9:30 pm",
	title:		   "O'Connell's Irish Pub",
	location1:     "7207 Fegenbush Ln",
	location2:     "",
	location3:     "",
	link: 		   "",
	map:		   "http://www.mapquest.com/maps/map.adp?city=Louisville&state=KY&address=7207+Fegenbush+Ln&zip=40228-1507&country=us"
};

showdates[1] = {
	date:          "March 23",
	year:			"2007",
	day_of_week:   "Friday",
	time:          "",
	title:		   "WDRB Fox in the Morning (TV)",
	location1:     "",
	location2:     "",
	location3:     "",
	link: 		   "",
	map:		   ""
};

showdates[2] = {
	date:          "March 23",
	year:			"2007",
	day_of_week:   "Friday",
	time:          "10:00pm",
	title:		   "Hideaway Saloon",
	location1:     "1607 Bardstown Rd",
	location2:     "",
	location3:     "",
	link: 		   "",
	map:		   ""
};

showdates[3] = {
	date:          "March 30",
	year:			"2007",
	day_of_week:   "Friday",
	time:          "8:30pm",
	title:		   "Clifton's Pizza",
	location1:     "2230 Frankfort Ave",
	location2:     "",
	location3:     "",
	link: 		   "",
	map:		   ""
};

showdates[4] = {
	date:          "October 13",
	year:		   "2007",
	day_of_week:   "Saturday",
	time:          "",
	title:		   "River Heritage Bluegrass Festival",
	location1:     "Riverfront Park in Brandenburg, KY",
	location2:     "",
	location3:     "",
	link: 		   "http://www.meadereads.org/dynamicpage.asp?pid=1&id=66",
	map:		   ""
};


		
showdates[5] = {
	date:          "January 13",
	year:			"2007",
	day_of_week:   "Saturday",
	time:          "11:00pm",
	title:		   "O'Connell's Irish Pub",
	location1:     "",
	location2:     "",
	location3:     "",
	link: 		   "",
	map:		   ""
};

showdates[6] = {
	date:          "January 27",
	year:			"2007",
	day_of_week:   "Saturday",
	time:          "11:00pm",
	title:		   "Longshot's Tavern",
	location1:     "",
	location2:     "",
	location3:     "",
	link: 		   "",
	map:		   ""
};

showdates[7] = {
	date:          "May 19",
	year:			"2006",
	day_of_week:   "Saturday",
	time:          "11:00pm",
	title:		   "Private Event",
	location1:     "",
	location2:     "",
	location3:     "",
	link: 		   "",
	map:		   ""
};

showdates[8] = {
	date:          "June 1",
	year:			"2006",
	day_of_week:   "Thursday",
	time:          "11:00pm",
	title:		   "Rudyard Kipling",
	location1:     "",
	location2:     "",
	location3:     "",
	link: 		   "",
	map:		   ""
};

showdates[9] = {
	date:          "June 19",
	year:			"2006",
	day_of_week:   "Monday",
	time:          "11:00pm",
	title:		   "Private Event",
	location1:     "",
	location2:     "",
	location3:     "",
	link: 		   "",
	map:		   ""
};

showdates[10] = {
	date:          "August 4",
	year:			"2006",
	day_of_week:   "Friday",
	time:          "11:00pm",
	title:		   "Dark Star Tavern",
	location1:     "",
	location2:     "",
	location3:     "",
	link: 		   "",
	map:		   ""
};

showdates[11] = {
	date:          "August 19",
	year:			"2006",
	day_of_week:   "Saturday",
	time:          "11:00pm",
	title:		   "Air Devils Inn",
	location1:     "",
	location2:     "",
	location3:     "",
	link: 		   "",
	map:		   ""
};

showdates[12] = {
	date:          "September 2",
	year:			"2006",
	day_of_week:   "Saturday",
	time:          "11:00pm",
	title:		   "Hideaway Saloon",
	location1:     "",
	location2:     "",
	location3:     "",
	link: 		   "",
	map:		   ""
};

showdates[13] = {
	date:          "September 9",
	year:			"2006",
	day_of_week:   "Saturday",
	time:          "11:00pm",
	title:		   "Private Event",
	location1:     "",
	location2:     "",
	location3:     "",
	link: 		   "",
	map:		   ""
};

showdates[14] = {
	date:          "September 11",
	year:			"2006",
	day_of_week:   "Monday",
	time:          "11:00pm",
	title:		   "Wick's Pizza",
	location1:     "",
	location2:     "",
	location3:     "",
	link: 		   "",
	map:		   ""
};


showdates[15] = {
	date:          "July 28",
	year:			"2007",
	day_of_week:   "Saturday",
	time:          "1:30pm",
	title:		   "Kentucky Music Weekend",
	location1:     "Iroquois Amphitheater",
	location2:     "Louisville, KY",
	location3:     "",
	link: 		   "http://www.kentuckymusicweekend.com/",
	map:		   ""
};

showdates[16] = {
	date:          "July 28",
	year:			"2007",
	day_of_week:   "Saturday",
	time:          "7:00pm",
	title:		   "Kentucky Music Weekend",
	location1:     "Iroquois Amphitheater",
	location2:     "Louisville, KY",
	location3:     "",
	link: 		   "http://www.kentuckymusicweekend.com/",
	map:		   ""
};


showdates[17] = {
	date:          "July 21",
	year:			"2007",
	day_of_week:   "Saturday",
	time:          "",
	title:		   "KY State Championship Old Time Fiddlers Contest",
	location1:     "Rough River Dam State Park",
	location2:     "Leitchfield, KY",
	location3:     "",
	link: 		   "http://www.kentuckyfiddler.com",
	map:		   ""
};

showdates[18] = {
	date:          "August 4",
	year:			"2007",
	day_of_week:   "Saturday",
	time:          "4:00pm",
	title:		   "KY Bluegrass Music Festival",
	location1:     "The Belvedere",
	location2:     "Downtown Louisville, KY",
	location3:     "",
	link: 		   "http://www.bisigimpactgroup.com/bluegrass/",
	map:		   ""
};

showdates[19] = {
	date:          "August 25",
	year:			"2007",
	day_of_week:   "Saturday",
	time:          "4:00pm",
	title:		   "Peak Summit Festival",
	location1:     "Rustic Frog",
	location2:     "New Albany Indiana",
	location3:     "",
	link: 		   "http://www.myspace.com/peaksummit",
	map:		   ""
};

showdates[20] = {
	date:          "August 2",
	year:			"2007",
	day_of_week:   "Thursday",
	time:          "12:00pm",
	title:		   "WHAS TV",
	location1:     "",
	location2:     "",
	location3:     "",
	link: 		   "",
	map:		   ""
};

showdates[21] = {
	date:          "September 8",
	year:			"2007",
	day_of_week:   "Saturday",
	time:          "6:00pm",
	title:		   "Old Kentucky Home Bicycle Tour",
	location1:     "Spalding Hall",
	location2:     "Bardstown, KY",
	location3:     "",
	link: 		   "http://www.okht.org/",
	map:		   ""
};

showdates[22] = {
	date:          "August 24",
	year:			"2007",
	day_of_week:   "Friday",
	time:          "11:30am",
	title:		   "Chancellor’s Picnic",
	location1:     "Indiana University Southeast",
	location2:     "New Albany, IN",
	location3:     "",
	link: 		   "",
	map:		   ""
};

showdates[23] = {
	date:          "September 12",
	year:			"2007",
	day_of_week:   "Wednesday",
	time:          "7:30pm",
	title:		   "Grass Roots Festival",
	location1:     "Stratto's",
	location2:     "318 W Lewis And Clark Pkwy",
	location3:     "Clarksville IN",
	link: 		   "http://www.strattosrestaurant.com",
	map:		   ""
};

showdates[24] = {
	date:          "December 16",
	year:			"2007",
	day_of_week:   "Sunday",
	time:          "",
	title:		   "Rabbit Hash General Store",
	location1:     "Rabbit Hash, KY",
	location2:     "",
	location3:     "",
	link: 		   "http://www.rabbithash.com/",
	map:		   ""
};

showdates[25] = {
	date:          "January 26",
	year:			"2008",
	day_of_week:   "Saturday",
	time:          "9:00",
	title:		   "O'Connell's Irish Pub",
	location1:	 	"7207 Fegenbush Ln",
	location2:     "John and Caleb duet show",
	location3:     "",
	link: 		   "",
	map:		   "http://www.mapquest.com/maps/map.adp?city=Louisville&state=KY&address=7207+Fegenbush+Ln&zip=40228-1507&country=us"
};

showdates[26] = {
	date:          "May 4",
	year:			"2008",
	day_of_week:   "Sunday",
	time:          "10am - 2pm",
	title:		   "Lynn's Paradise Cafe",
	location1:	 	"Derby Sunday!",
	location2:     "984 Barret Ave",
	location3:     "",
	link: 		   "http://www.lynnsparadisecafe.com",
	map:		   ""
};

showdates[27] = {
	date:          "June 28",
	year:			"2008",
	day_of_week:   "Saturday",
	time:          "TBA",
	title:		   "Westport General Store",
	location1:	   "Westport, KY",
	location2:     "7008 Hwy 524",
	location3:     "",
	link: 		   "http://www.westportgeneralstore.com",
	map:		   "http://www.westportgeneralstore.com/generalinfo/location.asp"
};

showdates[28] = {
	date:          "July 25",
	year:			"2008",
	day_of_week:   "Friday",
	time:          "TBA",
	title:		   "Iroquois Amphitheater",
	location1:     "Kentucky Homefront live radio show recording",
	location2:     "Louisville, KY",
	location3:     "",
	link: 		   "http://www.kentuckyhomefront.org",
	map:		   ""
};

showdates[29] = {
	date:          "August 1",
	year:			"2008",
	day_of_week:   "Friday",
	time:          "7pm",
	title:		   "BBC Tap Room",
	location1:	   "636 East Main Street",
	location2:     "",
	location3:     "",
	link: 		   "http://www.bluegrassbrew.com/",
	map:		   ""
};

showdates[30] = {
	date:          "October 18",
	year:			"2008",
	day_of_week:   "Saturday",
	time:          "",
	title:		   "Private Event",
	location1:	   "",
	location2:     "",
	location3:     "",
	link: 		   "",
	map:		   ""
};

showdates[31] = {
	date:          "August 30",
	year:			"2008",
	day_of_week:   "Saturday",
	time:          "7pm",
	title:		   "Westport General Store",
	location1:	   "Westport, KY",
	location2:     "7008 Hwy 524",
	location3:     "",
	link: 		   "http://www.westportgeneralstore.com",
	map:		   "http://www.westportgeneralstore.com/generalinfo/location.asp"
};

showdates[32] = {
	date:          "September 20",
	year:			"2008",
	day_of_week:   "Saturday",
	time:          "7pm",
	title:		   "Westport General Store",
	location1:	   "Westport, KY",
	location2:     "7008 Hwy 524",
	location3:     "",
	link: 		   "http://www.westportgeneralstore.com",
	map:		   "http://www.westportgeneralstore.com/generalinfo/location.asp"
};

showdates[33] = {
	date:          "November 9",
	year:			"2008",
	day_of_week:   "Sunday",
	time:          "5-6pm",
	title:		   "Harvest Festival Fundraiser",
	location1:	   "Montessori School of Louisville",
	location2:     "770 Eastern Parkway ",
	location3:     "At the corner of Eastern and Preston in the Our Mother of Sorrows building",
	link: 		   "",
	map:		   ""
};

showdates[34] = {
	date:          "December 7",
	year:			"2008",
	day_of_week:   "Sunday",
	time:          "2:30pm",
	title:		   "Rabbit Hash General Store",
	location1:     "Rabbit Hash, KY",
	location2:     "",
	location3:     "",
	link: 		   "http://www.rabbithash.com/",
	map:		   ""
};

showdates[35] = {
	date:          "December 13",
	year:			"2008",
	day_of_week:   "Saturday",
	time:          "9:00pm",
	title:		   "Flanagan's Ale House",
	location1:     "934 Baxter Avenue",
	location2:     "Louisville, KY",
	location3:     "",
	link: 		   "",
	map:		   ""
};

showdates[36] = {
	date:          "February 18",
	year:			"2009",
	day_of_week:   "Wednesday",
	time:          "7:00pm",
	title:		   "Red Barn Radio",
	location1:     "Lexington, KY",
	location2:     "",
	location3:     "",
	link: 		   "http://www.redbarnradio.com/",
	map:		   ""
};

showdates[37] = {
	date:          "August 28",
	year:			"2009",
	day_of_week:   "Friday",
	time:          "6:00pm",
	title:		   "Bluegrass 101 Bluegrass Festival",
	location1:     "Bullitt County Fairgrounds",
	location2:     "Shepherdsville, KY",
	location3:     "",
	link: 		   "",
	map:		   ""
};

showdates[38] = {
	date:          "June 14",
	year:			"2009",
	day_of_week:   "Sunday",
	time:          "12:00",
	title:		   "Locust Grove",
	location1:     "Locust Grove Family Picnic",
	location2:     "",
	location3:     "",
	link: 		   "http://locustgrove.org/",
	map:		   ""
};

showdates[39] = {
	date:          "April 19",
	year:			"2009",
	day_of_week:   "Sunday",
	time:          "2:30pm",
	title:		   "The Pickin Ranch",
	location1:     "",
	location2:     "",
	location3:     "",
	link: 		   "",
	map:		   ""
};

showdates[40] = {
	date:          "May 2",
	year:			"2009",
	day_of_week:   "Saturday",
	time:          "10:30am - 1:30pm",
	title:		   "Lynn's Paradise Cafe",
	location1:	 	"Derby Day!",
	location2:     "984 Barret Ave",
	location3:     "",
	link: 		   "http://www.lynnsparadisecafe.com",
	map:		   ""
};

showdates[41] = {
	date:          "May 3",
	year:			"2009",
	day_of_week:   "Sunday",
	time:          "8:30am - 1:30pm",
	title:		   "Lynn's Paradise Cafe",
	location1:	 	"Derby Sunday!",
	location2:     "984 Barret Ave",
	location3:     "",
	link: 		   "http://www.lynnsparadisecafe.com",
	map:		   ""
};

showdates[42] = {
	date:          "July 24",
	year:			"2009",
	day_of_week:   "Friday",
	time:          "TBD",
	title:		   "Kentucky Music Weekend",
	location1:     "Iroquois Amphitheater",
	location2:     "Louisville, KY",
	location3:     "",
	link: 		   "http://www.kentuckymusicweekend.com/",
	map:		   ""
};

showdates[43] = {
	date:          "July 25",
	year:			"2009",
	day_of_week:   "Saturday",
	time:          "TBD",
	title:		   "Kentucky Music Weekend",
	location1:     "Iroquois Amphitheater",
	location2:     "Louisville, KY",
	location3:     "",
	link: 		   "http://www.kentuckymusicweekend.com/",
	map:		   ""
};

showdates[44] = {
	date:          "September 4",
	year:			"2009",
	day_of_week:   "Friday",
	time:          "",
	title:		   "Private Event",
	location1:     "",
	location2:     "",
	location3:     "",
	link: 		   "",
	map:		   ""
};

showdates[45] = {
	date:          "September 5",
	year:			"2009",
	day_of_week:   "Saturday",
	time:          "",
	title:		   "Private Event",
	location1:     "",
	location2:     "",
	location3:     "",
	link: 		   "",
	map:		   ""
};

showdates[46] = {
	date:          "September 10",
	year:			"2009",
	day_of_week:   "Thursday",
	time:          "8:00pm",
	title:		   "Surfside Pier",
	location1:     "Garden City, South Carolina",
	location2:     "",
	location3:     "",
	link: 		   "",
	map:		   ""
};

showdates[47] = {
	date:          "September 12",
	year:			"2009",
	day_of_week:   "Saturday",
	time:          "9:00pm",
	title:		   "Sam's Corner",
	location1:     "Surfside Beach, South Carolina",
	location2:     "",
	location3:     "",
	link: 		   "",
	map:		   ""
};

showdates[48] = {
	date:          "October 3",
	year:			"2009",
	day_of_week:   "Saturday",
	time:          "4:00pm",
	title:		   "Belle of Louisville Cruise",
	location1:     "Louisville Riverfront",
	location2:     "",
	location3:     "",
	link: 		   "http://belleoflouisville.org",
	map:		   ""
};

showdates[49] = {
	date:          "October 5",
	year:			"2009",
	day_of_week:   "Monday",
	time:          "",
	title:		   "Private Event",
	location1:     "",
	location2:     "",
	location3:     "",
	link: 		   "",
	map:		   ""
};

showdates[50] = {
	date:          "October 16",
	year:			"2009",
	day_of_week:   "Friday",
	time:          "7:00pm",
	title:		   "Huber's Orchard",
	location1:     "",
	location2:     "",
	location3:     "",
	link: 		   "",
	map:		   ""
};

showdates[51] = {
	date:          "November 7",
	year:			"2009",
	day_of_week:   "Saturday",
	time:          "7:00pm",
	title:		   "Westport General Store",
	location1:	   "Westport, KY",
	location2:     "7008 Hwy 524",
	location3:     "",
	link: 		   "http://www.westportgeneralstore.com",
	map:		   "http://www.westportgeneralstore.com/generalinfo/location.asp"
};

showdates[52] = {
	date:          "November 18",
	year:			"2009",
	day_of_week:   "Wednesday",
	time:          "7:00pm",
	title:		   "Red Barn Radio",
	location1:     "Lexington, KY",
	location2:     "",
	location3:     "",
	link: 		   "http://www.redbarnradio.com/",
	map:		   ""
};

showdates[53] = {
	date:          "August 14",
	year:			"2010",
	day_of_week:   "Saturday",
	time:          "",
	title:		   "Private Event",
	location1:     "",
	location2:     "",
	location3:     "",
	link: 		   "",
	map:		   ""
};

/*
dulcimerbeth@gmail.com
August 14 at Gingerwoods in Prospect (right next to Henry's Ark.)
*/

showdates[54] = {
	date:          "December 5",
	year:			"2009",
	day_of_week:   "Saturday",
	time:          "4:00pm",
	title:		   "Highlands Beer Festival",
	location1:     "Valumarket Mid-City Mall",
	location2:     "1250 Bardstown Rd",
	location3:     "Louisville KY",
	link: 		   "/pdf/hbf.pdf",
	map:		   ""
};




function sortByDate(a,b) {
	n = new Date(a.date + " " + a.year);
    m = new Date(b.date + " " + b.year);	
	if (n < m) {return -1};
	if (n > m) {return 1} else {return 0};
}


var sorted = showdates.sort(sortByDate);


function writeGigInfo(n, mode) {
	sorted[n].title != "" ? document.write(sorted[n].title + "<br>"): "";	
	if (mode != "previous") {
	sorted[n].location1 != "" ? document.write(sorted[n].location1 + "<br>"): "";
	sorted[n].location2 != "" ? document.write(sorted[n].location2 + "<br>"): "";
	sorted[n].location3 != "" ? document.write(sorted[n].location3 + "<br>"): "";
	sorted[n].link != "" ? document.write("<a href='" + sorted[n].link + "'>Find out more &gt;</a><br>"): "";
	}
}

function hasDatePassedYet(d) {
	var r = false;
	var rightNow = new Date();
	var showDate = new Date(sorted[d].date + " " + sorted[d].year);	
	showDate.setDate(showDate.getDate()+1);
	if (rightNow>showDate) {r = true} ;
	return r;
}


function drawUpcoming() {
	document.write("<span class='gigBlurb'>");
	for (var i = 0; i < sorted.length; i++) {	
		if(sorted[i]){	
		var hasDatePassed = hasDatePassedYet(i);	
		if (hasDatePassed) {continue}	
		var time = sorted[i].time=="" ? "TBD" : sorted[i].time;
		document.write("<span class='subheader'>" + sorted[i].day_of_week + ", " + sorted[i].date + " - " + time + "</span><br>");	
		writeGigInfo(i);	
		document.write("<hr size='1' align='left' color='#999999' width='120'>")
		}
	}
	document.write("</span>");
}


function drawPrevious() {
	document.write("<span class='gigBlurb'>");
	for (var i = 0; i < sorted.length; i++) {	
		if(sorted[i]){	
		var hasDatePassed = hasDatePassedYet(i);	
		if (!hasDatePassed) {break}	
		document.write("<span class='subheader'>" + sorted[i].day_of_week + ", " + sorted[i].date + ", " + sorted[i].year + "</span><br>");	
		writeGigInfo(i, 'previous');	
		document.write("<hr size='1' align='left' color='#999999' width='120'>")
		}
	}
	document.write("</span>");
}



function drawNextShow(maxShows) { 
var count=1;
	for (var i = 0; i < sorted.length; i++) {	
		if(sorted[i]){	
		var hasDatePassed = hasDatePassedYet(i);	
		if (hasDatePassed) {continue} else {
			document.write("<span class='gigBlurb'>- "+ sorted[i].date + " @ " + sorted[i].title + "</span><br>") ;
			count++;
			if(count>maxShows){break}
		} 		
		}
	}
}

function drawPastShows() {

}




