﻿productListUtil = new productListUtil();




var expandListFunction = {
  init: function () {

  },
  activateExpand: function (inVal) {
    if (inVal == "1") {
      return;
    }
    if (inVal == "Alle varer") {
      inVal = 200;
    }
    var LocVar = location.href;
    LocVar = LocVar.replace(/\&CustomPageSize=\d+/gi, "");
    location.href = LocVar + "&CustomPageSize=" + inVal;
    return false;
  }
}


if (document.getElementById('prlistwrapper')) {
  productListUtil.init();

}
if (document.getElementById('prListPagingNextTD')) {
  expandListFunction.init();
}


function productListUtil() {
  var i;

  this.init = function () {
    redesignDescription();
    removeEight();
  },
  redesignDescription = function () {
    if (exists("prlistDescription")) {
      if (document.getElementById('prlistDescription').innerHTML == "") {
        document.getElementById('prlistDescription').style.display = "none";
      }
    }
  }
removeEight = function () {
    if (document.getElementById('ProductList_TD')) {
        var fResult = document.getElementById('Main_TD').getElementsByTagName("span");
        for (i = 0; i < fResult.length; i++) {
            if (fResult[i].className == "PriceStriked_Productlist") {
                fResult[i].innerHTML = fResult[i].innerHTML.replace(new RegExp("</strike>8<strike>", "gi"), "8");
            }
        }
    }
} 
  exists = function (inVal) {
    if (document.getElementById(inVal)) {
      return true;
    }

  }
}








