function openPrint(e, f) { e.href = f; window.print() }
$(document).ready(function () {
    $("ul.Horizontal li").mouseenter(function () { $("div.menuHover", this).show() }); $("ul.Horizontal li").mouseleave(function () { $("div.menuHover", this).hide() }); var e = $.query.get("catid"); if (e != "") { var f = $("[data-id='" + e + "']", "#sub_menu"); if (f.length > 0) if (f.get(0).tagName != "H4") { f = f.attr("data-selector"); $("h4[data-selector=" + f + "]").addClass("selected"); $("div[data-selector=" + f + "]").show() } else f.addClass("selected") } $("li[data-id=" + e + "]").addClass("selected"); $("ul.fourth_tier > li").click(function () { $(this).addClass("selected") });
    $("#sub_menu h4").click(function () { var a = $(this).next()[0].tagName == "DIV" ? $(this).next() : null, d = $(this).siblings("div:visible"); $(this).siblings("h4").each(function () { $(this).removeClass("selected") }); if (d.length) d.slideUp("fast", function () { $(this).prev().removeClass("selected"); if (a != null) { a.prev().addClass("selected"); a.slideToggle("fast") } }); else { a != null && a.slideToggle("fast"); $(this).hasClass("selected") ? $(this).removeClass("selected") : $(this).addClass("selected") } }); $("#sel-header-search").click(function () {
        if ($("#sel-header-search-txt").val().length >=
1) location.href = "default.aspx?pid=9&search=" + $.URLEncode($("#sel-header-search-txt").val())
    }); $("#sel-header-search-txt").live("keydown", function (a) { if (a.which == 13 || a.keyCode == 13) { a.preventDefault(); location.href = "default.aspx?pid=9&search=" + $.URLEncode($("#sel-header-search-txt").val()) } }); $("#sel-header-search-txt").live("click", function () { $(this).val() == $(this).attr("data-txt") && $(this).val("") }); $("#sel-header-search-txt").live("blur", function () { $(this).val() == "" && $(this).val($(this).attr("data-txt")) });
    $(".use-logo-description").live("click", function () { if ($(this).val() == $(this).attr("data-txt")) { $(this).val(""); $(this).css("color", "#000000") } }); $(".use-logo-description").live("blur", function () { $(this).val() == "" && $(this).val($(this).attr("data-txt")) }); $(".sel-product-image").live("click", function () { window.location.href = $(this).attr("data-href") }); $("div.item", "div.productCategory").live("mouseenter", function () { $("div.prodInfo", $(this)).toggleClass("prodInfoHover", true) }); $("div.item", "div.productCategory").live("mouseleave",
function () { $("div.prodInfo", $(this)).toggleClass("prodInfoHover", false) }); $.extend({ URLEncode: function (a) { var d = "", g = 0; a = a.toString(); for (var h = /(^[a-zA-Z0-9_.]*)/; g < a.length; ) { var c = h.exec(a.substr(g)); if (c != null && c.length > 1 && c[1] != "") { d += c[1]; g += c[1].length } else { if (a[g] == " ") d += "+"; else { c = a.charCodeAt(g).toString(16); d += "%" + (c.length < 2 ? "0" : "") + c.toUpperCase() } g++ } } return d }, URLDecode: function (a) {
    a = a; for (var d, g = /(%[^%]{2})/; (m = g.exec(a)) != null && m.length > 1 && m[1] != ""; ) {
        b = parseInt(m[1].substr(1), 16);
        d = String.fromCharCode(b); a = a.replace(m[1], d)
    } return a
} 
}); $(".sel-hide-bil-addr").click(function () { $(":checked", this.parent).length == 1 ? $(".sel-bil-addr").hide() : $(".sel-bil-addr").show() }); $("input.qty").live("click", function () { $(this).select() }); $("span.sel-select-all").live("click", function () { $("input[id$='hidEmployee_ID']").filter(function () { return $(this).val() == -1 }).each(function () { $(".select-all > input", $(this).parent().parent()).attr("checked", true) }) }); $("span.sel-deselect-all").live("click",
function () { $("input[id$='hidEmployee_ID']").each(function () { $(".select-all > input", $(this).parent().parent()).attr("checked", false) }) }); $("img.sel-open-overspend").live("click", function () {
    var a = $(this).attr("data-id"), d = $("tr.sel-overspend-panel[data-id='" + a + "']"), g = $(this); if (d.filter(":visible").length > 0) { d.hide(); g.attr("src", "gfx/plus.png"); g.attr("alt", "more") } else $.ajax({ type: "POST", url: "webservices/json.asmx/GetEmployeeOrderlines", data: "{iEmployee_ID:" + a + "}", contentType: "application/json; charset=utf-8",
        dataType: "json", async: false, success: function (h) { var c = ""; c += "<td>&nbsp;</td>"; c += '<td colspan="4">'; c += '<table width="100%">'; $.each(h.d, function (j, i) { c += "<tr>"; c += "<td>" + i.MyDateOrderCompleted + "</td>"; c += "<td>" + i.ProductName + "</td>"; c += "<td>" + i.ColourName + "</td>"; c += "<td>" + i.SizeName + "</td>"; c += '<td align="right">' + i.MyNetAmount + "</td>"; c += "</tr>" }); c += "</table>"; c += "</td>"; d.html(c); d.show(); g.attr("src", "gfx/minus.png"); g.attr("alt", "less") }, error: function (h) { _App.displayError(h) } 
    })
})
}); var selectedItemText;
function clearCombo(e) { selectedItemText = e.get_text(); e.clearSelection() } function setComboValue(e) { if (e.get_value() == "") { var f = new Telerik.Web.UI.RadComboBoxItem; f.set_text(selectedItemText); e.trackChanges(); e.get_items().add(f); f.select(); e.commitChanges() } } $(document).ready(function () { $("#front-page-rotator").jshowoff({ speed: 5E3, effect: "fade", controls: false, hoverPause: false, controls: true, controlText: { play: "", pause: ""} }) });