/*** COPYRIGHT 2009  BY CUTSEY BUSINESS SYSTEMS LTD. - ALL RIGHTS RESERVED ***/
/* product.js -- Product Page Javascript                                     */
/*****************************************************************************/
/*E010100 02/11/10 PMS- Called global getCurrency function                   */
/*E010010 02/04/10 PMS- Updated for translation                              */
/*E010009 10/23/09 JD2- Changed to handle custom freight and sales amount.   */
/*                    - Added customDisplay function call. Used in           */
/*                      retail-upsell.w.                                     */
/*E010008 08/05/09 DPK- Changed to handle is_upsell flag.                    */
/*E010007 07/20/09 JD2- Updated for OFS mode.                                */
/*E010006 06/22/09 APY- No Longer display feature data - already shown.      */
/*                    - Update Video Display.                                */
/*E010005 06/12/09 APY- Adjustments to alt-view display, remove 'feature' img*/
/*E010004 06/05/09 APY- Updated feature display.                             */
/*E010003 06/04/09 JD2- Merged v010101 from DEV99C.                          */
/*E010002 06/02/09 APY- Add Video Logic.                                     */
/*E010001 05/14/09 APY- Display feature list instead of catalog-description. */
/*E010000 04/30/09 APY- Seperate comparables display and add bottom scroll.  */
/*****************************************************************************/
/* 010101 05/15/09 JD2- Use ttItem.order-limit.                              */
/* 010010 04/07/09 JB - Use new enviro vars, new swatch error type.          */
/*        04/14/09 APY- Fix pricing display on comparables.                  */
/* 010009 04/03/09 JB - Change "hide" to "swatch" for image replacement.     */
/* 010008 04/02/09 JB - Added conditions for product mode.                   */
/* 010007 03/30/09 JD2- Added default price.                                 */
/* 010006 03/17/09 APY- If only a single size select by default.             */
/* 010005 03/17/09 APY- Reduce avail qty when successfully adding to cart.   */
/* 010004 02/26/09 SB - Add color name under swatch display grid.            */
/* 010003 02/09/08 APY- Updated default multi dim size when on 1 detail rec. */
/* 010002 12/30/08 APY- Corrected swatchHex, add altView update Comparables  */
/* 010001 12/16/08 APY- Add Multi-view, nocache, use hostURL and appURL      */
/*                    - Add alternate comparables display location           */
/* 010000 12/03/08 APY- Created.                                             */
/*****************************************************************************/
/****** Globals JS Vars Defined in product.w ******
var allStylesObj = new Object();
var styleObj     = new Object();
var vLockedImg = "";
var vDefaultWhse  = "";
var vComparableDir = "";
var vSelectedProd = "";
var vSelectedSize  = "";
var vSelectedColor = "";
var vSelectedSizeDesc  = "";
var vSelectedColorDesc = "";
var vSelectedPrice = "";
var vSelectedMultiSize = new Array();
var vRegPriceLabel  = "";
var vRegOnSaleLabel = "";
var vIsRetail = true/false;
var vDispColorDesc = true/false;
var vBrowseParam = ""
var vSponsorCode = ""
var vProdType = "s" or "i"
var vOrderLimit = 0
var vOrderLimitMsg = ""
var vCompSCode = "" //Side Comparables
var vCompBCode = "" //Bottom Comparables
** - hostDomain and appPath js vars used from header **              010010
var vCompSugCode = "PAR" //Side Comparables
var vCompAccCode = "ACC" //Bottom Comparables
******************************************/
var vStyleList = new Array();
if(typeof vCompSugCode == 'undefined') { var vCompSugCode; }
if(typeof vCompAccCode == 'undefined') { var vCompAccCode; }
//========--------   Load / Display   --------========\\
function loadStyle(vStyle,vSponsor){
 var vFoundStyle = false;
 $.each(vStyleList,function(j){
   if(vStyleList[j] != null && vStyleList[j].styleCode == vStyle &&
      vStyleList[j].styleColor && vStyleList[j].styleColor[0] != null &&
      vStyleList[j].styleSize  && vStyleList[j].styleSize[0] != null)
   { styleObj = vStyleList[j]; vFoundStyle = true; }
 });
 if(vFoundStyle){
  displayStyle();
 }
 else{
  var vCurrTime = new Date();
  var vCurrSecs  = (((vCurrTime.getHours() * 60) + vCurrTime.getMinutes()) * 60) + vCurrTime.getSeconds();
  var vNoCache = "&nocache=" + vCurrSecs;
  $.ajax({
    type: "GET",
    url: hostDomain + appPath + "/olc/get-style.w?style=" + vStyle + "&frames=no&target=main&sponsor=" + vSponsor + "&lang=" + clientLang + vNoCache,  /* 010010 */
    dataType: "xml",
    complete: function(data) {
       allStylesObj = $.xmlToJSON(data.responseXML); // Save XML in JSON
       //Return a single style Object
       $.each(allStylesObj.ttStyle,function(i){
          var vAddMe = true;
          $.each(vStyleList,function(j){
            if(vStyleList[j] != null && vStyleList[j].styleCode == allStylesObj.ttStyle[i].styleCode)
            { vAddMe = false; return; }
          });
          if (vAddMe)
          { vStyleList[vStyleList.length] = allStylesObj.ttStyle[i];}
          if (allStylesObj.ttStyle[i].styleCode == vStyle) {
            styleObj = allStylesObj.ttStyle[i];
            if (vSelectedProd != vStyle) {
              vSelectedProd = vStyle;
              vSelectedColor = "";
              vSelectedSize = "";
              vLockedImg = "";
              vSelectedSizeDesc = "";
              vSelectedColorDesc = "";
              vSelectedPrice = "";
              vSelectedMultiSize = new Array();
            }
          }
       });
       displayStyle();
    }
  });
 }

}
function displayStyle(){
  var vZoomInit;
  $("#addVid").attr("href","javascript:showVideo('" + styleObj.video + "');");  /* E010002 */
  if (vSelectedColor != "" && styleObj.ttColor ){
    $.each(styleObj.ttColor,function(i){
      if (styleObj.ttColor[i].colorCode == vSelectedColor && styleObj.ttColor[i].imageLg != "" ) {
        $(".imageCell").attr("src",styleObj.ttColor[i].imageLg);
        vLockedImg = styleObj.ttColor[i].imageLg;
        if(styleObj.ttColor[i].imageZm != "")
          vZoomInit = styleObj.ttColor[i].imageZm;
      }
    });
  }

  if (vLockedImg == "" || vLockedImg == null){
    if (styleObj.ttColor&&styleObj.ttColor[0].imageLg != "" && styleObj.ttColor[0].imageLg != null){  /* 010008m */
      $(".imageCell").attr("src",styleObj.ttColor[0].imageLg);
      vLockedImg = styleObj.ttColor[0].imageLg;
      if (styleObj.ttColor[0].imageZm != "" && styleObj.ttColor[0].imageZm != null)
        vZoomInit = styleObj.ttColor[0].imageZm;
    }
    else{
      $(".imageCell").attr("src",styleObj.imageLg);
      vLockedImg = styleObj.imageLg;
      if (styleObj.imageZm != "" && styleObj.imageZm != null)
        vZoomInit = styleObj.imageZm;
    }
  }
  $(".prodTitle").html(styleObj.description);
  //$(".prodCatalogDesc").html(styleObj.fullDesc);
  if (styleObj.imageMill != "" && styleObj.imageMill != null)
    $(".prodMillImg").html("<img src=\"" + styleObj.imageMill + "\" alt=\"\">");
  if(styleObj.ttColor && vSelectedColor=="" || vSelectedColor==null ){  /* 010008 */
    vSelectedColor = styleObj.ttColor[0].colorCode;
    vSelectedColorDesc = styleObj.ttColor[0].description;
    if (styleObj.ttColor[0].fabDesc != "" && styleObj.ttColor[0].fabDesc != null)
      { vSelectedColorDesc += " " + styleObj.ttColor[0].fabDesc; }
    $(".selectedColor").html(vSelectedColorDesc);
  }
  displayColors();
  if(styleObj.ttSizeScale && styleObj.ttSizeScale[1] != null){
    styleObj.ttSizeScale.sort(function(a,b){ return a.sortIndex - b.sortIndex }); //Ensure array is Sorted by sortIndex
    $.each(styleObj.ttSizeScale,function(i){
       if(styleObj.ttSizeScale[i].ttSizeScaleValue.length == 1)  /* 010003 */
         vSelectedMultiSize[i] = styleObj.ttSizeScale[i].ttSizeScaleValue[0].dimValue;
       else
         vSelectedMultiSize[i] = "";
    });
    displayMultiSizes();
  }
  else if(styleObj.ttSize!=null)  /* 010008 */
    displaySizes();
  
  //displayFeatIcons();
  displayFeats();

  if(styleObj.ttAltView)
    showAltViews('');
  if(styleObj.ttCompType)
    displayComprables();
  else{
    $(".prodComparable").html("");
    $(".prodComparable").hide();
  }
  if(vZoomInit != "" && vZoomInit != null)
     $(".MagicZoomBigImageCont > div > img").attr("src",vZoomInit);

  if($(".prodDisplay").css("display")=="none"){
    $(".prodDisplay").fadeIn(250);
  }
  if (vShowImgLib)
     showImgLib(vSelectedProd,vSelectedColor);

  if (typeof vDefaultPrice == "boolean") /* 010007 */
  {
	  if (vDefaultPrice)
	     priceItem("","",styleObj.ttItem[0].itemNumber);
  }

  /******v 010101 v******/

  if ( styleObj.ttItem.length == 1 && vSelectedProd == styleObj.ttItem[0].itemNumber  ) {
     
     if (isNaN(styleObj.ttItem[0].orderLimit) == false)
        vOrderLimit = parseFloat(styleObj.ttItem[0].orderLimit);

     if (vOrderLimit == 1) {
        $("#qty").val("1");  
        $(".prodQty").hide();
        $(".prodOrder").show();
     }
     else if (vOrderLimit == -1) {
        $(".prodOrder").hide();
        $(".prodQty").hide();                                      /* E010003 */
     }
     else {
        $(".prodOrder").show();
        $(".prodQty").show();                                      /* E010003 */       
     }
  }
  else {
     $(".prodOrder").show();
     $(".prodQty").show();                                         /* E010003 */
  }

  /******^ 010101 ^******/
  
  if (typeof customDisplay != "undefined") {                      /* E010009 */
     customDisplay();                                             /* E010009 */
  }                                                               /* E010009 */

}

