function com_stewartspeak_replacement() {
  /*
    Dynamic Heading Generator
    By Stewart Rosenberger
    http://www.stewartspeak.com/headings/

    This script searches through a web page for specific or general elements
    and replaces them with dynamically generated images, in conjunction with
    a server-side script.
  */

  // replaceSelector(selector, phpfile, wordwrap, fontfile, size, background, foreground, store)
  // replaceSelector("h4","/services/heading.php",false,"font.ttf","12","FFFFFF","999999","build200501");

  var testURL = "/images/test.png" ;
  var doNotPrintImages = false;
  var printerCSS = "/replacement-print.css";
  var hideFlicker = false;
  var hideFlickerCSS = "/replacement-screen.css";
  var hideFlickerTimeout = 1000;

  /* ---------------------------------------------------------------------------
      For basic usage, you should not need to edit anything below this comment.
      If you need to further customize this script's abilities, make sure
      you're familiar with Javascript. And grab a soda or something.
  */

  var items;
  var imageLoaded = false;
  var documentLoaded = false;

  function replaceSelector(selector,url,wordwrap,font,size,foreground,background,store) {
    if(typeof items == "undefined") {
      items = new Array();
    }
    items[items.length] = {selector: selector, url: url, wordwrap: wordwrap, font: font, size: size, foreground: foreground, background: background, store: store};
  }

  if(hideFlicker) {    
    document.write('<link id="hide-flicker" rel="stylesheet" media="screen" href="' + hideFlickerCSS + '" />');    
    window.flickerCheck = function() {
      if(!imageLoaded) {
        setStyleSheetState('hide-flicker',false);
      }
    };
    setTimeout('window.flickerCheck();',hideFlickerTimeout)
  }

  if(doNotPrintImages) {
    document.write('<link id="print-text" rel="stylesheet" media="print" href="' + printerCSS + '" />');
  }

  var test = new Image();
  test.onload = function() { imageLoaded = true; if(documentLoaded) replacement(); };
  test.src = testURL + "?date=" + (new Date()).getTime();

  addLoadHandler(function(){ documentLoaded = true; if(imageLoaded) replacement(); });


  function documentLoad() {
    documentLoaded = true;
    if(imageLoaded) {
      replacement();
    }
  }

  function replacement() {
    if(items) {
      for(var i=0;i<items.length;i++) {
        var elements = getElementsBySelector(items[i].selector);
        if(elements.length > 0) for(var j=0;j<elements.length;j++) {
          if(!elements[j]) {
            continue;
          }

          var text = extractText(elements[j]);
          while(elements[j].hasChildNodes()) {
            elements[j].removeChild(elements[j].firstChild);
          }

          var tokens = items[i].wordwrap ? text.split(' ') : [text] ;
          for(var k=0;k<tokens.length;k++) {
            var url = items[i].url + "?text="+ escape(tokens[k]+' ')+ "&selector="+ escape(items[i].selector)+ "&font="+ escape(items[i].font)+ "&size="+ escape(items[i].size)+ "&foreground="+ escape(items[i].foreground)+"&background="+ escape(items[i].background)+ "&store="+escape(items[i].store);
            var image = document.createElement("img");
            image.className = "replacement";
            image.alt = tokens[k] ;
            image.src = url;
            elements[j].appendChild(image);
          }

          if(doNotPrintImages) {
            var span = document.createElement("span");
            span.style.display = 'none';
            span.className = "print-text";
            span.appendChild(document.createTextNode(text));
            elements[j].appendChild(span);
          }
        }
      }

      if(hideFlicker) {
        setStyleSheetState('hide-flicker',false);
      }
    }
  }

  function addLoadHandler(handler) {
    if(window.addEventListener) {
      window.addEventListener("load",handler,false);
    } else if(window.attachEvent) {
      window.attachEvent("onload",handler);
    } else if(window.onload) {
      var oldHandler = window.onload;
      window.onload = function piggyback() {
        oldHandler();
        handler();
      };
    } else {
      window.onload = handler;
    }
  }

  function setStyleSheetState(id,enabled) {
    var sheet = document.getElementById(id);
    if(sheet) {
      sheet.disabled = (!enabled);
    }
  }

  function extractText(element) {
    if(typeof element == "string") {
      return element;
    } else if(typeof element == "undefined") {
      return element;
    } else if(element.innerText) {
      return element.innerText;
    }

    var text = "";
    var kids = element.childNodes;
    for(var i=0;i<kids.length;i++) {
      if(kids[i].nodeType == 1) {
        text += extractText(kids[i]);
      } else if(kids[i].nodeType == 3) {
        text += kids[i].nodeValue;
      }
    }

    return text;
  }

  /*
    Finds elements on page that match a given CSS selector rule. Some
    complicated rules are not compatible.
    Based on Simon Willison's excellent "getElementsBySelector" function.
    Original code (with comments and description):
    http://simon.incutio.com/archive/2003/03/25/getElementsBySelector
  */
  function getElementsBySelector(selector) {
    var tokens = selector.split(' ');
    var currentContext = new Array(document);
    for(var i=0;i<tokens.length;i++) {
      token = tokens[i].replace(/^\s+/,'').replace(/\s+$/,'');
      if(token.indexOf('#') > -1) {
        var bits = token.split('#');
        var tagName = bits[0];
        var id = bits[1];
        var element = document.getElementById(id);
        if(tagName && element.nodeName.toLowerCase() != tagName)
          return new Array();
        currentContext = new Array(element);
        continue;
      }
      if(token.indexOf('.') > -1) {
        var bits = token.split('.');
        var tagName = bits[0];
        var className = bits[1];
        if(!tagName) {
          tagName = '*';
        }

        var found = new Array;
        var foundCount = 0;
        for(var h=0;h<currentContext.length;h++) {
          var elements;
          if(tagName == '*') {
            elements = currentContext[h].all ? currentContext[h].all : currentContext[h].getElementsByTagName('*');
          } else {
            elements = currentContext[h].getElementsByTagName(tagName);
          }
          for(var j=0;j<elements.length;j++) {
            found[foundCount++] = elements[j];
          }
        }

        currentContext = new Array;
        var currentContextIndex = 0;
        for(var k=0;k<found.length;k++) {
          if(found[k].className && found[k].className.match(new RegExp('\\b'+className+'\\b'))) {
            currentContext[currentContextIndex++] = found[k];
          }
        }
        continue;
      }

      if(token.match(/^(\w*)\[(\w+)([=~\|\^\$\*]?)=?"?([^\]"]*)"?\]$/)) {
        var tagName = RegExp.$1;
        var attrName = RegExp.$2;
        var attrOperator = RegExp.$3;
        var attrValue = RegExp.$4;
        if(!tagName) {
          tagName = '*';
        }

        var found = new Array;
        var foundCount = 0;
        for(var h=0;h<currentContext.length;h++) {
          var elements;
          if(tagName == '*') {
            elements = currentContext[h].all ? currentContext[h].all : currentContext[h].getElementsByTagName('*');
          } else {
            elements = currentContext[h].getElementsByTagName(tagName);
          }

          for(var j=0;j<elements.length;j++) {
            found[foundCount++] = elements[j];
          }
        }

        currentContext = new Array;
        var currentContextIndex = 0;
        var checkFunction;
        switch(attrOperator) {
          case '=':
            checkFunction = function(e) { return (e.getAttribute(attrName) == attrValue); };
          break;
          case '~':
            checkFunction = function(e) { return (e.getAttribute(attrName).match(new RegExp('\\b'+attrValue+'\\b'))); };
          break;
          case '|':
            checkFunction = function(e) { return (e.getAttribute(attrName).match(new RegExp('^'+attrValue+'-?'))); };
          break;
          case '^':
            checkFunction = function(e) { return (e.getAttribute(attrName).indexOf(attrValue) == 0); };
          break;
          case '$':
            checkFunction = function(e) { return (e.getAttribute(attrName).lastIndexOf(attrValue) == e.getAttribute(attrName).length - attrValue.length); };
          break;
          case '*':
            checkFunction = function(e) { return (e.getAttribute(attrName).indexOf(attrValue) > -1); };
          break;
          default :
            checkFunction = function(e) { return e.getAttribute(attrName); };
          break;
        }

        currentContext = new Array;
        var currentContextIndex = 0;
        for(var k=0;k<found.length;k++) {
          if(checkFunction(found[k])) {
            currentContext[currentContextIndex++] = found[k];
          }
        }
        continue;
      }

      tagName = token;
      var found = new Array;
      var foundCount = 0;
      for(var h=0;h<currentContext.length;h++) {
        var elements = currentContext[h].getElementsByTagName(tagName);
        for(var j=0;j<elements.length; j++) {
          found[foundCount++] = elements[j];
        }
      }

      currentContext = found;
    }

    return currentContext;
  }
}

// end of scope, execute code
if(document.createElement && document.getElementsByTagName && !navigator.userAgent.match(/opera\/?6/i)) {
  com_stewartspeak_replacement();
}

// Used for search by rating and search by price menus.
function go(form) {
   window.location = form.range.options[form.range.selectedIndex].value;
}
function submitform()
{
  document.myform.submit();
}
// Standard preload function
function preload_images () {
  var d = document;
  if (!d.imgs) { d.imgs = new Array(); }
  var j = d.imgs.length, args = preload_images.arguments, i;
  for (i = 0; i < args.length; i++) {
    d.imgs[j] = new Image;
    d.imgs[j].src = args[i];
    j++;
  }
}

