/*
** Function name:  replaceCR
** Purpose:        Replace carriage returns with ^ char (primarily used for address text)
** Parameters:     1: string to be manipulated
**                 2: string to prepend to the start of next line
** Return:         New string with characters replaced
** Compliance:     JavaScript 1.0
*/
function replaceCR
(
    tstring,
	prependstring
)
{
    var c ;
    var i ;
	var newstring = "";

	if (tstring != null)
	   {
       for ( i = 0 ; i < tstring.length ; i ++ )
          {
          c = tstring.charAt ( i );

          if ( c == '\n' )
             {
             newstring += "^\n"; /* replace with ^\n */
             if (i < tstring.length)
                {
                newstring += prependstring;
                }
             }
          else
             {
             newstring += c;
             }
          }
       }

    return (newstring);
}
