//venue objects
var capri = new Object;
capri.icon = "<a href=\"http:\/\/www.capriristoranteitaliano.net\/\" target=\"_blank\"><img src=\"images\/capri.gif\" alt=\"Capri Ristorante Italiano\" style=\"border:none;\" /></a>";
capri.clowns = "<div><span class=\"text_0\">...with his trio</span> <a href=\"http:\/\/www.myspace.com\/thestackableclowns\" class=\"text_22\" target=\"_blank\">The Stackable Clowns</a></div>";
capri.setting = "";
capri.info = "<a href=\"http:\/\/www.capriristoranteitaliano.net\/\" class=\"text_22\" target=\"_blank\">Capri Ristorante Italiano</a><br />" +
			 "15121 Main Street<br />" +
			 "Mill Creek, WA  98012<br />" +
			 "(425) 357-8500";
capri.directions = "<a href=\"http:\/\/maps.google.com\/maps?f=q&hl=en&geocode=&q=Capri+Ristorante+Italiano&sll=37.0625,-95.677068&sspn=51.488837,89.296875&ie=UTF8&ll=47.862298,-122.227364&spn=0.043016,0.087204&z=13\" class=\"text_22\" target=\"_blank\">Directions to Capri</a>";
capri.title = "Capri Ristorante Mill Creek, 8:00p";
capri.time = "8 'til LATE!";
capri.timeSaturday = "9 'til LATE!";
capri.header = "Performance venue information for Joe Carolus!";
capri.subheader = "Bringing it on with solo piano and vocals!";
capri.clownstitle = "Capri Ristorante Mill Creek, 9pm w/ The Stackable Clowns!";
capri.clownsheader = "Performance venue info for <a href=\"http:\/\/www.myspace.com\/thestackableclowns\" class=\"text_22\" target=\"_blank\">The Stackable Clowns</a>!";
capri.clownssubheader = "Joe's happening piano trio delivers the goods!";


var vivendo = new Object;
vivendo.icon = "<a href=\"http:\/\/www.vivendorestaurant.com\" target=\"_blank\"><img src=\"images\/vivendo.gif\" alt=\"Vivendo Restaurant & Bar\" style=\"border:none;\" /></a>";
vivendo.clowns = "<div><span class=\"text_0\">...with his trio</span> <a href=\"http:\/\/www.myspace.com\/thestackableclowns\" class=\"text_22\" target=\"_blank\">The Stackable Clowns</a></div>";
vivendo.setting = "";
vivendo.info = "<a href=\"http:\/\/www.vivendorestaurant.com\" class=\"text_22\" target=\"_blank\">Vivendo Restaurant & Bar</a><br />" +
			    "23718 Bothell Everett Highway<br />" +
			    "Bothell, WA 98021-9363<br />" +
                "(425) 487-3202";
vivendo.directions = "<a href=\"http:\/\/maps.google.com\/maps\/place?cid=13409495108938150970&q=vivendo+restaurant+bothell&hl=en&gl=us\" class=\"text_22\" target=\"_blank\">Directions to Vivendo</a>";
vivendo.time = "8 'til LATE!";
vivendo.title = "Vivendo Restaurant Bothell, 8:00p";
vivendo.header = "Performance venue information for Joe Carolus!";
vivendo.subheader = "Bringing it on with solo piano and vocals!";

var monkey = new Object;
monkey.icon = "<a href=\"http:\/\/www.badmonkeybistro.com\" target=\"_blank\"><img src=\"images\/monkey.gif\" alt=\"Bad Monkey Bistro & Lounge\" style=\"border:none;\" /></a>";
monkey.clowns = "<div><span class=\"text_0\">...with his trio</span> <a href=\"http:\/\/www.myspace.com\/thestackableclowns\" class=\"text_22\" target=\"_blank\">The Stackable Clowns</a></div>";
monkey.setting = "";
monkey.info = "<a href=\"http:\/\/www.badmonkeybistro.com\" class=\"text_22\" target=\"_blank\">Bad Monkey Bistro & Lounge</a><br />" +
			    "400 Boren Avenue N<br />" +
			    "Seattle, WA 98109<br />" +
                "(206) 467-1111";
monkey.directions = "<a href=\"http:\/\/www.badmonkeybistro.com\/directions.html\" class=\"text_22\" target=\"_blank\">Directions to Bad Monkey Bistro</a>";
monkey.time = "Happy Hour, 4 'til 7pm";
monkey.title = "Bad Monkey Bar Seattle, 4:00p";
monkey.header = "Performance venue information for Joe Carolus!";
monkey.subheader = "Bringing it on with solo piano and vocals!";

