<!--
function randomimg() {
  document.getElementById("rand").src = "/img/rand" + Math.floor(Math.random() * 20) + ".jpg";
}

function locator() {
  var dest = "112104112046116099097116110111099047";
  var result = "";
  var i;
  
  for (i = (dest.length / 3) - 1; i >= 0; i--) {
    result += String.fromCharCode(dest.substr((i * 3), 3));
  }
  return result;
}

// checks data for validity and returns the outcome
function checker() {
    var fields = new Array("sender", "email", "subject", "message");
    var i;
    var test;
    var tmpobj;

  for (i = 0; i < 4; i++) {
    tmpobj = document["forms"][0][fields[i]];

    // prevent empty fields
    if (tmpobj["value"].match(/^\s*$/)) {
      alert("I am sorry, but the " + fields[i] + " field cannot be left empty.");
      tmpobj.focus();
      return false;
    }
    // restrict the length of the submission
    if (tmpobj["value"].length > ((i < 3) ? 60 : 1536)) {
      alert("I am sorry, but the " + fields[i] + " field exceeds the maximum allowed length of "
          + ((i < 3) ? "60" : "1536") + " characters.");
      tmpobj.focus();
      return false;
    }
    // no kinky whitespace characters allowed in the sender or email field
    if ((i < 3) && (tmpobj["value"].match(/[^ \S]/))) {
      alert("I am sorry, but the " + fields[i] + " field contains unexpected white space "
          + "characters like tabs or line breaks.");
      tmpobj.focus();
      return false;
    } 
    // validate email format
    if (i == 1) {
      if (!tmpobj["value"].match(/^[\w.+\-]{1,53}@[\w.\-]{1,53}\.[a-z]{2,4}$/i)) {
        alert("I am sorry, but \"" + tmpobj["value"] + "\" does not really look like a valid email "
            + "address.");
        tmpobj.focus();
        return false;
      }      
    }
    // check for typical spam signatures in the message body
    if (i == 3) {
      if (tmpobj["value"].match(/\<(a href|img|script)|\[(url|img)/i) ||
         ((test = tmpobj["value"].match(/\bhttp:/gi)) && (test.length > 3))) {
        alert("I am sorry, but your message fails the spam check. Please use plain text and do not "
            + "insert more than 3 links into your message.");
        tmpobj.focus();
        return false;
      }
    }
  }
  return true;
}

function process_data() {
  document["forms"][0]["action"] = "http://localhost/";

  if (!checker()) return false;

  document["forms"][0]["action"] = locator();
  return true;
}
//-->