function is_Number(n){n=n?n:window.event;var t=n.which?n.which:n.keyCode;return t>31&&(t<48||t>57)?!1:!0}function PlusQuantity(){var n=$("#txtProductQty").val(),t;n>=0?n=Number(n)+1:(t="Specified Quantity Not Allowed",$("#atc_Error").text(t),$("#atc_Error").show());$("#txtProductQty").val(n)}function MinusQuantity(){var n=$("#txtProductQty").val(),t;n>1?n=Number(n)-1:(t="Specified Quantity Not Allowed",$("#atc_Error").text(t),$("#atc_Error").show());$("#txtProductQty").val(n)}function Success_Update_JS(n,t,i,r,u,f,e,o,s,h,c){$("#atc_Error").hide();var l=!0;t=="MINQTY_CONFLICT"?(l=!1,$("#atc_Error").text(r),$("#atc_Error").show()):t=="MAXQTY_CONFLICT"?(l=!1,$("#atc_Error").text(u),$("#atc_Error").show()):t=="MINQTY_REEQUIRED"?(l=!1,$("#atc_Error").text(h),$("#atc_Error").show()):t=="PRICE_NOT_AVAILABLE"?(l=!1,$("#atc_Error").text(f),$("#atc_Error").show()):t=="QUANTITY_NOT_AVAILABLE"?(l=!1,$("#atc_Error").text(s),$("#atc_Error").show()):t=="QUANTITY_GREATER_THAN_0"?(l=!1,$("#atc_Error").text(e),$("#atc_Error").show()):t=="QUANTITY_EXCEED_THAN_MAX_QUANTITY_THRESHOLD_FOR_ADDTOCART"?(l=!1,$("#atc_Error").text(c),$("#atc_Error").show()):t.indexOf("Required")>-1?(l=!1,$("#atc_Error").text(t),$("#atc_Error").show()):t=="SHOPPINGLIST_UPDATED"?(l=!1,window.location.href=o):t=="SUBSCRIPTION_SHOPPINGLIST_UPDATED"&&(l=!1,window.location.href=o);l?Product_Success_Update(n,t,i):HideWaitDiv()}function Add_Authenticated_ShoppingList(n){var t="";$("#atc_Error").hide();$("#txtShoppingListName").is(":visible")?(t=$("#txtShoppingListName").val(),t!=""?($("#atc_Error").hide(),$("#hdnShoppingListName").val(t),$("#btnAddToShoppingList").prop("type","submit")):($("#atc_Error").text(n),$("#atc_Error").show(),$("#btnAddToShoppingList").prop("type","button"))):(t=$("#ddlShoppingList option:selected").text(),t!=""?($("#atc_Error").hide(),$("#hdnShoppingListName").val(t),$("#btnAddToShoppingList").prop("type","submit")):($("#atc_Error").text(n),$("#atc_Error").show(),$("#btnAddToShoppingList").prop("type","button")))}function Product_Set_Selected_Value_InConfigurations(n,t,i,r,u){var o,f,e;showLoadingSpinner();try{if(o=[],f=$("#hdnProductAttributeValueIDs").val().split(","),f=unique(f),f!=null&&f.length>0){for(e=0;e<f.length;e++)$("#rbl_"+f[e]).removeAttr("disabled"),$("#chk_"+f[e]).removeAttr("disabled"),$("#opt_"+f[e]).removeAttr("disabled");$("#divTextBoxControl input:text").removeAttr("disabled");try{$.each($("LI._msddli_"),function(n,t){t.style.visibility="visible"})}catch(s){hideLoadingSpinner()}}}catch(s){hideLoadingSpinner()}$.ajax({type:"POST",url:u,data:{ProductID:i},success:function(n){$.each(n,function(n,i){var f=n,e=i.split("_"),u=e[0],s=e[1],v=e[2],p=e[3],y=e[4],o,h,c,l,a;if(v=="Disabled")if(s=="DropDownList"){o="";try{o=$("#ddlAttributeValueID_"+u+" option:selected").val()}catch(w){}o==null&&(o=$("[id^=ddlAttributeValueID_"+u+"] option:selected").val());o==f&&$("#ddlAttributeValueID_"+u).val(0);$("#opt_"+f).attr("disabled"," disabled");try{h=0;c=$("#opt_"+f).text();$.each($("#ddlAttributeValueID_"+u+"_child ul LI._msddli_"),function(n,t){var i=t.innerHTML;i.indexOf("<img")!=-1?c.indexOf(t.children[1].innerText)!=-1&&(t.style.visibility="hidden",h=n):c.indexOf(t.children[0].innerText)!=-1&&(t.style.visibility="hidden",h=n)});h==0&&t!=u&&r.toLocaleLowerCase()=="false"&&(l=0,$("#ddlAttributeValueID_"+u+" option").each(function(){if(f!=$(this).val())return l=$(this).val(),!1}),a=$("#ddlAttributeValueID_"+u).msDropdown().data("dd"),t!=u&&a.set("selectedIndex",1),setDropdownSelection(y,u,l))}catch(w){}}else s=="RadioButtonList"?($("#rbl_"+f).removeAttr("checked"),$("#rbl_"+f).attr("disabled"," disabled")):s=="CheckBoxList"?($("#chk_"+f).removeAttr("checked"),$("#chk_"+f).attr("disabled"," disabled")):s=="TextBox"&&($("#txtAttributeValue_"+u).val(""),$("#txtAttributeValue_"+u).attr("disabled"," disabled"))});hideLoadingSpinner()},error:function(){hideLoadingSpinner()},complete:function(){hideLoadingSpinner()}})}function Product_Set_Selected_Attribute_Value(n,t,i,r,u,f){showLoadingSpinner();var e,o="";r=="RadioButtonList"?e="UnDefined":r=="ImageRadioButtonList"?e="UnDefined":r=="CheckBoxList"?e=$("#chk_"+i).is(":checked")?"Checked":"UnChecked":r=="DropDownList"?(i=$("#ddlAttributeValueID_"+t).val(),e="UnDefined"):r=="TextBox"?(i=i,e="UnDefined",o=$("#txtAttributeValue_"+t).val()):r=="FileUpload"&&(o=i,e=i,i=0);$.ajax({type:"POST",url:f,data:{ProductID:u,ProductConfigurationGroupID:n,ProductAttributeID:t,ProductAttributeValueID:i,ControlStatus:e,ControlValue:o},success:function(i){i.indexOf("window.location =")==0||($("#divConfiguredProductPrice").html(i),SetSelectedValueInConfigurations(n,t))},error:function(){hideLoadingSpinner()},complete:function(){hideLoadingSpinner()}})}function Product_Set_DropdownSelection(n,t,i,r,u){var f,e;n>0&&$.ajax({type:"POST",url:u,data:{ProductID:r,ProductConfigurationGroupID:n,ProductAttributeID:t,ProductAttributeValueID:i,ControlStatus:f,ControlValue:e},success:function(n){$("#divConfiguredProductPrice").html(n)},error:function(){hideLoadingSpinner()},complete:function(){hideLoadingSpinner()}})}function Product_ChangeVideo1(n,t,i){$(".pro-mainimg").hide();$(".pro-video").hide();$(".pro-video div").html("");var r="<video id='plyvideo' style='height:500px;width:100%;' controls><source src='"+i+"'  /><\/video>";$("#divProductVideo").html("");$("#divProductVideo").html(r);$("#divProductVideo").show()}function ConfigurableRadioImageClick(n){$("#rbl_"+n).click();$(".image-radio-box").removeClass("active");$("#divProductAttributeValue_"+n).addClass("active")}function unique(n){var t=[];return $.each(n,function(n,i){$.inArray(i,t)==-1&&t.push(i)}),t}function Get_FaqForm(n,t,i,r){$.get(n,{Plugin:"Comrogen.Plugins.FrequentlyAskedQuestions",entityType:"Product",entityId:t,PluginId:i,d_l:r},function(n){n==null||n==""?$("#divAddUpdateQuestion").hide():$("#divAddUpdateQuestion").html(n)})}function GetFaqList(n,t,i,r,u){$.get(n,{Plugin:"Comrogen.Plugins.FrequentlyAskedQuestions",EntityType:t,EntityId:i,PluginId:r,d_l:u},function(n){n==null||n==""?$("#divFaqList").hide():$("#divFaqList").html(n)})}function GetRelatedProductPlugin(n,t,i,r,u){$.get(n,{Plugin:"Comrogen.Plugins.CollectionsPlugin",id:t,Keyword:i,EntityType:r,d_l:u},function(n){var t=n;t=t.trim();t==null||t==""?($("#divRelatedProductTab").hide(),$("#divRelatedProductMain").hide(),$("#anchorRelatedProduct").hide()):($("#divRelatedProductTab").show(),$("#divRelatedProductMain").show(),$("#anchorRelatedProduct").show(),$("#relatedproducts").html(t))})}function GetUpsaleProductPlugin(n,t,i,r,u){$.get(n,{Plugin:"Comrogen.Plugins.CollectionsPlugin",id:i,Keyword:t,EntityType:r,d_l:u},function(n){var t=n;t=t.trim();t==null||t==""?$("#tabUpsaleProducts").hide():$("#upsaleproducts").html(t)})}function SuccessUpdate_GetFilteredProduct(n){$("#divProductInfo").html("");$("#divProductInfo").html(n)}function onBegin(){ShowWaitDiv();$("#resultDiv").html("").show()}function Product_Success_Update(n,t,i){var r=n;$("#resultDiv").hide();$.ajax({type:"POST",url:r,dataType:"html",success:function(n){$("#divcartdetails").html("");t!="Item Added to the cart"?$("#resultDiv").html(t):($("#resultDiv").html(""),$("#resultDiv").hide());$("#divcartdetails").html(n);$.ajax({type:"POST",url:i,success:function(n){try{$("#divMiniCart1").html(n)}catch(t){}}})},complete:function(){HideWaitDiv();try{OpenMiniCartPopup()}catch(n){}}})}function ShowWaitDiv(){showLoadingSpinner()}function HideWaitDiv(){hideLoadingSpinner()}function RelatedProductsCarousel(){var n=$(".related-products .owl-carousel");n.owlCarousel({nav:!0,loop:!1,rewindNav:!1,navigation:!0,navigationText:["<div class='addb-arrow ad-arr-l mov-left pull-left'><a data-slide='prev'><\/a><\/div>","<div class='addb-arrow ad-arr-r mov-right pull-right'><a data-slide='next' id=''><\/a><\/div>"],items:5,itemsDesktop:[1250,4],itemsDesktopSmall:[991,2],itemsTablet:[600,1],itemsMobile:!1})}function productThumbsCarousel(){var n=$(".productThumbs .owl-carousel");n.owlCarousel({nav:!0,loop:!1,rewindNav:!1,navigation:!0,navigationText:["<div class='arrow-l SEEArrows mov-left pull-left'><a data-slide='prev'><\/a><\/div>","<div class='arrow-r SEEArrows mov-right pull-right'><a data-slide='next' id=''><\/a><\/div>"],items:4,itemsDesktop:[1300,4],itemsDeskto1Small:[1100,3],itemsTablet:[600,2],itemsMobile:!1})}function ChangeImage(n,t,i){ShowWaitDiv();$(".pro-mainimg").show();$(".pro-video").hide();$(".pro-video div").html("");$.ajax({type:"POST",url:i,data:{ProductID:n,MediaGroupingID:t},success:function(n){$("#imgProductMainImage").attr("src",n.MediaPath);$("#hypJQZoomLargePic").removeClass("MagicZoomPlus");$("#hypJQZoomLargePic").attr("href",n.ZoomMediaPath);$("#hypJQZoomLargePic").addClass("MagicZoomPlus");MagicZoomPlus.refresh();HideWaitDiv()}})}function CustomerReview(n,t,i){$.get(n,{Plugin:"Comrogen.Plugins.Reviews",id:t,d_l:i},function(n){n==null||n==""?$("#tabReviews").hide():$("#divProductReviews").html(n)})}function CustomerReviewWithCount(n,t,i){$.get(n,{Plugin:"Comrogen.Plugins.Reviews",ProductID:t,d_l:i},function(n){n==null||n==""||$("#divRatingWithCount").html(n)})}function ChangeVideo(n,t){t=t.replace("http:","");t=t.replace("https:","");$(".pro-mainimg").hide();$("#divProductVideo").hide();$("#divProductVideo").html("");$("#divVideo"+n).html("<iframe src='"+t+"' width='500' height='500' webkitallowfullscreen='' mozallowfullscreen='' allowfullscreen=''><\/iframe>");$(".pro-video").show();$("#divProductVideo").hide()}function ChangeVideoWithoutEmbed(n,t){t=t.replace("http:","");t=t.replace("https:","");$(".pro-mainimg").hide();$("#divProductVideo").hide();$("#divProductVideo").html("");$("#divVideo"+n).html("<iframe src='"+t+"?rel=0' webkitallowfullscreen='' mozallowfullscreen='' allowfullscreen=''><\/iframe>");$(".pro-video").show();$("#divProductVideo").hide()}function AddNewShoppingList(){var n=$("#ddlShoppingList option:selected").text(),t=$("#ddlShoppingList option:selected").val();t==0&&n=="Add New Shopping List"?$("#txtShoppingListName").show():($("#txtShoppingListName").val(""),$("#txtShoppingListName").hide(),$("#ddlShoppingList").show())}function ValidateShoppingListForAuthenticatedUser(){var n="";$("#atc_Error").hide();$("#txtShoppingListName").is(":visible")?(n=$("#txtShoppingListName").val(),n!=""?($("#atc_Error").hide(),$("#hdnShoppingListName").val(n),$("#btnAddToShoppingListSubmit").prop("type","submit")):(msg="Please Provide Shopping List Name",$("#atc_Error").text(msg),$("#atc_Error").show(),$("#atc_Error").fadeOut(3e3),$("#btnAddToShoppingListSubmit").prop("type","button"))):(n=$("#ddlShoppingList option:selected").text(),n!=""?($("#atc_Error").hide(),$("#hdnShoppingListName").val(n),$("#btnAddToShoppingListSubmit").prop("type","submit")):(msg="Please Provide Shopping List Name",$("#atc_Error").text(msg),$("#atc_Error").show(),$("#btnAddToShoppingListSubmit").prop("type","button")))}function JS_AppendValueID(n){var t=$("#hdnProductAttributeValueIDs").val();t.length>0&&(t=t+",");t=t+n;$("#hdnProductAttributeValueIDs").val(t)}function JS_AddProductForAuthenticatedUse(n){$("#btnAddToShoppingListSubmit").show();n==1?$("#txtShoppingListName").show():$("#ddlShoppingList").show()}function JS_DocumentReady_Product(n,t,i,r,u,f,e,o,s,h,c,l,a,v,y,p,w,b,k,d,g,nt,tt,it,rt,ut,ft){var ht,et,ct,ot,st;try{productThumbsCarousel()}catch(lt){}try{$("img.lazy1").lazyload({})}catch(lt){}MagicZoomPlus.refresh();i.toLowerCase()=="true"&&SetSelectedValueInConfigurations(r,0);try{u>0&&ut.toLowerCase()=="true"&&ft.toLowerCase()=="true"&&(et=f,ht="Related Products",GetRelatedProductPlugin(et,n,ht,t,w))}catch(lt){}try{e>0?o.toLowerCase()=="true"?s.toLowerCase()=="true"?(et=h,CustomerReview(et,n,w),ct=c,CustomerReviewWithCount(ct,n,w)):($("#review").hide(),$("#tabReviews").hide()):($("#review").hide(),$("#tabReviews").hide()):($("#review").hide(),$("#tabReviews").hide())}catch(lt){}try{l>0?nt.toLowerCase()=="true"?tt.toLowerCase()=="true"?(ot=v,st=l,Get_FaqForm(ot,n,st,w),ot=y,GetFaqList(ot,a,n,st,w)):($("#tabFaq").hide(),$("#faq").hide()):($("#tabFaq").hide(),$("#faq").hide()):($("#tabFaq").hide(),$("#faq").hide())}catch(lt){}if(it>0)try{if(rt.toLowerCase()=="true"){var et=p;$.get(et,{Plugin:"Comrogen.Plugins.RecentlyViewedProduct",FormatType:"Medium",ProductNameLength:37,ExceptEntityID:n},function(n){$("#divRecentlyViewedProduct").html(n)})}}catch(lt){}RenderQuantityDiscountTable_Product(n,b,k,d,g)}function RenderQuantityDiscountTable_Product(n,t,i,r,u){$("#divQuantityDiscountTableList").html("");var f=t;$.ajax({type:"POST",url:f,data:{DisplayProviderName:"Product",nProductID:n,dPrice:i,dSalePrice:r,dCL_Price:u},success:function(n){$("#divQuantityDiscountTableList").html(n)}})}function Product_goToByScroll(n){$("html,body").animate({scrollTop:$("#"+n).offset().top},"slow")}