function displayColors(){
       var vColorHTML = "";
       var vColorDesc ="";
       var vClass;

       var vHexPercent2 = "75,25";
       var vHexPercent3 = "50,25,25";
       var vHexPercent4 = "25,25,25,25";

       if(styleObj.ttColor!=null)  /* 010008 */
       for(var i=0; i<styleObj.ttColor.length; i++){
         if(vSelectedSize == "" || checkItem(styleObj.ttColor[i].colorCode,vSelectedSize) )
         {
           if(vSelectedColor=="" && i==0) {
             vSelectedColor     = styleObj.ttColor[i].colorCode;
           }

           if(vSelectedColor==styleObj.ttColor[i].colorCode) {
             vSelectedColorDesc = styleObj.ttColor[i].description;
             if (styleObj.ttColor[i].fabDesc != "" && styleObj.ttColor[i].fabDesc != null)
             { vSelectedColorDesc += " " + styleObj.ttColor[i].fabDesc; }

             $(".selectedColor").html(vSelectedColorDesc);
             if(vSelectedSize == "" || checkStock(styleObj.ttColor[i].colorCode,vSelectedSize,vDefaultWhse) > 0)
              vClass = "colorOuterSelected";
             else
              vClass = "colorOuterOOSSelected";
           } else {
             if(vSelectedSize == "" || checkStock(styleObj.ttColor[i].colorCode,vSelectedSize,vDefaultWhse) > 0)
               vClass = "colorOuter";
             else
               vClass = "colorOuterOOS";
           }
           vColorDesc = styleObj.ttColor[i].description;
           if (styleObj.ttColor[i].fabDesc != "" && styleObj.ttColor[i].fabDesc != null)
             { vColorDesc += " " + styleObj.ttColor[i].fabDesc; }

           vColorHTML += '<a href="' + styleObj.ttColor[i].imageZm + '" rel="zoom1" rev="' + styleObj.ttColor[i].imageLg + '" ' +
                         'onmouseover="swapImg(\'' + styleObj.ttColor[i].imageLg + '\');' +
                         '$(\'.selectedColor\').html(\'' + vColorDesc + '\'); ';

           if(vClass == "colorOuterOOS" || vClass == "colorOuterOOSSelected")
             vColorHTML += 'showOOSMsg(\'' + styleObj.ttColor[i].description + '\',vSelectedSizeDesc);';

           vColorHTML += ' " onmouseout="restoreImg();$(\'.selectedColor\').html(vSelectedColorDesc); ';

           if(vClass == "colorOuterOOS" || vClass == "colorOuterOOSSelected")
             vColorHTML += 'hideOOSMsg();';

           vColorHTML += ' " onclick="setColor(\'' + styleObj.ttColor[i].colorCode + '\',\'\'); return false;">';

           if (vDispColorDesc) {                                   /* XXX */
             vColorHTML += '<div class="swatchbox">';
             vColorHTML += '<div class="swatchcenter">';
           }

           vColorHTML += '<div class="' + vClass + '" colorcode="' + styleObj.ttColor[i].colorCode + '">';

           if (styleObj.ttColor[i].imageSw == "" || styleObj.ttColor[i].imageSw == null ){
             if (styleObj.ttColor[i].hexColor != "" && styleObj.ttColor[i].hexColor != null && styleObj.ttColor[i].hexColor.indexOf(",") != -1){ //Check for multiple hex values
               vHexArray = styleObj.ttColor[i].hexColor.split(",");
               switch(vHexArray.length){
                 case 2:
                   vHexPerArray = vHexPercent2.split(",");
                   break;
                 case 3:
                   vHexPerArray = vHexPercent3.split(",");
                   break;
                 case 4:
                   vHexPerArray = vHexPercent4.split(",");
                   break;
                 default:
                   vHexPerArray = vHexPercent2.split(",");
               }
               vColorHTML += '<div class="colorInner">';
               for(var j=0; j<vHexArray.length; j++){
                  vColorHTML += '<div style="margin:0px;padding:0px;float:left;height:100%;width:' + vHexPerArray[j] + '%;background-color:#' + vHexArray[j] + ';"></div>';
               }
               vColorHTML += '</div>';
             }
             else
               vColorHTML += '<div class="colorInner" style="background-color:#' + styleObj.ttColor[i].hexColor + ';"></div>';
           }
           else
             vColorHTML += '<img src="' + styleObj.ttColor[i].imageSw + '" onerror="top.ImageError(this,\'swatch\')" alt="" class="colorImg"/>';  /* 010009 */

           if (vDispColorDesc) {                                   /* XXX */
             vColorHTML += '</div>'; // colorOuter
             vColorHTML += '</div>'; // swatchcenter
             vColorHTML += '<span class="swatchboxtxt">' + styleObj.ttColor[i].description + '</span>';
           }

           vColorHTML += '</div></a>'; // swatchbox || colorOuter
         }
       }
       $(".prodColors").html(vColorHTML);
}
function displaySizes(){
   var vSizeHTML = "";
   var vClass;
   if (styleObj.ttSize.length==1){
     vSelectedSize = styleObj.ttSize[0].sizeCode;
     vSelectedSizeDesc = styleObj.ttSize[0].description;
     $(".selectedSize").html(vSelectedSizeDesc);
   }
   $(".sizeHeading").html("Size:"); /* 010007 */
   $.each(styleObj.ttSize,function(i){
     if( checkItem(vSelectedColor,styleObj.ttSize[i].sizeCode) )
     {
       if(vSelectedSize==styleObj.ttSize[i].sizeCode){
         if(checkStock(vSelectedColor,styleObj.ttSize[i].sizeCode,vDefaultWhse) > 0)
          vClass = "sizeOuterSelected";
         else
          vClass = "sizeOuterOOSSelected";
       }
       else{
         if(checkStock(vSelectedColor,styleObj.ttSize[i].sizeCode,vDefaultWhse) > 0)
           vClass = "sizeOuter";
         else
           vClass = "sizeOuterOOS";
       }
       vSizeHTML += '<div sizecode="' + styleObj.ttSize[i].sizeCode + '"' +
                    'onmouseover="$(\'.selectedSize\').html(\'' + styleObj.ttSize[i].description + '\'); ';

       if(vClass == "sizeOuterOOS" || vClass == "sizeOuterOOSSelected")
         vSizeHTML += 'showOOSMsg(vSelectedColorDesc,\'' + styleObj.ttSize[i].description + '\');';

       vSizeHTML += '" onmouseout="$(\'.selectedSize\').html(vSelectedSizeDesc); ';

       if(vClass == "sizeOuterOOS" || vClass == "sizeOuterOOSSelected")
         vSizeHTML += 'hideOOSMsg();';
       if (!vIsRetail) { vClass += " sizeb2b"; }
       vSizeHTML += '" onclick="setSize(\'' + styleObj.ttSize[i].sizeCode + '\',this)" class="' + vClass + '" >' +
                    '<div class="sizeInner">' + styleObj.ttSize[i].description + '</div>' +
                    '</div>';
     }
   });
   $(".prodSizes").html(vSizeHTML);
}
function displayMultiSizes(){
   var vSizeHTML = "";
   var vClass;
   if (styleObj.ttSizeScale.length == 1 && styleObj.ttSizeScale[0].ttSizeScaleValue.length == 1)
   { vSelectedMultiSize = styleObj.ttSizeScale[0].ttSizeScaleValue[0].dimValue; }
   if ($("#mainSizeHeading"))       /* 010007 */
      $("#mainSizeHeading").hide(); /* 010007 */
   $.each(styleObj.ttSizeScale,function(i){
      vSizeHTML += "<div class='sizeHeading'>" + styleObj.ttSizeScale[i].description + "</div><div class='prodSizes'>";
      $.each(styleObj.ttSizeScale[i].ttSizeScaleValue,function(j){
         if(multiSizeCheckItem(i,styleObj.ttSizeScale[i].ttSizeScaleValue[j].dimValue)){
            if(vSelectedMultiSize[i]==styleObj.ttSizeScale[i].ttSizeScaleValue[j].dimValue){
              if(multiSizeCheckStock(i,styleObj.ttSizeScale[i].ttSizeScaleValue[j].dimValue) > 0)
                vClass = "sizeOuterSelected" + i;
              else
                vClass = "sizeOuterOOSSelected" + i;
            }
            else{
              if(multiSizeCheckStock(i,styleObj.ttSizeScale[i].ttSizeScaleValue[j].dimValue) > 0)
                vClass = "sizeOuter" + i;
              else
                vClass = "sizeOuterOOS" + i;
            }
            vSizeHTML += '<div class="' + vClass + '" dimValue="' + styleObj.ttSizeScale[i].ttSizeScaleValue[j].dimValue + '"' +
                         'onmouseover="$(\'.selectedSize' + i + '\').html(\'' + styleObj.ttSize[i].description + '\'); ';
            if(vClass == "sizeOuterOOS" + i || vClass == "sizeOuterOOSSelected" + i)
              vSizeHTML += 'showMultiSizeOOSMsg(vSelectedColorDesc,' + i + ',\'' + styleObj.ttSizeScale[i].ttSizeScaleValue[j].dimValue + '\');';

            vSizeHTML += '" onmouseout="$(\'.selectedSize' + i + '\').html(vSelectedSizeDesc); ';

            if(vClass == "sizeOuterOOS" + i || vClass == "sizeOuterOOSSelected" + i)
              vSizeHTML += 'hideOOSMsg();';

            vSizeHTML += '" onclick="setMultiSize(' + i + ',\'' + styleObj.ttSizeScale[i].ttSizeScaleValue[j].dimValue + '\',this)">' +
                         '<div class="sizeInner">' + styleObj.ttSizeScale[i].ttSizeScaleValue[j].description + '</div>' +
                         '</div>';
         }
      });
      vSizeHTML += "</div>";
   });
   $(".prodSizes").html(vSizeHTML);
}
function switchComp(vType,curObj){
 $(".compTypeContainerH").hide();
 $(".compSelected").removeClass("compSelected");
 $(curObj).addClass("compSelected");
 vType = "#" + vType;
 $(vType).fadeIn(250);
}
function displayComprables(){
  var vCompHTML = "";
  var vCompPrice = 0.00;
  /******vv E010000 vv******/

  if(styleObj && styleObj.ttCompType && styleObj.ttCompType[0].ttCompDetail){
    $.each(styleObj.ttCompType,function(i){
      styleObj.ttCompType[i].ttCompDetail.sort(function(a,b){ return a.compSort - b.compSort }); //Ensure array is Sorted by compSort
    });
  }

  $.each(styleObj.ttCompType,function(i){
    if(styleObj.ttCompType[i].compType == vCompSugCode){
      vCompHTML += "<div class='compTitle'>" + styleObj.ttCompType[i].typeDesc + "</div>";
      $.each(styleObj.ttCompType[i].ttCompDetail,function(j){
        vCompHTML += "<div class='compDetail' onclick='goStyle(\"" + styleObj.ttCompType[i].ttCompDetail[j].compStyleCode + "\");'>";
        vCompHTML += "<img class='compDetailImg' src='" + styleObj.ttCompType[i].ttCompDetail[j].compImage + "' alt='" + styleObj.ttCompType[i].ttCompDetail[j].compStyleCode + "' onerror='top.ImageError(this,\"thumb\")' />";
        vCompHTML += "<div class='compDetailDesc'>" + styleObj.ttCompType[i].ttCompDetail[j].compDesc + "</div>";
        if (styleObj.ttCompType[i].ttCompDetail[j].regPrice > 0){  /* 010010 */
           if(styleObj.ttCompType[i].ttCompDetail[j].salePrice <= 0 ){
             vCompPrice = parseFloat(styleObj.ttCompType[i].ttCompDetail[j].regPrice);
             vCompPrice =  vCompPrice.toFixed(2);
             vCompHTML += '<div class="compDetailRegPriceDiv"><span class="compDetailRegPriceLabel"></span><span class="compDetailRegPrice">' + getCurrency(vCompPrice,currencyJS) + '</span></div>';
           }
           else{
             vCompPrice = parseFloat(styleObj.ttCompType[i].ttCompDetail[j].regPrice);
             vCompPrice =  vCompPrice.toFixed(2);
             vCompHTML += '<div class="compDetailRegPriceDiv"><span class="compDetailRegPriceLabel"></span><span class="compDetailRegPriceStrike">' + getCurrency(vCompPrice,currencyJS) + '</span></div>';
             vCompPrice = parseFloat(styleObj.ttCompType[i].ttCompDetail[j].salePrice);
             vCompPrice =  vCompPrice.toFixed(2);
             vCompHTML += '<div class="compDetailSalePriceDiv"><span class="compDetailSalePriceLabel">' + styleObj.ttCompType[i].ttCompDetail[j].saleLabel + '</span><span class="compDetailSalePrice">' + getCurrency(vCompPrice, currencyJS) + '</span></div>';
           }
        }
        vCompHTML += "</div>";
      });
      $(".prodCompRight").html(vCompHTML);
      $(".prodCompRight").show();
      vCompHTML = "";
    }
    if(styleObj.ttCompType[i].compType == vCompAccCode){
      vCompHTML += "<div class='accCompOuter'><div class='compTitle'>" + styleObj.ttCompType[i].typeDesc + "</div><div class='accCompInner'>";
      $.each(styleObj.ttCompType[i].ttCompDetail,function(j){
        vCompHTML += "<div class='compDetail' onclick='goStyle(\"" + styleObj.ttCompType[i].ttCompDetail[j].compStyleCode + "\");'>";
        vCompHTML += "<img class='compDetailImg' src='" + styleObj.ttCompType[i].ttCompDetail[j].compImage + "' alt='" + styleObj.ttCompType[i].ttCompDetail[j].compStyleCode + "'  onerror='top.ImageError(this,\"thumb\")' />";
        vCompHTML += "<div class='compDetailDesc'>" + styleObj.ttCompType[i].ttCompDetail[j].compDesc + "</div>";
        if (styleObj.ttCompType[i].ttCompDetail[j].regPrice > 0) { /* 010010 */
          if(styleObj.ttCompType[i].ttCompDetail[j].salePrice <= 0 ){
            vCompPrice = parseFloat(styleObj.ttCompType[i].ttCompDetail[j].regPrice);
            vCompPrice =  vCompPrice.toFixed(2);
            vCompHTML += '<div class="compDetailRegPriceDiv"><span class="compDetailRegPriceLabel"></span><span class="compDetailRegPrice">' + getCurrency(vCompPrice,currencyJS) + '</span></div>';
          }
          else{
            vCompPrice = parseFloat(styleObj.ttCompType[i].ttCompDetail[j].regPrice);
            vCompPrice =  vCompPrice.toFixed(2);
            vCompHTML += '<div class="compDetailRegPriceDiv"><span class="compDetailRegPriceLabel"></span><span class="compDetailRegPriceStrike">' + getCurrency(vCompPrice,currencyJS) + '</span></div>';
            vCompPrice = parseFloat(styleObj.ttCompType[i].ttCompDetail[j].salePrice);
            vCompPrice =  vCompPrice.toFixed(2);
            vCompHTML += '<div class="compDetailSalePriceDiv"><span class="compDetailSalePriceLabel">' + styleObj.ttCompType[i].ttCompDetail[j].saleLabel + '</span><span class="compDetailSalePrice">' + getCurrency(vCompPrice, currencyJS) + '</span></div>';
          }
        }
        vCompHTML += "</div>";
      });
      vCompHTML += "</div></div>";
      $(".prodCompBottom").html(vCompHTML);
      $(".prodCompBottom").show();
      var vTmpWidth = 0;
      $(".accCompInner > .compDetail").each(function(){ vTmpWidth += $(this).outerWidth(); });
      $(".accCompInner").width(vTmpWidth);
      vCompHTML = "";
    }
  /******^^ E010000 ^^******/
  });
}
function goStyle(vStyleCode,vStyleColor){
   golink("b2c/product.w?product=" + vStyleCode + "&color=" + vStyleColor + vBrowseParam,"main");
}
//========--------   Color/Size Selection   --------========\\
function setSize(vSizeCode,vThis){
  if(vSizeCode=="none" || !vIsRetail ) { return; }
  $(".cartError").html("");
  vSelectedSize = vSizeCode;
  if(document.getElementById("size" + vSelectedProd))
    document.getElementById("size" + vSelectedProd).value = vSizeCode;
  $(".sizeOuterSelected").attr("class","sizeOuter");
  $(".sizeOuterOOSSelected").attr("class","sizeOuterOOS");
  if(checkStock(vSelectedColor,vSelectedSize,vDefaultWhse) > 0)
    vClass="sizeOuterSelected";
  else
    vClass="sizeOuterOOSSelected";
  if(vThis == "")
    $("div[sizeCode='" + vSizeCode + "']").addClass(vClass);
  else
    vThis.className=vClass;

  $.each(styleObj.ttSize,function(i){
    if (styleObj.ttSize[i].sizeCode == vSizeCode) {
      vSelectedSizeDesc = styleObj.ttSize[i].description;
      $(".selectedSize").html(vSelectedSizeDesc);
    }
  });

  if (vSelectedSize != "" && vSelectedColor != "")
  { priceItem(vSelectedColor,vSelectedSize); }

  displayColors();
}
function setColor(vColorCode,vThis,vImgSwitch){
  var newLgImg;
  var newZmImg;
  $(".cartError").html("");
  if(vColorCode=="none") { return; }
  if(document.getElementById("#imgLibDiv"))
      $("#imgLibDiv").hide();
  vSelectedColor = vColorCode;
  if(document.getElementById("color" + vSelectedProd))
    document.getElementById("color" + vSelectedProd).value = vColorCode;

  $(styleObj.ttColor).each(function(i){
      if(styleObj.ttColor[i].colorCode == vColorCode){
         newLgImg = styleObj.ttColor[i].imageLg;
         newZmImg = styleObj.ttColor[i].imageZm;
         return;
      }
  });
  if(vImgSwitch)
     swapImg(newLgImg);
  if(newZmImg != "" && newZmImg != null){
    $(".MagicZoomBigImageCont div > img").attr("src",newZmImg); //hack to update zoom image
  }
  vLockedImg = $(".imageCell").attr("src");

  $(".colorOuterSelected").attr("class","colorOuter");
  $(".colorOuterOOSSelected").attr("class","colorOuterOOS");
  if(vSelectedSize == "" || checkStock(vSelectedColor,vSelectedSize,vDefaultWhse) > 0)
    vClass="colorOuterSelected";
  else
    vClass="colorOuterOOSSelected";
  if(vThis == "")
    $("div[colorCode='" + vColorCode + "']").addClass(vClass);
  else
    vThis.className=vClass;

  $.each(styleObj.ttColor,function(i){
    if (styleObj.ttColor[i].colorCode == vColorCode) {
      vColorObj = styleObj.ttColor[i];
    }
  });

  vSelectedColorDesc = vColorObj.description;
  if (vColorObj.fabDesc != "" && vColorObj.fabDesc != null)
    { vSelectedColorDesc += " " + vColorObj.fabDesc; }
  $(".selectedColor").html(vSelectedColorDesc);

  if (vSelectedSize != "" && vSelectedColor != "")
  { priceItem(vSelectedColor,vSelectedSize); }

  if(styleObj.ttSizeScale && styleObj.ttSizeScale[1] != null)
    displayMultiSizes();
  else if(styleObj.ttSize!=null)  /* 010008 */
    displaySizes();
  if(styleObj.ttAltView)
    switchAltViews(vColorCode);
}

