function load_current_year() {
   currentYear = new Date().getFullYear();
	 document.getElementById('designer_copyright').innerHTML = currentYear;
   }
	 
function load_webdesigner_email() {
	 document.getElementById('webdesigner').innerHTML = '<a href=\mailto:rhys@datasphere-systems.com>DsS:VisionTECH</a>';
   }

// initiates all of the standard functions when a page is loaded in the user's browser
function pageLoad() {
   load_current_year();
	 load_webdesigner_email();
   }
	 

// ==============================================================	 
// These functions validate the submissions for the Postcard form
// Functions: isFilled, isEmail, and validateForm
// ==============================================================

//check that there's at least one character in the
//field and that the default value is not still in the field
function isFilled(field) {
   if (field.value.length < 1 || field.value == field.defaultValue) {
      return false;
      } else {
         return true;
         }
   }// check for presence of a "@" and a "." - if they're present it's good enough

function isEmail(field){
   if (field.value.indexOf("@") == -1 || field.value.indexOf(".") == -1){
      return false;
      } else {
         return true;
         }
   }// check that required fields are filled and that email is valid

function validateForm(whichform){
   for (var i=0; i<whichform.elements.length; i++) {
      var element = whichform.elements[i];
      if (element.className.indexOf("required") != -1) {//is required, so validate
         if (!isFilled(element)){
            alert("Please fill in the "+element.name+" field.");
            return false;
            }
         }//end class required
      if (element.className.indexOf("email") != -1){// email is required, so validate
         if (!isEmail(element)){
            alert ("The " + element.name + " field must be a valid email address.");
            return false;
            }
         }//end email
      }//end for
   return true;
   }//end function
