  function replaceSifrFonts (pageLevel) {
    if ((!window.location.hash.blank() && window.location.hash.match(/nosifr/))||RF.getCookie('nosifr')) {
      return;
    }

    var gillsanslight = {
          "src": "/flooring/i/swf/gillsanslight.swf",
          "ratios": [10,1.32,16,1.27,17,1.23,18,1.25,25,1.23,29,1.21,34,1.22,35,1.2,36,1.21,48,1.2,73,1.19,77,1.18,78,1.19,1.18]
        };
    sIFR.activate(gillsanslight);
    var bodyTag = $(document.body);
    if (bodyTag.hasClassName('popup')) {
      sIFR.replace(gillsanslight, {
        "elements": $$('h1'),
        "offsetTop" : 0,
        "css": {".sIFR-root": {"font-size": "30px","color": "#666666"}},
        "wmode": "transparent"
      });
      if (bodyTag.hasClassName('dealerFilter') && $('h2')) {
          sIFR.replace(gillsanslight, {
            "elements": [$('h2')],
            "css": {".sIFR-root": {"font-size": "20px","leading": -1,"color": "#666666"}},
            "wmode": "transparent"
          });
        }
    } else if (4==pageLevel) {
      if ($('h1')) {
        sIFR.replace(gillsanslight, {
          "elements": [$('h1')],
          "offsetTop" : 0,
          "css": {".sIFR-root": {"font-size": "30px","color": "#666666"}},
          "wmode": "transparent"
        });
      }
      if ($('h2')) {
        sIFR.replace(gillsanslight, {
          "elements": [$('h2')],
          "css": {".sIFR-root": {"font-size": "20px","leading": -1,"color": "#666666"}},
          "wmode": "transparent"
        });
      }
    } else if (3==pageLevel) {
      sIFR.replace(gillsanslight, {
        "elements": [$('h1')],
        "offsetTop" : -1,
        "css": {".sIFR-root": {"font-size": "60px","color": "#FFFFFF","text-transform": "uppercase"}},
        "wmode": "transparent",
        "filters": {"DropShadow": {"knockout": false,"distance": 5,"angle": 90,"blurX": 7,"blurY": 7,"color": "#333333","strength": .3}}
      });
      if ($('h2')) {
        sIFR.replace(gillsanslight, {
          "elements": [$('h2')],
          "offsetTop" : 5,
          "css": {".sIFR-root": {"font-size": "17px","letter-spacing": 1.15,"leading": 0,"color": "#FFFFFF","text-transform": "uppercase"}},
          "wmode": "transparent",
          "filters": {"DropShadow": {"knockout": false,"distance": 5,"angle": 90,"blurX": 7,"blurY": 7,"color": "#333333","strength": .3}},
          "sharpness": 110,
          "antiAliasType": "advanced"
        });
      }
    } else if (2==pageLevel) {
      sIFR.replace(gillsanslight, {
        "elements": [$('h1')],
        "wmode": "transparent",
        "offsetTop" : 0,
        "css": {".sIFR-root": {"font-size": "75px","color": "#FFFFFF","text-transform": "uppercase"}},
        "filters": {"DropShadow": {"knockout": false,"distance": 5,"angle": 90,"blurX": 7,"blurY": 7,"color": "#333333","strength": .3}}
      });
      if ($('h2')) {
        sIFR.replace(gillsanslight, {
          "elements": [$('h2')],
          "wmode": "transparent",
          "offsetTop" : 5,
          "css": {".sIFR-root": {"font-size": "18px","leading": 0,"letter-spacing": 1.15,"color": "#FFFFFF","text-transform": "uppercase"}},
          "filters": {"DropShadow": {"knockout": false,"distance": 5,"angle": 90,"blurX": 7,"blurY": 7,"color": "#333333","strength": .3}},
          "sharpness": 110,
          "antiAliasType": "advanced"
        });
      }
    }
  }
  function initNavBarRollovers () {
    $$(".headerNavTab").each( function(objThis) {
      objThis.onmouseover = aTab_onmouseover;
      objThis.onmouseout = aTab_onmouseout;
    });
  }
  function aTab_onmouseover () {
    new Effect.Morph(this, {
      "style": "padding-top: 5px;",
      "duration": 0.11
    });
    this.style.backgroundImage = this.style.backgroundImage.replace("_normal", "_hover");
  }
  function aTab_onmouseout () {
    new Effect.Morph(this, {
      "style": "padding-top: 0px;",
      "duration": 0.09,
      "queue": "end"
    });
    this.style.backgroundImage = this.style.backgroundImage.replace("_hover", "_normal");
  }
  function initTocRollovers() {
      $$(".toc li a").each(function(objThis){
        objThis.onmouseover = tocA_onmouseover;
        objThis.onmouseout = tocA_onmouseout;
      });
  }
  function tocA_onmouseover() {
    var colorTemp = this.up("div").getStyle("backgroundColor");
    switch (colorTemp) {
      case "#944C2A": case "rgb(148, 76, 42)": colorTemp = "#a66a4e"; break;
      case "#C69038": case "rgb(198, 144, 56)": colorTemp = "#d2a662"; break;
      case "#3b6342": case "rgb(59, 99, 66)": colorTemp = "#5c7d62"; break;
      case "#2E4C60": case "rgb(46, 76, 96)": colorTemp = "#516a7b"; break;
      case "#84262A": case "rgb(132, 38, 42)": colorTemp = "#994b4e"; break;
    }
    var newBG = new Element("div", {style:"position: absolute; top: 0; width: 160px; height 25px; z-index:1;"});
    newBG.setStyle({"backgroundColor":colorTemp});
    newBG.update("&nbsp;");
    if (this.up("li").up("li")) {
      newBG.setStyle({"left":"-20px"})
    } else if (this.up("li")) {
      newBG.setStyle({"left":"0px"});
    }
    this.up("li").insert({"top":newBG});
  }
  function tocA_onmouseout() {
    if (this.up("li") && this.up("li").down("div")) {
      this.up("li").down("div").remove();
    }
  }
  function initButtonRollovers () {
    $$("input.buttonSubmit").each( function (buttonTemp) {
      var sOrigBG = buttonTemp.getStyle("backgroundImage");
      var sHoverBG = sOrigBG.replace("_normal", "_hover")
      buttonTemp.sOrigBG = sOrigBG; buttonTemp.style.backgroundImage = sHoverBG;
      buttonTemp.sHoverBG = sHoverBG; buttonTemp.style.backgroundImage = sOrigBG;
      buttonTemp.onmouseover = function() {this.style.backgroundImage = this.sHoverBG};
      buttonTemp.onmouseout = function() {this.style.backgroundImage = this.sOrigBG};
    });
    $$("a.buttonBlank").each( function (buttonTemp) {
      // check is contains span - if not - insert one (cm bug)
      if (buttonTemp.getElementsByTagName('SPAN').length==0) {
        buttonTemp.innerHTML = "<span>" + buttonTemp.innerHTML + "</span>";
      }
      var sOrigBG_right = buttonTemp.getStyle("backgroundImage");
      var sHoverBG_right = sOrigBG_right.replace("_normal", "_hover")
      var sOrigBG_left = buttonTemp.down("span").getStyle("backgroundImage");
      var sHoverBG_left = sOrigBG_left.replace("_normal", "_hover")
      buttonTemp.sOrigBG_right = sOrigBG_right; buttonTemp.style.backgroundImage = sHoverBG_right;
      buttonTemp.sHoverBG_right = sHoverBG_right; buttonTemp.style.backgroundImage = sOrigBG_right;
      buttonTemp.sOrigBG_left = sOrigBG_left; buttonTemp.down("span").style.backgroundImage = sHoverBG_left;
      buttonTemp.sHoverBG_left = sHoverBG_left; buttonTemp.down("span").style.backgroundImage = sOrigBG_left;
      buttonTemp.onmouseover = function() {this.style.backgroundImage = this.sHoverBG_right; this.down("span").style.backgroundImage = this.sHoverBG_left;};
      buttonTemp.onmouseout = function() {this.style.backgroundImage = this.sOrigBG_right; this.down("span").style.backgroundImage = this.sOrigBG_left;};
    });
  }
  function initTabComponents () {
    var tabTitle;
    var tabFirst = true;
    var largestHeight = 0;
    var currentX = 0;
    var defaultTab = null;
    $$("div.tabComponent").each( function(tabComponent) {
      var clickSecond = false;
      var hardCodedHeight = Number(tabComponent.readAttribute('force-height'));
      tabComponent.toggleClassName("tabComponent-outlined");
      tabTitle = tabComponent.select("div.tabComponent-tabTitle");
      tabComponent.select("div.tabComponent-tabTitle").each( function(tabTemp) {
        if (tabFirst) {
          tabTemp.up("div").selectedTab = tabTemp;
          tabTemp.addClassName("tabComponent-tabCurrent");
          tabTemp.next("div.tabComponent-tabContents").addClassName("tabComponent-visible");
          clickSecond = (tabTemp.select("a").length>0);

          tabFirst = false;
        } else {
          tabTemp.next("div.tabComponent-tabContents").style.visibility = "hidden";
          tabTemp.next("div.tabComponent-tabContents").addClassName("tabComponent-hidden");
          if (tabTemp.hasClassName('tab-default')) {
            defaultTab = tabTemp;
          }
        }
        tabTemp.setStyle({position: "absolute",
                          top: "0px",
                          left : (currentX + "px")});
        tabTemp.next("div").style.width = tabTemp.up("div").getWidth() - 2;
        currentX += tabTemp.getWidth();
        tabTemp.relatedContent = tabTemp.next("div.tabComponent-tabContents");
        tabTemp.next("div.tabComponent-tabContents").setStyle({position: "absolute", top: "25px", left: "0px"});
        if (hardCodedHeight) {
          largestHeight = hardCodedHeight;
        } else {
          largestHeight = (tabTemp.next("div").getHeight() > largestHeight) ? tabTemp.next("div").getHeight() : largestHeight;
        }
        tabTemp.next("div").style.border = "none";
        tabTemp.onmouseover = function () {
          if (this != this.up("div").selectedTab) {
            this.addClassName("tabComponent-tabRollover");
          }
        }
        tabTemp.onmouseout = function () {
          if (this != this.up("div").selectedTab) {
            this.removeClassName("tabComponent-tabRollover");
          }
        }
        tabTemp.onclick = function () {
          if (this != this.up("div").selectedTab) {
            if (this.select("a").length>0) {
              window.location = this.down("a").href;
              return;
            }
            this.up("div").selectedTab.removeClassName("tabComponent-tabCurrent");
            this.up("div").selectedTab.removeClassName("tabComponent-tabRollover");
            this.up("div").selectedTab.relatedContent.style.visibility = "hidden";
            this.up("div").selectedTab.relatedContent.removeClassName("tabComponent-visible");
            this.up("div").selectedTab.relatedContent.addClassName("tabComponent-hidden");
            this.up("div").selectedTab = this;
            this.relatedContent.style.visibility = "visible";
            this.removeClassName("tabComponent-tabRollover");
            this.addClassName("tabComponent-tabCurrent");
            this.up("div").selectedTab.relatedContent.removeClassName("tabComponent-hidden");
            this.up("div").selectedTab.relatedContent.addClassName("tabComponent-visible");
            resetTabHeights(this);
          }
        }
        // Check if its an empty tab by looking for an anchor
        if (tabTemp.select("a").length>0) {
          tabTemp.addClassName('no-content');
        }
      });
      var tabContents = tabComponent.select("div.tabComponent-tabContents");
      for (var iTabContents = 0; iTabContents < tabContents.length; iTabContents++) {
        tabTemp = tabContents[iTabContents];
        if (tabTemp.style != undefined) {
          tabTemp.style.height = (largestHeight - 12) + "px";
        }
      }
      tabComponent.style.height = (largestHeight + 38) + "px";
      if (defaultTab!=null) {
        defaultTab.onclick();
      } else  if (clickSecond) {
        tabComponent.select('.tabComponent-tabTitle')[1].onclick();
      } else {
        Event.observe(window,"load", function() {
          resetTabHeights(tabComponent.select('.tabComponent-tabTitle')[0]);
        });
      }
    })
  }

  function resetTabHeights(clickedTab) {
    var rc = clickedTab.up("div").selectedTab.relatedContent;
    rc.setStyle({'height':'auto'});
    clickedTab.up("div").setStyle({'height':((rc.getHeight()+25)+'px')});
  }

  function addPhotoDetails(anElement) {
      try {
        var href = anElement.select('A')[0];
        var anId = 'cm' + anElement.identify();
        anElement.innerHTML = anElement.innerHTML +
            "<div id='button_" + anId + "' class='button_photoDetails'>"+
            "  <img alt='' src='/flooring/i/images/button_photoDetails.gif' onclick='initInfoPopup(\"infoPopup_button_"+ anId + "\");$(\"infoPopup_button_" + anId + "\").toggle()'/>"+
            "  <div class='infoPopup' id='infoPopup_button_"+ anId +"' style='visibility:hidden;display:none'><div class='content' style='width: 300px'>"+
            "     <a href='" + href.href + "'>" + href.title+ "</a>"+
            "  </div></div>"+
            "</div>";
       } catch(e) {/*die quietly*/}
  }

  function initPromoCalloutComponents() {
    $$('div.photodetails').each(addPhotoDetails);
    $$("div.promoCalloutComponent").each(function (objThis) {
      objThis.style.cursor = "pointer";
      objThis.onmouseover = promoCalloutComponent_onmouseover;
      objThis.onmouseout = promoCalloutComponent_onmouseout;
      objThis.onmouseout();
      objThis.select(".outline").each(function (objThis) {
        objThis.style.zIndex = 1000;
      })

      Event.observe(objThis, "click", function() {
        var href=this.getElementsByTagName("A")[0].href;
        s_getObjectID=href;
        if (href.match(/\.pdf$/i) && RF.canLaunchInterstial()) {
  				RF.launchInterstitial(href);
  				return;
				}
        else {
	        if (this.getElementsByTagName("A")[0].target) {
	          window.open(href, "_blank");
	        } else {
	          location.href=href;
	        }
        }
      });
    })
  }
  function promoCalloutComponent_onmouseover () {
    new Effect.Parallel([
      new Effect.Morph(this.select(".captionBackground")[0], {
        "style": "top: 65px; height: 65px;"
      }),
      new Effect.Morph(this.select(".captionArrow")[0], {
        "style": "top: 65px;"
      }),
      new Effect.Morph(this.select(".captionText")[0], {
        "style": "top: 65px;"
      })
    ], {
      "duration": .11
    });
  }
  function promoCalloutComponent_onmouseout () {
    new Effect.Parallel([
      new Effect.Morph(this.select(".captionBackground")[0], {
        "style": "top: 96px; height: 35px;"
      }),
      new Effect.Morph(this.select(".captionArrow")[0], {
        "style": "top: 96px;"
      }),
      new Effect.Morph(this.select(".captionText")[0], {
        "style": "top: 96px;"
      })
    ], {
      duration: 0.11
    });
  }
  function initInfoPopups() {
    $$("div.infoPopup-r, div.infoPopup").each( function(objThis) {
      initInfoPopup(objThis.identify());
    });
  }
  function infoPopupClose() {
    this.up("div").toggle();
  }

  function initInfoPopup(anId) {
    var objThis = $(anId);
    if (objThis.readAttribute('initInfoPopup')!=null) {
      return;
    } else {
      objThis.writeAttribute('initInfoPopup', 'true')
    }
    objThis.setStyle({"visibility":"hidden"});

    var innerHtml = '<div style="width: REPLACE_WIDTHpx; height: REPLACE_HEIGHTpx;" class="border-c">&nbsp;</div>' +
                    '<img style="height: REPLACE_HEIGHTpx;" class="border-l" src="/flooring/i/images/infoPopup_borderL.png" height="REPLACE_HEIGHT">' +
                    '<img style="width: REPLACE_WIDTHpx;" class="border-b" src="/flooring/i/images/infoPopup_borderB.png">' +
                    '<img style="height: REPLACE_HEIGHTpx;" class="border-r" src="/flooring/i/images/infoPopup_borderR.png">' +
                    '<img style="width: REPLACE_WIDTHpx;" class="border-u" src="/flooring/i/images/infoPopup_borderU.png" height="25">' +
                    '<img class="border-br" src="/flooring/i/images/infoPopup_border_rb.png">' +
                    '<img class="border-bl" src="/flooring/i/images/infoPopup_border_lb.png">' +
                    '<img class="border-ur" src="/flooring/i/images/infoPopup_border_close.png">' +
                    '<img class="border-ul" src="/flooring/i/images/infoPopup_borderUL.png">';

    innerHtml = innerHtml.replace(/REPLACE_WIDTH/g, objThis.getWidth()-50);
    innerHtml = innerHtml.replace(/REPLACE_HEIGHT/g, objThis.getHeight()-45);
    innerHtml = innerHtml.replace(/REPLACE_CLOSE/g, (objThis.hasClassName('no-close')?"-nc":""));
    innerHtml = innerHtml.replace(/REPLACE_BOTTOM/g, (objThis.hasClassName('infoPopup-r')?"-r":""));
    objThis.innerHTML =  innerHtml + objThis.innerHTML;

    if (objThis.id) {
      var sTriggerElemID = objThis.id.substr(objThis.id.indexOf("_") + 1, objThis.id.length - (objThis.id.indexOf("_") + 1));
      var objTriggerElem = $(sTriggerElemID);
      var objPositionedOffset;
      if (objTriggerElem) objPositionedOffset = objTriggerElem.cumulativeOffset();
      objThis.remove();
      objTriggerElem.up("body").insert(objThis);
      if (objThis.hasClassName('infoPopup-r')) {
        objThis.setStyle({"left":(objPositionedOffset.left + 6) + "px", "top":(objPositionedOffset.top - (objThis.getHeight() - 1)) + "px"});
      } else {
        objThis.setStyle({"left":(objPositionedOffset.left - (objThis.getWidth() - 4)) + "px", "top":(objPositionedOffset.top - (objThis.getHeight() - 1)) + "px"});
      }
      objThis.setStyle({"visibility":"visible"});
    }
    objThis.select(".border-ur").each( function(xx) {
      xx.onclick = infoPopupClose;
    });
    //png fix
    if (isIE6){objThis.select("img").each(function(xx) {pngfix2(xx)})};
  }

  function formEnterKeyDetect(myfield,e)  {
    var keycode;
    if (window.event) {
      keycode = window.event.keyCode;
    } else if (e) {
      keycode = e.which;
    } else {
      return true;
    }
    if (keycode == 13) {
       myfield.form.submit();
       return false;
    } else {
       return true;
    }
  }

