// Front end ajax functions

// Call the python function get alert string and del the session
function AjaxDeleteSession(id){
	$.post('/ajax/delsess/'+id+'/', function(data){
		if(data != 'none'){
			alert(data);
		}
	});
}

// 
function ajaxDelImg(id, img, num, mode){
	if(confirm('Are you sure you want to delete this image?')){
		$.post('/ajax/delimg/' + mode +'/' + id + '/' + img + '/', function(data){
			$(".imgdel_hide"+num).hide();
			$(".imgdel_show"+num).show();
			if(mode == 'logo'){
			   toggle_logo('cancel')
			}
		});
	}
}
