
    <!-- function that display on and off specified element -->
	function viewElement(element_id, other_element_id) {
	
	var $element = $('#'+element_id);
	var $other_element = $('#'+other_element_id);

	if ($element.is(':checked') == true) { $other_element.slideDown("fast"); }
	else { $other_element.slideUp("fast"); }
	}



    <!-- function that display on and off specified element -->
	function enableElement(element_id, other_element_id) {
	
	var element = document.getElementById(element_id);
	//var	status = element.getAttribute('checked');
	var status = element.checked;
	if (status == true) { document.getElementById(other_element_id).disabled = false; }
	else { document.getElementById(other_element_id).disabled = true; }
	}
	
	
	    <!-- function that substitute value of the input field -->
	function changeElementValue(element_id, new_value) {
	
	var element = document.getElementById(element_id);
    document.getElementById(element_id).value = new_value;

	}
	
	
	function notifyBoxOnSelect(element_id, other_element_id, initial_status, initial_category) {
		  		  
	      $("select#"+element_id).change(function () { 
          var new_status = ""; 
		  var new_category = "";
          $("select#"+element_id+" option:selected").each(function () { 
                new_status=$("select#status").val(); 
				new_category=$("select#category").val();
              }); 
		  
		  if((initial_category!='IR' || initial_status!='A') && (new_category=='IR' && new_status=='A'))
            {$("#"+other_element_id).css('display', 'block'); $("#msg_type").html('"welcome new IR"');}
	   else if((initial_category=='IR' && initial_status=='A') && (new_category!='IR' || new_status!='A'))
		    {$("#"+other_element_id).css('display', 'block'); $("#msg_type").html('"thank you for your service"');}
	   else {$("#"+other_element_id).css('display', 'none'); }
        }) 
        .trigger('change'); 

  
	}
	