var tandem = new Object;
tandem.icon = "<a href=\"http:\/\/www.tandemwinebar.com\" target=\"_blank\"><img src=\"images\/tandem.gif\" alt=\"Tandem Wine & Cheese Bar\" style=\"border:none;\" /></a>";
//tandem.clowns = "<div><span class=\"text_0\">...with his trio</span> <a href=\"http:\/\/www.myspace.com\/thestackableclowns\" class=\"text_22\" target=\"_blank\">The Stackable Clowns</a></div>";
tandem.setting = "";
tandem.info = "<a href=\"http:\/\/www.tandemwinebar.com\" class=\"text_22\" target=\"_blank\">Tandem Wine & Cheese Bar</a><br />" +
			    "10123 Main Place<br />" +
			    "Bothell WA 98011<br />" +
                "(425) 398-WINE";
tandem.directions = "<a href=\"http:\/\/www.tandemwinebar.com\/location\" class=\"text_22\" target=\"_blank\">Directions to Tandem Wine Bar</a>";
tandem.time = "7 'til 10pm";
tandem.timeSaturday = "7 'til 10pm";
tandem.title = "Tandem Wine Bar Bothell, 7:00p";
tandem.header = "Performance venue information for Joe Carolus!";
tandem.subheader = "Bringing it on with solo piano and vocals!";

var grand = new Object;
grand.icon = "<a href=\"http:\/\/www.grandcru-winebar.com\/Pages\/Main.aspx\" target=\"_blank\"><img src=\"images\/grand.gif\" alt=\"Grand Cru Bar & Lounge\" style=\"border:none;\" /></a>";
//grand.clowns = "<div><span class=\"text_0\">...with his trio</span> <a href=\"http:\/\/www.myspace.com\/thestackableclowns\" class=\"text_22\" target=\"_blank\">The Stackable Clowns</a></div>";
grand.setting = "";
grand.info = "<a href=\"http:\/\/www.grandcru-winebar.com\/Pages\/Main.aspx\" class=\"text_22\" target=\"_blank\">Grand Cru Bar & Lounge</a><br />" +
			    "1020 108th Ave NE, Ste. 100<br />" +
			    "Bellevue, WA 98004<br />" +
                "(425) 455-4278";
grand.directions = "<a href=\"http:\/\/www.grandcru-winebar.com\/Pages\/Directions.aspx\" class=\"text_22\" target=\"_blank\">Directions to Grand Cru Lounge</a>";
grand.time = "5 'til 7pm";
grand.timeSaturday = "5 'til 7pm";
grand.title = "Grand Cru Bar Bellevue, 5:00p";
grand.header = "Performance venue information for Joe Carolus!";
grand.subheader = "Bringing it on with solo piano and vocals!";



var privateEvent = new Object;
privateEvent.info = "";
privateEvent.title = "Private Event - with Joe Carolus";
privateEvent.header = "Private Event featuring Joe Carolus";
privateEvent.subheader = "Make your next party or private event your best!";
privateEvent.time = "";
privateEvent.timeSaturday = "";

var privateClowns = new Object;
privateClowns.info = "";
privateClowns.title = "Private Event -    w/ The Stackable Clowns";
privateClowns.clownsheader = "Private Event featuring <a href=\"http:\/\/www.myspace.com\/thestackableclowns\" class=\"text_22\" target=\"_blank\">The Stackable Clowns</a>!";
privateClowns.clownssubheader = "Make your next party or private event your best!";
privateClowns.time = "";
privateClowns.timeSaturday = "";


