function swapImg(imgField,staat) {
  if (document.images) {
    document[imgField].src = eval(imgField + staat + ".src")
  }
}

function popUp(url, breedte, hoogte) {
  newWin = window.open(url, "swellpopup", "width="+breedte+",height="+hoogte+",location=no,status=no,toolbar=no,menubar=no,scrollbars=yes,resizable=yes");
}

function openUrl(url) {
  NewWin=window.open(url, "swelllinks","width=650,height=530,location=yes,status=yes,toolbar=no,menubar=no,resizable=yes,scrollbars=yes");
  NewWin.focus();
}

function openWin(url) {
  newWin = window.open(url, "robametals","width=800,height=500,location=no,status=yes,toolbar=no,menubar=no,resizable=yes,scrollbars=yes");
}

function swapNav(imgName,status) {
  if (document.images) {
    document[imgName].src = eval(imgName + status + ".src")
  }
}


function doHideDiv(layerName) {
	f = "hideDiv('" + layerName + "')";
	setTimeout(f, 500);
}

function getLayer(sLayerName) {
  var oLayer = null;
  if (document.all) { // IE
    oLayer = document.all[sLayerName].style;
  } else if (document.layers) { // NS4
    oLayer = document.layers[sLayerName];
  } else if (document.getElementById) { // NS6
    oLayer = document.getElementById(sLayerName).style;
  }
  return oLayer;
}


function showDiv(sLayerName) {
  var oLayer = null;
  if (document.all) { // IE
    oLayer = document.all[sLayerName].style;
  } else if (document.layers) { // NS4
    oLayer = document.layers[sLayerName];
  } else if (document.getElementById) { // NS6
    oLayer = document.getElementById(sLayerName).style;
  }
  oLayer.visibility = 'visible';
}

function hideDiv(sLayerName) {
  var oLayer = null;
  if (document.all) { // IE
    oLayer = document.all[sLayerName].style;
  } else if (document.layers) { // NS4
    oLayer = document.layers[sLayerName];
  } else if (document.getElementById) { // NS6
    oLayer = document.getElementById(sLayerName).style;
  }
  oLayer.visibility = 'hidden';
}

function alterObjectContent(deDiv, deContent) {
	if (document.getElementById) {
		document.getElementById(deDiv).innerHTML = deContent;
	}	else if (document.all) {
		deDiv.innerHTML = deContent;
	}
}

function blockDiv(sLayerName) {
  var oLayer = null;
  if (document.all) { // IE
    oLayer = document.all[sLayerName].style;
  } else if (document.layers) { // NS4
    oLayer = document.layers[sLayerName];
  } else if (document.getElementById) { // NS6
    oLayer = document.getElementById(sLayerName).style;
  }
  oLayer.visibility = 'visible';
  oLayer.display = 'block';
}

function noneDiv(sLayerName) {
  var oLayer = null;
  if (document.all) { // IE
    oLayer = document.all[sLayerName].style;
  } else if (document.layers) { // NS4
    oLayer = document.layers[sLayerName];
  } else if (document.getElementById) { // NS6
    oLayer = document.getElementById(sLayerName).style;
  }
  oLayer.visibility = 'hidden';
  oLayer.display = 'none';
}

actieveDiv = null;
function showUitleg(divNaam) {
	if (actieveDiv != null ) {
		noneDiv(actieveDiv);
	}
	if (actieveDiv != divNaam)	{
		blockDiv(divNaam);
	}
	actieveDiv = divNaam;
}

function rand(a,b) {
	num = Math.random();
	num = (num*(b-a))+a;
	num = Math.round(num);
	return num;
}

function showSwfAlert(nr) {
	showDiv("divSwfAlert" + nr);
}



function chgImageField(veld, waarde) {
  document.invoer[veld].value = waarde;
}

function showImage(src, afb) {
  if (document.images) {
    document[src].src = afb + "?" + Math.random()*1000;
  }
}

function clearImage(welke) {
  chgImageField(welke,'');
  a = "de" + welke;
  showImage(a, "images/1x1trans.gif");
}


function checkOk(url) {
  if (confirm("Weet u zeker dat u dit item wilt verwijderen?")) {
    location.href=url;
  }
}


function getX(obj) {
	var curleft = 0;
	if(obj.offsetParent)
		while(1) {
			curleft += obj.offsetLeft;
			if(!obj.offsetParent)
				break;
			obj = obj.offsetParent;
		} else if(obj.x)
			curleft += obj.x;
	return curleft;
}

function getY(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curtop += obj.offsetTop
		}
	}
	return curtop;
}