// Standard bookmark function
function bookmark(title) {
  var urlAddress = location.href;
  var pageName = title;
  var browser = navigator.appName;
  if (browser == 'Microsoft Internet Explorer') {
    window.external.AddFavorite(urlAddress,pageName)
  } else if (browser == 'Netscape') { 
    alert("Your browser does not support this feature.  Use CTRL-D to bookmark this page");
  } else { 
   alert("Your browser does not support this feature.");
  }
}

/* The functions below are cookie functions which can be used for anything site-wide but
   are intended (at the moment) to be used for the dynamic cart quantities */

function getCookie(Name) {
  var search = Name + "=";
  var returnvalue = "";
  if(document.cookie.length > 0) {
    offset = document.cookie.indexOf(search)
    // if cookie exists
    if(offset != -1) { 
      offset += search.length
    }
    // set index of beginning of value
    end = document.cookie.indexOf(";", offset);
    // set index of end of cookie value
    if(end == -1) {
      end = document.cookie.length;
    }
    returnvalue=unescape(document.cookie.substring(offset, end))
  }
  return returnvalue;
}

function setCookie(name,num) {
 //set document cookie
 document.cookie=name+"="+num;
}

function isCookied(name,num) {
 if (getCookie(name)!=num) {
  return true;
 } else {
  return false;
 }
}

/* End Cookie Functions */

/* Dynamic Quantities JavaScript Below */

function priceChange(id,oper,num) {
 // Price Change v1.2:
 // id = the id of the product (so we know what qty box and price to update).
 // oper = what operation to use: dynamic:add:sub:dropdown
 // num = the original price of the product
 //
 // --[ Revisions ]--
 // 20050603 - v1 - Original Script Creation ~Michael@ColorMaria
 // 20050620 - v1.1 - Modified Script to Support Drop-Down Quantity Boxes ~Michael@ColorMaria
 // 20051215 - v1.2 - Added a fix for commas.
 /////////////////////////////////////////////////////////////////////////////////////////////
  if (num == '') {
    num = document.getElementById('hidden_price_' + id).value;
  } 
  if(oper == 'dynamic') {
    // Get the qty value:
    var num2 = 0;
    var qty = document.getElementById('qty_' + id).value;
    // Make sure they didn't go below 1:
    if(qty < 1 || qty == '') {
      document.getElementById('price_' + id).value = '$' + num;
    } else {
      // If they're above one or at 1, do the math for the price:
      num2 = num.replace(',','') * document.getElementById('qty_' + id).value;
      document.getElementById('price_' + id).value = '$' + num2.toFixed(2);
    }
  }
  if(oper == 'add') {
    // Increment the qty box:
    ++document.getElementById('qty_' + id).value;
    // Set qty equal to the new value:
    var qty = document.getElementById('qty_' + id).value;
    if(qty < 1) {
      // Probably not gonna happen, but just in case:
      document.getElementById('qty_' + id).value = '1';
      document.getElementById('price_' + id).value = '$' + num;
    } else {
      // Do the math for the new price:
      num2 = num.replace(',','') * document.getElementById('qty_' + id).value;
      document.getElementById('price_' + id).value = '$' + num2.toFixed(2);
    }
  }
  if(oper == 'sub') {
    // Decrement the value of the qty box:
    --document.getElementById('qty_' + id).value;
    // Set qty = to the new value:
    var qty = document.getElementById('qty_' + id).value;
    if(qty < 1) {
      // Set qty back to 1 if they try to go below 1:
      document.getElementById('qty_' + id).value = '1';
      document.getElementById('price_' + id).value = '$' + num;
    } else {
      // If they're above one or at 1 then do the math for the price:
      num2 = num.replace(',','') * document.getElementById('qty_' + id).value;
    }
  }
  if(oper == 'dropdown') {
    // Set qty = to the new value:
    var qty = document.getElementById('qty_' + id).value;
    if(qty < 1) {
      // Not sure how this will happen, but you never know:
      document.getElementById('qty_' + id).value = '1';
      document.getElementById('price_' + id).value = '$' + num;
    } else {
      // If they're above one or at 1 then do the math for the price:
      num2 = num.replace(',','') * document.getElementById('qty_' + id).value;
    }
  }
  // Some people like to do weird things, like enter letters for a quantity amount, let's not let them:
  if(num2 != '') {
    if(!isNaN(num2)) {
      // if num wasn't NaN then a letter wasn't entered
      document.getElementById('price_' + id).value = '$' + num2.toFixed(2);
    } else {
      // if num was NaN, fix it.
      document.getElementById('price_' + id).value = '$' + num;
      document.getElementById('qty_' + id).value = '';
    }
  }
}

function cartChange(id,num,qty,total) {
 // Cart Change v1.4:
 // id = an id to represent the price and qty (so we know what qty box and price to update).
 // num = the original cost of the item(s) (if there were 3x a 10-dollar item, num would = 30.00).
 // qty = the original quantity that existed in the cart before modification
 // total = the original total of the cart items before modification.
 // 
 // --[ Revisions ]--
 // 20050620 - Original Script Creation ~Michael@ColorMaria
 // 20050629 - Added a line to change the color of the update cart message ~Michael@ColorMaria
 // 20050705 - Added code (accompanied by cookies) to check the quantities of items in the cart
 //          - to see whether they match what the user entered for better checking to see if 
 //          - the update cart button needs to be pressed.
 //          - 
 //          - Please note: This update requires the cookie functions above the priceChange
 //          - function. ~Michael@ColorMaria
 // 20050722 - Added error handling for NaN errors.
 // 20051215 - Fixed a bug with commas
 ///////////////////////////////////////////////////////////////////////////////////////////////
 // Setup our Variables:
  var num2 = 0;
  var qty2 = document.getElementById('qty_' + id).value;
  if(isNaN(qty2)) { // If qty2 isNaN that means someone's made a typo and hit a letter or other non-number key
    document.getElementById('qty_' + id).value = '';
    qty2 = '';
  }
  var num3 = document.getElementById('price_' + id).value.split("$");
  var num3 = num3[1].replace(',','');
  // Check to see if we're dividing by 0:
  if(qty != '0' || !qty) {
    // If not, get the real price (rPrice):
    var rPrice = num.replace(',','') / qty;
  } else {
    // If we are, set the total price for that item to 0:
    document.getElementById('price_' + id).value = '$0.00';
  }
  // Setup our new prices:
  num2 = (rPrice * qty2);
  document.getElementById('price_' + id).value = '$' + num2.toFixed(2);
  // We gotta do this differently depending on if the total we're modifying 
  // is the REAL total or if it's one that was previously modified.
  if(total == document.getElementById('total').value) {
    // If we are modifying the current REAL total, do it this way:
    // Figure out what total would be if the item we're modifying didn't exist.
    total = total - num3;
    // Add the new value to the total:
    total = total + num2;
    document.getElementById('total').value = '$' + total.toFixed(2);
  } else {
    // Setup our fake_total variable so we can essentially do the same 
    // thing we did with the real total
    var fake_total = document.getElementById('total').value.split("$");
    fake_total = fake_total[1].replace(',','');
    // Figure out what the total would be without this product.
    total = fake_total - num3;
    // Readd the new value to the total.
    total = total + num2;
    document.getElementById('total').value = '$' + total.toFixed(2);
  }
  // Just in case they think this will automagically update the real prices for them,
  // setup a fail safe the function below will read and evaluate:
  var nQty = getCookie('quantities');
  arQty = nQty.split('|');
  // Note: the last element of the array will be empty, so ignore it.
  cntQty = arQty.length - 1;
  for(i=0;i<cntQty;i++) {
    arID = arQty[i].split(','); // Hoo Hoo (owl)
    if(document.getElementById('qty_'+arID[0]).value == arID[1]) {
      // It equals the default quantity, yay! No need to update cart.
      document.getElementById('hasUpdated').value = '1';
      // Change the color of the update cart message.
      document.getElementById('update_msg').style.color = '#000';
      continue;
    } else {
      // It doesn't, they need to update.  No need to check further since if one hasn't been updated
      // the whole cart needs to be updated.
      document.getElementById('hasUpdated').value = '0';
      // Change the color of the update cart message so it stands out after a change to the qty is made.
      document.getElementById('update_msg').style.color = '#F00';
      // Break the loop.
      break;
    }
  }
}

function hasUpdated() {
 // Small function to verify that the cart has been updated
 // before checking out or using the continue shopping button.
 //
 // 20060403 - Added fix for when 'hasUpdated' doesn't exist. ~Michael
 ///////////////////////////////////////////////////////////////
  if(typeof document.getElementById('hasUpdated') != 'undefined') {
    var hUpdated = document.getElementById('hasUpdated').value;
    if(hUpdated != '1') {
      alert('You have not updated your cart since last changing your quantities.\nPlease press the \'Update Cart\' button before continuing.');
      return false;
    }
  }
}

/* ** END Dynamic Quantities JS ** */


/* ***************************************
   * verifyRecipients() function.        *
   * Checks the checkout_shippingdetail  *
   * page to ensure that a shipping      *
   * recipient was chosen for each       *
   * product and that there weren't any  *
   * missed recipients.  If gives the    *
   * customer the option of ignoring     *
   * missed ship-tos since that doesn't  *
   * break the checkout it just causes   *
   * blank spaces in some spots.         *
   *                                     *
   * ~Michael - 20060111                 *
   *************************************** */

