function loadEventsPane(artistId)
{

	document.title = "Columbia Records | Events";

	html = '<table width="100%" cellspacing="0" cellpadding="0" style="padding: 0px 0px 0px 5px; border-bottom: 1px solid #333333"><tr valign="top" align="left"><td><span id="header28">ARTISTS ON TOUR</span><td><tr></table>';
	getElement('secondary_1').style.width = "325px";
	getElement('secondary_2').style.width = "575px";

	html += '<tr valign="top" align="left"><td>';
	html += '<table width="100%" cellspacing="0" cellpadding="0"><tr valign="top" align="left"><td><div id="artistTourList"><table width="100%" cellspacing="0" cellpadding="0"><tr valign="top" align="left"><td>';

	var it = 0;
	
	for(var art in contentObj[1].listing)
	{
		artist = contentObj[1].listing[art];
		
		html += '<span id="genreListing"><a href="javascript:void(0);" onclick="jQuery(\'#secondary_2\').fadeOut(500, function() { loadArtistEvents(\''+ artist.artistId +'\'); })">'+ artist.artistName +'</span></a><br/>';
		
		if(it > 0 && ((it + 1) % 20 == 0)) html += '</td><td>';
		
		it++;
	}		
	
	html += '</td></tr></table></div></td></tr></table>';
	
	document.getElementById('secondary_1').innerHTML = html;
	

	html = '<table width="100%" cellspacing="0" cellpadding="0"><tr valign="top" align="left"><td style="padding: 0px 0px 0px 5px; border-bottom: 1px solid #333333"><span id="header28">UPCOMING APPEARANCES</span></td></tr>';
	html += '<tr><td height="5" /></tr>';
	html += '<tr valign="top" align="left"><td><div id="artistTourDatesDiv">';
	

	
	html += '</div></td></tr></table>';
		
	document.getElementById('secondary_2').innerHTML = html;
	
	if(artistId == null) 
	{
		loadEventsToday();
	} else {
		loadArtistEvents(artistId);
	}
	
	document.getElementById('secondary_2').style.display = "block";
	

	jQuery("#secondaryContainer").fadeIn(500, function(){});

}

function loadEventsToday()
{
	var html = '<table width="100%" cellspacing="5" cellpadding="0"><tr valign="top" align="left"><td>';
	
	var it = 0;
	
	var thisDate = "";
	
	var dateSegment = contentObj[0].today;
	
	for(property in dateSegment)
	{
		dates = dateSegment[property];
		
		html += '<div style="float: left; width: 100%;  height:auto; padding: 3px 3px 3px 0px; margin-bottom: 10px"><span id="tourListing"><b>'+ property +'</b></span></div>';
		
		for(var gn in dates)
		{
		
			var event = dates[gn];
			
			html += '<div style="float:left; width: 265px;  height:75px; border: 1px solid #333333; margin: 0px 3px 0px 0px"><div style="width: 80px; float:left;"><div id="imageDiv"><div style="position:relative; left: -30px; top: 0px"><img src="'+ event.artistImage +'" width="136" height="75" style="margin: 0px 0px 0px 0px; display: inline" /></div></div></div><div style="width: 175px; float:left;"><div id="tourListing"><b>'+ event.artistName +'</b><br/>'+ event.venue +'<br/></div><div id="tourListingSub">';

			var venueLocation = "";
			
			if(event.city != "") venueLocation += event.city;

			if(event.state != "")
			{
				if(event.city != "")
				{
					venueLocation += ', '+ event.state;
				} else {
					venueLocation += event.state;
				}
			}

			if(event.country != "-1" && event.country != "")
			{
				//venueLocation += ', '+ event.country;
				
				if(event.city != "" || event.state != "")
				{
					venueLocation += ', '+ event.country;
				} else {
					venueLocation += event.country;
				}		
			}

			html += venueLocation + '<br/>';

			if(event.infoLink != "")
			{
				html += '<a href="' + event.infoLink +'" target="_blank">More Info</a><br/>';	
			}

			if(event.tickets != "")
			{
				if(event.tickets == "sold out" || event.tickets == "SOLD OUT")
				{
					html += '<img src="images/soldout.jpg" width="60" height="16" border="0" />';	
				} else {
					html += '<a href="' + event.tickets +'" target="_blank"><img src="images/buy_tickets.jpg" width="60" height="16" border="0" /></a><br/>';
				}
			}

			html += '</div></div></div>';

			//if(it > 0 && ((it + 1) % 2 == 0)) html += '</tr><tr valign="top" align="left">';

	
		}
		html += '<div style="width: 100%; height 1px; clear:both; margin-bottom: 10px"></div>';
		
		it++;
	}
	
	html += '</td></tr></table>';
	
	if(it < 1)
	{
		html = '<div style="float: left; width: 543px;  height:auto; padding: 3px 3px 3px 0px; margin-bottom: 10px"><span id="tourListing">There are no upcoming appearances this week, please select an artist on tour from the left for dates further in the future.</span></div>';
	}
	
	document.getElementById('artistTourDatesDiv').innerHTML = html;
		
	
	document.getElementById('artistTourDatesDiv').style.height = "347px";;
	//jQuery('#artistTourDatesDiv').fadeIn(500);
	
}

