﻿
// Algemene functies

function ChngLblCatnrsHerbep() {
	with (document.getElementById("lblCatnrsHerbep")) {
		style.color="#ff9933";
		innerText="De cat.volgnrs wordt aangepast...";
		visible=true;
	}
}

function ChngLblMkCopy() {
	with (document.getElementById("lblMkCopy")) {
		style.color="#ff9933";
		innerText="De kopie wordt gemaakt...";
		visible=true;
	}
}

function ChngLblMkPg() {
	with (document.getElementById("lblMkPg")) {
		style.color="#ff9933";
		innerText="De pagina wordt aangepast...";
		visible=true;
	}
}

function CheckForm() {
	if (Trim(document.getElementById("txtNaam")).value==""
	 || Trim(document.getElementById("txtEmail")).value==""
	 || Trim(document.getElementById("txtTelnr")).value==""
	 || Trim(document.getElementById("txtVraag")).value=="") {
		alert("Vul svp. alle gegevens in");
		return false;
	} else {
		return true;
	}
}

function confirmDelete() {
	return confirm("Weet je zeker dat deze link verwijderd moet worden?");
}

function Hide(id) {
  document.getElementById('shdw-'+id).style.display="none";
	document.getElementById(id).style.display="none";
	with (document.getElementById('atag'+id).style) {
	  //borderBottom="none"
	  borderBottom = "dashed 1px #0a9cb5"
	  color = "#ffffaa"//"#666666"
	}
}
function Show(id) {
	objElm=document.getElementById('atag'+id);
	objElm.style.color = "#ffffff" //"#ffffaa"
	objElm.style.borderBottom="solid 1px #ffffaa"
	var elmTop=objElm.offsetTop;
	while (objElm.tagName!='BODY') {
		objElm=objElm.offsetParent;
		elmTop+=objElm.offsetTop;
	}
  objElm=document.getElementById(id);
	with (objElm.style) {
		top=elmTop+'px';
		display="block";
	}
  shdwElm=document.getElementById('shdw-'+id);
  shdwElm.innerHTML=objElm.innerHTML;
  shdwElm.style.top=elmTop+3+'px';
	shdwElm.style.display="block";
}

function setContentSize() {
  var hghtHdr1 = document.getElementById("header-container").offsetHeight;
  var hdr2Cont = document.getElementById("header2-container");
  var hghtHdr2 = 0;
  if (hdr2Cont != null) hghtHdr2 = hdr2Cont.offsetHeight;
	var hghtFtr = document.getElementById("footer-container").offsetHeight;
	var hghtCntN = document.body.offsetHeight - hghtHdr1 - hghtHdr2 - hghtFtr;
	if (hghtCntN < 0) hghtCntN = 0;
	document.getElementById("content-container").style.height = hghtCntN + "px";		//IE (+ FF ?)
	document.getElementById("content-container").style.minHeight = hghtCntN + "px"; //FF (niet IE !)
}

function Trim(Field) {
	var I=0
	while(Field.value.charAt(I)==" ") {I++}
	Field.value=Field.value.substring(I,Field.value.length)
	var I=Field.value.length -1
	while(Field.value.charAt(I)==" ") {I--}
	Field.value=Field.value.substring(0,I+1)
	return Field
}

function WrtMlLnk(part1, part2, part3, part4) {
	if (part4=="") {
		document.write ("<a href='mailto:"+part1+"@"+part2+"."+part3+"' title='"+part1+"'>"+part1+"@"+part2+"."+part3+"</a>");
	} else {
		document.write ("<a href='mailto:"+part1+"@"+part2+"."+part3+"'>"+part4+"</a>");
	}
}

