//alert("begin browserSniff")
  browser = 'an unknown browser';
  platform = 'an unknown platform';
  var u = navigator.userAgent;
  var i = u.indexOf('WebTV');
  if(i >= 0) { browser = 'WebTV'; i += 6; }
  else
  {
    i = u.indexOf('MSIE');
    if (i >= 0) { browser = 'Internet Explorer'; i += 5; }
    else
    {
      i = u.indexOf('Opera');
      if (i >= 0) { browser = 'Opera'; i = u.indexOf(')') + 2; }
      else
      {
        i = u.indexOf('Mozilla/');
        if (i >= 0) { browser = 'Netscape'; i += 8; }
      }
    }
  }
  version = parseFloat(u.substring(i, i+4));

  if (u.indexOf('Win') >= 0)
  {
    platform = 'Windows';
    if(u.indexOf('95') >= 0) platform+=" 95";
    else if(u.indexOf('98') >= 0) platform+=" 98";
    else if(u.indexOf('2000') >= 0) platform+=" 2000";
    else if(u.indexOf('NT') >= 0) platform+=" NT";
  }
  if (u.indexOf('Mac') >= 0) { platform = 'Macintosh'; }
  if (u.indexOf('OS/2') >= 0) { platform = 'OS/2'; }
  if (u.indexOf('X11') >= 0) { platform = 'UNIX'; }
  if (u.indexOf('Linux') >= 0) { platform = 'Linux'; }

  if(browser=="Netscape") { 
    if ((version/1)==5) version=6;
    else if ((version/1)==6) version=7;
  }
//  document.write("You are using "+browser+" "+version+" on "+platform);
//  document.write(" with Java "+(navigator.javaEnabled()?"enabled":"disabled")+".");
//  alert("You are using "+browser+" "+version+" on "+platform);
//  alert(" with Java "+(navigator.javaEnabled()?"enabled":"disabled")+".");


//alert("end browserSniff")




//========================================================================================================
//========================================================================================================
//========================================================================================================
//alert("begin findDOM")
var isDHTML = 0;
var isLayers = 0;
var isAll = 0;
var isID = 0;

if (document.getElementById){
  isID = 1
  isDHTML = 1
}
else{
  if (document.all){
    isAll = 1
    isDHTML = 1
  }
  else{
    browserVersion = parseInt(navigator.appVersion);
    if ((navigator.appName.indexOf('Netscape') != -1) && (browserVersion == 4)){
      isLayers = 1
      isDHTML = 1
    }
  }
}

//alert(isDHTML +"\n"+ isLayers +"\n"+ isAll +"\n"+ isID);

function findDOM(objectID, withStyle){
  if (withStyle == 1){
    if (isID){
      return document.getElementById(objectID).style;
    }
    else{
      if (isAll){
        return (document.all[objectID].style)
      }
      else
        if (isLayers){
          return (document.layers[objectID]);
        }
    }
  }
  else{
    if (isID)
      return (document.getElementById(objectID))
    else{
      if (isAll)
        return (document.all[objectID])
      else
        if (isLayers)
          return (document.layers[objectID]);
    }
  }
}
//alert("end findDOM")








//========================================================================================================
//========================================================================================================
//========================================================================================================
//alert("begin getWidthHeight")
var ns4 = (document.layers) ? 1 : 0;
var ie4 = (document.all) ? 1 : 0;
var ns6 = (document.getElementById && !document.all) ? 1 : 0;
function getWidth(){ return (ns4||ns6) ? window.innerWidth : document.body.clientWidth; }
function getHeight(){ return (ns4||ns6) ? window.innerHeight : document.body.clientHeight; }
//alert("end getWidthHeight")








//========================================================================================================
//========================================================================================================
//========================================================================================================
wo_base = location.host


function tenPercentOff(){
  theWindow = window.open('http://' +wo_base+ '/lowPrice.htm', 'anew', config='height=435,width=440,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,directories=no,status=no');
  theWindow.focus()

}

