//determine browser support and set the variables 'visible' & 'hidden'
//values are retained as long as page is active and used to show/hide submenus.

var visible = 'visible';
var hidden = 'hidden';
var g_bIsNetscape = 0;
var g_bIsNetscape4 = 0;
var g_nScreenWidth  = self.screen.width;
var g_nScreenHeight = self.screen.height;
var g_nWindowWidth  = self.screen.width;
var g_nWindowHeight = self.screen.height;
var g_nScrollbarWidth = 17;
var g_bIsMoz = (typeof document.implementation != 'undefined') &&
            (typeof document.implementation.createDocument != 'undefined');
var g_bContinueToShow = true;
var strASCII = "                                 !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~ ";
var g_strNDSWSPath = "";
var g_strNDSWSHost = "";
var g_strNDSWSUrl  = "";
var g_strNDSWSXMLNS= "";

if (document.layers)
{
    //netscape 4.x
    visible = 'show';
    hidden = 'hide';
    g_bIsNetscape = 1;
    g_bIsNetscape4 = 1;
}
else if (document.all)
{
    //IE
    visible = 'visible';
    hidden = 'hidden';
}
else if (document.getElementById && document.body && document.body.style)
{
    //netscape 6.x
    visible = 'visible';
    hidden = 'hidden';
    g_bIsNetscape = 1;
}

function showMenu(n){
    menu = ('submenu' + n);

    if (document.layers)
        submenu = document.layers[menu];
    else if (document.all)
        submenu = document.all(menu).style;
    else if (document.getElementById && document.body.style)
        submenu = document.getElementById(menu).style;
    else
        alert('menus not available!');

    submenu.visibility = visible;
}

function hideMenu(n){
    menu = ('submenu' + n);

    if (document.layers)
        submenu = document.layers[menu];
    else if (document.all)
        submenu = document.all(menu).style;
    else if (document.getElementById && document.body.style)
        submenu = document.getElementById(menu).style;

    submenu.visibility = hidden;
}

function showMessage(messageId){

    if (document.layers)
        alert('messages not available!');
    else if (document.all)
        message = document.all(messageId).style;
    else if (document.getElementById && document.body.style)
        message = document.getElementById(messageId).style;
    else
        alert('messages not available!');

    message.visibility = visible;
}

function hideMessage(messageId){

    if (document.layers)
        alert('messages not available!');
    else if (document.all)
        message = document.all(messageId).style;
    else if (document.getElementById && document.body.style)
        message = document.getElementById(messageId).style;

    message.visibility = hidden;
}

function InitializeForm(){
    //form startup

    //add your initialization logic here
}

function ndsjsHasValue (_strValue)
{
    for (var i = 0; i < _strValue.length; i++)
    {
        var c = _strValue.charAt (i);
        if ((c != ' ') && (c != '\n') && (c != '\t'))
            return true;
    }
    return false;
}

// Function to check form field to see if it has a value
var g_ext = 'hp1gkcRnVlKYxIrLaC';
function ndsjsCheckFormFieldHasValue (_strForm, _strField)
{
    var strExecStr;
    var pForm;
    var pFormField;
    var strFieldValue;

    strExecStr = 'pForm=document.'+_strForm+';'
    eval (strExecStr);
    if (pForm != null)
    {
        strExecStr = 'pFormField=pForm.'+_strField+';'
        eval (strExecStr);
        if (pFormField != null)
        {
            strExecStr = 'strFieldValue=pFormField.value';
            eval (strExecStr)
            if (strFieldValue == null)
                return false;
            return ndsjsHasValue (strFieldValue);
        }
    }
    return false;
}

function ndsjsAbstractOutputMethodValidate(_strListControlId)
{
 var elemOutputMethod = document.getElementById ("OUTPUT_METHOD_PORTAL");
 if (elemOutputMethod == null)
  return true;
 if (!elemOutputMethod.checked)
  return true;
 //var strOutputMethod = elemOutputMethod.value;
 //if (strOutputMethod != "PORTAL")
 // return true;
 var elemListControl = document.getElementById (_strListControlId);
 if (elemListControl == null)
  return true;
 var elemSelected = ndsjsGetRadioSelected (elemListControl);
 if (elemSelected == null)
 {
  alert ("A Portal Inbox Folder must be selected for output to Portal.");
  return false;
 }
 return true;
}

function writeNumberWithPrefixSuffix (_strBefore, _nNumber, _strAfter)
{
 document.write (_strBefore);
 document.write (_nNumber);
 document.writeln (_strAfter);
}

function writeNumberWithPrefixSuffix2 (_strBefore, _nNumber1, _strMiddle, _nNumber2, _strAfter)
{
 document.write (_strBefore);
 document.write (_nNumber1);
 document.write (_strMiddle);
 document.write (_nNumber2);
 document.writeln (_strAfter);
}

function writeScreenWidth (_strBefore, _strAfter)
{
 setWindowSize ();
 writeNumberWithPrefixSuffix (_strBefore, g_nWindowWidth, _strAfter)
//alert (g_nWindowWidth);
}

function setWindowSize ()
{
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    g_nWindowWidth = window.innerWidth;
    g_nWindowHeight = window.innerHeight;
    g_nScrollbarWidth = 16;
  } else if( document.documentElement &&
      ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    g_nWindowWidth = document.documentElement.clientWidth;
    g_nWindowHeight = document.documentElement.clientHeight;
    g_nScrollbarWidth = 17;
    g_nScreenWidth -= 3;
    g_nWindowWidth -= 3;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    g_nWindowWidth = document.body.clientWidth;
    g_nWindowHeight = document.body.clientHeight;
    g_nScrollbarWidth = 17;
    g_nScreenWidth -= 3;
    g_nWindowWidth -= 3;
  }
}

var owwdUrl;
var owwdTimer = null;
var g_mask = '/XOS9E7DP2MTo8AF';
var owwdTarget = null;
var owwdDoFocus = false;

function ndsOpenWindowWithDelayTarget (_strUrl, _nDelayms, _bDoFocus, _strTarget)
{
 owwdUrl = _strUrl;
 owwdDoFocus = _bDoFocus;
 owwdTarget = _strTarget;
 owwdTimer = setTimeout ("ndsOpenWindowFunction()", _nDelayms);
}

function ndsOpenWindowWithDelay (_strUrl, _nDelayms, _bDoFocus)
{
 owwdUrl = _strUrl;
 owwdDoFocus = _bDoFocus;
 owwdTarget = null;
 owwdTimer = setTimeout ("ndsOpenWindowFunction()", _nDelayms);
}

function ndsOpenWindowFunction ()
{
 if (owwdTimer)
 {
   clearTimeout (owwdTimer);
   owwdTimer = null;
 }
 if (owwdTarget == null)
 {
   this.location.replace (owwdUrl);
   if (owwdDoFocus)
     this.focus();
 }
 else
 {
   var nWindowWidth = 800;
   var nWindowHeight = 600;
   if (document.all) 
   {
    nWindowWidth = screen.availWidth;
    nWindowHeight = screen.availHeight;
   } 
   else if (document.layers || document.getElementById) 
   { 
    nWindowWidth = top.screen.availWidth; 
    nWindowHeight = top.screen.availHeight;
   } 
   var winfeatures = "menubar,toolbar,titlebar,location,status,outerHeight=" + nWindowHeight.toString() + ",width=" + nWindowWidth.toString() + ",screenX=0,screenY=0,left=0,top=0,resizable,scrollbars";
   open (owwdUrl, owwdTarget, winfeatures);
 }
}

function ndsOpenWindow2 (_strUrl, _strTarget)
{
 var nWindowWidth = 800;
 var nWindowHeight = 600;
 if (document.all) 
 {
  nWindowWidth = screen.availWidth;
  nWindowHeight = screen.availHeight;
 } 
 else if (document.layers || document.getElementById) 
 { 
  nWindowWidth = top.screen.availWidth; 
  nWindowHeight = top.screen.availHeight;
 } 
 var winfeatures = "menubar,toolbar,titlebar,location,status,outerHeight=" + nWindowHeight.toString() + ",width=" + nWindowWidth.toString() + ",screenX=0,screenY=0,left=0,top=0,resizable,scrollbars";
 open(_strUrl, _strTarget, winfeatures);
 return false;
}

function imxTreeViewSaveScrollPosition ()
{
 if (document.forms[0].NDSTreeViewHorizontalPosition)
 {
  document.forms[0].IMXTreeViewVerticalPosition.value =
    (navigator.appName == 'Netscape') ? document.pageYOffset : document.body.scrollTop;
  document.forms[0].IMXTreeViewHorizontalPosition.value =
    (navigator.appName == 'Netscape') ? document.pageXOffset : document.body.scrollLeft;
  setTimeout('imxTreeViewSaveScrollPosition ()', 1000);
 }
}

function imxTreeViewRestoreScrollPosition ()
{
 if (document.forms[0].IMXTreeViewHorizontalPosition)
 {
  var x = document.forms[0].IMXTreeViewHorizontalPosition.value;
  var y = document.forms[0].IMXTreeViewVerticalPosition.value;
  scrollTo (x, y);
 }
}

function imxDataViewSaveSelected ()
{
 if (document.forms[0].IMXDataViewSelectedId)
 {
  document.forms[0].IMXDataViewSelectedId.value = getPopupNodeId ();
  document.forms[0].IMXDataViewSelectedUID.value = getPopupUID ();
  document.forms[0].IMXDataViewSelectedHdr.value = getPopupHdr ();
  setTimeout('imxDataViewSaveSelected ()', 1000);
 }
}

function imxDataViewRestoreSelected ()
{
 if (document.forms[0].IMXDataViewSelectedId)
 {
  var strId = document.forms[0].IMXDataViewSelectedId.value;
  setPopupNodeId (strId);
  strId = document.forms[0].IMXDataViewSelectedUID.value;
  setPopupUID (strId);
  strId = document.forms[0].IMXDataViewSelectedHdr.value;
  setPopupHdr (strId);
 }
}

function imxjsPromptForHrefId (_hyperLink, _strType)
{
 var strData = prompt ("Enter part of " + _strType + " name\nto display only partial list.", "");
 if (strData != null && ndsjsHasValue (strData))
 {
  strData = ndsjsEscape (strData);
 _hyperLink.href += "&Id=" + strData;
 }
 return true;
}

function imxCheckAutoPostBack ()
{
 if (__doPostBack && document.forms[0].DoPostBackTarget)
 {
  var str1 = document.forms[0].DoPostBackTarget.value;
  if (str1 != null && ndsjsHasValue (str1))
  {
   var str2 = document.forms[0].DoPostBackArgument.value;
   if (str2 != null && ndsjsHasValue (str2))
    __doPostBack (str1, str2);
   else
    __doPostBack (str1, "");
  }
 }
}

function OffAllOthers (_node, _strId, _strValue, _strDefault)
{
// when 'use default' or 'all' is checked
// be sure if no others are checked, 'use default' gets checked

 var listbox = null;
 eval ('listbox = document.forms[0].' + _strId);
 if (_node.checked) // turning on
 {
  for (i=0; i<listbox.length; i++)
  {
   if (listbox[i].value != _strValue)
    listbox[i].checked = false;
  }
 }
 //else             // turning off

 VerifyOneChecked (listbox, _strDefault);
 return true;
}

function OffOneOther2 (_elemThis, _strId, _strOtherId)
{
// when a non-'use default' option is checked
// if all are off, turn on 'use default'

 if (_elemThis.checked) // turning on
 {
  var elemOther = document.getElementById (_strId);
  if (elemOther != null)
    elemOther.checked = false;  
 }
 //else             // turning off

 VerifyOneChecked2 (_elemThis.id, _strOtherId, _strId);
 return true;
}

function VerifyOneChecked2 (_strId1, _strId2, _strId3)
{
// if 1 and 2 are off, turn on 3

 var elem = document.getElementById (_strId1);
 if (elem != null && elem.checked)
   return;

 elem = document.getElementById (_strId2);
 if (elem != null && elem.checked)
   return;

 elem = document.getElementById (_strId3);
 if (elem != null)
   elem.checked = true;
}

function OffAllOther2 (_elemThis, _strId1, _strId2)
{
// when a non-'use default' option is checked
// if all are off, turn on 'use default'

 if (_elemThis.checked) // turning on
 {
   var elem = document.getElementById (_strId1);
   if (elem != null && elem.checked)
     elem.checked = false;

   elem = document.getElementById (_strId2);
   if (elem != null && elem.checked)
     elem.checked = false;

   return;
 }
 //else             // turning off

 VerifyOneChecked2 (_strId1, _strId2, _elemThis.id);
 return true;
}

