<\/td><\/tr>';i=$("table.qo-table tbody tr").length;i>0?$("table.qo-table tbody tr:last").after(n):$("table.qo-table tbody").html(n);bindautocomplete()});$("#quickOrderPasteEntry-clearrows").click(function(){var n=$("#txtPaste").val();if(n.length>0){if(confirm("Are you sure you want to clear all this item(s)?"))return $("#txtPaste").val("").focus(),$("div.lopMsgError").html("").removeClass("lopError"),!0}else $("#txtPaste").val("").focus(),$("div.lopMsgError").html("").removeClass("lopError")});$("#quickOrderItemEntry-clearrows2").click(function(){for(var r,t=$("table.qo-table tbody tr"),i=0,n=0;n0;n++)r=$(t[n]).find("td.desc").find("div").find("ul").text(),r!=""&&i++;if(i>0){if(confirm("Are you sure you want to clear all this item(s)?"))return window.location.href="",!0}else window.location.href=""});bindautocomplete();$(window).resize(function(){$(".modal-box").css({top:($(window).height()-$(".modal-box").outerHeight())/2,left:($(window).width()-$(".modal-box").outerWidth())/2})});$("#quickOrderItemEntry-import2").click(function(){$("html").addClass("popup-enable");$("#import-excel").show()});$("#import-excel-close").click(function(){$("#import-excel").hide();$(".upload-overlay").removeClass("active");$("html").removeClass("popup-enable");$("div.upload-error").html("").removeClass("upload-excel-error");document.getElementById("upload-quick-order-file").value="";$("body").removeClass("scroll-hidden")})});$("#btn-addtocart").click(function(){AjaxCart.setLoadWaiting(!0);$("div.lopMsg").html("").removeClass("lopError");var n=!0;return $("table.qo-table tr input.qo-sku").each(function(){var t=$(this).val();$.trim(t).length>0&&(n=!1)}),n?($("div.lopMsg").html("Please add atleast one SKU to add to cart.").addClass("lopError"),AjaxCart.setLoadWaiting(!1),!1):void 0});$("#btn-wishlist").click(function(){var n=!0;return $("table.qo-table tr input.qo-sku").each(function(){var t=$(this).val();$.trim(t).length>0&&(n=!1)}),n?($("div.lopMsg").html("Please add atleast one SKU to add to wishlist.").addClass("lopError"),AjaxCart.setLoadWaiting(!1),!1):void 0});$(document).on("change","input.qo-sku",function(){var i,u;if(AjaxCart.loadWaiting==!1){var n=$(this).parent().next().next(),r=$(this).parent().next(),f=$(this).attr("name"),t=$(this).parent().next().next().next();$(this).val().length<=0?(n.html(""),$(this).parent().next().find("input").val(""),t.html("")):(AjaxCart.setLoadWaiting(!0),i=f,u={idPostFix:i,sku:$(this).val()},$.ajax({cache:!1,url:"/quickorder/searchsku",data:u,type:"get",success:function(u){var e,f;u.errormsg?($(".ui-autocomplete").prop("style","top: 523px; left: 387.5px; width: 208px; display: none;"),f='
<\/ul><\/div>',n.html(f),$("li.li-product-name-"+e).tooltip({content:''}))},complete:AjaxCart.resetLoadWaiting(),error:function(){}}))}});$(document).on("click","input.delete-largeordepadrow-button",function(){var n=$(this).closest("tr"),r=$(this).closest("tr").find("td.desc").find("div").find("ul").text(),u=$(this).closest("tr").find("td.price").find("div").text(),t=$("table.qo-table tbody tr"),i;if(r!=""&&u!=""){if(i="Are you sure you want to remove this product?",confirm(i))return t.length==1?(n.remove(),$("#quickOrderItemEntry-addrows2").trigger("click"),document.getElementById("quickOrderItemEntry-addrows2").disabled=!1,!0):(n.remove(),!0);$(n).eq(0).focus()}else t.length<=1?(document.getElementById("quickOrderItemEntry-addrows2").disabled=!1,n.remove(),$("#quickOrderItemEntry-addrows2").trigger("click")):(t.length<=5&&(document.getElementById("quickOrderItemEntry-addrows2").disabled=!1),n.remove())});$("#btn-addtocart-PasteEntry").click(function(){return});$(document).keydown(function(n){n.keyCode===27&&($(".modal-box").hide(),$(".upload-overlay").removeClass("active"),$("html").removeClass("popup-enable"),$("div.upload-error").html("").removeClass("upload-excel-error"),document.getElementById("upload-quick-order-file").value="",$("body").removeClass("scroll-hidden"),$(".quickOrder-overlay").hide(),$("html").removeClass("popup-enable"))})