//basisvariabelen theChosenFilter = "Kies een filter"; theChosenFilteron=""; theKeywords=""; advancedFilter=0; sortfield="training_naam"; sortorder="ASC"; minSearchLength = 0; maandaanbieding = 0; reservelijst = 0; txtLoading = "Bezig met laden..."; // "Bezig met laden..."; txtSearching = "Bezig met zoeken."; // ============================================================================== // Op de pagina moet als onloadstatement minimaal SmallSearch('','','',0) staan // ============================================================================== function SmallSearch(filter,filteron,keywords,advanced) { //advanced: 0 = ignore; 1 = alleen advanced; 2 = alleen OT theChosenFilter = filter; theChosenFilteron = filteron; theKeywords = keywords; advancedFilter = advanced; //alert("theCall"); DWREngine._errorHandler = errorHandler; DWREngine._execute(_cfscriptLocation, null, "fakesearch",theChosenFilter, theChosenFilteron,0,theKeywords,advancedFilter,sortfield,sortorder,SmallSearchResult); } function bigSearch(filter) { theChosenFilter = filter; document.getElementById("transveld").style.visibility = "visible"; document.getElementById("ip_training").style.visibility = "hidden"; document.getElementById("ip_training_home").style.visibility = "visible"; if (filter != '') { DWRUtil.setValue("ip_training", txtLoading); DWREngine._errorHandler = errorHandler; DWREngine._execute(_cfscriptLocation, null, "homesearch",theChosenFilter, theChosenFilteron,0,theKeywords,advancedFilter,sortfield,sortorder, homeSearchResult); } else { //CSBfleXcroll('traininglist_big'); } } function closeHomeSearch() { document.getElementById("transveld").style.visibility = "hidden"; document.getElementById("ip_training").style.visibility = "visible"; document.getElementById("ip_training_home").style.visibility = "hidden"; DWRUtil.setValue("ip_training_home", txtLoading); //alert("theCall"); DWREngine._errorHandler = errorHandler; DWREngine._execute(_cfscriptLocation, null, "fakesearch",theChosenFilter, theChosenFilteron,0,theKeywords,advancedFilter,sortfield,sortorder, SmallSearchResult); } function SmallSearchResult(returndata) { //alert("theResult"); DWRUtil.setValue("ip_training", returndata[1]); document.searchForm_fake.tq_fake.value = theKeywords; //DWRUtil.setValue("filter_naam",theChosenFilter); /* var tabs = $('trainsort').getElementsByTagName("a"); if ($('trainsort')) { for (var i=0; i < tabs.length; ++i) { tabBorder.render(tabs[i]); } } */ //CSBfleXcroll('traininglist_small'); } function homeSearchResult(returndata) { DWRUtil.setValue("ip_training_home", returndata[1]); //CSBfleXcroll('traininglist_big'); document.searchForm.tq.value = theKeywords; if (document.searchForm.tq) { document.searchForm.tq.focus(); } DWRUtil.setValue("filter_naam",theChosenFilter); DWREngine._execute(_cfscriptLocation, null, "getFilter", theChosenFilter, getFilterResult); } function getFilter(filter,containername) { theChosenFilter = filter; DWRUtil.setValue(containername,filter); DWREngine._execute(_cfscriptLocation, null, "getFilter", theChosenFilter, getFilterResult); } function getFilterResult(returndata) { DWRUtil.setValue("zoekfilter", returndata[1]); //CSBfleXcroll('optionwrapper_scroll_' + theChosenFilter + '_naam'); document.getElementById('optionwrapper_scroll_' + theChosenFilter + '_naam').toggle(0); if (returndata[0] == 1 && _referer) { location.href = _referer; } } function applyFilter(filteron,containername) { //alert(theChosenFilter); theChosenFilteron = filteron; var filterArray = new Array(txtSearching); DWRUtil.setValue("traininglist_container", filterArray[0]); DWRUtil.setValue(containername,theChosenFilteron); DWREngine._errorHandler = errorHandler; DWREngine._execute(_cfscriptLocation, null, "homesearch_search", 0,theChosenFilter, theChosenFilteron,0,theKeywords,advancedFilter,sortfield,sortorder,applyFilterResult); } function applyFilterResult(returndata) { //alert("theResult"); DWRUtil.setValue("traininglist_container", returndata[1]); //CSBfleXcroll('traininglist_big'); } function keywordSearch() { theKeywords = document.searchForm.tq.value; //alert(theKeywords); if(theKeywords.length >= minSearchLength) { DWREngine._errorHandler = errorHandler; DWREngine._execute(_cfscriptLocation, null, "homesearch_search", 0,theChosenFilter,theChosenFilteron,0,theKeywords,advancedFilter,sortfield,sortorder,applyFilterResult); } else { return } } function smallkeywordSearch() { theKeywords = document.searchForm.tq.value; if(theKeywords.length >= minSearchLength) { DWREngine._errorHandler = errorHandler; DWREngine._execute(_cfscriptLocation, null, "smallsearch_search", 0,theChosenFilter,theChosenFilteron,0,theKeywords,advancedFilter,sortfield,sortorder,applySmallFilterResult); } else { return } } function applySmallFilterResult(returndata) { //alert("theResult"); DWRUtil.setValue("traininglist_container", returndata[1]); //CSBfleXcroll('traininglist_small'); } function getTrainingData(fieldname,trainingId) { //alert('Yay! ' + trainingId); theObj = document.getElementById('select_wrapper_' + fieldname); //alert(theObj); DWRUtil.setValue("training_data", txtLoading); DWREngine._execute(_cfscriptLocation, null, "getTrainingData",trainingId,theObj.style.zIndex,getTrainingDataResult); } function checkAvailable(fieldname,dataId) { //alert('Yay! ' + dataId); //theObj = document.getElementById('select_wrapper_' + fieldname); //alert(theObj); //DWRUtil.setValue("training_data", txtLoading); //DWREngine._execute(_cfscriptLocation, null, "getTrainingData",trainingId,theObj.style.zIndex,getTrainingDataResult); //DWREngine._execute(_cfscriptLocation, null, "getDataBeschikbaar",dataId,checkAvailableResult); } function getTrainingDataResult(returndata) { maandaanbieding = 0; document.FrmInschrijf.maandaabieding.value = 'nee'; DWRUtil.setValue("training_data", returndata[1]); if(returndata[0] >= 5) { //reservelijst = 1 } if(returndata[0] == 2 || returndata[0] == 6) { DWREngine._execute(_cfscriptLocation, null, "getArrangement",getArrangementResult); } else if(returndata[0] == 3 || returndata[0] == 7) { maandaanbieding = 1; DWREngine._execute(_cfscriptLocation, null, "getAanbieding",getAanbiedingResult); } else if(returndata[0] == 4 || returndata[0] == 8) { maandaanbieding = 1; DWREngine._execute(_cfscriptLocation, null, "getArrangement",getArrangementResult); } else { DWRUtil.setValue("training_overnachting", ""); } } function getArrangementResult(returndata) { DWRUtil.setValue("training_overnachting", returndata[1]); if ( maandaanbieding == 1) { DWREngine._execute(_cfscriptLocation, null, "getAanbieding",getAanbiedingResult); } else { //DWRUtil.setValue("maandaanbieding", ""); } if ( reservelijst == 1) { DWREngine._execute(_cfscriptLocation, null, "getReservelijst",getReservelijstResult); } else { DWRUtil.setValue("reservelijst", ""); } } function getAanbiedingResult(returndata) { document.FrmInschrijf.maandaabieding.value = 'ja'; //DWRUtil.setValue("maandaanbieding", returndata[1]); if ( reservelijst == 1) { DWREngine._execute(_cfscriptLocation, null, "getReservelijst",getReservelijstResult); } else { DWRUtil.setValue("reserverlijst", ""); } } function getReservelijstResult(returndata) { DWRUtil.setValue("reservelijst", returndata[1]); } function antiSpamValididated(str) { var chck = document.getElementById('antiSpamValidation').value; return (hex_md5(str).toUpperCase() == chck.toUpperCase()); } function checkForm(formName,functionname) { var errorNum = 0; var firstfocus = ""; var errorTxt = "De volgende velden zijn onjuist: "; var currentFieldname = ''; //'Foutmelding

