/***********************************************
* 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
}

<!--
/***********************************************
* 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", "Name", "Phone", "Email", "Date", "Time");
	// Enter field description to appear in the dialog box
	var fieldDescription = Array("First Name", "Last Name", "Your Name", "Your Phone", "Your E-mail", "Date", "Time");
	// 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 == "Please Select"){
					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 == "Your Name" || obj.value == "Your Phone" || obj.value == "Date" || obj.value == "Time") { 
				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; 
   }
}

// -->