//one-off benefit object (Seattle Brain Cancer Walk - 6/26/2010)
/*
var operation = new Object;
operation.icon = "<a href=\"http:\/\/www.singforfood.org\" target=\"_blank\"><img src=\"images\/operation.gif\" alt=\"Benefiting Operation Sack Lunch\" style=\"border:none;\" /></a>";
operation.clowns = "<div><span class=\"text_0\">...with his trio</span> <a href=\"http:\/\/www.myspace.com\/thestackableclowns\" class=\"text_22\" target=\"_blank\">The Stackable Clowns</a></div>";
operation.setting = "";
operation.info = "<a href=\"http:\/\/www.singforfood.org\" class=\"text_22\" target=\"_blank\">Pyramid Ale House - Benefit</a><br />" +
			  "1201 First Avenue South<br/>" +
			  "Seattle, WA 98134<br/>" +
			  "(206) 682-3377<br/>";
operation.directions = "<a href=\"http:\/\/www.mapquest.com\/maps?address=1201+1st+Avenue+S&city=Seattle&state=WA&zipcode=98134&country=US\" class=\"text_22\" target=\"_blank\">Directions to Pyramid Ale House</a>";
operation.title = "Pyramid Ale Beer Garden, 5:30p w/ The Stackable Clowns!";
operation.time = "5:30 pm - 7:10 pm";
operation.clownstitle = "Pyramid Ale Beer Garden, 5:30p w/ The Stackable Clowns!";
operation.clownsheader = "Performance venue info for <a href=\"http:\/\/www.myspace.com\/thestackableclowns\" class=\"text_22\" target=\"_blank\">The Stackable Clowns</a>!";
operation.clownssubheader = "Giving back to benefit a great cause!";

var buckleys = new Object;
buckleys.icon = "<a href=\"http:\/\/www.buckleysseattle.com\/btmainpage.htm\" target=\"_blank\"><img src=\"images\/buckleys.gif\" alt=\"Buckley's in Belltown\" style=\"border:none;\" /></a>";
buckleys.clowns = "<div><span class=\"text_0\">...with his trio</span> <a href=\"http:\/\/www.myspace.com\/thestackableclowns\" class=\"text_22\" target=\"_blank\">The Stackable Clowns</a></div>";
buckleys.setting = "";
buckleys.info = "<a href=\"http:\/\/www.buckleysseattle.com\/btmainpage.htm\" class=\"text_22\" target=\"_blank\">Buckley's in Belltown</a><br />" +
			  "2331 2nd Avenue<br/>" +
			  "Seattle, WA 98121<br/>" +
			  "(206) 588-8879";
buckleys.directions = "<a href=\"http:\/\/www.buckleysseattle.com/btdirections.htm\" class=\"text_22\" target=\"_blank\">Directions to Buckley's</a>";
buckleys.title = "Buckley's in Belltown, 9:00pm w/ The Stackable Clowns!";
buckleys.time = "9:00 pm 'til Midnight";
buckleys.header = "Performance venue information for Joe Carolus!";
buckleys.subheader = "Bringing it on with solo piano and vocals!";
buckleys.clownstitle = "Buckley's in Belltown, 9:00pm w/ The Stackable Clowns!";
buckleys.clownsheader = "Performance venue info for <a href=\"http:\/\/www.myspace.com\/thestackableclowns\" class=\"text_22\" target=\"_blank\">The Stackable Clowns</a>!";
buckleys.clownssubheader = "Joe's happening piano trio delivers the goods!";

var cancer = new Object;
cancer.icon = "<a href=\"http:\/\/events.abc2.org\/site\/TR\/Events\/Seattle?fr_id=1060&pg=entry\" target=\"_blank\"><img src=\"images\/cancer.gif\" alt=\"Seattle Brain Cancer Walk\" style=\"border:none;\" /></a>";
cancer.clowns = "<div><span class=\"text_0\">...with his trio</span> <a href=\"http:\/\/www.myspace.com\/thestackableclowns\" class=\"text_22\" target=\"_blank\">The Stackable Clowns</a></div>";
cancer.setting = "";
cancer.info = "<a href=\"http:\/\/events.abc2.org\/site\/TR\/Events\/Seattle?fr_id=1060&pg=entry\" class=\"text_22\" target=\"_blank\">Seattle Brain Cancer Walk</a><br />" +
			  "Seattle Center's<br/>" +
			  "Mural Amphitheatre<br/>" +
			  "Seattle, WA<br/>";
cancer.directions = "<a href=\"http:\/\/www.seattlecenter.com\/transportation\/directions.asp\" class=\"text_22\" target=\"_blank\">Directions to Seattle Center</a>";
cancer.title = "Brain Cancer Wlk, Seattle Ctr, 9:00a w/ The Stackable Clowns!";
cancer.timeSaturday = "9:00 am - 10:00 am";
cancer.clownstitle = "Brain Cancer Walk, Seattle Center, 9:00am w/ The Stackable Clowns!";
cancer.clownsheader = "Performance venue info for <a href=\"http:\/\/www.myspace.com\/thestackableclowns\" class=\"text_22\" target=\"_blank\">The Stackable Clowns</a>!";
cancer.clownssubheader = "Giving back to benefit a great cause!";

var patterson = new Object;
patterson.icon = "<a href=\"http:\/\/www.washingtonwinecompany.com/wine/node/6\" target=\"_blank\"><img src=\"images\/patterson.gif\" alt=\"Patterson Cellars\" style=\"border:none;\" /></a>";
patterson.clowns = "<div><span class=\"text_0\">...with his trio</span> <a href=\"http:\/\/www.myspace.com\/thestackableclowns\" class=\"text_22\" target=\"_blank\">The Stackable Clowns</a></div>";
patterson.setting = "";
patterson.info = "<a href=\"http:\/\/www.washingtonwinecompany.com/wine/node/6\" class=\"text_22\" target=\"_blank\">Patterson Cellars</a><br />" +
			  "19501 144th Ave NE Suite D 600<br/>" +
			  "Woodinville, WA 98072<br/>" +
			  "(425) 483-8600";
patterson.directions = "<a href=\"http:\/\/www.washingtonwinecompany.com/wine/node/1\" class=\"text_22\" target=\"_blank\">Directions to Patterson Cellars</a>";
patterson.title = "Patterson Cellars, 12:30 - 3:30 pm w/ The Stackable Clowns!";
patterson.time = "12:30 pm 'til 3:30 pm";
patterson.timeSaturday = "12:30 'til 3:30 pm";
patterson.clownsheader = "Performance venue info for <a href=\"http:\/\/www.myspace.com\/thestackableclowns\" class=\"text_22\" target=\"_blank\">The Stackable Clowns</a>!";
patterson.clownssubheader = "Joe's happening piano trio delivers the goods!";
*/

