var activeMenu = -1, activeMenuClass = ""; function validateEmail(e) { return new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i).test(e) } function GetLebaneseZoneDateTime() { var e; return $.ajax({ type: "GET", async: !1, url: "/SiteWebService.asmx/GetLebaneseZoneDateTime", type: "POST", dataType: "json", data: "", contentType: "application/json; charset=utf-8", success: function (t) { var a = jQuery.parseJSON(t.d); e = a.LebaneseDate }, error: function (e) { } }), new Date(e) } function ToJavaScriptDate(e) { var t = /Date\(([^)]+)\)/.exec(e); return new Date(parseFloat(t[1])) } function getWeekendCountBetweenDates(e, t) { var a = 0; if (e.setHours(0, 0, 0, 0), t.setHours(0, 0, 0, 0), 20 == t.getDate() && t.getMonth() + 1 == 3 && 2022 == t.getFullYear()) return 0; for (var i = e; i <= t; i.setDate(i.getDate() + 1))0 == i.getDay() && a++; return a } function ShoppingCartDeliveryDate() { if (!($("#txtDeliveryDate").length <= 0)) { $("#txtDeliveryDate").val(""); var e = $("#ddlCountry").val(), t = $("#ddlArea").val(); if ("-- select country --" != e && null != t && "-1" != t) { var a = GetLebaneseZoneDateTime(), i = parseInt($("#hdfAreaDeliveryDays").val()) + parseInt($("#hdfProductDeliveryDays").val()), o = GetLebaneseZoneDateTime(), n = GetLebaneseZoneDateTime(), r = GetLebaneseZoneDateTime(); if (r.setDate(r.getDate() + parseInt(i)), console.log("startDate1: " + n), i += getWeekendCountBetweenDates(o, r), $("#hdfoveralldeliveryDays").val(i), parseInt(i) > 0 && a.setDate(a.getDate() + parseInt(i)), console.log("startDate: " + n), console.log("1-dateToday:" + a), n.getDate() == a.getDate() && n.getMonth() == a.getMonth() && n.getFullYear() == a.getFullYear()) { var s = a.getHours(); s >= 16 ? (a.setDate(a.getDate() + parseInt(1)), console.log("getDate" + a.getDate()), console.log("getMonth" + (a.getMonth() + 1)), console.log("getFullYear" + a.getFullYear()), 10 == a.getDate() && a.getMonth() + 1 == 4 && 2024 == a.getFullYear() && (console.log("april 10"), a.setDate(a.getDate() + parseInt(1))), 17 == a.getDate() && a.getMonth() + 1 == 6 && 2024 == a.getFullYear() && (console.log("june 17"), a.setDate(a.getDate() + parseInt(1)))) : ($("#ddlDeliveryTime").val("-1"), s < 10 ? ($("#ddlDeliveryTime option[value*='10:00am to 1:00pm']").prop("disabled", !1), $("#ddlDeliveryTime option[value*='1:00pm to 4:00pm']").prop("disabled", !1), $("#ddlDeliveryTime option[value*='4:00pm to 9:00pm']").prop("disabled", !1)) : ($("#ddlDeliveryTime option[value*='10:00am to 1:00pm']").prop("disabled", !0), s < 13 ? ($("#ddlDeliveryTime option[value*='1:00pm to 4:00pm']").prop("disabled", !1), $("#ddlDeliveryTime option[value*='4:00pm to 9:00pm']").prop("disabled", !1)) : ($("#ddlDeliveryTime option[value*='1:00pm to 4:00pm']").prop("disabled", !0), s < 16 ? $("#ddlDeliveryTime option[value*='4:00pm to 9:00pm']").prop("disabled", !1) : $("#ddlDeliveryTime option[value*='4:00pm to 9:00pm']").prop("disabled", !0)))) } console.log("2-dateToday:" + a), $("#hdfDatWithTime").val(a), a.setHours(0, 0, 0, 0), $("#hdfDat").val(a), $(".jqDatePickerDeliveryDate").focus((function () { $(this).blur() })), console.log("3dateToday:" + a), $(".jqDatePickerDeliveryDate").datepicker({ dateFormat: "dd/mm/yy", changeMonth: !0, changeYear: !0, defaultDate: $("#hdfDat").val(), beforeShowDay: function (e) { var t = new Date($("#hdfDat").val()), a = e.getDay(); t.getDate() == e.getDate() && t.getMonth() == e.getMonth() && t.getFullYear() == e.getFullYear() && (new Date($("#hdfDatWithTime").val()).getHours() >= 16 && (a = 0)); return 10 == e.getDate() && e.getMonth() + 1 == 4 && 2024 == e.getFullYear() && (a = 0), 17 == e.getDate() && e.getMonth() + 1 == 6 && 2024 == e.getFullYear() && (a = 0), e < t ? a = 0 : 20 == e.getDate() && e.getMonth() + 1 == 3 && 2022 == e.getFullYear() && (a = 1), [0 != a, ""] }, onSelect: function (e, t) { $("#ddlDeliveryTime").val(); var a = GetLebaneseZoneDateTime(), i = (a.getDate(), a.getMonth(), a.getFullYear(), $(this).val().split("/")), o = new Date(i[2], i[1] - 1, i[0]); if (console.log("onSelect GetLebaneseZoneDateTime():" + a), console.log("onSelect choosenDate():" + o), $("#ddlDeliveryTime").val("-1"), a.getDate() == o.getDate() && a.getMonth() == o.getMonth() && a.getFullYear() == o.getFullYear()) { var n = a.getHours(); n < 10 ? ($("#ddlDeliveryTime option[value*='10:00am to 1:00pm']").prop("disabled", !1), $("#ddlDeliveryTime option[value*='1:00pm to 4:00pm']").prop("disabled", !1), $("#ddlDeliveryTime option[value*='4:00pm to 9:00pm']").prop("disabled", !1)) : ($("#ddlDeliveryTime option[value*='10:00am to 1:00pm']").prop("disabled", !0), n < 13 ? ($("#ddlDeliveryTime option[value*='1:00pm to 4:00pm']").prop("disabled", !1), $("#ddlDeliveryTime option[value*='4:00pm to 9:00pm']").prop("disabled", !1)) : ($("#ddlDeliveryTime option[value*='1:00pm to 4:00pm']").prop("disabled", !0), n < 16 ? $("#ddlDeliveryTime option[value*='4:00pm to 9:00pm']").prop("disabled", !1) : $("#ddlDeliveryTime option[value*='4:00pm to 9:00pm']").prop("disabled", !0))) } else $("#ddlDeliveryTime option[value*='10:00am to 1:00pm']").prop("disabled", !1), $("#ddlDeliveryTime option[value*='1:00pm to 4:00pm']").prop("disabled", !1), $("#ddlDeliveryTime option[value*='4:00pm to 9:00pm']").prop("disabled", !1) }, yearRange: "-0:+1" }), console.log("-setDate:" + a), $(".jqDatePickerDeliveryDate").datepicker("setDate", a) } else $("#txtDeliveryDate").focus((function () { $(this).blur() })) } } function AreaChange() { var e = "", t = ""; if ($("#ddlArea option:selected").each((function () { e = $(this).text(), t = $(this).val() })), $("#divDeliveryTime").hide(), $(".jqDatePickerDeliveryDate").val(""), $("#hdfSelectedAreaID").val(t), t > 0) { var a = !1; $.ajax({ type: "GET", async: !1, url: "/SiteWebService.asmx/ValidateShoppingCartAreaRestrictedProucts", type: "POST", dataType: "json", data: '{AreaName:"' + e + '"}', contentType: "application/json; charset=utf-8", success: function (e) { 1 == e.d ? a = !0 : DisplayNotificationMessageNew("divNotificationMessage", "Flowers, cakes and balloons are delivered outside Beirut only through Express Delivery. Kindly choose your express delivery area from the list.", 1e4) }, error: function (e) { } }), $.ajax({ type: "GET", async: !1, url: "/SiteWebService.asmx/GetAreaDetails", type: "POST", dataType: "json", data: '{AreaName:"' + e + '"}', contentType: "application/json; charset=utf-8", success: function (e) { if (e.d) { var t = jQuery.parseJSON(e.d); $("#hdfAreaDeliveryDays").val(t.DeliveryDays), $("#hdfAreaDeliveryDaysNotification").val(t.DeliveryDaysNotification), a && "" != $("#hdfAreaDeliveryDaysNotification").val() && DisplayNotificationMessageNew("divNotificationMessage", $("#hdfAreaDeliveryDaysNotification").val(), 2e3), $("#divDeliveryTime").hide() } }, error: function (e) { } }) } ShoppingCartDeliveryDate() } function InitializeData() { if (HighlightActiveMenu(), AnimateMenu(), SetWaterMarks(), $('[data-toggle="tooltip"]').tooltip(), DisplayShoppingCartItemCount(), $(".jqDatePicker").datepicker({ dateFormat: "dd/mm/yy", changeMonth: !0, changeYear: !0, yearRange: "-100:+0" }), ShoppingCartDeliveryDate(), $(".searchProductTextBox").keyup((function (e) { 13 === e.keyCode && SearchProducts($(".searchProductTextBox").val()) })), $(".searchProductButton").click((function (e) { SearchProducts($(".searchProductTextBox").val()) })), $("#divNotificationMessageClose").click((function (e) { $("#divAddingItemToCartMessage").fadeOut("slow") })), $(".divOrderConfirmationOrder").length > 0) { var e = $(".divOrderConfirmationOrder").html(); res = e.replace(/"/g, "'"), OrderContent = res, $.ajax({ type: "GET", async: !1, url: "/SiteWebService.asmx/OrderConfirmationOrderEmailContent", type: "POST", dataType: "json", data: '{OrderContent:"' + OrderContent + '"}', contentType: "application/json; charset=utf-8", success: function (e) { }, error: function (e) { alert("Error! " + e.status + " - " + e.statusText) } }) } $("#divShoppingCartContainer").length > 0 && $("html, body").animate({ scrollTop: $("#divShoppingCartContainer").offset().top }, 250), $("#ddlCountry").length > 0 && $("#ddlCountry option:selected").each((function () { var e = $(this).val(); "-- select country --" != e && ShowShippingAddressArea(e) })), $("#ddlArea").length > 0 && AreaChange(), $("#ddlShippingAddress").change((function () { var e = ""; $("#ddlShippingAddress option:selected").each((function () { e = $(this).val(), $.ajax({ type: "GET", async: !1, url: "/SiteWebService.asmx/GetShippingAddressDetails", type: "POST", dataType: "json", data: '{ShippingAddressID:"' + e + '"}', contentType: "application/json; charset=utf-8", success: function (e) { if (e.d) { var t = jQuery.parseJSON(e.d); $("#chkShowSenderNAme").prop("checked", t.ShowSenderName), $(".myCheckbox").prop("checked", !0), $(".myCheckbox").prop("checked", !1), $("#txtSenderPhoneNumber").val(t.SenderPhoneNumber), $("#txtRecipientName").val(t.RecipientName), $("#ddlCountry").val(t.CountryId), $("#hdfSelectedCountryID").val(t.CountryId), $("#ddlCountry option:selected").each((function () { $("#hdfSelectedCountry").val($(this).text()) })), $("#hdfSelectedAreaID").val(t.AreaID), ShowShippingAddressArea(t.CountryId), $("#txtCity").val(t.City), $("#txtAddress").val(t.Address), $("#txtBuilding").val(t.Building), $("#txtFloor").val(t.Floor), $("#txtNearestLandmark").val(t.NearestLandmark), $("#txtEmailAddress").val(t.ShippingEmailAddress), $("#txtPhone").val(t.PhoneNumber) } }, error: function (e) { } }) })) })), $("#ddlCountry").change((function () { var e = ""; $("#ddlCountry option:selected").each((function () { e = $(this).val(), $("#hdfSelectedCountryID").val(e), $("#hdfSelectedCountry").val($(this).text()), $("#hdfSelectedAreaID").val("0"), ShowShippingAddressArea(e) })) })), $("#ddlArea").change((function () { AreaChange() })), EqualizeSubCategoriesHeightForCategories(), $(".SupplierSlider").slick({ autoplay: !0, autoplaySpeed: 4e3, dots: !0, infinite: !0, arrows: !1, prevArrow: '<button type="button" class="slick-prev"></button>', nextArrow: '<button type="button" class="slick-next"></button>', slidesToShow: 6, slidesToScroll: 6 }), $(".SupplierMobileSlider").slick({ autoplay: !0, autoplaySpeed: 4e3, dots: !1, infinite: !0, arrows: !1, prevArrow: '<button type="button" class="slick-prev"></button>', nextArrow: '<button type="button" class="slick-next"></button>', centerMode: !0, slidesToShow: 4, slidesToScroll: 4 }), $(".divPromoNotificationContainerWrapper").length > 0 && $(".divPromoNotificationContainerWrapper").click((function () { $("#divPromoNotification").hide() })), "1" == $("#hdfShowPromoNotification").val() && setTimeout((function () { $("#divPromoNotification").show(), $.ajax({ type: "GET", async: !1, url: "/SiteWebService.asmx/SetShowPromoNotification", type: "POST", dataType: "json", data: "", contentType: "application/json; charset=utf-8", success: function (e) { }, error: function (e) { } }) }), 2e3) } function SearchProducts(e) { var t = "/searchproducts.aspx?n=" + e.toLowerCase(); window.location.assign(t) } function ShowShippingAddressArea(e) { if ($("#ddlArea").empty(), $("#ddlArea").append(new Option("-- select area --", "-1")), "" != $("#hdfAreasList").val()) { var t = jQuery.parseJSON($("#hdfAreasList").val()); for (var a in t) if (t[a].CountryID == e) { var i = t[a].AreaID, o = t[a].AreaName; $("#ddlArea").append(new Option(o, i, !1)) } "0" != $("#hdfSelectedAreaID").val() && $("#ddlArea").val($("#hdfSelectedAreaID").val()) } AreaChange() } function EqualizeSubCategoriesHeightForCategories() { var e = 0; $(".ProductCategoriesItemPadding .item .subContainer").each((function (t) { e < $(this).height() && (e = $(this).height()) })), $(".ProductCategoriesItemPadding .item .subContainer").each((function (t) { e > $(this).height() && $(this).height(e) })) } function ApplyToCareer(e) { $("#txtJobTitle").val(e), $("#txtTitle").focus() } function SetWaterMarks() { $("#txtLoginUser2").watermark("Username"), $("#txtLoginPassword2").watermark("Password"), $("#txtUsernameForgetPassword").watermark("Username") } function AnimateMenu() { $("#topMenu li.Desktop.links").each((function (e) { e != activeMenu ? $(this).hover((function () { $(this).stop(!0, !1).animate({ height: "90px" }) }), (function () { $(this).stop(!0, !1).animate({ height: "70px" }) })) : $(this).stop(!0, !1).animate({ height: "90px" }) })) } function HighlightActiveMenu() { var e = "", t = $(location).attr("pathname").toLowerCase(); switch ("/" == t && (t = "/default.aspx"), !0) { case (t.match(/default/g) || []).length > 0: e = ".home"; break; case (t.match(/profile/g) || []).length > 0: e = ".profile"; break; case (t.match(/services/g) || []).length > 0: e = ".services"; break; case (t.match(/products/g) || []).length > 0: e = ".products"; break; case (t.match(/specialoffers/g) || []).length > 0: e = ".specialoffers"; break; case (t.match(/newsandevents/g) || []).length > 0: e = ".newsandevents"; break; case (t.match(/careers/g) || []).length > 0: e = ".careers"; break; case (t.match(/contactus/g) || []).length > 0: e = ".contactus", HighlightQuickViewIcon("location"); break; case (t.match(/offerdetails/g) || []).length > 0: e = ".specialoffers"; break; case (t.match(/shoppingcart/g) || []).length > 0: HighlightQuickViewIcon("shoppingcart") }activeMenu = $("#topMenu li.Desktop.links").index($(".navbar-nav " + e)), $(".navbar-nav " + e).addClass("active"), activeMenuClass = e } function AddItemToCart(e) { $.ajax({ type: "GET", async: !1, url: "/SiteWebService.asmx/AddProductToShoppingCart", type: "POST", dataType: "json", data: "{ProductID:" + e + "}", contentType: "application/json; charset=utf-8", success: function (e) { e.d ? ($("#divShopcartadd").show(), $("#divShopcartexclude").hide()) : ($("#divShopcartadd").hide(), $("#divShopcartexclude").show()), $("#divAddingItemToCartMessage").show() }, error: function (e) { $("#divShopcartadd").hide(), $("#divShopcartexclude").show(), $("#divAddingItemToCartMessage").show() } }), DisplayShoppingCartItemCount(), setTimeout((function () { $("#divAddingItemToCartMessage").fadeOut("slow") }), 15e3) } function HideNotificationMessage() { $("#divAddingItemToCartMessage").fadeOut("slow") } function DisplayNotificationMessage(e, t, a) { $("#" + e).html(t), $("#" + e).show(), $("#divAddingItemToCartMessage").show(), setTimeout((function () { $("#divAddingItemToCartMessage").fadeOut("slow"), $("#" + e).hide() }), 1e4) } function DisplayNotificationMessageNew(e, t, a) { $("#" + e).html(t), $("#" + e).show(), $("#divAddingItemToCartMessage").show(), setTimeout((function () { $("#divAddingItemToCartMessage").fadeOut("slow"), $("#" + e).hide() }), a) } function AddItemToCartWithDetails(e) { var t = $(".txtQuantity").val(), a = $(".txtDeliveryDate").val(); $.ajax({ type: "GET", async: !1, url: "/SiteWebService.asmx/AddProductToShoppingCartWithDetails", type: "POST", dataType: "json", data: "{ProductID:" + e + ",Quantity:" + t + ',DeliveryDate:"' + a + '"}', contentType: "application/json; charset=utf-8", success: function (e) { e.d ? ($("#divShopcartadd").show(), $("#divShopcartexclude").hide()) : ($("#divShopcartadd").hide(), $("#divShopcartexclude").show()), $("#divAddingItemToCartMessage").show() }, error: function (e) { $("#divShopcartadd").hide(), $("#divShopcartexclude").show(), $("#divAddingItemToCartMessage").show() } }), DisplayShoppingCartItemCount(), setTimeout((function () { $("#divAddingItemToCartMessage").fadeOut("slow") }), 15e3) } $(document).ready((function (e) { })); var selectedQuickViewIcon = ""; function ShowQuickView(e) { selectedQuickViewIcon != e ? ("" != selectedQuickViewIcon && HideQuickView(selectedQuickViewIcon), HighlightQuickViewIcon(e), $("." + e + "-quickview").toggle("slide", { direction: "right" }, 1e3), selectedQuickViewIcon = e) : HideQuickView(e) } function HighlightQuickViewIcon(e) { switch (e) { case "shoppingcart": $(".menu-shoppingcart-icon").attr("src", "images/shoppingCart-selected-icon.jpg"), SetShoppingCartQuickView(); break; case "search": $(".menu-search-icon").attr("src", "images/search-selected-icon.jpg"); break; case "location": $(".menu-location-icon").attr("src", "images/location-selected-icon.jpg"); break; case "user": $(".menu-user-icon").attr("src", "images/user-selected-icon.jpg"), SetUserQuickView() } } function ClearHighlightQuickViewIcon(e) { switch (e) { case "shoppingcart": $(".menu-shoppingcart-icon").attr("src", "images/shoppingCart-icon.png"); break; case "search": $(".menu-search-icon").attr("src", "images/search-icon.jpg"); break; case "location": $(".menu-location-icon").attr("src", "images/location-icon.jpg"); break; case "user": $(".menu-user-icon").attr("src", "images/user-icon.jpg") } } function HideQuickView(e) { if ("" != selectedQuickViewIcon) switch (selectedQuickViewIcon) { case "shoppingcart": $(".menu-shoppingcart-icon").attr("src", "images/shoppingCart-icon.jpg"); break; case "search": $(".menu-search-icon").attr("src", "images/search-icon.jpg"); break; case "location": $(".menu-location-icon").attr("src", "images/location-icon.jpg"); break; case "user": $(".menu-user-icon").attr("src", "images/user-icon.jpg") }$("." + selectedQuickViewIcon + "-quickview").toggle("slide", { direction: "right" }, 1e3), selectedQuickViewIcon = "" } function GoToSearch() { var e = $(".searchProductPriceTextBox").val(), t = "searchproducts.aspx?n=" + $(".searchProductNameTextBox").val() + "&c=" + $(".searchProductCategoryTextBox").val() + "&p=" + e + "&b=" + $(".searchProductBrandTextBox").val(); window.location.assign(t) } function GetShoppingCartItemCount() { var e = 0; return $.ajax({ type: "GET", async: !1, url: "/SiteWebService.asmx/GetShoppingCartItemCount", type: "POST", dataType: "json", data: "", contentType: "application/json; charset=utf-8", success: function (t) { e = t.d }, error: function (e) { } }), e } function DisplayShoppingCartItemCount() { var e = GetShoppingCartItemCount(); e > 0 ? ($(".ShoppingCartItemsCount").html("" + e), HighlightQuickViewIcon("shoppingcart")) : ($(".ShoppingCartItemsCount").html("0"), ClearHighlightQuickViewIcon("shoppingcart")) } function SetShoppingCartQuickView() { if (GetShoppingCartItemCount() > 0) { $(".divShoppingCartEmpty").hide(), $(".divShoppingCart").show(), $(".divShoppingCartItemsQuickView").html(""); var e = GetShoppingCartItems(); $(".divShoppingCartItemsQuickView").html(e) } else $(".divShoppingCart").hide(), $(".divShoppingCartItemsQuickView").html(""), $(".divShoppingCartEmpty").show() } function SetUserQuickView() { ShowSignup() } function GetShoppingCartItems() { var e = $("#hdfCurrency").val(), t = "", a = 0; return $.ajax({ type: "GET", async: !1, url: "/SiteWebService.asmx/GetShoppingCartItems", type: "POST", dataType: "json", data: "", contentType: "application/json; charset=utf-8", success: function (i) { for (var o = jQuery.parseJSON(i.d), n = 0; n < o.length; n++) { var r = ""; r = (r = (r = (r = (r += '<tr class="ui-widget-content">') + '<td style="border-right: 0px;"><img width="60px" src="../imagesdb/Products/Thumbnail/' + o[n].ThumbnailPhoto + '" /></td>') + "<td  >" + o[n].ProductTitle + "</td>") + "<td >" + o[n].Price.toLocaleString("en", { minimumFractionDigits: 2 }) + " " + e + "</td>") + "<td >" + o[n].ShoppingCartQuantity + "</td>", t += r += "</tr>", a += o[n].Price * o[n].ShoppingCartQuantity } t = '<table class="gridview" style="border-style: None; width: 100%;"><tr class="ui-widget-header"><th colspan=2>Product Name</th><th>Quantity</th><th style="border-right: 0px;">Price</th></tr>' + t + "</table>" }, error: function (e) { alert("Error! " + e.status + " - " + e.statusText) } }), $("#spanShoppingCartItemsQuickViewTotal").html(a.toLocaleString("en", { minimumFractionDigits: 2 }) + " " + e), t } function Login() { $("#lblLoginMessage").hide(), "" == $("#txtLoginUser2").val() && $("#spLoginUser").show(), "" == $("#txtLoginPassword2").val() && $("#spLoginPassword").show(), "" != $("#txtLoginUser2").val() && "" != $("#txtLoginPassword2").val() && ($("#spLoginUser").hide(), $("#spLoginPassword").hide(), $.ajax({ type: "GET", async: !1, url: "/SiteWebService.asmx/Login", type: "POST", dataType: "json", data: '{username:"' + $("#txtLoginUser2").val() + '",password:"' + $("#txtLoginPassword2").val() + '"}', contentType: "application/json; charset=utf-8", success: function (e) { e.d ? window.location.reload() : $("#lblLoginMessage").show() }, error: function (e) { $("#lblLoginMessage").show() } })) } function ShowForgetPassword() { $(".divSignin").hide(), $(".divForgetPassword").show(), $("#spForgetPasswordNotification").hide(), $("#spForgetPasswordNotification").hide(), $("#txtUsernameForgetPassword").val("") } function ShowSignup() { $(".divSignin").show(), $(".divForgetPassword").hide(), $("#lblLoginMessage").hide(), $("#txtLoginUser2").val(""), $("#txtLoginPassword2").val(""), $("#spLoginUser").hide(), $("#spLoginPassword").hide() } function ResetPassword() { $("#spForgetPasswordNotification").hide(), "" != $("#txtUsernameForgetPassword").val() ? ($("#spUsernameForgetPassword").hide(), $.ajax({ type: "GET", async: !1, url: "/SiteWebService.asmx/ResetPassword", type: "POST", dataType: "json", data: '{username:"' + $("#txtUsernameForgetPassword").val() + '"}', contentType: "application/json; charset=utf-8", success: function (e) { e.d ? ($("#spForgetPasswordNotification").html("please check your email address"), $("#spForgetPasswordNotification").show()) : ($("#spForgetPasswordNotification").html("please enter a valid username"), $("#spForgetPasswordNotification").show()) }, error: function (e) { $("#spForgetPasswordNotification").html("please enter a valid username"), $("#spForgetPasswordNotification").show() } })) : $("#spUsernameForgetPassword").show() } function AddProductWithQuantityToShoppingCart(e, t) { var a = 0; return $.ajax({ type: "GET", async: !1, url: "/SiteWebService.asmx/AddProductWithQuantityToShoppingCart", type: "POST", dataType: "json", data: "{ProductID:" + e + ",Quantity:" + t + "}", contentType: "application/json; charset=utf-8", success: function (e) { e.d && (a = e.d) }, error: function (e) { return -1 } }), a } function ModifyShoppingcartQuantities(e, t, a, i) { var o = parseInt($("#" + a).val()); switch (t) { case "+": o += 1; break; case "-": o -= 1 }if (o > 0) { $("#" + a).val(o); var n = a.lastIndexOf("_"), r = a.substring(n + 1); a.indexOf("Mobile") > 0 ? $("#ContentPlaceHolder1_gvShoppingCart_txtQuantity_" + r).val(o) : $("#ContentPlaceHolder1_gvShoppingCartMobile_txtQuantity_" + r).val(o); var s = $("#hdfCurrency").val(), c = 0, d = !1; $.ajax({ type: "GET", async: !1, url: "/SiteWebService.asmx/AddProductWithQuantityToShoppingCart", type: "POST", dataType: "json", data: "{ProductID:" + e + ",Quantity:" + o + "}", contentType: "application/json; charset=utf-8", success: function (e) { e.d && (c = e.d.ShoppingCartProductSum, d = e.d.Availability) }, error: function (e) { } }); var l = c; $("#lblSubTotal").html(l.toLocaleString("en", { minimumFractionDigits: 2 }) + " " + s), $("#lblAllTotal").html(l.toLocaleString("en", { minimumFractionDigits: 2 }) + " " + s), d ? ($("#ContentPlaceHolder1_gvShoppingCart_imgOutOfStock_" + r).hide(), $("#ContentPlaceHolder1_gvShoppingCart_imgOutOfStocky_" + r).hide()) : ($("#ContentPlaceHolder1_gvShoppingCart_imgOutOfStock_" + r).show(), $("#ContentPlaceHolder1_gvShoppingCart_imgOutOfStocky_" + r).show(), DisplayNotificationMessage("divNotificationMessage", "Some items are out of stock. Please review your order")) } } function ModifyShoppingcartDeliveryDate(e, t) { var a = $("#" + t).val(), i = t.lastIndexOf("_"); t.substring(i + 1); updateProductShoppingCartWithDeliveryDate(e, a) } function updateProductShoppingCartWithDeliveryDate(e, t) { return $.ajax({ type: "GET", async: !1, url: "/SiteWebService.asmx/UpdateProductShoppingCartWithDeliveryDate", type: "POST", dataType: "json", data: "{ProductID:" + e + ",DeliveryDate:" + t + "}", contentType: "application/json; charset=utf-8", success: function (e) { if (e.d) return !0 }, error: function (e) { alert("function execution has failed: " + e.status + ": " + e.statusText + "." + e.responseText) } }), !1 } function getParameterByName(e, t) { t || (t = window.location.href), e = e.replace(/[\[\]]/g, "\\$&"); var a = new RegExp("[?&]" + e + "(=([^&#]*)|&|#|$)").exec(t); return a ? a[2] ? decodeURIComponent(a[2].replace(/\+/g, " ")) : "" : null } function URLRewriteQueryString(e) { return e.replace("'", "").replace('"', "").replace(" ", "-").replace("+", "-").replace("&", "-").replace("/", "-").replace(",", "") }