var winName = "UsedCarWin";
var width  = "500";
var height = "400";

// openWindow ( STRING URL [, BOOLEAN selfClose] )
function openWindow ( URL, winName )
  {if ( URL==null || URL.length==0 || URL=="" )
      {width  = "200";
       height = "60";
       URL    = "blank.html";
      }
   var newWindow = window.open ( URL, winName, "resizable=yes,scrollbars=yes,status=yes,menubar=yes,toolbar=no,top=50" +
                                 ",width="+width+",height="+height);
   var selfClose = false;
   if ( openWindow.arguments.length == 2 )
      { selfClose = openWindow.arguments[1]; }
   if ( !selfClose )
      {if ( document.window != null && !newWindow.opener )
          { newWindow.opener = document.window; }
      }
  }

function openChatWindow ( URL )
  {var newWindow = window.open ( URL, winName, "resizable=yes,top=50 ,width=450,height=250");
   var selfClose = false;
   if ( openChatWindow.arguments.length == 2 )
      { selfClose = openChatWindow.arguments[1]; }
   if ( !selfClose )
      {if ( document.window != null && !newWindow.opener )
          { newWindow.opener = document.window; }
      }
  }

// returns a window
function makeNewWindow ( URL )
  {return window.open ( URL, winName, "resizable=yes,scrollbars=yes,status=yes,menubar=yes,toolbar=no,top=50" +
                        ",width="+width+",height="+height);
  }
  
function openPreviewWin ( URL, winName )
  {var newWindow = window.open ( URL, winName, "width=400,height=300,top=120,left=25,status=yes" +
                                  ",scrollbars=yes" );
    if ( document.window != null && !newWindow.opener )
       { newWindow.opener = document.window; }
  }

function openVehicleWin ( URL, winName )
  {var newWindow = window.open ( URL, winName, "width=600,height=600,top=60,left=35,status=yes" +
                                  ",scrollbars=yes" );
    if ( document.window != null && !newWindow.opener )
       { newWindow.opener = document.window; }
  }

function openFavWindow ( URL )
  {var newWindow = window.open ( URL, winName, "width=300,height=280,top=120,left=25,status=no" +
                                  ",scrollbars=no, resizable=yes"  );
    if ( document.window != null && !newWindow.opener )
       { newWindow.opener = document.window; }
  }

function openEMailWindow ( URL )
  {var newWindow = window.open ( URL, winName, "resizable=yes,width=600,height=400,top=120,left=25,status=no" +
                                  ",scrollbars=yes" );
    if ( document.window != null && !newWindow.opener )
       { newWindow.opener = document.window; }
  }

function openBig5Window ( URL )
  {var newWindow = window.open ( URL, winName, "resizable=yes,width=600,height=400,top=120,left=25,status=no" +
                                  ",scrollbars=yes" );
    if ( document.window != null && !newWindow.opener )
       { newWindow.opener = document.window; }
  }
  
function winBar ( stmt )
  { window.status = stmt; }

function noFrame()
  {if ( parent.length > 0 ) { parent.location = self.location; }}

//<A HREF="" ONCLICK="JAVASCRIPT: return false;"  ONMOUSEOVER="chgImg('img2','hlite.gif');" ONMOUSEOUT="chgImg('img2','normal.gif');">
//   <IMG NAME="img2" SRC="normal.gif" WIDTH="162" HEIGHT="69"></A>
function chgImg ( imgID, imgName)
  {if (document.images) { document[imgID].src = imgName; }}

// histGo ( [INTEGER pages] ) pages + forward - backward
function histGo()
  {  if ( histGo.arguments.length == 1 )
      {var pages = histGo.arguments[0];
       window.history.go ( pages );
      }
   else { window.history.back(-1); }
  }

// writeHREF ( STRING URL, STRING linkText, STRING statusMsg [, STRING className] )
//  writeHREF ("JAVASCRIPT: sortAction('catName', '#IIF(sortBy IS "catName", "newSortTitle", DE("Asc"))#' );",
//             "Category", "#IIF(sortBy IS 'catName', 'newSortTitle', DE('Sort ascending order'))#", "theader" );
function writeHREF ( URL, linkText, statusMsg )
  {var className = ""
   if ( writeHREF.arguments.length == 4 )
      { className = writeHREF.arguments[3]; }
   if ( className==null || className.length==0 || className=="" )
      {document.writeln ( "<A HREF=\"" + URL + "\" " +
                        "ONMOUSEOVER=\"JAVASCRIPT: window.status='" + statusMsg + "'; return true\" " +
                        "ONMOUSEOUT=\"JAVASCRIPT: window.status=''; return true;\">" +
                        linkText + "</A>" );
      }
   else
      {document.writeln ( "<A HREF=\"" + URL + "\" " +
                        "ONMOUSEOVER=\"JAVASCRIPT: window.status='" + statusMsg + "'; return true\" " +
                        "ONMOUSEOUT=\"JAVASCRIPT: window.status=''; return true;\">" +
                        "<SPAN CLASS=\"" + className + "\">" + linkText + "</SPAN></A>" );
      }
  }
