   // ------------------------------------------------------------------------------------------------------------------------------------------------
   // select lists
   // ------------------------------------------------------------------------------------------------------------------------------------------------
   
   
   function listClear ( objList ) {
      if ( objList.length == 0 ) return;
      for ( i=objList.length-1; i >= 0; i-- ) objList.remove(0);
   }



   // NOTE: see note for "newOption()" function !!
   function listCopy ( srcList, destList, documentObject  ) {
      for ( i=0; i < srcList.length; i++ ) {
         listAddItem ( destList, srcList.options[i].value, srcList.options[i].text, documentObject );
      }
   }

   // NOTE: see note for "newOption()" function !!
   function listAddItem ( objList, id, text, documentObject ) {
      objList.add ( newOption(id,text,documentObject) );
   }

   // NOTE: e.g. if you want to add new entries to a select list of an opener window: create always an option element with "opener.document.createElement()" !!!
   // so, the call to other list than the current document should be done like:  newOption("id","text",opener.document);
   function newOption ( id, text, documentObject ) {  
      element        = null;
      if ( documentObject == null ) element = document.createElement('option');
      else                          element = documentObject.createElement('option');
      element.value  = id
      element.text   = text;
      return element;
   }




   function listContains ( objList, key ) {
      for ( i=0; i < objList.length; i++ ) {
         if ( objList.options[i].value == key ) return true;
      }
      return false;
   }

   function listSelectEntry ( objList, value ) {
      for ( i=0; i < objList.length; i++ ) {
         if ( objList.options[i].value == value ) {
            objList.selectedIndex = i;
            return;
         }
      }
   }

   function listGetSelectedValue ( objList ) {
      if ( document.all[objList].selectedIndex == -1 ) return null;
      return document.all[objList].options[document.all[objList].selectedIndex].value;
   }

   function listGetSelectedValues ( objList ) {
      values = new Array();
      for ( i=0; i < objList.length; i++ ) {
         if ( objList.options[i].selected ) {
            values[values.length] = objList.options[i].value;
         }
      }
      return values;
   }
            

         
   function listRemoveItem ( objList ) {
      if ( objList.selectedIndex == -1 ) return;
      objList.remove ( objList.selectedIndex );
   }
   
   
   
   function radioGetSelectIndex ( radiogroup ) {
      for ( i=0; i < radiogroup.length; i++ ) {
         if ( radiogroup[i].checked ) {
            return i;
         }
      }
      return -1;
   }


   function listMoveUp ( objList ) {
      ix = objList.selectedIndex;
      if ( ix > 0 ) {
         listSwapEntries ( objList, ix, ix-1 ); 
      }
   }

   function listMoveDown ( objList ) {
      ix = objList.selectedIndex;
      if ( ix < objList.length - 1 ) {
         listSwapEntries ( objList, ix, ix+1 ); 
      }
   }

   function listMoveTop ( objList ) {
      ix = objList.selectedIndex;
      for ( ; ix > 0; ix-- ) {
         listSwapEntries ( objList, ix, ix-1 ); 
      }
   }

   function listMoveBottom ( objList ) {
      ix = objList.selectedIndex;
      for ( ; ix < objList.length - 1; ix++ ) {
         listSwapEntries ( objList, ix, ix+1 ); 
      }
   }

   function listSortAlpha ( objList ) { // algo: by smallest element
      for ( i=0; i < objList.length; i++ ) {
         smallest = i;
         for ( j=i; j < objList.length; j++ ) {
            if ( objList[j].text.toUpperCase() < objList[smallest].text.toUpperCase() ) smallest = j;
         }            
         if ( i != smallest ) listSwapEntries ( objList, i, smallest ); 
      }
   }
   
   function listSwapEntries ( objList, ixFrom, ixTo ) {
      objVal   = objList.options[ixFrom].value;
      objText  = objList.options[ixFrom].text;
      objList.options[ixFrom].value = objList.options[ixTo].value;
      objList.options[ixFrom].text  = objList.options[ixTo].text;
      objList.options[ixTo].value   = objVal;
      objList.options[ixTo].text    = objText;
      objList.selectedIndex         = ixTo;
   }

   function listBuildPositionString ( objList ) {     // return all element values seperated by comma
      var s = "";
      for ( i=0; i < objList.length; i++ ) {
         s += "," + objList.options[i].value;
      }
      if ( s.length > 0 ) return s.substring(1);
      return "";
   }


         


   // ------------------------------------------------------------------------------------------------------------------------------------------------
   // windows
   // ------------------------------------------------------------------------------------------------------------------------------------------------

   function openWindow ( url, name, width, height, scrollbar, resizable ) {
      if ( scrollbar == null ) scrollbar = 'no';
      if ( resizable == null ) resizable = 'no';
      var ref = window.open ( url, name, "height=" + height + ",width=" + width + ",resizable=" + resizable + ",dependent=no,scrollbars=" + scrollbar + ",menubar=no,status=yes,toolbar=no" );
      ref.focus();
   }
   
   function openDocumentWindow ( url ) {
      openWindow ( baseHref + url, 'document', 800, 600, 'yes', 'yes' );
   }  
   
   function openExternalWindow ( url, name ) {
      if(name == '')
          name = 'ext';
      openWindow ( url, name, 800, 600, 'yes', 'yes' );
   }
   
   // ------------------------------------------------------------------------------------------------------------------------------------------------
   // handle the state of the password fields on the right hand pane.
   // ------------------------------------------------------------------------------------------------------------------------------------------------
   
   var emptiedUserAndPasswordFields = false;
   
   function emptyUserAndPasswordFields() {
      if(!emptiedUserAndPasswordFields) {
         document.formLogin.username.value = "";
         document.formLogin.password.value = "";
         document.formLogin.username.style.color = "#000000";
         document.formLogin.password.style.color = "#000000";
         emptiedUserAndPasswordFields = true;
      }
   }

   function submitUserAndPasswordFields() {
      if(emptiedUserAndPasswordFields) {
	     document.formLogin.submit();
	  }
   }


   
   // ------------------------------------------------------------------------------------------------------------------------------------------------
   // strings, convertings
   // ------------------------------------------------------------------------------------------------------------------------------------------------

   function trim ( s ) {
      if ( s == null ) return null;
      for ( i=0; s.charAt(i) == ' '; i++ );
      for ( j=s.length-1; s.charAt(j) == ' '; j-- );
      return s.substring(i,j+1)
   }
   
   

   // ------------------------------------------------------------------------------------------------------------------------------------------------
   // dynamic resizing
   // ------------------------------------------------------------------------------------------------------------------------------------------------
   
	function getWinwidth () {
	    // for Netscape browser:
	    if (window.innerWidth) {
	        return window.innerWidth;
	    // for Internet Explorer:
	        } else if (document.body && document.body.offsetWidth) {
	            return document.body.offsetWidth;
	        } else {
	            return 0;
	        }
	}
		
	function getWinheight () {
	    // for Netscape browser:    
	    if (window.innerHeight) {
	            return window.innerHeight;
	    // for Internet Explorer:
	        } else if (document.body && document.body.offsetHeight) {
	            return document.body.offsetHeight;
	        } else {
	            return 0;
	        }
	}
		        
	function updateWindow () {
	    if (Winwidth != getWinwidth() || Winheight != getWinheight())
	        window.history.go(0);
	}   



        
   // ------------------------------------------------------------------------------------------------------------------------------------------------
   // flash
   // ------------------------------------------------------------------------------------------------------------------------------------------------
    
    /**
     * Note: call this functions with:       setTimeout( 'hideAllFlash()', 10 );
     * (otherwise all objects might not be loaded at call-time)
     */
    
    function hideAllFlash() {
        toggleAllFlash( 'hidden' );
    }

    function showAllFlash() {
        toggleAllFlash( 'visible' );
    }

    function toggleAllFlash( val ) {
        for( i=0; i < document.all.length; i++ ) {

            obj = document.all(i);
            objName = '' + obj.nodeName;
            
            if( objName.indexOf('OBJECT') != -1 ) {
            
                objCodeBase = obj.attributes.getNamedItem('codebase');
                if( objCodeBase != null ) {
                    codeBase = objCodeBase.nodeValue;
                    if( codeBase.toLowerCase().indexOf('flash') != -1 ) {
                        obj.style.visibility = val;
                    }
                }
                
            } // end-if
            
        } // end-for
    }    
