<!--

function resetOnlyContact(){ 
document.getElementById('FirstName').value = ""; 
document.getElementById('LastName').value = ""; 
document.getElementById('PhoneNumber').value = ""; 
document.getElementById('POnumber').value = ""; 
document.getElementById('Dep').value = ""; 
document.getElementById('Institution').value = ""; 
document.getElementById('FaxNumber').value = ""; 
document.getElementById('MyEmail').value = "";
document.getElementById('ContactAddress').value = ""; 
document.getElementById('ContactCity').value = ""; 
document.getElementById('ContactState').value = ""; 
document.getElementById('ContactZipCode').value = "";  
}

function resetOnlyCollection(){  
document.getElementById('amino1').selectedIndex = 0;
document.getElementById('amino2').selectedIndex = 0;
document.getElementById('amino3').selectedIndex = 0;
document.getElementById('amino4').selectedIndex = 0;
document.getElementById('amino5').selectedIndex = 0;
document.getElementById('amino6').selectedIndex = 0;
document.getElementById('amino7').selectedIndex = 0;
document.getElementById('amino8').selectedIndex = 0;
document.getElementById('amino9').selectedIndex = 0;
document.getElementById('amino10').selectedIndex = 0;
document.getElementById('amino11').selectedIndex = 0;
document.getElementById('amino12').selectedIndex = 0;
document.getElementById('amino13').selectedIndex = 0;
document.getElementById('amino14').selectedIndex = 0;
document.getElementById('amino15').selectedIndex = 0;
document.getElementById('amino16').selectedIndex = 0;
document.getElementById('amino17').selectedIndex = 0;
document.getElementById('amino18').selectedIndex = 0; 
document.getElementById('amino19').selectedIndex = 0; 
document.getElementById('amino20').selectedIndex = 0; 
document.getElementById('amino21').selectedIndex = 0; 
document.getElementById('amino22').selectedIndex = 0;
document.getElementById('amino23').selectedIndex = 0;
document.getElementById('buyer_description').value = "";
document.getElementById('n_term').checked=true;
document.getElementById('c_term').checked=true;
var quotes = document.getElementsByName("quotes");
for (i = 0; i < quotes.length; i++){	
	quotes[i].checked=false;
}
document.getElementById('SpecialInstructions').value = "";
}

function resetOnlyOrder2(){  
document.getElementById('Protocol').selectedIndex = 0;
document.getElementById('HostSpecies').selectedIndex = 0;
document.getElementById('AccessionNumber').value = "";
document.getElementById('Information').value = "";
document.getElementById('Comments').value = "";

}
function resetOnlyOrder3(){  
document.getElementById('Protocol').selectedIndex = 0;
document.getElementById('HostSpecies').selectedIndex = 0;
document.getElementById('AccessionNumber').value = "";
document.getElementById('Information').value = "";
document.getElementById('Comments').value = "";
}
function resetOnlyAntiOrder1(){  
document.getElementById('Protocol').selectedIndex = 0;
document.getElementById('HostSpecies').selectedIndex = 0;
document.getElementById('AccessionNumber').value = "";
document.getElementById('Information').value = "";
document.getElementById('Comments').value = "";
}

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;
}

function MM_validateForm() { //v4.0
  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=MM_findObj(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 required field(s) were not filled in:\n'+errors);
  document.MM_returnValue = (errors == '');
}

function MM_setTextOfTextfield(objName,x,newText) { //v3.0
  var obj = MM_findObj(objName); if (obj) obj.value = newText;
}