function setMultiSize(vIndex,vDimValue,vThis){
  if(!vIsRetail ) { return; }
  var vFullSizeCode = "";
  var vFullSize = true;

  vSelectedMultiSize[vIndex] = vDimValue;
  $(".sizeOuterSelected" + vIndex).attr("class","sizeOuter" + vIndex);
  vThis.className="sizeOuterSelected" + vIndex;
  $.each(vSelectedMultiSize, function(i){
     vFullSizeCode += vSelectedMultiSize[i];
     if(vSelectedMultiSize[i] == "")
       vFullSize = false;
  });

  if(vFullSize){
    vSelectedSize = vFullSizeCode;
    $.each(styleObj.ttSize,function(i){
      if (styleObj.ttSize[i].sizeCode == vSelectedSize) {
        vSelectedSizeDesc = styleObj.ttSize[i].description;
        $(".selectedSize").html(vSelectedSizeDesc);
      }
    });
    displayColors();
  }
  else
    vSelectedSize = "";

  if (vSelectedSize != "" && vSelectedColor != "")
  { priceItem(vSelectedColor,vSelectedSize); }
  displayMultiSizes();
}
//========--------   size / stock checking   --------========\\

function checkStock(vColorCode,vSizeCode,vWhse){
  var vAvailQty = 0;
  $.each(styleObj.ttItem,function(i){
    if(styleObj.ttItem[i].colorCode == vColorCode && styleObj.ttItem[i].sizeCode == vSizeCode) {
      if (styleObj.ttItem[i].availQty == null)
        vAvailQty = 1;
      else
        vAvailQty = styleObj.ttItem[i].availQty;
      return; // returns from $.each function
    }
  });
  return vAvailQty;
}