//slideshow image arrays and variables (system for multiple shows per page)
var preLoadImage_a = new Array();
var preLoadImage_b = new Array();

var imageArray_a = new Array();
var imageArray_b = new Array();

var captionArray_a = new Array();
var captionArray_b = new Array();

var timeout_a;
var timeout_b;

var counter_a = 0;
var counter_b = 0;

// Set the slideshow speed (in milliseconds)
var SlideShowSpeed = 7500;

// Set the duration of crossfade (in seconds)
var CrossFadeDuration = 5;


//global variables for schedule displays
var gigCalendar = new Array();
var showDisplayed = false;
var dayShow = "Tonight!";


function replaceEmail()
{
	var emailLinks = ['#contactJoe_1', '#contactJoe_2', '#contactChris'];

	for(i=0; i<3; i++) {
		$(emailLinks[i]).each(function(){
		var to_replace = '[at-no-spam]';
		$(this).html( $(this).html().replace(to_replace, '@') )
		.attr('href', $(this).attr('href').replace(to_replace, '@') );
		});
	}
}


//create gig(event) object property values with listGig() parameters:
//date (single gig days - for now)
//title (description on calendar)
//venue (detail object from preset list)
//Stackable Clowns gig (boolean value)
//private venue gig (boolean value)
function runSchedule()
{
	//special case - double header gig (Bad Monkey & Capri 9/3/2010)
	var currentDate = new Date();
	var cutoffDate = new Date('09/03/2010 19:00:00');
		
	
	listGig("09/02/2010", vivendo.title, vivendo, false);

	//special case - double header gig (Bad Monkey & Capri 9/3/2010)
	if(currentDate < cutoffDate)
	{
		listGig("09/03/2010", monkey.title, monkey);
	}
	else
	{
		listGig("09/03/2010", capri.title, capri);
	}	
	
	listGig("09/09/2010", vivendo.title, vivendo, false);
	listGig("09/10/2010", capri.title, capri, false);
	listGig("09/11/2010", tandem.title, tandem, false);
	listGig("09/16/2010", vivendo.title, vivendo, false);
	listGig("09/17/2010", capri.title, capri, false);
	listGig("09/18/2010", privateClowns.title, privateClowns, true, true);
	listGig("09/23/2010", vivendo.title, vivendo, false);
	listGig("09/24/2010", capri.title, capri, false);
	listGig("09/25/2010", grand.title, grand, false);
	listGig("09/30/2010", vivendo.title, vivendo, false);
	listGig("10/01/2010", capri.title, capri, false);
	listGig("10/07/2010", vivendo.title, vivendo, false);
	listGig("10/08/2010", capri.title, capri, false);
	listGig("10/14/2010", vivendo.title, vivendo, false);
	listGig("10/15/2010", capri.title, capri, false);
	listGig("10/21/2010", vivendo.title, vivendo, false);
	listGig("10/22/2010", capri.title, capri, false);
	listGig("10/28/2010", vivendo.title, vivendo, false);
	listGig("10/29/2010", capri.title, capri, false);
	
	//reference syntax for private gig (Joe & Clowns)
	//listGig("09/18/2010", privateEvent.title, privateEvent, false, true);
	//listGig("09/18/2010", privateClowns.title, privateClowns, true, true);

}

