function check_it() { //Create objects var sname = document.getElementById('sname').value; var sepost = document.getElementById('sepost').value; var pnum = document.getElementById('pnum').value; var errormsg = ''; var sepostfeil = false; var mepostfeil = false; if(sname.length < 3) { errormsg = errormsg + 'You have to fill in your name.\n'; } if(pnum.length < 3) { errormsg = errormsg + 'You have to fill in your zipcode.\n'; } if(sepost.indexOf("@") == -1) { sepostfeil = true; } else { var splitter = sepost.split("@"); if(splitter[1].indexOf(".") == -1) { sepostfeil = true; } } if(sepostfeil) { errormsg = errormsg + 'Your e-mail is incorrect.\n'; } if(mepostfeil) { errormsg = errormsg + 'Receivers e-mail is incorrect.\n'; } if(errormsg.length > 0) { alert(errormsg); return false; } else { return true; } } function switch_color(color,id) { var tdObj = document.getElementById(id); tdObj.style.backgroundColor = color; } function activate_link(id,color) { var linkObj = document.getElementById(id); linkObj.style.color = color; } var oldin = 0; var output = ""; function typewriter(texten,inn,inn2,sw) { var typeObj = document.getElementById('typewrite'); var textar = texten.split("|"); inn2 = inn2 -0; inn = inn -0; var a = textar.length; a = a - 0; if(sw == 1) { sw = 0; tbit = "_"; } else { sw = 1; tbit = ""; } if(inn < a) { if(oldin < textar[inn].length) { w_text = textar[inn]; output = output + w_text.substring(inn2,inn2+1); if(output.length > 60) { output = output.substring((output.length-60),output.length); } typeObj.innerHTML = output+tbit oldin = inn2 +1; time = setTimeout("typewriter('"+texten+"',"+inn+","+(inn2+1)+","+sw+")",80); } else { w_text = textar[inn]; output = output + w_text.substring(inn2,inn2+1); if(output.length > 60) { output = output.substring((output.length-60),output.length); } typeObj.innerHTML = output; output = ""; inn = inn - 0 + 1; oldin = 0; time = setTimeout("typewriter('"+texten+"',"+inn+",0,0)",1000); } } else { oldin = 0; time = setTimeout("typewriter('"+texten+"',0,0,0)",1000); } } function check_letter() { var text = document.getElementById('epost').value; var errormsg = false; if(text.length < 6) { errormsg = true; } if(text.indexOf("@") == -1) { errormsg = true; } else { textsplit = text.split("@") if(textsplit[1].indexOf(".") == -1) { errormsg = true; } } if(errormsg) { alert('Your e-mail is incorrect.\n'); return false; } else { return true; } } function nl_remove() { var nlForm = document.getElementById('nlform'); nlForm.action = 'newsletteradd.asp?m=off'; var send = check_letter(); if(send) { nlForm.submit(); } }