function hideAll(){ $('#log').slideUp('fast', function() { $('#reg').slideUp('fast', function() { }); }); } function showReg(){ $('#log').slideUp('fast', function() { $('#reg').slideDown('fast', function() { focusAtEnd(document.getElementById("username")); } ); }); } function showLogin(){ $('#reg').slideUp('fast', function(){ $('#log').slideDown('fast', function(){ focusAtEnd(document.getElementById("emaill")); } ); }); } function checkmail(email){ if (!email.match(/^[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i)){ return(false); } else { return(true) } } function checkregform(){ if (document.forms.regForm.username.value.length < 1){ document.getElementById('errorR').innerHTML="Missing your username!"; $('#errorR').slideDown('slow', function(){} ); document.forms.regForm.username.focus(); return(false); } if (!checkmail(document.forms.regForm.email.value)){ document.getElementById('errorR').innerHTML="Invalid email"; $('#errorR').slideDown('slow', function(){} ); document.forms.regForm.email.focus(); return(false); } if (document.forms.regForm.password.value.length < 6){ document.getElementById('errorR').innerHTML="Password is to short (6 characters)"; $('#errorR').slideDown('slow', function(){} ); document.forms.regForm.password.focus(); return(false); } var username = document.forms.regForm.username.value.replace(/[^\w\s]/gi, ''); if(document.forms.regForm.username.value!=username){ document.getElementById('errorR').innerHTML="Invalid usename (numbers and characters only)"; $('#errorR').slideDown('slow', function(){} ); document.forms.regForm.username.focus(); return(false); } document.forms.regForm.submit(); } function dsiplaycheckUsername(val){ if(val){ document.getElementById('errorR').innerHTML="Sorry - username already exists!"; $('#errorR').slideDown('slow', function(){} ); $('#regFormlink').slideUp('slow', function(){} ); }else{ $('#errorR').slideUp('slow', function(){} ); $('#regFormlink').slideDown('slow', function(){} ); } } function checkurl(){ var thisusername=encodeURIComponent(document.getElementById('username').value); x_checkUsername(thisusername, dsiplaycheckUsername) } function checkUsername(){ var username = document.forms.regForm.username.value.replace(/[^\w\s]/gi, ''); if(username != document.forms.regForm.username.value){ document.forms.regForm.username.value=username; } else { //return true; } checkurl(); } function setSex(sex){ $(".selected").removeClass("selected").addClass("sex"); $("#sex"+sex).removeClass("sex").addClass("selected"); $(".sexcheck").html(""); $("#sexcheck"+sex).html(""); $("#sex").val(sex); } function setFlirt(flirt){ $(".flirtselected").removeClass("flirtselected").addClass("flirt"); $("#flirt"+flirt).removeClass("flirt").addClass("flirtselected"); $(".flirtcheck").html(""); $("#flirtcheck"+flirt).html(""); $("#flirt").val(flirt); if(flirt==1){ $('#oriantationbox').slideDown('slow', function(){} ); }else{ $('#oriantationbox').slideUp('slow', function(){} ); } } function setOriantation(oriantation){ $(".oriantationselected").removeClass("oriantationselected").addClass("oriantation"); $("#oriantation"+oriantation).removeClass("oriantation").addClass("oriantationselected"); $(".oriantationcheck").html(""); $("#oriantationcheck"+oriantation).html(""); $("#oriantation").val(oriantation); } function checkregform2(){ var y=$("#birthyear").val(); var m=$("#birthmonth").val(); var d=$("#birthday").val(); var date = new Date(y,m-1,d); if (date.getFullYear() == y && date.getMonth() + 1 == m && date.getDate() == d) { } else { document.getElementById('errorR2').innerHTML="Invalid date!"; $('#errorR2').slideDown('slow', function(){} ); return(false); } if (document.forms.regForm2.sex.value == 0){ document.getElementById('errorR2').innerHTML="Missing your gender!"; $('#errorR2').slideDown('slow', function(){} ); return(false); } if (document.forms.regForm2.flirt.value == 0){ document.getElementById('errorR2').innerHTML="Do you wanna flirt?"; $('#errorR2').slideDown('slow', function(){} ); return(false); } if (document.forms.regForm2.flirt.value == 1){ if (document.forms.regForm2.oriantation.value == 0){ document.getElementById('errorR2').innerHTML="Missing your interest"; $('#errorR2').slideDown('slow', function(){} ); return(false); } } document.forms.regForm2.submit(); } // Inkey function checkInKeySubmitButton(){ thiskey=$("#newinkey").val(); if(thiskey!=""){ $('#inkeysubmitbutton').slideDown('slow', function(){} ); }else{ $('#inkeysubmitbutton').slideUp('slow', function(){} ); } } function submitInKey(){ var thiskey=$("#newinkey").val(); top.location.href="https://kirchenzeitung-koeln.de/i/"+thiskey; } function checkRequestMail(){ var v=$("#requestemail").val(); var val=checkmail(v); if(val){ $('#requestsubmitbutton').slideDown('slow', function(){} ); }else{ $('#requestsubmitbutton').slideUp('slow', function(){} ); } } function displaySubmitRequestMail(val){ if(val){ $('#requestemailsuc').html(val); $('#requestemailform').slideUp('slow', function(){} ); $('#requestemailsuc').slideDown('slow', function(){} ); } } function submitRequestMail(){ var requestemail = encodeURIComponent($("#requestemail").val()); x_submitRequestMail(requestemail, displaySubmitRequestMail); }