<!--
var opera = navigator.userAgent.indexOf("Opera") != -1;
var ie5   = navigator.userAgent.indexOf("MSIE 5") != -1 && !opera;
var ie6   = navigator.userAgent.indexOf("MSIE 6") != -1 && !opera;

function repositionMenus() {
  // to fix an IE issue where the menu jumps around or disappears, toggle the position from static to relative
  if (document.getElementById) {
    var productMenu = document.getElementById("productMenu");
    var topMenu     = document.getElementById("topMenu");
    productMenu.style.position = 'static';
    productMenu.style.position = 'relative';
    topMenu.style.position = 'static';
    topMenu.style.position = 'relative';
    }
  }

function popupWindowSized(thisHref,thisTarget,w,h) {
  var screenHeight = 600; // default to 800x600 screen
  var screenWidth  = 800;
  if (window.screen && window.screen.height && window.screen.height) {
    screenHeight = window.screen.height;
    screenWidth  = window.screen.width;
    }
  screenHeight = screenHeight-60;  // allow room for taskbars, etc.
  screenWidth  = screenWidth-40;
  if (screenHeight < h)
    h = screenHeight;
  if (screenWidth < w)
    w = screenWidth;
  var winProps = "toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,scrollbars=auto,width=" + w + ",height=" + h + ",left=5,top=5";
  var popupWin = window.open(thisHref,thisTarget,winProps);
  popupWin.focus();
  }

function writeEmailAddress(addressee,subject,domain) {
  if (writeEmailAddress.arguments.length < 3 || domain == "") {
    domain = "babybestbuy.com";
    }
  var emailAddress = addressee + "@" + domain;
  if (writeEmailAddress.arguments.length < 2) {
    subject = "Inquiry from " + domain;
    }
  document.write("<a href=\"mailto:" + emailAddress + "?subject=" + subject + "\">" + emailAddress + "</a>");
  }

/* MOUSEOVER FUNCTIONS */

function applyMouseover(img) {
  // change the following variables to reflect the naming conventions of your mouseover images
  var offExt  = "_OFF";
  var overExt = "_OVER";
  var pattern = /^(.+)(_OFF)\.(gif|jpg|jpeg|jpe|png)$/;
  if (img.src && img.src.match(pattern)) {
    img.outSrc  = img.src;
    img.overSrc = img.src.replace(pattern, "$1"+overExt+".$3");
    addEvent(img,'mouseover',function() {this.src = this.overSrc},false);
    addEvent(img,'mouseout',function() {this.src = this.outSrc},false);
    if (!document.preloads)
      document.preloads = new Array();
    else
      var p = document.preloads.length;
    document.preloads[p]     = new Image;
    document.preloads[p].src = img.overSrc;
    }
  }

function createMouseovers(node) {
  if (node == null)
    node = document;
  var imgs = document.getElementsByTagName('IMG');
  for (var i = 0; i < imgs.length; i++) {
    applyMouseover(imgs[i]);
    }
  }

// Accept any number of image sources for preloadings (separate with commas)
function preloadImages() {
  if (document.images) {
    if (!document.preloads)
      document.preloads = new Array();
    var i, j, p = document.preloads.length, a = preloadImages.arguments;
    // Check to see if the preload already exists in the array, and if so, exit function
    for (i=0; i<p; i++) {
      for (j=0; j<a.length; j++) {
        if (document.preloads[i].src == a[j])
          return;
        }
      }
    // Add preload to array
    for (j=0; j<a.length; j++) {
      document.preloads[p]       = new Image;
      document.preloads[p++].src = a[j];
      }
    }
  }

/* COOKIE FUNCTIONS */

function cookieGet(name) {
  var cookies = document.cookie.split(";");
  for (var i = 0; i < cookies.length; i++) {
    var a = cookies[i].split("=");
    if (a.length == 2 && a[0].trim() == name)
      return unescape(a[1].trim());
    }
  return "";
  }

function cookieSet(name, value, days) {
  var date = new Date();
  date.setTime(date.getTime()+(days*24*60*60*1000));
  document.cookie = name + "=" + escape(value) + "; expires=" + date.toGMTString() + "; path=/"; // expiry = 0 expires at end of session, but doesn't work in IE
  }

function cookieDel(name) {
  document.cookie = name + "=; expires=Thu, 01-Jan-70 00:00:01 GMT; path=/";
  }

/* EVENT FUNCTION (http://www.dustindiaz.com/top-ten-javascript/) */

function addEvent(obj, type, fn, useCapture) {
  if (obj == null)
    obj = window;
  if (obj.addEventListener) {
    obj.addEventListener( type, fn, useCapture );
    }
  else if (obj.attachEvent) {
    obj["e"+type+fn] = fn;
    obj[type+fn] = function() { obj["e"+type+fn]( window.event ); }
    obj.attachEvent( "on"+type, obj[type+fn] );
    }
  else {
    obj["on"+type] = obj["e"+type+fn];
    }
  }

/* HELPER FUNCTIONS */

if (typeof String.prototype.trim == "undefined") {
  String.prototype.trim = function() {
    var s = this.replace(/^\s*/, "");
    return s.replace(/\s*$/, "");
    }
  }

// Iterates through all class names for an object and returns true if specified class name is found
function hasClassName(obj, className) {
  if (obj && obj.className) {
    var objClass = obj.className.trim();
    arrClasses = objClass.split(" ");
    for (var c=0; c<arrClasses.length; c++) {
      if (className == arrClasses[c])
        return true;
      }
    }
  return false;
  }

/* EVENTS */

addEvent(window,'load',function() { createMouseovers() },false);
/*
addEvent(window,'load',function() { if (document.getElementById && document.getElementById('productMenu')) { loadMenu() }},false);
addEvent(window,'load',function() { if (ie6 && document.getElementById && document.getElementById('productMenu')) { repositionMenus() }},false);
addEvent(window,'resize',function() { if (ie6 && document.getElementById && document.getElementById('productMenu')) { setTimeout("repositionMenus()",1) }},false);
*/
//-->
