function progress(width) { var B = new String; B = width; if (B == 'step' || B == '') { B = ProgressIn.style.width; if (B == '') B = '0%'; B = B.substr(0,B.length-1) B = Math.round(eval(B + ' + (100 - ' + B + ')/2')); } ProgressIn.style.width = B + '%'; ProgressIn.innerHTML = B + '%'; if (B > 100) { $('.progress').hide(); } } function formHighlight(myState) { if ( (event.srcElement.tagName=='INPUT') && !(event.srcElement=='submit' || event.srcElement=='reset' || event.srcElement=='checkbox' ) ) { if (myState == 0) { // event.srcElement.style.background = '#EEEEBB'; } else { // event.srcElement.style.background = 'rgb(233, 240, 245)'; } } } function focusField() { if (event.srcElement.tagName=='INPUT' && !event.srcElement.ReadOnly) { event.srcElement.focus(); } } var downStrokeField; function autojump(fieldName,nextFieldName,fakeMaxLength) { var myForm=document.forms[document.forms.length - 1]; var myField=myForm.elements[fieldName]; myField.nextField=myForm.elements[nextFieldName]; if (myField.maxLength == null) myField.maxLength=fakeMaxLength; myField.onkeydown=autojump_keyDown; myField.onkeyup=autojump_keyUp; } function autojump_keyDown() { this.beforeLength=this.value.length; downStrokeField=this; } function autojump_keyUp() { if ( (this == downStrokeField) && (this.value.length > this.beforeLength) && (this.value.length >= this.maxLength) ) this.nextField.focus(); downStrokeField=null; } function doerror(err, etype) { msg = err.innerHTML; if (etype=='Error') { err.innerHTML = '' + msg; } else { err.innerHTML = '' + msg; } } function dowarnerr(obj, etype) { if(typeof(obj.innerHTML) == 'string') { doerror(obj, etype); } else { for (var prop in obj) { // if (obj.hasOwnProperty(prop)) { // alert(prop); //0 1 2 length doerror(obj[prop], etype); // } } //for (i = 0; i < obj.length; i++) { //old code changed Jan 2013 JH //doerror(obj(i), etype); //} } } function EnterButton(hover) { event.srcElement.hover = 1; event.srcElement.className = event.srcElement.className.replace('button', 'btnhover'); } function LeaveButton(hover) { event.srcElement.hover = 0; if ((event.srcElement.hover + event.srcElement.focus) == 0) event.srcElement.className = event.srcElement.className.replace('btnhover', 'button'); } function FocusButton(hover) { event.srcElement.focus = 1; event.srcElement.className = event.srcElement.className.replace('button', 'btnhover'); } function BlurButton(hover) { event.srcElement.focus = 0; if ((event.srcElement.hover + event.srcElement.focus) == 0) event.srcElement.className = event.srcElement.className.replace('btnhover', 'button'); } function FocusInput() { event.srcElement.className += ' inputhover'; } function BlurInput() { event.srcElement.className = event.srcElement.className.replace(' inputhover', ''); } function findtxtarea() { var Inputs = document.body.getElementsByTagName("TEXTAREA"); for (i = 0; i < Inputs.length; i++) { //Error //if (null == Inputs[i].onfocus) Inputs[i].onfocus = FocusInput; //if (null == Inputs[i].onblur) Inputs[i].onblur = BlurInput; } } function findbuttons() { var Inputs = document.body.getElementsByTagName("INPUT"); for (i = 0; i < Inputs.length; i++) { if (Inputs[i].type == 'button' || Inputs[i].type == 'submit' || Inputs[i].type == 'reset') { Inputs[i].hover = 0; Inputs[i].focus = 0; Inputs[i].className = Inputs[i].className.replace(' button', '') + ' button'; Inputs[i].onmouseenter = EnterButton; Inputs[i].onmouseleave = LeaveButton; if (null == Inputs[i].onfocus) Inputs[i].onfocus = FocusButton; if (null == Inputs[i].onblur) Inputs[i].onblur = BlurButton; } else if (Inputs[i].type == 'text' || Inputs[i].type == 'password') { if (null == Inputs[i].onfocus) { Inputs[i].focus = 0; //Error //Inputs[i].onfocus = FocusInput; } //Error //if (null == Inputs[i].onblur) Inputs[i].onblur = BlurInput; if (Inputs[i].readOnly) Inputs[i].className = Inputs[i].className.replace(' readonly', '') + ' readonly'; } else if (Inputs[i].type == 'checkbox' || Inputs[i].type == 'radio') { //alert(Inputs[i].className); Inputs[i].className += ' checkbox'; } } } function AddIcons() { if (typeof(error)=='object') { dowarnerr(error,'Error'); } if (typeof(warning)=='object') { dowarnerr(warning,'Warning'); } } var LastParent = document; function showThumb(im) { if(im) { //ben added so undefined.jpg doesn't get called. if(im != 'undefined'){ if (event.srcElement.parentElement.parentElement.id != 'LMenuDIV') { LastParent = event.srcElement; thumb.outerHTML = ''; thumb.style.left = event.srcElement.offsetLeft + event.srcElement.offsetWidth; thumb.style.top = event.srcElement.offsetTop; } } } } function unThumb() { // thumb.style.display = 'none'; thumb.style.visibility = 'hidden'; } function loadedThumb() { if (thumb.src.substr(thumb.src.length-18,18) != '/images/logoff.gif') { // thumb.style.display = 'block'; thumb.width = Math.min(thumb.width, LastParent.offsetParent.clientWidth - LastParent.offsetLeft - LastParent.offsetWidth); thumb.style.filter="blendTrans(duration=0.5)"; if (thumb.filters.blendTrans.status != 2) { thumb.filters.blendTrans.apply(); thumb.style.visibility="visible"; thumb.filters.blendTrans.play(); } } } function addLMenuItem(Link, Descr, title, Preview) { if(Descr=="Beweeg op" ||Descr =="Move up" ) document.write(""+"  One Level Up/ Een Vlak Op"); else if (Descr !="Huis" && Descr !="Home" && Descr !="Soek" && Descr !="Search") //Max sit in Jun 2016 om te verhoed dat huis en search wys aangesien daar reeds icons is { document.write(""+Descr+""); } } function dateValidate(DtObj) { var ChkDt = str2dt(DtObj.value); var Today = new Date(); if (ChkDt > Today) { alert("Date cannot be in the future! Today's date will be used"); ChkDt = Today; } DtObj.value = dt2dtstr(ChkDt); } function CheckNum(TxtObj) { var Range = "09" //From 0 to 9 is valid if (event.keyCode < Range.charCodeAt(0) || event.keyCode > Range.charCodeAt(1)) //If not valid event.returnValue=false; //Cancel the keypress } function get_radio(r) { if (!r) return undefined; var l = r.length; if (l == undefined) return (r.checked ? r.value : null); for (var i = 0; i < l; i++) if (r[i].checked) return r[i].value; return null; } function set_radio(r, v) { if (!r) return undefined; var l = r.length; if (l == undefined) r.checked = (r.value == v.toString()); else for (var i = 0; i < l; i++) r[i].checked = (r[i].value == v.toString()); return; } // --------------------------------------------------------------------------------------------------------------------------- // Check if a value is numeric or not. // =========================================================================================================================== function is_Numeric(input) { return !isNaN(input) ; } // --------------------------------------------------------------------------------------------------------------------------- // Check if a date entered into a form text element is valid. // // IN: dtObjName = ID of the date input element // submitObjName = ID of the sbmit button to disable / hide when date is not valid. // Leave blank to skip disable / hide functionality // allowEmpty = 't' to allow empty date field, else force date to be entered // // OUT: true if date is valid // false if not // =========================================================================================================================== function isDateStr(dtObjName, submitObjName, allowEmpty) { if (allowEmpty==null) { allowEmpty='t'; } dtOK = true; dtObj = document.getElementById(dtObjName); if ((allowEmpty=='t' && dtObj.value!="") || allowEmpty!='t') { if (dtObj.value.length<10) { dtValue = dtObj.value+"00000000"; d = dtValue.substring(0,2) ; m = dtValue.substring(2,4) ; y = dtValue.substring(4,8) ; dtOK = dtObj.value.length==8; } else { dtValue = dtObj.value; d = dtValue.substring(0,2) ; splitChr1 = dtValue.substring(2,3) ; m = dtValue.substring(3,5) ; splitChr2 = dtValue.substring(5,6) ; y = dtValue.substring(6,10) ; dtOK = dtObj.value.length==10 && (splitChr1=="/" || splitChr1=="-") && (splitChr2=="/" || splitChr2=="-"); } if (!is_Numeric(d) || !is_Numeric(m) || !is_Numeric(y)) { dtOK = false; } if (dtOK) { d = parseFloat(d) ; m = parseFloat(m) ; y = parseFloat(y) ; dtOK = d>=1 && m>=1 && m<=12 && y>1930 && y<2100; } if (dtOK) { febDays = 28; if (y % 4==0) { febDays=29; } switch (m) { case 1: case 3: case 5: case 7: case 8: case 10: case 12: dtOK = d<=31; break; case 2: dtOK = d<=febDays; break; case 4: case 6: case 9: case 11: dtOK = d<=30; break; } } } if (dtOK) { dtObj.style.backgroundColor = "white" ; } else { dtObj.style.backgroundColor = "red" ; } showSubmit = dtOK; var Inputs = document.getElementsByTagName("INPUT"); if (dtOK) { for (i = 0; i < Inputs.length; i++) { showSubmit = showSubmit && Inputs[i].style.backgroundColor != "red" } } submitObj = document.getElementById(submitObjName) ; if (submitObj!=null) { submitObj.disabled = !showSubmit; submitObj.style.visibility = showSubmit?"visible":"hidden" ; } else { for (i = 0; i < Inputs.length; i++) { if (Inputs[i].type == 'submit') { Inputs[i].disabled = !showSubmit; Inputs[i].style.visibility = showSubmit?"visible":"hidden" ; } } } return dtOK; }