function openCertDetails(){
  theWindow = window.open('https://digitalid.verisign.com/as2/1ef944603fe4fd05a227164b4bf86476', 'anew', config='height=400,width=480,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,location=yes,directories=no,status=yes');
  theWindow.focus()
}

function freeShipping(){
  theWindow = window.open('http://' +wo_base+ '/freeShipping.htm', 'anew', config='height=570,width=430,toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,directories=no,status=no');
  theWindow.focus()
}

function freeCD(){
  theWindow = window.open('http://www.metacog.com', 'anew', config='height=480,width=600,toolbar=yes,menubar=yes,scrollbars=yes,resizable=yes,location=no,directories=no,status=no');
  theWindow.focus()
}

function testimonial(){
  theWindow = window.open('http://' +wo_base+ '/testimonials.htm', 'anew', config='height=520,width=640,toolbar=no,menubar=no,scrollbars=yes,resizable=no,location=no,directories=no,status=no');
  theWindow.focus()
}







//========================================================================================================
//========================================================================================================
//========================================================================================================
//var firstLoad=true;

function positionTextDiv(){
	//alert("begin positionTextDiv()");
  var windowWidth = getWidth();
//  if (windowWidth>770) {
    var autoPartsDetailsStyle = findDOM("auto-parts-details", 1);
    var bufferImageStyle = findDOM("textBuffer", 1);
    var bufferImageObj = findDOM("textBuffer", 0);
    var autoPartsDetailsLeft=0;
    /*
    if (firstLoad) {
      //autoPartsDetailsLeft = parseInt(autoPartsDetailsStyle.left);
      autoPartsDetailsWidth = parseInt(autoPartsDetailsStyle.width);
      firstLoad = false;
    }
    */
    /*
    searchString = document.location.search;
    searchString = searchString.replace("?width=", "");
    searchString *= 1;
    bufferImageObj.width = searchString;
    */
    
    //bufferImageObj.width = 234;
    var bigWindowComp = (windowWidth-800)/2;
    /*
    alert(
      "bigWindowComp: " +bigWindowComp +"\n"+
      "windowWidth: "   +windowWidth
    );
    */
    if(bigWindowComp<0) {bigWindowComp=0;}
    //alert("bigWindowComp: " +bigWindowComp);
    var moveLeft = bigWindowComp+40;
     
    //alert(moveLeft);
    //newLeft = autoPartsDetailsLeft+moveLeft; //this line was shifting it left on every resize
    //alert(newLeft);
    autoPartsDetailsStyle.left = moveLeft;
//  }
    /*
    alert(
      "moveLeft: " +moveLeft+ "\n"+
      "autoPartsDetailsStyle.left: " +autoPartsDetailsStyle.left
    );
    */
	//alert("end positionTextDiv()");
}









//========================================================================================================
//========================================================================================================
//========================================================================================================
bm_base = location.host;

var url = "http://" + bm_base;
var who = "Discount auto parts and auto accessories."
var ver = navigator.appName
var num = parseInt(navigator.appVersion)

function bookmark() {
  if ((ver == "Microsoft Internet Explorer") && (num >= 4)) {
    window.external.AddFavorite(url,who);
  }
  else {
    alert("It's easy to save this page!  Hold down your 'Ctrl' (Control) key and the 'D' key together.  That's it.  You now have a bookmark to this site.  Go to \"Communicator >> Bookmarks\" to see your bookmarks.")
  }
}








//========================================================================================================
//========================================================================================================
//========================================================================================================
function checkYearandMake(theForm){
  if (theForm.catYear.selectedIndex==0 || theForm.catMake.selectedIndex==0)
    {alert("Please select a valid Year and Make"); return false;}
  else {return true;}
}








//========================================================================================================
//========================================================================================================
//========================================================================================================








//========================================================================================================
//========================================================================================================
//========================================================================================================
