/***********************************************
* Email Validation script- &copy; Dynamic Drive (www.dynamicdrive.com)
* This notice must stay intact for legal use.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var emailfilter=/^\w+[\+\.\w-]*@([\w-]+\.)*\w+[\w-]*\.([a-z]{2,4}|\d+)$/i

function checkmail(e){
var returnval=emailfilter.test(e.value)
if (returnval==false){
alert("Please enter a valid email address.")
e.select()
}
return returnval
}






<!--
function MM_validateForm() { //v4.0
  if (document.getElementById){
    var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
    for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);
      if (val) { nm=val.name; 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+' is required.\n'; }
    } if (errors) alert('The following error(s) occurred:\n'+errors);
    document.MM_returnValue = (errors == '');
} }
// -->

 <!--

/***********************************************
* Required field(s) validation v1.10- By NavSurf
* Visit Nav Surf at http://navsurf.com
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

function formCheck(formobj){
	// Enter name of mandatory fields
	var fieldRequired = Array("First Name", "Last Name", "Email", "Phone", "Moving From Address", "Moving From City", "Moving From State", "Moving To Address", "Moving To City", "Moving To State", "Month", "Day", "Year", "Ship To", "Moving to Type", "Moving from type", "Moving to footage", "Moving from footage");
	// Enter field description to appear in the dialog box
	var fieldDescription = Array("First Name", "Last name", "Email", "Phone", "Moving From Address", "Moving From City", "Moving From State", "Moving To Address", "Moving To City", "Moving To State", "Moving Month", "Moving Day", "Moving Year", "Shipping To", "Moving to Building Type", "Moving from Building Type", "Moving to Approximate footage", "Moving from Approximate footage");
	// dialog message
	var alertMsg = "Please complete the following fields:\n";
	
	var l_Msg = alertMsg.length;
	
	for (var i = 0; i < fieldRequired.length; i++){
		var obj = formobj.elements[fieldRequired[i]];
		if (obj){
			switch(obj.type){
			case "select-one":
				if (obj.selectedIndex == -1 || obj.options[obj.selectedIndex].text == "Month:" || obj.options[obj.selectedIndex].text == "Day:" || obj.options[obj.selectedIndex].text == "Year:"  || obj.options[obj.selectedIndex].text == "Please Select..."  || obj.options[obj.selectedIndex].text == "- State -"){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "select-multiple":
				if (obj.selectedIndex == -1){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			case "text":
			case "textarea":
				if (obj.value == "" || obj.value == null){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
				break;
			default:
			}
			if (obj.type == undefined || obj.value == "Full Name" || obj.value == "Phone Number" || obj.value == "Move Date") { 
				var blnchecked = false;

				for (var j = 0; j < obj.length; j++){
					if (obj[j].checked){
						blnchecked = true;
					}
				}
				if (!blnchecked){
					alertMsg += " - " + fieldDescription[i] + "\n";
				}
			}
		}
	}

	if (alertMsg.length == l_Msg){
		return true;
	}else{
		alert(alertMsg);
		return false;
	}
}


function dropdown1(sel){
   if(sel.options.selectedIndex == 0 || sel.options.selectedIndex == 1){
      alert('Please choose an option');
      return false;
   }	   
   else{
      document.contact.mto.options.selectedIndex = 1; 
   }
}

function dropdown2(sel){
   if(sel.options.selectedIndex == 0){
      alert('Please choose an option');
      return false;
   }    
   else{
      document.contact.mfrom.options.selectedIndex = 13; 
   }
}

// -->

