function displayEvent(evnt, title){
	$('#calDialog').dialog('destroy');
	$("#calDialog").load('ajax/ajax.cfm', 'eId='+evnt).dialog({
		title: title,
		modal: true,
		height:315,
		width:400,
		close: function(){
			$('#calDialog').empty()
		}
	});
}

$(document).ready(function (){
	 $(".eLink").tooltip({ effect: 'slide'}); 
});

function addE(){
	$("#calDialog").dialog('destroy');
	$("#calDialog").load('ajax/ajax.cfm', 'new=true').dialog({
		title: 'Add New Event',
		modal: true,
		height:480,
		width:475,
		close: function(){
			$('#calDialog').empty()
		}
	})
}

function editE(){
	$("#calDialog").dialog('destroy');
	$("#calDialog").load('ajax/ajax.cfm', 'editStepOne=true').dialog({
		title: 'Edit Event',
		modal: true,
		height:270,
		width:515,
		close: function(){
			$('#calDialog').empty()
		}
	})
}

function showEditPage(val){
	$("#calDialog").css("height", "500px").dialog('option', 'position', 'center');		
	$('#editStuff').load('ajax/ajax.cfm', 'editStepTwo=true&selection='+val);
}

function deleteE(){
	$("#calDialog").dialog('destroy');
	$("#calDialog").load('ajax/ajax.cfm', 'delete=true').dialog({
		title: 'Edit Event',
		modal: true,
		height:270,
		width:515,
		close: function(){
			$('#calDialog').empty()
		}
	})
}

function confirmDelete(){
		if($("#deleteSel").val() == ''){
			alert('You must make a selection');
			return false;
		}
		else{
			var answer = confirm("Are you sure?");
			if(answer){
				return true;
			}
			else
				return false;
		}
}
