/*
 * This function will take the parameters to make an Ajax call.  The returned
 * object will then be used to automatically update the innerHtml of the 
 * parameter updateDivId.
 * 
 * Arguments:
 *    url - The *.action command, or valid url, that is passed to the Struts
 *       controller.  A mapping must already exist in the struts-config.xml 
 *       file if an action is specified.
 *    postParameterArray - An array of post parameters.
 *    updateDivId - The div id that is used post request.  The Ajax utility
 *       will take this id and update the innerHTML of the respective tag, 
 *       preferably a div tag, with the returned object.
 *
 * Examples:
 *    loadContent('TestAction.do', null, 'test-Id');
 *    loadContent('TestAction.do', new Array('a=xyz','b=qrs'), 'test-Id');
 */
function invokeAjax(url, postParameterArray, updateDivId, indicatorDivId){
   var params = new String();
   if(postParameterArray != null){
      params=params.concat("?");
      params=params.concat(postParameterArray.join("&"));
   }
   url=url.concat(params);
   new Ajax(url, {
      method:      "get",
      onRequest:   function(){ 
                      if(indicatorDivId != null && $(indicatorDivId) != null)
                        $(indicatorDivId).empty().setHTML("<img src='./images/indicator.gif'/>");
                   },
      update:      updateDivId,
      onComplete:  function(){ 
                      if(indicatorDivId != null && $(indicatorDivId) != null)
                          $(indicatorDivId).empty();
                   }}).request();
}