var check_email = /^(\w+(?:\.\w+)*)@((?:\w+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;

function submit1(tell) {
trimtext(tell.name);
trimtext(tell.email);
trimtext(tell.email_1);
trimtext(tell.email_2);
trimtext(tell.email_3);
trimtext(tell.email_4);
trimtext(tell.email_5);
trimtext(tell.email_6);
trimtext(tell.message);
error_msg = "";
focus_to = "";
if (tell.name.value == "") {
error_msg += "- your name\n";
if (focus_to == "") focus_to = "name"; }
if (!check_email.test(tell.email.value)) {
error_msg += "- your email\n";
if (focus_to == "") focus_to = "email"; }
if (tell.email_1.value == "" && tell.email_2.value == "" && tell.email_3.value == "" && tell.email_4.value == "" && tell.email_5.value == "" && tell.email_6.value == "") {
error_msg += "- your friends email\n";
if (focus_to == "") focus_to = "email_1"; }
if (tell.email_1.value != "" && !check_email.test(tell.email_1.value)) {
error_msg += "- your friends email 1\n";
if (focus_to == "") focus_to = "email_1"; }
if (tell.email_2.value != "" && !check_email.test(tell.email_2.value)) {
error_msg += "- your friends email 2\n";
if (focus_to == "") focus_to = "email_2"; }
if (tell.email_3.value != "" && !check_email.test(tell.email_3.value)) {
error_msg += "- your friends email 3\n";
if (focus_to == "") focus_to = "email_3"; }
if (tell.email_4.value != "" && !check_email.test(tell.email_4.value)) {
error_msg += "- your friends email 4\n";
if (focus_to == "") focus_to = "email_4"; }
if (tell.email_5.value != "" && !check_email.test(tell.email_5.value)) {
error_msg += "- your friends email 5\n";
if (focus_to == "") focus_to = "email_5"; }
if (tell.email_6.value != "" && !check_email.test(tell.email_6.value)) {
error_msg += "- your friends email 6\n";
if (focus_to == "") focus_to = "email_6"; }
if (error_msg != "") {
if (tell.name.value == "") {
alert("the following fields are either blank or have an invalid email address:\n\n"+error_msg+"\nplease correct these and try again."); }
else {
alert("the following fields have an invalid email address:\n\n"+error_msg+"\nplease correct these and then submit again."); }
eval("tell."+focus_to+".select()");
return false; }
else {
document.cookie = "hu_name="+tell.name.value;
document.cookie = "hu_email="+tell.email.value;
tell.submit.disabled = true;
tell.submit.value = "WAIT...";
tell.submit.style.cursor = "default";
return true; } }

function submit2(scoreform) {
trimtext(scoreform.name);
if (scoreform.name.value == "") {
alert("you havent entered a name!");
scoreform.name.focus();
return false; }
else {
document.cookie = "hu_name="+scoreform.name.value;
scoreform.submit.disabled = true;
scoreform.submit.value = "WAIT...";
scoreform.submit.style.cursor = "default";
return true; } }

function submit3(contact) {
trimtext(contact.email);
error_msg = "";
focus_to = "";
if (!check_email.test(contact.email.value)) {
error_msg += "- email\n";
if (focus_to == "") focus_to = "email"; }
if (contact.message.value == "") {
error_msg += "- message\n";
if (focus_to == "") focus_to = "message"; }
if (error_msg != "") {
alert("the following fields are either blank\nor have an invalid email address:\n\n"+error_msg+"\nplease correct these and try again.");
eval("contact."+focus_to+".select()");
return false; }
else {
document.cookie = "hu_email="+contact.email.value;
contact.submit.disabled = true;
contact.submit.value = "WAIT...";
contact.submit.style.cursor = "default";
return true; } }

function submit4(video) {
if (video.number.value == "") {
alert("you have to enter the keycode in the space provided first.\n\nplease fill it in and try again.");
video.number.focus();
return false; }
else {
video.submit.disabled = true;
video.submit.value = "...";
video.submit.style.cursor = "default";
return true; } }

function get_cookie(name) {
var search = name+"=";
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search);
if (offset != -1) {
offset += search.length;
end = document.cookie.indexOf(";", offset);
if (end == -1) {
end = document.cookie.length; }
returnvalue = unescape(document.cookie.substring(offset, end)); } }
return returnvalue; }

function trimtext(item) {
item.value = item.value.replace(/\r/g, " ");
item.value = item.value.replace(/[^ A-Za-z0-9`~!@#\$%\^&\*\(\)-_=\+\\\|\]\[\}\{'";:\?\/\.>,<]/g, "");
item.value = item.value.replace(/'/g, "");
item.value = item.value.replace(/ +/g, " ");
item.value = item.value.replace(/^\s/g, "");
item.value = item.value.replace(/\s$/g, "");
if (item.value == ' ') {
item.value = ''; } }

function formfields() {
var forms=document.getElementsByTagName("input");
for (var i=0; i<forms.length; i++) {
if (!/submit/.test(forms[i].className)) {
forms[i].onfocus=function() {
this.className="inpon"; }
forms[i].onblur=function() {
this.className="input"; } }
else {
forms[i].hideFocus=true;
forms[i].onfocus=function() {
this.className="subon"; }
forms[i].onblur=function() {
this.className="submit"; }
forms[i].onmouseover=function() {
this.className="subon"; }
forms[i].onmouseout=function() {
this.className="submit"; } } }
var texts=document.getElementsByTagName("textarea");
for (var i=0; i<texts.length; i++) {
texts[i].onfocus=function() {
this.className="inpon"; }
texts[i].onblur=function() {
this.className="input"; }
texts[i].onkeypress=function(e) {
key = document.all ? event.keyCode : e.which;
if (key==13) {
alert('you cannot start a new line in this field'); return false; } } } }