          function doCurrencyConversion(sourceCurrencyInputName, targetCurrencySelectName, targetCurrencyDirect, resultEditBoxName, resultSpanName, targetCurrencySymbolSpanName) {
            // extract the relevant stuff from the visual controls...
            var sourceCurrencyInput = document.all(sourceCurrencyInputName);
            var sourceCurrency;
            if (sourceCurrencyInput != null)
              sourceCurrency = sourceCurrencyInput.value;

            // either target currency has been passed in directly or the name of a select has been
            //  passed in and we iterate over it to get the target currency...
            var targetCurrency;
            if (targetCurrencyDirect != null)
               targetCurrency = targetCurrencyDirect;
            else {
                var targetCurrencySelect = document.all(targetCurrencySelectName);

                if (targetCurrencySelect != null)
                  for (var i = 0; i < targetCurrencySelect.length; i++)
                    if (targetCurrencySelect.options(i).selected == 1) {
                      targetCurrency = targetCurrencySelect.options(i).value;
                      break;
                    }
            }

            // ensure there is a conversion to do...
            if (sourceCurrency != targetCurrency) {
              // either resultBoxEditName or reultBoxSpanName will have been supplied...
              var resultControlName;
              var value;
              if (resultEditBox != null) {
                  var resultEditBox = document.all(resultEditBoxName);
                  if (resultEditBox != null)
                    value = resultEditBox.value;
                  // set the result control name...
                  resultControlName = resultEditBoxName;
              }
              else {
                  var resultSpan = document.all(resultSpanName);
                  if (resultSpan != null)
                    value = resultSpan.innerHTML;
                  // set the result control name...
                  // to enable us to decode in the call back if we had a span or edit, prefix the name with
                  // an identifier string....
                  resultControlName = "_SPAN_" + resultSpanName;
              }

              // and spawn a new window to actually make the request... when it has completed it will make a call back to a function called
              // updateAfterCurrencyConversion in this window
              convWin = window.open("/servlet/HsPublic?context=ir&path=tradingPublic&service=getConvertCurrency"
                                    + "&value=" + value
                                    + "&sourceCurrency=" + sourceCurrency
                                    + "&targetCurrency=" + targetCurrency
                                    + "&resultEditBoxName=" + resultControlName
                                    + "&sourceCurrencyInputName=" + sourceCurrencyInputName
                                    + "&targetCurrencySymbolSpanName=" + targetCurrencySymbolSpanName,
                                    "convWin", "toolbar=no,menubar=no,height=50,width=300,location=no,scrollbars=yes,resizable=yes,status=yes,left=100,top=100");
            }
            else
              alert("The chosen currency is already selected");
          }

          function updateAfterCurrencyConversion(resultEditBoxName, value, sourceCurrencyInputName, currency, targetCurrencySymbolSpanName) {
            // callback function that updates the visual controls after a currency conversion
            // decode back if we had a span or edit box as the result control...
            if (resultEditBoxName.indexOf("_SPAN_") == -1) {
                // is an edit box...
                var resultEditBox = document.all(resultEditBoxName);
                if (resultEditBox != null)
                  resultEditBox.value = value;
            }
            else {
                // is a span, extract its real name and update it....
                var resultSpanName = resultEditBoxName.substr(6); // NOTE: 6 is the length of _SPAN_
                var resultSpan = document.all(resultSpanName);
                if (resultSpan != null)
                    resultSpan.innerHTML = value;
            }

            var sourceCurrencyInput = document.all(sourceCurrencyInputName);
            if (sourceCurrencyInput != null)
              sourceCurrencyInput.value = currency;
            var targetCurrencySymbolSpan = document.all(targetCurrencySymbolSpanName);
            if (targetCurrencySymbolSpan != null) {
              var symbol;
              if (currency == 'GBP')
                symbol = '&pound;';
              else if (currency == 'USD')
                symbol = '$';
              else if (currency == 'EUR')
                symbol = '&euro;';
              else if (currency == 'JPY')
                symbol = '&#165;';
              else
                symbol = currency;
              targetCurrencySymbolSpan.innerHTML = symbol;
            }
          }

          function resetDefaultCurrency(symbolSpanName, symbol, currencyInputName, currency) {
            // after a calc is done - the value will be back in default currency again, reset the appropriate items...
            document.all(symbolSpanName).innerHTML = symbol;
            document.all(currencyInputName).value = currency;
          }
