﻿uiFn = new uiFn();
var i;
var Reconstruction = {
  init: function () {
    Reconstruction.moveNews();
    Reconstruction.replaceHeader();
    Reconstruction.insertValSearchTxt();
    Reconstruction.fixPrMenuSpanTagMenu()
  },
  moveNews: function () {
    $("#ProductMenu_Table").before($("#prNewsAndSpecialOfferLinkBox"))
  },
  replaceHeader: function () {
    if (window.location.pathname.match(new RegExp("^/shop/news-ALL"))) {
      $("#prlistHeader H1").text("Nyheder")
    }
    if (window.location.pathname.match(new RegExp("^/shop/specialoffer-ALL-1.html"))) {
      $("#prlistHeader H1").text("Udsalg")
    }
    if (window.location.pathname.match(new RegExp("^/shop/search"))) {
      $("#prlistHeader H1").text("Søgeresultat")
    }
  },
  insertValSearchTxt: function () {
    var a = "SØG EFTER PRODUKT";
    $("#SFm .S").val(a);
    $("#SFm .S").focus(function () {
      if (this.value == a) {
        this.value = ""
      }
    });
    $("#SFm .S").blur(function () {
      if (this.value == "") {
        this.value = a
      }
    })
  },
  fixPrMenuSpanTagMenu: function () {
    var a = document.getElementById("ProductmenuContainer_DIV").getElementsByTagName("SPAN");
    for (i = 0; i < a.length; i++) {
      if (a[i].className == "ProductMenu_MenuItemBold") {
        a[i].parentNode.innerHTML += a[i].innerHTML;
        a[i].style.display = "none";
        a[i].innerHTML = ""
      }
    }
  }
};
Reconstruction.init();
$(document).ready(function () {
  $(".ProductMenu_MenuItemBold").remove();
  $(document).pngFix()
});

