var submitted = 0;
var foc = 0;

function everything(form) {
foc = 0;
if (submitted) { alert("Form already submitted, please be patient"); return false;}

if(isage(form) == false) {
alert("You must be at at least 16 years of age to enter");
form.age.focus();
return false; }
text = "You have not correctly filled in the following fields:";
if(isname(form) == false) {
text += "\n   your name is mandatory";
}
if(isemail(form) == false) {
text += "\n   your e-mail address is mandatory (format you@mail.domain)";
}
if(isweb(form) == false) {
text += "\n   the url of the web site you are submitting is mandatory (format http://something.something)";
}
if (foc) { alert(text); return false; }
if (!submitted) { 
form.submitit.disabled=true;
submitted = 1;
form.submit();
}}

function isname(form) {
if (form.name.value == "") {
if (!foc) {form.name.focus(); foc = 1;}
return false;
}
return true;
}
function isemail(form) {
if ((form.replyemail.value == "" || form.replyemail.value.indexOf('@', 0) == -1) ||
form.replyemail.value.indexOf('.') == -1) {
if (!foc) {form.replyemail.focus(); foc = 1;}
return false;
}
return true;
}
function isweb(form) {
if (form.web.value.indexOf("http:\/\/") == -1 || form.web.value.indexOf(".") == -1) {
if (!foc) {form.web.focus(); foc = 1;}
return false;
}
return true;
}
function isage(form) {
return form.age.checked;
}

