var arrInput = new Array(0);
  var arrInputValue = new Array(0);

function addInput() {
  arrInput.push(arrInput.length);
  arrInputValue.push("");
  display();
}

function display() {
  document.getElementById('parah').innerHTML="";
  for (intI=0;intI<arrInput.length;intI++) {
    document.getElementById('parah').innerHTML+=createInput(arrInput[intI], arrInputValue[intI]);
  }
}

function saveValue(intId,strValue) {
  arrInputValue[intId]=strValue;
}  

function createInput(id,value) {
  return "<div style='border:1px solid #cccccc;'><table><tr><td>Name</td><td colspan='3'><input type='text' name='name"+ id +"' size='60' onChange='javascript:saveValue("+ id +",this.value)' value='"+ value +"'/></td></tr><tr><td colspan='4'>Relationship to elder (i.e., daughter, son, neighbor, niece, guardian, facility administrator) &nbsp; <input type='text' name='reltoelder"+ id +"' onChange='javascript:saveValue("+ id +",this.value)' value='"+ value +"'/></td></tr><tr><td>Location (City/State or Country)</td><td colspan='3'><input type='text' name='location"+ id +"' size='60' onChange='javascript:saveValue("+ id +",this.value)' value='"+ value +"'/></td></tr><tr><td colspan='4'>Do you believe this person would be willing to be involved?  YES/NO/Don't Know &nbsp; <select name='QuestionA"+ id +"' onChange='javascript:saveValue("+ id +",this.value)' value='"+ value +"'><option value='' selected='selected'>Please Select</option><option value='Yes'>Yes</option><option value='No'>No</option><option value='Don&rsquo;t Know'>Don\'t Know</option></select></td></tr><tr><td colspan='4'>Do you believe that this person would be willing/able to pay their share of the cost? YES/NO/Don't Know &nbsp; <select name='QuestionB"+ id +"' onChange='javascript:saveValue("+ id +",this.value)' value='"+ value +"'><option value='' selected='selected'>Please Select</option><option value='Yes'>Yes</option><option value='No'>No</option><option value='Don&rsquo;t Know'>Don\'t Know</option></select></td></tr><tr><td colspan='4'>Do you believe this person is essential to the process? YES/NO/Don't Know &nbsp; <select name='QuestionC"+ id +"' onChange='javascript:saveValue("+ id +",this.value)' value='"+ value +"'><option value='' selected='selected'>Please Select</option><option value='Yes'>Yes</option><option value='No'>No</option><option value='Don&rsquo;t Know'>Don\'t Know</option></select></td></tr><tr><td valign='top'>Comments</td><td colspan='3'><textarea name='comment"+ id +"' cols='45' rows='4' onChange='javascript:saveValue("+ id +",this.value)' value='"+ value +"'></textarea></td></tr></table></div><br />";
  
}

function deleteInput() {
  if (arrInput.length > 0) { 
     arrInput.pop(); 
     arrInputValue.pop();
  }
  display(); 
}

