$(document).ready(function(){ActiveCache(!0);$("head link[rel='stylesheet']").last().after("<link rel='stylesheet' href='/Collect/Nprogress/nproress.css?ver=10009' type='text/css'/>");$.getScript('/Collect/Nprogress/nprogress.js?ver=10009',function(){init_ajax();lazyload();init_timepicker();init_phone();init_animated();init_picker();init_size();loadStatus();loadcookie()})});function lazyload(){if($(".lazy").length>0){try{var lazyLoadInstance=new LazyLoad({elements_selector:".lazy",effect:"fadeIn"})}catch(e){ActiveCache(!0);$.getScript('/Collect/lazy/jquery.lazy.min.js?t=68767869',function(){lazyload()})}}}
function init_size(){$("#contentPage").removeAttr("style");if($(window).height()>$("body").height()){var he=getheight(window)-getheight(".copy-right:visible")-getheight("#headmaster:visible")-getheight(".multimarch:visible");$("#contentPage").height(he)}}
function getheight(el){return $(el).length>0&&(el==window||$(el).css("position")!="absolute")?$(el).height():0}
function init_animated(){if($(".animated").length>0&&$("#link-animate").length==0){$("head link[rel='stylesheet']").last().after("<link id='link-animate' rel='stylesheet' href='/Collect/animate/animate.min.css' type='text/css'/>")}}
function init_picker(){if($(".picker").length>0){$("head link[rel='stylesheet']").last().after("<link rel='stylesheet' href='/Collect/bootstrap/bootstrap-select.css' type='text/css'/>");$.getScript('/Collect/bootstrap/bootstrap-select.js',function(){$(".picker").each(function(index,item){if($(item).hasClass("genselect")==!1)
$(item).addClass("genselect").selectpicker('val',typeof $(item).attr("data")!=='undefined'?$(item).attr("data").split(','):($(item).find("option[selected]").length>0?$(item).find("option[selected]").attr("value"):[]))})})}}
function init_phone_old(){if($(".phone").length>0){$("head link[rel='stylesheet']").last().after("<link rel='stylesheet' href='/Collect/input-phone/build2/css/intlTelInput.css' type='text/css'/>");$.getScript('/Collect/input-phone/build2/js/intlTelInput.js',function(){$.getScript('/Collect/input-phone/build2/js/utils.js',function(){$(".phone").each(function(i,item){var tt=window.intlTelInput($(item)[0],{initialCountry:"auto",autoHideDialCode:$(item).hasClass("autoHideDialCode")?true:!1,separateDialCode:$(item).hasClass("separateDialCode")?true:!1,nationalMode:$(item).hasClass("nationalMode")?true:!1,geoIpLookup:function(success,failure){$.get("https://ipinfo.io",function(){},"jsonp").always(function(resp){var countryCode=(resp&&resp.country)?resp.country:"GB";success(countryCode)})},});$(this).off("input").on("input",function(){if($(this).val().indexOf("+"+tt.getSelectedCountryData().dialCode)<0||$(this).val().replace("+"+tt.getSelectedCountryData().dialCode,'')[0]=='0'){alert2("Please Fill Phone number with Country Code ...","warning");$(this).val("+"+tt.getSelectedCountryData().dialCode)}}).change(function(){if($(this).val().indexOf("+"+tt.getSelectedCountryData().dialCode)<0||$(this).val().replace("+"+tt.getSelectedCountryData().dialCode,'')[0]=='0'){alert2("Please Fill Phone number with Country Code ...","warning");$(this).val("+"+tt.getSelectedCountryData().dialCode)}})})})})}}
function init_timepicker(){if($(".datetimepicker").length>0){$("head link[rel='stylesheet']").last().after("<link rel='stylesheet' href='/Collect/datetimepicker/build/jquery.datetimepicker.min.css' type='text/css'/>");$.getScript('/Collect/datetimepicker/build/jquery.datetimepicker.full.min.js',function(){$(".datetimepicker").each(function(i,item){$(item).datetimepicker({formatTime:'H:i',formatDate:'Y-m-d',timepickerScrollbar:!1})})})}}
function init_ajax(){$(document).on("mousedown","button[value][name]",function(){var fparent=$(this).parents("form");if(fparent!=!1){if(typeof $(this).attr("confirm")!=='undefined')
$(fparent).attr("confirm",$(this).attr("confirm"));if(typeof $(this).attr("target")!=='undefined')
$(fparent).attr("target",$(this).attr("target"));$("#hiddiv").remove();$(fparent).append("<div id='hiddiv'><input type='hidden' name='"+$(this).attr("name")+"' value='"+$(this).val()+"'/></div>")}});$(document).on("submit","form[action]:not([target*='blank']):not([target*='self']):not(.spitify)",ajaxP);$(document).on("click","a[href]:not([href^='#']):not(.controls):not([href*='javascript']):not([target*='_blank']):not([target*='_self'])",ajaxP)}
function ajaxP(event){ActiveCache(!1);var th=$(this);var target=typeof th.attr("target")!=='undefined'&&$("#"+th.attr("target")).length>0?th.attr("target"):"contentPage";var target_is_modal=$("#"+target).parents(".modal-dialog").length>0?$("#"+target).parents(".modal"):!1;var stopform=!1;var isform=!1;if(th.is("form")){isform=!0;th.find("[required]:not([disabled])").each(function(i,item){if($(item).is(":visible")){var t=$(item).attr("type");if((t=="select"&&($(item).val()==null||$(item).val()==''))||((t=="radio"||t=="checkbox")&&!$("[name='"+$(item).attr("name")+"']").is(":checked"))||(t=='text'&&$(item).val()=="")){event.preventDefault();$(item)[0].setCustomValidity("You must select at least one addon for "+$(item).attr("parentname"));alert("You must select at least one addon for "+$(item).attr("parentname"));this.reportValidity();stopform=!0;return!1}}})}
var aj=function(){NProgress.start();if(th.parents(".modal-dialog").length>0)
th.parents(".modal.fade").modal('hide');var _url=th.is("form")?th.attr("action"):th.attr("href");var _method=th.is("form")?th.attr("method"):'GET';var _data=th.is("form")?th.serialize():[];$.ajax({url:_url,timeout:360000,method:_method,error:function(jqXHR,textStatus,errorThrown){alert("Please check your internet connection and try again");NProgress.done();$("#hiddiv").remove()},data:_data,success:function(data){try{$("#hiddiv").remove();var titlepage="";data=JSON.parse(data);if(typeof data.scriptcode!=='undefined'&&data.scriptcode.length>0)
eval(data.scriptcode);if(typeof data.msg!=='undefined'&&data.msg!=null&&data.msg.length>0)
alert2(data.msg,(typeof data.type!=='undefined'&&data.type!=null)?data.type:'info');if(typeof data.html!=='undefined'&&data.title!=null&&data.title.toString().length>0){$("#titlepge,#titlepge1").html(data.title);titlepage=data.title}
if(typeof data.html!=='undefined'&&data.html!=null&&data.html.length>0){if(target_is_modal!==!1)
$(target_is_modal[0]).modal('show');if($("#"+target).length>0){$("#"+target).html(data.html);if(isform==!1)
$("html, body").animate({scrollTop:"0px"},500)}else window.location=_url;init_timepicker();init_phone();init_animated();init_picker();init_size();lazyload();try{window.history.pushState(null,"",_url)}catch(e){}}else if(typeof data.url!=='undefined'&&data.url.length>0)
window.location=data.url}catch(e){alert2('Page can not proccess, please try again later!\r\n'+e.message,"error")}
NProgress.done()}})};if(stopform==!1){if(typeof th.attr("confirm")!=='undefined')
confirm2(th.attr("confirm"),aj,function(){th.removeAttr("confirm")});else aj()}
event.preventDefault()}
function loadStatus(){$.get('/Menu/getStatusMerchant/key-5681ac15',function(data){if(data=="1"){$("#openstatus,.openstatus").text("OPEN");$("#opencolor,.opencolor").attr("class","ribbon");$("#opencolor2,.opencolor2").attr("class","open_color");$("#statuspan,.statuspan").html("<span class='isopen'><b>WE`RE OPEN</b></span>").addClass("opened")}})}
function loadcookie(){if(banner_getCookie('cookiepolicy')!="yes"){$(".cookiemsg").fadeIn()}else $(".cookiemsg").remove()}
function acceptcookie(){banner_setCookie("cookiepolicy","yes",1000000);$(".cookiemsg").fadeOut(function(){$(this).remove()})}
function banner_setCookie(cname,cvalue,exmin){var d=new Date();d.setTime(d.getTime()+(exmin*60*1000));var expires="expires="+d.toUTCString();document.cookie=cname+"="+JSON.stringify(cvalue)+"; "+expires+"; path=/"}
function banner_getCookie(cname){var name=cname+"=";var ca=document.cookie.split(';');for(var i=0;i<ca.length;i++){var c=ca[i];while(c.charAt(0)==' '){c=c.substring(1)}
if(c.indexOf(name)==0){return JSON.parse(c.substring(name.length,c.length))}}
return""}
function ActiveCache(isEnable){$.ajaxSetup({cache:isEnable,timeout:10000})}
$(window).on('load',function(e){$('#preloader').fadeOut("slow")});$(document).ready(function(){menu_init();init_menu_top();checkscroll()});function checkscroll(){if($(window).width()>767){var init_size_first=$('.container_navibars').outerHeight();function chchc(){var scroll=$(window).scrollTop();if(scroll>250){$("#body_header").css("height",init_size_first+"px");$(".container_navibars").addClass('fxedhed')}else{$(".container_navibars").removeClass('fxedhed')}};chchc();$(window).scroll(function(event){chchc()})}}
function menu_init(){var a,b,c;if(a=document.getElementById("site-navigation"),a&&(b=a.getElementsByTagName("button")[0],"undefined"!=typeof b)){if(c=a.getElementsByTagName("ul")[0],"undefined"==typeof c)return void(b.style.display="none");c.setAttribute("aria-expanded","false"),-1===c.className.indexOf("nav-menu")&&(c.className+=" nav-menu"),b.onclick=function(){-1!==a.className.indexOf("toggled")?(a.className=a.className.replace(" toggled",""),b.setAttribute("aria-expanded","false"),c.setAttribute("aria-expanded","false")):(a.className+=" toggled",b.setAttribute("aria-expanded","true"),c.setAttribute("aria-expanded","true"))}}
$(".site-header-cart").find("a").on("focus.pizzaro blur.pizzaro",function(){$(this).parents().toggleClass("focus")}),$(".phm-close").on("click",function(){$(".menu-toggle").trigger("click")}),$(document).on("click",function(b){var c=$(".main-navigation");c.hasClass("toggled")&&(c.is(b.target)||0!==c.has(b.target).length||$(".menu-toggle").trigger("click"))}),$(".handheld-navigation .menu li a[href]").click(function(){$(".menu-toggle").trigger("click")})}
function init_menu_top(){var hidWidth;var scrollBarWidths=40;var maxsize=0;var widthOfList=function(){var itemsWidth=0;$('#menucatshopm li').each(function(){var itemWidth=$(this).outerWidth();maxsize=itemWidth>maxsize?itemWidth:maxsize;itemsWidth+=itemWidth});return itemsWidth};var widthOfBox=function(){return $('#menucatshopm  .wrapper').outerWidth()};var getLeftPosi=function(){return Math.abs($('#menucatshopm .list').position().left)};var getrightPosi=function(){return widthOfList()-widthOfBox()-getLeftPosi()};var widthOfHidden=function(){return widthOfList()-widthOfBox()};var widthOfVisible=function(){return widthOfList()-widthOfHidden()};var calculateWidth=function(){console.log(widthOfList(),widthOfBox());var _widthOfList=widthOfList();var _widthOfBox=widthOfBox();if(_widthOfList<_widthOfBox){var wd=_widthOfBox/$('#menucatshopm li').length;wd=wd>maxsize?wd:maxsize;$('#menucatshopm li').outerWidth(wd+"px")}else{$('#menucatshopm li').removeAttr("style");reAdjust()}};var reAdjust=function(){if(getrightPosi()<=0)
$('#menucatshopm .scroller-right i').addClass('dis_button');else $('#menucatshopm .scroller-right i').removeClass('dis_button');if(getLeftPosi()==0)
$('#menucatshopm .scroller-left i').addClass('dis_button');else $('#menucatshopm .scroller-left i').removeClass('dis_button')}
calculateWidth();reAdjust();$(window).on('resize',function(e){$('#menucatshopm li').removeAttr("style");calculateWidth();reAdjust()});$('#menucatshopm .scroller-right').click(function(){if($(this).find('i').hasClass('dis_button')==!1){var gotonext=widthOfBox()+getLeftPosi();gotonext=gotonext>widthOfList()?widthOfList():gotonext;$('#menucatshopm .list').animate({left:"-"+gotonext+"px"},300,function(){setTimeout(function(){reAdjust()},300)})}});$('.scroller-left').click(function(){if($(this).find('i').hasClass('dis_button')==!1){var gotonext=getLeftPosi()-widthOfBox();gotonext=gotonext<0?0:gotonext;$('#menucatshopm .list').animate({left:"-"+gotonext+"px"},300,function(){setTimeout(function(){reAdjust()},510)})}})}