
//Big Daddy's Place
var daddys = new Object;
daddys.icon = "<a href=\"http:\/\/www.bigdaddysplace.com\" target=\"_blank\"><img src=\"images\/daddys.gif\" alt=\"Big Daddy's Place\" style=\"border:none;\" /></a>";
daddys.info = "<a href=\"http:\/\/www.bigdaddysplace.com\" class=\"branding_textListLink\" target=\"_blank\">Big Daddy's Place</a><br />" +
			  "13420 NE 177th Place<br />" +
			  "(Little Bear Creek Parkway)<br />" +
			  "Woodinville, WA 98072<br />" +
              "(425) 402-9887";
daddys.directions = "<a href=\"http:\/\/www.bigdaddysplace.com\/directions.htm\" class=\"branding_textListLink\" target=\"_blank\">Directions to Big Daddy's Place</a>";
daddys.time = "9:00pm 'til 1:00am";
daddys.title = "Big Daddy's Place Woodinville, 9pm";
daddys.header = "Performance venue information for Rock Candy!";
daddys.subheader = "Spend an evening with Seattle's sweetest party band!";

//Clearwater Casino
var clearwater = new Object;
clearwater.icon = "<a href=\"http:\/\/www.clearwatercasino.com\" target=\"_blank\"><img src=\"images\/clearwater.gif\" alt=\"Clearwater Casino\" style=\"border:none;\" /></a>";
clearwater.info = "<a href=\"http:\/\/www.clearwatercasino.com\" class=\"branding_textListLink\" target=\"_blank\">Clearwater Casino</a><br />" +
			  "15347 Suquamish Way NE<br />" +
			  "Suquamish, WA 98392<br />" +
              "1 (800) 375-6073";
clearwater.directions = "<a href=\"http:\/\/www.clearwatercasino.com\/about\/location\/maps.html\" class=\"branding_textListLink\" target=\"_blank\">Directions to Clearwater Casino</a>";
clearwater.time = "9:00pm 'til 1:00am";
clearwater.title = "Clearwater Casino - Resort Suquamish, 9pm";
clearwater.header = "Performance venue information for Rock Candy!";
clearwater.subheader = "Spend an evening with Seattle's sweetest party band!";

//Mill Bay
var millbay = new Object;
millbay.icon = "<a href=\"http:\/\/www.colvillecasinos.com\/mbc-main.html\" target=\"_blank\"><img src=\"images\/millbay.gif\" alt=\"Mill Bay Casino\" style=\"border:none;\" /></a>";
millbay.info = "<a href=\"http:\/\/www.colvillecasinos.com\/mbc-main.html\" class=\"branding_textListLink\" target=\"_blank\">Mill Bay Casino</a><br />" +
			  "455 Wapato Lake Road<br />" +
			  "Manson, WA 98831<br />" +
              "(509) 687-2102";
millbay.directions = "<a href=\"http:\/\/www.google.com\/maps?f=q&hl=en&q=455 Wapato Lake Road, Manson, WA 98831&om=1\" class=\"branding_textListLink\" target=\"_blank\">Directions to Mill Bay Casino</a>";
millbay.time = "9:00pm 'til 1:00am";
millbay.title = "Mill Bay Casino, Lake Chelan 9pm";
millbay.header = "Performance venue information for Rock Candy!";
millbay.subheader = "Spend an evening with Seattle's sweetest party band!";

//7-Cedars Casino
var cedars = new Object;
cedars.icon = "<a href=\"http:\/\/www.7cedarscasino.com\/home.html\" target=\"_blank\"><img src=\"images\/cedars.gif\" alt=\"7-Cedars Casino\" style=\"border:none;\" /></a>";
cedars.info = "<a href=\"http:\/\/www.7cedarscasino.com\/home.html\" class=\"branding_textListLink\" target=\"_blank\">7-Cedars Casino</a><br />" +
              "270756 Hwy 101<br />" +
              "Sequim, WA 98382<br />" +
              "(360) 683-7777";
