// ########################
// CALENDAR
// ########################
function updateCalendar(mn, yr){
	$.get("ajax_display_calendar.php", {m:mn, y:yr}, function(data){
		$("#calendar").html(data);
	});
}

// ########################
// NEWS
// ########################
function displayNewsItem(id){
	$.get("ajax_display_news_item.php", {id:id}, function(data){
		$("#news-item").html(data);
	});
}

function displayNewsItemsForPage(pg){
	$.get("ajax_display_news_items_for_page.php", {pg:pg}, function(data){
		$("#news-items").html(data);
	});
}

// ########################
// REVIEWBOARD (HAVE YOUR SAY)
// ########################
function getReviewboardForPage(page){
	$.get("ajax_get_reviewboard_for_page.php", {pg:page}, function(data){
		$("#reviewboard").html(data);
	});
}

//########################
// EVENT SEARCH
//########################
function searchEvents(type){
	$.get("ajax_search_events.php", {t:type}, function(data){
		$(".eventslist").html(data);
	});
}

function searchCategories(type, category){
	$.get("ajax_search_categories.php", {t:type, c:category}, function(data){
		$(".eventslist").html(data);
	});
}

function searchVenues(type, id){
	$.get("ajax_search_venues.php", {t:type, id:id}, function(data){
		$(".eventslist").html(data);
	});
}

function searchArtists(type, artist){
	$.get("ajax_search_artists.php", {t:type, a:artist}, function(data){
		$(".eventslist").html(data);
	});
}

// ########################
// PRIMITIVES
// ########################
function displayPopup(msg){
	$('#popup-message').dialog({
		autoOpen:false,
		buttons:{'Ok':function(){$(this).dialog("close");}},
		closeOnEscape:true,
		draggable:false,
		modal:true,
		resizable:false,
		title:'Information',
		width:480
	});
	$('#popup-message').html(msg);
	$('#popup-message').dialog('open');
}

function displayDialog(msg){
	$('#popup-message').dialog({
		autoOpen:false,
		closeOnEscape:true,
		draggable:false,
		modal:true,
		resizable:false,
		title:'Login',
		width:480
	});
	$('#popup-message').html(msg);
	$('#popup-message').dialog('open');
}

function confirmDelete(){
	input_box=confirm("Are you sure you want to delete?\nClick OK to confirm or CANCEL to cancel.");
	if (input_box == true){
		document.admin_delete.submit();
	}
}

function jmMoveToByLngLat(lng, lat, zoom){
	$('#map').jmap('MoveTo',{
		'mapCenter':[lng,lat],
		'mapZoom':zoom,
		'centerMethod':'pan'
	});
}