function verifyRecipients(theForm) {
  var intLength = theForm.length;            // Grab the total length of the form.
  var firstStep = 1, shipTos = new Array();  // Initialize a couple vars to be used later.
  for(var i=0;i<intLength;i++) {             // Loop through the form elements.
    if(firstStep && theForm.elements[i].name.substr(0,4) == 'recp') {
      // If it's the first dropdown setup the number of ship-tos it contains to compare later
      var numShipTos = +theForm.elements[i].options.length - 1;
      // Turn this off so it doesn't repeat this step (it won't hurt anything but would waste processing power).
      firstStep = 0;
    }
    if(theForm.elements[i].name.substr(0,4) == 'recp' && theForm.elements[i].value == '') {
      // If we encounter a dropdown that hasn't had a ship-to selected..
      alert('You must choose a recipient for each of the products you are purchasing.');
      return false;
    } else if (theForm.elements[i].name.substr(0,4) == 'recp') {
      // Otherwise add the item to an array to compare later.
      var shipTo = theForm.elements[i].selectedIndex;
      if(!in_array(shipTo, shipTos)) {
        // If the ship-to isn't in the array already, add it.
        var stLen = shipTos.length;
        shipTos.push(shipTo);
      }
    }
  }
  if(shipTos.length != numShipTos) {
    // If the # of ship-tos in the array don't match the number of ship-tos that exist, prompt the user
    var verifyShipTos = confirm("Some of your shipping address do not have products assigned to them.\n\nDo you wish to continue anyway?");
    if(verifyShipTos) {
      // User says it's OK
      return true;
    } else {
      // User says it's not OK
      return false;
    }
  }
  // If we've gotten this far, everything on the form has checked out OK.
  return true;
}

/* ***************************************
   * in_array() function for JS.         *
   * Works the same as the PHP function. *
   *                                     *
   * ~Michael - 20060111                 *
   * ~Michael - Fixed undefined vars     *
   *            20060111                 *
   *************************************** */

function in_array(needle, haystack) {
  if(typeof needle == undefined) {
    // If needle is undefined:
    alert("Needle is undefined.\nError: in_array");
    return false;
  } else if(typeof haystack == undefined) {
    alert("Needle is undefined.\nError: in_array");
    return false;
  }
  for(i=0,n=haystack.length;i<n;i++) {
    // Loop through the array.
    if(haystack[i] == needle) {
      // If the needle was found:
      return true;
    }
  }
  // If the code reaches this point, needle wasn't found:
  return false;
}

/* ************************
   * noHammer() function  *
   * Prevents form submit *
   * button hammering.    *
   *                      *
   * ~Michael - 20060403  *
   ************************ */

function noHammer(theForm) {
  if(typeof theForm.submit != 'undefined') {
    theForm.submit.disabled = true;
    theForm.submit.value = 'Wait...';
    return true;
  }
}

/* ************************
   * validateForgotForm() *
   * Checks for a valid   *
   * email before submit  *
   *                      *
   * ~Michael - 20060905  *
   ************************ */
