/**
 * fieldReviser.js
 *
 * $Revision: 1.10 $
 * $Date: 2011/11/18 18:55:39 $
 * Last edited by: $Author: bcooper $
 */
if( typeof reviseObjectField === 'undefined' )
{
  function reviseObjectField( objectType, objectId, fieldName, newHtml )
  {
    var sSelectorPrefix = '.' + objectType + objectId + fieldName;

    $( sSelectorPrefix + 'Container' ).toggle( newHtml !== '' );

    /**
     * The "newHtml" var includes the UL so the node is safe to
     * replace if it has a value. If it doesn't, we just want to
     * empty the node and keep it for future updates.
     */
    if( newHtml != '' )
    {
      $( sSelectorPrefix ).replaceWith( newHtml );
    }
    else
    {
      $( sSelectorPrefix ).empty();
    }
  }
}

