<!--

function validateForm(){

  var theform = document.getElementById('theform')
	
	if(document.getElementById('FName').value.length==0 || document.getElementById('LName').value.length==0 || !validateEmail() || !validatePhone()){
		alert("First Name, Last Name, an Office Phone (formatted as shown), and a valid Email address are required."); 
		return false;
	}
	else {
		document.theform.submit();
	}
}
//function keeps radio sub-groups in synch with header groups
function jiveRads(which) {
	
	var theform= document.getElementById('theform');  
	
	switch(which)
        {
        case 0: for(var i = 0; i < theform["Standard Color"].length;i++)theform["Standard Color"][i].checked=false;
				if(theform["Stock"][1].checked=true)!theform["Stock"][1].checked;
				break;
		
        case 1: for(var i = 0; i < theform["Special Order Material"].length;i++) theform["Special Order Material"][i].checked=false;
				if(theform["Stock"][0].checked=true)!theform["Stock"][1].checked;
				break;
				
        case 2: for(var i = 0; i < theform["Special Order Material"].length;i++) theform["Special Order Material"][i].checked=false;
				break;  
				
        case 3: for(var i = 0; i < theform["Standard Color"].length;i++)theform["Standard Color"][i].checked=false;        
        }	
}

function validateEmail(){

	var str = document.getElementById('Email').value;
	
	return (str.indexOf(".") > 2)  && (str.lastIndexOf(".") > (str.indexOf("@") + 1) && str.indexOf("@") > 1);
}

function validatePhone(){
  var str = document.getElementById('OfficePhone').value;
	var goodChars = "0123456789- ";
	
	if(str.length < 12){
	  return false;
	}
	else {
		for(var i=0;i<str.length;i++) if(goodChars.indexOf(str.charAt(i)) < 0) return false;
	}
	return true;
}

function setSel(opt){

for(var i = 1;i<document.theform.elements("Product").length;i++){
  if(document.theform.elements("Product")(i).value==opt){
      document.theform.elements("Product")(i).selected=true;
  }
 }
}

//-->