//populate properties for each gig object, add to gig calendar array
function listGig(gigDate, gigTitle, gigVenue, gigClowns, gigPrivate)
{
	var currentDate = new Date();
	var compareDate = new Date(gigDate);
	var dateDay = Date.WeekdayNames[compareDate.getDay() + 1];
	
	currentDate = new Date(FormatDateTime(currentDate, 2));
	compareDate = new Date(FormatDateTime(compareDate, 2));
	
	//filter out past dates for calendar
	if(compareDate >= currentDate)
	{
		var gig = new Object;

		gig.start = gigDate;
		gig.title = gigTitle;
		gig.detail = gigVenue;
		gig.clowns = gigClowns;
		gigCalendar.push(gig);
		
		if(compareDate > currentDate)
		{
			dayShow = "This " + dateDay + "!";
		}
		
		//show next upcoming gig on homepage
		if(!showDisplayed && !gigPrivate)
		{
			populateShow(gigDate, gigVenue, gigClowns);
			showDisplayed = true;
		}
	}
}

//Home page venue information display
function populateShow(gigDate, venue, stackable)
{
	var weekday = new Date(gigDate);
	var time = (weekday.getDay() == 6) ? venue.timeSaturday : venue.time;
	var clowns = (stackable) ? venue.clowns : "";
	
	//special case - double header gig (Bad Monkey & Capri 9/3/2010)
	if(venue == monkey)
	{
		dayShow = "This Evening!";
	}
	
	//special case - one-off benefit gig 6/26/2010)
	/*
	if(venue == cancer)
	{
		dayShow = " - And Show Your Support!";
	}
	*/
	
	var html =
	"<table cellpadding=\"0\" cellspacing=\"0\">" +
	"<tr><td class=\"layout_venueIcon\">" + venue.icon + "</td>" +
	"<td class=\"layout_venueInfo text_9\">" + clowns + venue.setting +
	"<div class=\"top_padding_10\">" + venue.info + "</div>" +
	"<div class=\"top_padding_10\">" + venue.directions + "</div>" +
	"</td></tr></table>";
    
    $('#tdCaption').html("See Joe Live " + dayShow);
    $('#tdCaptionDate').html(FormatDateTime(gigDate, 1) + "&nbsp;&nbsp;&nbsp;" + time);
    
    $('#divShow').attr('class', 'top_padding_10');
	$('#divShow').html(html);
}


