//aanbieder dropdown tonen function showDrop(id, title) { if(!$('#down-'+id).is(':visible')) { $('#'+id).append('
'+title+' abonnementen vergelijken'+title+' gebruikerservaringen'+title+' informatie
'); $('#'+id+' .drop').addClass('aanbiederactive'); } else { hideDrop(); } } //aanbieder dropdown verbergen function hideDrop() { $('.down').fadeOut('fast', function() { $('.down').remove(); }); $('.drop').removeClass('aanbiederactive'); } //ajax content laden function loadPage(hash) { active = true; if(hash != '' && hash.substring(0,1) == '#') hash = hash.substring(1); //huidige pagina en provider if(hash.indexOf('/') >= 0) { currentPage = hash.substring(0, hash.indexOf('/')); currentData = hash.substring(hash.indexOf('/')).substring(1); } else { currentPage = hash; currentData = ''; } if(currentPage == '') currentPage = 'vergelijken'; //if(currentPage == 'specificaties' && jQuery.inArray(currentData, aanbiederArray)) // currentData = ''; //menu bijwerken $('#menuitems li a').removeClass('menuactive'); $('#menuitems li #menu-'+currentPage).addClass('menuactive'); //aanbieders bijwerken $('#aanbieders li img').removeClass('aanbiederactive'); if(currentData != '') $('#aanbieders #'+currentData+' img').addClass('aanbiederactive'); $('#aanbieders li .aanbieder').attr('href', function() { return path+currentPage+this.href.substring(this.href.lastIndexOf('/')); }); //sidebar laden $("#sidebar").load(path+'sidebar/'+currentPage+'.inc.php?currentData='+currentData+'&version=content', function(response, status, xhr) { if(status == "error" && xhr.status == '404') $("#sidebar").html(''); $("#sidebar").show(); //content laden $("#content").load(path+hash+'?version=content', function(response, status, xhr) { if(status == "error" && xhr.status == '404') $("#content").load(path+'includes/404.inc.php?url='+$.URLEncode(hash)); $("#content").show(); }); active = false; }); //analytics pageview _gaq.push(['_trackPageview', '/'+hash]) } //postcodecheck valideren en laden function getPostcodecheck(form, vari) { var varPcg = form.pcg.value; var varPcl = form.pcl.value; var varHn = form.hn.value; form.hn.blur(); var expPcg = /([0-9]{4})/; var expPcl = /([A-Za-z]{2})/; var expHn = /[1-9]/; var errorOcc = false; if((!expPcg.test(varPcg) || !expPcl.test(varPcl.toUpperCase())) && (!expHn.test(varHn))) { $('#pcg,#pcl,#hn').addClass('error'); alert("U heeft een ongeldige postcode- en huisnummercombinatie ingevuld, controleer a.u.b. uw gegevens.\n\n"); errorOcc = true; } else if((!expPcg.test(varPcg)) || (!expPcl.test(varPcl))) { $('#pcg,#pcl').addClass('error'); alert("U heeft een ongeldige postcode ingevuld, controleer a.u.b. uw gegevens.\n\n"); errorOcc = true; } else if(!expHn.test(varHn)) { $('#hn').addClass('error'); alert("U heeft een ongeldig huisnummer ingevuld, controleer a.u.b. uw gegevens.\n\n"); errorOcc = true; } $('#pcg,#pcl,#hn').focus(function() { $('#'+this.id).removeClass('error'); }); if(errorOcc == false) { $('.loading,#pccload').show(); $('.loading,#pccload').fadeIn(); var postcodecheckData = $('#postcodecheck').serialize(); $.ajax({ type: 'POST', url: path+'/postcodecheck?version=content', data: postcodecheckData, success: function(returnData) { $('#postcodecheck').fadeTo(500, 0, function () { $("#adres").load(path+'includes/'+vari+'.inc.php?currentData='+currentData+'&'+postcodecheckData, function(response, status, xhr) { if(status == 'success') { $('#postcodecheck').hide(); $('.loading,#pccload').fadeOut(); $("#adres").show(); if(vari == 'adres') getAbonnementen(); } }); }); }, error: function(returnData) { $('.loading,#pccload').fadeOut(); $('#content').html('error'); } }); } return false; } //postcodecheck autotab function autoTab(object, length, next_field) { field_length = object.value.length; if(field_length == length) next_field.focus(); } //sorteer abonnementen function sortering(kol) { if(kol != $("#inp-sort").val()) { $("#inp-sort").val(kol); $("#inp-order").val('asc'); } else { switch($("#inp-order").val()) { case 'asc': $("#inp-order").val('desc'); break; case 'desc': $("#inp-order").val('asc'); break; } } getAbonnementen(); } //save session function saveSession(action, value) { $.ajax({ type: 'POST', url: path+'/includes/save', data: 'action='+action+'&value='+value, success: function() { $("#loader").hide(); } }); } //wijzig weergave function weergave(wrg) { //loader $("#loader").show(); switch(wrg) { case 'kolomweergave': $("#cols, #vc").hide(); break; case 'lijstweergave': $("#cols, #vc").show(); $(".aboi, .abospa, .slide").hide(); break; case 'ingeklapt': $(".aboi, .abospa, #cols, #vc").show(); $(".slide").hide(); break; case 'uitgeklapt': $(".aboi, .abospa, .slide, #cols, #vc").show(); break; } saveSession('weergave',wrg); if(wrg != 'kolomweergave' && currentPage != 'vergelijken') { var redirurl = path+'#vergelijken'; if(currentData != '' && jQuery.inArray(currentData, aanbiederArray) > 0) redirurl+= '/'+currentData; window.location.href = redirurl; } else if(wrg == 'kolomweergave' && currentPage != 'specificaties') { var redirurl = path+'#specificaties'; if(currentData != '') redirurl+= '/'+currentData; window.location.href = redirurl; } } //wijzig pagina function pagina(pag) { $(".paginas").hide(); $("#pag-"+pag).show(); saveSession(currentPage+'-pagina',pag); } //formdata function getForm(frm) { var poststr; var poststr_array = []; for (i=0;iSluiten X'; document.getElementById('modal').style.width = modalWidth+'px'; document.getElementById('modal').style.height = modalHeight+'px'; document.getElementById('modal').style.marginTop = '-'+(modalHeight / 2)+'px'; document.getElementById('modal').style.marginLeft = '-'+(modalWidth / 2)+'px'; document.getElementById('modalframe').src = modalSrc; document.getElementById('modalframe').style.width = modalWidth+'px'; document.getElementById('modalframe').style.height = modalHeight+'px'; document.getElementById('modal').style.visibility = "visible"; document.getElementById('overlay').style.visibility = "visible"; document.getElementById('modalframe').style.visibility = "visible"; } var iebody = document.body; if(navigator.appName.indexOf("Internet Explorer") != -1) { split=navigator.appVersion.split("MSIE"); version=parseFloat(split[1]); if(version < 7) { scroll(0,0); document.getElementById('modal').style.marginTop = '0px'; } } return false; }