// JavaScript Document
// In the function title brackets, in the syntax by which the field and the alert text is defined
function validate_required(field,alerttxt)
{
with (field)
{
if (value==null||value=="")
  {alert(alerttxt);return false}
<!-- else {return ValidateForm()} -->
}
}

// This function runs through the form, applying the validate_required function to all listed fields
function validate_form ( )
{
	valid = true;
		
		if ( document.contactform.name.value == "" )
        {alert ( "Name must be filled out" );document.contactform.name.focus();valid = false;}
		
		else if ( document.contactform.email.value == "" )
        {alert ( "Email must be filled out" );document.contactform.email.focus();valid = false;}
		
		else if ( document.contactform.typeofquery.selectedIndex == 0 )
        {alert ( "Type of Query must be selected" );document.contactform.typeofquery.focus();valid = false;}
		
		else if ( document.contactform.query.value == "" )
        {alert ( "Query must be filled out" );document.contactform.query.focus();valid = false;}
		
		return valid;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}