function setSubmenusEN() {
	// about menu
	obj = document.getElementById('submenu_about');
	var leftpx = (document.body.offsetWidth / 2) - 96;
	obj.style.left = leftpx + 'px';
	
	// about chr. menu
	obj = document.getElementById('submenu_about_chr');
	var leftpx = (document.body.offsetWidth / 2) + 171;
	obj.style.left = leftpx + 'px';

	// order materials menu
	obj = document.getElementById('submenu_order');
	var leftpx = (document.body.offsetWidth / 2) + 216;
	obj.style.left = leftpx + 'px';
}

function setSubmenusGR() {
	// about menu
	obj = document.getElementById('submenu_about');
	var leftpx = (document.body.offsetWidth / 2) - 141;
	obj.style.left = leftpx + 'px';
	
	// about chr. menu
	obj = document.getElementById('submenu_about_chr');
	var leftpx = (document.body.offsetWidth / 2) + 88;
	obj.style.left = leftpx + 'px';

	// order materials menu
	obj = document.getElementById('submenu_order');
	var leftpx = (document.body.offsetWidth / 2) + 268;
	obj.style.left = leftpx + 'px';
}

function setLanguages() {
	obj = document.getElementById('languages');
	var leftpx = (document.body.offsetWidth / 2) - 348;
	obj.style.left = leftpx + 'px';
	// de vlaggen uiteindelijk plaatsen
	obj.style.display = 'block';
}

function sw_button_on(obj) {
	obj.style.backgroundColor = "#FFFFFF";
	obj.style.cursor = "hand";
}

function sw_button_off(obj) {
	obj.style.backgroundColor = "";
}

function sw_subbutton_on(obj) {
	obj.style.backgroundColor = "#000180";
	obj.style.color = "#FFFFFF";
	obj.style.cursor = "hand";
}

function sw_subbutton_off(obj) {
	obj.style.backgroundColor = "#FFFFFF";
	obj.style.color = "#000000";
}

function sw_menu_on(id) {
	obj = document.getElementById(id);
	obj.style.display = "block";
}

function sw_menu_off(id) {
	obj = document.getElementById(id);
	obj.style.display = "none";
}

function lnk_to(node, page) {
	location.href = page + "?node=" + node;
}

function openPlayer(file, showDownloadButton) {
	// window name
	var windowName = Date();
	
	windowName = replaceAll(windowName, " ", "");
	windowName = replaceAll(windowName, ":", "");
	windowName = "Player_" + windowName;
	
	// window openen
	window.open('player/player.php?file=' + file + '&db='+ showDownloadButton +'', windowName, 'width=260,height=70,scrollbars=no,toolbar=no,location=no'); 
}

function replaceAll(str, from, to) {
  var idx = str.indexOf(from);
  while (idx > -1) {
    str = str.replace(from, to);
    idx = str.indexOf(from);
  }
  return str;
}