function validateForgotForm(theForm) {
  var theEmail=theForm.email;
  var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
  if((theEmail.value==null)||(theEmail.value=="")) {
    document.getElementById('errorMsg').innerHTML="<br />Please enter a valid e-mail address before continuing.";
    theEmail.focus();
    return false;
  } else {
    if(!filter.test(theEmail.value)) {
      document.getElementById('errorMsg').innerHTML="<br />Please enter a valid e-mail address before continuing.";
      theEmail.value="";
      theEmail.focus();
      return false;
    }
  }
  return true;
}
function getObj(name)
{
	if (document.getElementById)
	{
		this.obj = document.getElementById(name);
	}else if (document.all){
		this.obj = document.all[name];
		this.style = this.obj.style;
	}else if (document.layers){
		this.obj = document.layers[name];
		this.style = this.obj;
	} 
	return this.obj;
} 
// Start For Tabbase Programming
function TabPanelDisplay(value) {
var idlist = new Array('relatedbatterytabfocus','relatedchargerstabfocus','relatedeliminatorstabfocus','relatedbatterytabready','relatedchargerstabready','relatedeliminatorstabready','relatedbatterycontent','relatedchargerscontent','relatedeliminatorscontent');

if(arguments.length < 1) { return; }
for(var i = 0; i < idlist.length; i++) {
   var block = false;
   for(var ii = 0; ii < arguments.length; ii++) {
      if(idlist[i] == arguments[ii]) {
         block = true;
         break;
         }
      }
   var idlistObj=new getObj(idlist[i]);
   if (idlistObj != null && idlistObj.style!= null)
   {
   if(block)
   {
        idlistObj.style.display = "block";
   }
   else
   {
        idlistObj.style.display = "none";
   }
   }
}
}
function TabPaneladaptersDisplay(value) {
var idlist = new Array('relatedbatterytabfocus','relatedchargerstabfocus','relatedadapterstabfocus','relatedbatterytabready','relatedchargerstabready','relatedadapterstabready','relatedbatterycontent','relatedchargerscontent','relatedadapterscontent');

if(arguments.length < 1) { return; }
for(var i = 0; i < idlist.length; i++) {
   var block = false;
   for(var ii = 0; ii < arguments.length; ii++) {
      if(idlist[i] == arguments[ii]) {
         block = true;
         break;
         }
      }
   var idlistObj=new getObj(idlist[i]);
   if (idlistObj != null && idlistObj.style!= null)
   {
   if(block)
   {
        idlistObj.style.display = "block";
   }
   else
   {
        idlistObj.style.display = "none";
   }
   }
}
}
function TabPanelBatteryDisplay(value) {
var idlist = new Array('relatedbatterytabfocus','relatedbatterycontent');

if(arguments.length < 1) { return; }
for(var i = 0; i < idlist.length; i++) {
   var block = false;
   for(var ii = 0; ii < arguments.length; ii++) {
      if(idlist[i] == arguments[ii]) {
         block = true;
         break;
         }
      }
   var idlistObj=new getObj(idlist[i]);
   if (idlistObj != null && idlistObj.style!= null)
   {
   if(block)
   {
        idlistObj.style.display = "block";
   }
   else
   {
        idlistObj.style.display = "none";
   }
   }
}
}
function toUnicode(elmnt,content){
    if (content.length==elmnt.maxLength){
      next=elmnt.tabIndex
      if (next<document.recall.elements.length){
        document.recall.elements[next].focus()
    }
  }
}
//End Tabbase programming
//////////////////////////////////////////////////////////////////////////////////////////
// DreamWeaver's functions.

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function ResetForm(which){
var pass=true
var first=-1
if (document.images){
for (i=0;i<which.length;i++){
var tempobj=which.elements[i]
 if (tempobj.type=="text"){
  eval(tempobj.value="")
  if (first==-1) {first=i}
 }
 else if (tempobj.type=="checkbox") {
  eval(tempobj.checked=0)
  if (first==-1) {first=i}
 }
 else if (tempobj.col!="") {
  eval(tempobj.value="")
  if (first==-1) {first=i}
 }
}
}
which.elements[first].focus()
return false
}
function echeck(str)
{
	var at="@";
	var dot=".";
	var lat=str.indexOf(at);
	var lstr=str.length;
	var ldot=str.indexOf(dot);
	if (str.indexOf(at)==-1)
	{
		return false;
	}
	if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr)
	{
		return false;
	}
	if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr)
	{
		return false;
	}
	if (str.indexOf(at,(lat+1))!=-1)
	{
		return false;
	}
	if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot)
	{
		return false;
	}
	if (str.indexOf(dot,(lat+2))==-1)
	{
		return false;
	}
	if (str.indexOf(" ")!=-1)
	{
		return false;
	}
	return true;
}
var digits = "0123456789";
var phoneNumberDelimiters = "()- ";
var validWorldPhoneChars = phoneNumberDelimiters + "+";
var minDigitsInIPhoneNumber = 10;
function isInteger(s)
{
	var i;
	for (i = 0; i < s.length; i++)
	{
		// Check that current character is number.
		var c = s.charAt(i);
		if (((c < "0") || (c > "9"))) return false;
	}
	return true;
}
function stripCharsInBag(s, bag)
{
	var i;
	var returnString = "";
	for (i = 0; i < s.length; i++)
	{
		var c = s.charAt(i);
		if (bag.indexOf(c) == -1) returnString += c;
	}
	return returnString;
}
function checkInternationalPhone(strPhone)
{
	s=stripCharsInBag(strPhone,validWorldPhoneChars);
	return (isInteger(s) && s.length >= minDigitsInIPhoneNumber);
}
function QuotationFormCheck()
{ 
	var errorMsg = "";
	if (document.ship_form.Quotation_Requested.value == "")
	{
		errorMsg += "\nEnter Quotation Requested";
	}
	if (document.ship_form.Quantity.value == "")
	{
		errorMsg += "\nEnter Quantity";
	}else{
		if (isInteger(document.ship_form.Quantity.value)==false)
		{
			errorMsg += "\nEnter Valid Quantity";
		}
	}
	if (document.ship_form.Contact_Name.value == "")
	{
		errorMsg += "\nEnter Contact Name";
	}
	if (document.ship_form.Phone_Number.value == "")
	{
		errorMsg += "\nEnter Phone Number";
	}else{
		if (checkInternationalPhone(document.ship_form.Phone_Number.value)==false)
		{
			errorMsg += "\nEnter Valid Phone Number";
		}
	}
	if (document.ship_form.from.value == "")
	{
		errorMsg += "\nEnter Email Address";
	}else{
		if (echeck(document.ship_form.from.value)==false)
		{
			errorMsg += "\nEnter Valid Email Address";
		}
	}
	if (errorMsg != "")
	{
		msg = "______________________________________________________________\n\n";
		msg += "Your enquiry has not been sent because there are problem(s) with the form.\n";
		msg += "Please correct the problem(s) and re-submit the form.\n";
		msg += "______________________________________________________________\n\n";
		msg += "The following field(s) need to be corrected: -\n";
		errorMsg += alert(msg + errorMsg + "\n\n");
		return false;
	}
	return true;
}
function RecallFormCheck()
{ 
	var errorMsg = "";
	if (document.recall.txtFirstName.value == "")
	{
		errorMsg += "\nEnter First Name";
	}
        if (document.recall.txtLastName.value == "")
	{
		errorMsg += "\nEnter Last Name";
	}
	if (document.recall.txtEmail.value == "")
	{
		errorMsg += "\nEnter Email Address";
	}else{
		if (echeck(document.recall.txtEmail.value)==false)
		{
			errorMsg += "\nEnter Valid Email Address";
		}
	}
	if (errorMsg != "")
	{
		msg = "______________________________________________________________\n\n";
		msg += "Your enquiry has not been sent because there are problem(s) with the form.\n";
		msg += "Please correct the problem(s) and re-submit the form.\n";
		msg += "______________________________________________________________\n\n";
		msg += "The following field(s) need to be corrected: -\n";
		errorMsg += alert(msg + errorMsg + "\n\n");
		return false;
	}
	return true;
}
function RefundFormCheck()
{ 
	var errorMsg = "";
	if (document.refund.txtPhoneNumber.value == "")
	{
		errorMsg += "\nEnter Phone Number";
	}
    if (document.refund.txtStreet1.value == "")
	{
		errorMsg += "\nEnter Street1";
	}
	if (document.refund.txtCity.value == "")
	{
		errorMsg += "\nEnter City";
	}
	if (document.refund.txtState.value == "")
	{
		errorMsg += "\nEnter State";
	}
	if (document.refund.txtZip.value == "")
	{
		errorMsg += "\nEnter Zip";
	}
	if (document.refund.txtCountry.value == "")
	{
		errorMsg += "\nEnter Country";
	}
	if (errorMsg != "")
	{
		msg = "______________________________________________________________\n\n";
		msg += "Your enquiry has not been sent because there are problem(s) with the form.\n";
		msg += "Please correct the problem(s) and re-submit the form.\n";
		msg += "______________________________________________________________\n\n";
		msg += "The following field(s) need to be corrected: -\n";
		errorMsg += alert(msg + errorMsg + "\n\n");
		return false;
	}
	return true;
}
function ContactFormCheck()
{ 
	var errorMsg = "";
	myOption = -1;
	for (i=document.checkout.shipping_type1.length-1; i > -1; i--)
	{
		if (document.checkout.shipping_type1[i].checked)
		{
			myOption = i; i = -1;
		}
	}
	if (document.checkout.first_name.value == "")
	{
		errorMsg += "\nEnter First Name";
	}
	if (myOption == -1)
	{
		errorMsg += "\nSelect Shipping Type";
	}
	if (document.checkout.email.value == "")
	{
		errorMsg += "\nEnter Email Address";
	}else{
		if (echeck(document.checkout.email.value)==false)
		{
			errorMsg += "\nEnter Valid Email Address";
		}
	}
	if (document.checkout.phone.value == "")
	{
		errorMsg += "\nEnter Phone Number";
	}else{
		if (checkInternationalPhone(document.checkout.phone.value)==false)
		{
			errorMsg += "\nEnter Valid Phone Number";
		}
	}
    if (errorMsg != "")
	{
		msg = "______________________________________________________________\n\n";
		msg += "Your enquiry has not been sent because there are problem(s) with the form.\n";
		msg += "Please correct the problem(s) and re-submit the form.\n";
		msg += "______________________________________________________________\n\n";
		msg += "The following field(s) need to be corrected: -\n";
		errorMsg += alert(msg + errorMsg + "\n\n");
		return false;
	}
	return true;
}
function BestPriceFormCheck()
{ 
	var errorMsg = "";
	if (document.ship_form.Contact_Name.value == "")
	{
		errorMsg += "\nEnter Contact Name";
	}
	if (document.ship_form.Phone_Number.value == "")
	{
		errorMsg += "\nEnter Phone Number";
	}else{
		if (checkInternationalPhone(document.ship_form.Phone_Number.value)==false)
		{
			errorMsg += "\nEnter Valid Phone Number";
		}
	}
	if (document.ship_form.from.value == "")
	{
		errorMsg += "\nEnter Email Address";
	}else{
		if (echeck(document.ship_form.from.value)==false)
		{
			errorMsg += "\nEnter Valid Email Address";
		}
	}
	if (document.ship_form.Country.value == "")
	{
		errorMsg += "\nEnter Country";
	}
	if (errorMsg != "")
	{
		msg = "______________________________________________________________\n\n";
		msg += "Your enquiry has not been sent because there are problem(s) with the form.\n";
		msg += "Please correct the problem(s) and re-submit the form.\n";
		msg += "______________________________________________________________\n\n";
		msg += "The following field(s) need to be corrected: -\n";
		errorMsg += alert(msg + errorMsg + "\n\n");
		return false;
	}
	return true;
}
function WorkWithUsFormCheck()
{ 
	var errorMsg = "";
	if (document.ship_form.Name.value == "")
	{
		errorMsg += "\nEnter Your Name";
	}
	if (document.ship_form.Phone_Number.value == "")
	{
		errorMsg += "\nEnter Phone Number";
	}else{
		if (checkInternationalPhone(document.ship_form.Phone_Number.value)==false)
		{
			errorMsg += "\nEnter Valid Phone Number";
		}
	}
	if (document.ship_form.from.value == "")
	{
		errorMsg += "\nEnter Email Address";
	}else{
		if (echeck(document.ship_form.from.value)==false)
		{
			errorMsg += "\nEnter Valid Email Address";
		}
	}
	if (document.ship_form.Country.value == "")
	{
		errorMsg += "\nEnter Country";
	}
    if (errorMsg != "")
	{
		msg = "______________________________________________________________\n\n";
		msg += "Your enquiry has not been sent because there are problem(s) with the form.\n";
		msg += "Please correct the problem(s) and re-submit the form.\n";
		msg += "______________________________________________________________\n\n";
		msg += "The following field(s) need to be corrected: -\n";
		errorMsg += alert(msg + errorMsg + "\n\n");
		return false;
	}
	return true;
}
function CallMeNowFormCheck()
{ 
	var errorMsg = "";
	if (document.ship_form.country.value == "")
	{
		errorMsg += "\nEnter Country";
	}
	if (document.ship_form.Phone_Number.value == "")
	{
		errorMsg += "\nEnter Phone Number";
	}else{
		if (checkInternationalPhone(document.ship_form.Phone_Number.value)==false)
		{
			errorMsg += "\nEnter Valid Phone Number";
		}
	}
    if (document.ship_form.Full_Name.value == "")
	{
		errorMsg += "\nEnter Contact Name";
	}
    if (errorMsg != "")
	{
		msg = "______________________________________________________________\n\n";
		msg += "Your enquiry has not been sent because there are problem(s) with the form.\n";
		msg += "Please correct the problem(s) and re-submit the form.\n";
		msg += "______________________________________________________________\n\n";
		msg += "The following field(s) need to be corrected: -\n";
		errorMsg += alert(msg + errorMsg + "\n\n");
		return false;
	}
	return true;
}
function PayLessFormCheck()
{ 
	var errorMsg = "";
	if (document.ship_form.Contact_Name.value == "")
	{
		errorMsg += "\nEnter Contact Name";
	}
	if (document.ship_form.Phone_Number.value == "")
	{
		errorMsg += "\nEnter Phone Number";
	}else{
		if (checkInternationalPhone(document.ship_form.Phone_Number.value)==false)
		{
			errorMsg += "\nEnter Valid Phone Number";
		}
	}
    if (document.ship_form.from.value == "")
	{
		errorMsg += "\nEnter Email Address";
	}else{
		if (echeck(document.ship_form.from.value)==false)
		{
			errorMsg += "\nEnter Valid Email Address";
		}
	}
	if (document.ship_form.Current_Price.value == "")
	{
		errorMsg += "\nEnter Current Price";
	}else{
		if (isInteger(document.ship_form.Current_Price.value)==false)
		{
			errorMsg += "\nEnter Valid Current Price";
		}
	}
    if (document.ship_form.Current_Vendor.value == "")
	{
		errorMsg += "\nEnter Current Vendor";
	}
	if (errorMsg != "")
	{
		msg = "______________________________________________________________\n\n";
		msg += "Your enquiry has not been sent because there are problem(s) with the form.\n";
		msg += "Please correct the problem(s) and re-submit the form.\n";
		msg += "______________________________________________________________\n\n";
		msg += "The following field(s) need to be corrected: -\n";
		errorMsg += alert(msg + errorMsg + "\n\n");
		return false;
	}
	return true;
}
function TellAFriendFormCheck()
{ 
	var errorMsg = "";
	if (document.ship_form.from_first.value == "")
	{
		errorMsg += "\nEnter From First Name";
	}
	if (document.ship_form.from_email.value == "")
	{
		errorMsg += "\nEnter From Email Address";
	}else{
		if (echeck(document.ship_form.from_email.value)==false)
		{
			errorMsg += "\nEnter Valid From Email Address";
		}
	}
	if (document.ship_form.to_first.value == "")
	{
		errorMsg += "\nEnter To First Name";
	}
	if (document.ship_form.to_email.value == "")
	{
		errorMsg += "\nEnter To Email Address";
	}else{
		if (echeck(document.ship_form.to_email.value)==false)
		{
			errorMsg += "\nEnter Valid To Email Address";
		}
	}
    if (errorMsg != "")
	{
		msg = "______________________________________________________________\n\n";
		msg += "Your enquiry has not been sent because there are problem(s) with the form.\n";
		msg += "Please correct the problem(s) and re-submit the form.\n";
		msg += "______________________________________________________________\n\n";
		msg += "The following field(s) need to be corrected: -\n";
		errorMsg += alert(msg + errorMsg + "\n\n");
		return false;
	}
	return true;
}
function ProductNotFoundFormCheck()
{ 
	var errorMsg = "";
	if (document.ship_form.Looking_For.value == "")
	{
		errorMsg += "\nEnter What You Looking For";
	}
	if (document.ship_form.First_Name.value == "")
	{
		errorMsg += "\nEnter First Name";
	}
	if (document.ship_form.Last_Name.value == "")
	{
		errorMsg += "\nEnter Last Name";
	}
	if (document.ship_form.Contact_Phone.value == "")
	{
		errorMsg += "\nEnter Contact Phone";
	}else{
		if (checkInternationalPhone(document.ship_form.Contact_Phone.value)==false)
		{
			errorMsg += "\nEnter Valid Contact Phone";
		}
	}
	if (document.ship_form.from.value == "")
	{
		errorMsg += "\nEnter Email Address";
	}else{
		if (echeck(document.ship_form.from.value)==false)
		{
			errorMsg += "\nEnter Valid Email Address";
		}
	}
	if (errorMsg != "")
	{
		msg = "______________________________________________________________\n\n";
		msg += "Your enquiry has not been sent because there are problem(s) with the form.\n";
		msg += "Please correct the problem(s) and re-submit the form.\n";
		msg += "______________________________________________________________\n\n";
		msg += "The following field(s) need to be corrected: -\n";
		errorMsg += alert(msg + errorMsg + "\n\n");
		return false;
	}
	return true;
}
function clearBoxhome(selectbox)
{
	var selectObj=new getObj(selectbox);
	if (selectObj != null && selectObj.options != null)
    {
		var counting=selectObj.options.length;
	}else{
		var counting="0";
	}
	var j;
	for(j=counting;j>0;j--)
	{
		selectObj.options[j] = null;
	}
}
function submitbuttonhome()
{
	var modelindexvalue=document.findabattery.model.options[document.findabattery.model.selectedIndex].value;
	var partindexvalue=document.findabattery.part.options[document.findabattery.part.selectedIndex].value;
	if((modelindexvalue=="Choose Your Device Model No" && partindexvalue=="Choose Your Device Part Number") || (modelindexvalue=="" && partindexvalue=="")){
		alert("Select Device Model Number or Part Number");
	}else{
		if(modelindexvalue=="Choose Your Device Model No" || modelindexvalue=="")
		{
			var URL="http://www.laptopbatterystore.com/category/"+partindexvalue;
			window.location.href=URL;
		}else{
			var URL="http://www.laptopbatterystore.com/category/"+modelindexvalue;
			window.location.href=URL;
		}
	}
}
function addOptionhome(selectbox, selectvalue)
{
	var modelObj=new getObj('model');
	var partObj=getObj('part');
	var selectObj=new getObj(selectbox);
	if(selectbox=="model")
	{
		for (var s = 1; s<mymodelcat.length; s++)
		{
			var mycatmodel_array=mymodelcat[s].split(":");
			var mycatmodel_parent=mycatmodel_array[0];
			var mycatmodel_id=mycatmodel_array[1];
			var mycatmodel_name=mycatmodel_array[2];
			var model_new_name=mycatmodel_array[2].split(" ");
			var mynewcatmodel_name="";
			for (var m = 1; m<model_new_name.length; m++)
			{
				mynewcatmodel_name=mynewcatmodel_name + model_new_name[m] + " ";
			}
			if(selectvalue==mycatmodel_parent)
			{
				var leng1=document.forms['findabattery'].model.options.length;
				document.forms['findabattery'].model.options[leng1] = new Option(mynewcatmodel_name,mycatmodel_id);
			}
		}
		for (var t = 1; t<mypartcat.length; t++)
		{
			var mycatpart_array=mypartcat[t].split(":");
			var mycatpart_parent=mycatpart_array[0];
			var mycatpart_id=mycatpart_array[1];
			var mycatpart_name=mycatpart_array[2];
			
			var part_new_name=mycatpart_array[2].split(" ");
			var mynewcatpart_name="";
			for (var p = 1; p<part_new_name.length; p++)
			{
				mynewcatpart_name=mynewcatpart_name + part_new_name[p] + " ";
			}
			if(selectvalue==mycatpart_parent)
			{
				var leng2=document.forms['findabattery'].part.options.length;
				document.forms['findabattery'].part.options[leng2] = new Option(mynewcatpart_name,mycatpart_id);
			}
		}
	}else{
		for (var k = 1; k<mycat.length; k++)
		{
			var mycat_array=mycat[k].split(":");
			var mycat_parent=mycat_array[0];
			var mycat_id=mycat_array[1];
			var mycat_name=mycat_array[2];
			var series_new_name=mycat_name.split(" ");
			var mynewseries_name="";
			for (var g = 1; g<series_new_name.length; g++)
			{
				mynewseries_name=mynewseries_name + series_new_name[g] + " ";
			}
			if(selectvalue==mycat_parent)
			{
				if (selectObj != null && selectObj.options != null)
				{
					selectObj.options[selectObj.options.length] = new Option(mynewseries_name,mycat_id);

				}
			}
		}
	}
}
function clearBoxcategory(selectbox)
	{
		var selectObj=new getObj(selectbox);
		if (selectObj != null && selectObj.options != null)
		{
			var counting=selectObj.options.length;
		}else{
			var counting="0";
		}
		var j;
		for(j=counting;j>0;j--)
		{
			selectObj.options[j] = null;
		}
	}
	function submitbuttoncategory()
	{
		var modelindexvalue=document.findabattery.model.options[document.findabattery.model.selectedIndex].value;
		var partindexvalue=document.findabattery.part.options[document.findabattery.part.selectedIndex].value;
		if((modelindexvalue=="Choose Your Device Model No" && partindexvalue=="Choose Your Device Part Number") || (modelindexvalue=="" && partindexvalue=="")){
			alert("Select Device Model Number or Part Number");
		}else{
			if(modelindexvalue=="Choose Your Device Model No" || modelindexvalue=="")
			{
				var URL="http://www.cutratebatteries.com/category/"+partindexvalue;
				window.location.href=URL;
			}else{
				var URL="http://www.cutratebatteries.com/category/"+modelindexvalue;
				window.location.href=URL;
			}
		}
	}
	function addOptioncategory(selectbox, selectvalue)
	{
		var modelObj=new getObj('model');
		var partObj=getObj('part');
		var selectObj=new getObj(selectbox);
		if(selectbox=="model")
		{
			for (var t = 1; t<mypartcat.length; t++)
			{
				var mycatpart_array=mypartcat[t].split(":");
				var mycatpart_parent=mycatpart_array[0];
				var mycatpart_id=mycatpart_array[1];
				var mycatpart_name=mycatpart_array[2];

				var part_new_name=mycatpart_array[2].split(" ");
				var mynewcatpart_name="";
				for (var p = 1; p<part_new_name.length; p++)
				{
					mynewcatpart_name=mynewcatpart_name + part_new_name[p] + " ";
				}
				if(selectvalue==mycatpart_parent)
				{
					var leng=document.forms['findabattery'].part.options.length;
					document.forms['findabattery'].part.options[leng] = new Option(mynewcatpart_name,mycatpart_id);
				}
			}
			for (var s = 1; s<mymodelcat.length; s++)
			{
				var mycatmodel_array=mymodelcat[s].split(":");
				var mycatmodel_parent=mycatmodel_array[0];
				var mycatmodel_id=mycatmodel_array[1];
				var mycatmodel_name=mycatmodel_array[2];
				var model_new_name=mycatmodel_array[2].split(" ");
				var mynewcatmodel_name="";
				for (var m = 1; m<model_new_name.length; m++)
				{
					mynewcatmodel_name=mynewcatmodel_name + model_new_name[m] + " ";
				}
				
				if(selectvalue==mycatmodel_parent)
				{
					var leng1=document.forms['findabattery'].model.options.length;
					document.forms['findabattery'].model.options[leng1] = new Option(mynewcatmodel_name,mycatmodel_id);
				}
			}
		}else{
			for (var k = 1; k<mycat.length; k++)
			{
				var mycat_array=mycat[k].split(":");
				var mycat_parent=mycat_array[0];
				var mycat_id=mycat_array[1];
				var mycat_name=mycat_array[2];
				if(selectvalue==mycat_parent)
				{
					if (selectObj != null && selectObj.options != null)
					{
						selectObj.options[selectObj.options.length] = new Option(mycat_name,mycat_id);

					}
				}
			}
		}
	}