cedars.directions = "<a href=\"http:\/\/www.7cedarsresort.com\/directions.html\" class=\"branding_textListLink\" target=\"_blank\">Directions to 7-Cedars Casino</a>";
cedars.time = "9:00pm 'til 1:00am";
cedars.title = "7-Cedars Casino Sequim, 9pm";
cedars.header = "Performance venue information for Rock Candy!";
cedars.subheader = "Spend an evening with Seattle's sweetest party band!";

//Jillian's
var jillians = new Object;
jillians.icon = "<a href=\"http:\/\/seattle.jbcent.com\" target=\"_blank\"><img src=\"images\/jillians.gif\" alt=\"Jillian's Billiards Club\" style=\"border:none;\" /></a>";
jillians.info = "<a href=\"http:\/\/seattle.jbcent.com\" class=\"branding_textListLink\" target=\"_blank\">Jillian's Billiards Club</a><br />" +
              "731 Westlake Ave. North<br />" +
              "Seattle, WA 98109<br />" +
              "(206) 223-0300";
jillians.directions = "<a href=\"http:\/\/maps.google.com\/maps?f=q&source=s_q&hl=en&geocode=&q=731+Westlake+Avenue+North,+Seattle,+WA&aq=3&sll=37.0625,-95.677068&sspn=60.635244,134.912109&ie=UTF8&hq=&hnear=731+Westlake+Ave+N,+Seattle,+King,+Washington+98109&z=17\" class=\"branding_textListLink\" target=\"_blank\">Directions to Jillian's Billiards</a>";
jillians.time = "9:00pm 'til 1:00am";
jillians.title = "Jillian's Billiards Seattle, 9pm";
jillians.header = "Performance venue information for Rock Candy!";
jillians.subheader = "Spend an evening with Seattle's sweetest party band!";

//Muckleshoot
var muckleshoot = new Object;
muckleshoot.icon = "<a href=\"http:\/\/www.muckleshootcasino.com\/frontsite\/index.action\" target=\"_blank\"><img src=\"images\/muckleshoot.gif\" alt=\"Muckleshoot Casino\" style=\"border:none;\" /></a>";
muckleshoot.info = "<a href=\"http:\/\/www.muckleshootcasino.com\/frontsite\/index.action\" class=\"branding_textListLink\" target=\"_blank\">Muckleshoot Casino</a><br />" +
              "2402 Auburn Way S.<br />" +
              "Auburn, WA 98002<br />" +
              "(800) 804-4944";
muckleshoot.directions = "<a href=\"http:\/\/www.muckleshootcasino.com\/en_US\/frontsite\/to_show_gmap.action\" class=\"branding_textListLink\" target=\"_blank\">Directions to Muckleshoot Casino</a>";
muckleshoot.time = "5:00pm 'til 9:00pm";
muckleshoot.title = "The Muckleshoot Auburn, 5pm";
muckleshoot.header = "Performance venue information for Rock Candy!";
muckleshoot.subheader = "Spend an evening with Seattle's sweetest party band!";

//Private Event
var party = new Object;
party.icon = "<a href=\"contact.htm\"><img src=\"images\/party.gif\" alt=\"Rock Candy\" style=\"border:none;\" /></a>";
party.info = "<a href=\"contact.htm\" class=\"branding_textListLink\">Private Party</a><br />" +
			  "Book Rock Candy<br/>For Your Event!<br />";
party.time = "";
party.title = "Private Event - with Rock Candy";
party.header = "Private Event featuring Rock Candy";
party.subheader = "Make your next party or private event your best!";