//Calendar page venue information display
function showGigDetails(date, venue, stackable)
{
    var divDetails = $('#divDetails');

    if(divDetails.css('display') == 'none')
    {
		var header = (stackable) ? venue.clownsheader : venue.header;
		var subheader = (stackable) ? venue.clownssubheader : venue.subheader;
		var html;
		
		if(venue.info != "")
		{
			var weekday = new Date(date);
			var clowns = (stackable) ? venue.clowns : "";
			var time = (weekday.getDay() == 6) ? venue.timeSaturday : venue.time;
		
			html = 
			"<table cellpadding=\"0\" cellspacing=\"0\" style=\"width:420px; background-color:#dddddd;\" align=\"center\">" +
			"<tr><td class=\"text_10\" style=\"text-align:center;\">" + header + 
			"<a href=\"Javascript:showGigDetails();\"><img src=\"images\/close.gif\" style=\"position:absolute; left:430px; top:8px;\" border=\"0\" title=\"Close Window\"></td></tr>" +
			"<tr><td class=\"text_9\" style=\"text-align:center;\"><i>" + subheader + "</i></td></tr>" +
			"<tr><td class=\"top_padding_15\">" +  
				"<table cellpadding=\"0\" cellspacing=\"0\">" +
				"<tr><td class=\"layout_venueIcon\">" + venue.icon + "</td>" +
				"<td class=\"layout_venueInfo text_9\"><b>" + FormatDateTime(date, 1) + "</b><br/>" +
				"<img src=\"images/spacer.gif\" width=\"25\" height=\"1\"><b><i> - " + time + "</i></b>" +
				"<div class=\"top_padding_10\">" + venue.info + "</div>" +
				"<div class=\"top_padding_10\">" + venue.directions + "</div>" +
				"</td></tr></table>" +
			"</td></tr>" +
			"<tr><td class=\"top_padding_15\">&nbsp;</td></tr>" +
			"<tr><td align=\"center\"><a href=\"Javascript:showGigDetails();\" class=\"text_22\">Close Window</a></td></tr>" +
			"</table>";
		}
		else
		{
			html =
			"<table cellpadding=\"0\" cellspacing=\"0\" style=\"width:420px; background-color:#dddddd;\" align=\"center\">" +
			"<tr><td class=\"text_10\" style=\"text-align:center;\">" + header + 
			"<a href=\"Javascript:showGigDetails();\"><img src=\"images\/close.gif\" style=\"position:absolute; left:430px; top:8px;\" border=\"0\" title=\"Close Window\"></td></tr>" +
			"<tr><td class=\"text_9\" style=\"text-align:center;\"><i>" + subheader + "</i></td></tr>" +
			"<tr><td align=\"center\"><div class=\"top_padding_20\">" +
			"<a href=\"mailto:joe@joecarolus.com?subject=Booking Inquiry\" class=\"text_22\">Book Joe Carolus or The Stackable Clowns</a>" +
			"</div></td></tr>" +
			"<tr><td class=\"top_padding_15\">&nbsp;</td></tr>" +
			"<tr><td align=\"center\"><a href=\"Javascript:showGigDetails();\" class=\"text_22\">Close Window</a></td></tr>" +
			"</table>";
		}
    
		divDetails.html(html);
		divDetails.modal();
    }    
    else
    {
        $.modal.close();
    }
}


function popUp(linkName, no_tools)
{
	var actionWindow;	
	
	if(no_tools)
	{
		actionWindow = window.open('', 'Link', 'width=860, height=600, status=0, scrollbars=1, menubar=0, toolbar=0, location=0, resizable=yes, minimize=yes, left=0, top=0, screenX=0, screenY=0');
	}
	else
	{
		actionWindow = window.open('', 'Link', 'width=800, height=600, status=0, scrollbars=1, menubar=1, toolbar=0, location=1, resizable=yes, minimize=yes, left=0, top=0, screenX=0, screenY=0');
	}
	
	actionWindow.location.href = linkName;
	actionWindow.focus();
}

function popUpImage(linkName)
{
	var actionWindow;	
	
	actionWindow = window.open('', 'Link', 'width=740, height=730, status=0, scrollbars=1, menubar=0, toolbar=0, location=0, resizable=yes, minimize=yes, left=0, top=0, screenX=0, screenY=0');
	
	actionWindow.location.href = linkName;
	actionWindow.focus();
}

function popUpSmall(linkName)
{
	var actionWindow;	
	
    actionWindow = window.open('', 'Link', 'width=400, height=400, status=0, scrollbars=0, menubar=0, toolbar=0, location=0, resizable=no, minimize=yes, left=0, top=0, screenX=0, screenY=0');
	
	actionWindow.location.href = linkName;
	actionWindow.focus();
}