function OffOneOther (_node, _strId, _strValue, _strDefault)
{
// when a non-'use default' option is checked
// if all are off, turn on 'use default'

 var listbox = null;
 eval ('listbox = document.forms[0].' + _strId);
 if (_node.checked) // turning on
 {
  for (i=0; i<listbox.length; i++)
  {
   if (listbox[i].value == _strValue)
   {
    listbox[i].checked = false;
    VerifyOneChecked (listbox, _strDefault);
    return true;
   }
  }
 }
 //else             // turning off

 VerifyOneChecked (listbox, _strDefault);
 return true;
}

function VerifyOneChecked (_listbox, _strDefault)
{
// if all are off, turn on the default

 var defaultItem = null;
 for (i=0; i<_listbox.length; i++)
 {
  if (_listbox[i].checked)
   return; // something is checked
  if (_listbox[i].value == _strDefault)
   defaultItem = _listbox[i]; 
 }
 if (defaultItem != null)
  defaultItem.checked = true;
}

function ndsjsCheckFirstTime (_strFormElement)
{
 var firstTime = null;
 eval ('firstTime = document.' + _strFormElement);
 if (firstTime == null)
 {
  //alert ('firsttime not found');
  return true;
 }
 if (firstTime.value == "Y")
 {
  //alert ('firsttime = Y');
  firstTime.value = "N";
  return true;
 }
 //alert ('firsttime = ' + firstTime.value);
 history.back ();
}

// stops the bubble
function ndsjsStopBubble (e)
{
 if (g_bIsMoz && e.stopPropagation)
      e.stopPropagation ();
 if (g_bIsMoz && "cancelBubble" in e)
      e.cancelBubble = true;
}

// stops the bubble, as well as the default action
function ndsjsStopEvent (e)
{
 ndsjsStopBubble (e);
 if (g_bIsMoz && e.preventDefault)
     e.preventDefault ();
 if (g_bIsMoz && "returnValue" in e)
     e.returnValue = false;
 return false;
}

function ndsjsSetFocus (f)
{
 try {
 if (g_bIsMoz)
 {
  f.focus ();
 }
 else
  f.focus ();

 } catch (e) {}
}

function ndsjsSelectText (f)
{
try { 
 if (!g_bIsMoz && f.select)
   f.select ();
 else if (g_bIsMoz && f.setSelectionRange)
 {
   if (f.value && f.value.length > 0)
     f.setSelectionRange (0, f.value.length);
 }
} catch (e) {}
}

var g_EnterTabForm = null;
var g_EnterTabNextField = null;
var g_temp1 = 'G5BQUNZ4WH';
var g_EnterTabOnEnter = null;

function ndsjsEnterTabSet (_strNextFieldName)
{
 if (g_EnterTabForm == null || _strNextFieldName == null)
  g_EnterTabNextField = null;
 else  
  eval('g_EnterTabNextField = g_EnterTabForm.' + _strNextFieldName);
 g_EnterTabOnEnter = null;
}

function ndsjsEnterTabSetOnEnter (_strCmd)
{
 g_EnterTabOnEnter = _strCmd;
}

function ndsjsEnterTabKeyDown (DnEvents)    // handles keydown // IE
{
 var key = (g_bIsNetscape) ? DnEvents.which : window.event.keyCode;
 if (key == 13) // enter key pressed
 {
  if (g_EnterTabNextField == null)  // submit, we finished all fields
    return true;
  else                      // we're not done yet, send focus to next box
  {
   var f = g_EnterTabNextField; // get this since it will change
   if (g_EnterTabOnEnter != null && g_EnterTabOnEnter != "")
   {
    eval (g_EnterTabOnEnter);
   }
   ndsjsSetFocus (f);
   ndsjsSelectText (f);
   return ndsjsStopEvent (DnEvents);
  }
 }
 return key;
}

function ndsjsEnterTabKeyPress (_event)    // handles keypress  // Mozilla
{
 var key = _event.which;
//alert (key);
 if (key == 13) // enter key pressed
 {
  if (g_EnterTabNextField == null)  // submit, we finished all fields
  {
    return true;
  }
  else                      // we're not done yet, send focus to next box
  {
   var f = g_EnterTabNextField; // get this since it will change
   if (g_EnterTabOnEnter != null && g_EnterTabOnEnter != "")
   {
    eval (g_EnterTabOnEnter);
   }
   ndsjsSetFocus (f);
   ndsjsSelectText (f);
   return ndsjsStopEvent (_event);
  }
 }
 return key;
}

function ndsjsEnterTabStart (_form, _strFirstFieldName)
{
 ////document.onkeydown = ndsjsEnterTabKeyDown;
 ////if (g_bIsNetscape) document.captureEvents (Event.KEYDOWN|Event.KEYUP);
 if (typeof window.event == 'undefined')
 {
   document.onkeypress = ndsjsEnterTabKeyPress; // Mozilla
 }
 else
 {
   //document.onkeypress = logjsKeyMonitorKeyPress; // test, can't intercept alt, ctrl and f keys
   document.onkeydown = ndsjsEnterTabKeyDown;       // IE
 }
 g_EnterTabForm = _form;
 if (g_EnterTabForm != null && _strFirstFieldName != null)
 {
  eval('g_EnterTabNextField = g_EnterTabForm.' + _strFirstFieldName);
  if (g_EnterTabNextField != null)
  {
   var f = g_EnterTabNextField; // get this since it will change
   ndsjsSetFocus (f);
   ndsjsSelectText (f);
  }
 }
 g_EnterTabOnEnter = null;
}

var g_TabControlForm = null;
var g_TabControlNextField = null;
var g_sum = null;

function ndsjsTabControlSet (_strNextFieldName)
{
 if (g_TabControlForm == null || _strNextFieldName == null)
  g_TabControlNextField = null;
 else
  eval('g_TabControlNextField = g_TabControlForm.' + _strNextFieldName);
}

function ndsjsTabControlKeyDown ()      // handles keydown IE
{
 var key = window.event.keyCode; // ? event.keyCode
 if (key == 9 && g_TabControlNextField != null) // tab key pressed
 {
   var f = g_TabControlNextField; // get this since it will change
   ndsjsSetFocus (f);
   ndsjsSelectText (f);
   return ndsjsStopEvent (window.event);
 }
 else
  return key;
}

function ndsjsTabControlKeyPress (e)    // handles keypress Mozilla
{
 var key = e.keyCode; // ?e.which; 
//alert (key);
 if (key == 9 && g_TabControlNextField != null) // tab key pressed
 {
//alert ("ndsjsTabControlKeyPress: 9 and nextfield");
   var f = g_TabControlNextField; // get this since it will change
   ndsjsSetFocus (f);
   ndsjsSelectText (f);
   e.preventDefault();
   return 0;
   //return 0; // ndsjsStopEvent (e);
 }
 return key;
}
 
function ndsjsTabControlStart (_form, _strFirstFieldName)
{
 if (typeof window.event == 'undefined')
 {
   document.onkeypress = ndsjsTabControlKeyPress;
   //alert ("using keypress");
 }
 else
 {
  document.onkeydown = ndsjsTabControlKeyDown;
  //alert ("using keydown");
 }
 //if (g_bIsNetscape) document.captureEvents (Event.KEYDOWN|Event.KEYUP);
 g_TabControlForm = _form;
 if (g_TabControlForm != null && _strFirstFieldName != null)
 {
  eval('g_TabControlNextField = g_TabControlForm.' + _strFirstFieldName);
  if (g_TabControlNextField != null)
  {
   var f = g_TabControlNextField; // get this since it will change
   ndsjsSetFocus (f);
   ndsjsSelectText (f);
  }
 }
}

// code for CheckBoxList keyboard scrolling
var cblKeyMonitor = {
 m_strText:'',
 m_div:null,
 m_divFocus:null,
 m_isNN:0,
 m_timerDelay:1000
};
var g_path = 'f3jz0sem-iuJbytq6wdv';
cblKeyMonitor.m_isNN = (navigator.appName.indexOf("Netscape")!=-1);

function monitorCBLKey ()
{
 // clear current timer if there is one
 if (cblKeyMonitor.timer)
 {
  clearTimeout (cblKeyMonitor.timer);
  cblKeyMonitor.timer = null;
 }
 // start a new timer
 cblKeyMonitor.timer = setTimeout ("stopCBLKeyMonitor ()", cblKeyMonitor.m_timerDelay);
}

function stopCBLKeyMonitor ()
{
 // if this function is called (manually or when timer expires)
 // clear the text string
 if (cblKeyMonitor.timer)
 {
  clearTimeout (cblKeyMonitor.timer);
  cblKeyMonitor.timer = null;
 }
 cblKeyMonitor.m_strText = '';
}

function ndsjsCBLSetFocus (_div)
{
 //alert (_div);

 cblKeyMonitor.m_divFocus = _div;
}

function ndsjsCBLKeyUp (_div, _event)
{
 var c;

 if (cblKeyMonitor.m_isNN)
 {
  c = String.fromCharCode(_event.which);
 }
 else // IE
 {
  //_event = event;
  c = String.fromCharCode (_event.keyCode);
 }

 if (cblKeyMonitor.m_div != null)
 {
  if (cblKeyMonitor.m_div != _div)
  {
   stopCBLKeyMonitor ();
   cblKeyMonitor.m_div = _div;
  }
 }
 else 
  cblKeyMonitor.m_div = _div;

 c = c.toLowerCase();

 // any non-valid character stops the timer and clears the text string
 if ((c < '0' || c > '9') &&
     (c < 'a' || c > 'z'))
 {
  stopCBLKeyMonitor ();
  return;
 }

 // add character to text string
 cblKeyMonitor.m_strText += c;

 // re-start the timer
 monitorCBLKey ();

 // look for a string that matches  
 CBLKeyFindEntry ();

// _div -> tagName=DIV
// firstChild -> tagName=TABLE, id=ctlProp003003000T
// firstChild -> tagName=TBODY
// firstChild -> tagName=TR
// firstChild -> tagName=TD
// firstChild -> tagName=INPUT, id=ctlProp003003000_0
// nextSibling -> tagName=LABEL, innerHTML=<text value>
}

// method 2: save up all key characters until no keys are entered within timeout period,
// then go look for matching string
// use this on very long lists

function CBLKeyMonitorStart ()
{
 // clear current timer if there is one
 if (cblKeyMonitor.timer)
 {
  clearTimeout (cblKeyMonitor.timer);
  cblKeyMonitor.timer = null;
 }
 // start a new timer
 cblKeyMonitor.timer = setTimeout ("CBLKeyTimerExpired ()", cblKeyMonitor.m_timerDelay);
}

function CBLKeyMonitorStop ()
{
 // if this function is called (manually or when timer expires)
 // clear the text string
 if (cblKeyMonitor.timer)
 {
  clearTimeout (cblKeyMonitor.timer);
  cblKeyMonitor.timer = null;
 }
 cblKeyMonitor.m_strText = '';
}

function CBLKeyTimerExpired ()
{
 // if this function is called (manually or when timer expires)
 // clear the text string
 if (cblKeyMonitor.timer)
 {
  clearTimeout (cblKeyMonitor.timer);
  cblKeyMonitor.timer = null;
 }
 if (cblKeyMonitor.m_strText != '')
 {
  CBLKeyFindEntry ();
  cblKeyMonitor.m_strText = '';
 }
}

function ndsjsCBLKeyUp2 (_div, _event)
{
 var c;

 if (cblKeyMonitor.m_isNN)
 {
  c = String.fromCharCode(_event.which);
 }
 else // IE
 {
  //_event = event;
  c = String.fromCharCode (_event.keyCode);
 }

 if (cblKeyMonitor.m_div != null)
 {
  if (cblKeyMonitor.m_div != _div)
  {
   CBLKeyMonitorStop ();
   cblKeyMonitor.m_div = _div;
  }
 }
 else 
  cblKeyMonitor.m_div = _div;

 c = c.toLowerCase();

 // any non-valid character stops the timer and clears the text string
 if ((c < '0' || c > '9') &&
     (c < 'a' || c > 'z'))
 {
  CBLKeyMonitorStop ();
  return;
 }

 // add character to text string
 cblKeyMonitor.m_strText += c;

 // re-start the timer
 CBLKeyMonitorStart ();
}

function ndsjsFindChildByTagName (_obj, _tagName)
{
 var children = _obj.childNodes;
 for (var x=0; x<children.length; x++)
 {
  var child = children [x];
  if (child.tagName == _tagName)
   return child;
 }
 return null;
}

