//==========================================================================================
// Adesa Javascript library
//
// jmavor : 03/25/2005 - New Buyer Services - new functions 
//==========================================================================================

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
  var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
  if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function openWindow(winURL,winName,winAttrib) {
  var newWindow = window.open(winURL,winName,winAttrib)
}

function popUp(URL) {
  day = new Date();
  id = day.getTime();
  eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=300,left = 100,top = 100');");
}

function showFeaturedVehicle ( itemFileName ) {
  day = new Date();
  id = day.getTime();
  myURL = "../../index.jsp?content=dynamic/featured_vehicles/display.jsp?stock=" + itemFileName +"&popup=true";
  eval("page" + id + " = window.open( myURL, '" + id + "', 'scrollbars=1,resizable=1,width=870,height=750' );");
}

function showSpecialEventItem ( itemKey ) {
  day = new Date();
  id = day.getTime();
  myURL = "/external/index.jsp?content=/newsMaint/viewEvent.jsp&key=" + itemKey +"&popup=true";
  eval("page" + id + " = window.open( myURL, '" + id + "', 'scrollbars=1,resizable=1,width=520,height=500' );");
}

function showURL ( myURL ) {
  day = new Date();
  id = day.getTime();
  eval("page" + id + " = window.open( myURL, '" + id + "', 'scrollbars=1,resizable=1,width=700,height=500' );");
}

function showURLWide ( myURL ) {
  day = new Date();
  id = day.getTime();
  eval("page" + id + " = window.open( myURL, '" + id + "', 'scrollbars=1,resizable=1,width=800,height=500' );");
}

function showURLMini ( myURL ) {
  day = new Date();
  id = day.getTime();
  eval("page" + id + " = window.open( myURL, '" + id + "', 'scrollbars=0,resizable=0,width=700,height=200' );");
}

function showURLWithSize ( myURL, width, height ) {
  day = new Date();
  id = day.getTime();
  eval("page" + id + " = window.open( myURL, '" + id + "', 'scrollbars=1,resizable=1,width=" + width + ", height=" + height + "' );" );
}

/* jmavor : 08/01/2005 NEW */
function showURLWithSize0 ( myURL, width0, height0 ) {
  LeftPosition = (screen.width) ? (screen.width-width0)/2 : 0;
  TopPosition = (screen.height) ? (screen.height-height0)/2 : 0;
  day = new Date();
  id = day.getTime();
  eval("page" + id + " = window.open( myURL, '" + id + "', 'scrollbars=1,resizable=1,width=" + width0 + ", height=" + height0 + ", top=" + TopPosition + ",left=" + LeftPosition + "' );" );
}

function showVehicleDetails ( myURL ) {
  day = new Date();
  id = day.getTime();
  eval("page" + id + " = window.open( myURL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=970,height=650' );");
}

var oldWindow
function closeWindow(){
   oldWindow = window.close()
}

function showPrintDirections ( AuctionId ) {
  day = new Date();
  id = day.getTime();
  myURL = "/?content=static/buyer/facilities/printdir" + AuctionId + ".htm&popup=true";
  eval("page" + id + " = window.open( myURL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=750,height=600' );");
}

function showFacilitiesInfo ( AuctionId ) {
  day = new Date();
  id = day.getTime();
  myURL = "/?content=static/buyer/facilities/facilities" + AuctionId + ".htm&popup=true";
  eval("page" + id + " = window.open( myURL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=750,height=600' );");
}

/** [START] Show Sale Lists -------------------------------------------------------------- **/

function showSaleList ( yardId ) {
  myUrl = "/?content=buyersalelist&buyerMode=true";
  if (yardId!="") myUrl = "/?content=buyersalelist&yard=" + yardId + "&buyerMode=true";
  window.location.href = myUrl;
}

function showSaleList2 ( yardId ) {
  myUrl = "/?content=buyersalelist";
  if (yardId!="") myUrl = "/?content=buyersalelist&yard=" + yardId
  window.location.href = myUrl;
}

function showSaleListSearch () {
  //window.location.href = "/?content=buyersalelist&search=true" + "&buyerMode=true";
  window.location.href = "/?content=buyersearch" + "&buyerMode=true&action=reset";
}

/** [END] Show Sale Lists -------------------------------------------------------------- **/

function backLink() {
  history.back();
}




//==========================================================================================
//==========================================================================================
