function MM_validateForm() { //v4.0
  if (document.getElementById){
    var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
    
		if(document.form1.name.value == "") {
			errors+='- Your Name\n';
		}

		if(document.form1.contactMethod.value == "None") {
			errors+='- Preferred contact method\n';
		}
		
		if(document.form1.contactMethod.value == "Email" & document.form1.Email.value == "") {
			errors+='- Email\n';
		}
		
		if(document.form1.contactMethod.value == "Telephone - home" & document.form1.Phone.value == "") {
			errors+='- Phone\n';
		}
		
		if(document.form1.contactMethod.value == "Telephone - mobile" & document.form1.Phone.value == "") {
			errors+='- Phone\n';
		}
		
		if(document.form1.contactMethod.value == "Telephone - business" & document.form1.Phone.value == "") {
			errors+='- Phone\n';
		}

		for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);
      if (val) { nm=val.alt; if ((val=val.value)!="") {
        if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
          if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\n';
        } else if (test!='R') { num = parseFloat(val);
          if (isNaN(val)) errors+='- '+nm+' must contain a number.\n';
          if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
            min=test.substring(8,p); max=test.substring(p+1);
            if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\n';
      } } } else if (test.charAt(0) == 'R') errors += '- '+nm+'\n'; }
    } if (errors) alert('Please fill out the following fields:\n'+errors);
    document.MM_returnValue = (errors == '');
} }

function lightMethod() {
	if (document.form1.contactMethod.value == "Email") {
		document.getElementById('Email').style.background = "#f4f3e6";
		document.getElementById('Phone').style.background = "#FFFFFF";
		document.getElementById('required1').style.color = "#2d7290";
		document.getElementById('required2').style.color = "#FFFFFF";
	}
	if (document.form1.contactMethod.value == "Telephone - home" || document.form1.contactMethod.value == "Telephone - mobile" || document.form1.contactMethod.value == "Telephone - business") {
		document.getElementById('Phone').style.background = "#f4f3e6";
		document.getElementById('Email').style.background = "#FFFFFF";
		document.getElementById('required1').style.color = "#FFFFFF";
		document.getElementById('required2').style.color = "#2d7290";
	}
	if (document.form1.contactMethod.value == "None") {
		document.getElementById('Phone').style.background = "#FFFFFF";
		document.getElementById('Email').style.background = "#FFFFFF";
		document.getElementById('required1').style.color = "#FFFFFF";
		document.getElementById('required2').style.color = "#FFFFFF";
	}
}