// specify the name of your form
var thisForm = "form";

// load field names and default values into list
var defaultVals = new Array();
defaultVals[0] = new Array("name", "*Your name");
defaultVals[1] = new Array("email", "*Your email");
defaultVals[2] = new Array("phone", "*Your phone");
defaultVals[3] = new Array("websites", "Please include related websites to your business so that we can research what they are doing well, and then make suggestions to take your brand to the next level.");
defaultVals[4] = new Array("companyinfo", "Please type your answers in these boxes. The more project details that you can provide will help us to give you an estimate on an available start date, and cost.");
defaultVals[5] = new Array("code", "Coupon code");

// populate fields with default values on page load
function MPLoadDefaults() {
with (document.forms[thisForm]) {
for (var n=0; n<defaultVals.length; n++) {
var thisField = defaultVals[n][0];
var thisDefault = defaultVals[n][1];
if (elements[thisField].value == '')
elements[thisField].value = thisDefault;
}}}

// clear default value from field when selected
function MPClearField(field) {
var fieldName = field.name;
for (var n=0; n<defaultVals.length; n++) {
var thisField = defaultVals[n][0];
var thisDefault = defaultVals[n][1];
if (thisField == fieldName) {
if (field.value == thisDefault) field.value = '';
break;
}}}

// clear all defaults when form is submitted
function MPClearAll() {
with (document.forms[thisForm]) {
for (var n=0; n<defaultVals.length; n++) {
var thisField = defaultVals[n][0];
var thisDefault = defaultVals[n][1];
if (elements[thisField].value == thisDefault)
elements[thisField].value = '';
}}}