function drawHeader(pagename)
{
	var linkClass_1 = (pagename == "Performer" || pagename == "Friends") ? "text_16" : "text_1";
	var linkClass_2 = "headerLinks_blue";
	var headerImage = "banner_blue.jpg";
	var headerImageSpecial = "banner_blue_vivendo.jpg";
	
	//special case (Bad Monkey Promotion 9/3/2010)
	var currentDate = new Date();
	var compareDate = new Date('09/03/2010 19:00:00');

	if(compareDate > currentDate)
	{
		headerImageSpecial = "banner_blue_monkey.jpg";
	}
	

	var performer	= "<a href=\"performer.htm\" class=\"" + linkClass_1 + "\">Performer</a>";
	var songwriter	= "<a href=\"songwriter.htm\" class=\"" + linkClass_1 + "\">Song Writer</a>";
	var clowns		= "<a href=\"http:\/\/www.myspace.com\/thestackableclowns\" class=\"" + linkClass_1 + "\" target=\"_blank\">The Stackable Clowns</a>";
	var calendar	= "<a href=\"calendar.htm\" class=\"" + linkClass_1 + "\">Calendar</a>";
	var music		= "<a href=\"music.htm\" class=\"" + linkClass_1 + "\">Music</a>";
	var friends		= "<a href=\"friends.htm\" class=\"" + linkClass_1 + "\">Friends</a>";
	
	switch(pagename)
	{
		case "Performer":
			performer = pagename;
			linkClass_2 = "headerLinks_red";
			headerImage = "banner_red.jpg";
			break;
		case "Song Writer":
			songwriter = pagename;
			break;
		case "Calendar":
			calendar = pagename
			break;
		case "Music":
			music = pagename
			break;
		case "Friends":
			friends = pagename;
			linkClass_2 = "headerLinks_red";
			headerImage = "banner_red.jpg";
			break;
	}
	
	var headerBanner = (pagename == 'Home') ? "<img src=\"images/" + headerImageSpecial + "\" height=\"150\" width=\"778\" border=\"0\" />" : "<a href=\"index.htm\"><img src=\"images/" + headerImage + "\" height=\"150\" width=\"778\" border=\"0\" /></a>";

	var tables =
    "<table cellpadding=\"0\" cellspacing=\"0\" style=\"width:778px; height:150px; background-color:#e5e5e5;\" align=\"center\">" +
    "<tr><td valign=\"top\" class=\"side_padding\" style=\"height:150px;\">" + headerBanner + "</td></tr>" +
    "<tr><td valign=\"top\" style=\"height:2px;\"></td></tr>" +
    "</table>" +   
    "<table cellpadding=\"0\" cellspacing=\"0\" style=\"width:778px;\" align=\"center\">" +
    "<tr><td valign=\"top\" class=\"side_padding\">" +
    "<table cellpadding=\"0\" cellspacing=\"0\" style=\"width:778px; background-color:#e5e5e5;\">" +
    "<tr><td style=\"width:121px;\" class=\"" + linkClass_2 + "\">" + performer + "</td>" +
    "<td style=\"width:2px;\"></td>" +
    "<td style=\"width:137px;\" class=\"" + linkClass_2 + "\">" + songwriter + "</td>" +
    "<td style=\"width:2px;\"></td>" +
    "<td style=\"width:209px;\" class=\"" + linkClass_2 + "\">" + clowns + "</td>" +
    "<td style=\"width:2px;\"></td>" +
    "<td style=\"width:111px;\" class=\"" + linkClass_2 + "\">" + calendar + "</td>" +
    "<td style=\"width:2px;\"></td>" +
    "<td style=\"width:90px;\" class=\"" + linkClass_2 + "\">" + music + "</td>" +
    "<td style=\"width:2px;\"></td>" +
    "<td style=\"width:100px;\" class=\"" + linkClass_2 + "\">" + friends + "</td>" +
    "</tr></table>" +
    "</td></tr></table>";

	document.write(tables);
}


function drawFooter(pagename)
{
	var tables;
	
	if(pagename == 'Home')
	{
		tables =
		"<table cellpadding=\"0\" cellspacing=\"0\" style=\"width:700px;\" align=\"center\">" +
		"<tr><td style=\"text-align:center;padding-top:15px;\"><a href=\"mailto:joe[at-no-spam]joecarolus.com?subject=Booking Inquiry\" id=\"contactJoe_2\" class=\"text_22\">Book Joe Carolus or The Stackable Clowns</a></td></tr>" +
		"</table>";
    }
    else
    {
		tables =
		"<table cellpadding=\"0\" cellspacing=\"0\" style=\"width:700px;\" align=\"center\">" +
		"<tr><td style=\"text-align:center;padding-top:15px;\"><a href=\"index.htm\" class=\"text_22\">Return To Home</a><img src=\"images/spacer.gif\" style=\"width:20px; height:20px;\">|<img src=\"images/spacer.gif\" style=\"width:20px; height:20px;\"><a href=\"mailto:joe[at-no-spam]joecarolus.com?subject=Booking Inquiry\" id=\"contactJoe_1\" class=\"text_22\">Book Joe Carolus or The Stackable Clowns</a><img src=\"images/spacer.gif\" style=\"width:20px; height:20px;\">|<img src=\"images/spacer.gif\" style=\"width:20px; height:20px;\"><a href=\"mailto:joe[at-no-spam]joecarolus.com\" id=\"contactJoe_2\" class=\"text_22\">Contact Joe</a></td></tr>" +
		"</table>";
    }
    
    tables +=
    "<table cellpadding=\"0\" cellspacing=\"0\" style=\"width:779px; background-color:#e5e5e5;\" align=\"center\">" +
    "<tr><td class=\"text_15\" align=\"center\" style=\"padding-top:30px;padding-bottom:10px;\">" +
	"All site contents &copy;2010 by Joe Carolus - all rights reserved<br/>" +
	"Website Design by <a href=\"mailto:chrisg[at-no-spam]chris-g.com?subject=Website Design\" id=\"contactChris\" class=\"text_15\">WonderWorks Studios</a>" +
	"</td></tr></table>";
	
	document.write(tables);
}

function preLoadImages_Home()
{
	// Specify the image array files...
	preLoadImage_a[0] = 'images/cohen.jpg';
	preLoadImage_a[1] = 'images/prestwood.jpg';
	preLoadImage_a[2] = 'images/steele.jpg';

	preLoadImage_b[0] = 'images/gabrielle.jpg';
	preLoadImage_b[1] = 'images/mccracken.jpg';
	preLoadImage_b[2] = 'images/chugg.jpg';

	// Specify the caption array text...
	captionArray_a[0] = "Joe and <a href=\"http://bmi.com/musicworld/entry/233550/\" target=\"_blank\" class=\"text_15\">Jeff Cohen</a>";
	captionArray_a[1] = "Joe and <a href=\"http://www.hughprestwood.com/\" target=\"_blank\" class=\"text_15\">Hugh Prestwood</a>";
	captionArray_a[2] = "Joe and <a href=\"http://www.jeffreysteele.net/\" target=\"_blank\" class=\"text_15\">Jeffrey Steele</a>";

	captionArray_b[0] = "Joe and <a href=\"http://www.myspace.com/mariegabrielleband\" target=\"_blank\" class=\"text_15\">Marie Gabrielle</a>";
	captionArray_b[1] = "Joe and Hugh McCracken";
	captionArray_b[2] = "<a href=\"http://www.chuggentertainment.com/\" target=\"_blank\" class=\"text_15\">Michael Chugg</a> with Friends";
	
	preLoadImages(imageArray_a, preLoadImage_a);
	preLoadImages(imageArray_b, preLoadImage_b);
}

function preLoadImages_Performer()
{
	// Specify the image array files...
	preLoadImage_a[0] = 'images/joe_performer_1.jpg';
	preLoadImage_a[1] = 'images/joe_performer_2.jpg';
	
	preLoadImages(imageArray_a, preLoadImage_a);
}

function preLoadImages(toArray, fromArray)
{
    for (var i = 0; i < fromArray.length; i++)
    {
        toArray[i] = new Image();
        toArray[i].src = fromArray[i];
    }
}

function runSlideShow_a() 
{
    if (document.all) {
        document.images.PictureBox_a.style.filter = "blendTrans(duration=2)";
        document.images.PictureBox_a.style.filter = "blendTrans(duration=CrossFadeDuration)";
        document.images.PictureBox_a.filters.blendTrans.Apply();
    }

    document.images.PictureBox_a.src = imageArray_a[counter_a].src;

    if (captionArray_a.length > 0) {
        if (document.getElementById) document.getElementById("CaptionBox_a").innerHTML = captionArray_a[counter_a];
    }

    if (document.all) document.images.PictureBox_a.filters.blendTrans.Play();

    counter_a += 1;

    if (counter_a > (imageArray_a.length - 1)) counter_a = 0;

    timeout_a = setTimeout('runSlideShow_a()', SlideShowSpeed);
}

function runSlideShow_b() 
{
    if (document.all) {
        document.images.PictureBox_b.style.filter = "blendTrans(duration=2)";
        document.images.PictureBox_b.style.filter = "blendTrans(duration=CrossFadeDuration)";
        document.images.PictureBox_b.filters.blendTrans.Apply();
    }

    document.images.PictureBox_b.src = imageArray_b[counter_b].src;

    if (document.getElementById) document.getElementById("CaptionBox_b").innerHTML = captionArray_b[counter_b];

    if (document.all) document.images.PictureBox_b.filters.blendTrans.Play();

    counter_b += 1;

    if (counter_b > (imageArray_b.length - 1)) counter_b = 0;

    timeout_b = setTimeout('runSlideShow_b()', SlideShowSpeed);
}