function Admin() {

	const
		links = document.querySelectorAll('.operation.link'),
		views = document.querySelectorAll('.operation.link'),
		iframe = document.getElementById('script'),
		btn = document.getElementById('execute'),
		php = config.a + 'server/maintenance/';

	let current_view = 0;

	btn.addEventListener('click', () => {
		const view = document.querySelector(`#view_${current_view}`);
		let text = 'Can you confirm you want to ' + view.firstElementChild.innerHTML + ' ?';
		if (confirm(text) == true) iframe.src = php + view.dataset.script + '.php';
		else return;
	}, false);

	links.forEach(el => {

		el.addEventListener('click', () => event.preventDefault());

		el.addEventListener('mouseover', function() {
			const
				n = parseInt(el.dataset.num, 10),
				old_link = document.querySelector(`#link_${current_view}`),
				old_view = document.querySelector(`#view_${current_view}`),
				new_view = document.querySelector(`#view_${n}`);

			old_link.classList.remove('current');
			old_view.classList.toggle('off');

			current_view = n;
			el.classList.add('current');
			new_view.classList.toggle('off');
			iframe.src = "";

		})

	});

};

document.addEventListener("DOMContentLoaded", Admin());