/*
	/calendar/calendar.js:	This file includes all javascript specific to the calendar functions of the Kennedy Center website.

	MODIFICATIONS:
	9/29/05 - Lisa Haas - created
	2/7/08 - Joe Dickerson - added ajax functionality using YUI dialog box
    5/31/11 - Joe Dickerson - migrated to jQuery. simplified
*/

var loadingText = 'Loading...';

var mouseEvent;
var current_id;


function displayPrices(data) {
    $("#perf_pricing").html(data);
}

function showPrices(show) {
    if (show) {
        $("#pricing_dialog").dialog('open');	
    } else {
        $("#pricing_dialog").dialog('close');	
    }
}

/*
 * 
 */

function loadPrices(perf_no, venue,mos,dt,link,show_avail){
		var _id = 'perf_pricing';
		showPrices(true);
		if(perf_no != current_id){
		    $("#perf_pricing").html(loadingText);
			var _link = '/calendar/dsp_perf_pricing.cfm?perf_no=' + perf_no + '&venue=' + venue + '&id=' + _id + '&mos=' + mos + '&dt=' + dt + '&purchase_link=' + link + '&show_avail=' + show_avail;
			$.get(_link, displayPrices);
			current_id = perf_no;
		}	
}


