$("#foo3").carouFredSel({ responsive : true, pagination : "#foo3_pag", scroll : { fx : "crossfade", easing : "linear", pauseOnHover : true }, auto : { timeoutDuration : 5000 }, items : { visible : 1, width : 468, height : "312" } }); $('input').not('.poll_option, .poll_reg').focus(function() { if (!$(this).data("DefaultText")) $(this).data("DefaultText", $(this).val()); if ($(this).val() != "" && $(this).val() == $(this).data("DefaultText")) $(this).val(""); }).blur(function(){ if ($(this).val() == "") $(this).val($(this).data("DefaultText")); }); /* index */ $(function() { $('.more').live("click",function() { var ID = $(this).attr("id"); if(ID) { $("#more"+ID).html(''); $.ajax({ type: "POST", url: "/index/swk_covers_more.inc.php", data: "lastmsg="+ ID, cache: false, success: function(html){ $(".content_double").append(html); $("#more"+ID).remove(); }, }); } return false; }); }); /* news */ $('.nbm').each(function() { var obj = $(this); var imgWidth = $('img',obj).width(); var imgHeight = $('img',obj).height(); if(imgHeight < 100) { $(this).height(130); } if(imgHeight > 100) { $(this).height(180); } if(imgHeight === 0) { $(this).height(180); } }); /* blogs */ $('.blogger_inf').live("click",function(e) { /* $('.content_mid').animate({'opacity': '0.2'}, '50');*/ var blogID = $(this).attr("id"); /*alert(blogID);*/ var blogID = '#' + blogID + '-content'; $(blogID).show('slow'); $(".nbm").animate({'opacity': '0.2'}, '50'); /* $('.content_mid').animate({ 'opacity': '0.2' }, function() { $(blogID).show('fast'); });*/ e.preventDefault(); }); /* show artist pops */ $(".nam_block").click(function() { $(".nam_info").hide(); var box = $(this).attr('id'); var boxid = '#' + box + '-content'; $(boxid).show('slow'); }); $('html:not(.nam_info, .nam_block, .blogger_inf)').on('click',function() { $(".nam_info, .blogger_info").slideUp(); $("#submithidden").hide('fast'); $('.nbm').animate({'opacity': '1'}, 'slow'); }); $(".nam_info, .nam_block, .blogger_info, #email_nwsbrf").click(function(event) { event.stopPropagation(); }); /* NIEUWSBRIEF */ $('input[id=email_nwsbrf]').each(function() { var searchtxt = $("input#searchnav").val(); $("input[id=email_nwsbrf]").css("color","#CCC"); var default_value = this.value; $("input[id=email_nwsbrf]").click(function() { $("input[id=email_nwsbrf]").css("color","#333"); if(this.value == default_value) { this.value = ''; } $('#submithidden').show('slow'); $('.regerrNwsbrf').hide(); }); }); $(document).on('click', '.submitNwsbrf', function () { $('.regerrNwsbrf').hide(); var hasError = hasError; var email = $("#email_nwsbrf").val(); var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/; var emailaddressVal = $("#email_nwsbrf").val(); if(emailaddressVal == '') { hasError = true; $(".submitNwsbrf").after('Dit is een verplicht veld.'); } else if(!emailReg.test(emailaddressVal)) { hasError = true; $(".submitNwsbrf").after('Dit is geen geldig email adres.'); } if (hasError == undefined) { var dataString = 'email='+ email; $.ajax({ type: "POST", url: "/include/process/ins.nieuwsbrief.php", data: dataString, success: function (data) { if(data == 1) { $(".subscribe").html('Hartelijk dank voor jouw inschrijving!'); } if(data == 2) { $(".subscribe").html('Je bent aangemeld voor de nieuwsbrief.'); } if(data == 3) { $(".subscribe").html('De aanmelding is niet gelukt.'); } }, error : function(data) { $(".subscribe").html('De aanmelding is niet gelukt. Probeer het nog een keer of neem contact op met slagwerkkrant.'); } }); } }); $('input[id=unemail_nwsbrf]').each(function() { var searchtxt = $("input#searchnav").val(); $("input[id=unemail_nwsbrf]").css("color","#CCC"); var default_value = this.value; $("input[id=unemail_nwsbrf]").click(function() { $("input[id=unemail_nwsbrf]").css("color","#333"); if(this.value == default_value) { this.value = ''; } $('#unsubmithidden').show('slow'); $('.regerrNwsbrf').hide(); }); }); $(document).on('click', '.unsubmitNwsbrf', function () { $('.unregerrNwsbrf').hide(); var hasError = hasError; var email = $("#unemail_nwsbrf").val(); var codec = $("#unemail_nwsbrf").attr("data"); var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/; var emailaddressVal = $("#unemail_nwsbrf").val(); if(emailaddressVal == '') { hasError = true; $(".unsubmitNwsbrf").after(' Dit is een verplicht veld.'); } else if(!emailReg.test(emailaddressVal)) { hasError = true; $(".unsubmitNwsbrf").after(' Dit is geen geldig email adres.'); } if (hasError == undefined) { var dataString = 'email='+ email + '&codec=' + codec; $.ajax({ type: "POST", url: "/include/process/ins.nieuwsbrief_out.php", data: dataString, success: function (data) { if(data == 1) { $(".ga_content").hide(); $(".unsubscribe").html('Je bent uitgeschreven van de nieuwsbrief.'); } if(data == 2) { $(".unsubscribe").html('De afmelding is niet gelukt.'); } }, error : function(data) { $(".unsubscribe").html('De afmelding is niet gelukt. Probeer het nog een keer of neem contact op met slagwerkkrant.'); } }); } }); /* ZOEKEN */ $('#csubmit').click(function(e) { e.preventDefault(); var searchtxt = $("input.regZkn").val(); var dataString = 'search='+ searchtxt; $.ajax({ type: "GET", url: "/nieuws/zoeken/", data: dataString, success: function(){ window.location.href = '/nieuws/zoeken/?search='+searchtxt+''; if(data == 1) { } if(data == 2) { alert('errrrrrrrrrror'); } }, error : function(data) { } }); }); $('input.regZkn').keypress(function (e) { $(".regZkn").css("color","#333"); var searchtxt = $("input.regZkn").val(); if (e.which == 13) { var dataString = 'search='+ searchtxt; $.ajax({ type: "GET", url: "/nieuws/zoeken/", data: dataString, success: function(){ window.location.href = '/nieuws/zoeken/?search='+searchtxt+''; if(data == 1) { } if(data == 2) { //alert('errrrrrrrrrror'); } }, error : function(data) { } }); } }); $('#csubmit_vidz').click(function(e) { e.preventDefault(); var searchtxt = $("input.regZknVid").val(); var dataString = 'search='+ searchtxt; $.ajax({ type: "GET", url: "/videos/zoeken/", data: dataString, success: function(){ window.location.href = '/videos/zoeken/?search='+searchtxt+''; if(data == 1) { } if(data == 2) { alert('errrrrrrrrrror'); } }, error : function(data) { } }); }); $('input.regZknVid').keypress(function (e) { $(".regZknVid").css("color","#333"); var searchtxt = $("input.regZknVid").val(); if (e.which == 13) { var dataString = 'search='+ searchtxt; $.ajax({ type: "GET", url: "/videos/zoeken/", data: dataString, success: function(){ window.location.href = '/videos/zoeken/?search='+searchtxt+''; if(data == 1) { } if(data == 2) { //alert('errrrrrrrrrror'); } }, error : function(data) { } }); } }); /* aboform */ $(document).ready(function () { $("#cadeau_error").hide(); $("input[type=radio].abonnement").change(function(){ $("input[type=radio].cadeau").removeAttr("checked"); $('#cadeau_voornaam, #cadeau_achternaam, #cadeau_adres, #cadeau_postcode, #cadeau_plaats, #cadeau_land, #cadeau_telefoon, #cadeau_email').val(""); $(".gifts").hide(); var giftdiv = $(this).attr("data"); var aboID = $(this).attr("id"); var aboC = $(this).attr("abo_c"); $("#a-"+aboID).show(); if(aboC === "1") $("#cadeauform").show(); if($(aboID).val() != "") $("#orderform").show(); }); $('.desc').hide(); $("input[name='betaalwijze']").click(function() { var test = $(this).attr("data"); if(test == "machtiging") $(".desc").show(); else $(".desc").hide(); $("#"+test).show(); }); $("#buitenland").hide(); $("#NL").hide(); $("#betaalHead").show(); $("#betaalMessage").show(); if ($("#land").val() == "Nederland" ) { $("#buitenland").hide(); $("#NL").show(); $("#betaalMessage").hide(); } $("#land").change(function(){ if ($(this).val() != "Nederland" ) { $("#buitenland").show(); $("#NL").hide(); $("#betaalMessage").hide(); } else { $('input[type="radio"]#betaalwijze').prop('checked', false); $("#buitenland").hide(); $("#NL").show(); $("#betaalMessage").hide(); } }); $(".submitOrder").click(function(){ $(".order_item").css('background-color','white'); $(".iban_error").hide(); $("#cadeau_error").hide(); var hasError = hasError; var cadeau_voornaam = $("#cadeau_voornaam").val(); var cadeau_achternaam = $("#cadeau_achternaam").val(); var cadeau_adres = $("#cadeau_adres").val(); var cadeau_postcode = $("#cadeau_postcode").val(); var cadeau_plaats = $("#cadeau_plaats").val(); var cadeau_land = $("#cadeau_land").val(); var cadeau_telefoon = $("#cadeau_telefoon").val(); var cadeau_email = $("#cadeau_email").val(); var voornaam = $("#voornaam").val(); var achternaam = $("#achternaam").val(); var adres = $("#adres").val(); var postcode = $("#postcode").val(); var plaats = $("#plaats").val(); var land = $("#land").val(); var telefoon = $("#telefoon").val(); var email = $("#email").val(); var betaalwijze = $("#betaalwijze").val(); var bankrekening = $("#bankrekening").val(); if($('#nieuwsbrief').prop('checked')) var nieuwsbrief = 1; else var nieuwsbrief = 0; /* CADEAU ABO VALIDATION */ var checkCadeauAbo = $('input[type="radio"].abonnement:checked').attr("abo_c"); if(checkCadeauAbo === "1") { if(cadeau_voornaam == '') { hasError = true; $("#c_voornaam").css('background-color','yellow'); } if(cadeau_achternaam == '') { hasError = true; $("#c_achternaam").css('background-color','yellow'); } if(cadeau_adres == '') { hasError = true; $("#c_adres").css('background-color','yellow'); } if(cadeau_postcode == '') { hasError = true; $("#c_postcode").css('background-color','yellow'); } if(cadeau_plaats == '') { hasError = true; $("#c_plaats").css('background-color','yellow'); } if(cadeau_land == '') { hasError = true; $("#c_land").css('background-color','yellow'); } } /* NORMAL ABO VALIDATION */ if(voornaam == '') { hasError = true; $("#o_voornaam").css('background-color','yellow'); } if(achternaam == '') { hasError = true; $("#o_achternaam").css('background-color','yellow'); } if(adres == '') { hasError = true; $("#o_adres").css('background-color','yellow'); } if(postcode == '') { hasError = true; $("#o_postcode").css('background-color','yellow'); } if(plaats == '') { hasError = true; $("#o_plaats").css('background-color','yellow'); } if(land == '') { hasError = true; $("#o_land").css('background-color','yellow'); } if(telefoon == '') { hasError = true; $("#o_tel").css('background-color','yellow'); } var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/; var emailaddressVal = $("#email").val(); if(emailaddressVal == '') { hasError = true; $("#o_email").css('background-color','yellow'); } if(!emailReg.test(emailaddressVal)) { hasError = true; $("#o_email").css('background-color','yellow'); } var checkBetaling = $('input[type="radio"]#betaalwijze:checked').attr("value"); if(checkBetaling === undefined) { hasError = true; } else { if(checkBetaling === "machtiging") { if(bankrekening == '') { hasError = true; $("#o_bankrekening").css('background-color','yellow'); var numericReg = /[a-zA-Z]{2}[0-9]{2}[a-zA-Z0-9]{4}[0-9]{7}([a-zA-Z0-9]?){0,16}/; if(!numericReg.test(bankrekening)) { hasError = true; $("#bankrekening").after('
Geef een geldig IBAN rekeningnummer.
'); } } } if(checkBetaling === "acceptgiro") { $("#bankrekening").val(''); } var aboKeuze = $('input[type="radio"].abonnement:checked').attr("data"); var checkAbo = $('input[type="radio"].abonnement:checked').attr("id"); if ($("#a-"+checkAbo).length){ var abo_cadeau = $('input[type="radio"]#cadeau:checked').attr("value"); if(abo_cadeau === undefined) { hasError = true; $("#cadeau_error").slideDown(); } else { $("#cadeau_error").hide(); } } } if (checkCadeauAbo === "undefined"); { var checkCadeauAbo = ''; } var dataString = 'cadeau_voornaam='+ cadeau_voornaam + '&cadeau_achternaam=' + cadeau_achternaam + '&cadeau_adres=' + cadeau_adres + '&cadeau_postcode=' + cadeau_postcode + '&cadeau_plaats=' + cadeau_plaats + '&cadeau_land=' + cadeau_land + '&cadeau_telefoon=' + cadeau_telefoon + '&cadeau_email=' + cadeau_email + '&voornaam=' + voornaam + '&achternaam=' + achternaam + '&adres=' + adres + '&postcode=' + postcode + '&plaats=' + plaats + '&land=' + land + '&telefoon=' + telefoon + '&email=' + email + '&betaalwijze=' + checkBetaling + '&bankrekening=' + bankrekening + '&aboKeuze=' + aboKeuze + '&abo_cadeau=' + abo_cadeau + '&checkCadeauAbo=' + checkCadeauAbo + '&nieuwsbrief=' + nieuwsbrief; if (hasError == undefined) { $.ajax({ type: "POST", url: "/include/process/reg_abo.php", data: dataString, success: function(data){ if(data == "1") { $("#abo_form").hide(); $("html, body").animate({scrollTop: 0}, 1000); $(".succes").show(); } if(data == "3") {alert(data); } }, error: function(data){ alert('Probeer het nog een keer.');} }); } }); }); $(".gas_button").click(function(){ var topic = $(".gas_button").attr("title"); window.location.href = "mailto:info@slagwerkkrant.nl?subject="+topic+"&body=(Let op: vermeld naast je antwoord ook je adresgegevens en telefoonnummer.)"; }); $('.vid_main').bind('contextmenu',function() { return false; }); /* videos */ $(document).on('click', '.showmore', function() { $(this).text(function(_, txt) { return txt == '- toon minder -' ? '- lees meer -' : '- toon minder -'; }).siblings('.complete').toggle("fast"); }); $(function() { $('.moreVid').live("click",function() { var ID = $(this).attr("id"); if(ID) { $("#more"+ID).html(''); $.ajax({ type: "POST", url: "/videos/videos_more.inc.php", data: "lastmsg="+ ID, cache: false, success: function(html){ $(".content_moreVids").append(html); $("#more"+ID).remove(); }, }); } return false; }); }); /* poll */ $(document).ready(function() { if ($('#pollform').length){ $('input[type="submit"]').attr('disabled','disabled'); } }); $(function() { /* $('#poll_submit').live("click",function() {*/ $("form#pollform :input").change(function() { $(".pollerror").html(''); $("#p_voornaam, #p_achternaam, #p_email,#p_code").css('background-color','white'); var hasError = hasError; var captcha_code = $("#captcha_code").val(); var numberOfCheckedRadio = $('input:radio:checked').length; var totalCheckboxes = $('input:radio').length; var numberNotChecked = totalCheckboxes - numberOfCheckedRadio; var typedTextBox = $("input.poll_option:text:not([value=''])").length; /* alert(typedTextBox); */ var total = typedTextBox + numberOfCheckedRadio; if(total < 6) { hasError = true; $('.pollerror').html('
Vul tenminste zes secties in.'); } /*alert($("input.poll_option:text").length);*/ var voornaam = $("#voornaam").val(); var achternaam = $("#achternaam").val(); var email = $("#email").val(); if(voornaam == '') { hasError = true; $("#p_voornaam").css('background-color','yellow'); } if(achternaam == '') { hasError = true; $("#p_achternaam").css('background-color','yellow'); } var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/; var emailaddressVal = $("#email").val(); if(emailaddressVal == '') { hasError = true; $("#p_email").css('background-color','yellow'); } if(!emailReg.test(emailaddressVal)) { hasError = true; $("#p_email").css('background-color','yellow'); } if($('#enterVerify').val() == $('#verifyNumHidden').val() ) { } else { hasError = true; $("#p_code").css('background-color','yellow'); randomgen(); $('input[type="submit"]').attr('disabled','disabled'); } if (hasError == undefined) { /*alert('OK! ' + hasError);*/ $('input[type="submit"]').removeAttr('disabled'); } }); }); function randomgen() { var rannumber=''; for(ranNum=1; ranNum<=6; ranNum++){ rannumber+=Math.floor(Math.random()*10).toString(); } $('#verifyNum').html(rannumber); $('#verifyNumHidden').val(rannumber); } randomgen(); $('div.artistSelect').on('click', function() { var string = $(this).attr('id'); string = string.split('-'); var artistName = string[0]; var id1 = string[1]; var id2 = string[2]; $('#'+id1+'-'+id2).val(artistName); comments.val(comments.val() + $(this).attr('title')); });