// Process Marketing Acumen Project Briefings Form
//
// Load as MA_BriefingForm.js
// written by Steve Knowles
// Modification History:
//   2003/4/12 - initial installation
//
/* Builds ARP3 autoresponder lists for subscribe/unsubscribe  */

var arp3_extra_ar = '';
var arp3_id = 0;
var first_name_entry = 0;

var numBriefings = 18
Briefings = new Array()
    Briefings[0] = 3   /* Analyst Presentation  */
    Briefings[1] = 5   /* Brand */
    Briefings[2] = 6   /* Corporate Brochure */
    Briefings[3] = 7   /* Executive Bios */
    Briefings[4] = 8   /* Logo */
    Briefings[5] = 12  /* Executive Seminar Series */
    Briefings[6] = 9   /* Press Release */
    Briefings[7] = 10  /* Product Press Release */
    Briefings[8] = 21  /* 3rd Party Press Release */
    Briefings[9] = 11  /* Print Ad */
    Briefings[10] = 14 /* Presentation Folder */
    Briefings[11] = 13 /* 3rd Party White Paper */
    Briefings[12] = 15 /* Product Demo */
    Briefings[13] = 16 /* Website */
    Briefings[14] = 18 /* Tradeshow */
    Briefings[15] = 20 /* Reviewer's Guide */
    Briefings[16] = 22 /* Press & Analyst Kit */
    Briefings[17] = 24 /* 3-Tiered Direct Mail Campaign */
    
function build_list(this_form, this_array)
/* build AR list to pass to ARP3  */
{

/* initialize form fields */
/* set id, extra_ar based on checked boxes */
  for (i=0; i < numBriefings; i++)
  {

  if (this_array[i].checked)
    {
      if (arp3_id==0)
         arp3_id = Briefings[i] ;
      else
         arp3_extra_ar = arp3_extra_ar + '|' + Briefings[i] ;

    }
  }
document.choose_briefings.id.value = '' + arp3_id;
document.choose_briefings.extra_ar.value = '' + arp3_extra_ar;	


}

 function build_full_name(this_form)
/* build ARP3 Full Name from 1st, middle, & last names  */
{

/* construct full_name */
hold_first_name = '' + document.choose_briefings.first_name.value;
hold_middle_name = '' + document.choose_briefings.middle_name.value;
hold_last_name = '' + document.choose_briefings.last_name.value;

hold_full_name = '' + hold_first_name;

if (hold_middle_name.length != 0)
   hold_full_name = hold_full_name + " " + hold_middle_name;

hold_full_name = hold_full_name + " " + hold_last_name

document.choose_briefings.full_name.value = '' + hold_full_name;

}

function process_form(this_form, this_array)
/* process data from form before passing to ARP3  */
{
  build_list(this_form, this_array);
  build_full_name(this_form);
}