
    function DoReplacePopup(theURL,winName,features) { //v2.0
      window.close();
      return(window.open(theURL,winName,features));
    }

    function DoPopup(theURL,winName,features) { //v2.0
      var new_win = window.open(theURL,winName,features);
      if (winName != '_self') {
        ChildWindowsGlobalArray.push(new_win);
      }
      return(new_win);
    }
    
    function ChildWindowIfOther(theURL,winName,formName,updateField) { //v2.0
      if (document.forms[formName].elements[updateField].options[document.forms[formName].elements[updateField].selectedIndex].value 
           == 'NEW') {
        var fixedUrl = theURL + '?targetFormName='+formName+'&targetField=' + updateField;
        var features = 'scrollbars=yes,resizable=yes,width=525,height=500';
        var new_win = window.open(fixedUrl,winName,features) ;
        if (winName != '_self') {
          ChildWindowsGlobalArray.push(new_win);
        }
        return(new_win);
      }
      return(null);
    }
    
    function ChildTableWindow(theURL,winName,formName,updateField,action,fieldValue) { //v2.0
      var target_value = document.forms[formName].elements[updateField].value ;
      //debugMessage('ChildTableWindow:'+updateField+':'+target_value+"<br>");
      if (target_value) {
        action = 'edit';
        fieldValue = target_value;
      }
      var fixedUrl = theURL + '?new_'+winName+'_action='+action+'&edit_value='+fieldValue+'&targetFormName='+formName+'&targetField=' + updateField;
      var features = 'scrollbars=yes,resizable=yes,width=525,height=500';
      
      var new_win = window.open(fixedUrl,winName,features);
      if (winName != '_self') {
        ChildWindowsGlobalArray.push(new_win);
      }
      return(new_win);
    }