De verplichte velden met een zijn niet (juist) ingevuld. Vul deze in en klik opnieuw op verzend.

'; var validateEmail = /^([a-zA-Z0-9])+([\.a-zA-Z0-9_-])*@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-]+)+$/;//TO DO: Email validatie activeren for (var i=0;i'; errorTxt = errorTxt + txt; alert(txt); } break; default: if ( formName.elements[i].value == '' || (formName.elements[i].type == 'checkbox' && formName.elements[i].checked == false) || (formName.elements[i].name == 'verifyCode' && !antiSpamValididated(formName.elements[i].value.toUpperCase())) ) { errorNum++; if (firstfocus == "") { firstfocus = formName.elements[i].name } document.getElementById('req_' + formName.elements[i].name).parentNode.childNodes[0].className = 'verplicht_error'; var errorbox = document.getElementById('form_error'); errorbox.className = 'errorzone'; var txt = '' + document.getElementById('req_' + formName.elements[i].name).parentNode.lastChild.nodeValue + '
'; errorTxt = errorTxt + txt; } break; } } } if (errorNum) { errorbox.innerHTML = errorTxt; scroll(0,0); return false } else { document.getElementById('form_error').className = ''; document.getElementById('form_error').innerHTML = ''; if(functionname != "") { submitForm(formName,functionname); } else { return true } } } function submitForm(formName,functionname) { var field = new Array(); var oWddx = new WddxSerializer(); for (var i=0;i<(formName.elements.length-1);i++) { var data = new Object; data.theName = encodeURI(formName.elements[i].name); if(formName.elements[i].type == "checkbox" || formName.elements[i].type == "radio"){ if(formName.elements[i].checked == true) { //alleen de waarde van aangevinkte pakken data.theValue = encodeURI(formName.elements[i].value); } else { data.theValue = ""; } } else if (formName.elements[i].type == "select") { //alert('selected Index =' + formName.elements[i].selectedIndex); } else if (formName.elements[i].type == "select-multiple") { data.theValue = ""; //if(formName.elements[i].name.indexOf('_selected') != -1) { for (oc=0; oc0) data.theValue = data.theValue + ',' + formName.elements[i].options[oc].value; else data.theValue = formName.elements[i].options[oc].value; } //} } else if (formName.elements[i].type == "button"){ data.theValue = ''; } else { data.theValue = encodeURI(formName.elements[i].value); } //alert(formName.elements[i].parentNode.parentNode.childNodes[1].lastChild); if (formName.elements[i].parentNode.parentNode.childNodes[0].lastChild) { data.theTitle = encodeURI(formName.elements[i].parentNode.parentNode.childNodes[0].lastChild.nodeValue);//IE } else if (formName.elements[i].parentNode.parentNode.childNodes[1].lastChild){ data.theTitle = encodeURI(formName.elements[i].parentNode.parentNode.childNodes[1].lastChild.nodeValue);//anders } else { data.theTitle = data.theName; } field[i] = data; //alert(formName.elements[i].name + '\nType=' + formName.elements[i].type + '\n\nname=' + data.theName + ' \nlabel= \'' + data.theTitle + '\' \nvalue= ' + data.theValue); } DWREngine._execute(_cfscriptLocation, null, functionname, oWddx.serialize(field),formName.name,submitFormResult); } function submitFormResult(returndata) { window.location = "http://www.vergouwenoverduin.nl/Inschrijving_Voltooid.html"; //DWRUtil.setValue("formarea", returndata[1]); } function setSortorder(thesortfield) { DWRUtil.setValue("traininglist_small", txtLoading); if (sortorder == "ASC" && sortfield == thesortfield) { sortorder="DESC"; } else { sortorder="ASC"; } sortfield=thesortfield; DWREngine._execute(_cfscriptLocation, null, "fakesearch",theChosenFilter, theChosenFilteron,0,theKeywords,advancedFilter,sortfield,sortorder,SmallSearchResult); } function setSortorder2(thesortfield) { DWRUtil.setValue("traininglist_big", txtLoading); if (sortorder == "ASC" && sortfield == thesortfield) { sortorder="DESC"; } else { sortorder="ASC"; } sortfield=thesortfield; DWREngine._execute(_cfscriptLocation, null, "homesearch",theChosenFilter, theChosenFilteron,0,theKeywords,advancedFilter,sortfield,sortorder,homeSearchResult); } function trim(s){ if((s==null)||(typeof(s)!='string')||!s.length)return'';return s.replace(/^\s+/,'').replace(/\s+$/,'')}