function checkActivationCode() { $j("#greenbox").removeClass("phone_block_vervolg_fout"); $j("#greenbox").addClass("phone_block_vervolg"); $j("#SMSError").hide(); $j("#ShowError").hide(); $j("#ShowError").removeClass("phone_txt_mobile"); $j("#ShowError").addClass("phone_txt_activation"); if($j("#ActivatieCode").val() == '') { $j("#greenbox").removeClass("phone_block_vervolg"); $j("#greenbox").addClass("phone_block_vervolg_fout"); $j("#error").html('Je vulde een ongeldige activatie code in. Probeer het opnieuw.'); $j("#ShowError").show(); }else{ $j("#ActivateButton").removeClass("verzend"); $j("#ActivateButton").addClass("verzend_inactive"); $j.ajax({ url: 'http://www.kpn.com/is-bin/INTERSHOP.enfinity/WFS/KPN-B2C-Site/nl_NL/-/EUR/ViewVBR-Login', type: 'POST', dataType: 'xml', data: { MobileNumber: $j("#MobileNumber").val(), ActivationCode: $j("#ActivatieCode").val(), Ajax: true }, error: function(xhr, status) { window.location.replace("http://www.kpn.com/is-bin/INTERSHOP.enfinity/WFS/KPN-B2C-Site/nl_NL/-/EUR/ViewVBR-ErrorPagina"); }, success: function(xml) { if ($j("Result > Status", xml).text() == "OK") { window.location.replace("http://www.kpn.com:80/mobiel/VerlengenAbonnement.cat"); }else if ($j("Result > Code", xml).text() == "5") { $j("#ActivateButton").removeClass("verzend_inactive"); $j("#ActivateButton").addClass("verzend"); $j("#greenbox").removeClass("phone_block_vervolg"); $j("#greenbox").addClass("phone_block_vervolg_fout"); $j("#error").html('Je vulde een ongeldige activatie code in. Probeer het opnieuw.'); $j("#ShowError").show(); }else if ($j("Result > Code", xml).text() == "6") { window.location.replace($j("Result > Redirect", xml).text()); }else{ window.location.replace("http://www.kpn.com/is-bin/INTERSHOP.enfinity/WFS/KPN-B2C-Site/nl_NL/-/EUR/ViewVBR-ErrorPagina"); } } }); } return false; } function checkMobileNumber() { $j("#ShowError").hide(); $j("#SMSError").hide(); $j("#greenbox").removeClass("phone_block_2"); $j("#greenbox").addClass("phone_block"); var myExpression = /^06\d{8}$/; if(!myExpression.test($j("#MobileNumber").val()) || $j("#MobileNumber").val() == '') { $j("#greenbox").removeClass("phone_block"); $j("#greenbox").addClass("phone_block_2"); $j("#error").html('Je vulde geen volledig tiencijferig telefoonnummer in.'); $j("#ShowError").show(); }else{ $j("#SendButton").removeAttr("onclick"); $j("#SendButton").removeClass("verzend"); $j("#SendButton").addClass("verzend_inactive"); $j("#MobileNumber").attr("disabled", true); $j.ajax({ url: 'http://www.kpn.com/is-bin/INTERSHOP.enfinity/WFS/KPN-B2C-Site/nl_NL/-/EUR/ViewVBR-Start', type: 'POST', dataType: 'xml', data: { MobileNumber: $j("#MobileNumber").val(), Ajax: true }, error: function(xhr, status) { window.location.replace("http://www.kpn.com/is-bin/INTERSHOP.enfinity/WFS/KPN-B2C-Site/nl_NL/-/EUR/ViewVBR-ErrorPagina"); }, success: function(xml) { if ($j("Result > Status", xml).text() == "OK") { $j("#greenbox").removeClass("phone_block"); $j("#greenbox").addClass("phone_block_vervolg"); $j("#ActivationDiv").show(); }else if ($j("Result > Code", xml).text() == "2") { $j("#greenbox").removeClass("phone_block"); $j("#greenbox").addClass("phone_sms"); $j("#SendButton").removeAttr("onclick"); $j("#SMSErrorText").html('Er is al een sms verstuurd naar dit nummer.'); $j("#SMSError").show(); $j("#ActivationDiv").show(); $j("#MobileNumber").attr("disabled", true); }else if ($j("Result > Code", xml).text() == "3") { $j("#error").html("Uw SMS is vervallen. Gelieve nogmaals in te loggen."); }else{ window.location.replace("http://www.kpn.com/is-bin/INTERSHOP.enfinity/WFS/KPN-B2C-Site/nl_NL/-/EUR/ViewVBR-ErrorPagina"); } } }); } return false; }