//Bite of Seattle
var bite = new Object;
bite.icon = "<a href=\"http:\/\/www.comcastbiteofseattle.com\" target=\"_blank\"><img src=\"images\/bite.gif\" alt=\"Bite of Seattle\" style=\"border:none;\" /></a>";
bite.info = "<a href=\"http:\/\/www.comcastbiteofseattle.com\" class=\"branding_textListLink\" target=\"_blank\">Bite of Seattle - 2011</a><br />" +
"Seattle Center - Fountain Stage<br />" +
"Rock Candy plays @2:00 pm<br />" +
"Seattle, WA 98109<br />" +
"(425) 283-5050";
bite.directions = "<a href=\"http:\/\/www.seattlecenter.com\/transportation\/directions.asp\" class=\"branding_textListLink\" target=\"_blank\">Directions to Bite of Seattle</a>";
bite.time = "2:00pm 'til 2:40pm";
bite.title = "Bite of Seattle Seattle Center, Fountain Stage 2pm";
bite.header = "Performance venue information for Rock Candy!";
bite.subheader = "Spend an afternoon with Seattle's sweetest party band!";

//Tulalip Casino
var tulalip = new Object;
tulalip.icon = "<a href=\"http:\/\/www.tulalipcasino.com\/index.aspx\" target=\"_blank\"><img src=\"images\/tulalip.gif\" alt=\"Tulalip Casino\" style=\"border:none;\" /></a>";
tulalip.info = "<a href=\"http:\/\/www.tulalipcasino.com\/index.aspx\" class=\"branding_textListLink\" target=\"_blank\">Tulalip Casino</a><br />" +
"10200 Quil Ceda Blvd<br />" +
"Tulalip, WA 98271<br />" +
"(888) 272-1111";
tulalip.directions = "<a href=\"http:\/\/www.tulalipcasino.com\/directions.aspx\" class=\"branding_textListLink\" target=\"_blank\">Directions to Tulalip Casino</a>";
tulalip.time = "9:00pm 'til 1:00am";
tulalip.title = "Tulalip Casino Tulalip, 9pm";
tulalip.header = "Performance venue information for Rock Candy!";
tulalip.subheader = "Spend an evening with Seattle's sweetest party band!";

//Skagit Valley Casino
var skagit = new Object;
skagit.icon = "<a href=\"http:\/\/www.theskagit.com\" target=\"_blank\"><img src=\"images\/skagit.gif\" alt=\"Skagit Valley Casino\" style=\"border:none;\" /></a>";
skagit.info = "<a href=\"http:\/\/www.theskagit.com\" class=\"branding_textListLink\" target=\"_blank\">Skagit Valley Casino</a><br />" +
"5984 N. Darrk Lane<br />" +
"Bow, WA 98232<br />" +
"(877) 275-2448";
skagit.directions = "<a href=\"http:\/\/www.google.com\/maps?f=q&source=s_q&hl=en&geocode=&q=5984+N.+Darrk+Lane++%E2%80%A2+Bow,+WA+98232&sll=37.0625,-95.677068&sspn=41.767874,93.076172&ie=UTF8&hq=5984+N.+Darrk+Lane+%E2%80%A2&hnear=Bow,+Skagit,+Washington+98232&ll=48.563431,-122.34684&spn=0.065549,0.181789&t=h&z=13&iwloc=A\" class=\"branding_textListLink\" target=\"_blank\">Directions to Skagit Valley Casino</a>";
skagit.time = "9:00pm 'til 1:00am";
skagit.title = "The Skagit Casino Bow, 9pm";
skagit.header = "Performance venue information for Rock Candy!";
skagit.subheader = "Spend an evening with Seattle's sweetest party band!";

//Jet Bar & Grill
var jet = new Object;
jet.icon = "<a href=\"http:\/\/www.thejetbar.com/\" target=\"_blank\"><img src=\"images\/jet.gif\" alt=\"Jet Bar & Grill\" style=\"border:none;\" /></a>";
jet.info = "<a href=\"http:\/\/www.thejetbar.com\" class=\"branding_textListLink\" target=\"_blank\">Jet Bar & Grill</a><br />" +
			  "800 164th St. SE<br />" +
			  "Mill Creek, WA 98012<br />" +
              "(425) 743-4593";
