<script type="text/javascript">
  function member(fid) 
  {
   var m_first_name = document.getElementById("m_first_name"+fid).value;          
   var m_last_name = document.getElementById("m_last_name"+fid).value;
   var m_email_id = document.getElementById("m_email_id"+fid).value;
   var m_phone_no = document.getElementById("m_phone_no"+fid).value;
   var m_ssn = document.getElementById("m_ssn"+fid).value;
   var result = m_first_name + '  ' + m_last_name + '  ' + m_email_id + '  ' + m_phone_no + '  ' + m_ssn;
   document.getElementById('member'+fid).textContent = result;
 }
 function membersum(fid,cid,mprice)
 {
  var cursum = document.getElementById('total1'+fid).innerHTML;
  if(cid) { var value = document.getElementById('mprice'+cid).innerHTML;
  document.getElementById('mprice'+cid).textContent = mprice;} 
  else { var value = document.getElementById('mprice'+fid).innerHTML;
  document.getElementById('mprice'+fid).textContent = mprice;}
  var val = parseInt(value);
  var totalsum = parseInt(cursum);
  var mmprice = parseInt(mprice);
  if(val===0){
   if(!cursum) { document.getElementById('total1'+fid).textContent = mprice;
 } else { var tot =totalsum+mmprice;
  document.getElementById('total1'+fid).textContent = tot;
}
}
}

function memplus(fid) 
{
  var m2_first_name = document.getElementById("m2_first_name"+fid).value;  
  var m2_last_name = document.getElementById("m2_last_name"+fid).value;
  var m2_email_id = document.getElementById("m2_email_id"+fid).value;
  var m2_phone_no = document.getElementById("m2_phone_no"+fid).value;
  var m2_ssn = document.getElementById("m2_ssn"+fid).value;
  var result = m2_first_name + '  ' + m2_last_name + '  ' + m2_email_id + '  ' + m2_phone_no + '  ' + m2_ssn;
  document.getElementById('memplus'+fid).textContent = result;
}
function memplussum(fid,cid,m2price)
{
 var cursum = document.getElementById('total1'+fid).innerHTML;
 if(cid) { var value = document.getElementById('mplusprice'+cid).innerHTML;
 document.getElementById('mplusprice'+cid).textContent = m2price;} 
 else { var value = document.getElementById('mplusprice'+fid).innerHTML;
 document.getElementById('mplusprice'+fid).textContent = m2price;}
 var totalsum = parseInt(cursum);
 var mm2price = parseInt(m2price);
 var val = parseInt(value);
 if(val===0){
  if(!cursum) { document.getElementById('total1'+fid).textContent = m2price;
} else { var tot =totalsum+mm2price;
  document.getElementById('total1'+fid).textContent = tot;
}
}
}

function nonmember(fid) 
{
  var n_first_name = document.getElementById("n_first_name"+fid).value;  
  var n_last_name = document.getElementById("n_last_name"+fid).value;
  var n_email_id = document.getElementById("n_email_id"+fid).value;
  var n_phone_no = document.getElementById("n_phone_no"+fid).value;
  var n_ssn = document.getElementById("n_ssn"+fid).value;
  var result = n_first_name + '  ' + n_last_name + '  ' + n_email_id + '  ' + n_phone_no + '  ' + n_ssn;
  document.getElementById('nonmember'+fid).textContent = result;
}
function nmembersum(fid,cid,nprice)
{
  var cursum = document.getElementById('total1'+fid).innerHTML;
  if(cid) {var value = document.getElementById('nprice'+cid).innerHTML;
  document.getElementById('nprice'+cid).textContent = nprice;} 
  else { var value = document.getElementById('nprice'+fid).innerHTML;
  document.getElementById('nprice'+fid).textContent = nprice; }
  var totalsum = parseInt(cursum);
  var nmprice = parseInt(nprice);
  var val = parseInt(value);
  if(val===0){
    if(!cursum) { document.getElementById('total1'+fid).textContent = nprice;
  } else { var tot =totalsum+nmprice;
    document.getElementById('total1'+fid).textContent = tot;
  }
}
}

function nonmemplus(fid) 
{
  var n2_first_name = document.getElementById("n2_first_name"+fid).value;  
  var n2_last_name = document.getElementById("n2_last_name"+fid).value;
  var n2_email_id = document.getElementById("n2_email_id"+fid).value;
  var n2_phone_no = document.getElementById("n2_phone_no"+fid).value;
  var n2_ssn = document.getElementById("n2_ssn"+fid).value;
  var result = n2_first_name + '  ' + n2_last_name + '  ' + n2_email_id + '  ' + n2_phone_no + '  ' + n2_ssn;
  document.getElementById('nmemplus'+fid).textContent = result;
}
function nmemplussum(fid,cid,n2price)
{
 var cursum = document.getElementById('total1'+fid).innerHTML;
 if(cid) { var value = document.getElementById('nplusprice'+cid).innerHTML;
 document.getElementById('nplusprice'+cid).textContent = n2price;} 
 else { var value = document.getElementById('nplusprice'+fid).innerHTML;
 document.getElementById('nplusprice'+fid).textContent = n2price;}
 var totalsum = parseInt(cursum);
 var nm2price = parseInt(n2price);
 var val = parseInt(value);
 if(val===0){
  if(!cursum) { document.getElementById('total1'+fid).textContent = n2price;
} else { var tot =totalsum+nm2price;
  document.getElementById('total1'+fid).textContent = tot;
}
}
}

function employer(fid) 
{
  var s_first_name = document.getElementById("s_first_name"+fid).value;          
  var s_last_name = document.getElementById("s_last_name"+fid).value;
  var s_email_id = document.getElementById("s_email_id"+fid).value;
  var s_phone_no = document.getElementById("s_phone_no"+fid).value;
  var s_ssn = document.getElementById("s_ssn"+fid).value;
  var result = s_first_name + '  ' + s_last_name + '  ' + s_email_id + '  ' + s_phone_no + '  ' + s_ssn;
  document.getElementById('employer'+fid).textContent = result;
}
function smembersum(fid,cid,sprice)
{
  var cursum = document.getElementById('total1'+fid).innerHTML;
  if(cid) { var value = document.getElementById('sprice'+cid).innerHTML;
  document.getElementById('sprice'+cid).textContent = sprice;}
  else{ var value = document.getElementById('sprice'+fid).innerHTML;
  document.getElementById('sprice'+fid).textContent = sprice;}
  var totalsum = parseInt(cursum);
  var smprice = parseInt(sprice);
  var val = parseInt(value);
  if(val===0){
    if(!cursum) { document.getElementById('total1'+fid).textContent = sprice;
  } else { var tot =totalsum+smprice;
    document.getElementById('total1'+fid).textContent = tot;
  }
}
}
</script>