// Script Source: CodeLifter.com
// Copyright 2003
// Do not remove this notice.

// SETUPS:
// ===============================

// Set the horizontal and vertical position for the popup

PositionX = 100;
PositionY = 100;

// Set these value approximately 20 pixels greater than the
// size of the largest image to be used (needed for Netscape)

defaultWidth  = 500;
defaultHeight = 500;

// Set autoclose true to have the window close automatically
// Set autoclose false to allow multiple popup windows

var AutoClose = true;

// Do not edit below this line...
// ================================
if (parseInt(navigator.appVersion.charAt(0))>=4){
var isNN=(navigator.appName=="Netscape")?1:0;
var isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}
var optNN='scrollbars=no,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY;
var optIE='scrollbars=no,width=150,height=100,left='+PositionX+',top='+PositionY;
function popImage(imageURL,imageTitle){
if (isNN){imgWin=window.open('about:blank','',optNN);}
if (isIE){imgWin=window.open('about:blank','',optIE);}
with (imgWin.document){
writeln('<html><head><title>Loading...</title><style>body{margin:0px;}</style>');writeln('<sc'+'ript>');
writeln('var isNN,isIE;');writeln('if (parseInt(navigator.appVersion.charAt(0))>=4){');
writeln('isNN=(navigator.appName=="Netscape")?1:0;');writeln('isIE=(navigator.appName.indexOf("Microsoft")!=-1)?1:0;}');
writeln('function reSizeToImage(){');writeln('if (isIE){');writeln('window.resizeTo(300,300);');
writeln('width=300-(document.body.clientWidth-document.images[0].width);');
writeln('height=300-(document.body.clientHeight-document.images[0].height);');
writeln('window.resizeTo(width,height);}');writeln('if (isNN){');       
writeln('window.innerWidth=document.images["George"].width;');writeln('window.innerHeight=document.images["George"].height;}}');
writeln('function doTitle(){document.title="'+imageTitle+'";}');writeln('</sc'+'ript>');
if (!AutoClose) writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()">')
else writeln('</head><body bgcolor=000000 scroll="no" onload="reSizeToImage();doTitle();self.focus()" onblur="self.close()">');
writeln('<img name="George" src='+imageURL+' style="display:block"></body></html>');
close();		
}}
// End DreamWeaver's functions.
function sack(file) {
	this.xmlhttp = null;

	this.resetData = function() {
		this.method = "POST";
  		this.queryStringSeparator = "?";
		this.argumentSeparator = "&";
		this.URLString = "";
		this.encodeURIString = true;
  		this.execute = false;
  		this.element = null;
		this.elementObj = null;
		this.requestFile = file;
		this.vars = new Object();
		this.responseStatus = new Array(2);
  	};

	this.resetFunctions = function() {
  		this.onLoading = function() { };
  		this.onLoaded = function() { };
  		this.onInteractive = function() { };
  		this.onCompletion = function() { };
  		this.onError = function() { };
		this.onFail = function() { };
	};

	this.reset = function() {
		this.resetFunctions();
		this.resetData();
	};

	this.createAJAX = function() {
		try {
			this.xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e1) {
			try {
				this.xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e2) {
				this.xmlhttp = null;
			}
		}

		if (! this.xmlhttp) {
			if (typeof XMLHttpRequest != "undefined") {
				this.xmlhttp = new XMLHttpRequest();
			} else {
				this.failed = true;
			}
		}
	};

	this.setVar = function(name, value){
		this.vars[name] = Array(value, false);
	};

	this.encVar = function(name, value, returnvars) {
		if (true == returnvars) {
			return Array(encodeURIComponent(name), encodeURIComponent(value));
		} else {
			this.vars[encodeURIComponent(name)] = Array(encodeURIComponent(value), true);
		}
	}

	this.processURLString = function(string, encode) {
		encoded = encodeURIComponent(this.argumentSeparator);
		regexp = new RegExp(this.argumentSeparator + "|" + encoded);
		varArray = string.split(regexp);
		for (i = 0; i < varArray.length; i++){
			urlVars = varArray[i].split("=");
			if (true == encode){
				this.encVar(urlVars[0], urlVars[1]);
			} else {
				this.setVar(urlVars[0], urlVars[1]);
			}
		}
	}

	this.createURLString = function(urlstring) {
		if (this.encodeURIString && this.URLString.length) {
			this.processURLString(this.URLString, true);
		}

		if (urlstring) {
			if (this.URLString.length) {
				this.URLString += this.argumentSeparator + urlstring;
			} else {
				this.URLString = urlstring;
			}
		}

		// prevents caching of URLString
		this.setVar("rndval", new Date().getTime());

		urlstringtemp = new Array();
		for (key in this.vars) {
			if (false == this.vars[key][1] && true == this.encodeURIString) {
				encoded = this.encVar(key, this.vars[key][0], true);
				delete this.vars[key];
				this.vars[encoded[0]] = Array(encoded[1], true);
				key = encoded[0];
			}

			urlstringtemp[urlstringtemp.length] = key + "=" + this.vars[key][0];
		}
		if (urlstring){
			this.URLString += this.argumentSeparator + urlstringtemp.join(this.argumentSeparator);
		} else {
			this.URLString += urlstringtemp.join(this.argumentSeparator);
		}
	}

	this.runResponse = function() {
		eval(this.response);
	}

	this.runAJAX = function(urlstring) {
		if (this.failed) {
			this.onFail();
		} else {
			this.createURLString(urlstring);
			if (this.element) {
				this.elementObj = document.getElementById(this.element);
			}
			if (this.xmlhttp) {
				var self = this;
				if (this.method == "GET") {
					totalurlstring = this.requestFile + this.queryStringSeparator + this.URLString;
					this.xmlhttp.open(this.method, totalurlstring, true);
				} else {
					this.xmlhttp.open(this.method, this.requestFile, true);
					try {
						this.xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
					} catch (e) { }
				}


				this.xmlhttp.onreadystatechange = function() {
					switch (self.xmlhttp.readyState) {
						case 1:
							self.onLoading();
							break;
						case 2:
							self.onLoaded();
							break;
						case 3:
							self.onInteractive();
							break;
						case 4:
							self.response = self.xmlhttp.responseText;
							self.responseXML = self.xmlhttp.responseXML;
							self.responseStatus[0] = self.xmlhttp.status;
							self.responseStatus[1] = self.xmlhttp.statusText;

							if (self.execute) {
								self.runResponse();
							}

							if (self.elementObj) {
								elemNodeName = self.elementObj.nodeName;
								elemNodeName.toLowerCase();
								if (elemNodeName == "input"
								|| elemNodeName == "select"
								|| elemNodeName == "option"
								|| elemNodeName == "textarea") {
									self.elementObj.value = self.response;
								} else {
									self.elementObj.innerHTML = self.response;
								}
							}
							if (self.responseStatus[0] == "200") {
								self.onCompletion();
							} else {
								self.onError();
							}

							self.URLString = "";
							break;
					}
				};

				this.xmlhttp.send(this.URLString);
			}
		}
	};

	this.reset();
	this.createAJAX();
}
function getBatteryList(sel)
{
	var brandCode = sel.options[sel.selectedIndex].value;
	document.getElementById('brand').options.length = "0";
	document.getElementById('model').options.length = "0";
	document.getElementById('part').options.length = "0";
	if(brandCode.length>0){
        ajax.requestFile= '/select_brand/'+brandCode;	// Specifying which file to get
		ajax.onCompletion = createBrand;// Specify function that will be executed after file has been found
		ajax.runAJAX();// Execute AJAX function
	}
}
function createBrand()
{
   var ajaxresponse=ajax.response;
   ajaxresponse = ajaxresponse.replace(/^[\s]+/,'').replace(/[\s]+$/,'').replace(/[\s]{2,}/,' ');
   var valuearray=ajaxresponse.split(":");
   valuearray.sort();
   var leng1=document.forms['findabattery'].brand.options.length;
   document.forms['findabattery'].brand.options[leng1] = new Option('Select Series','');
   var leng22=document.forms['findabattery'].model.options.length;
   document.forms['findabattery'].model.options[leng22] = new Option('Select Model No','');
   var leng33=document.forms['findabattery'].part.options.length;
   document.forms['findabattery'].part.options[leng33] = new Option('Select Part No','');
   for (var z=0; z<valuearray.length; z++)
   {
       var namearray=valuearray[z].split(">");
       var leng1=document.forms['findabattery'].brand.options.length;
	   var splitarray=namearray[0].split(" ");
	   var catname="";
	   if(splitarray[1]=="")
	   {
			catname=namearray[0];
	   }else{
		   for (var r=1; r<splitarray.length; r++)
		   {
				catname=catname+" "+splitarray[r];
		   }
	   }
	   var catname = catname.replace(/^[\s]+/,'').replace(/[\s]+$/,'').replace(/[\s]{2,}/,' ');
	   var catidstring = namearray[1]+"::"+catname;
	   document.forms['findabattery'].brand.options[leng1] = new Option(catname,catidstring);
   }
}
function getBrandList(sel)
{
	getModelNoList(sel);
}
function getPartNoList(sel)
{
	var PartNoCode = sel.options[sel.selectedIndex].value;
	document.getElementById('part').options.length = 0;
	if(PartNoCode.length>0){
        ajax.requestFile= '/select_part/'+PartNoCode;
        ajax.onCompletion = createPartNo;
        ajax.runAJAX();
	}
}
function getModelNoList(sel)
{
	var ModelNoCode = sel.options[sel.selectedIndex].value;
	document.getElementById('model').options.length = 0;
	var PartNoCode = sel.options[sel.selectedIndex].value;
	document.getElementById('part').options.length = 0;
	if(ModelNoCode.length>0){
        ajax.requestFile= '/select_model/'+ModelNoCode;	// Specifying which file to get
		ajax.onCompletion = createModelNo;// Specify function that will be executed after file has been found
		ajax.runAJAX();
	}
	if(PartNoCode.length>0){
        ajax1.requestFile= '/select_part/'+PartNoCode;
		ajax1.onCompletion = createPartNo;
        ajax1.runAJAX();
	}
}
function createPartNo()
{
   var ajaxresponse11=ajax1.response;
   ajaxresponse11 = ajaxresponse11.replace(/^[\s]+/,'').replace(/[\s]+$/,'').replace(/[\s]{2,}/,' ');
   var valuearray11=ajaxresponse11.split(":");
   valuearray11.sort();
   var leng11=document.forms['findabattery'].part.options.length;
   document.forms['findabattery'].part.options[leng11] = new Option('Select Part No','');
   for (var y=0; y<valuearray11.length; y++)
   {
       var namearray11=valuearray11[y].split(">");
       var leng11=document.forms['findabattery'].part.options.length;
	   var splitarray=namearray11[0].split(" ");
	   var catname="";
	   for (var q=1; q<splitarray.length; q++)
       {
			catname=catname+" "+splitarray[q];
	   }
	   var catname = catname.replace(/^[\s]+/,'').replace(/[\s]+$/,'').replace(/[\s]{2,}/,' ');
       document.forms['findabattery'].part.options[leng11] = new Option(catname,namearray11[1]);
   }
}
function createModelNo()
{
   var ajaxresponse1=ajax.response;
   ajaxresponse1 = ajaxresponse1.replace(/^[\s]+/,'').replace(/[\s]+$/,'').replace(/[\s]{2,}/,' ');
   var valuearray1=ajaxresponse1.split(":");
   valuearray1.sort();
   var leng2=document.forms['findabattery'].model.options.length;
   document.forms['findabattery'].model.options[leng2] = new Option('Select Model No','');
   for (var x=0; x<valuearray1.length; x++)
   {
       var namearray1=valuearray1[x].split(">");
       var leng2=document.forms['findabattery'].model.options.length;
	   var splitarray=namearray1[0].split(" ");
	   var catname="";
	   for (var p=1; p<splitarray.length; p++)
       {
			catname=catname+" "+splitarray[p];
	   }
	   var catname = catname.replace(/^[\s]+/,'').replace(/[\s]+$/,'').replace(/[\s]{2,}/,' ');
       document.forms['findabattery'].model.options[leng2] = new Option(catname,namearray1[1]);
   }
}
function getObj(name)
{
	if (document.getElementById)
	{
		this.obj = document.getElementById(name);
	}else if (document.all){
		this.obj = document.all[name];
		this.style = this.obj.style;
	}else if (document.layers){
		this.obj = document.layers[name];
		this.style = this.obj;
	} 
	return this.obj;
} 
function populateSecondDropBox(selectvalue,selectbox)
{
	var modelObj=new getObj('model');
	var partObj=new getObj('part');
	var brandObj=new getObj('brand');
	if(selectbox=='modeldisabled')
	{
		if(selectvalue!='')
		{
			modelObj.disabled=true;
		}else{
			modelObj.disabled=false;
		}
	}else{
		modelObj.disabled=false;
	}
	if(selectbox=='partdisabled')
	{
		if(selectvalue!='')
		{
			partObj.disabled=true;
		}else{
			partObj.disabled=false;
		}
	}else{
		partObj.disabled=false;
	}
}
//////////////////////////////////////////////////////////////////////////////////////////


