// Algemene Scripts /**************************** * Init scripts * ****************************/ function init(){ MM_preloadImages('images/loading.gif','images/NL/bols_acces.jpg','images/EN/bols_acces.jpg','images/verloop.jpg'); ageCheck(); MM_preloadImages('images/top_menu/home_h.jpg','images/top_menu/faqs_h.jpg','images/top_menu/lucas_h.jpg','images/top_menu/nl_h.jpg','images/top_menu/en_h.jpg','images/top_menu/snon_h.jpg','images/top_menu/snoff_h.jpg','images/footer_menu/colofon_h.jpg','images/footer_menu/sitemap_h.jpg'); muziekButton(); checkCourse(); initSelectDiv(); if (document.getElementById("headapl")) { document.getElementById("headapl").style.display = "none"; } initYouTube(); } /* */ function initYouTube(){ $('.youtubeField').bind('keyup',function(){ var searchString = "http"; var fieldValue = $(this).attr("value"); var bIndex = fieldValue.indexOf(searchString); if (bIndex > 0) { var tempValue = fieldValue.substr(bIndex, fieldValue.length) var eIndex = tempValue.indexOf("\""); var endValue = tempValue.substr(0,eIndex); $(this).attr("value", endValue) } else { $(this).attr("value", fieldValue) } }); } /* OUD tour positie function setTourPos(){ var tourDiv = document.getElementById("tourPopup_container"); if (tourDiv2) { var tourWidth = parseInt(tourDiv.style.width); var pageWidth = 975; if(document.all){ availW = document.body.clientWidth; }else{ availW = innerWidth; } if (availW > 996) { var tourRight = (((availW-pageWidth)/2) + 64) + "px"; tourDiv.style.right = tourRight; } } }*/ function getAgeCheck() { var objects = document.getElementsByTagName("object"); var embeds = document.getElementsByTagName("embed"); if (objects) { for (o=0; o < objects.length; o++) { objects[o].style.visibility = "hidden"; } } if (embeds) { for (e=0; e < embeds.length; e++) { embeds[e].style.visibility = "hidden"; } } var ageCheckGrey = document.getElementById("agecheckgrey"); if (ageCheckGrey) { ageCheckGrey.style.height = document.body.scrollHeight; ageCheckGrey.style.display = "block"; } var ageCheck = document.getElementById("agecheck"); if (ageCheck) { ageCheck.style.display = "block"; } } function leaveAgeCheck() { var objects = document.getElementsByTagName("object"); var embeds = document.getElementsByTagName("embed"); if (objects) { for (o=0; o < objects.length; o++) { objects[o].style.visibility = "visible"; } } if (embeds) { for (e=0; e < embeds.length; e++) { embeds[e].style.visibility = "visible"; } } var ageCheckGrey = document.getElementById("agecheckgrey"); if (ageCheckGrey) { ageCheckGrey.style.display = "none"; } var ageCheck = document.getElementById("agecheck"); if (ageCheck) { ageCheck.style.display = "none"; } var ageCheck2 = document.getElementById("ageCheckContainer"); if (ageCheck2) { ageCheck2.style.display = "none"; } var ageCheck3 = document.getElementById("ageCheckShadow"); if (ageCheck3) { ageCheck3.style.display = "none"; } } function AgeOk(ref) { AgeCheckOk(); } function AgeFault() { //top.location.href = "about:home"; } /**************************************** * Locatienet popup * ****************************************/ function locatienet(x) { var link = ""; if (x == "en") { link = "http://tools.locatienet.com/location/map.asp?config_id=8023&language=english&address=488168_5235910_Paulus%20Potterstraat_12_1071CZ_Amsterdam__NL_&zoom=2&markertext=Bols%20Bartending%20Academy&background=http%3A//www.bolsbartendingacademy.nl/images/lokatienet/background.jpg&bgcolor=%230D0D33&logo=http%3A//www.bolsbartendingacademy.nl/images/logo.jpg&css=http%3A//www.bolsbartendingacademy.nl/style/lokatienet.css"; //link = "http://tools.locatienet.com/location/map.asp?config_id=8023&language=english&address=488168_5235910_Paulus%20Potterstraat_14_1071CZ_Amsterdam__NL_&zoom=2&markertext=Bols%20Bartending%20Academy&background=http%3A//www.bolsbartendingacademy.nl/images/lokatienet/background.jpg&logo=http%3A//www.bolsbartendingacademy.nl/images/logo.jpg&css=http%3A//www.bolsbartendingacademy.nl/style/lokatienet.css"; } else { link = "http://tools.locatienet.com/location/map.asp?config_id=8023&language=dutch&address=488168_5235910_Paulus%20Potterstraat_12_1071CZ_Amsterdam__NL_&zoom=2&markertext=Bols%20Bartending%20Academy&background=http%3A//www.bolsbartendingacademy.nl/images/lokatienet/background.jpg&bgcolor=%230D0D33&logo=http%3A//www.bolsbartendingacademy.nl/images/logo.jpg&css=http%3A//www.bolsbartendingacademy.nl/style/lokatienet.css"; //link = "http://tools.locatienet.com/location/map.asp?config_id=8023&language=dutch&address=488168_5235910_Paulus%20Potterstraat_14_1071CZ_Amsterdam__NL_&zoom=2&markertext=Bols%20Bartending%20Academy&background=http%3A//www.bolsbartendingacademy.nl/images/lokatienet/background.jpg&logo=http%3A//www.bolsbartendingacademy.nl/images/logo.jpg&css=http%3A//www.bolsbartendingacademy.nl/style/lokatienet.css"; } window.open(link ,"routekaart","scrollbars=no,toolbar=no,width=650,height=450,resize=no,menubar=no,left=50,top=75"); } /**************************************** * Voorwaarden popup * ****************************************/ function voorwaarden() { voorwaardenPos(); document.getElementById('frameVoorwaarden').src = "voorwaarden.asp"; } function voorwaardenPos() { document.getElementById('frameVoorwaarden').style.top = document.body.scrollTop + 70; } function voorwaarden2() { voorwaardenPos(); document.getElementById('frameVoorwaarden').src = "voorwaarden2.asp"; } /**************************************** * Preload en IMG swap scripts * ****************************************/ function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i\n'); //document.write('On Error Resume Next\n'); //document.write('Sub menutest2_FSCommand(ByVal command, ByVal args)\n'); //document.write(' Call menutest2_DoFSCommand(command, args)\n'); //document.write('End Sub\n'); //document.write('\n'); } /**************************** * Muziek scripts * ****************************/ var IE = navigator.appName.indexOf("Microsoft Internet"); function muziekButton(strTemp){ var strKnop if (top != window){ if (navigator.appVersion.indexOf("Safari")!=-1) { if (strTemp == "uit") { document.getElementById("muziekButtonSpan").innerHTML = "\"Sound"; } else { document.getElementById("muziekButtonSpan").innerHTML = "\"Sound"; } } else { if (parent.muziekframe.strStatus == "playing"){ document.getElementById("muziekButtonSpan").innerHTML = "\"Sound"; } else if (parent.muziekframe.strStatus == "stopped"){ document.getElementById("muziekButtonSpan").innerHTML = "\"Sound"; } } } } function playMuziek(){ var movie = parent.muziekframe.muziek if(top != window){ if (navigator.appVersion.indexOf("Safari")!=-1) { parent.muziekframe.location.href = "includes/muziek.asp"; muziekButton('aan'); } else { if (navigator.appName.indexOf("Microsoft Internet")!=-1){ parent.muziekframe.muziek.GotoFrame(2); } else{ parent.muziekframe.document.embeds['muziek'].GotoFrame(3); } parent.muziekframe.strStatus = "playing"; muziekButton(''); } } } function stopMuziek(){ if(top != window){ if (navigator.appVersion.indexOf("Safari")!=-1) { parent.muziekframe.location.href = "leeg.asp"; muziekButton('uit'); } else { if (navigator.appName.indexOf("Microsoft Internet")!=-1){ parent.muziekframe.muziek.GotoFrame(7); } else{ parent.muziekframe.document.embeds['muziek'].GotoFrame(7); } parent.muziekframe.strStatus = "stopped"; muziekButton(''); } } } /**************************** * Hide selectboxen * ****************************/ function hideSelects(action) { if (action!='visible'){action='hidden';} if (navigator.appName.indexOf("MSIE")) { for (var S = 0; S < document.forms.length; S++){ for (var R = 0; R < document.forms[S].length; R++) { if (document.forms[S].elements[R].options) { document.forms[S].elements[R].style.visibility = action; } } } } } /**************************** * Frame detect * ****************************/ function detect(detectUrl) { if (self != top) { void(0); } else{ document.write('
'); document.redirectForm.submit(); } } /**************************** * Show/Hide Div * ****************************/ function showHideDiv(sHDId) { var div = document.getElementById(sHDId); var kop = document.getElementById(sHDId + "kop"); if (div) { if (div.style.display == "none") { showHideAll('dagDiv', 'hide'); div.style.display = "block"; if (kop) { kop.className = "booking_cursus_bold"; } } else { div.style.display = "none"; if (kop) { kop.className = "booking_cursus_norm"; } } } } function showHideAll(sHAClass, sHAType) { var divs = document.getElementsByTagName('div'); for (x=0;x= 0) { var korting = datumVeld.options[datumVeld.selectedIndex].getAttribute('korting'); var aantal = datumVeld.options[datumVeld.selectedIndex].getAttribute('aantalpers'); getCourse(cDiv.options[cDiv.selectedIndex].value, datumVeld.options[datumVeld.selectedIndex].value); getCourseCount(cDiv.options[cDiv.selectedIndex].value, aantal, korting); } } } } } function checkPrijs() { var cForm = document.bookingForm; var aantal = parseFloat(cForm.aantal.value); var prijs = cForm.tempPrijs.value; prijs = prijs.replace(",","."); prijs = parseFloat(prijs); document.getElementById("prijsSubSpan").innerHTML = "€ " + prijs; totaalPrijs = aantal * prijs; totaalPrijs = ConvertMoney(totaalPrijs); totaalPrijs = totaalPrijs.replace(",00",",-"); document.getElementById("prijsTotaalSpan").innerHTML = "€ " + totaalPrijs; } function checkApplicants() { var cForm = document.bookingForm; if (cForm) { var cAantal = cForm.aantal; if(cAantal) { if (cAantal.options[cAantal.selectedIndex].value == 1) { document.getElementById("headapl").style.display = "none"; document.getElementById("bookBut1").style.display = "block"; if (document.getElementById("bookMeld1")) { document.getElementById("bookMeld1").style.display = "none"; } getCourseApplicants("leeg"); } else { document.getElementById("headapl").style.display = "block"; document.getElementById("bookBut1").style.display = "none"; if (document.getElementById("bookMeld1")) { document.getElementById("bookMeld1").style.display = "block"; } getCourseApplicants(cAantal.options[cAantal.selectedIndex].value); } } } } function showKalender() { var frm = document.getElementById("frameKalender"); var div = document.getElementById("divKalender"); if (frm && div) { frm.style.height = document.body.scrollHeight; frm.style.display = "block"; div.style.top = document.body.scrollTop + 10; div.style.display = "block"; getKalender(''); } } function hideKalender() { var frm = document.getElementById("frameKalender"); var div = document.getElementById("divKalender"); if (frm && div) { div.style.display = "none"; frm.style.display = "none"; } } /**************************** * Formatnumber script * ****************************/ function checkNum(cNAantal, cNCurVeld) { if (cNCurVeld == "bday") { var str = document.bookingForm.bday.value; if (str.length == cNAantal) { document.bookingForm.bmonth.value = ""; document.bookingForm.bmonth.focus(); } } if (cNCurVeld == "bmonth") { var str = document.bookingForm.bmonth.value; if (str.length == cNAantal) { document.bookingForm.byear.value = ""; document.bookingForm.byear.focus(); } } } function isNumberKey(evt, key) { var charCode = (evt.which) ? evt.which : event.keyCode if (charCode > 31 && (charCode < 48 || charCode > 57) && ((charCode != 44 ) || (key.indexOf(",") > -1)) ) return false; return true; } function ConvertMoney(strString) { strString = strString+''; blnResult = strString.replace(".",","); TempblnResult = ""; blnResult2 = ""; if (blnResult.length == 0) blnResult = "0"; if (blnResult.indexOf(",") == -1) { blnResult += ",00"; } else { if (blnResult.substring(blnResult.indexOf(",")+1,blnResult.length).length == 1) blnResult += "0"; } TempblnResult = blnResult.substring(0,blnResult.indexOf(",")); while(TempblnResult.length > 3) { blnResult2 += "." + TempblnResult.substring(TempblnResult.length-3, TempblnResult.length); TempblnResult = TempblnResult.substring(0, TempblnResult.length-3); } blnResult = TempblnResult + blnResult2 + blnResult.substring(blnResult.indexOf(","), blnResult.indexOf(",")+3); return blnResult; } function ConvertMoneyBack(strString) { strString = strString+''; strString = strString.replace(".",""); strString = strString.replace(",","."); return strString-''; } function ConvertMoneyEditBack(strString) { strString = strString+''; strString = replaceAll(strString,".",""); return strString; } function IsMoney(sText) { var ValidChars = "0123456789.,"; var IsNumber=true; var Char; for (i = 0; i < sText.length && IsNumber == true; i++) { Char = sText.charAt(i); if (ValidChars.indexOf(Char) == -1) { IsNumber = false; } } return IsNumber; } function replaceAll( str, from, to ) { var idx = str.indexOf( from ); while ( idx > -1 ) { str = str.replace( from, to ); idx = str.indexOf( from ); } return str; } /**************************** * Check Select Scripts * ****************************/ function initSelectDiv() { var cShow = document.getElementById("check1"); var cShow2 = document.getElementById("check2"); var dShow = document.getElementById("divBusiness"); var dShow2 = document.getElementById("divLeisure"); if (cShow && cShow2) { if (cShow.checked == true) { dShow.style.display = "block"; } if (cShow2.checked == true) { dShow2.style.display = "block"; } } } function checkSelectDiv(cSDId) { if (cSDId == "bus") { var cShow = document.getElementById("check1"); var dShow = document.getElementById("divBusiness"); var sShow = document.getElementById("business"); var pShow = cShow.getAttribute("state"); var cHide = document.getElementById("check2"); var dHide = document.getElementById("divLeisure"); var sHide = document.getElementById("leisure"); var pHide = cHide.getAttribute("state"); } else if (cSDId == "lei") { var cShow = document.getElementById("check2"); var dShow = document.getElementById("divLeisure"); var sShow = document.getElementById("leisure"); var pShow = cShow.getAttribute("state"); var cHide = document.getElementById("check1"); var dHide = document.getElementById("divBusiness"); var sHide = document.getElementById("divBusiness"); var pHide = cHide.getAttribute("state"); } if (cShow && sShow && pShow && cHide && sHide && pHide) { if (pShow == "true") { cShow.setAttribute("state","false"); cShow.checked = false; sShow.selectedIndex = 0; dShow.style.display = "none"; cHide.setAttribute("state","false"); cHide.checked = false; sHide.selectedIndex = 0; dHide.style.display = "none"; } else if (pShow == "false") { cShow.setAttribute("state","true"); cShow.checked = true; sShow.selectedIndex = 0; dShow.style.display = "block"; cHide.setAttribute("state","false"); cHide.checked = false; sHide.selectedIndex = 0; dHide.style.display = "none"; } } } /**************************** * check Form scripts * ****************************/ function checkFriendForm() { var tForm = document.tipaFriendForm; if (tForm) { var ErrorValue = ""; if (tForm.znaam.value == "") { ErrorValue += "- " + ErrorTipNaamZ + "\n"; } if (tForm.zemail.value == "") { ErrorValue += "- " + ErrorTipEmailZ + "\n"; } if (tForm.onaam.value == "") { ErrorValue += "- " + ErrorTipNaamO + "\n"; } if (tForm.oemail.value == "") { ErrorValue += "- " + ErrorTipEmailO + "\n"; } //Bij fout weergeven if (ErrorValue != "") { alert(ErrorValue); } else { tForm.submit(); } } } function checkFaqForm() { var bForm = document.faqForm; if (bForm) { var ErrorValue = ""; if (bForm.naam.value == "") { ErrorValue += "- Naam is leeg\n"; } if (bForm.email.value == "") { ErrorValue += "- Email is leeg\n"; } if (bForm.vraag.value == "") { ErrorValue += "- Vraag is leeg\n"; } //Bij fout weergeven if (ErrorValue != "") { alert(ErrorValue); } else { bForm.submit(); } } } function checkAkForm() { var bForm = document.akForm; if (bForm) { var ErrorValue = ""; if (bForm.redenvanafkeuring.value == "") { ErrorValue += "1" } if (ErrorValue == "") { bForm.submit(); } } } function checkBookingBedrijfForm() { var bForm = document.bookingForm; if (bForm) { //ErrorValues aanmaken var ErrorValue = ""; var CourseErrorValue = ""; var HeadErrorValue = ""; var VoorkeurErrorValue = ""; var AgreeErrorValue = ""; var bANaamError = 0; var bAAchternaamError = 0; var bAEmailError = 0; var ErrorAplValue = ""; //Hoofd cursust gegevens var bFirstname = bForm.voornaam; var bLastname = bForm.achternaam; var bBirthDay = bForm.bday; var bBirthMonth = bForm.bmonth; var bBirthYear = bForm.byear; var bEmail = bForm.email; var bTel = bForm.tel; var bStreet = bForm.straat; var bNumber = bForm.nummer; var bZipcode = bForm.postcode; var bCity = bForm.plaats; var bCountry = bForm.land; var bCourseType = bForm.coursetype; var bBusiness = bForm.business; var bLeisure = bForm.leisure; var bLevel = bForm.level; var bCourseLang = bForm.taal; var bAgree = bForm.agree; var bBedrijfsnaam = bForm.bedrijfsnaam; var bBTW = bForm.btw; var bHoe = bForm.hoebijbols; var bPersonen = bForm.aantalpersonen; var bDatum1 = bForm.datum1; var bDatum2 = bForm.datum2; var bDatum3 = bForm.datum3; var bDuur = bForm.duur; //Formulier checken //Hoofd cursist //if (bBedrijfsnaam.value == "") //{ // HeadErrorValue += "- " + ErrorHeadBedrijfsnaam + "\n"; //} //if (bBTW.value == "") //{ // HeadErrorValue += "- " + ErrorHeadBTW + "\n"; //} if (bFirstname.value == "") { HeadErrorValue += "- " + ErrorHeadVoornaam + "\n"; } if (bLastname.value == "") { HeadErrorValue += "- " + ErrorHeadAchternaam + "\n"; } if (bBirthDay.value == "" || bBirthDay.value == 0 || bBirthDay.value > 31 || bBirthMonth.value == "" || bBirthMonth.value == 0 || bBirthMonth.value > 21 || bBirthYear.value == "" || bBirthYear.value.length < 4 ) { HeadErrorValue += "- " + ErrorHeadBirthday + "\n"; } if (bEmail.value == "" || bEmail.value.indexOf("@") < 0 || bEmail.value.indexOf(".",bEmail.value.indexOf("@")) < 0) { HeadErrorValue += "- " + ErrorHeadEmail + "\n"; } if (bTel.value == "") { HeadErrorValue += "- " + ErrorHeadTel + "\n"; } if (bStreet.value == "") { HeadErrorValue += "- " + ErrorHeadStreet + "\n"; } if (bNumber.value == "") { HeadErrorValue += "- " + ErrorHeadNumber + "\n"; } if (bZipcode.value == "") { HeadErrorValue += "- " + ErrorHeadZipcode + "\n"; } if (bCity.value == "") { HeadErrorValue += "- " + ErrorHeadCity + "\n"; } if (bCountry.options[bCountry.selectedIndex].value == "") { HeadErrorValue += "- " + ErrorHeadCountry + "\n"; } if (bHoe.value == "") { HeadErrorValue += "- " + ErrorHeadHoeBijBols + "\n"; } if (bDatum1.value == "" && bDatum2.value == "" && bDatum3.value == "") { HeadErrorValue += "- " + ErrorHeadDatum1 + "\n"; } if (HeadErrorValue != "") { HeadErrorValue = ErrorHeadKop + ": \n" + HeadErrorValue ; } //Voorkeursinstellingen if (bCourseType[0].checked == false && bCourseType[1].checked == false) { VoorkeurErrorValue += "- " + ErrorVoorkeurType + "\n"; } else if (bCourseType[0].checked == true && bBusiness.options[bBusiness.selectedIndex].value == "") { VoorkeurErrorValue += "- " + ErrorVoorkeurBusiness + "\n"; } else if (bCourseType[1].checked == true && bLeisure.options[bLeisure.selectedIndex].value == "") { VoorkeurErrorValue += "- " + ErrorVoorkeurLeisure + "\n"; } if (VoorkeurErrorValue != "") { VoorkeurErrorValue = ErrorVoorkeurKop + ": \n" + VoorkeurErrorValue ; } //Error Messages samenvoegen if (HeadErrorValue != "") { ErrorValue += "\n" + HeadErrorValue; } if (VoorkeurErrorValue != "") { ErrorValue += "\n" + VoorkeurErrorValue; } //Bij fout weergeven if (ErrorValue != "") { alert(ErrorValue); } else { bForm.submit(); } } else { } } function checkBookingForm() { var bForm = document.bookingForm; if (bForm) { if (bForm.hoebijbols) { checkBookingBedrijfForm(); } else { //ErrorValues aanmaken var ErrorValue = ""; var CourseErrorValue = ""; var HeadErrorValue = ""; var VoorkeurErrorValue = ""; var AgreeErrorValue = ""; var bANaamError = 0; var bAAchternaamError = 0; var bAEmailError = 0; var ErrorAplValue = ""; //Cursus gegevens var bCid = bForm.cid; var bAantal = bForm.aantal; var bDate = bForm.date; //Datum korting if (bDate) { if (bDate.selectedIndex >= 0) { var bKorting = bDate.options[bDate.selectedIndex].getAttribute('korting'); } } //Hoofd cursust gegevens var bFirstname = bForm.voornaam; var bLastname = bForm.achternaam; var bBirthDay = bForm.bday; var bBirthMonth = bForm.bmonth; var bBirthYear = bForm.byear; var bEmail = bForm.email; var bTel = bForm.tel; var bStreet = bForm.straat; var bNumber = bForm.nummer; var bZipcode = bForm.postcode; var bCity = bForm.plaats; var bCountry = bForm.land; var bCourseType = bForm.coursetype; var bBusiness = bForm.business; var bLeisure = bForm.leisure; var bLevel = bForm.level; var bCourseLang = bForm.taal; var bAgree = bForm.agree; //Formulier checken //Cursus if (bCid.options[bCid.selectedIndex].value == "") { CourseErrorValue += "- " + ErrorCursusId + "\n"; } if (bDate) { if (bDate.selectedIndex == -1) { CourseErrorValue += "- " + ErrorCursusDatum + "\n"; } } else { CourseErrorValue += "- " + ErrorCursusGeenDatum + "\n"; } if (bAantal) { if (bAantal.selectedIndex == -1) { CourseErrorValue += "- " + ErrorCursusAantal + "\n"; } } else { CourseErrorValue += "- " + ErrorCursusGeenAantal + "\n"; } if (CourseErrorValue != "") { CourseErrorValue = ErrorCourseKop + ": \n" + CourseErrorValue; } //Hoofd cursist if (bFirstname.value == "") { HeadErrorValue += "- " + ErrorHeadVoornaam + "\n"; } if (bLastname.value == "") { HeadErrorValue += "- " + ErrorHeadAchternaam + "\n"; } if (bBirthDay.value == "" || bBirthDay.value == 0 || bBirthDay.value > 31 || bBirthMonth.value == "" || bBirthMonth.value == 0 || bBirthMonth.value > 21 || bBirthYear.value == "" || bBirthYear.value.length < 4 ) { HeadErrorValue += "- " + ErrorHeadBirthday + "\n"; } if (bEmail.value == "" || bEmail.value.indexOf("@") < 0 || bEmail.value.indexOf(".",bEmail.value.indexOf("@")) < 0) { HeadErrorValue += "- " + ErrorHeadEmail + "\n"; } if (bStreet.value == "") { HeadErrorValue += "- " + ErrorHeadStreet + "\n"; } if (bNumber.value == "") { HeadErrorValue += "- " + ErrorHeadNumber + "\n"; } if (bZipcode.value == "") { HeadErrorValue += "- " + ErrorHeadZipcode + "\n"; } if (bCity.value == "") { HeadErrorValue += "- " + ErrorHeadCity + "\n"; } if (bCountry.options[bCountry.selectedIndex].value == "") { HeadErrorValue += "- " + ErrorHeadCountry + "\n"; } if (HeadErrorValue != "") { HeadErrorValue = ErrorHeadKop + ": \n" + HeadErrorValue ; } //Voorkeursinstellingen if (bCourseType[0].checked == false && bCourseType[1].checked == false) { VoorkeurErrorValue += "- " + ErrorVoorkeurType + "\n"; } else if (bCourseType[0].checked == true && bBusiness.options[bBusiness.selectedIndex].value == "") { VoorkeurErrorValue += "- " + ErrorVoorkeurBusiness + "\n"; } else if (bCourseType[1].checked == true && bLeisure.options[bLeisure.selectedIndex].value == "") { VoorkeurErrorValue += "- " + ErrorVoorkeurLeisure + "\n"; } if (VoorkeurErrorValue != "") { VoorkeurErrorValue = ErrorVoorkeurKop + ": \n" + VoorkeurErrorValue ; } //Agree vinkje if (bAgree.checked == false) { AgreeErrorValue += "- " + ErrorAgree + "\n"; } if (AgreeErrorValue != "") { AgreeErrorValue = ErrorAgreeKop + ": \n" + AgreeErrorValue ; } //Extra cursisten if (bAantal) { var totaal = bAantal.options[bAantal.selectedIndex].value; totaal = totaal + 1; for (vI=2; vI < totaal; vI++) { var bANaamVeld = document.getElementById("aplVoornaam"+vI); if(bANaamVeld) { if (bANaamVeld.value == "") { bANaamError++; } } var bAAchternaamVeld = document.getElementById("aplAchternaam"+vI); if(bAAchternaamVeld) { if (bAAchternaamVeld.value == "") { bAAchternaamError++; } } var bAEmailVeld = document.getElementById("aplEmail"+vI); if(bAEmailVeld) { if (bAEmailVeld.value == "") { bAEmailError++; } } } } if (bANaamError != 0) { ErrorAplValue += "- " + ErrorAplNaamValue + "\n"; } if (bAAchternaamError != 0) { ErrorAplValue += "- " + ErrorAplAchternaamValue + "\n"; } if (bAEmailError != 0) { ErrorAplValue += "- " + ErrorAplEmailValue + "\n"; } if (ErrorAplValue != "") { ErrorAplValue = ErrorAplKop + ": \n" + ErrorAplValue ; } //Error Messages samenvoegen if (CourseErrorValue != "") { ErrorValue += CourseErrorValue; } if (HeadErrorValue != "") { ErrorValue += "\n" + HeadErrorValue; } if (VoorkeurErrorValue != "") { ErrorValue += "\n" + VoorkeurErrorValue; } if (AgreeErrorValue != "") { ErrorValue += "\n" + AgreeErrorValue; } if (ErrorAplValue != "") { ErrorValue += "\n" + ErrorAplValue ; } //Bij fout weergeven if (ErrorValue != "") { alert(ErrorValue); } else { bForm.submit(); } } } else { } } function NieuwsbriefCheckForm() { var nbForm = document.nieuwsbriefForm; if (nbForm) { var nieuwsbriefEmail = nbForm.nieuwsbriefEmail ; if (nieuwsbriefEmail.value == "" || nieuwsbriefEmail.value.indexOf("@") < 0 || nieuwsbriefEmail.value.indexOf(".",nieuwsbriefEmail.value.indexOf("@")) < 0) { alert("" + ErrorNieuwsbriefEmailValue + "") } else { nbForm .submit() } } } // return the value of the radio button that is checked // return an empty string if none are checked, or // there are no radio buttons function getCheckedValue(radioObj) { if(!radioObj) return ""; var radioLength = radioObj.length; if(radioLength == undefined) if(radioObj.checked) return radioObj.value; else return ""; for(var i = 0; i < radioLength; i++) { if(radioObj[i].checked) { return radioObj[i].value; } } return ""; } // set the radio button with the given value as being checked // do nothing if there are no radio buttons // if the given value does not exist, all the radio buttons // are reset to unchecked function setCheckedValue(radioObj, newValue) { if(!radioObj) return; var radioLength = radioObj.length; if(radioLength == undefined) { radioObj.checked = (radioObj.value == newValue.toString()); return; } for(var i = 0; i < radioLength; i++) { radioObj[i].checked = false; if(radioObj[i].value == newValue.toString()) { radioObj[i].checked = true; } } } function checkProfile() { callEditLayer('ShowLogin'); document.addLogin.username.focus(); document.addLogin.redirect.value = "profile.asp"; } function checkPoll() { callEditLayer('ShowLogin'); document.addLogin.username.focus(); } function checkForum() { callEditLayer('ShowLogin'); document.addLogin.redirect.value = "forum"; } function checkForumComment() { callEditLayer('ShowLogin'); document.addLogin.redirect.value = "forumcomment"; } function checkRecommendation() { callEditLayer('ShowLogin'); document.addLogin.redirect.value = "recommendation"; } // Check email function initCheckEmail(){ $("#checkEmailField").bind("blur",function(){ checkEmail($(this).attr("value")); }); } function checkEmail(emailaddress) { jQuery.post('includes/checkEmail.asp', { email: emailaddress }, function(data) { if (data == "|OK|") { $("#checkEmailExists").attr("value","false"); } else { $("#checkEmailExists").attr("value","true"); } }) }