   var ops = new Array(10)
   ops[0] = "have_you_attend";
   ops[1] = "if_yes_how_long";
   ops[2] = "was_the_program";
   ops[3] = "eng_res";
   ops[4] = "general_res";
   ops[5] = "eng_licensing_info";
   ops[6] = "networking_and_cold";
   ops[7] = "co_op_program";
   ops[8] = "mentoring_program";
   ops[9] = "find_job";
   
   function setAmount (form) {

    var item=form.item_name.options[form.item_name.options.selectedIndex].value;

    if (item == "Conference Registration Fee - Standard Delegate")
      form.amount.value = "75.00";
    if (item == "Conference Registration Fee - Employer (Networking Event)")
      form.amount.value = "200.00";
    if (item == "Conference Registration Fee - Employer (Networking Event) with Advertisement")
      form.amount.value = "250.00";
   }

   function toggle(showMe)
   {
	   for (var i = 0; i < ops.length; i++)
	   {
	      target = document.getElementById(ops[i]);
		   target.style.display = "none";
      }
      document.getElementById(showMe).style.display = '';
   }
   
   function toggle2(element_id)
   {
      target = document.getElementById(element_id);
      if(target.style.display == "none")
      {
         target.style.display = "";
      } 
      else 
      {
         target.style.display = "none";
      }
   }

   function validateForm()
   {
      with (document.survey)
      {
         var alertMsg = "The following REQUIRED fields\nhave been left empty:\n";
         if (have_you_attend.value == "")alertMsg+="\nHave you attended any Employment Preparation program";
         if (have_you_attend.value == "Yes"[if_yes_how_long].value == "")alertMsg+="\nHow long was the program?";
         if (have_you_attend.value == "Yes"[was_the_program].value == "")alertMsg+="\nHow long was the program?";
         if (have_you_attend.value == "Yes"[eng_res].value == "")alertMsg+="\nHow long was the program?";
         if (have_you_attend.value == "Yes"[general_res].value == "")alertMsg+="\nHow long was the program?";
         if (have_you_attend.value == "Yes"[eng_licensing_inf].value == "")alertMsg+="\nHow long was the program?";
         if (have_you_attend.value == "Yes"[networking_and_cold].value == "")alertMsg+="\nHow long was the program?";
         if (have_you_attend.value == "Yes"[co_op_program].value == "")alertMsg+="\nHow long was the program?";
         if (have_you_attend.value == "Yes"[mentoring_program].value == "")alertMsg+="\nHow long was the program?";
         if (have_you_attend.value == "Yes"[find_job].value == "")alertMsg+="\nHow long was the program?";
         if (alertMsg != "The following REQUIRED fields\nhave been left empty:\n")
         {
            alert(alertMsg);
            return false;
         }
         else
         {
            return true;
         }
      }
   }
   
  function reloadfield(form)
  {
    var mdsp_id=form.mdiscipline_id.options[form.mdiscipline_id.options.selectedIndex].value;
    var seq_id=form.seq_id.value;
    self.location= 'resfieldexpedit.php?mdsp_id=' + mdsp_id + '&amp;seq_id=' + seq_id;
  }

  function reloadjob(form)
  {
    var mdsp_id=form.mdiscipline_id.options[form.mdiscipline_id.options.selectedIndex].value;
    var seq_id=form.seq_id.value;
    self.location= 'jobexpedit.php?mdsp_id=' + mdsp_id  + '&amp;seq_id=' + seq_id;
  }

  function reload_prac_reg(form)
  {
    var mdsp_id=form.mdiscipline_id.options[form.mdiscipline_id.options.selectedIndex].value;
    self.location='prac_registration.php?action=objective&mdsp_id=' + mdsp_id;
  }

  function reload_reg_reg(form)
  {
    var mdsp_id=form.mdiscipline_id.options[form.mdiscipline_id.options.selectedIndex].value;
    self.location='reg_registration.php?action=objective&mdsp_id=' + mdsp_id;
  }

  function reload_software_function(form)
  {
    var cid=form.software_category_id.options[form.software_category_id.options.selectedIndex].value;
    self.location='software.php?cid=' + cid;
  }

   function createXmlHttpRequestObject()
   {
      var xmlHttp;
      try
      {
         xmlHttp = new XMLHttpRequest();
      }
      catch(e)
      {
         var XmlHttpVersions = new Array('MSXML2.XMLHTTP.6.0',
                                         'MSXML2.XMLHTTP.5.0',
                                         'MSXML2.XMLHTTP.4.0',
                                         'MSXML2.XMLHTTP.3.0',
                                         'MSXML2.XMLHTTP',
                                         'Microsoft.XMLHTTP');
         for(var i=0; i<XmlHttpVersions.length && !xmlHttp; i++)
         {
            try
            {
               xmlHttp = new ActiveXObject(XmlHttpVersions[i]);
            }
            catch (e) {}
         }
      }
      if(!xmlHttp)
      {
         alert("Error creating the XMLHttpRequest object.");
      }
      else
      {
         return xmlHttp;
      }
   }
   
   function processXmlHttpRequest(url, obj, func)
   {
      xmlHttp = createXmlHttpRequestObject();
      if(xmlHttp)
      {
         try
         {
            xmlHttp.open("GET", url, true);
            xmlHttp.onreadystatechange = function()
                                         {
                                            eval('func(obj)');
                                         }
            xmlHttp.send(null);
         }
         catch(e)
         {
            alert("Can't connect to server:\n" + e.toString());
         }
      }
   }
   
   function getResponse(obj)
   {
      myDiv = document.getElementById(obj);
      if(xmlHttp.readyState >= 1 && xmlHttp.readyState <= 3)
      {
         myDiv.innerHTML = "<img src=\"/img/loading.gif\" alt=\"\" /> Processing...";
      }
      else if(xmlHttp.readyState == 4)
      {
         if(xmlHttp.status == 200)
         {
            try
            {
               response = xmlHttp.responseText;
               myDiv.innerHTML = response;
            }
            catch(e)
            {
               alert("Error: " + e.toString());
            }
         }
         else
         {
            alert("There was a problem retrieving the data:\n" +
            xmlHttp.statusText);
         }
      }
   }

	function popup(url) 
	{
	 var width  = 820;
	 var height = 650;
	 var left   = (screen.width  - width)/2;
	 var top    = (screen.height - height)/2;
	 var params = 'width='+width+', height='+height;
	 params += ', top='+top+', left='+left;
	 params += ', directories=no';
	 params += ', location=no';
	 params += ', menubar=no';
	 params += ', resizable=no';
	 params += ', scrollbars=no';
	 params += ', status=no';
	 params += ', toolbar=no';
	 newwin=window.open(url,'windowname5', params);
	 if (window.focus) {newwin.focus()}
	 return false;
	}
