﻿
function popup(url, name, h, w, t)
{
	var x;
	
	x = Math.ceil( (window.screen.width  - w) / 2 );
	h = h + 20;
	if (t == -1) {
		t = Math.ceil( (window.screen.height  - h) / 2 );
	}
	
	popUp = window.open(url,name,'toolbar=no,directories=no,menubar=0,status=no,scrollbars=no,resizable=0,height=' + h + ',width=' + w + ',left=' + x + ',top=' + t);
	
	if (popUp != null) {
		popUp.focus();
	}
}

function popupScroll(url, name, h, w, t)
{
	var x;
	
	x = Math.ceil( (window.screen.width  - w) / 2 );
	h = h + 20;
	if (t == -1) {
		t = Math.ceil( (window.screen.height  - h) / 2 );
	}
	
	popUp = window.open(url,name,'toolbar=no,directories=no,menubar=0,status=no,scrollbars=auto,resizable=0,height=' + h + ',width=' + w + ',left=' + x + ',top=' + t);
	
	if (popUp != null) {
		popUp.focus();
	}
}

function GoTo(url) {
	document.location.href = url;
}

function showControl(id)
{
	var e = document.getElementById(id);
	if (e != null)
	{
		e.style.visibility = "visible";
		e.style.display = "inline";
	}
}

function hideControl(id)
{
	var e = document.getElementById(id);
	if (e != null)
	{
		e.style.visibility = "hidden";
		e.style.display = "none";
	}
}

function ClearControl(e, oIdControl)
{
	document.getElementById(oIdControl).value = "";
	document.getElementById(e).innerHTML = "<span class='lookupspan'>(Niet gespecificeerd)</span>";	
}

function tabMouseOver(e) {
	while (e.tagName != "TABLE") {
		e = e.parentNode;
	}

	e.setAttribute("save-classname", e.className);
	e.className = 'tabov';
}

function tabMouseOut(e) {		
	while (e.tagName != "TABLE") {
		e = e.parentNode;
	}
	
	e.className = e.getAttribute("save-classname");
}

function ChangeClassName(e, className) {		
	if (e != null)
		e.className = className;
}

function SetFocus(id) {
  var e = document.getElementById(id);
  if (e != null)
    e.focus();
}

function GetUrlWithoutQS(url) {
	var loc = url.lastIndexOf('?');
	
	if (loc == -1)	
		return url;
	else
		return url.substring(0, loc);
}