jet.directions = "<a href=\"http:\/\/maps.google.com\/maps?q=800+164th+St.+SE,+Mill+Creek,+WA.+98012&hl=en&sll=37.0625,-95.677068&sspn=62.484575,134.912109&vpsrc=0&hnear=800+164th+St+SE,+Mill+Creek,+Washington+98012&t=m&z=17\" class=\"branding_textListLink\" target=\"_blank\">Directions to Jet Bar & Grill</a>";
jet.time = "9:00pm 'til 1:00am";
jet.title = "Jet Bar and Grill Mill Creek, 9pm";
jet.header = "Performance venue information for Rock Candy!";
jet.subheader = "Spend an evening with Seattle's sweetest party band!";


/* Holding Area (Unused Gig Objects)

//Twisted Cork
var twisted = new Object;
twisted.icon = "<a href=\"contact.htm\"><img src=\"images\/party.gif\" alt=\"Rock Candy\" style=\"border:none;\" /></a>";
twisted.info = "<a href=\"http:\/\/local.yahoo.com\/info-37439519-twisted-cork-wine-bar-bellevue\" class=\"branding_textListLink\" target=\"_blank\">Twisted Cork</a><br />" +
"900 Bellevue Way NE, Ste 100<br />" +
"Bellevue, WA 98004<br />" +
"(425) 637-0808";
twisted.directions = "<a href=\"http:\/\/maps.google.com\/maps?hl=en&ie=UTF8&q=twisted+cork+bellevue&fb=1&gl=us&hq=twisted+cork&hnear=Bellevue,+WA&pcsi=2246357129883467240,1&view=map&cid=2246357129883467240&iwloc=A&ved=0CIsBEKUG&sa=X&ei=_OB1TNG3BaTstAPiq4X7Bg\" class=\"branding_textListLink\" target=\"_blank\">Directions to Twisted Cork</a>";
twisted.time = "9:00pm 'til 1:00am";
twisted.title = "Twisted Cork, Bellevue 9pm";
twisted.header = "Performance venue information for Rock Candy!";
twisted.subheader = "Spend an evening with Seattle's sweetest party band!";

//Club Hollywood
var hollywood = new Object;
hollywood.icon = "<a href=\"http:\/\/www.silverdollarcasinos.com\/main.html\" target=\"_blank\"><img src=\"images\/hollywood.gif\" alt=\"Club Hollywood Casino\" style=\"border:none;\" /></a>";
hollywood.info = "<a href=\"http:\/\/www.silverdollarcasinos.com\/main.html\" class=\"branding_textListLink\" target=\"_blank\">Club Hollywood Casino</a><br />" +
"16716 Aurora Avenue North<br />" +
"Shoreline, WA 98133<br />" +
"(206) 546-4444";
hollywood.directions = "<a href=\"http:\/\/maps.google.com\/maps?hl=en&um=1&ie=UTF-8&q=club+hollywood+casino+shoreline&fb=1&gl=us&hq=club+hollywood+casino+shoreline&hnear=Kirkland,+WA&cid=0,0,8449205552062618986&ei=ZZO3S5L4MIbWtgOOjrnpDA&sa=X&oi=local_result&ct=image&resnum=4&ved=0CBUQnwIwAw\" class=\"branding_textListLink\" target=\"_blank\">Directions to Club Hollywood</a>";
hollywood.time = "9:00pm 'til 1:00am";
hollywood.title = "Club Hollywood Shoreline, 9pm";
hollywood.header = "Performance venue information for Rock Candy!";
hollywood.subheader = "Spend an evening with Seattle's sweetest party band!";

//JR Phinickey's
var jrbar = new Object;
jrbar.icon = "<img src=\"images\/jrbar.gif\" alt=\"JR Phinickey's\" style=\"border:none;\" />";
jrbar.info = "JR Phinickey's<br />" +
			 "1352 State Avenue<br />" +
			 "Marysville, WA 98270<br />" +
             "(360) 658-7747";
jrbar.directions = "<a href=\"http:\/\/maps.google.com\/maps?f=q&source=s_q&hl=en&geocode=&q=1352+State+Avenue,+Marysville,+WA&sll=48.067985,-122.176895&sspn=0.096702,0.2635&ie=UTF8&hq=&hnear=1352+State+Ave,+Marysville,+Snohomish,+Washington+98270&ll=48.066437,-122.176874&spn=0.012447,0.032938&t=h&z=16\" class=\"branding_textListLink\" target=\"_blank\">Directions to JR Phinickey's</a>";
jrbar.time = "9:00pm 'til 1:00am";
jrbar.title = "JR Phinickey's Marysville, 9pm";
jrbar.header = "Performance venue information for Rock Candy!";
jrbar.subheader = "Spend an evening with Seattle's sweetest party band!";

//Liquid Lime
//var liquid = new Object;
//liquid.icon = "<a href=\"http:\/\/www.theliquidlime.com\" target=\"_blank\"><img src=\"images\/liquid.gif\" alt=\"Liquid Lime\" style=\"border:none;\" /></a>";
//liquid.info = "<a href=\"http:\/\/www.theliquidlime.com\" class=\"branding_textListLink\" target=\"_blank\">Liquid Lime</a><br />" +
//			  "12015 124th Avenue NE<br />" +
//			  "Kirkland, WA 98034<br />" +
//              "(425) 825-9658 ";
//liquid.directions = "<a href=\"http:\/\/maps.yahoo.com\/#mvt=m&lat=47.707001&lon=-122.175913&zoom=17&q1=12015%20124th%20Ave.%20NE%20Kirkland%2C%20WA%20&gid1=31648450\" class=\"branding_textListLink\" target=\"_blank\">Directions to Liquid Lime</a>";
//liquid.time = "9:00pm 'til 1:00am";
//liquid.title = "Liquid Lime Kirkland, 9pm";
//liquid.header = "Performance venue information for Rock Candy!";
//liquid.subheader = "Spend an evening with Seattle's sweetest party band!";

//R&R Live
//var rrlive = new Object;
//rrlive.icon = "<a href=\"http:\/\/www.randrlive.com\" target=\"_blank\"><img src=\"images\/rrlive.gif\" alt=\"R&R Live\" style=\"border:none;\" /></a>";
//rrlive.info = "<a href=\"http:\/\/www.randrlive.com\" class=\"branding_textListLink\" target=\"_blank\">R&R Live</a><br />" +
//              "9915 224th St. E<br />" +
//              "Graham, WA 98338<br />" +
//              "(253) 537-5177";
//rrlive.directions = "<a href=\"http:\/\/maps.yahoo.com\/#mvt=m&lat=47.053257&lon=-122.298423&zoom=14&q1=9915%20224th%20Street%20East%2C%20Graham%2C%20WA\" class=\"branding_textListLink\" target=\"_blank\">Directions to R&R Live</a>";
//rrlive.time = "9:00pm 'til 1:00am";
//rrlive.title = "R&R Live Club Graham, 9pm";
//rrlive.header = "Performance venue information for Rock Candy!";
//rrlive.subheader = "Spend an evening with Seattle's sweetest party band!";

*/


