/* Print functie */
var hoog = 0;
function printDocument(){
    window.print();
}
function Footer() {
	var docHoog = GetHeight();
	var BodyHoog=getBodyHeigth();
	
	if (BodyHoog <= docHoog) {		
		hoog = BodyHoog;
		document.getElementById('allcontentpane').style.height = (docHoog - 319) + "px";
	}
	//window.onresize = ResizeFooter;
}

function GetHeight() {
  var myHeight = 0;
  if(typeof(window.innerHeight) == 'number') {
    //Non-IE
    myHeight = window.innerHeight;
  } else if(document.documentElement && document.documentElement.clientHeight) {
    //IE 6+ in 'standards compliant mode'
    myHeight = document.documentElement.clientHeight;
  } else if(document.body && document.body.clientHeight) {
    //IE 4 compatible
    myHeight = document.body.clientHeight;
  }
  return myHeight;
}

function getBodyHeigth(){
	return (document.documentElement && document.documentElement.scrollHeight) ? document.documentElement.scrollHeight: (document.body.scrollHeight > document.body.offsetHeight) ? document.body.scrollHeight: document.body.offsetHeight;
}

function StartChange(id, time) {
	setTimeout("AddColor('" + id + "')", time);
}
function AddColor(id) {
	document.getElementById(id).className += " RechtsOranje";
	setTimeout("RemoveColor('" + id + "')", 500);
}
function RemoveColor(id) {
	document.getElementById(id).className = "rightbaritemcontent";

	huidig++;
	if (huidig>aantal) {
		huidig=0;
	}
	
	setTimeout("AddColor('" + strArr[huidig] + "')", 500);
}

function SwitchVisible(visibleObj, hiddenObj){
	document.getElementById(visibleObj).style.display = "none";
	document.getElementById(hiddenObj).style.display = "block";
}

function NirasDialogen() {
	var inOrde=true;
	if ((document.NirasDialoog.Mail.value == "") || (document.NirasDialoog.Naam.value == "") || (document.NirasDialoog.Voornaam.value == "")) {
		inOrde = false;
		alert('De velden aangeduid met een asterisk (*) moeten worden ingevuld.');
	} else if ((document.NirasDialoog.Organisatie[0].checked) && (document.NirasDialoog.Sector.value=="")) {
		alert('U moet nog een sector invullen!')
		inOrde = false;
	} else if (!EmailControle(document.NirasDialoog.Mail.value)) {
		inOrde=false;
		alert('U moet nog een correct e-mail adres invullen!');
		frm.Mail.focus();
	}
	return inOrde;
}

function NirasConferentie() {
	var inOrde=true;
	if ((document.InterConferentie.Mail.value == "") || (document.InterConferentie.Naam.value == "") || (document.InterConferentie.Voornaam.value == "")) {
		inOrde = false;
		alert('De velden aangeduid met een asterisk (*) moeten worden ingevuld.');
	} else if ((document.InterConferentie.Functie.value == "") || (document.InterConferentie.organisatie.value == "") || (document.InterConferentie.vakgebied.value == "")) {
		inOrde = false;
		alert('De velden aangeduid met een asterisk (*) moeten worden ingevuld.');
	} else if (!EmailControle(document.InterConferentie.Mail.value)) {
		inOrde=false;
		alert('U moet nog een correct e-mail adres invullen!');
		frm.Mail.focus();
	}
	return inOrde;
}

function NirasDialogenFR() {
	var inOrde=true;
	if ((document.NirasDialoog.Mail.value == "") || (document.NirasDialoog.Naam.value == "") || (document.NirasDialoog.Voornaam.value == "")) {
		inOrde = false;
		alert('Les champs avec un astérisque sont à compléter.');
	} else if ((document.NirasDialoog.Organisatie[0].checked) && (document.NirasDialoog.Sector.value=="")) {
		alert('U moet nog een sector invullen!')
		inOrde = false;
	} else if (!EmailControle(document.NirasDialoog.Mail.value)) {
		inOrde=false;
		alert('Veuillez introduire une adresse e-mail valable!');
		frm.Mail.focus();
	}
	return inOrde;
}

function NirasConferentieFR() {
	var inOrde=true;
	if ((document.InterConferentie.Mail.value == "") || (document.InterConferentie.Naam.value == "") || (document.InterConferentie.Voornaam.value == "")) {
		inOrde = false;
		alert('Les champs avec un astérisque sont à compléter  .');
	} else if ((document.InterConferentie.Functie.value == "") || (document.InterConferentie.organisatie.value == "") || (document.InterConferentie.vakgebied.value == "")) {
		inOrde = false;
		alert('Les champs avec un astérisque sont à compléter .');
	} else if (!EmailControle(document.InterConferentie.Mail.value)) {
		inOrde=false;
		alert('Veuillez introduire une adresse e-mail valable!');
		frm.Mail.focus();
	}
	return inOrde;
}

function NaamEmailControle(frm) {
	var inOrde=true;
	if ((frm.Mail.value=="") || (frm.Naam.value=="") || (frm.Voornaam.value=="")) {
		inOrde=false;
		alert('De velden aangeduid met een asterisk (*) moeten worden ingevuld.');
	} else if (!EmailControle(frm.Mail.value)) {
		inOrde=false;
		alert('U moet nog een correct e-mail adres invullen!');
		frm.Mail.focus();
	}
	return inOrde;
}

function EmailControle(str) {
	var inOrde = true;
	var re = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+(\.[a-zA-Z]{2,4})+$/;
	if (re.test(str)) {
		inOrde = true;
	} else {
		inOrde = false;
	}
	return inOrde;
}