function checkStockItem()
{
 var vAvailQty = 0;
  $.each(styleObj.ttItem,function(i)
  {
      if (styleObj.ttItem[i].availQty == null)
        vAvailQty = 1;
      else
        vAvailQty = styleObj.ttItem[i].availQty;
      return; // returns from $.each function
  });
  return vAvailQty;
}

function setStock(vColorCode,vSizeCode,vQty){
  var vAvailQty = 0;
  $.each(styleObj.ttItem,function(i){
    if(styleObj.ttItem[i].colorCode == vColorCode && styleObj.ttItem[i].sizeCode == vSizeCode) {
      styleObj.ttItem[i].availQty -= vQty;
      return; // returns from $.each function
    }
  });
}

function setStockItem(vQty){
  var vAvailQty = 0;
  $.each(styleObj.ttItem,function(i){

      styleObj.ttItem[i].availQty -= vQty;
      return; // returns from $.each function

  });
}


function multiSizeCheckStock(vIndex,vDimValue,vWhse){
  var vAvailQty = 0;
  var vTempSize = "";
  var vSize     = "";

  //return true if no other size dimension is selected
  $.each(vSelectedMultiSize,function(k){
     if (k != vIndex)
        vTempSize += vSelectedMultiSize[k];
     if (k == vIndex)
        vSize += vDimValue;
     else
        vSize += vSelectedMultiSize[k];
  });
  if (vTempSize == "")
  { return 1; }

  $.each(styleObj.ttItem,function(i){
    if(styleObj.ttItem[i].colorCode == vSelectedColor && styleObj.ttItem[i].sizeCode == vSize) {
      if (styleObj.ttItem[i].availQty == null)
        vAvailQty = 1;
      else
        vAvailQty = styleObj.ttItem[i].availQty;
      return; // returns from $.each function
    }
  });
  return vAvailQty;
}
function checkItem(vColorCode,vSizeCode){
  var vFound = false;
  $.each(styleObj.ttItem,function(k){
    if(styleObj.ttItem[k].colorCode == vColorCode && styleObj.ttItem[k].sizeCode == vSizeCode)
    { vFound = true; return; }
  });
  return vFound;
}
function multiSizeCheckItem(vIndex,vDimValue){
  var vFound = false;
  var vTempSize = "";
  var vSize     = "";

  //return true if no color or other size dimension is selected
  if(vSelectedColor == "")
  { return true; }
  $.each(vSelectedMultiSize,function(k){
     if (k != vIndex)
        vTempSize += vSelectedMultiSize[k];
     if (k == vIndex)
        vSize += vDimValue;
     else
        vSize += vSelectedMultiSize[k];
  });
  if (vTempSize == "")
  { return true; }
  return checkItem(vSelectedColor,vSize);
}
//========----   Feature Icon Display  ----========\\
function displayFeatIcons(){
  if(styleObj.ttFeatIcon){
    $.each(styleObj.ttFeatIcon,function(i){
     $(".prodIcons").append("<img src='" + styleObj.ttFeatIcon[i].icon + "' class='featureIcon' alt='" + styleObj.ttFeatIcon[i].description + "' />");
    });
  }
}
//========--------   Update Price   --------========\\
function priceItem(vColorCode,vSizeCode,vItemNumber){ /* 010007 */
  var newPrice = "";
  $.each(styleObj.ttItem,function(k){
    if((styleObj.ttItem[k].colorCode == vColorCode && styleObj.ttItem[k].sizeCode == vSizeCode) || vItemNumber == styleObj.ttItem[k].itemNumber){ /* 010007 */
      if(styleObj.ttItem[k].salePrice <= 0 ){
        $(".salePriceDiv").hide();
        $(".regPriceStrike").addClass("regPrice");
        $(".regPriceStrike").removeClass("regPriceStrike");
        newPrice = parseFloat(styleObj.ttItem[k].regPrice);
        $(".regPrice").html( getCurrency(newPrice,currencyJS) );
        $(".regPriceLabel").html(vRegPriceLabel);
        vSelectedPrice = newPrice.toFixed(2);
      }
      else{
        newPrice = parseFloat(styleObj.ttItem[k].regPrice);
        $(".regPriceLabel").html(vRegOnSaleLabel);
        $(".regPrice").html( getCurrency(newPrice,currencyJS) );
        $(".regPrice").addClass("regPriceStrike");
        $(".regPrice").removeClass("regPrice");
        newPrice = parseFloat(styleObj.ttItem[k].salePrice);
        vSelectedPrice = newPrice.toFixed(2);
        $(".salePrice").text(getCurrency(newPrice,currencyJS) );
        $(".salePriceDiv").show();
      }
      return;
    }
  });
}
//========--------   MouseOvers   --------========\\
function swapImg(vNewImg,vNoLock){
  if(vNewImg != "" ){
    if(!vNoLock)
      vLockedImg = $(".imageCell").attr("src");
    $(".imageCell").attr("src",vNewImg);
  }
}
function restoreImg(){
  if(vLockedImg != "" && $(".imageCell").attr("src") != vLockedImg)
  { $(".imageCell").attr("src",vLockedImg); }
}
function showOOSMsg(vColor,vSize){
  var vPosition   = $(".imgUpper").position();

  $(".imgMessageText").html(vColor + " is currently out of stock in " + vSize);

  var vTopOffset  = ( $(".jqzoom").outerHeight() - $("#imgMessage").outerHeight() - ( $("#imgMessage").outerHeight()/2) );
  var vLeftOffset = ( $(".imgUpper").outerWidth() - $("#imgMessage").outerWidth() )/2;

  $("#imgMessage").css("top",vPosition.top + vTopOffset);
  $("#imgMessage").css("left",vPosition.left + vLeftOffset);
  $("#imgMessage").show();
}
function showMultiSizeOOSMsg(vColor,vIndex,vDimValue){
  var vSize     = "";
  var vSizeDesc = "";
  $.each(vSelectedMultiSize,function(k){
     if (k == vIndex)
        vSize += vDimValue;
     else
        vSize += vSelectedMultiSize[k];
  });
  $.each(styleObj.ttSize,function(i){
     if(styleObj.ttSize[i].sizeCode == vSize){
        vSizeDesc = styleObj.ttSize[i].description;
        return;
     }
  });
  showOOSMsg(vColor,vSizeDesc);
}
function hideOOSMsg(){
  $("#imgMessage").hide();
}
/****** Retail Add to Cart ******/
function retailAddToCart(vProduct,vColor,vSize,vOrderType,vOFS,vUpsell,vFreightAmt,vSalesAmt){  /* E010007 */ /* E010008 */ /* E010009 */
  var vOrderQty = $("#qty").attr("value");
  if(vProdType=="S")  /* 010008 */
  {
   if(vColor == "" || vColor == "none" || vColor == null){
     $(".cartError").html("Please choose a color to continue.");
     return;  }
   if(vSize == "" || vSize == "none" || vSize == null) {
     $(".cartError").html("Please choose a size to continue.");
     return;  }
  }
  if (vOrderQty == "" ) {
    $(".cartError").html("Please enter a quantity before adding item(s) to shopping bag.");
    return;  }
  if (isNumeric(vOrderQty) == false) {
    $(".cartError").html("Please enter a numeric quantity before adding item(s) to shopping bag.");
    $("#qty").attr("value","")
    $("#qty").focus();
    return;  }
  if (vOrderQty <= 0)  {
    $(".cartError").html("Please enter a quantity before adding item(s) to shopping bag.");
    return;  }

  /******v 010101 v******/

  if (vOrderLimit > 1 && (parseFloat(vOrderQty)  > vOrderLimit)) { /* E010003 */
     if (vOrderLimitMsg.indexOf("<qty>") != -1)
        vOrderLimitMsg = vOrderLimitMsg.replace("<qty>",vOrderLimit);
     alert(vOrderLimitMsg);
     return;
  }

  /******^ 010101 ^******/

  var invAvail=0;  /* 010008 */
  if(vProdType=="S") invAvail = parseInt(checkStock(vColor,vSize));  /* 010008 */
  if(vProdType=="I") invAvail = parseInt(checkStockItem());
  if(invAvail < vOrderQty)  {
    if (invAvail <= 0)
     $(".cartError").html("The selected item is currently out of stock.");
    else{
     var alertMsg = "You have ordered " + vOrderQty + " however only ";
     if (invAvail == 1)
       alertMsg += "1 is available.";
     else
       alertMsg += invAvail + " are available.";
     alert(alertMsg);
    }
    if (invAvail <= 0 )
       invAvail = 1;
    $("#qty").attr("value",invAvail)
    $("#qty").focus();
    return;
  }
  vTopScroll=true; /* E010001 */
  addToCart(vProduct,vColor,vSize,vOrderQty,vOrderType,false,vOFS,vUpsell,vFreightAmt,vSalesAmt);     /* E010007 */ /* E010008 */ /* E010009 */
  if(vProdType=="S") setStock(vColor,vSize,vOrderQty);  /* 010008 */
  if(vProdType=="I") setStockItem(vOrderQty);  /* 010008 */
}
/*===---- Retail Functions ----===*/
function clearmessage(){
  $(".cartError").html("");
}
function enterCheck(event,id)
{
  if(event.keyCode == 13)
  {
    $("#retailAddToCart").click();
    return false;
  }
  return true;
}

