﻿
// This sets a css class to the control specified in me.
function HandleAction(me,CssClass) {
	me.className= CssClass;
} // end function

function ResizeListBox(id,width) {
  var listBox= document.getElementById(id);
  if(listBox !== null) {
    if(listBox.style.width > width) {
      listBox.style.width = 'auto';
    } // end if  
    else {
      listBox.style.width= width;
    } // end else
  } // end if
} // end function

function SetClipboard(copyText) {    
      if (window.clipboardData) { // IE send-to-clipboard method.
            window.clipboardData.setData('Text', copyText);            
      } // end if
      else if (window.netscape) {
            // You have to sign the code to enable this or allow the action in about:config by changing user_pref("signed.applets.codebase_principal_support", true);
            netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
            
            // Store support string in an object.
            var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
            if (!str) return false;
            str.data=copyText;
            
            // Make transferable.
            var trans = Components.classes["@mozilla.org/widget/transferable;1"].createInstance(Components.interfaces.nsITransferable);
            if (!trans) return false;
            
            // Specify what datatypes we want to obtain, which is text in this case.
            trans.addDataFlavor("text/unicode");
            trans.setTransferData("text/unicode",str,copyText.length*2);
            
            var clipid=Components.interfaces.nsIClipboard;
            var clip = Components.classes["@mozilla.org/widget/clipboard;1"].getService(clipid);
            if (!clip) return false;
            
            clip.setData(trans,null,clipid.kGlobalClipboard);
      } // end else
} // end function

var lastThumb= 0;

function ThumbOver(i) {
  document.getElementById('div' + lastThumb).className= 'divHidden';
  document.getElementById('headerThumb' + lastThumb).className= 'headerThumb';  
  document.getElementById('header' + lastThumb).className= 'headerThumbText';
  document.getElementById('headerThumb' + i).className= 'headerThumbOver';  
  document.getElementById('header' + i).className= 'headerThumbTextOver';
  document.getElementById('div' + i).className= 'divVisible';
} // end function

function ThumbOut(i) {  
  lastThumb= i;   
} // end function

