
///////////////////////////////////////////////////////////////// DELETE Actions

function deleteContactEmail(contact_id)
{
	var myAjax = new Ajax.Request('/action_del_contactmail.php', 
								{ 
									method: 'get', 
									parameters: 'contact_id='+contact_id,
									onComplete: function(t){ 
										Effect.SwitchOff($('con_mail_' + contact_id), {duration: 0.7});
									}
								} );
}

function deleteInterest(interest_id)
{
	var myAjax = new Ajax.Request('/action_del_interest.php', 
								{ 
									method: 'get', 
									parameters: 'interest_id='+interest_id,
									onComplete: function(t){ 
										Effect.SwitchOff($('interest_' + interest_id), {duration: 0.7});
										updateWidget('wgt_interests');
									}
								} );
}


function deleteProjectPub(project_id, pub_id)
{
	var myAjax = new Ajax.Request('/action_del_project_pub.php', 
								{ 
									method: 'post', 
									parameters: 'pub_id=' + pub_id + '&project_id=' + project_id,
									onComplete: function(t){ 
										Effect.SwitchOff($('div_pub_'+pub_id), {duration: 0.7});
									}
								} );
}

function deleteDepartment(dep_id)
{
	var myAjax = new Ajax.Request('/action_del_department.php', 
								{ 
									method: 'get', 
									parameters: 'dep_id=' + dep_id,
									onComplete: function(t){ updateWidget('wgt_departments'); }
								} );
}

function deleteCourse(course_id)
{
	var myAjax = new Ajax.Request('/action_del_course.php', 
								{ 
									method: 'post', 
									parameters: 'course_id=' + course_id,
									onComplete: function(t){ updateWidget('wgt_courses'); }
								} );
}

function deleteAward(award_id)
{
	var myAjax = new Ajax.Request('/action_del_award.php', 
								{ 
									method: 'post', 
									parameters: 'award_id=' + award_id,
									onComplete: function(t){ updateWidget('wgt_awards'); }
								} );
}

function deleteEducation(education_id)
{
	var myAjax = new Ajax.Request('/action_del_education.php', 
								{ 
									method: 'post', 
									parameters: 'education_id=' + education_id,
									onComplete: function(t){ updateWidget('wgt_education'); }
								} );
}

function deleteCV(cv_id)
{
	var myAjax = new Ajax.Request('/action_del_cv.php', 
								{ 
									method: 'post', 
									parameters: 'cv_id=' + cv_id,
									onComplete: function(t){ updateWidget('wgt_cv'); updateWidget('wgt_user_work'); }
								} );
}

function deleteProject(project_id)
{
	var myAjax = new Ajax.Request('/action_del_project.php', 
								{ 
									method: 'post', 
									parameters: 'project_id='+project_id,
									onComplete: function(t){ updateWidget('wgt_projects'); }
								} );
}

function deleteMessageThread(message_id)
{
	var myAjax = new Ajax.Request('/action_del_message_thread.php', 
								{ 
									method: 'get', 
									parameters: 'message_id='+message_id
								} );
}

function deletePublication(pub_id)
{
	var myAjax = new Ajax.Request('/action_del_pub.php', 
								{ 
									method: 'post', 
									parameters: 'pub_id='+pub_id,
									onComplete: function(t){ updateWidget('wgt_pubs'); }
								} );
}

function deleteEvent(conference_id)
{
	var myAjax = new Ajax.Request('/action_del_event.php', 
				{ 
					method: 'post', 
					parameters: 'conference_id='+conference_id,
					onComplete: function(t){ 
						var response = eval('('+t.responseText+')');

						if (response.result)
							Element.hide('event_'+conference_id);
						else
							alert(response.message);
					}
				} );
}

