// General-use functions go in here.


// Open Window.  Takes window name, size, and scrollbar option, and creates 
// a new popup window.  Assumes start from link, so filename is not required.
function openWin(n,w,h,s) {
  open('', n, 
       'toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=1,'+
       'scrollbars='+s+',width='+w+',height='+h+',dependent=1');
}

function openPopup(n,w,h) {
  open('', n, 
       'toolbar=0,location=0,directories=0,status=0,menubar=0,resizable=1,'+
       'scrollbars=1,width='+w+',height='+h+',dependent=1');
}


function divPrint(div,scrW,scrH,sty) {
  p = getRef(div,'');       // Requires TwinHelix library
  var prWin = open('','',
              'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,'+
              'resizable=0,width='+scrW+',height='+scrH+',dependent=1');
  prWin.document.write(
      '<ht'+'ml><he'+'ad>'+
      '<scr'+'ipt language="JavaScript1.2">'+
      'function printThis() {'+
      ' self.print();'+
      ' setTimeout("self.close()",5000);'+
      '}'+
      '</scr'+'ipt>');
  if (sty != '') {
    prWin.document.write('<li'+'nk rel="stylesheet" href="http://'+location.host+'/'+sty+'" type="text/css" />');
  }
  prWin.document.write(
      '</he'+'ad><bo'+'dy onload="printThis()">'+
       p.innerHTML+
      '</bo'+'dy>'+
      '</ht'+'ml>');
  prWin.document.close();
}