//create gig calendar array
var gigCalendar = new Array();

//create gig(event) object property values with listGig() parameters:
//date (single gig days)
//title (description on calendar)
//venue (detail object from preset list)
//nights (optional - number of consecutive nights)
function runSchedule() {

    listGig("12/30/2011", jet.title, jet);
    listGig("01/13/2012", clearwater.title, clearwater, 2);
    listGig("01/14/2012", clearwater.title, clearwater, 2);
    listGig("02/04/2012", cedars.title, cedars);
    listGig("04/20/2012", clearwater.title, clearwater);

	//reference syntax for two-night gigs
	//listGig("09/03/2010", millbay.title, millbay, 2);
	//listGig("09/04/2010", millbay.title, millbay, 2);
}


//populate properties for each gig object, add to gig calendar array
function listGig(gigDate, gigTitle, gigVenue, gigNights)
{
	var currentDate = new Date();
	var compareDate = new Date(gigDate);
	var dateDay = Date.WeekdayNames[compareDate.getDay() + 1];
	
	currentDate = FormatDateTime(currentDate, 2);
	compareDate = FormatDateTime(compareDate, 2);
	
	currentDate = new Date(currentDate);
	compareDate = new Date(compareDate);
	
	//filter out past dates for calendar, include special condition for multiple nights
	if(compareDate >= currentDate)
	{
		var gig = new Object;

		gig.start = gigDate;
		gig.title = gigTitle;
		gig.detail = gigVenue;
		gig.nights = (gigNights) ? gigNights : 1;
		gigCalendar.push(gig);
	}
}


