/**
 * @author: jeremy
 * @description: provided the name of the form and an array containing the different functions you want to call
 *                this function will call the various related check_form functions you provided
 * @param: form_name - this is the name of the current form
 * @param: form_components - this is an array of the form check functions you want to run
**/
function check_form(form_name, form_components)
{
   var msg = "";
   for(i in form_components)
   {      
      msg += form_components[i](form_name);
   }
   if(msg!=""){alert("Please do the following: \n"+msg);}
   else{document.getElementById(form_name).submit();}
}

/**
 * @author: jeremy
 * @description: The current_id variable keeps track of what div is currently shown
 *               This function will hide the current_id and show the value-given_id then set the current_id to the given_id
 * @param: given_id - the value of the selected package - the id of what you want to display
**/
var current_id = 1;
function swap_button(given_id)
{
   var id_off = "value-"+current_id;
   var id_on = "value-"+given_id;
   
   document.getElementById(id_off).style.display = 'none';
   document.getElementById(id_on).style.display = 'block';
   current_id = given_id;
}

/**
 * @author: jeremy
 * @description: All this does is set the value of the "dynamic-level" element to given_id.
 * @param: given_id - the value you want to set dynamic-level to
**/
function set_level(given_value)
{
   document.getElementById("dynamic-level").value = given_value;
}

/**
 * @author: jeremy
 * @description: given an id this function will set the display to block.
 * @param: given_id - the value of the selected package - the id of what you want to display
**/
function show_div(div_id)
{
   document.getElementById(div_id).style.display = 'block';
}