  var g_dlgEbook = null;


  function ebookViewWindow( targetURL, width, height, varArg )
  {
    var szTop = "dialogTop: 0px; ";
    var szLeft = "dialogLeft: 0px; ";
    var sFeatures = szTop + szLeft + "dialogHeight: " + height + "px; dialogWidth: " + width + "px; center: no; edge: raised; help: no; status: no;";
    var advanceArg = new Array();
    advanceArg[0] = window;
    var dlgWin = null;
    var top = 0;
    var left = 0;
    if ( varArg ) {
      dlgWin = window.showModelessDialog( targetURL, varArg, sFeatures );
    } else {
      dlgWin = window.showModelessDialog( targetURL, advanceArg, sFeatures );
    }
    
    return dlgWin;
  }
  
  function fullSCRViewWindow( targetURL, width, height, varArg )
  {
    var dlgWin = null;
    dlgWin = window.open(targetURL+"?"+varArg,"BookMaker","top=0,left=0,width="+width+",height="+height+",channelmode=no, directories=no, status=no, titlebar=no, toolbar=no, resizable=no, scrollbars=no, menubar=no");
    dlgWin.blur();
    dlgWin.focus();
    
    return dlgWin;
  }

  
  function vieweBook(fname){
      var width =  window.screen.width;
      var height = window.screen.height;// - 34;  
      if ( width > height*2) width = width / 2;
      var argVar = new Array();
      argVar[0] = window;
      argVar[1] = width;           
      argVar[2] = height;     
      argVar[3] = ""; 
      argVar[4] = "";
      argVar[5] = fname; 
      g_dlgEbook = fullSCRViewWindow("/prg/ebook.htm", width,height,fname);
  }