//partial calendar listing for Upcoming Show display on homepage
function listCalendar()
{
	var dateGig;
	var dateCurrent = new Date();
	
	var dateDiff;
	var rows = "";
	var gigs = 0;
	var gigVenue;
	
	//add initial spacer after header text
	rows += "<tr><td style=\"height:7px; valign:top;\"></td></tr>";

	if (gigCalendar.length == 0) {
	    rows += "<tr><td class=\"branding_textList_2\" style=\"text-align:center; valign:top;\">There are no shows scheduled at this time. Check back soon!</td></tr>";
	}
	else {

	    for (var i = 0; i < gigCalendar.length; i++) {
	        //only display next three gigs for Upcoming Shows
	        if (gigs == 3)
	            break;

	        //check if next gig in line is the same venue (for multiple nights - exclude private events)
	        if (gigVenue == gigCalendar[i].detail && gigVenue != party)
	            continue;

	        //add date checking to display current and future gigs
	        dateGig = new Date(gigCalendar[i].start);
	        dateDiff = DateDiff("d", dateCurrent, dateGig);

	        if (dateDiff < 0)
	            continue;

	        //add spacer row between listings
	        if (gigs != 0) {
	            rows += "<tr><td style=\"height:7px; valign:top;\"></td></tr>";
	        }

	        //add date display (may be full day displays for main calendar page)
	        rows += "<tr><td class=\"branding_textList_1\" style=\"text-align:center; valign:top;\"><u>" + dateDisplay(dateGig, gigCalendar[i].nights) + ":</u></td></tr>";
	        rows += "<tr><td class=\"branding_textList_2\" style=\"text-align:center; valign:top;\">" + gigCalendar[i].detail.info + "</td></tr>";

	        //increment gig total
	        gigs += 1;

	        //assign gigVenue to track multiple nights
	        gigVenue = gigCalendar[i].detail;
	    }
	}
	
	document.write("<table cellpadding=\"0\" cellspacing=\"0\">" + rows + "</table>");
}


function dateDisplay(gigDate, nights) {

	var dateAfterAdd;
	var displayDate;
	
	displayDate = Date.MonthName(gigDate.getMonth()+1) + " " + dayDisplay(gigDate.getDate());
	
	if(nights == 2)	{
		dateAfterAdd = DateAdd("d", 1, gigDate);		
		displayDate += " & " + dayDisplay(dateAfterAdd.getDate());
    }

    if (nights == 3) {
        dateAfterAdd_1 = DateAdd("d", 1, gigDate);
        dateAfterAdd_2 = DateAdd("d", 2, gigDate);
        displayDate += ", " + dayDisplay(dateAfterAdd_1.getDate());
        displayDate += ", " + dayDisplay(dateAfterAdd_2.getDate());
    }
	
	return displayDate;
}


