function start_onload () {
	if (document.getElementById("cbx_expertenmodus") && document.getElementById("cbx_expertenmodus").checked == true) {
		document.getElementById("mode_expert").style.display = "block";
	}
}

function check_form_status (el) {
	if (el.checked) {
		document.getElementById("mode_expert").style.display = "block";
	} else {
		document.getElementById("mode_expert").style.display = "none";
	}
	return true;
}


var pop = null;


function popdown() {
  if (pop && !pop.closed) pop.close();
}

function openvid (vidfile) {
	w = 530;  // 150px*150px is the default size
	h = 342;
	var l = (screen.width/2) - (w/2);
	var t = (screen.height/2) - (h/2);
	var args = 'width='+w+',height='+h+',left='+l+',top='+t+',resizable';
	popdown();
	pop = window.open('/files/video.php?vid_name='+vidfile,'',args);
	return (pop) ? false : true;
}

function popup(obj,w,h) {
  var url = (obj.getAttribute) ? obj.getAttribute('href') : obj.href;
  if (!url) return true;
  w = (w) ? w += 20 : 150;  // 150px*150px is the default size
  h = (h) ? h += 25 : 150;
  var l = (screen.width/2) - (w/2);
  var t = (screen.height/2) - (h/2);
  var args = 'width='+w+',height='+h+',left='+l+',top='+t+',resizable';
  popdown();
  pop = window.open(url,'',args);
  return (pop) ? false : true;
}

window.onunload = popdown;
window.onfocus = popdown;

