function allPurposeMailer(domainName, emailSubject, emailName, displayName) {
    var uno = "to:";
    var dos = "mail";
    var tres = emailName;
    var cuatro = "@";
    var cinco = domainName;
    var seis = emailSubject;
    var siete = displayName;
    document.write("<a href=\"" + dos+uno+tres+cuatro+cinco + "?subject=" + seis + "\">" + siete + "</a>");
}

//javascript validation for the contact us 
function validateContactForm() {
		var strMsgIntro = "The following fields are required:\n\n";
		var strMsg = "";
		with (document.ContactForm) {
			if (name.value == "") {
				strMsg = strMsg + "- Name\n";
			}
			if (document.getElementById("comments").value == "") {
				strMsg = strMsg + "- Message\n";
			}
			strMsg += checkEmail(email.value);
		}
		if (strMsg != "") {
			alert(strMsgIntro + strMsg);
			return false;
		}
		else {
			return true;
		}
	}
//end contact us validation
	
	
// ////////////////////////////////////////////////////////////////////	
// non-empty textbox
// ////////////////////////////////////////////////////////////////////
function isEmpty(strng,fieldname) {
var error = "";
  if (strng.length == 0) {
     error = fieldname + " has not been filled in.\n"
  }
return error;
}
// ////////////////////////////////////////////////////////////////////
// end non-empty text box
// ////////////////////////////////////////////////////////////////////


// ////////////////////////////////////////////////////////////////////
// validate selector from dropdown list
// ////////////////////////////////////////////////////////////////////
function checkDropdown(choice,fieldname) {
var error = "";
    if (choice == 0) {
    error = "- " + fieldname + "\n";
    }
return error;
}
// ////////////////////////////////////////////////////////////////////
// end dropdown selector
// ////////////////////////////////////////////////////////////////////



// ////////////////////////////////////////////////////////////////////
// email validation functions
// ////////////////////////////////////////////////////////////////////
function checkEmail (strng) {
var error="";
if (strng == "") {
   error = "You didn't enter an email address.\n";
}

    var emailFilter=/^.+@.+\..{2,3}$/;
    if (!(emailFilter.test(strng))) {
       error = "Please enter a valid email address.\n";
    }
    else {
//test email for illegal characters
       var illegalChars= /[\(\)\<\>\,\;\:\\\"\[\]]/
         if (strng.match(illegalChars)) {
          error = "The email address contains illegal characters.\n";
       }
    }
return error;
}
// ////////////////////////////////////////////////////////////////////
// end check email functions
// ////////////////////////////////////////////////////////////////////