function bookmarkMe(){
  if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
  window.external.AddFavorite(location.href,document.title);
  }
  else if (navigator.appName == "Netscape") {
    window.sidebar.addPanel(document.title,location.href,"");
  }
  else {
   if(agt.indexOf("opera")!= -1)
    alert("Press CTRL-T to bookmark this page.");
   else
    alert("Press CTRL-D to bookmark this page.");
  }
}

function openBlogText(vDescription,vImgPth,vFullDesc){
 if (styleObj){
   if (styleObj.description)
     vDescription = styleObj.description;
   if (styleObj.fullDesc != "" && styleObj.fullDesc != null)
     vFullDesc = styleObj.fullDesc;
   if (styleObj.imageTh != "" && styleObj.imageTh != null)
     vImgPth = styleObj.imageTh;
 }
 var vBlogHTML = "<table cellspacing='0' cellpadding='0' border='0' class='blogTable'>" +
                 "<tr><td colspan='2' style='font-weight:bold;font-size:12pt;'>" + document.title +
                 "</td></tr><tr><td rowspan='2'><img src='" + vImgPth + "' alt=''></td>" +
                 "<td style='text-align:center;vertical-align:top;height:25px;'><a style='font-weight:bold;font-size:11pt;' href='" + appPath + "/site.w?location=b2c/product.w&product=" + vSelectedProd +   /* 010010 */
                 "&frames=no&target=main&sponsor=" + vSponsorCode + "'>" + vDescription + "</a>" +
                 "</td><tr><td style='vertical-align:top;'>" + vFullDesc + "</td></tr></table>";
 vBlogHTML = "<div style='width:400px;text-align:center;margin:none;pading:none;'><table cellspacing='0' cellpadding='0' border='0' style='width:400px'><tr><td class='blogInstructions' style='text-align:center;'>Copy and paste the HTML text below to share this product on your blog or online profile.</td></tr></table>" + vBlogHTML + "<br/> <textarea>" + vBlogHTML + "</textarea></div>";
 if(!document.getElementById("blogPost")){
   $("body").append("<div id='blogPost' title='Blog HTML' style='width:400px;' />");
   $("#blogPost").html(vBlogHTML);
   $("#blogPost").dialog({width:450,height:475,resizable:false} );
 }
 else
   $("#blogPost").dialog("open");
}

