
<!-- hide from non-JavaScript Browsers
    // general purpose function to see if an input value has been
    // entered at all
    function isEmpty(inputStr) 
    {
	   if (inputStr == null || inputStr == "") 
	   {
		  return true;
	   }
	   return false;
    }     //end function isEmpty()
    
    // general purpose function to see if a suspected numeric input
    // is a positive integer
    
    function isPosInteger(inputVal) 
    {
	   inputStr = inputVal.toString()
	   for (var i = 0; i < inputStr.length; i++) 
	   {
		  var oneChar = inputStr.charAt(i);
		  if ((oneChar < "0" || oneChar > "9") && oneChar !=".") 
		  {
			 return false;
		  }
	   }
	   return true;
    }
    
    // general purpose function to see if a suspected numeric input
    // is a positive or negative number
    function isNumber(inputVal) 
    {
	   oneDecimal = false;
	   inputStr = inputVal.toString();
	   //alert("inside isN," + inputStr);
	   for (var i = 0; i < inputStr.length; i++) 
	   {
		  var oneChar = inputStr.charAt(i);
		  if (i == 0 && oneChar == "-") 
		  {
			 continue;
		  }
		  if (oneChar == "." && !oneDecimal) 
		  {
			 oneDecimal = true;
			 continue;
		  }
		  if (oneChar < "0" || oneChar > "9") 
		  {
			 return false;
		  }
	   }
	   return true;
    }
    
    // ensure that a text box number is in range 0-7
    function inRange(aControl,e) 
    {
		var i,ndx,icount
		icount=1
		var aVal = aControl.value
		if (aVal < 0 || aVal > 7) 
		{
			alert("Number of days should not exceed 7.")
			
			for (i = 0; i < document.form1.elements.length; ++i)
			{
				if (aControl.name == document.form1.elements[i].name) {
				ndx=i;
				break;
				} 
			}
			document.form1.elements[ndx].focus()
			document.form1.elements[ndx].select()
			return false
		}
		//else return true;
    }
   
    function validnumberkey(box,e){
	   var charCode = (navigator.appName == "Netscape") ? e.which + e.keyCode : e.keyCode
	   var i
	   var focus_int
	   //alert ("which was " + e.which)
	   //alert("keycode was " + e.keyCode)
	   //alert("charCode is " + charCode)
	   //status = charCode
	   if (charCode > 31 && (charCode < 48 || charCode > 57)) {
	   //alert("non-number charCode is " + charCode)
		e.returnValue = false
		return false
	    }
	   if (charCode == 13) {
				//alert("13 charCode was " + charCode)
				e.returnValue = false
				//iterate through the form controls until we find the current control
				for (i = 0; i < document.form1.elements.length; ++i)
				{
					if (box.name == document.form1.elements[i].name) {
						//set the focus to the next control (but stay on current control if this is the last one)
						focus_int =i+1
						if (focus_int >= document.form1.elements.length) {
							focus_int = i
							break
						}
					}
				}
				document.form1.elements[focus_int].focus() 
				return false
	   }
	    
	    return true
	    
   }
   
    //intercept the keypress event and moves focus forward one control if 
    //keystroke was an enter(13), simulating a tab.
    //this is used to prevent cr being interpreted as submit
    //originally coded for pir by tbeckhelm
    //revised for survey by mwoodall 10/01 
    
    function SubTabForEnter(e,box) 
    {
	   var charCode = (navigator.appName == "Netscape") ? e.which + e.keyCode : e.keyCode
	   var i
	   var focus_int
	   //alert("charCode was " + charCode)
	        if (charCode == 13) {
				e.returnValue = false;
				//iterate through the form controls until we find the current control
				for (i = 0; i < document.form1.elements.length; ++i)
				{
					if (box.name == document.form1.elements[i].name)
					{
						//set the focus to the next control (but stay on current control if this is the last one)
						focus_int = i+1
						if (focus_int >= document.form1.elements.length)
						focus_int = i
						break
					}
				}
				document.form1.elements[focus_int].focus() 
				return false
			}
	    return true
	    
   }   //end function SubTabForEnter()
   
   
   function do_daysum() {
	  var n1,n2,n3,n4,n5,sum
	  n1=parseInt(nulltozero(document.form1.da.value))+parseInt(nulltozero(document.form1.coa.value))
	  n2=parseInt(nulltozero(document.form1.cp.value))+parseInt(nulltozero(document.form1.bi.value))
	  n3=parseInt(nulltozero(document.form1.vp.value))+parseInt(nulltozero(document.form1.wa.value))
	  n4=parseInt(nulltozero(document.form1.pb.value))
	  sum=parseInt(n1)+parseInt(n2)+parseInt(n3)+parseInt(n4)  
	  return sum
   }     //end function do_daysum
   
   function nulltozero(val) {
   if (isEmpty(val)) {
		return 0
		}
	else {
		return val
		}
   }
//end function nulltozero


	function hasNoSelection(buttonGroup){
		for (var i = 0; i < buttonGroup.length; i++) {
			if (buttonGroup[i].checked) {
				return false;
			}
		}
		return true;
	}
//end function hasNoSelection


   function validate_form(e) {
	var charCode = (navigator.appName == "Netscape") ? e.which : e.keyCode;
	var zbox=document.form1.ln.value
	if (isEmpty(document.form1.ln.value)) {
		e.returnValue=false;
		alert ("Please enter your last name.")
		document.form1.ln.focus()
		return false;	
	}
	if (isEmpty(document.form1.fn.value)) {
		e.returnValue=false;
		alert ("Please enter your first name.")
		document.form1.fn.focus()
		return false;	
	}
	if (isEmpty(document.form1.jt.value)) {
		e.returnValue=false;
		alert ("Please enter your job title.")
		document.form1.jt.focus()
		return false;	
	}
	if (isEmpty(document.form1.hph.value)) {
		e.returnValue=false;
		alert ("Please enter your phone number.")
		document.form1.hph.focus()
		return false;	
	}
	if (isEmpty(document.form1.eml.value)) {
		e.returnValue=false;
		alert ("Please enter email address.")
		document.form1.eml.focus()
		return false;	
	}
	if (isEmpty(document.form1.en.value)) {
		e.returnValue=false;
		alert ("Please enter a name of agency.")
		document.form1.en.focus()
		return false;	
	}
	if (isEmpty(document.form1.ean.value)) {
		e.returnValue=false;
		alert ("Please enter a street number.")
		document.form1.ean.focus()
		return false;	
	}
	if (isEmpty(document.form1.ea.value)) {
		e.returnValue=false;
		alert ("Please enter a street.")
		document.form1.ea.focus()
		return false;	
	}
	if (isEmpty(document.form1.ec.value)) {
		e.returnValue=false;
		alert ("Please enter a city.")
		document.form1.ec.focus()
		return false;	
	}
	if (isEmpty(document.form1.ez.value)) {
		e.returnValue=false;
		alert ("Please enter a zip code.")
		document.form1.ez.focus()
		return false;	
	}
	
	return true;      
	
	}		//end function validate_form
   
// - stop hiding -->