function AutoFocus() {
	if (document.getElementById('auto_focus')) {
		document.getElementById('auto_focus').focus();
	}
}

function HighLightMenu(id, action) {
	if (action == "hl") {
		document.getElementById(id).style.backgroundColor='#b4dbc2';
	} else if (action == "no") {
		document.getElementById(id).style.backgroundColor='#d6f3e1';
	}
}

function AskAndGoTo(id) {
	if (confirm(delete_question)) {
		location.href = base_url_for_delete + id;
	}
}

var all_custom_del_question = 'You are going to delete all the records in this list. Are you sure?';

function DeleteAllCustomIPWhite() {
	if (confirm(all_custom_del_question)) {
		location.href = '/index.php?data[action][]=members&data[action][]=cust_ip&data[action][]=del_all_white';
	}
}

function DeleteAllCustomIPBlock() {
	if (confirm(all_custom_del_question)) {
		location.href = '/index.php?data[action][]=members&data[action][]=cust_ip&data[action][]=del_all_block';
	}
}

function DeleteAllCountry() {
	if (confirm(all_custom_del_question)) {
		location.href = '/index.php?data[action][]=members&data[action][]=country&data[action][]=del_all_country';
	}
}

function UpgradeAlert() {
	alert('This option is not available based on your traffic expectations.\nPlease choose a higher level!');
}

function UpgradeForm(id, platinum) {
	if (id == platinum) {
		if (!confirm("Platinum membership requires custom software installation on your server.\nPlease only choose this option if you have previously been in touch with us and we confirmed that you are eligible for this membership.\nIf you haven't received confirmation from us, please contact us!")) {
			return;
		}
	}
	document.getElementById("upgrade_form_id_" + id).submit();
}

function CancelQuestion(link) {
	if (confirm('You are about to cancel the recurring of your premium membership.\nAre you sure?')) {
		location.href = link;
	}
}
