function end_session () {
	
	if (confirm("Are you sure you wish to end this session?\n\r\n\rWarning: Doing so will lose your current clients.txt file!") == true) {
		
		window.location = "?act=maniclients&sub=endsession";
		
	}

}

function delete_admingroup (id) {
	
	if (confirm("Are you sure you wish to delete this group?")) {
		
		window.location = "?act=maniclients&del=admingroup&id=" + id;
		
	}

}

function delete_player (id) {
	
	if (confirm("Are you sure you wish to delete this player?")) {
		
		window.location = "?act=maniclients&del=player&id=" + id;
		
	}

}

function mm_delete_admingroup (id) {
	
	if (confirm("Are you sure you wish to delete this group?")) {
		
		window.location = "?act=mani&task=clients&del=admingroup&id=" + id;
		
	}

}

function mm_delete_client (id) {
	
	if (confirm("Are you sure you wish to delete this player?")) {
		
		window.location = "?act=mani&task=clients&del=player&id=" + id;
		
	}

}

function mm_servers_jobs (server_id, job_type) {
	
	if (confirm("Are you sure you wish to install mani admin on this server?")) {
		
		window.location = "?act=mani&task=servers&sub=jobs&servid=" + server_id + "&jtype=" + job_type;
		
	}

}

function mm_delete_advert (id) {
	
	if (confirm("Are you sure you wish to delete this advert?")) {
		
		window.location = "?act=mani&task=settings&sub=adverts&del=" + id;
		
	}

}

function mm_delete_webshortcut (id) {
	
	if (confirm("Are you sure you wish to delete this Web Shortcut?")) {
		
		window.location = "?act=mani&task=settings&sub=webshortcutlist&del=" + id;
		
	}

}

function create_cookie(name, value, days) {

	if (days) {
		
		var date = new Date();
		date.setTime(date.getTime() + (days*24*60*60*1000));
		var expires = "; expires=" + date.toGMTString();
		
	} else {
		
		var expires = "";
		
	}
	
	document.cookie = name + "=" + value + expires + "; path=/";
	
}

function mm_swap_visibility(id) {
	
	var style = document.getElementById(id).style;
	
	if (style.display == "none") {
		
		style.display = "";
		//create_cookie(id, "", "365")
		
	} else {
		
		style.display = "none";
		//create_cookie(id, "none", "365")
		
	}
	
}