
//<script>


//**************************************
//* This script pre-loads all the 
//* menu images do eliminate delay when
//* first hovering over the menu.
//**************************************

{
  storesoff = new Image(185,27);
  storesoff.src = "/images/b_wheretoshop.gif";
  storeson = new Image(185,27);
  storeson.src = "/images/b_wheretoshop_h.gif";
  homeoff = new Image(158,31);
  homeoff.src = "/images/b_home.gif";
  homeon = new Image(158,31);
  homeon.src = "/images/b_home_h.gif";
  productsoff = new Image(158,31);
  productsoff.src = "/images/b_products.gif";
  productson = new Image(158,31);
  productson.src = "/images/b_products_h.gif";
  blogoff = new Image(158,31);
  blogoff.src = "/images/b_blog.gif";
  blogon = new Image(158,31);
  blogon.src = "/images/b_blog_h.gif";
  aboutoff = new Image(158,31);
  aboutoff.src = "/images/b_aboutus.gif";
  abouton = new Image(158,31);
  abouton.src = "/images/b_aboutus_h.gif";
  contactusoff = new Image(158,31);
  contactusoff.src = "/images/b_contactus.gif";
  contactuson = new Image(158,31);
  contactuson.src = "/images/b_contactus_h.gif";
  householdoff = new Image(157,23);
  householdoff.src = "/images/b_household.gif";
  householdon = new Image(157,23);
  householdon.src = "/images/b_household_h.gif";
  featuredproductoff = new Image(157,23);
  featuredproductoff.src = "/images/b_featured.gif";
  featuredproducton = new Image(157,23);
  featuredproducton.src = "/images/b_featured_h.gif";
  shopbyroomb = new Image(435,236);
  shopbyroomb.src = "/images/rb1_shopbyroom.jpg";
  featuredproductb = new Image(435,236);
  featuredproductb.src = "/images/rb2_featuredproduct.jpg";
}


//**************************************
//* This script changes the
//* pre-loaded images when the mouse
//* pointer hovers over them.
//**************************************

function imgSwap(imgName, imgState)
{
  document.getElementById(imgName).src = eval(imgName + imgState + ".src");
}


//**************************************
//* This script changes the
//* pre-loaded images when the mouse
//* pointer hovers over them.
//**************************************

function imgSwapFButton(imgName, imgState)
{
  if ((imgName == "household" && document.getElementById("fpbanner").src.substring(document.getElementById("fpbanner").src.lastIndexOf('/')) != "/rb1_household.jpg") || (imgName == "featuredproduct" && document.getElementById("fpbanner").src.substring(document.getElementById("fpbanner").src.lastIndexOf('/')) != "/rb2_featuredproduct.jpg"))
  {
    document.getElementById(imgName).src = eval(imgName + imgState + ".src");
  }
}


//**************************************
//* This script changes the
//* pre-loaded images when the mouse
//* pointer hovers over them.
//**************************************

function imgSwapFClick(imgName, imgState)
{
  if ((imgName == "household" && document.getElementById("fpbanner").src.substring(document.getElementById("fpbanner").src.lastIndexOf('/')) != "/rb1_household.jpg") || (imgName == "featuredproduct" && document.getElementById("fpbanner").src.substring(document.getElementById("fpbanner").src.lastIndexOf('/')) != "/rb2_household.jpg"))
  {
    if (imgName == "featuredproduct")
    {
      document.getElementById("fpbanner").src = "/images/rb2_featuredproduct.jpg";
      document.getElementById("fplink").href = "/products.aspx";
      document.getElementById("household").src = "/images/b_household.gif";
      document.getElementById("featuredproduct").src = "/images/b_featured_h.gif";
    }
    else
    {
      document.getElementById("fpbanner").src = "/images/rb1_household.jpg";
      document.getElementById("fplink").href = "/products.aspx";
      document.getElementById("featuredproduct").src = "/images/b_featured.gif";
      document.getElementById("household").src = "/images/b_household_h.gif";
    }
  }
}


//**************************************
//* This script changes the
//* featured product banner after a
//* set amount of time.
//**************************************

function bannerSwap()
{
  if (document.getElementById("fpbanner"))
  {
    if (document.getElementById("fpbanner").src.substring(document.getElementById("fpbanner").src.lastIndexOf('/')) == "/rb1_household.jpg") 
    {
      document.getElementById("fpbanner").src = "/images/rb2_featuredproduct.jpg";
      document.getElementById("fplink").href = "/products.aspx";
      document.getElementById("household").src = "/images/b_household.gif";
      document.getElementById("featuredproduct").src = "/images/b_featured_h.gif";
    }
    else
    {
      document.getElementById("fpbanner").src = "/images/rb1_household.jpg";
      document.getElementById("fplink").href = "/products.aspx";
      document.getElementById("featuredproduct").src = "/images/b_featured.gif";
      document.getElementById("household").src = "/images/b_household_h.gif";
    }
  }
  setTimeout("bannerSwap()", 7000);
}


//**************************************
//* This script changes the
//* state of a product menu item
//**************************************

function toggleNodes(list, mitem)
{
  var listElementStyle = document.getElementById(list).style;
  var menuElementClass = document.getElementById(mitem);

  if (listElementStyle.display == "none")
  {
    listElementStyle.display = "block";
    menuElementClass.className = "pmopen";
  }
  else
  {
    listElementStyle.display = "none";
    menuElementClass.className = "pmclosed";
  }
}
