<script>



function initDialog(h) {
   var copy=function(text){
      try {
         if (window.clipboardData){
            if(window.clipboardData.setData("Text", text))
            return true;
         }
         netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
         var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);
         if(clip) {
            var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
            if (trans) {
               trans.addDataFlavor('text/unicode');
               var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
               str.data=text;
               trans.setTransferData("text/unicode",str,text.length*2);
               var clipid=Components.interfaces.nsIClipboard;
               if (clip) {
                  clip.setData(trans,null,clipid.kGlobalClipboard);
                  return true;
               }
            }
         }
      }
      catch(e) {}
      return false;
   };
   var url=cleanHref(window.location.href);
   url+=$(h.t).attr("href");
   var intvId;
   var doResp=function(tmo) {
      h.w.css('top',$(h.t).offset()-20);
      var msg="";
      if(tmo) {
         var mins = Math.floor(tmo/60);
         var hours = Math.floor(mins/60);
         mins = mins % 60;
         mins = mins < 10 ? "0"+mins : ""+mins;
         hours = hours < 10 ? "0"+hours : ""+hours;
         msg="<p><b>Note:</b> Your session expires after "+hours+":"+mins+" hour(s) of inactivity.<br/>Any changes to opened documents must be saved within this time frame.<br/>Saving the document resets this time period.</p>";
      }
      url=encodeURI(url);
      if(copy(url)) {
         $('#ClipboardInfo').html("The following URL is now copied to your clipboard:<br/>"+url+msg);
         intvId = setInterval(function() {
            clearInterval(intvId);
            h.w.jqmHide();
         }, 10000); 
      }
      else {
         $('#ClipboardInfo').html('<input type="text" id="clipboardURL" style="width:100%" value="'+url+'"/><br/><br/>'+msg);
         $("#clipboardURL").select().focus();
      }
   }
   var file;
   var ix = url.lastIndexOf("/");
   file=url.substring(ix+1);
   url=url.substring(0,ix+1);
   $.getJSON(url+"?cmd=sesuri", function(resp) {
      var ix=url.indexOf("/",8);
      url=url.substr(0,ix)+resp.uri;
      if(file) url+=file;
      doResp(resp.tmo);
   });
   return function() {
      if(intvId) clearInterval(intvId);
   };
};

</script>
<div class="rtltmb"><span></span><div>Copy the following URL (CTRL-C):</div></div>
<div id="ClipboardInfo" class="tooltip">
</div>