var opacitySpeed = 2;	// Speed of opacity - switching between large images - Lower = faster
	var opacitySteps = 10; 	// Also speed of opacity - Higher = faster
	var slideSpeed = 5;	// Speed of thumbnail slide - Lower = faster
	var slideSteps = 8;	// Also speed of thumbnail slide - Higher = faster
	var columnsOfThumbnails = 4;	// Hardcoded number of thumbnail columns, use false if you want the script to figure it out dynamically.
	
	/* Don't change anything below here */
	var DHTMLgoodies_largeImage = false;
	var DHTMLgoodies_imageToShow = false;
	var DHTMLgoodies_currentOpacity = 100;
	var DHTMLgoodies_slideWidth = false;
	var DHTMLgoodies_thumbTotalWidth = false;
	var DHTMLgoodies_viewableWidth = false;
	
	var currentUnqiueOpacityId = false;
	var DHTMLgoodies_currentActiveImage = false;
	var DHTMLgoodies_thumbDiv = false;
	var DHTMLgoodies_thumbSlideInProgress = false;
	
	var browserIsOpera = navigator.userAgent.indexOf('Opera')>=0?true:false;
	var leftArrowObj;
	var rightArrowObj;
	var thumbsColIndex = 1;
	var thumbsLeftPos = false;
	
	function initGalleryScript()
	{
		DHTMLgoodies_largeImage = document.getElementById('DHTMLgoodies_largeImage').getElementsByTagName('IMG')[0];
		var innerDiv = document.getElementById('DHTMLgoodies_thumbs_inner');
		DHTMLgoodies_slideWidth = innerDiv.getElementsByTagName('DIV')[0].offsetWidth;
		DHTMLgoodies_thumbDiv = document.getElementById('DHTMLgoodies_thumbs_inner');
		DHTMLgoodies_thumbDiv.style.left = '0px';
		
		var subDivs = DHTMLgoodies_thumbDiv.getElementsByTagName('DIV');
		DHTMLgoodies_thumbTotalWidth = 0;
		var tmpLeft = 0;
		for(var no=0;no<subDivs.length;no++){
			if(subDivs[no].className=='strip_of_thumbnails'){
				DHTMLgoodies_thumbTotalWidth = DHTMLgoodies_thumbTotalWidth + DHTMLgoodies_slideWidth;
				subDivs[no].style.left = tmpLeft + 'px';
				subDivs[no].style.top = '0px';
				tmpLeft = tmpLeft + subDivs[no].offsetWidth;
			}
		}

		DHTMLgoodies_viewableWidth = document.getElementById('DHTMLgoodies_thumbs').offsetWidth;
		
		
		DHTMLgoodies_currentActiveImage = DHTMLgoodies_thumbDiv.getElementsByTagName('A')[0].getElementsByTagName('IMG')[0];
		DHTMLgoodies_currentActiveImage.className='activeImage';
	}
	
	function moveThumbnails()
	{
		if(DHTMLgoodies_thumbSlideInProgress)return;
		DHTMLgoodies_thumbSlideInProgress = true;
		if(this.id=='DHTMLgoodies_leftArrow'){
			thumbsColIndex--;
			rightArrowObj.style.visibility='visible';
			if(DHTMLgoodies_thumbDiv.style.left.replace('px','')/1>=0){
				leftArrowObj.style.visibility='hidden';
				DHTMLgoodies_thumbSlideInProgress = false;
				return;
			}
			
			slideThumbs(slideSteps,0);
			
		}else{
			thumbsColIndex++;
			leftArrowObj.style.visibility='visible';
			var left = DHTMLgoodies_thumbDiv.style.left.replace('px','')/1;	
			var showArrow = true;
			if(DHTMLgoodies_thumbTotalWidth + left - DHTMLgoodies_slideWidth <= DHTMLgoodies_viewableWidth)showArrow = false;
			if(columnsOfThumbnails)showArrow = true;
				
			if(!showArrow)	
			{
				rightArrowObj.style.visibility='hidden';
				DHTMLgoodies_thumbSlideInProgress = false;
				return;
			}	
			
			slideThumbs((slideSteps*-1),0);
		}	
		
	}
	
	function slideThumbs(speed,currentPos)
	{
		var leftPos;
		if(thumbsLeftPos){
			leftPos= thumbsLeftPos;
		}else{
			var leftPos = DHTMLgoodies_thumbDiv.style.left.replace('px','')/1;
			thumbsLeftPos = leftPos;
		}
		currentPos = currentPos + Math.abs(speed);		
		var tmpLeftPos = leftPos;
		leftPos = leftPos + speed;
		thumbsLeftPos = leftPos;
		DHTMLgoodies_thumbDiv.style.left = leftPos + 'px';
		if(currentPos<DHTMLgoodies_slideWidth)setTimeout('slideThumbs(' + speed + ',' + currentPos + ')',slideSpeed);else{
			if(tmpLeftPos>=0 || (columnsOfThumbnails && thumbsColIndex==1)){
				document.getElementById('DHTMLgoodies_leftArrow').style.visibility='hidden';
			}	
			var left = tmpLeftPos;		
			var showArrow = true;
			if(DHTMLgoodies_thumbTotalWidth + left - DHTMLgoodies_slideWidth <= DHTMLgoodies_viewableWidth)showArrow=false;
			if(columnsOfThumbnails){
				if((thumbsColIndex+1)<columnsOfThumbnails)showArrow=true; else showArrow = false;				
			}			
			if(!showArrow){
				document.getElementById('DHTMLgoodies_rightArrow').style.visibility='hidden';
			}					
			DHTMLgoodies_thumbSlideInProgress = false;
		}
	
	}
	
	function showPreview(imagePath,inputObj)
	{		
		if(DHTMLgoodies_currentActiveImage){
			if(DHTMLgoodies_currentActiveImage==inputObj.getElementsByTagName('IMG')[0])return;
			DHTMLgoodies_currentActiveImage.className='';
		}
		DHTMLgoodies_currentActiveImage = inputObj.getElementsByTagName('IMG')[0];
		DHTMLgoodies_currentActiveImage.className='activeImage';
		
		DHTMLgoodies_imageToShow = imagePath;
		var tmpImage = new Image();
		tmpImage.src = imagePath;
		currentUnqiueOpacityId = Math.random();
		moveOpacity(opacitySteps*-1,currentUnqiueOpacityId);
	}
	
	function setOpacity()
	{
		if(document.all)
		{
			DHTMLgoodies_largeImage.style.filter = 'alpha(opacity=' + DHTMLgoodies_currentOpacity + ')';
		}else{
			DHTMLgoodies_largeImage.style.opacity = DHTMLgoodies_currentOpacity/100;
		}		
	}
	function moveOpacity(speed,uniqueId)
	{
		
		if(browserIsOpera){
			DHTMLgoodies_largeImage.src = DHTMLgoodies_imageToShow;
			return;
		}
		
		DHTMLgoodies_currentOpacity = DHTMLgoodies_currentOpacity + speed;
		if(DHTMLgoodies_currentOpacity<=5 && speed<0){
		
			var tmpParent = DHTMLgoodies_largeImage.parentNode; 
			DHTMLgoodies_largeImage.parentNode.removeChild(DHTMLgoodies_largeImage);
			DHTMLgoodies_largeImage = document.createElement('IMG');
			tmpParent.appendChild(DHTMLgoodies_largeImage);
			setOpacity();
			DHTMLgoodies_largeImage.src = DHTMLgoodies_imageToShow;
		
			speed=opacitySteps;
		}
		if(DHTMLgoodies_currentOpacity>=99 && speed>0)DHTMLgoodies_currentOpacity=99;		
		setOpacity();	
		if(DHTMLgoodies_currentOpacity>=99 && speed>0)return;		
		if(uniqueId==currentUnqiueOpacityId)setTimeout('moveOpacity(' + speed + ',' + uniqueId + ')',opacitySpeed);		
	}

