﻿  intSelectNavNode = -1;
  
  arrLN_Topic      = new Array();
  arrLN_SubTopic   = new Array();
  arrLN_SubParent  = new Array();
  arrLN_Tier1      = new Array();
  arrLN_Tier2      = new Array();
  arrLN_ProdName   = new Array();
  arrLN_ProdCode   = new Array();
  arrLN_ProdURL    = new Array();
  arrLN_ProdURL_R  = new Array();
  arrLN_ProdSKU    = new Array();
  arrLN_ProdPage   = new Array();
  arrLN_ProdQSPage = new Array();
  
  var strQS         = new Querystring();
  var strTopicCode  = strQS.get("Topic1");
  var strSubTopic   = strQS.get("Topic2");
  var strProdCode   = strQS.get("prdcode");
  var strParentCode = "";
 
  var strLN_Tier1 = "";
  var strLN_Tier2 = "";
  var strLN_ProdName = "";
  var strLN_ProdCode = "";
  var strLN_Homepage = "";
  var boolRewriteHair_Coll = true;
  var boolRewriteHair_Type = false;
  var boolRewriteHair_Ingr = false;
  var boolRewriteHair_Frag = false;
  var boolRewriteStyl_Coll = true;
  var boolRewriteStyl_Efft = false;
  var boolRewriteStyl_Type = false;
  
  if (!strTopicCode) { strTopicCode = ""; }
  if (!strSubTopic)  { strSubTopic  = ""; }
  if (!strProdCode)  { strProdCode  = ""; }
    
  function GetDefaultPath() {
    for (x=0; x<arrLN_ProdCode.length; x++) {
      if ( strProdCode.toString().toLowerCase() == arrLN_ProdCode[x].toString().toLowerCase() ) {
        strSubTopic = arrLN_Tier2[x];
        break;
      }
    }
  }

  /* Styling Native */
  function GetTopicBySubTopic(strST) {
    for (x=0; x<arrLN_Tier2.length; x++) {
      if ( strST.toString().toLowerCase() == arrLN_Tier2[x].toString().toLowerCase() ) {
        strTopicCode = arrLN_Tier1[x];
        break;
      }
    }
  }
    
  function ResetProductLists() {
    for (x=0; x<arrLN_SubTopic.length;x++) {
      document.getElementById("products_" + arrLN_SubTopic[x]).style.display = 'none';
      document.getElementById("div_" + arrLN_SubTopic[x] + "_ON").style.display = 'none';
      document.getElementById("div_" + arrLN_SubTopic[x] + "_OFF").style.display = 'inline';
    } 
  }

  function ResetCatalogProductLists() {
    for (x=0; x<arrLN_SubTopic.length;x++) {
      document.getElementById("products_" + arrLN_SubTopic[x]).innerHTML = '';
      document.getElementById("products_" + arrLN_SubTopic[x]).style.display = 'none';
      document.getElementById("div_" + arrLN_SubTopic[x] + "_ON").style.display = 'none';
      document.getElementById("div_" + arrLN_SubTopic[x] + "_OFF").style.display = 'inline';
    } 
  }

  function ResetSubTopicLists() {
    for (x=0; x<arrLN_Topic.length;x++) {
      document.getElementById("subtopic_" + arrLN_Topic[x]).style.display = 'none';
      document.getElementById("div_" + arrLN_Topic[x] + "_ON").style.display = 'none';
      document.getElementById("div_" + arrLN_Topic[x] + "_OFF").style.display = 'inline';
    } 
  }

  function ToggleSubTopics(strSubTopicName) {
    if (document.getElementById("subtopic_" + strSubTopicName).style.display.toString() == 'inline') {
      // Hide the current Sub-Topic if it's currently Selected.
      document.getElementById("subtopic_" + strSubTopicName).style.display = 'none';
      document.getElementById("div_" + strSubTopicName + "_ON").style.display = 'none';
      document.getElementById("div_" + strSubTopicName + "_OFF").style.display = 'inline';
    }
    else {
      // Reveal the selected Sub-Topic      
      ResetSubTopicLists();
      ResetProductLists();
      
      document.getElementById("subtopic_" + strSubTopicName).style.display = 'inline';
      document.getElementById("div_" + strSubTopicName + "_ON").style.display = 'inline';
      document.getElementById("div_" + strSubTopicName + "_OFF").style.display = 'none';
    }    
  }

  function DisplaySubTopics() {
  
    for (x=0; x<arrLN_SubTopic.length; x++) {
      if (strSubTopic.toString().toLowerCase().indexOf(arrLN_SubTopic[x].toString().toLowerCase(), 0) >= 0) {
        // Display the SubTopic as active
        strDivName    = "div_" + arrLN_SubTopic[x] + "_ON";
        document.getElementById(strDivName).style.display = 'inline';
        
        // Display the Products of the Active Sub-Topic
        strProductsDiv = "products_" + arrLN_SubTopic[x];
        document.getElementById(strProductsDiv).style.display = 'inline';
        
      }
      else {
        // Display the SubTopic as inactive
        strDivName    = "div_" + arrLN_SubTopic[x] + "_OFF";
        document.getElementById(strDivName).style.display = 'inline';      
      }
    }  
  }

  function AdjustLeftNav(Collection_Name) {
    // This function is used expressly for creating "sticky" navigation and updating highlight states.
    if (strProdCode != "" && strTopicCode == "") { 
      // We have a Valid PrdCode - but no Pathing - so we need to generate it.
      if (Collection_Name == "Styling") { strTopicCode = "Styling_Collection"; }
      if (Collection_Name == "Haircare") { strTopicCode = "Haircare_Collection"; }
      GetDefaultPath();
    }
    
    for (x=0; x<arrLN_Topic.length; x++) {
      if (strTopicCode.toString().toLowerCase().indexOf(arrLN_Topic[x].toString().toLowerCase(), 0) >= 0) {
        // Set the Key Nav Node
        intSelectNavNode = x;
      
        // Display the Topic
        strDivName    = "div_" + arrLN_Topic[x] + "_ON";
        document.getElementById(strDivName).style.display = 'inline';
        
        // Display the subTopic of a Selected Topic
        strObjectName = "subtopic_" + arrLN_Topic[x];
        document.getElementById(strObjectName).style.display = 'inline';
        
        // Highlight the Product
        if (strProdCode != "") {
          strProductDivName = "div_" + strTopicCode + "_" + strProdCode;
          document.getElementById(strProductDivName + "_ON").style.display = 'inline';
          document.getElementById(strProductDivName + "_OFF").style.display = 'none';
        }
      }
      else {
        strDivName    = "div_" + arrLN_Topic[x] + "_OFF";
        document.getElementById(strDivName).style.display = 'inline';        
      }    
    }
    DisplaySubTopics();
  }

  function ProductToggle(objDiv, intShow) {
    var strProductList = "products_" + objDiv;
    var strHeader      = "div_" + objDiv;
        
    ResetProductLists();
    
    if (intShow) {
      strHeaderShow = strHeader + "_ON";
      strHeaderHide = strHeader + "_OFF";
      document.getElementById(strProductList).style.display = 'inline';
    }
    else {
      strHeaderShow = strHeader + "_OFF";    
      strHeaderHide = strHeader + "_ON";
      document.getElementById(strProductList).style.display = 'none';
    }

    document.getElementById(strHeaderShow).style.display = 'inline';
    document.getElementById(strHeaderHide).style.display = 'none';

  }  
  
  /* Build Functions for HairCare & Styling Left Navs */
  function BuildElement_Header(TOP_CODE) {
    var strBuildHeaderHTML = "";
    strBuildHeaderHTML += '\n<div class="LN_LNK_CNTNR" style="background-color:#000000;">';
    strBuildHeaderHTML += '\n <div name="div_' + TOP_CODE + '_ON" id="div_' + TOP_CODE + '_ON" class="LN_LNK_CNTNR" style="background-color:#000000;display:none;">';
    strBuildHeaderHTML += '\n  <div style="height:17px;" class="LN_BG_ON" >';
    strBuildHeaderHTML += '\n   <div align="right" class="float_R padding05_R"><a href="" onclick="event.cancelBubble=true;ToggleSubTopics(\'' + TOP_CODE + '\');return false;"><img src="/IMG/LN_' + TOP_CODE + '_ON.gif" border="0"></a></div>';
    strBuildHeaderHTML += '\n  </div>';
    strBuildHeaderHTML += '\n </div>';
    strBuildHeaderHTML += '\n <div name="div_' + TOP_CODE + '_OFF" id="div_' + TOP_CODE + '_OFF" class="LN_LNK_CNTNR" style="background-color:#000000;display:none;">';
    strBuildHeaderHTML += '\n  <div style="height:17px;" class="LN_BG_OFF" onmouseover="this.className=(\'LN_BG_ON\');MM_swapImage(\'' + TOP_CODE + '_IMG\',\'\',\'/IMG/LN_' + TOP_CODE + '_ON.gif\',\'' + TOP_CODE + '_BTN\',\'\',\'/IMG/LN_ICN_WHT_RO.gif\',1)" onmouseout="this.className=(\'LN_BG_OFF\');MM_swapImgRestore()" >';
    strBuildHeaderHTML += '\n   <div align="right" class="float_R padding05_R"><a href="" onclick="event.cancelBubble=true;ToggleSubTopics(\'' + TOP_CODE + '\');return false;"><img src="/IMG/LN_' + TOP_CODE + '_OFF.gif" name="' + TOP_CODE + '_IMG" id="' + TOP_CODE + '_IMG" border="0"></a></div>';
    strBuildHeaderHTML += '\n  </div>';
    strBuildHeaderHTML += '\n </div>';
    strBuildHeaderHTML += '\n</div>';
    document.write(strBuildHeaderHTML);
  }
  
  function BuildElement_Collection(TOP_CODE, TOP_NAME) {
    var strBuildCollectionHTML = "";
    strBuildCollectionHTML += '\n<div class="LN_LNK_CNTNR_SM" style="background-color:#000000;">';
    strBuildCollectionHTML += '\n <div name="div_' + TOP_CODE + '_ON" id="div_' + TOP_CODE + '_ON" style="height:13px;background-color:#000000;display:none;">';
    strBuildCollectionHTML += '\n  <div style="height:13px" class="LN_BG_ON" >';
    strBuildCollectionHTML += '\n   <div class="float_R padding05_R"><a href=\'javascript:ProductToggle("' + TOP_CODE + '", 0);\' class="AWhite10_BTT">' + TOP_NAME + '</a></div>';
    strBuildCollectionHTML += '\n  </div>';
    strBuildCollectionHTML += '\n </div>';
    strBuildCollectionHTML += '\n <div name="div_' + TOP_CODE + '_OFF" id="div_' + TOP_CODE + '_OFF" style="height:13px;background-color:#000000;display:none;">';
    strBuildCollectionHTML += '\n  <div style="height:13px" class="LN_BG_OFF" onmouseover="this.className=(\'LN_BG_ON\');MM_swapImage(\'' + TOP_CODE + '\',\'\',\'/IMG/LN_' + TOP_CODE + '_ON.gif\',\'' + TOP_CODE + '_BTN\',\'\',\'/IMG/LN_ICN_WHT_RO.gif\',1)" onmouseout="this.className=(\'LN_BG_OFF\');MM_swapImgRestore()" >';
    strBuildCollectionHTML += '\n   <div class="float_R padding05_R"><a href=\'javascript:ProductToggle("' + TOP_CODE + '", 1);\' class="ALtGREY10_BTT">' + TOP_NAME + '</a></div>';
    strBuildCollectionHTML += '\n  </div>';
    strBuildCollectionHTML += '\n </div>';
    strBuildCollectionHTML += '\n</div>';
    document.write(strBuildCollectionHTML);
  }

  function BuildElement_Product(TOP_CODE, PRD_CODE, SKU, LN_ProdName, LN_Homepage, LN_Rewriter, LN_Tier1, LN_Tier2) {
    var strBuildProduct = '';
    strBuildProduct += '\n<div class="LN_LNK_CNTNR_MD_NOBDR" style="background-color:#000000;">';
    strBuildProduct += '\n <div name="div_' + TOP_CODE + '_' + PRD_CODE + '_ON" id="div_' + TOP_CODE + '_' + PRD_CODE + '_ON" style="background-color:#000000;display:none;">';
    strBuildProduct += '\n  <div style="width:150px;" class="LN_BG_ON" >';
    strBuildProduct += '\n   <table border="0" cellpadding="0" cellspacing="0" width="100%">';
    strBuildProduct += '\n    <tr><td valign="top" align="right"><div class="float_R padding05_R AWhite10_BTT">' + LN_ProdName + '</div></td></tr>';
    strBuildProduct += '\n   </table>\n  </div>\n </div>';
    strBuildProduct += '\n <div name="div_' + TOP_CODE + '_' + PRD_CODE + '_OFF" id="div_' + TOP_CODE + '_' + PRD_CODE + '_OFF" style="background-color:#000000;display:inline;">';
    strBuildProduct += '\n  <div style="width:150px;" class="LN_BG_OFF" onmouseover="this.className=(\'LN_BG_ON\');MM_swapImage(\'' + SKU + '\',\'\',\'/IMG/LN_' + SKU + '_ON.gif\',\'' + SKU + '_BTN\',\'\',\'/IMG/LN_ICN_WHT_RO.gif\',1)" onmouseout="this.className=(\'LN_BG_OFF\');MM_swapImgRestore()">';
    strBuildProduct += '\n   <table border="0" cellpadding="0" cellspacing="0" width="100%">';
    strBuildProduct += '\n    <tr><td valign="top" align="right"><div class="float_R padding05_R">';
    if (TOP_CODE.toString().toLowerCase() == 'haircare_collection') {
      if (boolRewriteHair_Coll == true) { strBuildProduct += '\n<a href="/haircare/' + LN_Rewriter + '" class="AWhite10_BTT">' + LN_ProdName + '</a>'; } 
      else { strBuildProduct += '\n<a href="/haircare/' + LN_Homepage + '?prdcode=' + PRD_CODE + '&CategoryCode=AXE_Haircare&Topic1=' + LN_Tier1 + '&Topic2=' + LN_Tier2 + '" class="AWhite10_BTT">' + LN_ProdName + '</a>'; }
    }
    if (TOP_CODE.toString().toLowerCase() == 'haircare_type') {
      if (boolRewriteHair_Type == true) { strBuildProduct += '\n<a href="/haircare/' + LN_Rewriter + '" class="AWhite10_BTT">' + LN_ProdName + '</a>'; } 
      else { strBuildProduct += '\n<a href="/haircare/' + LN_Homepage + '?prdcode=' + PRD_CODE + '&CategoryCode=AXE_Haircare&Topic1=' + LN_Tier1 + '&Topic2=' + LN_Tier2 + '" class="AWhite10_BTT">' + LN_ProdName + '</a>'; }
    }
    if (TOP_CODE.toString().toLowerCase() == 'precious_ingredients') {
      if (boolRewriteHair_Ingr == true) { strBuildProduct += '\n<a href="/haircare/' + LN_Rewriter + '" class="AWhite10_BTT">' + LN_ProdName + '</a>'; } 
      else { strBuildProduct += '\n<a href="/haircare/' + LN_Homepage + '?prdcode=' + PRD_CODE + '&CategoryCode=AXE_Haircare&Topic1=' + LN_Tier1 + '&Topic2=' + LN_Tier2 + '" class="AWhite10_BTT">' + LN_ProdName + '</a>'; }
    }
    if (TOP_CODE.toString().toLowerCase() == 'fragrance') {
      if (boolRewriteHair_Frag == true) { strBuildProduct += '\n<a href="/haircare/' + LN_Rewriter + '" class="AWhite10_BTT">' + LN_ProdName + '</a>'; }
      else { strBuildProduct += '\n<a href="/haircare/' + LN_Homepage + '?prdcode=' + PRD_CODE + '&CategoryCode=AXE_Haircare&Topic1=' + LN_Tier1 + '&Topic2=' + LN_Tier2 + '" class="AWhite10_BTT">' + LN_ProdName + '</a>'; }
    }
    if (TOP_CODE.toString().toLowerCase() == 'styling_collection') {
      if (boolRewriteStyl_Coll == true) { strBuildProduct += '\n<a href="/styling/' + LN_Rewriter + '" class="AWhite10_BTT">' + LN_ProdName + '</a>'; }
      else { strBuildProduct += '\n<a href="/styling/' + LN_Homepage + '?prdcode=' + PRD_CODE + '&CategoryCode=AXE_Styling&Topic1=' + LN_Tier1 + '&Topic2=' + LN_Tier2 + '" class="AWhite10_BTT">' + LN_ProdName + '</a>'; }
    }
    if (TOP_CODE.toString().toLowerCase() == 'styling_effect') {
      if (boolRewriteStyl_Efft == true) { strBuildProduct += '\n<a href="/styling/' + LN_Rewriter + '" class="AWhite10_BTT">' + LN_ProdName + '</a>'; }
      else { strBuildProduct += '\n<a href="/styling/' + LN_Homepage + '?prdcode=' + PRD_CODE + '&CategoryCode=AXE_Styling&Topic1=' + LN_Tier1 + '&Topic2=' + LN_Tier2 + '" class="AWhite10_BTT">' + LN_ProdName + '</a>'; }
    }
    if (TOP_CODE.toString().toLowerCase() == 'styling_typeofhair') {
      if (boolRewriteStyl_Type == true) { strBuildProduct += '\n<a href="/styling/' + LN_Rewriter + '" class="AWhite10_BTT">' + LN_ProdName + '</a>'; }
      else { strBuildProduct += '\n<a href="/styling/' + LN_Homepage + '?prdcode=' + PRD_CODE + '&CategoryCode=AXE_Styling&Topic1=' + LN_Tier1 + '&Topic2=' + LN_Tier2 + '" class="AWhite10_BTT">' + LN_ProdName + '</a>'; }
    }
    strBuildProduct += '\n      </div>';
    strBuildProduct += '\n     </td>';
    strBuildProduct += '\n    </tr>';
    strBuildProduct += '\n   </table>';
    strBuildProduct += '\n  </div>\n </div>\n</div>';
    
    document.write(strBuildProduct);
  }
  
  /* Build Functions for Full Catalog Left Navs */
  function BuildElement_CatalogHeader(TOP_CODE) {
    var strBuildHeaderHTML = "";
    strBuildHeaderHTML += '\n<div class="LN_LNK_CNTNR" style="background-color:#000000;">';
    strBuildHeaderHTML += '\n <div name="div_' + TOP_CODE + '_ON" id="div_' + TOP_CODE + '_ON" class="LN_LNK_CNTNR" style="background-color:#000000;display:none;">';
    strBuildHeaderHTML += '\n  <div style="height:17px;" class="LN_BG_ON" >';
    strBuildHeaderHTML += '\n   <div align="right" class="float_R padding05_R"><a href="" onclick="event.cancelBubble=true;ToggleSubTopics(\'' + TOP_CODE + '\');return false;"><img src="/IMG/LN_' + TOP_CODE + '_ON.gif" border="0"></a></div>';
    strBuildHeaderHTML += '\n  </div>';
    strBuildHeaderHTML += '\n </div>';
    strBuildHeaderHTML += '\n <div name="div_' + TOP_CODE + '_OFF" id="div_' + TOP_CODE + '_OFF" class="LN_LNK_CNTNR" style="background-color:#000000;display:inline;">';
    strBuildHeaderHTML += '\n  <div style="height:17px;" class="LN_BG_OFF" onmouseover="this.className=(\'LN_BG_ON\');MM_swapImage(\'' + TOP_CODE + '_IMG\',\'\',\'/IMG/LN_' + TOP_CODE + '_ON.gif\',\'' + TOP_CODE + '_BTN\',\'\',\'/IMG/LN_ICN_WHT_RO.gif\',1)" onmouseout="this.className=(\'LN_BG_OFF\');MM_swapImgRestore()" >';
    strBuildHeaderHTML += '\n   <div align="right" class="float_R padding05_R"><a href="" onclick="event.cancelBubble=true;ToggleSubTopics(\'' + TOP_CODE + '\');return false;"><img src="/IMG/LN_' + TOP_CODE + '_OFF.gif" name="' + TOP_CODE + '_IMG" id="' + TOP_CODE + '_IMG" border="0"></a></div>';
    strBuildHeaderHTML += '\n  </div>';
    strBuildHeaderHTML += '\n </div>';
    strBuildHeaderHTML += '\n</div>';
    document.write(strBuildHeaderHTML);
  }

  function BuildElement_CatalogCollection(TOP_CODE, TOP_NAME, TOP_PARENT) {
    var strBuildCollectionHTML = "";
    strBuildCollectionHTML += '\n<div class="LN_LNK_CNTNR_SM" style="background-color:#000000;">';
    strBuildCollectionHTML += '\n <div name="div_' + TOP_CODE + '_ON" id="div_' + TOP_CODE + '_ON" style="height:13px;background-color:#000000;display:none;">';
    strBuildCollectionHTML += '\n  <div style="height:13px" class="LN_BG_ON" >';
    strBuildCollectionHTML += '\n   <div class="float_R padding05_R"><a href=\'javascript:BuildElement_PopupProdList("' + TOP_PARENT + '", "' + TOP_CODE + '", 0);\' class="AWhite10_BTT">' + TOP_NAME + '</a></div>';
    strBuildCollectionHTML += '\n  </div>';
    strBuildCollectionHTML += '\n </div>';
    strBuildCollectionHTML += '\n <div name="div_' + TOP_CODE + '_OFF" id="div_' + TOP_CODE + '_OFF" style="height:13px;background-color:#000000;display:inline;">';
    strBuildCollectionHTML += '\n  <div style="height:13px" class="LN_BG_OFF" onmouseover="this.className=(\'LN_BG_ON\');MM_swapImage(\'' + TOP_CODE + '\',\'\',\'/IMG/LN_' + TOP_CODE + '_ON.gif\',\'' + TOP_CODE + '_BTN\',\'\',\'/IMG/LN_ICN_WHT_RO.gif\',1)" onmouseout="this.className=(\'LN_BG_OFF\');MM_swapImgRestore()" >';
    strBuildCollectionHTML += '\n   <div class="float_R padding05_R"><a href=\'javascript:BuildElement_PopupProdList("' + TOP_PARENT + '", "' + TOP_CODE + '", 1);\' class="ALtGREY10_BTT">' + TOP_NAME + '</a></div>';
    strBuildCollectionHTML += '\n  </div>';
    strBuildCollectionHTML += '\n </div>';
    strBuildCollectionHTML += '\n <div name="products_' + TOP_CODE + '" id="products_' + TOP_CODE + '" style="display:none;position:absolute;margin-left:155px;height:0px;width:200px;border:solid 1px #696969;"><div class="AWhite10_BTT"></div></div>';
    strBuildCollectionHTML += '\n</div>';

    document.write(strBuildCollectionHTML);
  }
  
  function BuildElement_PopupProduct(PRD_CODE, SKU, LN_ProdName, LN_Homepage, LN_Rewriter, TOP_CODE, COLL_CODE) {
    var strBrType = BrowserDetect.browser;
    var strBrVer  = BrowserDetect.version;
    var strBuildPopupProduct = '';
    strBuildPopupProduct += '\n<div class="" style="background-color:#000000;height:16px;">';
    strBuildPopupProduct += '\n <div name="div_' + COLL_CODE + '_' + PRD_CODE + '_OFF" id="div_' + COLL_CODE + '_' + PRD_CODE + '_OFF" style="background-color:#000000;display:inline;">';
    strBuildPopupProduct += '\n  <div style="height:16px;" class="LN_BG_OFF" onmouseover="this.className=(\'LN_BG_ON\');MM_swapImage(\'' + SKU + '\',\'\',\'/IMG/LN_' + SKU + '_ON.gif\',\'' + SKU + '_BTN\',\'\',\'/IMG/LN_ICN_WHT_RO.gif\',1)" onmouseout="this.className=(\'LN_BG_OFF\');MM_swapImgRestore()" >';
    if (strBrType == "Explorer") { strBuildPopupProduct += '\n   <div class="float_L padding05_L" style="margin-top:-3px;">'; }
    else { strBuildPopupProduct += '\n   <div class="float_L padding05_L" style="margin-top:-1px;padding-top:3px;padding-bottom:0px;">'; }
    if (TOP_CODE.toString().toLowerCase() == 'haircare_collection') {
      if (boolRewriteHair_Coll == true) { strBuildPopupProduct += '\n<a href="/haircare/' + LN_Rewriter + '" class="AWhite10_BTT">' + LN_ProdName + '</a>'; }
      else { strBuildPopupProduct += '\n<a href="/haircare/' + LN_Homepage + '?prdcode=' + PRD_CODE + '&CategoryCode=AXE_Haircare&Topic1=' + TOP_CODE + '&Topic2=' + COLL_CODE + '" class="AWhite10_BTT">' + LN_ProdName + '</a>'; }
    }
    if (TOP_CODE.toString().toLowerCase() == 'haircare_type') {
      if (boolRewriteHair_Type == true) { strBuildPopupProduct += '\n<a href="/haircare/' + LN_Rewriter + '" class="AWhite10_BTT">' + LN_ProdName + '</a>'; }
      else { strBuildPopupProduct += '\n<a href="/haircare/' + LN_Homepage + '?prdcode=' + PRD_CODE + '&CategoryCode=AXE_Haircare&Topic1=' + TOP_CODE + '&Topic2=' + COLL_CODE + '" class="AWhite10_BTT">' + LN_ProdName + '</a>'; }
    }
    if (TOP_CODE.toString().toLowerCase() == 'precious_ingredients') {
      if (boolRewriteHair_Ingr == true) { strBuildPopupProduct += '\n<a href="/haircare/' + LN_Rewriter + '" class="AWhite10_BTT">' + LN_ProdName + '</a>'; }
      else { strBuildPopupProduct += '\n<a href="/haircare/' + LN_Homepage + '?prdcode=' + PRD_CODE + '&CategoryCode=AXE_Haircare&Topic1=' + TOP_CODE + '&Topic2=' + COLL_CODE + '" class="AWhite10_BTT">' + LN_ProdName + '</a>'; }
    }
    if (TOP_CODE.toString().toLowerCase() == 'fragrance') {
      if (boolRewriteHair_Frag == true) { strBuildPopupProduct += '\n<a href="/haircare/' + LN_Rewriter + '" class="AWhite10_BTT">' + LN_ProdName + '</a>'; }
      else { strBuildPopupProduct += '\n<a href="/haircare/' + LN_Homepage + '?prdcode=' + PRD_CODE + '&CategoryCode=AXE_Haircare&Topic1=' + TOP_CODE + '&Topic2=' + COLL_CODE + '" class="AWhite10_BTT">' + LN_ProdName + '</a>'; }
    }
    if (TOP_CODE.toString().toLowerCase() == 'styling_collection') {
      if (boolRewriteStyl_Coll == true) { strBuildPopupProduct += '\n<a href="/styling/' + LN_Rewriter + '" class="AWhite10_BTT">' + LN_ProdName + '</a>'; }
      else { strBuildPopupProduct += '\n<a href="/styling/' + LN_Homepage + '?prdcode=' + PRD_CODE + '&CategoryCode=AXE_Styling&Topic1=' + TOP_CODE + '&Topic2=' + COLL_CODE + '" class="AWhite10_BTT">' + LN_ProdName + '</a>'; }
    }
    if (TOP_CODE.toString().toLowerCase() == 'styling_effect') {
      if (boolRewriteStyl_Efft == true) { strBuildPopupProduct += '\n<a href="/styling/' + LN_Rewriter + '" class="AWhite10_BTT">' + LN_ProdName + '</a>'; }
      else { strBuildPopupProduct += '\n<a href="/styling/' + LN_Homepage + '?prdcode=' + PRD_CODE + '&CategoryCode=AXE_Styling&Topic1=' + TOP_CODE + '&Topic2=' + COLL_CODE + '" class="AWhite10_BTT">' + LN_ProdName + '</a>'; }
    }
    if (TOP_CODE.toString().toLowerCase() == 'styling_typeofhair') {
      if (boolRewriteStyl_Type == true) { strBuildPopupProduct += '\n<a href="/styling/' + LN_Rewriter + '" class="AWhite10_BTT">' + LN_ProdName + '</a>'; }
      else { strBuildPopupProduct += '\n<a href="/styling/' + LN_Homepage + '?prdcode=' + PRD_CODE + '&CategoryCode=AXE_Styling&Topic1=' + TOP_CODE + '&Topic2=' + COLL_CODE + '" class="AWhite10_BTT">' + LN_ProdName + '</a>'; }
    }
    strBuildPopupProduct += '\n   </div>';
    strBuildPopupProduct += '\n  </div>\n </div>\n</div>';

    return strBuildPopupProduct;
  }

  function BuildElement_PopupProdList(TOP_CODE, COLL_CODE, intShow) {
    var boolCenterListOnCollection = true;
    var strHeader      = "div_" + COLL_CODE;       
    var strPopup       = "products_" + COLL_CODE;
    var strInnerHTML   = '';
    var intNegBuffer   = 16;
    var intLineHeight  = 16; // Must be an Even #
    var intContWidth   = 120;
    var intProdCount   = 0; 
    var intContHeight  = 0;
    var intContMargin  = 0;
    var intProdChars   = 0;
    var intMaxChars = 0;
    var intZIndex = 0;

    ResetCatalogProductLists();

    if (intShow) {
      intZIndex = 150;
      strHeaderShow = strHeader + "_ON";
      strHeaderHide = strHeader + "_OFF";
      document.getElementById(strPopup).style.display = 'inline';
      for (x=0;x<arrLN_ProdName.length;x++) {
        if(arrLN_Tier2[x].toString().toLowerCase() == COLL_CODE.toString().toLowerCase()) {
          intProdCount++;
          strInnerHTML += BuildElement_PopupProduct(arrLN_ProdCode[x], arrLN_ProdSKU[x], arrLN_ProdName[x], arrLN_ProdPage[x], arrLN_ProdQSPage[x], TOP_CODE, COLL_CODE);
          intProdChars = arrLN_ProdName[x].toString().length;
          if (intProdChars > intMaxChars) { intMaxChars = intProdChars; }
        }
      }
      intContHeight = intProdCount * intLineHeight;
      intContMargin = intNegBuffer;
      if (boolCenterListOnCollection) { intContMargin = (intContHeight / 2) - (intLineHeight / 2) + intNegBuffer; }
      if (intMaxChars * 7 > intContWidth) { intContWidth = intMaxChars * 7; }
    }
    else {
      strHeaderShow = strHeader + "_OFF";    
      strHeaderHide = strHeader + "_ON";
      document.getElementById(strPopup).innerHTML = '';
      document.getElementById(strPopup).style.display = 'none';
    }

    document.getElementById(strHeaderShow).style.display = 'inline';
    document.getElementById(strHeaderHide).style.display = 'none';
    document.getElementById(strPopup).style.height = intContHeight.toString() + 'px';
    document.getElementById(strPopup).style.width  = intContWidth.toString() + 'px';
    document.getElementById(strPopup).style.marginTop = '-' + intContMargin.toString() + 'px';
    document.getElementById(strPopup).style.zIndex = intZIndex;
    document.getElementById(strPopup).innerHTML = strInnerHTML;    
  }
  

