<!--
/*
  Common JScript Routines.
  Copyright PAC & VNA 2000-2002

  Use:
  Put this in the <head>:
  <SCRIPT language='JavaScript' SRC='../JScripts/JScriptCommonLib.js'></SCRIPT>

*/

// Script Accessible?
function bCommonLibAlive()
{
  return true;
}

// Function closes a non-frames browser window
function CloseWindow 
(
  linkText,  // hyperlink text
  CursorTip  // mouse-over tip
)
/*
   Purpose: Closes window when user clicks hyperlink text
     Notes: Accomplishes same as following HTML:
      <a href="javascript:window.close()" title="Cursor Tip">Close Window</a>
   Returns: nothing
    History: PAC 2000 Aug 18 Consolidated existing function into this lib.

*/
{
  linkText = (linkText == null) ? "Close Window" : linkText;
  CursorTip = (CursorTip == null) ? "Close&nbsp;this&nbsp;Window" : CursorTip;
  document.write("<a href='javascript:top.close()' title=" 
                    + CursorTip + ">" + linkText + "</a>");
}    


// Function opens a new browser window
function OpenWindow
(
  file,       // document file name
  unique,     // unique name for id, does not show, MUST NOT HAVE SPACES
  parameters  // optional parameters to set
)
/* 
  Purpose: Will open browser with file and bring it to front. 
    Notes: Allowed parameters: 
              toolbar, location, directories, status, menubar, scrollbars, 
              resizable, width=x, height=x
              
           Common usage examples:
           1) Simple
            a) Put this in the <body>:
           <a href="sample.htm" target="_blank" onclick="OpenWindow('sample.htm','unique_nm','width=540,height=480,scrollbars,resizable');return false;">Target Text</a>

           2) Complicated 
            a) Put this in the <body>:            
           <SCRIPT><!-- execute this if JS is enabled:
             document.write('<a href="javascript:OpenWindow(\'http://sample.htm\',\'unique_nm\',
                            \'width=300,height=200,scrollbars,resizable\');">');
           // else execute the following --></SCRIPT>
           <NOSCRIPT> 
             <a href="test%20text.htm" title="Non-Java Click" target="_blank">
           </NOSCRIPT>
           Target Text</a> <!-- In any case the target text is needed -->
  Returns: nothing
  History: PAC 2000 Aug 18 Consolidated existing function into this lib.
*/
{
  parameters = (parameters == null) ? "resizable" : parameters;
  WinObj = window.open(file, unique, parameters);  // open browser
  WinObj.focus();                           // bring to top
}

/*
<% ="'VNADealers','width=' + (screen.width - 7) + ',height=' + (screen.height - 7)+ ',top=5,left=5,scrollbars,resizable'" %>
*/
// -->