function dayDisplay(gigDay)
{
	var suffix;
	
	//convert day integer to string
	gigDay += '';
	
	//determine suffix based on day
	switch(gigDay)
	{
		case "1":
		case "21":
		case "31":
			suffix = "st";
			break;
		case "2":
		case "22":
			suffix = "nd";
			break;
		case "3":
		case "23":
			suffix = "rd";
			break;
		default:
			suffix = "th";
			break;
	}
	
	return gigDay + suffix;	
}


//Calendar page venue information display
function showGigDetails(date, venue)
{
    var divDetails = $('#divDetails');

    if(divDetails.css('display') == 'none')
    {
		var html;
		var venueInfo;
		
		if(venue.time != "")
		{
			venueInfo =					
				"<td class=\"layout_venueInfo branding_calendarHeader\"><b>" + FormatDateTime(date, 1) + "</b><br/>" +
				"<img src=\"images/spacer.gif\" width=\"25\" height=\"1\"><b><i> - " + venue.time + "</i></b>" +
				"<div class=\"top_padding_10 branding_textList_2\">" + venue.info + "</div>" +
				"<div class=\"top_padding_10\">" + venue.directions + "</div></td>";
		}
		else
		{
			venueInfo =					
				"<td class=\"layout_venueInfo branding_calendarHeader\" style=\"text-align:center;\">" +
				"<a href=\"contact.htm\" class=\"branding_textListLink\">Book Rock Candy for your next Private Party or Corporate Event!</a><br/><br/>" +
				"<span class=\"branding_textList_2\">See more details for booking the <br/>band on our contact page...</span></td>";
		}
		
		html =
			"<table cellpadding=\"0\" cellspacing=\"0\" style=\"width:444px; background-color:#877d70;\" align=\"center\">" +
			"<tr>" +
			"<td style=\"width:2px; height:270px;\"><img src=\"images/schedule_border_270.gif\"></td>" +
			"<td style=\"width:440px; height:270px;\">" +
				"<table cellpadding=\"0\" cellspacing=\"0\" style=\"width:420px; background-color:#877d70;\" align=\"center\">" +
				"<tr><td class=\"branding_calendarHeader\" style=\"text-align:center;\">" + venue.header + 
				"<a href=\"Javascript:showGigDetails();\"><img src=\"images\/close.gif\" style=\"position:absolute; left:412px; top:8px;\" border=\"0\" title=\"Close Window\"></td></tr>" +
				"<tr><td class=\"branding_calendarSubheader\" style=\"text-align:center;\"><i>" + venue.subheader + "</i></td></tr>" +
				"<tr><td class=\"top_padding_15\">" +  
					"<table cellpadding=\"0\" cellspacing=\"0\">" +
					"<tr><td class=\"layout_venueIcon\">" + venue.icon + "</td>" + venueInfo +				
					"</tr></table>" +
				"</td></tr>" +
				"<tr><td class=\"top_padding_5\">&nbsp;</td></tr>" +
				"<tr><td align=\"center\"><a href=\"Javascript:showGigDetails();\" class=\"branding_textListLink\">Close Window</a></td></tr>" +
				"</table>" +
			"</td>" +
			"<td style=\"width:2px; height:270px;\"><img src=\"images/schedule_border_270.gif\"></td>" +
			"</tr>" +
			"</table>";
    
		divDetails.html(html);
		divDetails.modal();
		
    }    
    else
    {
        $.modal.close();
    }
}

function defineElement(elementId)
{
    var leftPosition = getLeftPosition();
        
    document.getElementById(elementId).style.left = (leftPosition + 250);
}


function getLeftPosition()
{
	var windowWidth;
	var leftPosition;

	//ensure centering of footer text
	if (parseInt(navigator.appVersion) > 3) 
	{
 		if (navigator.appName.indexOf("Microsoft") != -1) 
		{
  			windowWidth  = document.body.offsetWidth;		
 		}
		else
		{
			windowWidth = document.width;			
		}

		leftPosition = ((windowWidth - 780) / 2);
    }
    
    return leftPosition;
}

