﻿/// <reference path="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.1.js" />
/// <reference path="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.1-vsdoc.js " />
(function (a)
{
    "use strict";
    /*addLinkerEvents-ga.js*/
    a.extend({ addLinkerEvents: function () { var c = document.getElementsByTagName("a"), h = [window.location.hostname.replace("www.", ""), "uk.dph.lait.dk", "dk.dph.lait.dk", "dph.lait.dk", "dphtrading.com"], b = [".doc", ".xls", ".exe", ".zip", ".pdf", ".js"], f, k, g, e, l, d = d = _gat._getTracker(a.GoogleAnalytics.acct); for (f = 0; f < c.length; f++) { k = 0; g = c[f].getAttribute("onclick"); if (g != null) { g = String(g); if (g.indexOf("urchinTracker") > -1 || g.indexOf("_trackPageview") > -1) { continue } } for (e = 0; e < h.length; e++) { if (c[f].href.indexOf(h[e]) == -1 && c[f].href.indexOf("google-analytics.com") == -1) { k++ } } if (k == h.length && c[f].href.indexOf("mailto:") == -1) { c[f].onclick = function () { l = location.href.split("//"); d._trackPageview("/klik/ext/" + l[1]) + ";" + ((g != null) ? g + ";" : "") } } for (e = 0; e < b.length; e++) { if (c[f].href.indexOf(h[0]) != -1 && c[f].href.indexOf(b[e]) != -1) { c[f].onclick = function () { l = location.href.split(h[0]); d._trackPageview("/klik/downloads" + l[1]) + ";" + ((g != null) ? g + ";" : "") }; break } } if (c[f].href.indexOf("mailto:") != -1) { c[f].onclick = function () { l = location.href.split(":"); d._trackPageview("/klik/mailto/" + l[1]) + ";" + ((g != null) ? g + ";" : "") } } } } });
    /*AjaxFunctions.js*/
    a.extend({ AjaxFunctions: new (function () { this.selLang = "da"; this.cache = []; this.currentFocus = ""; this.isAsync = false; this.submitCaller = null }), initTranslation: function () { var c = document.cookie.split(";"), d = null, b; if (window.location.pathname.substring(0, 4) == "/dk/") { for (b = 0; b < c.length; b++) { d = c[b].split("="); if (d[0] == "mstto" && d[1] == "da") { document.cookie = "mstmode=manual;path=/" } } } if (window.location.pathname.substring(0, 4) == "/uk/") { for (b = 0; b < c.length; b++) { d = c[b].split("="); if (d[0] == "mstto" && d[1] == "en") { document.cookie = "mstmode=manual;path=/" } } } a(document).ready(function () { a.preLoadImages("/css/imgs/ajax-loader.gif"); a("#MSTWMenu").change(function () { a.AjaxFunctions.selLang = this.value }); if (typeof Umbraco == "undefined") { var f = Sys.WebForms.PageRequestManager.getInstance()._updatePanel, e = Sys.WebForms.PageRequestManager.getInstance(), g = new Array(), h = new Array(); Sys.WebForms.PageRequestManager.getInstance()._updatePanel = function (j, i) { a(".ValidationSummary").hide(); a(j).fadeOut("fast", function () { a.loadShowUpdatePanel(f, j, i, function () { if (a(".message").length == 1) { a.fancybox({ content: a(".message").html(), width: 400, height: 125, autoDimensions: false }) } a.AjaxFunctions.isAsync = false }) }) }; e.add_beginRequest(function (k, j) { var i = j.get_updatePanelsToUpdate(), l; if (i != null) { a.AjaxFunctions.currentFocus = j.get_postBackElement().id; l = i[0].replace(/\$/g, "_").replace(/ctl00_/g, ""); a("#" + l).ShowLoading(); e._scrollPosition = null } }); e.add_initializeRequest(function (j, i) { if (e.get_isInAsyncPostBack()) { i.set_cancel(true); g.push(i.get_postBackElement().id); h.push(document.forms[0].__EVENTARGUMENT.value) } }); e.add_endRequest(function (j, i) { if (g.length > 0) { __doPostBack(g.shift(), h.shift()) } }) } }); a("input[type='submit'].next").click(function () { a.AjaxFunctions.submitCaller = a(this) }); a("form").submit(function (f) { if (a.AjaxFunctions.isAsync && a.AjaxFunctions.submitCaller != null) { f.preventDefault(); setTimeout(function () { a.AjaxFunctions.submitCaller.click() }, 100) } else { a.AjaxFunctions.submitCaller = null } }); a.fn.extend({ ShowLoading: function () { a.AjaxFunctions.isAsync = true; var e = a(document.createElement("img")), g = a(this), f = a(document.createElement("div")); e.addClass("LoadingImage"); e.attr("src", "/css/imgs/ajax-loader.gif"); f.hide(); f.append(e); g.append(f); g.css({ position: "relative" }); f.addClass("overlay"); f.fadeIn("fast") }, HideLoading: function () { var e = a(this).find("div.overlay"); e.fadeOut("fast", function () { a.AjaxFunctions.isAsync = false; e.remove() }) } }) }, loadShowUpdatePanel: function (c, e, b, d) { c.apply(Sys.WebForms.PageRequestManager.getInstance(), new Array(e, b)); a(e).fadeIn("fast", d); a("#" + a.AjaxFunctions.currentFocus).focus() }, IsNumeric: function (b) { return (b - 0) == b && b.length > 0 }, changeLang: function (d, f) { var b = a("#MSTWMenu")[0].value, c = a(d), e = a(f); if (b == "da" && e.length == 1) { window.location.href = e.attr("href"); document.cookie = "mstmode=manual;path=/" } else { if (c.length == 1) { window.location.href = c.attr("href"); if (b == "en") { document.cookie = "mstmode=manual;path=/" } } } }, showText: function (b) { a.fancybox.showActivity(); a.getText(b, function (c) { a.fancybox({ width: 640, height: 480, autoDimensions: false, content: c }); a.fancybox.resize() }) }, getText: function (c, b) { a.ajax({ type: "POST", cache: false, url: "/handlers/GetText.ashx", data: { text: c, withClose: true }, success: b }) }, ShowPanel: function (c, d) { var e = a("#" + c), b = a("#" + d); if (e.length == 1) { if (b.length == 1) { b.fadeOut(400, function () { e.fadeIn() }) } } }, preLoadImages: function () { var d = arguments.length, c, b; for (c = d; c--; ) { b = document.createElement("img"); b.src = arguments[c]; a.AjaxFunctions.cache.push(b) } }, moreLessTexts: function (l, j) { var e = a("#textTop"), c = a("#textBottom"), k = a("#productPage").length == 1, f, g, i, b, h = function (n) { n.preventDefault(); var m = a(this); c.fadeIn(400, function () { f.hide(); i.attr("style", ""); window.location.href = m.attr("href") }) }, d = function (n) { n.preventDefault(); var m = a(this); c.fadeOut(400, function () { i.hide(); f.attr("style", ""); window.location.href = m.attr("href") }) }; if (e.length == 1 && c.length == 1 && !k) { b = a(document.createElement("div")); c.hide(); f = a(document.createElement("a")); f.addClass("button"); f.attr("href", "#bottomText"); f.text(l); g = a(document.createElement("a")); g.addClass("button"); g.text(j); g.attr("href", "#top"); i = g.clone(); i.css({ display: "inline" }); i.hide(); f.click(h); g.click(d); i.click(d); e.append(i); e.append(f); c.append(g) } } });
    /*BagScripts.js*/
    a.extend({ buy: function (c, m, p, k, f, b, i) { var j = a("#" + k), h = j.parent().prev().find("input[type=text]").first().val(), e = "Buy", n = j.parent().siblings().first().find("select"), o = j.closest("table"), l = f.indexOf("set") != -1, g = o.find("a").last().attr("rel"), d = j.attr("ga_event"); if (d && d.length > 0) { setTimeout(d, 0) } if (n.length == 1) { p = n.val() } if (b) { e = "BuyAlternate" } if (i == "") { i = 0 } a("#bagSubmit").closest("div.ContentItem").first().ShowLoading(); a.ajax({ type: "POST", url: "/WebServices/Shop.asmx/" + e, data: '{ "location":"' + window.location.pathname + window.location.search + '", "lang": ' + c + ', "itemId": "' + m + '", "amount": ' + h + ', "action": "' + f + '", "quality": "' + p + '", "alternativeViewId": ' + (i == undefined ? 0 : i) + ', "parent":"' + g + '" }', contentType: "application/json; charset=utf-8", dataType: "json", success: function (r) { var u = a.parseJSON(r.d), y, w, v, q, s, t, x, z; a("#itemCount").text(u.itemCount); a("#bagSubmit").closest("div.ContentItem").first().HideLoading(); if (u.addGlobal) { for (v in u.addGlobal) { x = u.addGlobal[v]; a("tr:not(tr.specialRow)").find('a[rel="' + x + '"]').each(function () { a.updateBuyScripts(a(this), true) }) } } if (u.removeGlobal) { for (q in u.removeGlobal) { z = u.removeGlobal[q]; a("tr:not(tr.specialRow)").find('a[rel="' + z + '"]').each(function () { a.updateBuyScripts(a(this), false) }) } } for (y in u.add) { s = u.add[y]; if (s.indexOf("_[SET]") != -1) { a.updateBuyScripts(o.find('a[rel="' + s.replace("_[SET]", "") + '"]').last(), true) } else { if (s[0] == "_") { a("a[rel*='" + s + "']").each(function () { if (a(this).attr("href").indexOf("sell") == -1) { a.updateBuyScripts(a(this), true) } }) } else { if (!l) { a.updateBuyScripts(o.find('a[rel="' + s + '"]').first(), true) } else { o.find('a[rel="' + s + '"]').each(function () { a.updateBuyScripts(a(this), true) }) } } } } for (w in u.remove) { t = u.remove[w]; if (t.indexOf("_[SET]") != -1) { a.updateBuyScripts(o.find('a[rel="' + t.replace("_[SET]", "") + '"]').last(), false) } else { if (t[0] == "_") { a("a[rel*='" + t + "']").each(function () { if (a(this).attr("href").indexOf("sell") == -1) { a.updateBuyScripts(a(this), false) } }) } else { if (!l) { a.updateBuyScripts(o.find('a[rel="' + t + '"]').first(), false) } else { o.find('a[rel="' + t + '"]').each(function () { a.updateBuyScripts(a(this), false) }) } } } } } }) }, sell: function (d, j, h, i, g, e, b, f) { var c = a("#" + g); if (a.cookie("sellpopup") == null && c.attr("href").indexOf("remove") == -1) { a.showText(j) } else { a.buy(d, h, i, g, e, b, f) } a.cookie("sellpopup", "OK", { path: "/", expires: 3600 }) }, updateBuyScripts: function (s, g) { if (s.length == 1) { var q = s.attr("href"), o = q.match(/^javascript:\$\.buy\(.*\);?$/), d = q.match(/^javascript:\$\.sell\(.*\);?$/), n = new Array(), r = s.attr("newAction"), t = s.attr("newText"), m = s.attr("newToolTip"), b = false, u = -1, h = "", j = "", e = "", p = "", i = false, l = "", f = -1, k = s.attr("ga_event"), c = s.attr("ga_event_new"); s.attr("ga_event", c); s.attr("ga_event_new", k); if (o != null) { q = o[0].match(/\(.*\)/)[0].substr(1); q = q.substr(0, q.length - 1); q = q.replace(/'/g, ""); n = q.split(","); u = a.trim(n[0]); h = a.trim(n[1]); j = a.trim(n[2]); e = a.trim(n[3]); p = a.trim(n[4]); i = a.trim(n[5]); l = a.trim(n[6]); b = p.indexOf("remove") == -1; if (g == undefined) { g = b } if (b == g) { s.attr("newToolTip", s.attr("title")); s.attr("title", m); s.attr("newAction", p); s.attr("newText", s.text()); s.text(t); s.attr("href", "javascript:$.buy(" + u + ",'" + h + "', '" + j + "', '" + e + "', '" + r + "', " + i + ", '" + l + "')") } } else { if (d != null) { q = d[0].match(/\(.*\)/)[0].substr(1); q = q.substr(0, q.length - 1); q = q.replace(/'/g, ""); n = q.split(","); u = a.trim(n[0]); f = a.trim(n[1]); h = a.trim(n[2]); j = a.trim(n[3]); e = a.trim(n[4]); p = a.trim(n[5]); i = a.trim(n[6]); l = a.trim(n[7]); b = p.indexOf("remove") == -1; if (g == undefined) { g = b } if (b == g) { s.attr("newToolTip", s.attr("title")); s.attr("title", m); s.attr("newAction", p); s.attr("newText", s.text()); s.text(t); s.attr("href", "javascript:$.sell(" + u + "," + f + ",'" + h + "', '" + j + "', '" + e + "', '" + r + "', " + i + ", '" + l + "')") } } } } }, SaveNote: function (n, h, b, l) { var f = a("#" + n), m = f.closest("tr"), e = m.attr("id"), g = f.parent().parent().find("textarea").val().replace(/\"/g, "&quot;"), j = m.prev().find(".productDescription li.noteField"), k = j.find("span"), i = j.find("a"), d = i.attr("newtext"), c = i.attr("edittext"); a.ajax({ type: "POST", url: "/WebServices/Shop.asmx/SaveNote", data: '{ "itemId": "' + h + '", "note": "' + g + '", "sale":' + b + ', "quality":' + l + " }", contentType: "application/json; charset=utf-8", dataType: "json", success: function (o) { showHideComment(e); if (a.trim(g) == "") { k.html(d) } else { k.html(c) } } }) }, isEnter: function (b) { var c = null; if (b.which) { c = b.which } else { if (b.keyCode) { c = b.keyCode } } if (13 == c) { return true } return false }, ChangeAmount: function (c, g, f, i, d) { if (d != undefined && a.isEnter(d)) { d.preventDefault(); d.stopPropagation(); console.log("Should have been prevented!") } if (d == undefined || a.isEnter(d)) { var h = a("#" + c), b = h.val(); a("#updatebtn").parent().ShowLoading(); a.ajax({ type: "POST", url: "/WebServices/Shop.asmx/ChangeAmount", data: '{ "itemId": "' + g + '", "amount": ' + b + ', "sale":' + f + ', "quality":' + i + " }", contentType: "application/json; charset=utf-8", dataType: "json", success: function (e) { if (e.d == "reload") { window.location.reload() } else { a("#updatebtn").click() } } }) } if (a.isEnter(d)) { return false } }, RemoveItem: function (b, d, c, e) { a("#updatebtn").parent().ShowLoading(); a.ajax({ type: "POST", url: "/WebServices/Shop.asmx/ChangeAmount", data: '{ "itemId": "' + d + '", "amount": 0, "sale":' + c + ', "quality":' + e + " }", contentType: "application/json; charset=utf-8", dataType: "json", success: function (f) { if (f.d == "reload") { window.location.reload() } else { a("#updatebtn").click() } } }) }, SaveStep1: function (b, f, g, d) { var c = a("#" + b + " input[type=radio]:checked").val(), e = a("#" + f).val().replace(/\"/g, "&quot;"); if (!d) { a("#updatebtn").parent().ShowLoading() } a.ajax({ type: "POST", url: "/WebServices/Shop.asmx/SaveStep1", data: '{ "note": "' + e + '", "payType": ' + c + ', "nodeId": ' + g + " }", contentType: "application/json; charset=utf-8", dataType: "json", success: function (h) { a("input.next").val(h.d); if (!d) { a("#updatebtn").parent().HideLoading() } } }) }, SendMails: function (c, b, d) { a.ajax({ type: "POST", data: '{ "email": "' + c + '", "name": "' + b + '", "nodeId": ' + d + " }", url: "/WebServices/Shop.asmx/SendMails", contentType: "application/json; charset=utf-8", dataType: "json" }) }, InBag: function (d, f, c) { var b = a("#" + f), e = ""; if (b.length == 1) { e = b.val() } a.ajax({ type: "POST", url: "/WebServices/Shop.asmx/IsInBag", data: '{ "itemId":"' + d + '", "quality": ' + e + ', "sale": ' + c + " }", contentType: "application/json; charset=utf-8", dataType: "json", success: function (g) { a.updateBuyScripts(b.closest("tr").find('a[rel="sell_' + d + '"]'), g.d) } }) } });
    /*DefaultingText.js*/
    a.extend({ ClearText: function (b) { if (b[0].value === b.defaultText) { b[0].style.color = ""; b[0].value = "" } }, ResetText: function (b) { if (b[0].value.length == 0 || b[0].value === b.defaultText) { b[0].style.color = "#aaaaaa"; b[0].value = b.defaultText } }, SetUpDefaultingText: function (c, b) { c = a(c); if (c != null && c.length > 0) { c.defaultText = b; c.focus(function () { a.ClearText(c) }); c.blur(function () { a.ResetText(c) }); a.ResetText(c) } }, SetSubmitButton: function (b, c) { b = a("#" + b); c = a("#" + c); b.keypress(function (d) { if (d.keyCode == 13) { c.click(); location.href = c.attr("href") } }) } });
    /*GoogleAnalytics.js*/
    a.extend({ GoogleAnalytics: new (function () { this.acct = "UA-1000185-1"; this.FinishTrans = function (b) { b._trackTrans() } }), initGA: function (c, b) { try { setTimeout(function () { a.gaSSDSLoad(c, b) }, 100) } catch (d) { } }, gaSSDSLoad: function (c, b) { function d(n, k) { var j = a("#Print"), m = a("#TipFriend"), g = a("#Languages").children(), f = a(".newsLetter > input[type='submit']"), h, e, l; if (j.length > 0) { j.click(function () { print(); a.GATrackEvent("klik", "print", k) }) } if (m[0] != null) { m.click(function () { a.GATrackEvent("klik", "Tip en ven knap", k) }) } for (h = 0; h < g.length; h++) { e = g[h].id.indexOf("DK") > -1 ? "Dansk" : "Engelsk"; a(e[h]).click(function () { a.GATrackEvent("klik", "Sprog", e) }) } if (f[0] != null) { f.click(function () { a.GATrack("/klik/nyhedsbrev/tilmeld", true) }) } if (n) { l = window.location; a.GATrack(l.pathname + l.search) } else { a.GATrack(null) } } a(document).ready(function () { d(c, b) }) }, GATrack: function (d, c) { var e = _gat._getTracker(a.GoogleAnalytics.acct); if (d == null) { e._trackPageview() } else { if (d != null && c) { d = d.replace(/\s/g, "_"); e._trackPageview(d) } else { var b = window.location; e._trackPageview(b.pathname + b.search) } } }, GATrackEvent: function (d, e, b) { var c = _gat._getTracker(a.GoogleAnalytics.acct); a.GATrack("/" + d + "/" + e + "/" + b, true); c._trackEvent(d, e, b) }, AddTrans: function (b, e, h, i, g, d, f) { var c = _gat._getTracker(a.GoogleAnalytics.acct); c._addTrans(b, "", e, h, i, g, d, f); return c }, AddItem: function (h, f, b, e, g, c, d) { d._addItem(h, f, b, e, g, c); return d }, TrackBuy: function (d, c) { c = parseInt(c * 100); var b = _gat._getTracker(a.GoogleAnalytics.acct); console.log(d, c); b._trackEvent("Produkter", "Placer i kurv Buy", d, c) }, TrackAskBuy: function (c) { var b = _gat._getTracker(a.GoogleAnalytics.acct); b._trackEvent("Produkter", "Placer i kurv Ask price buy", c) }, TrackAskSell: function (c) { var b = _gat._getTracker(a.GoogleAnalytics.acct); b._trackEvent("Produkter", "Placer i kurv Ask price sell", c) }, TrackBuyRemove: function (d, c) { var b = _gat._getTracker(a.GoogleAnalytics.acct); b._trackEvent("Produkter", "Fjern fra kurv Buy", d, c) }, TrackAskBuyRemove: function (c) { var b = _gat._getTracker(a.GoogleAnalytics.acct); b._trackEvent("Produkter", "Fjern fra kurv Ask price buy", c) }, TrackAskSellRemove: function (c) { var b = _gat._getTracker(a.GoogleAnalytics.acct); b._trackEvent("Produkter", "Fjern fra kurv Ask price sell", c) } });
    /*jquery.cookie.js*/
    a.extend({ cookie: function (c, k, n) { var f = "", g, m, h, b, e, j, l, d; if (typeof k != "undefined") { n = n || {}; if (k === null) { k = ""; n.expires = -1 } if (n.expires && (typeof n.expires == "number" || n.expires.toUTCString)) { if (typeof n.expires == "number") { g = new Date(); g.setTime(g.getTime() + (n.expires * 1000)) } else { g = n.expires } f = "; expires=" + g.toUTCString() } m = n.path ? "; path=" + (n.path) : ""; h = n.domain ? "; domain=" + (n.domain) : ""; b = n.secure ? "; secure" : ""; document.cookie = [c, "=", encodeURIComponent(k), f, m, h, b].join("") } else { e = null; if (document.cookie && document.cookie != "") { l = document.cookie.split(";"); for (j = 0; j < l.length; j++) { d = jQuery.trim(l[j]); if (d.substring(0, c.length + 1) == (c + "=")) { e = decodeURIComponent(d.substring(c.length + 1)); break } } } return e } } });
    /*ProductImageHover.js*/
    a.extend({ initProductImageHover: function () { var b = a(".smallProductImg"); b.mouseover(function () { var g = a(this), f = a("#hoverImgPanel"), e = a("#hoverImgPanel > img"), d = g.position(), h = g.attr("src").replace("/100/", "/170/"), c = h.indexOf("image="); if (c != -1) { c += 6 } else { c = 0 } h = h.substring(c); e.attr("src", "/umbraco/imagegen.ashx?compression=100&pad=true&width=170&image=" + h); f[0].style.top = d.top + "px"; f[0].style.left = (d.left + g.width()) + "px"; f.show() }); b.mouseout(function () { var d = a("#hoverImgPanel"), c = a("#hoverImgPanel > img"); c.attr("src", "/css/imgs/ajax-loader.gif"); d.hide() }) } });
    /*Searching.js*/
    a.extend({ initSearch: function (c, e, h, b, f) { a.initSearchTypeChange(c, e, h, f); var g = a("#" + c), d = a("#" + b); g.keypress(function (i) { if (i.keyCode == 13) { i.preventDefault(); location.href = e + "?Keyword=" + encodeURIComponent(this.value) + "&Advanced=false"; return false } }); d.click(function () { location.href = e + "?Keyword=" + encodeURIComponent(a(this).parent().find("input").val()) + "&Advanced=false" }) }, initAdvancedSearch: function (f, b, m, k, e, d, l, j, g, i, n) { a.initSearchTypeChange(f, g, true, n); var h = a("#" + f + ", #" + b + ", #" + m + ", #" + k + ", #" + e + ", #" + d + ", #" + l + ", #" + j), c = a("#" + i); h.keypress(function (o) { if (o.keyCode == 13) { o.preventDefault(); c.click(); return false } }); c.click(function () { g = g + "?Keyword=" + encodeURIComponent(a("#" + f).val()) + "&Any=" + encodeURIComponent(a("#" + b).val()) + "&Exact=" + encodeURIComponent(a("#" + m).val()) + "&Without=" + encodeURIComponent(a("#" + k).val()) + "&Product=" + encodeURIComponent(a("#" + e).val()) + "&OnlyFromYear=" + encodeURIComponent(a("#" + d).val()) + "&FromYear=" + encodeURIComponent(a("#" + l).val()) + "&ToYear=" + encodeURIComponent(a("#" + j).val()) + "&Advanced=true"; location.href = g }) }, initSearchTypeChange: function (c, e, f, b) { if (b != null) { var d = a("#" + b); d.click(function () { var g = a("#" + c)[0].value; location.href = e + "?Keyword=" + encodeURIComponent(g) + "&Advanced=" + (f ? "false" : "true") }) } }, showContentResult: function () { a.cookie("search", "content", { path: "/", expires: 300 }); a.ShowPanel("contentSearch", "ProductPanel") }, showProductsResult: function () { a.cookie("search", "product", { path: "/", expires: 300 }); a.ShowPanel("ProductPanel", "contentSearch") }, showAllResults: function () { a.cookie("search", "all", { path: "/", expires: 300 }); var c = a("#contentSearch"), b = a("#ProductPanel"); if (c.length == 1) { c.fadeIn() } if (b.length == 1) { b.fadeIn() } }, initSearchScript: function () { if (a.cookie("search") == null || a.cookie("search") == "all") { a("#radioShowAll").attr("checked", "checked"); a.showAllResults() } else { if (a.cookie("search") == "content") { a("#radioShowContent").attr("checked", "checked"); a.showContentResult() } else { if (a.cookie("search") == "product") { a("#radioShowProds").attr("checked", "checked"); a.showProductsResult() } } } } });
    /*TreeExtensions.js*/
    a.extend({ TreeExtensions: new (function () { this.scrolling = false; this.lastScroll = 0; this.scrollSpeed = 2 }), NTree_ScrollToElement: function (f) { var c = a(".RadTreeView")[0], b = f.offsetLeft - c.offsetLeft - 21, g = f.offsetLeft + f.offsetWidth - c.offsetLeft, e = !a.TreeExtensions.scrolling && (c.scrollLeft > b || c.scrollLeft + c.offsetWidth < g), d; if (e) { a.TreeExtensions.scrolling = true; d = Math.ceil(b); setTimeout(function () { a.NTree_ScrollAnim(d) }, a.TreeExtensions.scrollSpeed) } }, NTree_ScrollAnim: function (c) { if (a.TreeExtensions.scrolling) { var b = a(".RadTreeView")[0]; a.TreeExtensions.lastScroll = b.scrollLeft; if (b.scrollLeft > c) { b.scrollLeft -= 1 } else { if (b.scrollLeft < c) { b.scrollLeft += 1 } } if (c != b.scrollLeft && b.scrollLeft != a.TreeExtensions.lastScroll) { setTimeout(function () { a.NTree_ScrollAnim(c) }, a.TreeExtensions.scrollSpeed) } else { a.TreeExtensions.scrolling = false } } }, TreeClientNodePopulated: function (c, b) { a.initAdvancedTree() }, initAdvancedTree: function () { setTimeout(function () { var b = a(".rtLI > div > a"); b.each(function () { a(this).unbind("mouseover"); a(this).mouseover(function () { a.NTree_ScrollToElement(this) }) }); if (a("#MSTWMenuOrigItem").length > 0) { a("#MSTWMenu").val(a.selLang); a("#MSTWGoButton").click(); a("#MSTWMenu").val(a.selLang); a("#MSTWGoButton").click() } }, 100) } });
    /*validation.js*/
    a.extend({ initValidator: function (g, b, h, m, o, e, l, p, k, j, c) { function i() { var q = a("form").valid(); if (!q) { a("input.next").addClass("cancel"); a("div.ValidationSummary").show() } else { a("div.ValidationSummary").hide(); a("input.next").removeClass("cancel") } } function d() { var s = -1; if (navigator.appName == "Microsoft Internet Explorer") { var q = navigator.userAgent; var r = new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})"); if (r.exec(q) != null) { s = parseFloat(RegExp.$1) } } return s } a.validator.addMethod("MyRequired", function (r, q) { return r != null && r.length > 0 }, "*"); a.validator.addMethod("CompareMail", function (t, q) { var s = a("input.email").val(), r = a("input.emailreply").val(); return s === r }, "*"); a.validator.addMethod("Currency", function (s, r) { try { var t = parseFloat(s); return t > 0 && t < 1000000 } catch (q) { return false } }, "*"); a("form").validate({ errorLabelContainer: "div.ValidationSummary ul", wrapper: "li", showErrors: function (r, s) { var q = a("form").validate().numberOfInvalids(); if (q == 0) { a("div.ValidationSummary").hide() } else { a("div.ValidationSummary").show() } this.defaultShowErrors() }, onfocusout: false, onkeyup: false, onclick: false, onsubmit: false }); if (a("input.email").length > 0) { a("input.email").rules("add", { required: true, MyRequired: true, email: true, messages: { required: g, MyRequired: g, email: l} }) } if (a("input.emailreply").length > 0) { a("input.emailreply").rules("add", { required: true, MyRequired: true, CompareMail: true, email: true, messages: { required: b, MyRequired: b, CompareMail: b, email: l} }) } if (a("input.name").length > 0) { a("input.name").rules("add", { required: true, MyRequired: true, messages: { required: h, MyRequired: h} }) } if (a("input.address").length > 0) { a("input.address").rules("add", { required: true, MyRequired: true, messages: { required: m, MyRequired: m} }) } if (a("input.zipcode").length > 0) { a("input.zipcode").rules("add", { required: true, MyRequired: true, messages: { required: o, MyRequired: o} }) } if (a("input.city").length > 0) { a("input.city").rules("add", { required: true, MyRequired: true, messages: { required: e, MyRequired: e} }) } if (a("span.acceptTerms input").length > 0) { a("span.acceptTerms input").rules("add", { required: true, messages: { required: c, MyRequired: c} }) } if (a("textarea.paymentReason").length > 0) { a("textarea.paymentReason").rules("add", { required: true, MyRequired: true, messages: { required: j, MyRequired: j} }) } if (a("input.currency").length > 0) { a("input.currency").rules("add", { required: true, Currency: true, MyRequired: true, messages: { required: p, MyRequired: p, Currency: k} }) } var n = d(); n = n > -1 && n < 9; function f(q) { if (a("input.next.cancel").length > 0) { q.preventDefault(); a("input.next").removeClass("cancel"); return false } } if (a("input.next").length > 0) { a("input.next").click(function (q) { i(); if (n && a("input.next.cancel").length > 0) { q.preventDefault(); a("input.next").removeClass("cancel"); return false } }) } if (!n) { a("form").bind("submit", f) } } });

    // Initialize scripts:
    a(document).ready(function ()
    {
        try
        {
            a.initTranslation();
        } catch (e) { }
        try
        {
            a.initProductImageHover();
        } catch (e) { }
        try
        {
            a.initSearchScript();
        } catch (e) { }
        try
        {
            a.initGalleries();
        } catch (e) { }
        try
        {
            a.initAdvancedTree();
        } catch (e) { }
        try
        {
            a.addLinkerEvents();
        } catch (e) { }
        try
        {

            if (a(".message").length == 1)
                setTimeout(function () { a.fancybox({ content: a(".message").html(), width: 400, height: 125, autoDimensions: false }) }, 100);
        } catch (e) { }
    });

})(jQuery);
