');
$(".overlay").fadeIn(250, function(){$(this).find("input:first").focus();});
$(".ask.button").click(function(){
if ($(this).text() == "ja"){
artNr = $(this).data("artnr");
updateCart(artNr, "delete", true);
}
if ($(this).text() == "versturen"){
error = false;
$(".overlay input").each(function(){
if ($(this).val() == ""){blink($(this)); if(error){return false;}} // nothing filled in
if ($(this).val().split("@").length - 1 > 1){blink($(this)); if(error){return false;}} // multiple e-mail addresses filled in (e-mail injection? spam?)
if ($(this).attr("type") == "email"){
atPos = $(this).val().indexOf("@"); dotPos = $(this).val().lastIndexOf(".");
if (atPos < 1 || dotPos < atPos + 2 || dotPos + 2 >= $(this).val().length){blink($(this)); if(error){return false;}} // wrong notation for e-mail
}
});
if (!error){
$.post("inc/PHP/mailHandler.php", {
"subject": "interesse in nieuw boek",
"message": "Deze persoon wil graag een bericht krijgen zodra dit boek beschikbaar is: