$(function(){$(".rateviewer.quality .stars").raty({space:!1,readOnly:!0,round:{down:.25,full:.6,up:.76},starType:"i",score:function(){return $(this).attr("data-score")}});$(".rateviewer.value .stars").raty({space:!1,readOnly:!0,round:{down:.25,full:.6,up:.76},starType:"i",score:function(){return $(this).attr("data-score")}});$(".rate.quality .stars").raty({hints:["Poor","Fair","Average","Good","Excellent"],target:"#hint",space:!1,starType:"i",score:4});$(".rate.value .stars").raty({hints:["Poor",
"Fair","Average","Good","Excellent"],target:"#hint",space:!1,starType:"i",score:4});$(".rate .stars i").hover(function(){$(this).prepend($("#hint"))});$(".questions input[name=score]").each(function(){this.name=$(this).parent().attr("id")});var a=document.getElementById("fitrange");noUiSlider.create(a,{range:{min:[-1,1],"50%":[0,1],max:[1,1]},start:0});a.noUiSlider.on("update",function(a,c){})});
$(document).on("click",".checkinstore",function(a){a.preventDefault();a=$(this).data("style");var b=$(this).data("colour");loadpopup("check-instore","/check-instore?i="+a+"&c="+b,{})});
$(document).on("click",".atw",function(a){a.preventDefault();a=$(this).attr("data-productid");var b=$(this).attr("data-customerid");0>=b.length?($(".wishlistmessage").html("Please login to add to your wishlist."),setTimeout("$('.wishlistmessage').html('')",3E3)):0>=a.length?($(".selectsizemessage").html("Please Select a Size"),setTimeout("$('.selectsizemessage').html('')",3E3)):0>=b.length?loadpopup("login","/login?i="+a,{}):$.getJSON("/add-to-wishlist",{i:a,c:b},function(a){!0===a.success&&$(".atw").html("Added to wishlist")})});
$(document).on("click",".writereview",function(){$(".writeaReview").toggleClass("active")});
$(document).on("submit",".writeaReview",function(a){a.preventDefault();var b=$(".prodReviews"),c=$(this);a=c.serializeArray();var d=document.getElementById("fitrange").noUiSlider.get();a.push({name:"fit",value:d});$.ajax({url:"/submit-review-ajax",type:"post",dataType:"json",data:a,success:function(a){c.fadeOut();a.success?(b.find(".alert-error").addClass("hidden").end(),b.find(".alert-success").removeClass("hidden").text(a.message).end(),b.find(".writereview").html("Review Submitted").css("cursor",
"default"),subscribeTimer=setTimeout(function(){$(".alert").addClass("hidden")},3E3)):(b.find(".alert-success").addClass("hidden").end().find(".alert-error").removeClass("hidden").text(a.message),subscribeTimer=setTimeout(function(){$(".alert").addClass("hidden");c.fadeIn()},3E3))},error:function(){}})});$(document).on("click",".readmorereview",function(){$(".reviewItem.overflow").each(function(a,b){$(this).is(":visible")?$(this).hide():$(this).show()})});
$(document).on("click",".toggleWrap h4",function(){$(this).siblings(".togglePanel").toggle();var a=$(this).find("i");console.log($(this));a.hasClass("ion-arrow-down-b")?a.removeClass("ion-arrow-down-b").addClass("ion-arrow-up-b"):a.removeClass("ion-arrow-up-b").addClass("ion-arrow-down-b")});$(document).load(function(){$(".popupContent .loader").remove("slow")});