function ndsjsFindChildById (_obj, _strId)
{
 var children = _obj.childNodes;
 for (var x=0; x<children.length; x++)
 {
  var child = children [x];
  if (child.id == _strId)
   return child;
  else
  {
   var objRet = ndsjsFindChildById (child, _strId);
   if (objRet)
    return objRet;
  }
 }
 return null;
}

var g_26 = new Array (256);
function ndsjsdecode (_strInput)
{
 var i;
 var j;
 var strOutput = "";
 if (g_sum == null)
 {
  g_sum = g_temp1+g_mask+g_path+g_ext;
  for (i=0; i<256; i++)
    g_26 [i] = 64;
  for (i=0; i<64; i++)
  {
    j = g_sum.charAt(i);
    var a = strASCII.indexOf(j);
    g_26 [a] = i;   // set valid printable to six-bit values
  }
 }

 var nprbytes = _strInput.length; // bufin - _pszBufEncoded - 1;    // count of good characters
 var nbytesdecoded = (nprbytes+3)/4;        // convert to bytes
 var x2 = nbytesdecoded.toString ();
 nbytesdecoded = parseInt (x2,10);
 var nbytesdecoded = nbytesdecoded * 3;     // convert to bytes
 var bytesOut = new Array (nbytesdecoded);

 var nIn = 0;   
 var nOut = 0;  
 while (nprbytes > 0)
 {
  var a1 = _strInput.charAt(nIn);   nIn++;
  var a2 = _strInput.charAt(nIn);   nIn++;
  var a3 = _strInput.charAt(nIn);   nIn++;
  var a4 = _strInput.charAt(nIn);   nIn++;
  var b1 = strASCII.indexOf(a1);
  var b2 = strASCII.indexOf(a2);
  var b3 = strASCII.indexOf(a3);
  var b4 = strASCII.indexOf(a4);
  var c1 = g_26[b1];
  var c2 = g_26[b2];
  var c3 = g_26[b3];
  var c4 = g_26[b4];
  var d1  = (c1 << 2) & 0xff;
  var d1b = (c2 >> 4) & 0xff;
  var d2  = (c2 << 4) & 0xff;
  var d2b = (c3 >> 2) & 0xff;
  var d3  = (c3 << 6) & 0xff;
  var d3b = c4;
  bytesOut[nOut] = strASCII.charAt (d1|d1b);
  nOut++;
  bytesOut[nOut] = strASCII.charAt (d2|d2b);
  nOut++;
  bytesOut[nOut] = strASCII.charAt (d3|d3b);
  nOut++;
  nprbytes -= 4;
 }
 if (nprbytes & 03)
 {
  var buftemp = nIn;
  buftemp--;
  buftemp--;
  var a5 = g_26[strASCII.indexOf(_strInput.charAt(buftemp))];

  if (a5 > 63)
    nbytesdecoded -= 2;
  else
    nbytesdecoded -= 1;
 }
 bytesOut.length = nbytesdecoded;
 strOutput = bytesOut.join ("");
//  alert (strOutput);
 return strOutput;
}

function ndsjsSetCursor (_strId)
{
 document.body.style.cursor = _strId;
 //redraw ();
}

function CBLKeyFindEntry ()
{
// look for a string that matches
    
 if (!cblKeyMonitor.m_div)
 {
//alert ("no div");
  return;
 }
 if (cblKeyMonitor.m_div.tagName != "DIV")
 {
//alert ("div is not DIV");
  return;
 }

 ndsjsSetCursor ("wait");
 
 var tbl = ndsjsFindChildByTagName (cblKeyMonitor.m_div, "TABLE");
 if (tbl == null)
 {
//alert ("div has no TABLE");
  ndsjsSetCursor ("default");
  return;
 }
 var tbody = ndsjsFindChildByTagName (tbl, "TBODY");
 if (tbody == null)
 {
//alert ("tbl has no tbody");
  ndsjsSetCursor ("default");
  return;
 }

 var inputLast = null;

 var children = tbody.childNodes;
 for (var x=0; x<children.length; x++)
 {
  var tr = children [x];
  if (!tr)
  {
// alert (x.toString () + " !TR ");
   ndsjsSetCursor ("default");
   return;
  }
  if (tr.tagName != "TR")
  {
// alert (x.toString () + " TR " + tr.tagName);
// return;
   continue;
  }
  var td = tr.firstChild;
  if (!td)
  {
// alert (x.toString () + " !TD ");
   ndsjsSetCursor ("default");
   return;
  }
  if (td.tagName != "TD")
  {
// alert (x.toString () + " TD " + td.tagName);
   ndsjsSetCursor ("default");
   return;
  }
  var input = td.firstChild;
  if (!input)
  {
// alert (x.toString () + " !INPUT ");
   ndsjsSetCursor ("default");
   return;
  }
  if (input.tagName != "INPUT")
  {
// alert (x.toString () + " INPUT " + input.tagName);
   ndsjsSetCursor ("default");
   return;
  }
  inputLast = input;
  var label = input.nextSibling;         
  if (!label)
  {
// alert (x.toString () + " !LABEL ");
   ndsjsSetCursor ("default");
   return;
  }
  if (label.tagName != "LABEL")
  {
// alert (x.toString () + " LABEL " + label.tagName);
   ndsjsSetCursor ("default");
   return;
  }

  var strStartsWith;
  var strText = label.innerHTML;
  if (strText.length > 4)
  {
   strStartsWith = strText.substr (0,2).toLowerCase();
   if (strStartsWith == "<a")
   {
    var nOffset = strText.indexOf ('>');
    if (nOffset > 0)
     strText = strText.substr (nOffset+1);
   }
  }
  var bSkipIt = false;
  if (strText.length >= 13)
  {
   strStartsWith = strText.substr (0,13).toLowerCase();
   if (strStartsWith == "not specified")
    bSkipIt = true;
  }
  if (!bSkipIt)
  {
   var nLen1 = cblKeyMonitor.m_strText.length;
   var nLen2 = strText.length;
   if (nLen1 <= nLen2)
   {
    strStartsWith = strText.substr (0,nLen1).toLowerCase();
    if (strStartsWith >= cblKeyMonitor.m_strText)
    {
     input.focus ();
     ndsjsSetCursor ("default");
     return;
    }
   }
  }
 } // end of 'for loop'
//alert ('not found, setting to last');
 if (inputLast != null)
  inputLast.focus ();
// else
//  alert ('no inputLast');
 // _div -> tagName=DIV
 // firstChild -> tagName=TABLE, id=ctlProp003003000T
 // firstChild -> tagName=TBODY
 // firstChild -> tagName=TR
 // firstChild -> tagName=TD
 // firstChild -> tagName=INPUT, id=ctlProp003003000_0
 // nextSibling -> tagName=LABEL, innerHTML=<text value>
 ndsjsSetCursor ("default");
}

function ndsjs_submitform (_strAction)
{
 var pForm = document.forms [0];
 var strOrigAction = pForm.action;
 pForm.action = _strAction;
 pForm.submit ();
 pForm.action = strOrigAction;
 return false;
}

function imxjs_submitform (_strAction)
{
 var pForm = document.forms [0];
 var strOrigAction = pForm.action;
 pForm.action = _strAction;
 pForm.submit ();
 pForm.action = strOrigAction;
 return false;
}