function printContent(id){
str=document.getElementById(id).innerHTML
newwin=window.open('','printwin','left=50,top=50,width=600,height=600')
newwin.document.write('<HTML>\n<HEAD>\n')
newwin.document.write('<TITLE>Sales Receipt: LaptopBatteryStore.com</TITLE>\n')
newwin.document.write('<link rel="stylesheet" type="text/css" href="/styles.css" />\n')
newwin.document.write('<script>\n')
newwin.document.write('function chkstate(){\n')
newwin.document.write('if(document.readyState=="complete"){\n')
newwin.document.write('window.close()\n')
newwin.document.write('}\n')
newwin.document.write('else{\n')
newwin.document.write('setTimeout("chkstate()",2000)\n')
newwin.document.write('}\n')
newwin.document.write('}\n')
newwin.document.write('function print_win(){\n')
newwin.document.write('window.print();\n')
newwin.document.write('chkstate();\n')
newwin.document.write('}\n')
newwin.document.write('<\/script>\n')
newwin.document.write('</HEAD>\n')
newwin.document.write('<BODY onload="print_win()" style="background:#ffffff;">\n')
newwin.document.write('<img src="/images/logo-laptop-battery-store.gif" border="0"><br><br>\n')
newwin.document.write(str)
newwin.document.write('</BODY>\n')
newwin.document.write('</HTML>\n')
newwin.document.close()
}

  /**********************
   * Start Methods Object
   * scanners - first store to implement: use their cart.js if no better one is available
   **********************/

  function Methods(sCountry) {
    this.country = sCountry;
    this.us      = Array('UPS Ground','UPS 3 Day','UPS 2nd Day Air',
                         'UPS Next Day Air');
    this.foreign = Array('UPS Worldwide Expedited','UPS Worldwide Express');
  }

  Methods.prototype.getMethods = function () {
    if (this.country == 'United States') {
      return this.us;
    } else {
      return this.foreign;
    }
  }

  Methods.prototype.clearBox = function (oBox) {
    if (oBox == null || typeof oBox == 'undefined') { // In case it really didn't exist. :)
      return false;
    }
    for (var i=0,n=oBox.options.length;i<n;i++) {
      oBox.options[0] = null;
    }
    if (arguments[1] != null) {
      oBox.options[0] = new Option(arguments[1],'');
    }
  }

  Methods.prototype.lockElement = function (e) {
    if (e == null) {
      return false;
    }
    if (typeof e.readOnly != 'undefined') {
      e.readOnly = true;
    } else if (typeof e.disabled != 'undefined') {
      e.disabled = true;
    }
  }

  Methods.prototype.unlockElement = function (e) {
    if (e == null) {
      return false;
    }
    if (typeof e.readOnly != 'undefined') {
      e.readOnly = false;
    } else if (typeof e.disabled != 'undefined') {
      e.disabled = false;
    }
  }

  Methods.prototype.printResults = function (oBox) {
    if (this.serverResponse == '') {
      alert('Error: No response from server.');
      return false;
    } else if (!this.serverResponse.match(/^Error/)) {
      var arMethods = (this.serverResponse.match(/\|/)) ? this.serverResponse.split('|') : new Array(this.serverResponse);
      this.clearBox(oBox);
      for (var i=0,n=arMethods.length;i<n;i++) {
        var sMeth = arMethods[i].replace(/ - .*$/,'');
        oBox.options[oBox.options.length] = new Option(arMethods[i],sMeth);
      }
      if (this.validMethod != null) { oBox.value = this.validMethod; }
    }
  }

  /********************
   * End Methods Object
   ********************/

  function doMethods(sCountry,sBoxID) {
    oMethods     = new Methods(sCountry); // Create instance of Methods object globally
    oBox         = document.getElementById(sBoxID); // Should never not exist, set globally
    var aMeths   = oMethods.getMethods(); // Get methods, only needed in this function

    if (arguments[2] == 'kf') { // Need to handle things differently
      if (arguments[3] != null) { var e = (arguments[3] != null) ? arguments[3] : window.event; }
      var zipField = document.getElementById('sZipField1');
      var cityField = document.getElementById('s_city1');
      if ((e != null && e.keyCode != '13') || e == null) {
        if (typeof keyTimer != 'undefined') {
          clearTimeout(keyTimer);
        }
        if (sCountry != '' && ((sCountry == 'United States' && zipField.value != '') || (sCountry != 'United States' && cityField.value != ''))) {
          oMethods.lockElement(zipField);
          oMethods.lockElement(cityField);
          var params = '?store=scanners&country='+sCountry+'&zip='+zipField.value+'&smethods='+aMeths.join(',');
          if (sCountry != 'United States') {
            params += '&city='+cityField.value;
          }
          // callServer is defined in shipEstimator.js
          oMethods.clearBox(oBox,'Querying server...');
          keyTimer = setTimeout('callServer(\''+params+'\',\'getMethodsWithPrices\')',1000);
          oMethods.unlockElement(zipField);
          oMethods.unlockElement(cityField);
          return false;
        } else if (zipField.value == '') {
          oMethods.clearBox(oBox,'Enter your Ship Zip/Postal Code');
        } else if (sCountry == '') {
          oMethods.clearBox(oBox,'Enter your Ship Country');
        } else if (sCountry != 'United States' && cityField.value == '') {
          oMethods.clearBox(oBox,'Enter your Ship City/Province');
        }
      }
    } else {
      oMethods.clearBox(oBox); // Clear the dropdown.

      for (var i=0,n=aMeths.length;i<n;i++) {
        oBox.options[oBox.options.length] = new Option(aMeths[i],aMeths[i]); // Add new methods sequentially.
      }
    }

    //delete oMethods; // Object will be recreated if it's needed again.
  }



function hideShowCalc(recip) {
 recip = (recip != '') ? '_'+recip : '';
 if (document.getElementById('cart_ship_estimator'+recip) != null && typeof document.getElementById('cart_ship_estimator'+recip) != 'undefined') {
   var div = document.getElementById('cart_ship_estimator'+recip);
   var link = document.getElementById('hideShowCalc'+recip);
 } else {
   return false;
 }
 div.style.display = (div.style.display == 'block') ? 'none' : 'block';
 link.innerHTML = (div.style.display == 'block') ? 'Hide Details' : 'Show Details';
}
