$(function(){enquire.register("screen and (min-width: 1101px)",{match:function(){$("body").addClass("desktop")},unmatch:function(){$("body").removeClass("desktop")}}).register("screen and (min-width: 751px) and (max-width: 1100px)",{match:function(){$("body").addClass("tablet")},unmatch:function(){$("body").removeClass("tablet")}}).register("screen and (max-width: 751px)",{match:function(){$("body").addClass("mobile")},unmatch:function(){$("body").removeClass("mobile")}})});
$(".inputWrap").each(function(b){b++;$(this).find("span").text(b++ +". ")});var adultid;$(".inputCheckbox").change(function(){ls_val=$(this).val();li_id=$(this).attr("id");this.checked&&("Adults only"==$("label[for="+li_id+"]").text()?(adultid=li_id,$("input:checkbox").removeAttr("checked"),$("#"+li_id).prop("checked",!0)):$("#"+adultid).prop("checked",!1))});var lo_answer={};
$(document).on("click",".submitBtn",function(){$(".p-inError").addClass("j-hidden");lo_questions={};lb_error=!1;$(".paQuestion").each(function(){ls_val=$(this).val();li_questionid=$(this).data("question");ls_type=$(this).data("type");ls_option=$(this).data("option");void 0==ls_val||""==ls_val?($(".e-error"+li_questionid).removeClass("j-hidden"),$(".e-error"+li_questionid).html("Please select your answer from the list"),lb_error=!0):"multi-dropdown"==ls_type?(lo_value={},lo_value[ls_option]=ls_val,
li_questionid in lo_questions?lo_questions[li_questionid].push(lo_value):lo_questions[li_questionid]=[lo_value]):lo_questions[li_questionid]=ls_val});var b=$("input[name=checkbox-question]"),a=0,c=!1;$(b).each(function(){ls_val=$(this).val();lb_checked=$(this).is(":checked");a=ls_questionid=$(this).data("question");lb_checked&&(ls_questionid in lo_questions?lo_questions[ls_questionid].push(ls_val):lo_questions[ls_questionid]=[ls_val],c=!0)});if(!c&&0<a)return $(".e-error"+a).removeClass("j-hidden"),
$(".e-error"+a).html("Please select your answer from the options"),lb_error=!0,!1;if(lb_error)return!1;lo_answer=lo_questions;$.get("/show-answer",lo_questions,function(a){$(".quiz").addClass("j-hidden");$(".thanks").html(a)})});$(document).on("click",".emailResult",function(){$(".emailContainer").removeClass("j-hidden")});
$(document).on("click",".sendlResult",function(b){b.preventDefault();ls_email=$("#email").val();$(".p-success").addClass("j-hidden");$(".p-error").addClass("j-hidden");$.get("/send-result",{c:lo_answer,e:ls_email},function(a){a.error?($(".p-error").removeClass("j-hidden"),$(".o-error").text(a.error)):($(".p-success").removeClass("j-hidden"),$(".p-success").text("Result successfully sent!"))})});