/**
 * venues.js - venues specific javascript
 *
*/

/**
 * resizes the tabs on-screen
 *
 * @return void
 * @author Tim Cromwell
 **/
$(document).ready(function () 
{
    resizeTabs("#venue_tabs");
});



/**
 * ascertains details for the provided venue and displays the information in a modal window
 *
 * @return void
 * @param int venueID the venue id
 * @author Tim Cromwell
 **/
function displayVenue(venueID)
{
	// get the artist details via ajax
	$.get("/ajax-data/?venue-id=" + venueID, 
		function(data) 
		{
			var jsonData = eval('(' + data.replace(/\n/g, '') + ')');
						
			// create the html content
			var htmlContent = "<h2 class=\"modal_title\">" + jsonData.venue_detail.venue_name + "</h2>";
			
			// if there is an image, output it
			if (jsonData.venue_detail.venue_large_photo.photo_filename != '')
			{
				var photoSrc = jsonData.venue_detail.workspace + jsonData.venue_detail.venue_large_photo.photo_path + "/" + jsonData.venue_detail.venue_large_photo.photo_filename;
				htmlContent += "<img class=\"venue_img\" src=\"" + photoSrc + "\" />";
			}
			
			// the artist bio
			htmlContent += "<div class=\"venue_description\">";
			htmlContent += jsonData.venue_detail.venue_description;
			htmlContent += "</div>";

			// insert the content into the popup
			$('div#modal_window_dynamic_content').html(htmlContent);
			
			// display the popup
			showModalWindow();
		}
	);
}