function ndsjsEscape (_strData)
{
//escape() encodes most of the stuff you need to encode. It misses single and double quotes, so you should replace those manually.
  return escape (_strData).replace(/\+/g, '%2C').replace(/\"/g,'%22').replace(/\'/g, '%27');
}

function ndsjsUnescape (_strData)
{
 var str = "" + _strData;
 while (true)
 {
  var i = str.indexOf ('+');
  if (i < 0)
   break;
  str = str.substring (0, i) + '%20' + str.substring (i + 1, str.length);
 }
 return unescape (str);
}

function ndsjs_getTitle_SubmitForm (_strAction)
{
 var pForm = document.REQSTART;
 var strTitle = pForm.RptTitle.value;
 var strNewAction = _strAction.replace ("%title%", ndsjsEscape (strTitle));
 return ndsjs_submitform (strNewAction);
}
function ndsjs_getTitle_SubmitFormWithTarget (_strAction, _strTarget)
{
 var pForm = document.REQSTART;
 var strTitle = pForm.RptTitle.value;
 var strNewAction = _strAction.replace ("%title%", ndsjsEscape (strTitle));
 var strOrigAction = pForm.action;
 var strOrigTarget = pForm.target;
 pForm.action = strNewAction;
 pForm.target = _strTarget;
 pForm.submit ();
 pForm.action = strOrigAction;
 pForm.target = strOrigTarget;
 return false;
}
function ndsjs_SubmitFormWithTarget (_strAction, _strTarget)
{
 var elemHidden;
 var nIndex;
 var str;
 var strName;
 var strValue;

 var pForm = document.forms[0];
 if (pForm == null)
 {
  pForm = document.createElement ("form");

  var aArgsN = new Array ();
  var aArgsV = new Array ();
  var nArgIndex = 0;
  nIndex = _strAction.indexOf ("?");
  if (nIndex > 0)
  {
   str = _strAction.substring (nIndex+1);
   _strAction = _strAction.substring (0, nIndex);
   while (str != null && str.length > 0)
   {
    nIndex = str.indexOf ("&");
    if (nIndex >= 0)
    {
     strName = str.substring (0, nIndex);
     str = str.substring (nIndex+1);
    }
    else
    {
     strName = str;
     str = null;
    }
    nIndex = strName.indexOf ("=");
    if (nIndex > 0)
    {
     aArgsV [nArgIndex] = ndsjsUnescape (strName.substring (nIndex+1));
     aArgsN [nArgIndex] = strName.substring (0, nIndex);
     nArgIndex++;
    }
    else
    {
     aArgsN [nArgIndex] = strName;
     aArgsV [nArgIndex] = "";
     nArgIndex++;
    }
   }
   if (nArgIndex > 0)
   {
    for (nIndex=0; nIndex < nArgIndex; nIndex++)
    {
     elemHidden = document.createElement ("INPUT");
     elemHidden.type  = "hidden";
     elemHidden.name  = aArgsN [nIndex];
     elemHidden.value = aArgsV [nIndex];
     pForm.appendChild (elemHidden);
    }
   }
  }
  pForm.action = _strAction;
  pForm.target = _strTarget;
  document.body.appendChild (pForm);
  pForm.submit ();
  document.body.removeChild (pForm);
  pForm = null;
  return false;
 }
 var strOrigAction = pForm.action;
 var strOrigTarget = pForm.target;
 pForm.action = _strAction;
 pForm.target = _strTarget;
 pForm.submit ();
 pForm.action = strOrigAction;
 pForm.target = strOrigTarget;
 return false;
}

function ndsjs_doFocus (_window)
{
 var pForm = document.REQSTART;
 if (pForm != null)
 {
  var pHidden = pForm.FOCUSID;
  if (pHidden != null)
  {
   var id = pHidden.value;
   if (id != null)
   {
    var pObj = null;
    eval ("pObj = document.REQSTART." + id + ";");
    if (pObj != null)
    {
     pObj.focus ();
     return;
    }
   }
  }
 }
 _window.focus ();
}

function ndsjs_CheckBox (_nCode, _bReturn)
{
 if (_nCode == 1)
 {
  if (!_bReturn)
   alert ("Audience Estimates are available by contacting your monitoring service provider.");
  return _bReturn;
 }
 else if (_nCode == 2)
 {
  if (!_bReturn)
   alert ("Ad Equivalency Rates are available by contacting your monitoring service provider.");
  return _bReturn;
 }
 else if (_nCode == 3)
 {
  if (!_bReturn)
   alert ("Calculated Publicity Values are available by contacting your monitoring service provider.");
  return _bReturn;
 }
 else if (_nCode == 4)
 {
  if (!_bReturn)
   alert ("Calculated Ad Equivalency Values are available by contacting your monitoring service provider.");
  return _bReturn;
 }
 else
  return _bReturn;
} 

function ndsjsValidateInteger (_strValue, _nDigits, _nMinValue, _nMaxValue)
{
 var    nValue = 0;
 if (_strValue != null && _strValue != "")
   nValue = parseInt (_strValue, 10);
 if (nValue < _nMinValue)
   nValue = _nMinValue;
 if (nValue > _nMaxValue)
   nValue = _nMaxValue;
 return ndsjsDigits (nValue, _nDigits);  
}

function ndsjsToInteger (_strValue, _nDigits)
{
 var    nValue = 0;
 if (_strValue != null && _strValue != "")
   nValue = parseInt (_strValue, 10);
 return ndsjsDigits (nValue, _nDigits);  
}

function ndsjsDigits (_nValue, _nDigits)
{
 var    nFixer = Math.pow(10,_nDigits); 
 var    nValue = _nValue % nFixer;
 nValue += nFixer;
 var    szValue = nValue.toString();
 var    szReturn = szValue.substr (1);
 return szReturn;  
}

function ndsjsFormatHMSFromSeconds (_nSeconds)
{
 var nHr   = _nSeconds / 3600;
 nHr = Math.floor (nHr);
 _nSeconds = _nSeconds - (nHr * 3600);
 var nMi   = _nSeconds / 60;
 nMi = Math.floor (nMi);
 _nSeconds = _nSeconds - (nMi * 60);
 var strReturn = ndsjsDigits (nHr, 2);
 strReturn += ":";
 strReturn += ndsjsDigits (nMi, 2);
 strReturn += ":";
 strReturn += ndsjsDigits (_nSeconds, 2);
 return strReturn;  
}

function ndsjsSetFieldValue (_strId, _strValue)
{
 var pForm = document.forms [0];
 var pFld = ndsjsFindChildById (pForm, _strId);
 if (pFld != null)
  pFld.value = _strValue;
}

function client_data(info)
{
    if (info == 'js')
    {
        document.write ('<FONT COLOR="#008000">Enabled</FONT>');
    }
    else if (info == 'popup')
    {
        if (g_bPopUpsBlocked)
        {
            document.write ('<FONT COLOR="#800000"><B>Blocked</B></FONT>');
        }
        else
        {
            document.write ('<FONT COLOR="#008000">Allowed</FONT>');
        }
    }
    else if (info == 'cookies')
    {
        if ( Get_Cookie ('cookie_test') )
        {
            document.write ('<FONT COLOR="#008000">Enabled</FONT>');
        }
        else
        {
            document.write ('<FONT COLOR="#800000"><B>Disabled</B></FONT>');
        }
    }
    else if (info == 'time')
    {
        var nUsesDST = -1;
        var bISDST;
        var strTZText = "Unknown Timezone";
        var strDSTText;
        var nStdMonth = 0;
        var nDstMonth = 6;
        var bWinterIsStd = true;
        var strCountry = "";

        if (navigator && navigator.userLanguage)
        {
            if (navigator.userLanguage == "en-au")      // Australia
            {
                nStdMonth = 6;
                nDstMonth = 0;
                bWinterIsStd  = false;
                nUsesDST = 1;       // does use DST
                strCountry = "au";
            }
            else if (navigator.userLanguage == "en-nz") // New Zealand
            {
                nStdMonth = 6;
                nDstMonth = 0;
                bWinterIsStd  = false;
                nUsesDST = 1;       // does use DST
                strCountry = "nz";
            }
            else if (navigator.userLanguage == "en-za") // South Africa
            {
                nStdMonth = 0;
                nDstMonth = 0;
                bWinterIsStd  = false;
                nUsesDST = 0;       // does not use DST
                strCountry = "za";
            }
            else if (navigator.userLanguage == "hr")    // Hrvatska (Croatia)
            {
                nStdMonth = 0;
                nDstMonth = 6;
                bWinterIsStd  = true;
                nUsesDST = 1;       // does use DST
                strCountry = "hr";
            }
        }
             
        var dtCurrent = new Date ();
        var szTimeStr  = dtCurrent.toLocaleDateString ();
        szTimeStr += " ";
        szTimeStr += dtCurrent.toLocaleTimeString ();

        document.write ('<FONT COLOR="#000080"><nobr>' + szTimeStr + ' </nobr></FONT>');

        var dtStd     = new Date (dtCurrent.getFullYear(), nStdMonth, 1, 0, 0, 0, 0);
        var strStdGMT = dtStd.toGMTString();
        var dtStdGMT  = new Date (strStdGMT.substring (0, strStdGMT.lastIndexOf(" ")-1));

        var dtDst     = new Date (dtCurrent.getFullYear(), nDstMonth, 1, 0, 0, 0, 0);
        var strDstGMT = dtDst.toGMTString();
        var dtDstGMT  = new Date (strDstGMT.substring (0, strDstGMT.lastIndexOf(" ")-1));

        var nDiffStdTimeMins = (dtStd - dtStdGMT) / (1000 * 60);
        var nDiffDstTimeMins = (dtDst - dtDstGMT) / (1000 * 60);

        var nTZOffset = 0 - dtCurrent.getTimezoneOffset ();

// Kuala Lumpur, Singapore, Manila  +8:00
// Bangkok, Hanoi, Jakarta          +7:00

        if (nDiffDstTimeMins == nDiffStdTimeMins)
        {
            if (nUsesDST == -1) 
                nUsesDST = 0;
        }
        else
        {
            if (nUsesDST == -1) 
                nUsesDST = 1;
        }

        if (nUsesDST == 0)  // does not use DST
        { 
            bISDST   = false;
            strDSTText = "No DST";
            switch (nTZOffset)
            {
                case  480:
                    if (strCountry == "au")
                        strTZText = "Western Australia";
                    else
                        strTZText = "Malaysia, Philippines, Singapore, Western Australia";
                    break;
                case  420:  strTZText = "Indonesia, Thailand, Vietnam"; break;
                case  180:  strTZText = "Moscow Time"; break;
                case  120:  strTZText = "South Africa Time"; break;
                case    0:  strTZText = "London Time"; break;
                case -300:  strTZText = "Indiana (East)"; break;
                case -420:  strTZText = "Arizona"; break;
                case -600:  strTZText = "Hawaii"; break;    
                default:    strTZText = "Unknown Timezone (" + nTZOffset.toString () + " "+ nDiffStdTimeMins.toString () + ")"; break;
            }
        }
        else if (nUsesDST == 1) // does use DST
        {
            if (nTZOffset == nDiffStdTimeMins)
            { 
                bISDST   = false;
                strDSTText = "In Std";
                switch (nTZOffset)
                {
                    case  720: strTZText = "New Zealand"; break;    
                    case  600: strTZText = "Eastern Australia"; break;  
                    case  570: strTZText = "Central Australia"; break;  
                    case   60:
                        if (strCountry == "hr")
                            strTZText = "Hrvatska"; 
                        else
                            strTZText = "Central European Time";
                        break;  
                    case -240: strTZText = "Atlantic Time (Canada)"; break; 
                    case -300: strTZText = "Eastern Time (U.S. and Canada)"; break; 
                    case -360: strTZText = "Central Time (U.S. and Canada)"; break; 
                    case -420: strTZText = "Mountain Time (U.S. and Canada)"; break;    
                    case -480: strTZText = "Pacific Time (U.S. and Canada)"; break; 
                    case -540: strTZText = "Alaska"; break; 
                    default:   strTZText = "Unknown Timezone (" + nTZOffset.toString () + " "+ nDiffStdTimeMins.toString () + " "+ nDiffDstTimeMins.toString () + ")"; break;
                }
            }
            else if (nTZOffset == nDiffDstTimeMins)
            {
                bISDST   = true;
                strDSTText = "In DST";
                switch (nTZOffset)
                {
                    case  780: strTZText = "New Zealand"; break;    
                    case  660: strTZText = "Eastern Australia"; break;  
                    case  630: strTZText = "Central Australia"; break;  
                    case  120:
                        if (strCountry == "hr")
                            strTZText = "Hrvatska"; 
                        else
                            strTZText = "Central European Time";
                        break;  
                    case -180: strTZText = "Atlantic Time (Canada)"; break; 
                    case -240: strTZText = "Eastern Time (U.S. and Canada)"; break; 
                    case -300: strTZText = "Central Time (U.S. and Canada)"; break; 
                    case -360: strTZText = "Mountain Time (U.S. and Canada)"; break;    
                    case -420: strTZText = "Pacific Time (U.S. and Canada)"; break; 
                    case -480: strTZText = "Alaska"; break; 
                    default:   strTZText = "Unknown Timezone (" + nTZOffset.toString () + " "+ nDiffStdTimeMins.toString () + " "+ nDiffDstTimeMins.toString () + ")"; break;
                }
            }
            else
            {
                strDSTText = "Unknown DST";
                strTZText = "Unknown Timezone (" + nTZOffset.toString () + " "+ nDiffStdTimeMins.toString () + " "+ nDiffDstTimeMins.toString () + ")";
            }
        }
        szTimeStr = "<BR>&nbsp;" + strTZText + ", " + strDSTText;
        document.write ('<FONT COLOR="#000080"><nobr>' + szTimeStr + ' </nobr></FONT>');

        var pFld;
        pFld = document.forms [0] ["LoginClientDiffStd"];   if (pFld != null)   pFld.value = nDiffStdTimeMins;
        pFld = document.forms [0] ["LoginClientDiffDst"];   if (pFld != null)   pFld.value = nDiffDstTimeMins;
        pFld = document.forms [0] ["LoginClientTZOffset"];  if (pFld != null)   pFld.value = dtCurrent.getTimezoneOffset ();
        pFld = document.forms [0] ["LoginClientTZName"];    if (pFld != null)   pFld.value = strTZText;
    }
}

function setLoginClientUTC ()
{
 var pFld = document.forms [0] ["LoginClientUTC"];
 if (pFld != null)
 {
  pFld.value = makeTimestamp ();
 }
}

function makeTimestamp ()
{
 var dtCurrent = new Date ();
 var strDTUTC = dtCurrent.getUTCFullYear ();
 strDTUTC += ndsjsDigits ((dtCurrent.getUTCMonth () + 1), 2);
 strDTUTC += ndsjsDigits (dtCurrent.getUTCDate (), 2);
 strDTUTC += ndsjsDigits (dtCurrent.getUTCHours (), 2);
 strDTUTC += ndsjsDigits (dtCurrent.getUTCMinutes (), 2);
 strDTUTC += ndsjsDigits (dtCurrent.getUTCSeconds (), 2);
 strDTUTC += ndsjsDigits (dtCurrent.getMilliseconds (), 3);
 return strDTUTC;
}

function ndsjsSecondsToLength (_nSec, _bAddS)
{
 var strLength = "";
 var nValue;
 if (_nSec > 59)
 {
  nValue = Math.floor (_nSec / 60);
  _nSec -= (nValue * 60);
  strLength += nValue.toString() + " minute";
  if (nValue != 1 && _bAddS)
   strLength += "s";
  if (_nSec > 0)
   strLength += " and ";
 }
 if (_nSec > 0)
 {
  strLength += _nSec.toString () + " second";
  if (_nSec != 1 && _bAddS)
   strLength += "s";
 }
 return strLength;
}

function ndsjsSecondsToHMS (_nSec)
{
 var	strPlusMinus = "";
 if (_nSec < 0)
 {
 	strPlusMinus = "-";
 	_nSec = 0 - _nSec;
 }
 var nHours =  Math.floor (_nSec / 3600);
 _nSec = _nSec - (nHours * 3600);
 var nMinutes =  Math.floor (_nSec / 60);
 _nSec = _nSec - (nMinutes * 60);
 return strPlusMinus + 
  ndsjsDigits (nHours, 2) + ":" +
  ndsjsDigits (nMinutes, 2) + ":" +
  ndsjsDigits (_nSec, 2);
}

function ndsjsFindSelectedCheckbox (_obj, _strIdPrefix, _nPrefixLength, _nLevel)
{
 if (_nLevel == 1)
  ndsjsSetCursor ("wait");

 var children = _obj.childNodes;
 for (var x=0; x<children.length; x++)
 {
  var child = children [x];
  var idChild = child.id;
  if (idChild != null)
  {
   if (idChild.length > _nPrefixLength)
   {
    if (idChild.substr (0, _nPrefixLength) == _strIdPrefix)
    {
     var bChecked = child.checked;
//if (g_bContinueToShow)
// g_bContinueToShow = confirm(idChild + ":" + bChecked + "\nContinue to show this info?\nOK=Yes Cancel=No");
     if (bChecked)
     {
      if (_nLevel == 1)
       ndsjsSetCursor ("default");
//alert ("A:" + _nLevel + ":" + idChild + ":true");
      return true;
     }
    }
   }
  }
  var nNextLevel = _nLevel + 1;
  var bRC = ndsjsFindSelectedCheckbox (child, _strIdPrefix, _nPrefixLength, nNextLevel);
  if (bRC)
  {
   if (_nLevel == 1)
    ndsjsSetCursor ("default");
//alert ("B:" + _nLevel + ":" + bRC);
   return bRC;
  }
 }
 if (_nLevel == 1)
 {
  ndsjsSetCursor ("default");
  alert ("At least one story must be selected for the order.");
 }
//alert ("C:" + _nLevel + ":" + false);
 return false;
}

// ---------------- code for getting HTML in XML data to display properly in browser ------------ start ----------
var g_bIsDecodingXMLHTML = false; 
var g_bIsDebuggingXMLHTML = 0;
 
function jsXMLHTMLComplain (s) 
{ 
//20060919  alert(s); 
  return s; 
}
 
//20060919if(!( document.getElementById && document.getElementsByName)) 
//20060919  throw jsXMLHTMLComplain("Your browser is too old to render this page properly." + " Consider going to getfirefox.com to upgrade.");

function jsXMLHTMLCheckDecoding () 
{ 
  var d = document.getElementById('divXMLHTMLTestDecode'); 
  if(!d) 
  { 
    throw jsXMLHTMLComplain("Can't find an id='divXMLHTMLTestDecode' element?"); 
  } 
  else if(!('textContent' in d)) 
  { 
    //throw jsXMLHTMLComplain("This browser doesn't implement textContent");
    // It's a browser with a halfassed DOM implementation (like IE6) 
    // that doesn't implement textContent! Assume that if it's that 
    // dumb, it probably doesn't implement disable-content-encoding. 
  } 
  else 
  { 
    var ampy = d.textContent; 
    if(g_bIsDebuggingXMLHTML > 1) 
    { 
      alert ("Got " + ampy); 
    } 
    if(ampy == undefined) 
      throw jsXMLHTMLComplain("'divXMLHTMLTestDecode' element has undefined text content?!"); 
    if(ampy == '') 
      throw jsXMLHTMLComplain("'divXMLHTMLTestDecode' element has empty text content?!" ); 
    if (ampy == "\x26") 
    { 
      g_bIsDecodingXMLHTML = true; 
    } 
    else if (ampy == "\x26amp;" ) 
    { 
      g_bIsDecodingXMLHTML = false; 
    } 
    else 
    { 
      throw jsXMLHTMLComplain('Insane value: "' + ampy + '"!'); 
    } 
  } 
  var msg = (g_bIsDecodingXMLHTML == undefined)
    ? "I can't tell whether the XSL processor supports disable-content-encoding!D"
    : g_bIsDecodingXMLHTML
      ? "The XSL processor DOES support disable-content-encoding"
      : "The XSL processor does NOT support disable-content-encoding"; 
  if (g_bIsDebuggingXMLHTML) 
    alert(msg); 
  return msg; 
} 
function jsXMLHTMLDoDecoding () 
{ 
  jsXMLHTMLCheckDecoding(); 
  if(g_bIsDecodingXMLHTML) 
  { 
    g_bIsDebuggingXMLHTML && alert("No work needs doing -- already decoded!"); 
    return; 
  } 
  var to_decode = document.getElementsByName('DecodeWithXMLHTML'); 
  if(!( to_decode && to_decode.length )) 
  { 
    g_bIsDebuggingXMLHTML && alert("No work needs doing -- no elements to decode!"); 
    return; 
  } 
  var s; 
  for(var i = to_decode.length - 1; i >= 0; i--) 
  { 
    s = to_decode[i].textContent; 
    if ( s == undefined || (s.indexOf('&') == -1 && s.indexOf('<') == -1) ) 
    { 
      // the null or markupless element needs no reworking 
    } 
    else 
    { 
      to_decode[i].innerHTML = s; // that's the magic
    } 
  } 
  return; 
} 
// ---------------- code for getting HTML in XML data to display properly in browser ------------ end ----------


function ndsjsToggleRequested()
{
 var bDoCheck = true;
 var elemBtn = document.getElementById ("btnToggleRequested");
 if (elemBtn && elemBtn.value)
 {
  if (elemBtn.value.substring(0,4) == "Mark")
  {
   elemBtn.value = "Clear All 'Request Story'";
  }
  else
  {
   elemBtn.value = "Mark All 'Request Story'";
   bDoCheck = false;
  }
 }
 var elemDiv = document.getElementById ("divCheckboxes");
 ndsjsGetChecked (elemDiv, "SEL", 3, bDoCheck);
}
function ndsjsToggleDelete()
{
 var bDoCheck = true;
 var elemBtn = document.getElementById ("btnToggleDelete");
 if (elemBtn && elemBtn.value)
 {
  if (elemBtn.value.substring(0,4) == "Mark")
  {
   elemBtn.value = "Clear All 'Delete Story'";
  }
  else
  {
   elemBtn.value = "Mark All 'Delete Story'";
   bDoCheck = false;
  }
 }
 var elemDiv = document.getElementById ("divCheckboxes");
 ndsjsGetChecked (elemDiv, "DEL", 3, bDoCheck);
}
function ndsjsGetChecked (_elem, _strPrefix, _nPrefixLength, _bDoCheck)
{
 if (_elem == null)
  return;
 var children = _elem.childNodes;
 for (var x=0; x<children.length; x++)
 {
  var child = children [x];
  if (child.type && (child.type == "checkbox"))
  {
   if (child.id && child.id.substring (0, _nPrefixLength) == _strPrefix)
    child.checked = _bDoCheck;
  }
  else if (child.childNodes != null && child.childNodes.length > 0)
   ndsjsGetChecked (child, _strPrefix, _nPrefixLength, _bDoCheck);
 }
}

function ndsjsGetRadioSelected (_elem)
{
 var obj;
 var children = _elem.childNodes;
 for (var x=0; x<children.length; x++)
 {
  var child = children [x];
  if (child.id != null)
  {
   if (child.type == "radio" && child.checked)
     return child;
  }
  if (child.childNodes != null && child.childNodes.length > 0)
  {
   obj = ndsjsGetRadioSelected (child);
   if (obj != null)
    return obj;
  }
 }
 return null;
}

function ndsjsVerifyAcknowledgeCheckbox(_strCBName, _strCBMsg)
{
 var cbElem = document.getElementById (_strCBName);
 if (cbElem == null)
  return true;
 if (cbElem.checked)
  return true;
 else
 {
  var strMsg = "The box for " + _strCBMsg + " must be checked in order to continue.";
  alert (strMsg);
  return false;
 }
}

function ndsjsReturnToReferrer(_strURL, _strMsg)
{
 if (_strMsg != null && _strMsg != "")
  alert (_strMsg);
 //if in new window, window.close (); 
 location.replace (_strURL);
}

function ndsjsOnClickSearchTypeProspecting (_strControlId)
{
 var elemSelect = document.getElementById (_strControlId);
 if (elemSelect == null)
  return;
 if (elemSelect.checked) // selected
 {
  var strMsg = "If you save this Stored Keyword Search\nwith Search Type=Prospecting selected,\n\n";
  strMsg += "  Search Result Destination will be set to 'NDS',\n\n";
  strMsg += "  Preview Option will be set to 'No Preview',\n\n";
  strMsg += "  non-prospecting email addresses will be removed\n    from Report Distribution.";
  alert (strMsg);
 }
}

function ndsjsReportSetFocus (_strId, _strId2)
{
 var elem = document.getElementById (_strId);
 if (elem == null)
 {
  if (_strId2 == null)
   return false;
  elem = document.getElementById (_strId2);
  if (elem == null)
   return false;
 }
 elem.scrollIntoView (true);
 return false;
}

//remove use of default sql/description

var g_ndsjsTextListAbstractSortOrder = null;

function ndsjsInitAbstractSortOrderList (_strForm, _strText, _strElemId, _nSecondsOn, _strClassOn, _strClassOff)
{
//build array of possible fields with sql and desciption text.
 var list = new ndsjsTextList ('AbstractSortOrder');
 list.addEntry ("Date",         "BroadcastDate",        true,   0);
 list.addEntry ("Time",         "BroadcastTime",        true,   0);
 list.addEntry ("Market Name",  "MarketName",           false,  0);
 list.addEntry ("Market Rank",  "MarketRank",           true,   0); 
 list.addEntry ("Source",       "ReportSource",         false,  0);
 list.addEntry ("Text Type",    "TextType",             false,  0);
 list.addEntry ("Source Type",  "SourceTypeSort",       false,  0);
 list.addEntry ("Website Type", "WebsiteTypeSort",      false,  0);

 list.m_strTextSuffix = ", StorySortValue, RecordId";

 g_ndsjsTextListAbstractSortOrder = list;

//scan text to get list and split into selected and available.
 var pForm;
 var pFormField;
 var strFieldValue;
 var strEval;
 var strTextList;
 var elemText = null;

 strEval = 'pForm=document.'+_strForm+';'
 eval (strEval);
 if (pForm != null)
 {
  strEval = 'pFormField=pForm.SORT_DESC;'
  eval (strEval);
  if (pFormField != null)
  {
   strEval = 'strTextList=pFormField.value';
   eval (strEval);
   list.m_elemFormDisplay = pFormField;
  }
  strEval = 'pFormField=pForm.SORT_SQL;'
  eval (strEval);
  if (pFormField != null)
  {
   list.m_elemFormData = pFormField;
  }
 }

 if (strTextList == null || strTextList == "")
  strTextList = "Date(Desc),Market Rank,Market Name,Source,Time(Desc),Text Type,Source Type,Website Type";
 if (_strText != null)
  strTextList = _strText;
 list.parseTextList (strTextList);

//display description text
 elemText = list.makeSelectedDisplay (null, null, null, null);

 if (_strText != null)
 {
  var strSelectedText = list.makeSelectedText (null, null, null, null);

  // build output data
  if (list.m_elemFormData != null)
  {
   list.m_elemFormData.value = list.m_strPlacePrefix + strSelectedText;
  }
  if (list.m_elemFormDisplay != null)
  {
   list.m_elemFormDisplay.value = _strText; // imxjsGetElementText (elemText);
  }
  ndsjsTextHighlightOn (_strElemId, _nSecondsOn, _strClassOn, _strClassOff);
  if (elemText != null)
   ndsjsTextHighlightOn (elemText.id, _nSecondsOn, 'HeaderDataOn', 'HeaderData');
 }
}

var g_ndsjsTextListAbstractSourceType = null;

function ndsjsInitAbstractSourceTypeList (_strForm)
{
//build array of possible fields with sql and desciption text.
 var list = new ndsjsTextList ('AbstractSourceType');
 list.addEntry ("Radio",      "Radio",      false, 1);
 list.addEntry ("Television", "Television", false, 2);
 list.addEntry ("Website",    "Website",    false, 3);

 g_ndsjsTextListAbstractSourceType = list;
 list.m_strPlacePrefix = " --SourceType*";

//scan text to get list and split into selected and available.
 var pForm;
 var pFormField;
 var strFieldValue;
 var strEval;
 var strTextList;

 strEval = 'pForm=document.'+_strForm+';'
 eval (strEval);
 if (pForm != null)
 {
  strEval = 'pFormField=pForm.SourceTypeSort_DESC;'
  eval (strEval);
  if (pFormField != null)
  {
   list.m_elemFormDisplay = pFormField;
  }
  strEval = 'pFormField=pForm.SourceTypeSort_SQL;'
  eval (strEval);
  if (pFormField != null)
  {
   strTextList=pFormField.value;
   list.m_elemFormData = pFormField;
  }
 }

 if (strTextList == null || strTextList == "")
  strTextList = "010101";
 else
 {
  if (strTextList.substring (0, list.m_strPlacePrefix.length) == list.m_strPlacePrefix)
   strTextList = strTextList.substring (list.m_strPlacePrefix.length);
 }
 list.parseTextList (strTextList);

//display description text
 list.makeSelectedDisplay (null, null, null, null);
}

var g_ndsjsTextListAbstractWebsiteType = null;

function ndsjsInitAbstractWebsiteTypeList (_strForm)
{
//build array of possible fields with sql and desciption text.
 var list = new ndsjsTextList ('AbstractWebsiteType');
 list.addEntry ("Magazine",     "Magazine",     false, 1);
 list.addEntry ("Newspaper",    "Newspaper",    false, 2);
 list.addEntry ("Online Only",  "Online Only",  false, 3);
 list.addEntry ("Radio",        "Radio",        false, 4);
 list.addEntry ("Television",   "Television",   false, 5);
 list.addEntry ("Aggregator",   "Aggregator",   false, 6);
 list.addEntry ("Blogs Only",   "Blogs Only",   false, 7);

 g_ndsjsTextListAbstractWebsiteType = list;
 list.m_strPlacePrefix = " --WebsiteType*";

//scan text to get list and split into selected and available.
 var pForm;
 var pFormField;
 var strFieldValue;
 var strEval;
 var strTextList;

 strEval = 'pForm=document.'+_strForm+';'
 eval (strEval);
 if (pForm != null)
 {
  strEval = 'pFormField=pForm.WebsiteTypeSort_DESC;'
  eval (strEval);
  if (pFormField != null)
  {
   list.m_elemFormDisplay = pFormField;
  }
  strEval = 'pFormField=pForm.WebsiteTypeSort_SQL;'
  eval (strEval);
  if (pFormField != null)
  {
   strTextList=pFormField.value;
   list.m_elemFormData = pFormField;
  }
 }

 if (strTextList == null || strTextList == "")
  strTextList = "01010101010101";
 else
 {
  if (strTextList.substring (0, list.m_strPlacePrefix.length) == list.m_strPlacePrefix)
   strTextList = strTextList.substring (list.m_strPlacePrefix.length);
 }
 list.parseTextList (strTextList);

//display description text
 list.makeSelectedDisplay (null, null, null, null);
}

function ndsjsTextList (_strType)
{
 this.m_aTextList = new Array ();
 this.m_nListCount = 0;
 this.m_elemSelected = null;
 this.m_elemGrouped = null;
 this.m_elemAvailable = null;
 this.m_strType = _strType;
 this.m_elemFormDisplay = null;
 this.m_elemFormData = null;
 this.m_strOpenOutputOptionType = "";
 this.m_nMaxPlace = 0;
 this.m_strPlacePrefix = "";
 this.m_strGroupedNo = ".";
 this.m_strGroupedYes= "+";

 this.m_strDisplayPrefix = "";
 this.m_strDisplaySuffix = "";
 this.m_strTextPrefix = "";
 this.m_strTextSuffix = "";
}

function ndsjsTextListEntry (_nId, _strDisplay, _strSQL, _nPlace)
{
 this.m_nId         = _nId;
 this.m_strDisplay  = _strDisplay;
 this.m_strSQL      = _strSQL;
 this.m_nPlace      = _nPlace;
}

ndsjsTextList.prototype.addEntry = function (_strDisplay, _strSQL, _bCanHaveDescending, _nPlace)
{
 var strDisplay = _strDisplay;
 var strSQL = _strSQL;
 var entry = new ndsjsTextListEntry (this.m_nListCount, strDisplay, strSQL, _nPlace);
 this.m_aTextList [this.m_nListCount] = entry;
 this.m_nListCount++;
 if (_nPlace > 0)
 {
  if (_nPlace > this.m_nMaxPlace)
   this.m_nMaxPlace = _nPlace;
  return;
 }
 if (!_bCanHaveDescending)
  return;
 strDisplay += "(Desc)";
 strSQL += " DESC";
 entry = new ndsjsTextListEntry (this.m_nListCount, strDisplay, strSQL, _nPlace);
 this.m_aTextList [this.m_nListCount] = entry;
 this.m_nListCount++;
}

ndsjsTextList.prototype.removeAllChildren = function (_list)
{
 var elemChild = _list.lastChild
 while (elemChild != null)
 {
   _list.removeChild (elemChild);
   elemChild = _list.lastChild;
 }
}

ndsjsTextList.prototype.parseTextList = function (_strDescription)
{
 // "Date(Desc), Market Rank, Market Name, Source, Time(Desc), Text Type, Source Type, Website Type";
 var i;
 var entry;
 var elem;
 var strValue;
 var nIndex;
 var elemList;
 var elemGrouped = null;
 var strListCode = "S";

 var strText = ndsjsUnescape (_strDescription);

 strValue = "div" + this.m_strType + "Selected";
 elemList = document.getElementById (strValue);
 this.m_elemSelected = elemList;
 this.removeAllChildren (elemList);

 if (this.m_nMaxPlace > 0)
 {
  strValue = "div" + this.m_strType + "Grouped";
  elemGrouped = document.getElementById (strValue);
  this.m_elemGrouped = elemGrouped;
  imxjsClearElementText (elemGrouped);
  return this.parsePlaceList (strText);
 }

//<INPUT TYPE=HIDDEN NAME="SORT_SQL" VALUE="SourceTypeSort,%20WebsiteTypeSort,%20BroadcastDate%20DESC,%20MarketRank,%20MarketName,%20ReportSource,%20Source,%20BroadcastTime,%20TextType,%20StorySortValue,%20RecordId%20--SourceType*010102%20--WebsiteType*02020301010405">
//<INPUT TYPE=HIDDEN NAME="SORT_DESC" VALUE="Source%20Type,%20Website%20Type,%20Date(Desc),%20Market%20Rank,%20Market%20Name,%20Source,%20Time,%20Text%20Type">

//<INPUT TYPE=HIDDEN NAME="SourceTypeSort_SQL" VALUE="%20--SourceType*010102">
//<INPUT TYPE=HIDDEN NAME="SourceTypeSort_DESC" VALUE="Radio,%20TV,%20Website">
//<INPUT TYPE=HIDDEN NAME="WebsiteTypeSort_SQL" VALUE="%20--WebsiteType*0102030405060708">
//<INPUT TYPE=HIDDEN NAME="WebsiteTypeSort_DESC" VALUE="Newspaper,%20Television">

 while (strText != "")
 {
  nIndex = strText.indexOf (',');
  if (nIndex < 0)
  {
   strValue = strText;
   strText = "";
  }
  else
  {
   strValue = strText.substring (0, nIndex);
   strText  = strText.substring (nIndex+1);
  }
  strValue = imxjsTrim (strValue);
  strText  = imxjsTrim (strText);

  // find text in list
  for (i=0; i<this.m_nListCount; i++)
  {
   entry = this.m_aTextList [i];
   if (entry != null && strValue == entry.m_strDisplay)
   {
    this.m_aTextList [i] = null;
    this.createEntry (elemList, entry, strListCode);
    break;
   }
  }
 }  
 // build remaining entries in available list
 strValue = "div" + this.m_strType + "Available";
 elemList = document.getElementById (strValue);
 this.m_elemAvailable = elemList;
 this.removeAllChildren (elemList);
 strListCode = "A";

 for (i=0; i<this.m_nListCount; i++)
 {
  entry = this.m_aTextList [i];
  if (entry != null)
  {
   this.m_aTextList [i] = null;
   this.createEntry (elemList, entry, strListCode);
  }
 }
}

ndsjsTextList.prototype.parsePlaceList = function (_strText)
{
 var i;
 var entry;
 var elem;
 var strKey;
 var strValue;
 var nIndex;
 var nValue;
 var elemList;
 var strListCode = "S";
 var nPlace = 1;
 var nPlacePrevious = 0;

 //this.m_elemSelected = elemList;
 //this.m_elemGrouped = elemGrouped;

 for (nPlace=1; nPlace <= this.m_nMaxPlace; nPlace++)
 {
  strKey = ndsjsDigits (nPlace, 2);
  for (i=0; i<this.m_nMaxPlace; i++)
  {
   nValue = i * 2; 
   strValue = _strText.substring (nValue, nValue+2);
   if (strValue == strKey)
   {
    _strText [nValue] = '0';
    _strText [nValue+1] = '0';
    entry = this.m_aTextList [i]; // assumes entries are in place sequence
    if (entry != null)
    {
     this.m_aTextList [i] = null;
     this.createEntry (this.m_elemSelected, entry, strListCode);
     if (nPlacePrevious == nPlace)
      this.createGroupedEntry (entry, this.m_strGroupedYes);
     else
      this.createGroupedEntry (entry, this.m_strGroupedNo);
     nPlacePrevious = nPlace;
    }
   }
  }
 }

 // build remaining entries in selected list
 for (i=0; i<this.m_nListCount; i++)
 {
  entry = this.m_aTextList [i];
  if (entry != null)
  {
   this.m_aTextList [i] = null;
   this.createEntry (this.m_elemSelected, entry, strListCode);
   this.createGroupedEntry (entry, this.m_strGroupedNo);
  }
 }
}

ndsjsTextList.prototype.createEntry = function (_list, _entry, _strListCode)
{
 var elem;

 elem = document.createElement ("div");
 imxjsSetElementValue (elem, "class", "ListData");
 elem.style.width      = "130px";
 elem.style.whiteSpace = "normal";
 elem.style.overflow   = "visible";
 elem.style.position   = "relative";
 elem.style.cursor     = "pointer";
 imxjsSetElementValue (elem, "id", this.m_strType + "_" + _entry.m_nId.toString());
 imxjsSetElementValue (elem, "onclick", "ndsjsOnClickTextListCurrent('" + this.m_strType + "','" + _strListCode + "','" + _entry.m_nId.toString() + "')");
 imxjsSetElementValue (elem, "text", _entry.m_strSQL);
 imxjsSetElementValue (elem, "elemid", _entry.m_nId.toString());
 imxjsSetElementValue (elem, "place",  _entry.m_nPlace.toString());
 imxjsSetElementText  (elem, _entry.m_strDisplay);
 _list.appendChild (elem);

 elem = document.createElement ("br");
 _list.appendChild (elem);
}

ndsjsTextList.prototype.createGroupedEntry = function (_entry, _strValue)
{
 var elem;

 if (this.m_nMaxPlace < 1)
  return;
 elem = document.createElement ("div");
 imxjsSetElementValue (elem, "class", "ListData");
 elem.style.width      = "10px";
 elem.style.whiteSpace = "normal";
 elem.style.overflow   = "visible";
 elem.style.position   = "relative";
 elem.style.cursor     = "pointer";
 imxjsSetElementValue (elem, "id", this.m_strType + "_" + _entry.m_nId.toString() + "_G");
 imxjsSetElementValue (elem, "onclick", "ndsjsOnClickTextListGrouped('" + this.m_strType + "','" + _entry.m_nId.toString() + "')");
 imxjsSetElementText  (elem, _strValue);
 this.m_elemGrouped.appendChild (elem);

 elem = document.createElement ("br");
 this.m_elemGrouped.appendChild (elem);
}

function ndsjsOnClickToggleTextList (_strTypeOption, _strType, _strList) 
{
 var list;
 var strEval = "list = g_ndsjsTextList" + _strTypeOption + _strType;
 eval (strEval);
 return list.toggleTextList ("", _strList);
}

function ndsjsOnClickTextListAction (_strTypeOption, _strAction)
{
 var list;
 var strEval = "list = g_ndsjsTextList" + _strTypeOption;
 eval (strEval);
 return list.doAction (_strAction);
}

function ndsjsOnClickTextListCurrent (_strTypeOption, _strType, _strId)
{
 var list;
 var strEval = "list = g_ndsjsTextList" + _strTypeOption;
 eval (strEval);
 return list.textListCurrent (_strType, _strId);
}

function ndsjsOnClickTextListGrouped (_strTypeOption, _strId)
{
 var elem;
 var strText;

 elem = document.getElementById (_strTypeOption + "_" + _strId + "_G");
 if (elem == null)
  return;
 strText = imxjsGetElementText  (elem);
 if (strText == ".")
  strText = "+";
 else
  strText = ".";
 imxjsSetElementText (elem, strText);
}

ndsjsTextList.prototype.makeElementId = function (_strPrefix, _strSuffix)
{
 return _strPrefix + this.m_strType + _strSuffix;
}

ndsjsTextList.prototype.doAction = function (_strAction)
{
// S=move from available to selected
// A=move from selected to available
// U=move selected up
// D=move selected down
 var strId;
 var elem;
 var elem2;

 if (this.m_elemTextListSelected == null)
 {
  this.m_elemTextListSelected = document.getElementById (this.makeElementId("div","Selected"));
  this.m_elemTextListAvailable= document.getElementById (this.makeElementId("div","Available"));
 }
 if (_strAction == "S")
 {
  if (this.m_strTextListCurrentType == "A")
  {
   // move from available to selected
   this.textListMove (this.m_elemTextListCurrent, this.m_elemTextListAvailable, this.m_elemTextListSelected);
   this.m_strTextListCurrentType = "S";
   strId = this.m_elemTextListCurrent.getAttributeNode ("elemid").value;
   imxjsSetElementValue (this.m_elemTextListCurrent, "onclick", "ndsjsOnClickTextListCurrent('" + this.m_strType + "','" + this.m_strTextListCurrentType + "','" + strId + "')");

   // create Grouped element
   this.createGroupedEntry (strId, this.m_strGroupedNo);
  }
  else
  {
   alert ("Choose a field from the 'Available fields' list first.");
  } 
 }
 else if (_strAction == "A")
 {
  if (this.m_strTextListCurrentType == "S")
  {
   // move selected to available
   this.textListMove (this.m_elemTextListCurrent, this.m_elemTextListSelected, this.m_elemTextListAvailable);
   this.m_strTextListCurrentType = "A";
   strId = this.m_elemTextListCurrent.getAttributeNode ("elemid").value;
   imxjsSetElementValue (this.m_elemTextListCurrent, "onclick", "ndsjsOnClickTextListCurrent('" + this.m_strType + "','" + this.m_strTextListCurrentType + "','" + strId + "')");

   // delete Grouped element
   if (this.m_nMaxPlace > 0)
   {
    elem = document.getElementById (this.m_strType + "_" + strId + "_G");
    if (elem != null)
    {
     elem2 = elem.nextSibling;
     if (elem2 != null)
      this.m_elemGrouped.removeChild (elem2);
     this.m_elemGrouped.removeChild (elem);
    }
   }
  }
  else
  {
   alert ("Choose a field from the 'Sort by' list first.");
  } 
 }
 else if (_strAction == "U")
 {
  if (this.m_strTextListCurrentType == "S")
  {
   // move selected up
   this.textListSlide (this.m_elemTextListCurrent, this.m_elemTextListSelected, _strAction);
   // move related Grouped item up
   if (this.m_nMaxPlace > 0)
   {
    strId = this.m_elemTextListCurrent.id + "_G";
    elem = document.getElementById (strId);
    if (elem != null)
    {
     this.textListSlide (elem, this.m_elemGrouped, _strAction);
     // if top grouped has +, set to empty
     if (elem.previousSibling == null)
     {
      imxjsSetElementText (this.m_strGroupedNo);
     }
    }
   }
  }
  else
  {
   alert ("Choose a field from the 'Sort by' list first.");
  } 
 }
 else if (_strAction == "D")
 {
  if (this.m_strTextListCurrentType == "S")
  {
   // move selected down
   this.textListSlide (this.m_elemTextListCurrent, this.m_elemTextListSelected, 'D');
   // move related Grouped item down
   if (this.m_nMaxPlace > 0)
   {
    strId = this.m_elemTextListCurrent.id + "_G";
    elem = document.getElementById (strId);
    if (elem != null)
     this.textListSlide (elem, this.m_elemGrouped, _strAction);
   }
  }
  else
  {
   alert ("Choose a field from the 'Sort by' list first.");
  } 
 }
}

ndsjsTextList.prototype.textListCurrent = function (_strType, _strId)
{
 // unselect any other selected/available field
 if (this.m_elemTextListCurrent != null)
 {
  imxjsMakeUnselectedClassName (this.m_elemTextListCurrent);
  this.m_elemTextListCurrent = null;
  this.m_strTextListCurrentType = "";
 }
 // select clicked field id=SortOrder_id
 var strId = "_" + _strId;
 this.m_elemTextListCurrent = document.getElementById (this.makeElementId("",strId));
 imxjsMakeSelectedClassName (this.m_elemTextListCurrent);
 this.m_strTextListCurrentType = _strType;
}
ndsjsTextList.prototype.textListFindElemBR = function (_elem)
{
 var elemBR = _elem.nextSibling;
 if (elemBR != null && elemBR.tagName != "BR")
  elemBR = null;
 return elemBR;
}
ndsjsTextList.prototype.textListFindNext = function (_elem, _strTagName)
{
 if (_strTagName == null)
  _strTagName = _elem.tagName;
 var elemNext = _elem.nextSibling;
 if (elemNext == null)
  return null;
 if (elemNext.tagName == _strTagName)
  return elemNext;
 if (elemNext.tagName != "BR")  // if not our tag and not BR
  return null;                  // don't look back any further
 return this.textListFindNext (elemNext, _strTagName);
}
ndsjsTextList.prototype.textListFindPrevious = function (_elem, _strTagName)
{
 if (_strTagName == null)
  _strTagName = _elem.tagName;
 var elemPrev = _elem.previousSibling;
 if (elemPrev == null)
  return null;
 if (elemPrev.tagName == _strTagName)
  return elemPrev;
 if (elemPrev.tagName != "BR")  // if not our tag and not BR
  return null;                  // don't look back any further
 return this.textListFindPrevious (elemPrev, _strTagName);
}
ndsjsTextList.prototype.textListMove = function (_elem, _elemFrom, _elemTo)
{
 var elemBR = _elem.nextSibling;
 if (elemBR != null && elemBR.tagName != "BR")
  elemBR = null;
 _elemFrom.removeChild (_elem);
 _elemTo.appendChild (_elem);
 if (elemBR != null)
 {
  _elemFrom.removeChild (elemBR);
  _elemTo.appendChild (elemBR);
 }
}
ndsjsTextList.prototype.textListSlide = function(_elem, _elemList, _strDirection)
{
 var elemTarget = null;
 var elemBR = _elem.nextSibling;
 if (elemBR != null && elemBR.tagName != "BR")
  elemBR = null;

 if (_strDirection == "U")  // move up
 {
  elemTarget = this.textListFindPrevious (_elem, null);
 }
 else                       // move down
 {
  elemTarget = this.textListFindNext (_elem, null);
  if (elemTarget == null)
   return;
  elemTarget = this.textListFindNext (elemTarget, null);
  if (elemTarget == null) // if moving next-to-last element down, there is no element for insertBefore, so use appendChild
  {
   _elemList.removeChild (_elem);
   _elemList.appendChild (_elem);
   if (elemBR != null)
   {
    _elemList.removeChild (elemBR);
    _elemList.appendChild (elemBR);
   }
   return;
  }
 }
 if (elemTarget != null)
 {
  _elemList.removeChild (_elem);
  _elemList.insertBefore (_elem, elemTarget);
  if (elemBR != null)
  {
   _elemList.removeChild (elemBR);
   _elemList.insertBefore (elemBR, elemTarget);
  }
 }
}

ndsjsTextList.prototype.toggleTextList = function(_strType, _strListType)
{
 var strMsg;
 var elemText = document.getElementById (this.makeElementId("txt",_strType));
 if (elemText == null)
 {
  alert (this.makeElementId("txt",_strType)+" not found.");
  return;
 }
 var elemList = document.getElementById (this.makeElementId("div",_strType));
 if (elemList == null)
 {
  alert (this.makeElementId("div",_strType)+" not found.");
  return;
 }
 var elemIcon = document.getElementById (this.makeElementId("icon",_strType));
 if (elemIcon == null)
 {
  alert (this.makeElementId("icon",_strType)+" not found.");
  return;
 }
 imxjsClearComputedStyle ();
 var strValue = imxjsGetStyleProperty (elemText, "display", "display");
 if (strValue == "none")    // text=hidden, list=visible --> get text and make visible
 {
  this.makeSelectedDisplay (elemList, elemText, null, _strListType);
  var strSelectedText = this.makeSelectedText (elemList, elemText, null, _strListType);
  elemList.style.display = "none";
  elemText.style.display = "inline";
  imxjsMakeUnselectedClassName (elemIcon);
  this.m_strOpenOutputOptionType = "";
  this.m_strOpenOutputOptionListType = "";

  // build output data
  if (this.m_elemFormData != null)
  {
   this.m_elemFormData.value = this.m_strPlacePrefix + strSelectedText;
  }
  if (this.m_elemFormDisplay != null)
  {
   this.m_elemFormDisplay.value = imxjsGetElementText (elemText);
  }
 }
 else                       // text visible, list hidden --> make list visible
 {
  if (this.m_strOpenOutputOptionType != "")
  {
   strMsg = "Close " + this.m_strOpenOutputOptionType + " window before trying to open this window.";
   alert (strMsg);
   return; 
  }
  if (this.m_subclass)
   this.m_subclass.closeCurrent ();
  elemText.style.display = "none";
  elemList.style.display = "inline";
  imxjsMakeSelectedClassName (elemIcon);
  this.m_strOpenOutputOptionType = _strType;
  this.m_strOpenOutputOptionListType = _strListType;
 }
}

ndsjsTextList.prototype.makeSelectedDisplay = function (_elemList, _elemText, _strType, _strListType)
{
 if (_elemList == null)
 {
  _elemList = document.getElementById (this.makeElementId("div",""));
  if (_elemList == null)
  {
   return null;
  }
 }
 if (_elemText == null)
 {
  _elemText = document.getElementById (this.makeElementId("txt",""));
  if (_elemText == null)
  {
   return null;
  }
 }
 var strValue = "";
 var elemStart;
 var nvParams = new imxjsNVList ();

 elemStart = document.getElementById (this.makeElementId("div","Selected"));
 var strIdPrefix = this.m_strType + "_";
 var nIdPrefixLength = strIdPrefix.length;
 this.getTextListSelected (elemStart, nvParams, strIdPrefix, nIdPrefixLength, 0, true, false, 0);
 if (this.m_nMaxPlace > 0)
  strValue = this.makeGroupedDisplay (nvParams, false);
 else
  strValue = nvParams.makeVString (false);
 nvParams = null;
 if (strValue == null || strValue == "")
  strValue = "None specified.";
 else
  strValue = this.m_strDisplayPrefix + strValue + this.m_strDisplaySuffix;
 imxjsSetElementText (_elemText, strValue);
 return _elemText;
}

ndsjsTextList.prototype.makeSelectedText = function (_elemList, _elemText, _strType, _strListType)
{
 if (_elemList == null)
 {
  _elemList = document.getElementById (this.makeElementId("div",""));
  if (_elemList == null)
  {
   return "";
  }
 }
 var strValue = "";
 var elemStart;
 var nvParams = new imxjsNVList ();

 elemStart = document.getElementById (this.makeElementId("div","Selected"));
 var strIdPrefix = this.m_strType + "_";
 var nIdPrefixLength = strIdPrefix.length;
 if (this.m_nMaxPlace > 0)
 {
  this.getTextListSelected (elemStart, nvParams, strIdPrefix, nIdPrefixLength, 0, true, false, 2);
  strValue = this.makeGroupedPlace (nvParams);
 }
 else
 {
  this.getTextListSelected (elemStart, nvParams, strIdPrefix, nIdPrefixLength, 0, true, false, 1);
  strValue = nvParams.makeVString (false);
 }
 if (strValue == null)
  strValue = "";
 if (this.m_elemFormData != null)
 {
  strValue = this.m_strTextPrefix + strValue + this.m_strTextSuffix;
  this.m_elemFormData.value = strValue;
 }
 nvParams = null;
 //alert (strValue);
 return strValue;
}

ndsjsTextList.prototype.getTextListSelected = function (_elem, _nvList, _strIdPrefix, _nIdPrefixLength, _nIndex, _bCheckedOnly, _bCheckOff, _nOutput)
{
 var strName;
 var strName2;
 var strId;
 var elem;

 var bCheckChildren = true;
 if (_elem == null)
  return _nIndex;
 var children = _elem.childNodes;
 for (var x=0; x<children.length; x++)
 {
  var child = children [x];
  if (child.id && child.id.substring (0, _nIdPrefixLength) == _strIdPrefix)
  {
   if (_nOutput == 0) // Display
   {
    if (child.childNodes != null && child.childNodes.length > 0)
     strName = imxjsGetElementText (child);
    else if (child.nextSibling != null)
     strName = imxjsGetElementText (child.nextSibling);
    else
     strName = "x";
   }
   else if (_nOutput == 1) // Text
   {
    strName = child.getAttributeNode ("text").value;
   }
   else // Place
   {
    strName = child.getAttributeNode ("place").value;
   }

   if (this.m_nMaxPlace > 0)
   {
    strId = child.id + "_G";
    elem = document.getElementById (strId);
    if (elem != null)
    {
     strName2 = imxjsGetElementText (elem);
     _nIndex++;
     if (strName2 != this.m_strGroupedYes)
      strName2 = ' ';
     _nvList.addNameValue (_nIndex, strName2);
    }
   }
   _nIndex++;
   _nvList.addNameValue (_nIndex, strName);

   bCheckChildren = false;
  }
  if (bCheckChildren && child.childNodes != null && child.childNodes.length > 0)
   _nIndex = this.getTextListSelected (child, _nvList, _strIdPrefix, _nIdPrefixLength, _nIndex, _bCheckedOnly, _bCheckOff, _nOutput);
 }
 return _nIndex;
}

ndsjsTextList.prototype.makeGroupedDisplay = function(_nvList, _bEscape)
{
 var pElem;
 var i;
 var j;
 var strGroup1;
 var strText;
 var strGroup2;
 var bGroupStarted = false;
 var aOutput = new Array ();
 var nCount = 0;
 for (i=0; i<_nvList.m_nNVCount; i++)
 {
  pElem = _nvList.m_aNV [i];
  strGroup1 = pElem.value; // + or space

  i++;
  pElem = _nvList.m_aNV [i];
  if (_bEscape)
   strText = ndsjsEscape (pElem.value);
  else
   strText = pElem.value;

  j = i + 1;
  if (j < _nvList.m_nNVCount)
  {
   pElem = _nvList.m_aNV [j];
   strGroup2 = pElem.value; // + or space
  }
  else
   strGroup2 = ' ';
      
  if ((strGroup1 == ' ' && strGroup2 == ' ') ||
      (strGroup1 == this.m_strGroupedYes && strGroup2 == this.m_strGroupedYes))
  {
   if (nCount > 0)
    aOutput [nCount++] = ',';
   aOutput [nCount++] = strText;
  }
  else if (strGroup1 == ' ' && strGroup2 == this.m_strGroupedYes) // first in group
  {
   if (nCount > 0)
    aOutput [nCount++] = ',';
   aOutput [nCount++] = '(';
   aOutput [nCount++] = strText;
  }
  else // if (strGroup1 == this.m_strGroupedYes && strGroup2 == ' ') // last in group
  {
   aOutput [nCount++] = ',';
   aOutput [nCount++] = strText;
   aOutput [nCount++] = ")";
  }
 }
 return aOutput.join ('');
}

ndsjsTextList.prototype.makeGroupedPlace = function(_nvList)
{
 var pElem;
 var i;
 var j;
 var strGroup1;
 var strText;
 var strGroup2;
 var bGroupStarted = false;
 var aOutput = new Array ();
 var nPlace = 0;
 var nIndex = 1;
 for (i=0; i<_nvList.m_nNVCount; i++)
 {
  pElem = _nvList.m_aNV [i];
  strGroup1 = pElem.value; // + or space

  i++;
  pElem = _nvList.m_aNV [i];
  nPlace = parseInt(pElem.value,10) - 1;
  strText = ndsjsDigits (nIndex, 2);

  j = i + 1;
  if (j < _nvList.m_nNVCount)
  {
   pElem = _nvList.m_aNV [j];
   strGroup2 = pElem.value; // + or space
  }
  else
   strGroup2 = ' ';
      
  if ((strGroup1 == ' ' && strGroup2 == ' ') ||
      (strGroup1 == this.m_strGroupedYes && strGroup2 == this.m_strGroupedYes))
  {
   aOutput [nPlace] = strText;
   nIndex++;
  }
  else if (strGroup1 == ' ' && strGroup2 == this.m_strGroupedYes) // first in group
  {
   aOutput [nPlace] = strText;
  }
  else // if (strGroup1 == this.m_strGroupedYes && strGroup2 == ' ') // last in group
  {
   aOutput [nPlace] = strText;
   nIndex++;
  }
 }
 return aOutput.join ('');
}

function imxjsTestSelectedClassName (_elem)
{
 if (_elem == null)
  return false;
 var strClass = _elem.className;
 if (strClass == null || strClass == "")
  return false; 
 var nIndex = strClass.indexOf ("Selected");
 return (nIndex >= 0); // tell if classname contains Selected
}

function imxjsMakeSelectedClassName (_elem)
{
 if (_elem == null)
  return;
 var strClass = _elem.className;
 if (strClass == null || strClass == "")
  return; 
 var nIndex = strClass.indexOf ("Selected");
 if (nIndex < 0)
  imxjsSetElementValue (_elem, "class", strClass+"Selected");
}

function imxjsMakeUnselectedClassName (_elem)
{
 if (_elem == null)
  return;
 var strClass = _elem.className;
 if (strClass == null || strClass == "")
  return; 
 var nIndex = strClass.indexOf ("Selected");
 if (nIndex >= 0)
  imxjsSetElementValue (_elem, "class", strClass.substring (0, nIndex));
}

function ndsjs_getURL_CheckPage (_strForm, _strId, _strURL, _strTarget)
{
// NDSMain
// ctlProp003001000
// page.getRootPath () + "/NDSCheckWebsite.aspx?WebPage=%url%"
// _blank

 var strEval;
 var pForm;
 var strURL;

 strEval = "pForm = document." + _strForm;
 eval (strEval);
 strEval = "strURL = pForm." + _strId + ".value";
 eval (strEval);
 var strNewAction = _strURL.replace ("%url%", ndsjsEscape (strURL));
 var strOrigAction = pForm.action;
 var strOrigTarget = pForm.target;
 var strOrigViewState;
 if (pForm.__VIEWSTATE)
  strOrigViewState = pForm.__VIEWSTATE.value;
 pForm.action = strNewAction;
 pForm.target = _strTarget;
 if (pForm.__VIEWSTATE)
  pForm.__VIEWSTATE.value = '';
 if (pForm.WebPageCheck)
    pForm.WebPageCheck.value = strURL;
 pForm.submit ();
 pForm.action = strOrigAction;
 pForm.target = strOrigTarget;
 if (pForm.__VIEWSTATE)
   pForm.__VIEWSTATE.value = strOrigViewState;
 return false;
}

function ndsjs_getURL_CheckPage2 (_strForm, _strId, _strIdS, _strTarget)
{
// NDSMain
// ctlProp003001000 URL
// ctlProp003023000 Use HTTPS
// _blank

 var strEval;
 var pForm;
 var strURL;
 var bHTTP;

 strEval = "pForm = document." + _strForm;
 eval (strEval);
 strEval = "strURL = pForm." + _strId + ".value";
 eval (strEval);

 if (strURL == null)
  strURL = "";
 strURL = imxjsTrim (strURL);
 if (strURL.length < 1)
 {
  alert ("URL is required.");
  return false;
 }

 strEval = "if (pForm." + _strIdS+ "Y) bHTTP= pForm." + _strIdS+ "Y.checked; else bHTTP=false;";
 eval (strEval);

 if (bHTTP == null)
  bHTTP = false; 

 var strNewAction = bHTTP ? "https://" : "http://";
 strNewAction += strURL;

 ndsOpenWindow2 (strNewAction, _strTarget);
 return false;
}

function ndsjsELSourceLocationCityInit(_strForm,_strParentListControlId,_strListControlId,_nvInput)
{
// get state id and put into nvInput as ParentId
 var strKey;
 var strValue;
 var nIndex;
 var elem;
 var form;
 var strAttributes;

 if (_strForm == null || _strForm == "")
 {
  form = document.forms [0];
 }
 else
 {
  form = document.getElementById (_strForm);
 }
 elem = document.getElementById (_strParentListControlId+"_list");
 if (elem == null) 
 {
  alert ("No state selected. (1)");
 }

 strValue = elem.value;
 if (strValue == null || strValue == "")
 {
    strValue = imxjsEditableListFindValue (elem, _strParentListControlId+"_sel", _strParentListControlId.length+4);
 }
 if (strValue == null || strValue == "")
 {
  alert ("No state selected. (2)");
  return;
 }
 _nvInput.addNameValue ("ParentId", strValue);

 strKey = imxjsEditableListMakeFormControlId (_strListControlId, "ParentId");
 elem = document.getElementById (strKey);
 if (elem != null)
  elem.value = strValue;
}

function ndsjsTextHighlightOn (_strElementId, _nSecondsOn, _strClassOn, _strClassOff)
{
 var elem = document.getElementById (_strElementId);
 if (elem == null)
  return;
 imxjsSetElementValue (elem, "class", _strClassOn);
 var strCmd = "ndsjsTextHighlightOff ('" +
  _strElementId + "','" +
  _strClassOff + "')";

 setTimeout (strCmd, _nSecondsOn*1000);
}

function ndsjsTextHighlightOff (_strElementId, _strClassOff)
{
 var elem = document.getElementById (_strElementId);
 if (elem == null)
  return;
 imxjsSetElementValue (elem, "class", _strClassOff);
}

function ndsjsFormCreate (_strMethod, _strURL, _strTarget)
{
 var elemForm = document.createElement("FORM");
 if (_strMethod != null && _strMethod == "GET")
  elemForm.method= "GET";
 else
  elemForm.method= "POST";
 elemForm.action = _strURL;
 elemForm.target = _strTarget;
 return elemForm;
}

function ndsjsFormAddHiddenInput (_elemForm, _strName, _strValue)
{
 var elemInput   = document.createElement ("INPUT");
 elemInput.type  = "hidden";
 elemInput.name  = _strName;
 elemInput.value = _strValue;
 _elemForm.appendChild(elemInput);
 return elemInput;
}

function ndsjsFormSubmit (_elemForm)
{
 _elemForm.submit ();
}

function ndsjsPlayClip (_strURL, _strParams, _strExpire, _bGetTitle, _strFormId)
{
 var strGuid = "";
 var strValue;

 if (_bGetTitle != null && _bGetTitle == "Y" && _strFormId != null)
 {
  var pForm;
  strValue = "pForm = document." + _strFormId;
  eval (strValue);
  if (pForm != null)
   strValue = pForm.RptTitle.value;
  else
   strValue = "";
  _strParams = _strParams.replace ("%title%", ndsjsEscape (strValue));
 }

 // call ws to save params and get id

 var request = ndsjsPlayClipInit ("ParamInfoAdd");
 request.setAsync (false);
 request.m_bSendSession = false;
 request.m_bSendTS = false;

 var nvInput = new imxjsNVList ();
 nvInput.addNameValue ("Data",       _strParams);
 nvInput.addNameValue ("Expire",     _strExpire);
 request.addParameter ("Input", nvInput.makeNVString());
 nvInput = null;
 ndsjsPlayClipCall (request);

 request.parseWebServiceResponse ();
 strStatus  = request.m_aNV.getValueByName ("Status");
 strMessage = request.m_aNV.getValueByName ("Message");

 if (strStatus != null && strStatus.length > 0)
 {
  if (strStatus == "S")
  {
   if (strMessage != null && strMessage != "")
   {
    nIndex = strMessage.indexOf ("Id=");
    if (nIndex >= 0)
    {
     nIndex2 = nIndex + 3;
     strGuid = strMessage.substring(nIndex2);
    }
   }
  }
  else // Failed
  {
  }
 }
 else // No status
 {
 }
 request = null;
 var strUrl = _strURL + "?PI=" + strGuid;
 ndsOpenWindow2 (strUrl, "_blank");
 return false;
}

function ndsjsPlayClipInit (_strMethod)
{
 var elem;
 var strValue;

 strValue = g_strNDSWSPath;
 if (strValue == null || strValue == "")
 {
  elem = document.getElementById ("NDSWSPath");
  if (elem == null)
   return null;
  strValue = elem.value;
 }
 var strWSPath = strValue;

 strValue = g_strNDSWSHost;
 if (strValue == null || strValue == "")
 {
  elem = document.getElementById ("NDSWSHost");
  if (elem == null)
   return null;
  strValue = elem.value;
 }
 var strWSHost = strValue;

 strValue = g_strNDSWSUrl;
 if (strValue == null || strValue == "")
 {
  elem = document.getElementById ("NDSWSUrl");
  if (elem == null)
   return null;
  strValue = elem.value;
 }
 var strWSUrl = strValue;

 strValue = g_strNDSWSXMLNS;
 if (strValue == null || strValue == "")
 {
  elem = document.getElementById ("NDSWSXMLNS");
  if (elem == null)
   return null;
  strValue = elem.value;
 }
 var strWSXMLNS = strValue;

 var request = new imxjsWebServiceRequest ();
 request.setWebPath         (strWSPath);
 request.setWebServiceHost  (strWSHost);
 request.setWebServiceUrl   (strWSUrl);
 request.setWebMethodName   (_strMethod);
 request.setWebServiceXMLNS (strWSXMLNS);
 request.m_bSendSession = true;
 request.m_bSendTS = true;
 request.setAsync (true);
 return request;
}

function ndsjsPlayClipCall (_request)
{
 var bRC = true;
 var strValue;
 if (_request.m_bSendSession)
 {
  strValue = g_page.getSessionId();
  if (strValue == null)
   strValue = "";
  _request.addParameter ("Session", strValue);
 }
 if (_request.m_bSendTS)
 {
  strValue = g_page.getSessionTS();
  if (strValue == null)
   strValue = "";
  _request.addParameter ("TS", strValue);
 }
 var objTarget = _request.getTarget();
 var cbSuccess = _request.getSuccessCallback ();
 if (objTarget != null && cbSuccess == null)
 {
  _request.setSuccessCallback (objTarget.ajaxOnSuccess);
  _request.setFailureCallback (objTarget.ajaxOnFailure);
 }
 _request.callWebService (objTarget);
 return bRC;
}
