<script Language="JavaScript">
<!-- Over the top e-mail checker by kurt.grigg@virgin.net

YourEmailAddress='info@pl-medien.de';

function Highlight(){
document.form1.email.focus();
document.form1.email.select();
}
function check(){
var email = document.form1.email.value;
var blanks = ''*100;
var naughty = new Array("arse","bastard","cunt","fuck","shit","wanker","piss","twat");
var sneaky = email.toLowerCase();
var illegal = "You have entered illegal characters.\nOnly characters listed here allowed.\n\nLetters of Alphabet [lower and upper case]\nNumbers\nOne @ symbol only\nFull stops\nHyphens [Minus sign]\nUnderscores\n\n";
//mail check
if (email <= blanks){
  alert("Please enter your e-mail address.");
  Highlight();return false;
  }
else if (email.length > 62){
   alert('Max character length for any e-mail address is 63.');
   Highlight();return false;
   }
else if (email.charAt(0) == " "){
   alert('You have typed a space at the - START - of your e-mail address');
   Highlight();return false;
   }
else if (email.charAt(email.length-1) == " "){
   alert('You have typed a space at the - END - of your e-mail address');
   Highlight();return false;
   }
else if (email.indexOf(" ") !=-1){
   alert('You have typed a space - IN - your e-mail address');
   Highlight();return false;
   }

//CHECK FOR ILLEGAL CHARACTERS 1
for (i=0; i < email.length; i++){
var caps = "a".toUpperCase();
var E = email.substring(i, i + 1);
if ((E < "0" || "9" < E ) && E != "@"  && E !="." && E !="-"  && E !="_"  &&  E < caps || "z" < E){
 alert(illegal);
 Highlight();return false;
 }
}

//CHECK FOR ILLEGAL CHARACTERS 2
if ((email.indexOf('`',0) != -1) || (email.indexOf(String.fromCharCode(94)) != -1) || (email.indexOf(String.fromCharCode(92)) != -1) || (email.indexOf('[',0) != -1) || (email.indexOf(']',0) != -1)){
 alert(illegal);
 Highlight();return false;
}

//CHECK FOR SWEARING
for (i=0; i < email.length; i){  
 if (sneaky.indexOf(naughty[i]) != -1){
 alert('Please remove the swear word - '+naughty[i].toUpperCase());
 Highlight();return false;
 }
i++;
}



for (i=0; i < email.length; i++){
if (email.charAt(i) ==" ")
email.charAt(i)="";
}
alert(email);




//GENERAL FORMATING
if (email.charAt(0) =="."){
 alert('An e-mail address cannot start with a full stop');
 Highlight();return false;
}
else if (email.split('@').length > 2){
 alert('Only 1 @ allowed in e-mail address.');
 Highlight();return false;
}
else if (email.indexOf ('@',0) == -1){
 alert("The @ symbol is missing");
 Highlight();return false;
}
else if (email.indexOf("@") < 2){
 alert("There must be at least 2 characters before @ symbol.");
 Highlight();return false;
}
else if (email.charAt(email.length-1) == "@"){
 alert('An e-mail address cannot finnish with @');
 Highlight();return false;
}
else if (email.indexOf ('.') == -1){
 alert("An e-mail address must contain at least 1 full stop");
 Highlight();return false;
}
else if (email.indexOf('.',email.indexOf('@')) == -1){
 alert('The full stop after the @ is missing');
 Highlight();return false;
}
else if (email.substring(email.indexOf('@'),email.length).indexOf(".") < 4){
 alert('There must be at least 3 characters between @ and following full stop');  
 Highlight();return false;
}
else if (email.lastIndexOf(".")+2 == email.length){
 alert('There must be at least 2 characters after last full stop');
 Highlight();return false;
}
else if (email.substring(email.lastIndexOf("."),email.length).length > 4){
 alert('Only 3 characters allowed after last full stop');
 Highlight();return false;
}
else if (email.charAt(email.length-1) =="."){
 alert('An e-mail address cannot finnish with a full stop');
 Highlight();return false;
}
ok=null;
confirm('You have entered  - '+email+'\nAll checks passed.\n\nDo you want to send it now?')?ok=1:ok=0;
if (ok==1) return true;
else return false;
}
//-->
</script>
Enter your e-mail address for my latest thingy.

<script Language="JavaScript">
<!-- Put this where ever you want!
var styleok=(document.all)?'class=looks':0; 
document.write('<form name="form1" method="POST" action="mailto:'+YourEmailAddress+'" ENCTYPE="text/plain" ONSUBMIT="return check()">'
+'<input '+styleok+' type="SUBMIT" value="Send"> '
+'<input '+styleok+' name="email" type="text" size="25" maxlength="63"> '
+'<input '+styleok+' type="Reset" value="Clear">'
+'</form>');
//-->
</script>