function showAltViews(vColorCode){
 var vAltViewHTML = "";
 if(document.getElementById("altViews")){
   $.each(styleObj.ttAltView,function(i){
     if(styleObj.ttAltView[i].colorCode == vColorCode){
        vAltViewHTML += "<div id=\"altView" + styleObj.ttAltView[i].altId + "\" colorCode=\"" + vColorCode + "\" onmouseover=\"swapImg('" + styleObj.ttAltView[i].imageLg + "',true);\" onmouseout=\"restoreImg();\">" +
                       "<img src='" + styleObj.ttAltView[i].imageSm + "' alt='' />" +
                       "</div>";
     }
   });
   $("#altViews").html(vAltViewHTML);
   if ($(".altViewSide"))
     $(".prodDesc").width($(".prodDesc").width() - $(".altViewSide").outerWidth() );
   $("#altViews").css("display","block");
 }
}
function switchAltViews(vColorCode){
 var vAltViewHTML = "";
 var vAltViewId;
 if(document.getElementById("altViews")){
   $.each(styleObj.ttAltView,function(i){
     if(styleObj.ttAltView[i].colorCode == vColorCode){
       vAltViewId = "#altView" + styleObj.ttAltView[i].altId;
       vAltViewObj = $(vAltViewId);
       if(vAltViewObj){
           $(vAltViewObj).html("<img src='" + styleObj.ttAltView[i].imageSm + "' alt='' />")
                         .attr("colorCode",styleObj.ttAltView[i].colorCode);
           $(vAltViewObj).unbind("onmouseover");
           $(vAltViewObj).mouseover(function(){swapImg(styleObj.ttAltView[i].imageLg,true);});
       }
     }
   });
   //reset all non color specific altViews to defaults
   $.each(styleObj.ttAltView,function(i){
     if(styleObj.ttAltView[i].colorCode == ""){
       vAltViewId = "#altView" + styleObj.ttAltView[i].altId;
       vAltViewObj = $(vAltViewId);
       if(vAltViewObj && $(vAltViewObj).attr("colorCode") != vColorCode && $(vAltViewObj).attr("colorCode") != ""){
           $(vAltViewObj).html("<img src='" + styleObj.ttAltView[i].imageSm + "' alt='' />")
                         .attr("colorCode","");
           $(vAltViewObj).unbind("onmouseover");
           $(vAltViewObj).mouseover(function(){swapImg(styleObj.ttAltView[i].imageLg,true);});
       }
     }
   });
 }
}
/******vv E010001 vv******/
function displayFeats(){
  var vTmpHtml = "<ul class='prodFeats'>"; /* E010005 */
  var vTmpIcon = "";
  if(styleObj.ttFeatIcon){     
     $.each(styleObj.ttFeatIcon,function(i){
        //E010006 vTmpHtml += "<li detailCode='" + this.featDetailCode + "' onclick='selectFeat(this)'><div class='featDesc'><span class='featList'>" + this.featDesc + "</span>" + this.description + "</div></li>"; /* E010004 */
        if(this.iconTh!=""&&this.iconLg!=""&&this.iconZm!=""){
          vTmpIcon += "<div class='featIconOuter' detailCode='" + this.featDetailCode + "' onclick='selectFeat(this)'>" +
                     "<img src='" + this.iconTh + "' alt='" + this.featDesc + "' /></div>"
        }
     });
     //E010006 vTmpHtml += "</ul>";
     if(vTmpIcon!=""){
     vTmpIcon = "<div class='prodFeatIcons'>" + /* E010005 */
                "<div class='featIconOuter iconDefault' style='border:2px solid #9016B2;' onclick='resetZoom(true)'>" +
                "<img src='" + styleObj.imageTh + "' alt='' /></div>" +
                vTmpIcon;
     }
     vTmpIcon += "</div>";
  }
  else{
    //E010006 vTmpHtml = styleObj.fullDesc;
  }
  //E010006 $(".prodCatalogDesc").html(vTmpHtml);
  $(".prodImgOuter").prepend(vTmpIcon);

}
function selectFeat(vThisObj){
 var vFeatDetail = $(vThisObj).attr("detailcode");
 var vFoundIcon = false;
 $(".prodFeats li").css("color","#000000");
 $(".featIconOuter").css("border","2px solid #FFFFFF");
 vFeatSel = ".prodFeats li[detailcode=" + vFeatDetail + "]";
 $(vFeatSel).css("color","#9016b2");
 vFeatSel = ".featIconOuter[detailcode=" + vFeatDetail + "]";
 $(vFeatSel).css("border","2px solid #9016B2");

  if(styleObj.ttFeatIcon){     
     $.each(styleObj.ttFeatIcon,function(i){
        if(this.featDetailCode == vFeatDetail && this.iconTh != "" ){

           vFoundIcon = true;
           swapImg(this.iconLg);
           $(".MagicZoomBigImageCont div > img").attr("src",this.iconZm); 
           vLockedImg = this.iconLg;

        }
     });
  }
  if(!vFoundIcon){
    resetZoom(false);
  }
}
function resetZoom(vClearFeat){
   if(vClearFeat) { $(".prodFeats li").css("color","#000000"); }
   $(".featIconOuter").css("border","2px solid #FFFFFF");
   swapImg(styleObj.imageLg);
   $(".MagicZoomBigImageCont div > img").attr("src",styleObj.imageZm);
   vLockedImg = styleObj.imageLg;
   $(".iconDefault").css("border","2px solid #9016B2");
}

