function setAdvValue(ID) { 
	advValue = ID; 
}

function checkEmail(strEmail) { return (strEmail.search(/^[\w\.\-_]*[A-Z|a-z|0-9]{1}@([\w\-_]+\.)+[A-Za-z]{2,4}$/) != -1) }

function trapEnter(e, enterFunction){
	try {
		if (!e) e = window.event;
		if (e.keyCode == 13) {
			e.cancelBubble = true;
			if (e.returnValue) e.returnValue = false;
			if (e.stopPropagation) e.stopPropagation();
			if (enterFunction) eval(enterFunction);
			return false;
		} else {
			return true;
		}
	}
	catch (e) {  }
}

function fnLoginRight() {
	var oFrm = document.forms.frmLoginRight;
	var errLvl = 0;
	var errMsg = "";
	if((oFrm.txtEmail.value == '') || (checkEmail(oFrm.txtEmail.value) == false)) { errLvl = 1; errMsg += '- Uw e-mailadres\n'; }
	if(oFrm.txtPassword.value == '') { errLvl = 1; errMsg += '- Uw wachtwoord\n'; }
	if(errLvl != 0) {
		alert("De volgende velden zijn niet, of niet correct, ingevuld:\n\n" + errMsg);
	} else {
		oFrm.submit();
	}
}

function fnLoginLB() {
	var oFrm = document.forms.frmLoginLB;
	var errLvl = 0;
	var errMsg = "";
	oFrm.advID.value = parent.advValue; 
	if((oFrm.txtEmail.value == '') || (checkEmail(oFrm.txtEmail.value) == false)) { errLvl = 1; errMsg += '- Uw e-mailadres\n'; }
	if(oFrm.txtPassword.value == '') { errLvl = 1; errMsg += '- Uw wachtwoord\n'; }
	if(errLvl != 0) {
		alert("De volgende velden zijn niet, of niet correct, ingevuld:\n\n" + errMsg);
	} else {
		oFrm.submit();
	}
}

function checkEmail(strEmail) { return (strEmail.search(/^[\w\.\-_]*[A-Z|a-z|0-9]{1}@([\w\-_]+\.)+[A-Za-z]{2,4}$/) != -1) }

function CheckDocumentFile(strFile) {
	var blnOk = true;
	var strCheck = 'abcdefghijklmnopqrstuvwxyz0123456789_-';
	if (strFile == '') return true;
	while (strFile.indexOf("\\") != -1) {
		strFile = strFile.slice(strFile.lastIndexOf("\\") + 1);
		ext = strFile.slice(strFile.lastIndexOf(".")).toLowerCase();
		if(ext != '.doc' && ext != '.pdf') {
			return false;
		} else {
			strFile = strFile.slice(0, strFile.indexOf(".")).toLowerCase();
			for(intTeller=0;intTeller<strFile.length;intTeller++) {
				if(strCheck.indexOf(strFile.charAt(intTeller)) >= 0) {
					blnOk = blnOk && true;
				} else {
					blnOk = blnOk && false;
				}
			}
		}
		return blnOk;
	}
}

function CheckImageFile(strFile) {
	var blnOk = true;
	var strCheck = 'abcdefghijklmnopqrstuvwxyz0123456789_-';
	if (strFile == '') return true;
	while (strFile.indexOf("\\") != -1) {
		strFile = strFile.slice(strFile.lastIndexOf("\\") + 1);
		ext = strFile.slice(strFile.lastIndexOf(".")).toLowerCase();
		if(ext != '.jpg' && ext != '.jpeg') {
			return false;
		} else {
			strFile = strFile.slice(0, strFile.indexOf(".")).toLowerCase();
			for(intTeller=0;intTeller<strFile.length;intTeller++) {
				if(strCheck.indexOf(strFile.charAt(intTeller)) >= 0) {
					blnOk = blnOk && true;
				} else {
					blnOk = blnOk && false;
				}
			}
		}
	}
	return blnOk;
}



	function fnShowDiv(id) {
		try { setAdvValue(id); }
		catch (ex) { }
		fnFadeInBackground(0);
	}
	function fnHideDiv() {
		document.getElementById("divOuterContainer").style.display = "none";
		document.getElementById("divWindow").style.display = "none";
	}
	function fnFadeInBackground(Percentage) {
		try { clearTimeout(t) } catch (ex) { }
		var objBg = document.getElementById("divOuterContainer");
		if(Percentage > 75) { Percentage = 75; }
		objBg.style.display = "block";
		try { eval('objBg.filters.alpha.opacity = "' + Percentage + '";') } catch (ex) { };
		try { eval('objBg.style.MozOpacity = ".' + Percentage + '";') } catch (ex) { };
		try { eval('objBg.style.opacity = ".' + Percentage + '";') } catch (ex) { };
		if(Percentage == 75) {
			document.getElementById("divWindow").style.display = "block";
		} else {
			Percentage = Percentage + 15;
			var t = eval('setTimeout("fnFadeInBackground(' + Percentage + ')",5)');
		}
	}