function loadArtistEvents(artistNum)
{

	document.title = "Columbia Records | Events";
	
	var artist = contentObj[2].artistEvents[artistNum];
	
	html = '<table width="100%" cellspacing="0" cellpadding="0"><tr valign="top" align="left"><td style="padding: 0px 0px 0px 5px; border-bottom: 1px solid #333333"><span id="header28">'+ artist.artistName.toUpperCase() +'</span></td></tr>';
	html += '<tr><td height="20" /></tr>';
	html += '<div style="position: absolute; top: 45px; left:390px;"><span id="tourListing" width="100"><u>Date</u></span></div><div style="position: absolute; top: 45px; left:520px;"><span id="tourListing"><u>Venue</u></span></div><div style="position: absolute; top: 45px; left:840px;"><span id="tourListing" width="100"><u>Tickets</u></span></div>';
	html += '<tr valign="top" align="left"><td><div id="artistTourDatesDiv">';
	html += '<table width="100%" cellspacing="5" cellpadding="0">';
	var it = 0;
	
	for(var gn in artist.events)
	{
		var event = artist.events[gn];
		
		if(it % 2 == 0)
		{
			bgColor = "#1e1e1e";
		} else {
			bgColor = "transparent";
		}
		
		html += '<tr valign="top" align="left"><td><table width="100%" cellspacing="0" cellpadding="0" style="background-color: '+ bgColor +';border: 1px solid #333333"><tr valign="top" align="left"><td width="130"><span id="tourListing"><b>'+ event.eventDate + '</b></td><td><span id="tourListing">'+event.venue +'<br/></span><span id="tourListingSub">';
		
		var venueLocation = "";
		if(event.city != "") venueLocation += event.city;
		
		if(event.state != "")
		{
			if(event.city != "")
			{
				venueLocation += ', '+ event.state;
			} else {
				venueLocation += event.state;
			}
		}
		
		if(event.country != "-1" && event.country != "")
		{
			//venueLocation += ', '+ event.country;
			if(event.city != "" || event.state != "")
			{
				venueLocation += ', '+ event.country;
			} else {
				venueLocation += event.country;
			}		
		}
		
		html += venueLocation + '<br/>';

		if(event.infoLink != "")
		{
			html += '<a href="' + event.infoLink +'" target="_blank">More Info</a><br/>';	
		}
		html += '</span></td>';
		html += '<td width="100">';
			if(event.tickets != "")
		{
			if(event.tickets == "sold out" || event.tickets == "SOLD OUT")
			{
				html += '<img src="images/soldout.jpg" width="60" height="16" border="0" />';	
			} else {
				html += '<a href="' + event.tickets +'" target="_blank"><img src="images/buy_tickets.jpg" width="60" height="16" border="0" /></a><br/>';
			}
		}
		html += '</td>';
		html += '</tr></table></td></tr>';
	
		
		it++;
	}
	
	html += '</table></div></td></tr></table>';
	
	document.getElementById('secondary_2').innerHTML = html;
	
	document.getElementById('artistTourDatesDiv').style.height = "330px";
	jQuery('#secondary_2').fadeIn(500);
	
}