function showFaqHtml(vFilename) { 
  $("body").append("<div id='faqHtml' title='FAQ' />"); 
  $("#faqHtml").css("overflow","auto");
  $("#faqHtml").css("text-align","left");   
  $("#faqHtml").load(vFilename,function(){
    $("#faqHtml").dialog({width:700,
                          height:500, 
                          minHeight: 464,
                          maxHeight: 500,
                          resizable:false, 
                          close: function(ev, ui) { $(this).remove(); } /* E010002 */
                        });
    $("#faqHtml").css("height","464px");
  });
}
/******vv E010002 vv******/
function showVideo(vFilename) { 
  /***vv E010006 vv***/
  if($('#video').length) { return; }
  $("body").scrollTop(160);
  $("body").append("<div id='video' title='Video' />"); 
  var vTmpPos = $(".prodImgOuter").position();

  if(vFilename!=""){
    $('#video').flash(
        { src: vFilename,
          width: 350,
          height: 350 }
    );
  }
  else{
   $('#video').html("<img src='/europro/images/noVideo.jpg' alt='' />")
  }

  $("#video").dialog({width: $.browser.msie ? 476 : 471,  //$(".prodImgOuter").innerWidth() - 6, 
                      height: $.browser.msie ? 382 : 375, //$(".prodImgOuter").innerHeight() - 6,
                      minHeight: $.browser.msie ? 382 : 375, //$(".prodImgOuter").innerHeight() - 6,
                      resizable:false,
                      draggable:false,
                      overlay:false,
                      position: [vTmpPos.left,vTmpPos.top - $("body").scrollTop()],
                      close: function(ev, ui) { $(this).remove(); },
                      modal:false});
  $("#video").height($.browser.msie ? 382 : 375); //$(".prodImgOuter").innerHeight() - 6
  /***^^ E010006 ^^***/
}
/******^^ E010002 ^^******/
/******^^ E010001 ^^******/
