var isSubmitting=!0,appID=$('#app_id').val();var URL=document.location.origin,CurrentURL=window.location.href,language=$('html').attr("lang"),$l;getUrl(URL+'/Lang/lang.php?Lang='+language+'&mode=json&t='+$.now(),function(data){$l=JSON.parse(data.responseText)});$(function(){toastr.options={"closeButton":!1,"debug":!1,"newestOnTop":!1,"progressBar":!1,"positionClass":"toast-bottom-center","preventDuplicates":!0,"onclick":null,"showDuration":"300","hideDuration":"1000","timeOut":"5000","extendedTimeOut":"1000","showEasing":"swing","hideEasing":"linear","showMethod":"fadeIn","hideMethod":"fadeOut"}});var myLazyLoad=new LazyLoad({elements_selector:".lazy"});$(window).on("load",function(){$('.img_background').hide();var app_id=$('#app_id').val();var app_name=$('#app_name').text();if($('#form_company').length!==0){$('.home_button').hide();var ThisHideForm=$('#form_company');ajaxCall(ThisHideForm,function(data){if(data.result=='success'){var list=data.list,package=data.content['package'],pck_category=package['WithCategory'],pck_voucher=package['Voucher'],comment=data.content.comment,with_category=(pck_category=='yes'?!0:!1),with_voucher=(pck_voucher=='yes'?!0:!1),item_list=data.content.item,member_comment=data.content.memberComment,service='',all_item='';get_addreview_blur=$(".addreview_blur").val();if(get_addreview_blur!=1)
{if(member_comment!=''){$.each(member_comment,function(k,v){if(v.Comment=='success-comment')
{$(".member_comment_blur").css("display","none");$(".member_blur").css({"padding":"0","-webkit-filter":"blur(0)","filter":"blur(0)"})}
else{$(".member_comment_blur").css("display","block");$(".member_blur").css({"padding":"20px","-webkit-filter":"blur(4px)","filter":"blur(4px)"})}})}}
else{$(".member_comment_blur").css("display","none")}
if(app_name!=''){if(list.Halo_slide!=''){var Halo_slide='';Halo_slide+='<div class="slide_box hidden">';Halo_slide+='<ul class="bxslider">';$.each(list.Halo_slide,function(k_1,v_1){Halo_slide+='<li><img data-src="/cms/'+v_1.SlideShowImage+'" data-src-retina="/cms/'+v_1.SlideShowImage+'" src="/cms/'+v_1.SlideShowImage+'" class="lazy_load_img" ></li>'});Halo_slide+='</ul>';Halo_slide+='</div>';$("#Halo_slide").html(Halo_slide).hide().fadeIn(300);$('.bxslider').bxSlider({onSliderLoad:function(){$(".slide_box").removeClass("hidden").addClass("shown")}})}
if(list.Type!=''){$.each(list.Type,function(k,v){service+='<li>'+v+'</li>'})}
var allCats='';if(item_list.result!=''){$.each(item_list.list,function(k,v){var receiver='&category_id='+v.CategoryID,page='product',description='';if(with_category!=!0){receiver='&category_id=0&product_id='+v.ProductID;page='product-detail';description='<div class="item_description">'+v.Description+'</div>'}
var url=encodeURI('?id='+appID+'&page='+page+'&category='+pck_category+receiver+'&page_title='+languageConvert(language,v.Name));if(v.SubCategoryID=='0'){allCats+='<div><a class="et-hero-tab" href="#'+encodeURI(v.Name)+'">'+v.Name+'</a></div>';all_item+='<li> <a href="'+url+'" target="_self"> <div class="item_frame"> <img src="'+v.Image+'"/> </div> <div class="item_flexbox"> <div class="item_title">'+v.Name+'</div> '+description+' </div> </a> </li>'}else if(with_category!=!0){var catid=($('#category_id').val()>=0?$('#category_id').val():'no');var url=encodeURI('?id='+appID+'&page=product-detail&category_id='+catid+'&product_id='+v.ProductID+'&page_title='+languageConvert(language,v.Name));all_item+='<li> <a href="'+url+'" target=""> <div class="item_frame"> <img data-src="'+v.Image+'" data-src-retina="'+v.Image+'" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="lazy_load_img" /> </div> <div class="item_flexbox"> <div class="item_title">'+languageConvert(language,v.Name)+'</div> <div class="item_price">RM'+v.Price+'</div> <div class="item_description">'+v.Description+'</div> </div> </a> </li>'}})}
if(list.Background!=''){$(".img_background").attr('src',list.Background)}else{$(".img_background").remove()};$('.img_background').show();$(".img_logo").attr('src',list.Logo);$(".m_title").html(list.Company).hide().fadeIn(300);$(".company_service").html(list.Service).hide().fadeIn(300);$(".company_services").html(service).hide().fadeIn(300);$(".news_description").html(htmlEntityDecode(list.Description)).hide().fadeIn(300);$(".stores_name").text(languageConvert(language,list.Title));var google_store=list.GoogleStore,apple_store=list.AppleStore;if(google_store==''){$("#google_store").addClass('image_grey')}else{$("#google_store").attr('href',google_store).attr('target','_blank')}
if(apple_store==''){$("#apple_store").addClass('image_grey')}else{$("#apple_store").attr('href',apple_store).attr('target','_blank')}
var information='',latitude=list.Latitude,longtitude=list.Longtitude,coordinates=(with_category?('https://www.google.com/maps/?q='+latitude+','+longtitude):'#'),mobile=list.Mobile,email=list.Email,website=list.Website,social=list.Social,voucher=list.Voucher,store_front=list.StoreFront;information+='<li class="information_address '+(with_category?'information_arrow':'')+'"> <a href="'+coordinates+'" target="_blank"> <img src="Images/marker.png" class="information_icon" /> <span class="information_title">'+list.Address+', '+list.Area+', '+list.PostCode+', '+list.State+' </span> </a> </li>';if(latitude!=''&&longtitude!=''){information+='<li class="information_coordinate '+(with_category?'information_arrow':'')+'"> <a href="'+coordinates+'" target="_blank"> <img src="Images/coordinates.png" class="information_icon" /> <span class="information_title"> '+latitude+', '+longtitude+' </span> </a> </li>'}
if(mobile!=''){information+='<li class="information_mobile information_arrow"> <a href="tel:'+mobile+'"> <img src="Images/mobile.png" class="information_icon" /> <span class="information_title"> '+mobile+' </span> </a> </li>'}
if(email!=''){information+='<li class="information_email information_arrow"> <a href="mailto:'+email+'"> <img src="Images/email.png" class="information_icon" /> <span class="information_title"> '+email+' </span> </a> </li>'}
if(website!=''){information+='<li class="information_website information_arrow"> <a href="https://'+website+'" target="_blank"> <img src="Images/website.png" class="information_icon" /> <span class="information_title"> '+website+' </span> </a> </li>'}
if(store_front!=''){information+='<li class="information_image"> <img src="'+store_front+'" /> </li>'}
$(".information_content").html(information).hide().fadeIn(300);if(list.WithBranch=='yes'){var branch_info='';$.each(list.Branch,function(k,v){address=v.Address,latitude=v.Latitude,longtitude=v.Longtitude,coordinates=(with_category?('https://www.google.com/maps/?q='+latitude+','+longtitude):'#'),mobile=v.Mobile,email=v.Email;store_front=v.StoreFront;branch_info+='<div class="section_box information_box">';branch_info+='<h3 class="box_title"><img src="Images/box_right.png"><span class="box_span_title">Information</span><img src="Images/box_left.png"></h3>';branch_info+='<div class="box_content">';branch_info+='<ul class="information_content">';if(address!=''){branch_info+='<li class="information_address '+(with_category?'information_arrow':'')+'"> <a href="'+coordinates+'" target="_blank"> <img src="Images/marker.png" class="information_icon" /> <span class="information_title">'+address+' </span> </a> </li>'}
if(latitude!=''&&longtitude!=''){branch_info+='<li class="information_coordinate '+(with_category?'information_arrow':'')+'"> <a href="'+coordinates+'" target="_blank"> <img src="Images/coordinates.png" class="information_icon" /> <span class="information_title"> '+latitude+', '+longtitude+' </span> </a> </li>'}
if(mobile!=''){branch_info+='<li class="information_mobile information_arrow"> <a href="tel:'+mobile+'"> <img src="Images/mobile.png" class="information_icon" /> <span class="information_title"> '+mobile+' </span> </a> </li>'}
if(email!=''){branch_info+='<li class="information_email information_arrow"> <a href="mailto:'+email+'"> <img src="Images/email.png" class="information_icon" /> <span class="information_title"> '+email+' </span> </a> </li>'}
if(store_front!=''){branch_info+='<li class="information_image"> <img src="'+store_front+'" /> </li>'}
branch_info+='</ul>';branch_info+='</div>';branch_info+='</div>'});$(".animate_information_box").append(branch_info)}
var schedule=list.Schedule,time=list.ScheduleTime,hours_content='';switch(schedule){case 'always':hours_content+='<li class="hours_content_always">'+$l.ao1+'</li>';break;case 'closed':hours_content+='<li class="hours_content_closed">'+$l.pc1+'</li>';break;case 'selected':hours_content+='<li>'+$l.m7+' : '+resetHoursContent(time[1].Status,time[1].Time)+'</li>';hours_content+='<li>'+$l.t1+' : '+resetHoursContent(time[2].Status,time[2].Time)+'</li>';hours_content+='<li>'+$l.w3+' : '+resetHoursContent(time[3].Status,time[3].Time)+'</li>';hours_content+='<li>'+$l.t5+' : '+resetHoursContent(time[4].Status,time[4].Time)+'</li>';hours_content+='<li>'+$l.f5+' : '+resetHoursContent(time[5].Status,time[5].Time)+'</li>';hours_content+='<li>'+$l.s10+' : '+resetHoursContent(time[6].Status,time[6].Time)+'</li>';hours_content+='<li>'+$l.s11+' : '+resetHoursContent(time[7].Status,time[7].Time)+'</li>';break}
$('.hours_content').html(hours_content).hide().fadeIn(300);$('.phone_content').html('<li>'+list.Mobile+'</li>').hide().fadeIn(300);var whatsapp=social.whatsapp,wechat=social.wechat;line=social.line;facebook=social.facebook;telegram=social.telegram;if(whatsapp==''){$(".social_whatsapp").addClass('image_grey')}else{$(".social_whatsapp").attr('href','https://wasap.my/'+whatsapp).attr('target','_blank')}
if(wechat==''){$(".social_wechat").addClass('image_grey')}
if(line==''){$(".social_line").addClass('image_grey')}
if(facebook==''){$(".social_facebook").addClass('image_grey')}else{$(".social_facebook").attr('href',facebook).attr('target','_blank')}
if(telegram==''){$(".social_telegram").addClass('image_grey')}
if(with_voucher){var all_voucher='';$.each(voucher,function(k,v){all_voucher+='<li>'+v+'%</li>'});$(".voucher_box").html(all_voucher).hide().fadeIn(300);$(".tnc_content").html(htmlEntityDecode(list.Tnc)).hide().fadeIn(300)}else{$(".animate_voucher_box, .animate_tnc_box").hide()}
$(".lazy_load_img").unveil(300);var HTMLcomment='';this.node=$('<ul/>');if(comment.result=='success'){if(comment.list){$.each(comment.list,function(x,y){HTMLcomment+=commentHTML(y)})}}else{HTMLcomment+='<div>No comment.</div>'}
$('.customer_comment').html(this.node.append(HTMLcomment)).hide().fadeIn(300)}else{window.location.href=encodeURI('?id='+app_id+'&name='+list.Company.split(' ').join('-'))}}else{}})}
if($('#form_product').length!==0){var ThisHideForm=$('#form_product');$('.main_container').hide();ajaxCall(ThisHideForm,function(data){var list=data.list,company=data.content,all_item='';if(data.result=='success'){if(list!=''){$.each(list,function(k,v){if(v.SubCategoryID!=v.CategoryID)
{var url=encodeURI('?id='+appID+'&page=product&category_id='+v.CategoryID+'&product_id='+v.ProductID+'&page_title='+languageConvert(language,v.Name));all_item+='<li> <a href="'+url+'" target=""> <div class="item_frame"> <img data-src="'+v.Image+'" data-src-retina="'+v.Image+'" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="lazy_load_img" /> </div> <div class="item_flexbox"> <div class="item_title">'+languageConvert(language,v.Name)+'</div>  </div> </a> </li>'}
else{var url=encodeURI('?id='+appID+'&page=product-detail&category_id='+$('#category_id').val()+'&product_id='+v.ProductID+'&page_title='+languageConvert(language,v.Name));all_item+='<li> <a href="'+url+'" target=""> <div class="item_frame"> <img data-src="'+v.Image+'" data-src-retina="'+v.Image+'" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="lazy_load_img" /> </div> <div class="item_flexbox"> <div class="item_title">'+languageConvert(language,v.Name)+'</div> <div class="item_price">RM'+v.Price+'</div> <div class="item_description">'+v.Description+'</div> </div> </a> </li>'}})}}else{alert('Sorry, no data found!')}
$(".header_title").text(company.Title);$('.product_container').show();$('.item_box').html(all_item).hide().fadeIn(300);$(".page_loader").fadeOut("slow");$(".lazy_load_img").unveil(300)})}
if($('#form_product_detail').length!==0){$('.main_container').hide();productDetail()}
if($('#form_product_detail_nearby').length!==0){$('.main_container').hide();productDetailNearby()}
if($('#form_cart').length!==0){var This=$('#form_cart'),cartremove='';cartremove=checkCart(This,'yes')}
if($('#form_cart_confirm').length!==0){var This=$('#form_cart_confirm');cartremove=checkCart(This,'no')}});function checkCart(This,editable){var ThisParentHidden=This.parents('body').find('div:hidden'),cartlist=ThisParentHidden.find('#form_cartListCheck'),cartremove='',inputCartRem=This.find("[name^='cartremove']");ajaxCall(cartlist,function(output){if(output.list.locat=='remove'){alert($l.yclid);inputCartRem.remove();cartremove=cartRemoveList(output.list.locat_remove)}else if(output.list.sele_time=='remove'){alert($l.ycstd);inputCartRem.remove();cartremove=cartRemoveList(output.list.selec_remove)}else if(output.list.checkItem=='remove'){alert($l.ssoyiit);inputCartRem.remove();cartremove=cartRemoveList(output.list.check_remove)}else if(output.list.cus=='remove'){alert($l.ycpdm);inputCartRem.remove();cartremove=cartRemoveList(output.list.cus_remove)}else if(output.list.prep=='remove'){alert($l.ycpptiao);inputCartRem.remove();cartremove=cartRemoveList(output.list.prep_remove)}
cartListing(This,cartremove,editable)})}
function commentHTML(y){var HTMLcomment=['<li>','<div class="customer_details">','<ul>',ratingCommentInput('Satisfaction','satisfaction',y.comment_rank_satisfaction,y.comment_id),'<div class="username_col">','<div class="username"><span class="comment_name" id="">'+y.comment_name+', </span><span class="comment_date">'+y.comment_date+'</span></div>','<div class="review_content"><span class="comment_content">'+y.comment_content+'</span></div>','</div>','<div class="clearfix"></div>','</ul>','</div>','<div class="clearfix"></div>','</li>'].join('');return HTMLcomment}
function cartListHTML(output,editable='yes'){var html='',Tempqty={};var nrCss=(editable=='yes'?'':'noremovecss');var merchantID='';html+='<div class="box_shadow" >';html+='<div class="shopping-cart">';if(output.list.item!=''){$.each(output.list.item,function(x,y){var merchantName=(checkValue(output.list.cartMerchant.CartMerchant[x].Name)?output.list.cartMerchant.CartMerchant[x].Name:'');merchantID=output.list.cartMerchant.CartMerchant[x].CustomerID;var merchantURL=URL+'/product?id='+merchantID+'&name='+encodeURIComponent(merchantName)+'',driverName=(output.list.cartMerchant.CartMerchant[x].DriverID>0?output.list.cartMerchant.CartMerchant[x].DriverName:output.list.CartArea.PicName),driverPrice=output.list.cartMerchant.CartMerchant[x].DeliveryFee,mSubtotal=(output.list.cartMerchant.CartMerchant[x].SubTotal>0?output.list.cartMerchant.CartMerchant[x].SubTotal:0.00),mGranTotal=(output.list.cartMerchant.CartMerchant[x].GrandTotal>0?output.list.cartMerchant.CartMerchant[x].GrandTotal:0.00),mGst=(output.list.cartMerchant.CartMerchant[x].Gst>0?output.list.cartMerchant.CartMerchant[x].Gst:0.00),mGstCharge=(output.list.cartMerchant.CartMerchant[x].GstCharge>0?output.list.cartMerchant.CartMerchant[x].GstCharge:'0.00');mCharge=(output.list.cartMerchant.CartMerchant[x].MSerAmount>=0?output.list.cartMerchant.CartMerchant[x].MSerAmount:'0.00');mDriverType=(checkValue(output.list.cartMerchant.CartMerchant[x].DriverType)?output.list.cartMerchant.CartMerchant[x].DriverType:'');html+=['<div class="merchant cart_hover">','<a href="'+merchantURL+'">'+merchantName+' </a> - Delivery by, '+driverName,'</div>','<div class="column-labels">','<label class="product-image '+nrCss+'">Image</label>','<label class="product-details '+nrCss+'">Product</label>','<label class="product-price '+nrCss+'">Price</label>','<label class="product-quantity '+nrCss+'">Quantity</label>'].join('');if(editable=='yes'){html+='<label class="product-removal">Remove</label>'}
html+=['<label class="product-line-addon '+nrCss+'">Addon</label>','<label class="product-line-price '+nrCss+'">Total</label>','</div>'].join('');if(y!=''){$.each(y,function(x_x,y_y){var Addon=Option=DateTime=Qty='';if(editable=='yes'){Qty+='<div class="product_quantity cart_table_qty">';Qty+='<div class="sp-quantity clearfix">';Qty+='<span class="sp_minus sp_left"><a class="minus" href="#" data-multi="-1">-</a></span>';Qty+='<span class="sp_qty" id="input" contenteditable="true" onKeypress="if((event.keyCode < 48 || event.keyCode > 57) || event.keyCode === 13){return false;}" >'+y_y.Quantity+'</span>';Qty+='<span class="sp_plus sp_right"><a class="plus" href="#" data-multi="1">+</a></span>';if(output.list.MinQuantity!=''&&output.list.MinQuantity!=null){if(output.list.MinQuantity[y_y.ProductID]!=''&&output.list.MinQuantity[y_y.ProductID]!=null){Qty+='<input type="hidden" name="MinQuantity_'+y_y.CartID+'" value="'+output.list.MinQuantity[y_y.ProductID]+'">'}}
Qty+='</div>';Qty+='</div>'}else{Qty+=y_y.Quantity}
if(y_y.Variant!=''&&y_y.Variant!=null){Option+='<div class="box_option"><span class="cartItemTitle">'+$l.o4+'</span><div class="attr_option">';$.each(y_y.Variant,function(a_1,o_1){if(o_1!=''){$.each(o_1,function(a_2,o_2){Option+='<span><b>'+a_2+'</b>: '+o_2+'</span><br>'})}});Option+='</div></div>'}
if(y_y.AddonList!=''&&y_y.AddonList!=null){Addon+='<div class="box_addon"><span class="cartItemTitle" style="margin-top: 19px;">'+$l.a10+'</span><div class="addon_list">';$.each(y_y.AddonList,function(a_1,o_1){var sumAddon="",AddonPrice=o_1.AddonPrice,AddonQty=o_1.AddonQty;if(checkNum(AddonPrice)&&checkNum(AddonQty)){AddonPrice=parseFloat(AddonPrice);AddonQty=parseFloat(AddonQty);AddonPrice.toFixed(2);AddonQty.toFixed(2);sumAddon=(AddonQty*AddonPrice).toFixed(2)}
Addon+='<span><b>'+o_1.AddonName+'</b> - RM'+o_1.AddonPrice+' x '+o_1.AddonQty+' = RM'+sumAddon+'</span><br>'});Addon+='</div></div>'}
var Cat='';if(y_y.CategoryID==0){Cat='no'}else{Cat=y_y.CategoryID}
var ProUrl=URL+'/product?id='+y_y.CustomerID+'&page=product-detail&category_id='+Cat+'&product_id='+y_y.ProductID+'';var REMARK='';if(y_y.Remark!=''){REMARK+=['<div class="box_remark tr_remark">','<span class="cartItemTitle">'+$l.r4+' : </span>','<input type="hidden" name="cart_item" value="'+y_y.CartID+'"/>','<textarea class="hidden_remark" style="display: none;"  name="hidden_remark['+y_y.MemberID+']['+y_y.CartID+']" '+(editable=='yes'?'':'readonly')+' >'+y_y.Remark+'</textarea>','<textarea class="required_input crtextarea '+(editable=='yes'?'cart_remark_textarea':'')+'" name="remark['+y_y.MemberID+']['+y_y.CartID+']" '+(editable=='yes'?'':'readonly')+' >'+y_y.Remark+'</textarea>'].join('');REMARK+=['</div>'].join('')}else{if(editable=='yes'){REMARK+=['<div class="box_remark tr_remark">','<span class="cartItemTitle">'+$l.r4+' : </span>','<input type="hidden" name="cart_item" value="'+y_y.CartID+'"/>','<textarea class="hidden_remark" style="display: none;"  name="hidden_remark['+y_y.MemberID+']['+y_y.CartID+']" '+(editable=='yes'?'':'readonly')+' >'+y_y.Remark+'</textarea>','<textarea class="required_input crtextarea" name="remark['+y_y.MemberID+']['+y_y.CartID+']"></textarea>','</div>'].join('')}else{REMARK+=['<div>','</div>'].join('')}}
html+=['<div class="product cart_tr" id="'+y_y.CartID+'">','<div class="pro_tr_border">','<div class="product-image '+nrCss+'">','<img src="'+y_y.Image+'">','</div>','<div class="product-details cart_hover '+nrCss+'">','<a href="'+merchantURL+'">'+languageConvert(language,y_y.Name)+'</a><br>'+Option+''+Addon+'',REMARK,'</div>','<div class="product-price '+nrCss+'">RM'+y_y.Price+'</div>','<div class="product-quantity '+nrCss+'">',Qty,'</div>','</div>'].join('');if(editable=='yes'){html+='<div class="product-removal cart_hover"><a href="#" class="cart_remove" ><i class="fa fa-trash" aria-hidden="true"></i></a></div>'}
html+=['<div class="product-line-addon '+nrCss+'">RM'+y_y.AddonSubTotal+'</div>','<div class="product-line-price '+nrCss+'">RM'+y_y.Total+'</div>','</div>'].join('')})}
html+=['<div class="totals clearfix">','<div class="totals-item">','<label>'+$l.st1+'</label>','<div class="totals-value" id="cart-subtotal">RM'+mSubtotal+'</div>','</div>'].join('');html+=['<div class="totals-item">','<label>Deliver - '+driverName+'</label>','<div class="totals-value" id="cart-subtotal">RM'+driverPrice+'</div>','</div>','<div class="totals-item">','<label>'+$l.gt1+'</label>','<div class="totals-value" id="cart-subtotal">RM'+mGranTotal+'</div>','</div>','</div>'].join('')})}
if(checkValue(output.list)){html+='<div class="cart_area_time">';if(output.list.CartArea!=''&&output.list.CartArea!=null){html+='<b style="font-size: 17px;">'+output.list.CartArea.AreaName+'</b><br>'}
if(checkValue(output.list.CartTimeDate)){var dateTime=output.list.CartTimeDate.Time,H=+dateTime.substr(0,2),h=H%12||12,ampm=(H<12||H===24)?"AM":"PM",dateTime=h+dateTime.substr(2,3)+ampm;var dateTime2=output.list.CartTimeDate.Time,H2=+dateTime2.substr(0,2),h2=H2%12||12,ampm2=(H2<12||H===24)?"AM":"PM",dateTime2=(h2+1)+dateTime2.substr(2,3)+ampm2;html+=output.list.CartTimeDate.Date+' | '+dateTime+' - '+dateTime2}
html+='</div>';html+='<div class="totals clearfix">';if(checkValue(output.list.cartTotal)){html+=['<div class="totals-item">','<label>'+$l.gt1+'</label>','<div class="totals-value" id="cart-subtotal">RM'+output.list.cartTotal.GrandTotal+'</div>','</div>'].join('');if(editable=='yes'){html+='<div class="btn_box">';html+='<div class="row unsetrow">';html+='<div class="twelve columns">';html+='<a href="merchant?r='+(output.list.business_type!=null&&output.list.business_type!=undefined?output.list.business_type:'')+'" class="carttomerchant cart_continue_shopping my_cart_continue" id="carttomerchant" >'+$l.ctam+'</a>';html+='<a href="product?id='+(output.list.last_merchant!=null&&output.list.last_merchant!=undefined?output.list.last_merchant:merchantID)+'" class="carttomerchant cart_continue_shopping my_cart_continue" id="carttomerchant" >'+$l.cts1+'</a>';html+='<a href="#" class="proceedtopay lazy_btn cart_confirm_order my_cart_confirm" id="carttoshipping" >'+$l.co1+'</a>';html+='</div>';html+='</div>';html+='</div>'}}
html+='</div>'}
html+='</div>';if(html==''){html='no found'}
$("#form_cart_list").html(html).hide().fadeIn(300);if(Tempqty!=''&&Tempqty!=null){$.each(Tempqty,function(q1,q2){})}}
function shippingCart(This){ajaxCall(This,function(output){})}
function shippingCartHTML(output,This){var html='';var ThisForm=This.parents('body').find('#form_shipping');ThisForm.find('#company_name').val(output.list.CompanyName);ThisForm.find('#email').val(output.list.Email);ThisForm.find('#name').val(output.list.Name);ThisForm.find('#address').val(output.list.Address);ThisForm.find('#postcode').val(output.list.Postcode);ThisForm.find('#city').val(output.list.City);ThisForm.find('#state').val(output.list.State)}
function cartListing(This,data,editable){This.append(data);appendLoad($("#form_cart_list"));ajaxCall(This,function(output){cartListHTML(output,editable);removeLoad($("#form_cart_list"))})}
function proBox(id,catid,appid){var html=['<form class="form_add_to_cart" id="pop_'+id+'">','<div class="modal fade show" style="padding-right: 16px;display: block;">','<div class="modal-dialog">','<div class="modal-content">','<div class="modal-body">','<div class="row unsetrow displayflex">','<div class="col-md-6">','<div class="view_image">','<img src="" class="pro_image">','</div>','</div>','<div class="col-md-6">','<div class="view_content_sw">','<span class="view_title_pro"></span>','<span class="pro_price"></span>','<div class="pro_ProductID">','<span></span>','</div>','<div class="pro_cart_quantity_ pcq">','<span></span>','</div>','<div class="pro_quantity">','<span></span>','</div>','<div class="pro_Description">','</div>','<div class="socialmedia_likebutton cart_hover">','<ul>','</ul>','</div>','</div>','</div>','</div>','<div class="view_multiple_option">','<div id="show_result">','<div class="failed_div failed-stock">'+$l.spoos+'</div>','<div class="failed_div failed-login">'+$l.syanly+'</div>','<div class="failed_div failed-area">'+$l.syaioocda+'</div>','<div class="failed_div failed-max">'+$l.stprmol+'</div>','<div class="failed_div failed-merchant">'+$l.scmpniyda+'</div>','<div class="failed_div failed-min-order">'+$l.stimo+'</div>','<div class="failed_div failed-lat-lng">'+$l.swcfy+'</div>','<div class="success_div success">'+$l.tyihbatc+'</div>','<div class="success_div success_wishlist">'+$l.saitw+'</div>','<div class="success_div remove_wishlist">'+$l.srifw+'</div>','</div>','<ul class="pro_ul_select">','<li>','<label>'+$l.d5+'</label>','<select name="pro_date" class="form-control pop_pro_date required_input">','<option value="">'+$l.cad+'</option>','</select>','</li>','<li>','<label>'+$l.t8+'</label>','<select name="pro_time" class="form-control pop_pro_time required_input">','<option value="">'+$l.ct2+'</option>','</select>','</li>','</ul>','<ul class="pro_ul_select pro_ul_option">','</ul>','<ul class="pro_ul_select pro_ul_addon">','</ul>','</div>','</div>','<div class="modal-footer clearfix">','<div class="modal-footer-left" >','<div class="product_quantity">','<div class="sp-quantity clearfix">','<div class="sp-minus fff sp-left"><a class="pop_ddd" href="#" data-multi="-1">-</a></div>','<div class="sp-input"><input type="text" name="cart_quantity" class="quntity-input required_input pop_product_quantity_input" id="" value=""/> </div>','<div class="sp-plus fff sp-right"><a class="pop_ddd" href="#" data-multi="1">+</a></div>','</div>','</div>','</div>','<div class="pop_area"></div>','<div class="modal-footer-right pro_button" >','<input type="hidden" name="type" value="cart">','<input type="hidden" name="action" value="addtocart">','<input type="hidden" name="DriverID" id="add_DriverID" value="">','<input type="hidden" name="PickupID" id="add_PickupID" value="">','<input type="hidden" name="app_id" id="add_app_id" value="">','<input type="hidden" name="category_id" id="add_category_id" value="">','<input type="hidden" name="product_id" id="add_ProductID" value="">','<input type="hidden" name="MinQuantity" id="add_MinQuantity" value="">','<button type="submit" class="addtocart product_addcart lazy_btn pro_button_shadow" id="addToCartButton">'+$l.atc1+'</button>','</div>','</div>','<div class="modal-close-button" data-dismiss="modal"><i class="fa fa-times" aria-hidden="true"></i></div>','</div>','</div>','</div>','<div class="modal-backdrop"></div>','</form>','<form id="form_cartListCheck">','<input type="hidden" name="type" value="cart" />','<input type="hidden" name="action" value="cartListCheck" />','<input type="hidden" name="app_id" id="app_id" value="'+appid+'" />','<input type="hidden" name="category_id" value="'+(catid>0?catid:'no')+'" />','<input type="hidden" name="product_id" value="'+id+'" />','<input type="hidden" name="product_date" id="product_date" value="" />','<input type="hidden" name="product_time" id="product_time" value="" />','</form>','<form id="form_addtowishlist">','<input type="hidden" name="type" value="app" />','<input type="hidden" name="action" value="addtowishlist" />','<input type="hidden" name="app_id" id="app_id" value="'+appid+'" />','<input type="hidden" name="product_id" value="'+id+'" />','</form>'].join('');return html}
function productDetailPopout(id,mode='all'){var ThisParentHidden=$('body').find('.item_box_procat'),ThisForm=ThisParentHidden.find('#de_'+id);ajaxCall(ThisForm,function(data){if(data.result=='success'){var list=data.list,company=data.content,content='',ThisParentHidden=ThisForm.parents('body').find('div:hidden'),ThisHideForm=ThisParentHidden.find('#form_product_detail'),ThisHideFormCheck=ThisParentHidden.find('#form_cartListCheck'),ProLink=encodeURIComponent(URL+'/product?id='+list.app_id+'&page=product-detail&category_id='+list.category_id+'&product_id='+list.ProductID+'&page_title='+languageConvert(language,list.Name)),$wishlist_link=$share_friend_link='<a href="#" class="like_compare addtowishlist" id="'+list.ProductID+'">',$wishlist_fa=(list.wishlist_status==0?'fa fa-heart':'fa fa-heart-o');$('.view_title_pro').text(languageConvert(language,list.Name));$('.pro_image').attr('src',list.Image);$('.pro_price').text('RM'+list.Price);$('.pro_ProductID').html($l.pdc+': <span>'+list.ProductID+'</span>');$('.pcq').html($l.a13+': <span>'+(list.Quantity>0?''+$l.is+'':''+$l.oos+'')+'</span>');$('.pro_quantity').html($l.q1+': <span>'+(list.Quantity>0?list.Quantity:0)+'</span>');$('.pro_Description').html('<span class="pro_Desc_spn">'+$l.d3+':</span> <span>'+htmlEntityDecode(languageConvert(language,list.Description))+'</span>');$('.socialmedia_likebutton').html(['<ul>','<li>'+$wishlist_link+'<i class="'+$wishlist_fa+'" id="fa_love"></i></a></li>','<li><iframe src="https://www.facebook.com/plugins/share_button.php?href='+ProLink+'&layout=button&size=small&mobile_iframe=true&appId=247512735724420&width=59&height=20" width="59" height="20" style="border:none;overflow:hidden;width:100%;" scrolling="no" frameborder="0" allowTransparency="true"></iframe></li>','</ul>'].join(''));var dateHtMl='',timeHtMl='';if(list.Date!=''&&list.Date!=null){dateHtMl+='<option value="">'+$l.cad+'</option>';var SelectedDate=!1;$.each(list.Date,function(k,v){var selected='';if(list.SelectedDate==k){selected='selected';SelectedDate=!0}
dateHtMl+='<option value="'+k+'" '+selected+'>'+v+'</option>'});if(SelectedDate){ThisHideForm.find("[name^='product_date']").val(list.SelectedDate);ThisHideFormCheck.find("[name^='product_date']").val(list.SelectedDate)}}else{dateHtMl+='<option value="">No Available Date</option>'}
$('.pop_pro_date').html(dateHtMl);if(list.Time!=''&&list.Time!=null){timeHtMl+='<option value="">'+$l.ct2+'</option>';var SelectedTime=!1;$.each(list.Time,function(k,v){var selected='';if(list.SelectedTime==k){selected='selected';SelectedTime=!0}
timeHtMl+='<option value="'+k+'" '+selected+' >'+v+'</option>'});if(SelectedTime){ThisHideForm.find("[name^='product_time']").val(list.SelectedTime);ThisHideFormCheck.find("[name^='product_time']").val(list.SelectedTime)}}else{timeHtMl+='<option value="">'+$l.ct2+'</option>'}
$('.pop_pro_time').html(timeHtMl);var optHtMl='';var count_option_Name=0;if(list.Option!=''){$.each(list.Option,function(k,v){if(v!=''){$.each(v,function(k_2,v_2){if(k_2!=''){var k_name=k_2}else{var k_name=count_option_Name}
optHtMl+='<li>';optHtMl+='<label>'+k_2+'</label>';optHtMl+='<select name="pro_option['+k+']" class="form-control  pop_pro_option required_input">';optHtMl+='<option value="">'+k_2+'</option>';if(v_2!=''){$.each(v_2,function(k_1,v_1){if(list.SelectedOption!=''&&list.SelectedOption!=null){if(list.SelectedOption[k]!=''&&list.SelectedOption[k]!='null'){var SelectedOption='';if(list.SelectedOption[k]==k_1){SelectedOption='selected'}}}
optHtMl+='<option value="'+k_1+'" '+SelectedOption+'>'+v_1+'</option>'})}
optHtMl+='</select>';optHtMl+='</li>';count_option_Name++})}})}
$('.pro_ul_option').html(optHtMl);if(list.ProductAddon!=''&&list.ProductAddon!='null'){var addonSelected=IMG='';var addonHtMl='<label class="addon_rm"><span class="red">*</span>'+$l.iywmt+'</label>';$.each(list.ProductAddon,function(x,y){addonHtMl+=['<li class="addon_box_list" >','<table>'].join('');var ThisProQty=0;if(list.addon_quantity!=''&&list.addon_quantity!==null&&list.addon_quantity!==undefined){if(list.addon_quantity[y.AddonID]!=''&&list.addon_quantity[y.AddonID]!==null&&list.addon_quantity[y.AddonID]!==undefined){ThisProQty=list.addon_quantity[y.AddonID]}}
if(list.ProductAddonSelected!=''&&list.ProductAddonSelected!=null&&list.ProductAddonSelected!==undefined){if($.inArray(x,list.ProductAddonSelected)!==-1){addonSelected='checked'}else{addonSelected=''}}
if(y.File!=''){IMG='cms/'+y.File}else{IMG='Images/NoProduct.jpg'}
var qtyhtml=['<div class="count-input space-bottom div-width">','<a class="incr-btn popoutbox" data-action="decrease" href="#">–</a>','<input class="quantity pop_addon_quantity" type="text" name="addon_quantity['+y.AddonID+']" value="'+ThisProQty+'"/>','<a class="incr-btn popoutbox" data-action="increase" href="#">&plus;</a>','</div>'].join('');addonHtMl+=['<tr>','<td class="addon_td_img" rowspan="2" ><img src="'+IMG+'" /></td>','<td class="addon_td_title"><span>'+y.Name+'</span></td>','<td class="addon_td_price"><span>RM'+y.Price+'</span></td>','</tr>','<tr>','<td class="addon_td_qty" colspan="2" >'+qtyhtml+'</td>','</tr>'].join('');addonHtMl+='</table>';addonHtMl+='</li>'});$('.pro_ul_addon').html(addonHtMl)}
var FooterPOP='';var ThisProQtyCart=1;if(list.cart_quantity!=''&&list.cart_quantity!==null&&list.cart_quantity!==undefined){if(list.cart_quantity>=list.MinQuantity){ThisProQtyCart=list.cart_quantity}else{ThisProQtyCart=list.MinQuantity}}
$('.pop_product_quantity_input').val(ThisProQtyCart);var areaHtml='';if(list.AreaID!=''&&list.AreaID!==null&&list.AreaID!==undefined){$.each(list.AreaID,function(x,y){areaHtml+='<input type="hidden" name="AreaID['+x+']" id="AreaID" value="'+y+'">'});$('.pop_area').html(areaHtml)}
$('#add_DriverID').val(list.DriverID);$('#add_PickupID').val(list.PickupID);$('#add_app_id').val(list.app_id);$('#add_category_id').val(list.category_id);$('#add_ProductID').val(list.ProductID);$('#add_MinQuantity').val(list.MinQuantity);$('.modal-body, .modal-footer').css('visibility','visible');removeLoad(ThisForm.parents('body').find(".modal-dialog"))}else{alert('Sorry, no data found!')}})}
function productDetail(){var ThisForm=$("#form_product_detail");ajaxCall(ThisForm,function(data){if(data.result=='success'){var list=data.list,company=data.content,content='',ThisParentHidden=ThisForm.parents('body').find('div:hidden'),ThisHideForm=ThisParentHidden.find('#form_product_detail'),ThisHideFormCheck=ThisParentHidden.find('#form_cartListCheck'),ProLink=encodeURIComponent(URL+'/product?id='+list.app_id+'&page=product-detail&category_id='+list.category_id+'&product_id='+list.ProductID+'&page_title='+languageConvert(language,list.Name)),$wishlist_link=$share_friend_link='<a href="#" class="like_compare addtowishlist" id="'+list.ProductID+'">',$wishlist_fa=(list.wishlist_status==0?'fa fa-heart':'fa fa-heart-o');$(".meta_title").text(languageConvert(language,list.Name));$(".meta_image").attr('content',list.Image);content=['<div class="row unsetrow displayflex">','<div class="six columns flex">','<div class="view_content"> ','<div class="view_image">','<img src="'+list.Image+'" />','</div>','</div>','</div>','<div class="six columns flex">','<div class="view_content_sw">','<span class="view_title_pro">'+languageConvert(language,list.Name)+'</span>','<span class="pro_price">RM'+list.Price+'</span>','<div class="pro_ProductID">'+$l.pdc+': <span>'+list.ProductID+'</span></div> ','<div class="pro_cart_quantity_'+(list.cart_quantity>0?'in':'out')+'">'+$l.a13+': <span>'+(list.Quantity>0?''+$l.is+'':''+$l.oos+'')+'</span></div>','<div class="pro_quantity">'+$l.q1+': <span>'+(list.Quantity>0?list.Quantity:0)+'</span></div>','<div class="pro_Description"><span class="pro_Desc_spn">'+$l.d3+':</span> <span>'+htmlEntityDecode(languageConvert(language,list.Description))+'</span></div>','<div class="socialmedia_likebutton">','<ul>','<li>'+$wishlist_link+'<i class="'+$wishlist_fa+'" id="fa_love"></i></a></li>','<li><iframe src="https://www.facebook.com/plugins/share_button.php?href='+ProLink+'&layout=button&size=small&mobile_iframe=true&appId=247512735724420&width=59&height=20" width="59" height="20" style="border:none;overflow:hidden;width:100%;" scrolling="no" frameborder="0" allowTransparency="true"></iframe></li>','</ul>','</div>','</div>','</div>','</div>','<div class="view_multiple_option">','<div id="show_result">','<div class="failed_div failed-stock">'+$l.spoos+'</div>','<div class="failed_div failed-login">'+$l.syanly+'</div>','<div class="failed_div failed-area">'+$l.syaioocda+'</div>','<div class="failed_div failed-merchant">'+$l.scmpniyda+'</div>','<div class="failed_div failed-min-order">'+$l.stimo+'</div>','<div class="failed_div failed-lat-lng">'+$l.swcfy+'</div>','<div class="success_div success">'+$l.tyihbatc+'</div>','<div class="success_div success_wishlist">'+$l.saitw+'</div>','<div class="success_div remove_wishlist">'+$l.srifw+'</div>','</div>','<form id="form_add_to_cart">'].join("");content+='<ul class="pro_ul_select">';content+='<li>';if(list.Date!=''&&list.Date!=null){content+='<label>'+$l.d5+'</label>';content+='<select name="pro_date" class="pro_date required_input">';content+='<option value="">'+$l.cad+'</option>';var SelectedDate=!1;$.each(list.Date,function(k,v){var selected='';if(list.SelectedDate==k){selected='selected';SelectedDate=!0}
content+='<option value="'+k+'" '+selected+'>'+v+'</option>'});if(SelectedDate){ThisHideForm.find("[name^='product_date']").val(list.SelectedDate);ThisHideFormCheck.find("[name^='product_date']").val(list.SelectedDate)}
content+='</select>'}else{content+='<select name="pro_date" class="pro_date required_input">';content+='<option value="">No Available Date</option>';content+='</select>'}
content+='</li>';content+='<li>';if(list.Time!=''&&list.Time!=null){content+='<label>'+$l.t8+'</label>';content+='<select name="pro_time" class="pro_time required_input">';content+='<option value="">'+$l.ct2+'</option>';var SelectedTime=!1;$.each(list.Time,function(k,v){var selected='';if(list.SelectedTime==k){selected='selected';SelectedTime=!0}
content+='<option value="'+k+'" '+selected+' >'+v+'</option>'});if(SelectedTime){ThisHideForm.find("[name^='product_time']").val(list.SelectedTime);ThisHideFormCheck.find("[name^='product_time']").val(list.SelectedTime)}
content+='</select>'}else{content+='<label>'+$l.t8+'</label>';content+='<select name="pro_time" class="pro_time required_input">';content+='<option value="">'+$l.ct2+'</option>';content+='</select>'}
content+='</li>';content+='</ul>';content+='<ul class="pro_ul_select">';var count_option_Name=0;if(list.Option!=''){$.each(list.Option,function(k,v){if(v!=''){$.each(v,function(k_2,v_2){if(k_2!=''){var k_name=k_2}else{var k_name=count_option_Name}
content+='<li>';content+='<label>'+k_2+'</label>';content+='<select name="pro_option['+k+']" class="pro_option required_input">';content+='<option value="">'+k_2+'</option>';if(v_2!=''){$.each(v_2,function(k_1,v_1){if(list.SelectedOption!=''&&list.SelectedOption!=null){if(list.SelectedOption[k]!=''&&list.SelectedOption[k]!='null'){var SelectedOption='';if(list.SelectedOption[k]==k_1){SelectedOption='selected'}}}
content+='<option value="'+k_1+'" '+SelectedOption+'>'+v_1+'</option>'})}
content+='</select>';content+='</li>';count_option_Name++})}})}
content+='</ul>';content+='<div>';content+='<div class="product_addon_title">';content+='<span>'+$l.ao3+'</span>';content+='</div>';content+='<ul class="pro_ul_select">';if(list.ProductAddon!=''&&list.ProductAddon!='null'){var addonSelected=IMG='';$.each(list.ProductAddon,function(x,y){content+=['<li class="addon_box_list" >','<table>'].join('');var ThisProQty=0;if(list.addon_quantity!=''&&list.addon_quantity!==null&&list.addon_quantity!==undefined){if(list.addon_quantity[y.AddonID]!=''&&list.addon_quantity[y.AddonID]!==null&&list.addon_quantity[y.AddonID]!==undefined){ThisProQty=list.addon_quantity[y.AddonID]}}
if(list.ProductAddonSelected!=''&&list.ProductAddonSelected!=null&&list.ProductAddonSelected!==undefined){if($.inArray(x,list.ProductAddonSelected)!==-1){addonSelected='checked'}else{addonSelected=''}}
if(y.File!=''){IMG='cms/'+y.File}else{IMG='Images/NoProduct.jpg'}
var qtyhtml=['<div class="count-input space-bottom div-width">','<a class="incr-btn normalbox" data-action="decrease" href="#">–</a>','<input class="quantity addon_quantity" type="text" name="addon_quantity['+y.AddonID+']" value="'+ThisProQty+'"/>','<a class="incr-btn normalbox" data-action="increase" href="#">&plus;</a>','</div>'].join('');content+=['<tr>','<td class="addon_td_img" rowspan="2" ><img src="'+IMG+'" /></td>','<td class="addon_td_title"><span>'+y.Name+'</span></td>','<td class="addon_td_price"><span>RM'+y.Price+'</span></td>','</tr>','<tr>','<td class="addon_td_qty" colspan="2" >'+qtyhtml+'</td>','</tr>'].join('');content+='</table>';content+='</li>'})}
content+='</ul>';content+='</div>';var ThisProQtyCart=1;if(list.cart_quantity!=''&&list.cart_quantity!==null&&list.cart_quantity!==undefined){if(list.cart_quantity>=list.MinQuantity){ThisProQtyCart=list.cart_quantity}else{ThisProQtyCart=list.MinQuantity}}
content+='<div >';content+='<div class="pro_addon_title">';content+='<span>'+$l.tq1+'</span>';content+='</div>';content+='<ul class="pro_ul_select">';content+='<li>';content+=['<div class="product_quantity">','<div class="sp-quantity clearfix">','<div class="sp-minus fff sp-left"><a class="ddd" href="#" data-multi="-1">-</a></div>','<div class="sp-input"><input type="text" name="cart_quantity" class="quntity-input required_input product_quantity_input" id="" value="'+ThisProQtyCart+'"/> </div>','<div class="sp-plus fff sp-right"><a class="ddd" href="#" data-multi="1">+</a></div>','</div>','</div>'].join('');content+='</li>';content+='</ul>';content+='</div>';content+='<div class="pro_button">';content+='<input type="hidden" name="type" value="cart">';content+='<input type="hidden" name="action" value="addtocart">';if(list.AreaID!=''&&list.AreaID!==null&&list.AreaID!==undefined){$.each(list.AreaID,function(x,y){content+='<input type="hidden" name="AreaID['+x+']" id="AreaID" value="'+y+'">'})}
content+='<input type="hidden" name="DriverID" id="DriverID" value="'+list.DriverID+'">';content+='<input type="hidden" name="PickupID" id="PickupID" value="'+company.PickupID+'">';content+='<input type="hidden" name="app_id" id="app_id" value="'+list.app_id+'">';content+='<input type="hidden" name="category_id" value="'+list.category_id+'">';content+='<input type="hidden" name="product_id" value="'+list.ProductID+'">';content+='<input type="hidden" name="MinQuantity" value="'+list.MinQuantity+'">';content+='<button type="submit" class="addtocart product_addcart lazy_btn pro_button_shadow" id="addToCartButton">'+$l.atc1+'</button>';content+='</div>';content+='	</div>  ';content+='</form>';content+='</div> ';$('.header_title').text(company.Title+' Details');$('.product_container').show();$('.product_view_content').html(content).hide().fadeIn(300);$(".page_loader").fadeOut("slow")}else{alert('Sorry, no data found!')}})}
function productDetailNearby(){var ThisForm=$("#form_product_detail_nearby");ajaxCall(ThisForm,function(data){if(data.result=='success'){var list=data.list,company=data.content,content='',ThisParentHidden=ThisForm.parents('body').find('div:hidden'),ThisHideForm=ThisParentHidden.find('#form_product_detail'),ThisHideFormCheck=ThisParentHidden.find('#form_cartListCheck'),ProLink=encodeURIComponent(URL+'/product?id='+list.app_id+'&page=product-detail&category_id='+list.category_id+'&product_id='+list.ProductID+'&page_title='+languageConvert(language,list.Name)),$wishlist_link=$share_friend_link='<a href="#" class="like_compare addtowishlist" id="'+list.ProductID+'">',$wishlist_fa=(list.wishlist_status==0?'fa fa-heart':'fa fa-heart-o');$(".meta_title").text(languageConvert(language,list.Name));$(".meta_image").attr('content',list.Image);content=['<div class="row unsetrow displayflex">','<div class="six columns flex">','<div class="view_content"> ','<div class="view_image">','<img src="'+list.Image+'" />','</div>','</div>','</div>','<div class="six columns flex">','<div class="view_content_sw">','<span class="view_title_pro">'+languageConvert(language,list.Name)+'</span>','<span class="pro_price">RM'+list.Price+'</span>','<div class="pro_ProductID">'+$l.pdc+': <span>'+list.ProductID+'</span></div> ','<div class="pro_cart_quantity_'+(list.cart_quantity>0?'in':'out')+'">'+$l.a13+': <span>'+(list.Quantity>0?''+$l.is+'':''+$l.oos+'')+'</span></div>','<div class="pro_quantity">'+$l.q1+': <span>'+(list.Quantity>0?list.Quantity:0)+'</span></div>','<div class="pro_Description"><span class="pro_Desc_spn">'+$l.d3+':</span> <span>'+htmlEntityDecode(languageConvert(language,list.Description))+'</span></div>','<div class="socialmedia_likebutton">','<ul>','<li>'+$wishlist_link+'<i class="'+$wishlist_fa+'" id="fa_love"></i></a></li>','<li><iframe src="https://www.facebook.com/plugins/share_button.php?href='+ProLink+'&layout=button&size=small&mobile_iframe=true&appId=247512735724420&width=59&height=20" width="59" height="20" style="border:none;overflow:hidden;width:100%;" scrolling="no" frameborder="0" allowTransparency="true"></iframe></li>','</ul>','</div>','</div>','</div>','</div>','<div class="view_multiple_option">','<div id="show_result">','<div class="failed_div failed-stock">'+$l.spoos+'</div>','<div class="failed_div failed-login">'+$l.syanly+'</div>','<div class="failed_div failed-area">'+$l.syaioocda+'</div>','<div class="failed_div failed-merchant">'+$l.scmpniyda+'</div>','<div class="failed_div failed-min-order">'+$l.stimo+'</div>','<div class="success_div success">'+$l.tyihbatc+'</div>','<div class="success_div success_wishlist">'+$l.saitw+'</div>','<div class="success_div remove_wishlist">'+$l.srifw+'</div>','</div>','<form id="form_add_to_cart">'].join("");content+='	</div>  ';content+='</form>';content+='</div> ';$('.header_title').text(company.Title+' Details');$('.product_container').show();$('.product_view_content').html(content).hide().fadeIn(300);$(".page_loader").fadeOut("slow")}else{alert('Sorry, no data found!')}})}
function checkField(OtherForm){var elem=subKey="",booleanValue=!0;var offset=-200;var count=1;OtherForm.find(".required_input").each(function(){subKey=$(this);subKey.removeClass("error");if(subKey.val()==""){subKey.addClass("error");booleanValue=!1;if(count==1){$('html, body').animate({scrollTop:subKey.offset().top+offset},1000);count++}}});return booleanValue}
function resetField(OtherForm){var subKey="",booleanValue=!0;OtherForm.find('input[type="text"],input[type="password"],textarea').each(function(){$(this).val("")});OtherForm.find('input[type="radio"]').each(function(){this.checked=!1});return booleanValue}
function lockUnlockInput(type){if(type=='lock'){$('select, input, textarea, .btn').attr('readonly','readonly');$('.btn').attr('disabled','disabled')}else{$('select, input, textarea').removeAttr("readonly");$('.btn').removeAttr('disabled')}}
function lockUnlockBtn(This,type){if(type=='lock'){This.attr('readonly','readonly');This.attr('disabled','disabled')}else{This.removeAttr("readonly");This.removeAttr('disabled')}}
function resetHoursContent(status,list){var content='';content='<span class="hours_status '+status+'">'+status+'</span>';if(status=='open'){content+='<span class="hours_list">( '+list.join(', ')+' )</span>'}
return content}
function cartRemoveList(data){var html='';if(data!=''){$.each(data,function(x,y){html+='<input type="hidden" name="cartremove['+x+']" value="'+y+'">'})}
return html}
function addToCart(This,data){This.append(data);ajaxCall(This,function(output){if(output.result=='success'){toastr.success($("."+output.result).text());if(checkValue(output.list.countCart)){$(".cart_count").text(output.list.countCart)}}else if(output.result=='failed-stock'){toastr.error($("."+output.result).text())}else if(output.result=='failed-login'){toastr.error($("."+output.result).text());window.location.href=URL+'/login?redirect='+output.redirect}else if(output.result=='failed-area'){toastr.error($("."+output.result).text())}else if(output.result=='failed-merchant'){toastr.error($("."+output.result).text())}else if(output.result=='failed-lat-lng'){toastr.error($("."+output.result).text())}else if(output.result=='failed-areaid'){toastr.error($(".failed-area").text())}else if(output.result=='failed-max'){toastr.error($(".failed-max").text())}})}
var getUrlParam=function getUrlParam(sParam){var sPageURL=decodeURIComponent(window.location.search.substring(1)),sURLVariables=sPageURL.split('&'),sParameterName,i;for(i=0;i<sURLVariables.length;i++){sParameterName=sURLVariables[i].split('=');if(sParameterName[0]===sParam){return sParameterName[1]===undefined?!0:sParameterName[1]}}};function ratingCommentInput($title,$value,$check,$id,$type){var $content=['<li class="rating_type">','<span class="rating">'].join('');var $content=['<li class="rating_type">','<span class="rating">'].join('');var $b=5;for(var $a=1;$a<=5;$a++){if($id!=''){var name='-'+$id}else{var name=''}
if($check==$b){var checked='checked'}else{var checked=''}
$content+=['<input type="radio" name="rating-input-'+$value+name+'" class="rating-input" id="rating-input-'+$value+name+'" value="'+$b+'" '+checked+' '+($type!=''?'disabled':'')+'>','<label for="rating-input-'+$value+'-'+$a+name+'" class="rating-star'+($type!=''?'-show':'')+'"></label>'].join('');$b--}
$content+=['</span>','</li>'].join('');return $content}
function appendLoad(This,img="loading_apple.png"){var src=URL+'/Images/'+img+'?v=1.1111',img='<span class="btn_load"><img src="'+src+'" width="25px" /></span>';This.css("position","relative");lockUnlockBtn(This,'lock');This.append(img)}
function removeLoad(This){var btn_load=This.find('.btn_load');btn_load.remove();lockUnlockBtn(This,'unlock')}
function closeProdetail(){$('#popout_pro_append').html('');$('body').removeClass('modal-open')}
$(document).ready(function(){$(document).ajaxStart(function(){});$(document).ajaxComplete(function(){});$(document).on('click','.popout_probox',function(e){var id=$(this).parent('.form_product_detail').attr('id'),ID=id.split('_'),appid=$(this).parent('.form_product_detail').attr('appid'),catid=$(this).parent('.form_product_detail').attr('catid');$('#popout_pro_append').html(proBox(ID[1],catid,appid));$('.modal-dialogs').show();$('.modal-body, .modal-footer').css('visibility','hidden');$('body').addClass('modal-open');appendLoad($(".modal-dialog"));productDetailPopout(ID[1]);e.preventDefault()});$(document).on('click','.modal-close-button',function(e){closeProdetail();e.preventDefault()});$(document).on('click','.modal',function(e){closeProdetail()}).on('click','.modal-dialog',function(e){e.stopPropagation()});$(document).on('change','.pop_pro_date, .pop_pro_time, .pop_pro_option',function(e){var ThisOption=$(this).attr('class'),isOption=!1,isValue=!0;if(ThisOption=='pop_pro_option required_input'){isOption=!0}
if($('.pop_pro_option').length!==''){$.each($('.pop_pro_option'),function(x,y){var VAL=$(this).val();if(VAL==''){isValue=!1}})}
if(isOption){if(isValue){}else{return}}
var ThisParent=$(this).parents('.form_add_to_cart'),Thispopout=ThisParent.attr('id'),ID=Thispopout.split('_');var ThisParentHidden=$(this).parents('body'),ThisHideForm=ThisParentHidden.find('#de_'+ID[1]);ThisHideFormCheck=ThisParentHidden.find('#form_cartListCheck');ThisDate=ThisParent.find('.pop_pro_date').val(),ThisTime=ThisParent.find('.pop_pro_time').val(),ThisOption=ThisParent.find('.pop_pro_option'),ThisAddon=ThisParent.find('.pop_pro_addon');ThisHideForm.find('.pop_pro_option').remove();if(ThisOption!=''){var appendInput='';$.each(ThisOption,function(k,v){if($(this).attr("name")!=''&&this.value!=''){appendInput+='<input type="hidden" name="'+$(this).attr("name")+'" class="pop_pro_option"  value="'+this.value+'">'}})}
ThisHideForm.append(appendInput);ThisHideForm.find("[name^='product_date']").val(ThisDate);ThisHideForm.find("[name^='product_time']").val(ThisTime);ThisHideFormCheck.find("[name^='product_date']").val(ThisDate);ThisHideFormCheck.find("[name^='product_time']").val(ThisTime);productDetailPopout(ID[1])});$(document).on('change','.pro_date, .pro_time, .pro_option',function(e){var ThisOption=$(this).attr('class'),isOption=!1,isValue=!0;if(ThisOption=='pro_option required_input'){isOption=!0}
if($('.pro_option').length!==''){$.each($('.pro_option'),function(x,y){var VAL=$(this).val();if(VAL==''){isValue=!1}})}
if(isOption){if(isValue){}else{return}}
var ThisParentHidden=$(this).parents('body').find('div:hidden'),ThisHideForm=ThisParentHidden.find('#form_product_detail');ThisHideFormCheck=ThisParentHidden.find('#form_cartListCheck');ThisParent=$(this).parents('#form_add_to_cart'),ThisDate=ThisParent.find('.pro_date').val(),ThisTime=ThisParent.find('.pro_time').val(),ThisOption=ThisParent.find('.pro_option'),ThisAddon=ThisParent.find('.pro_addon');ThisHideForm.find('.pro_option').remove();if(ThisOption!=''){var appendInput='';$.each(ThisOption,function(k,v){if($(this).attr("name")!=''&&this.value!=''){appendInput+='<input type="text" name="'+$(this).attr("name")+'" class="pro_option"  value="'+this.value+'">'}})}
ThisHideForm.append(appendInput);ThisHideForm.find("[name^='product_date']").val(ThisDate);ThisHideForm.find("[name^='product_time']").val(ThisTime);ThisHideFormCheck.find("[name^='product_date']").val(ThisDate);ThisHideFormCheck.find("[name^='product_time']").val(ThisTime);ThisHideForm.find('.product_addon').remove();if(ThisAddon.length!==0){var HTMLaddon='';$.each(ThisAddon,function(x,y){if($(this).is(":checked")){HTMLaddon+='<input type="text" name="addon[]" class="product_addon"  value="'+$(this).val()+'">'}});ThisHideForm.append(HTMLaddon)}
productDetail()});$(document).on("click",".filter_reset",function(e){$(':input').clearForm();e.preventDefault()});$(document).on("click",".ddd",function(e){var $button=$(this),$input=$button.closest('.sp-quantity').find("input.quntity-input"),$minimum=1,ProDetail=Cart=!1;var ThisParent=$(this).parents('#form_add_to_cart'),MinQuantity=ThisParent.find("[name^='MinQuantity']").val();var $quantity=+$input.val()+(1*+$button.data('multi')),Qty='';if($quantity>=$minimum){Qty=$quantity}else{Qty=$minimum}
if(Qty<MinQuantity)
{toastr.error($(".failed-min-order").text())}
if($('#form_cart_list').length!==0){Cart=!0;var ThisItemRow=$button.parents('.cart_tr'),ThisItem=ThisItemRow.attr('id'),ThisParentHidden=$button.parents('body').find('div:hidden'),ThisHideForm=ThisParentHidden.find('#form_cart_update');ThisHideForm.find("[name^='cart_id']").val(ThisItem);MinQuantity=$('#form_cart_list').find("[name^='MinQuantity_"+ThisItem+"']").val();$minimum=(MinQuantity!==0?MinQuantity:1);if(Qty>=$minimum){Qty=Qty}else{Qty=$minimum}}
if(Cart){ThisHideForm.find("[name^='cart_qty']").val(Qty);ajaxCall(ThisHideForm,function(output){if(output.result=='success-update'){cartListHTML(output);toastr.success($("."+output.result).text())}else if(output.result=='failed-update'){toastr.error($("."+output.result).text())}else if(output.result=='failed-stock'){cartListHTML(output);toastr.error($("."+output.result).text())}else{}})}else{var ThisParentHidden=$(this).parents('body').find('div:hidden'),ThisHideForm=ThisParentHidden.find('#form_product_detail'),ThisHideFormCheck=ThisParentHidden.find('#form_cartListCheck'),ThisParent=$(this).parents('#form_add_to_cart'),ThisAddon=ThisParent.find("[name^='addon']").val(),ThisAddonQty=ThisParent.find("[name^='addon_quantity']");ProDetail=!0}
$input.val(Qty);if(ProDetail){if(ThisHideForm.length!==0){ThisHideForm.find("[name^='selected_qty']").remove();var appendInput='';ThisQty=ThisParent.find("[name^='cart_quantity']");appendInput+='<input type="hidden" name="cart_quantity" class="cart_quantity"  value="'+ThisQty.val()+'">';ThisHideForm.append(appendInput);productDetail()}}
e.preventDefault()});$(document).on("click",".pop_ddd",function(e){var $button=$(this),$input=$button.closest('.sp-quantity').find("input.quntity-input"),$minimum=1,ProDetail=Cart=!1;var ThisParent=$(this).parents('.form_add_to_cart'),MinQuantity=ThisParent.find("[name^='MinQuantity']").val();var $quantity=+$input.val()+(1*+$button.data('multi')),Qty='';if($quantity>=$minimum){Qty=$quantity}else{Qty=$minimum}
if(Qty<MinQuantity)
{toastr.error($(".failed-min-order").text())}
var ThisParentHidden=$(this).parents('body'),ID=ThisParent.attr('id').split('_');ThisHideForm=ThisParentHidden.find('#de_'+ID[1]),ThisHideFormCheck=ThisParentHidden.find('#form_cartListCheck'),ThisAddon=ThisParent.find("[name^='pop_addon']").val(),ThisAddonQty=ThisParent.find("[name^='pop_addon_quantity']");ProDetail=!0;$input.val(Qty);if(ThisHideForm.length!==0){ThisHideForm.find("[name^='selected_qty']").remove();var appendInput='';ThisQty=ThisParent.find("[name^='cart_quantity']");appendInput+='<input type="hidden" name="cart_quantity" class="cart_quantity"  value="'+ThisQty.val()+'">';ThisHideForm.append(appendInput);productDetailPopout(ID[1])}
e.preventDefault()});$(document).on("click",".minus, .plus",function(e){var $button=$(this),$input=$button.closest('.sp-quantity').find(".sp_qty"),$minimum=1,ProDetail=Cart=!1;var ThisParent=$(this).parents('#form_add_to_cart'),MinQuantity=ThisParent.find("[name^='MinQuantity']").val();var $quantity=+$input.text()+(1*+$button.data('multi')),Qty='';if($quantity>=$minimum){Qty=$quantity}else{Qty=$minimum}
if(Qty<MinQuantity)
{toastr.error($(".failed-min-order").text())}
if($('#form_cart_list').length!==0){Cart=!0;var ThisItemRow=$button.parents('.cart_tr'),ThisItem=ThisItemRow.attr('id'),ThisParentHidden=$button.parents('body').find('div:hidden'),ThisHideForm=ThisParentHidden.find('#form_cart_update');ThisHideForm.find("[name^='cart_id']").val(ThisItem);MinQuantity=$('#form_cart_list').find("[name^='MinQuantity_"+ThisItem+"']").val();$minimum=(MinQuantity!==0?MinQuantity:1);if(Qty>=$minimum){Qty=Qty}else{Qty=$minimum}}
$input.text(Qty);if(Cart){ThisHideForm.find("[name^='cart_qty']").val(Qty);appendLoad($("#form_cart_list"));ajaxCall(ThisHideForm,function(output){if(output.result=='success-update'){cartListHTML(output);toastr.success($("."+output.result).text())}else if(output.result=='failed-update'){toastr.error($("."+output.result).text())}else if(output.result=='failed-stock'){cartListHTML(output);toastr.error($("."+output.result).text())}else{}
removeLoad($("#form_cart_list"))})}
e.preventDefault()});$(document).on("keyup",".sp_qty",function(e){var This=$(this)
Qty=parseInt(This.text()),MinQuantity=This.parents('#form_add_to_cart').find("[name^='MinQuantity']");$minimum=(MinQuantity.length!==0?MinQuantity:1),ProDetail=Cart=!1;if($('#form_cart_list').length!==0){Cart=!0;var ThisItemRow=This.parents('.cart_tr'),ThisItem=ThisItemRow.attr('id'),ThisParentHidden=This.parents('body').find('div:hidden'),ThisHideForm=ThisParentHidden.find('#form_cart_update');ThisHideForm.find("[name^='cart_id']").val(ThisItem);MinQuantity=$('#form_cart_list').find("[name^='MinQuantity_"+ThisItem+"']").val();$minimum=parseInt(MinQuantity!==0?MinQuantity:1);if(Qty>=$minimum){Qty=Qty}else{Qty=$minimum}}
if(Cart){ThisHideForm.find("[name^='cart_qty']").val(Qty);appendLoad($("#form_cart_list"));ajaxCall(ThisHideForm,function(output){if(output.result=='success-update'){cartListHTML(output);toastr.success($("."+output.result).text())}else if(output.result=='failed-update'){toastr.error($("."+output.result).text())}else if(output.result=='failed-stock'){cartListHTML(output);toastr.error($("."+output.result).text())}else{}
removeLoad($("#form_cart_list"))})}
e.preventDefault()});$(document).on("keyup",".product_quantity_input",function(e){var This=$(this)
Qty=This.val(),MinQuantity=This.parents('#form_add_to_cart').find("[name^='MinQuantity']");$minimum=(MinQuantity.length!==0?MinQuantity:1),ProDetail=Cart=!1;if($('#form_cart_list').length!==0){Cart=!0;var ThisItemRow=This.parents('.cart_tr'),ThisItem=ThisItemRow.attr('id'),ThisParentHidden=This.parents('body').find('div:hidden'),ThisHideForm=ThisParentHidden.find('#form_cart_update');ThisHideForm.find("[name^='cart_id']").val(ThisItem);MinQuantity=$('#form_cart_list').find("[name^='MinQuantity_"+ThisItem+"']").val();$minimum=(MinQuantity!==0?MinQuantity:1);if(Qty>=$minimum){Qty=Qty}else{Qty=$minimum}}
if(Cart){ThisHideForm.find("[name^='cart_qty']").val(Qty);ajaxCall(ThisHideForm,function(output){if(output.result=='success-update'){cartListHTML(output);toastr.success($("."+output.result).text())}else if(output.result=='failed-update'){toastr.error($("."+output.result).text())}else if(output.result=='failed-stock'){cartListHTML(output);toastr.error($("."+output.result).text())}else{}})}else{var ThisParentHidden=$(this).parents('body').find('div:hidden'),ThisHideForm=ThisParentHidden.find('#form_product_detail'),ThisHideFormCheck=ThisParentHidden.find('#form_cartListCheck'),ThisParent=$(this).parents('#form_add_to_cart'),ThisAddon=ThisParent.find("[name^='addon']").val(),ThisAddonQty=ThisParent.find("[name^='addon_quantity']");ProDetail=!0}
if(ProDetail){if(ThisHideForm.length!==0){ThisHideForm.find("[name^='selected_qty']").remove();var appendInput='';ThisQty=ThisParent.find("[name^='cart_quantity']");appendInput+='<input type="text" name="cart_quantity" class="cart_quantity"  value="'+ThisQty.val()+'">';ThisHideForm.append(appendInput);productDetail()}}
e.preventDefault()});$(document).on("keyup",".pop_product_quantity_input",function(e){var This=$(this)
Qty=This.val(),MinQuantity=This.parents('.form_add_to_cart').find("[name^='MinQuantity']");$minimum=(MinQuantity.length!==0?MinQuantity:1),ProDetail=Cart=!1;var ThisParent=This.parents('.form_add_to_cart'),ID=ThisParent.attr("id").split('_'),ThisParentHidden=This.parents('body'),ThisHideForm=ThisParentHidden.find("#de_"+ID[1]),ThisHideFormCheck=ThisParentHidden.find('#form_cartListCheck'),ThisAddon=ThisParent.find("[name^='addon']").val(),ThisAddonQty=ThisParent.find("[name^='addon_quantity']");ProDetail=!0;if(ThisHideForm.length!==0){ThisHideForm.find("[name^='selected_qty']").remove();var appendInput='';ThisQty=ThisParent.find("[name^='cart_quantity']");appendInput+='<input type="hidden" name="cart_quantity" class="cart_quantity"  value="'+ThisQty.val()+'">';ThisHideForm.append(appendInput);productDetailPopout(ID[1],'qty')}
e.preventDefault()});function addonQTY($button){var oldValue=$button.parent().find('.quantity').val();$button.parent().find('.incr-btn.normalbox[data-action="decrease"]').removeClass('inactive');if($button.data('action')=="increase"){var newVal=parseFloat(oldValue)+1}else{if(oldValue>0){var newVal=parseFloat(oldValue)-1}else{newVal=0;$button.addClass('inactive')}}
$button.parent().find('.quantity').val(newVal);var ThisParentHidden=$button.parents('body').find('div:hidden'),ThisHideForm=ThisParentHidden.find('#form_product_detail'),ThisHideFormCheck=ThisParentHidden.find('#form_cartListCheck'),ThisParent=$button.parents('#form_add_to_cart'),ThisAddon=ThisParent.find("[name^='addon']").val(),ThisAddonQty=ThisParent.find("[name^='addon_quantity']");if(ThisAddonQty!=''){var ThisTr=$button.parents('tr'),Find=ThisTr.find('.pro_addon');ThisHideForm.find("[name^='addon_quantity']").remove();var appendInput='';$.each(ThisAddonQty,function(k,v){if($button.attr("name")!=''&&this.value!=''){appendInput+='<input type="text" name="'+$(this).attr("name")+'" class="addon_quantity"  value="'+this.value+'">'}});ThisHideForm.append(appendInput);productDetail()}}
function popAddonQTY($button){var oldValue=$button.parent().find('.quantity').val();$button.parent().find('.incr-btn.popoutbox[data-action="decrease"]').removeClass('inactive');if($button.data('action')=="increase"){var newVal=parseFloat(oldValue)+1}else{if(oldValue>0){var newVal=parseFloat(oldValue)-1}else{newVal=0;$button.addClass('inactive')}}
$button.parent().find('.quantity').val(newVal);var ThisParent=$button.parents('.form_add_to_cart'),ThiID=ThisParent.attr('id').split('_'),ThisParentHidden=$button.parents('body'),ThisHideForm=ThisParentHidden.find('#de_'+ThiID[1]),ThisHideFormCheck=ThisParentHidden.find('#form_cartListCheck'),ThisAddon=ThisParent.find("[name^='addon']").val(),ThisAddonQty=ThisParent.find("[name^='addon_quantity']");if(ThisAddonQty!=''){var ThisTr=$button.parents('tr'),Find=ThisTr.find('.pro_addon');ThisHideForm.find("[name^='addon_quantity']").remove();var appendInput='';$.each(ThisAddonQty,function(k,v){if($button.attr("name")!=''&&this.value!=''){appendInput+='<input type="hidden" name="'+$(this).attr("name")+'" class="addon_quantity"  value="'+this.value+'">'}});ThisHideForm.append(appendInput);productDetailPopout(ThiID[1])}}
$(document).on("keyup",".addon_quantity",function(e){var $button=$(this);addonQTY($button);e.preventDefault()});$(document).on("keyup",".pop_addon_quantity",function(e){var $button=$(this);popAddonQTY($button);e.preventDefault()});$(document).on("click",".incr-btn.popoutbox",function(e){var $button=$(this);popAddonQTY($button);e.preventDefault()});$(document).on("click",".incr-btn.normalbox",function(e){var $button=$(this);addonQTY($button);e.preventDefault()});$(document).on("click","#addToCartButton",function(e){var cartlist=$(this).parents('body').find('#form_cartListCheck'),cartremove='',This=($(this).parents('#form_add_to_cart').length!==0?$(this).parents('#form_add_to_cart'):$(this).parents('.form_add_to_cart')),inputCartRem=This.find("[name^='cartremove']"),foo=checkField(This);if(foo){ajaxCall(cartlist,function(output){if(output.list.locat=='remove'){if(confirm("Your current location is different from current cart, Are you sure want to continue? if yes some of your item well be removed.")){inputCartRem.remove();cartremove=cartRemoveList(output.list.locat_remove);addToCart(This,cartremove)}}else if(output.list.sele_time=='remove'){if(confirm("Your current selected time date is different from current cart, Are you sure want to continue? if yes some of your item well be removed.")){inputCartRem.remove();cartremove=cartRemoveList(output.list.selec_remove);addToCart(This,cartremove)}}else if(output.list.checkItem=='remove'){alert("Sorry, some of your item is timeout, it will remove automatically.")
inputCartRem.remove();cartremove=cartRemoveList(output.list.check_remove);addToCart(This,cartremove)}else if(output.list.cus=='remove'){alert($l.ycpdm);inputCartRem.remove();cartremove=cartRemoveList(output.list.cus_remove);addToCart(This,cartremove)}else{addToCart(This,cartremove)}})}
e.preventDefault()});$(document).on("click",".cart_remove",function(e){if(confirm("Are you sure want to remove?")){var This=$(this),ThisItemRow=This.parents('.cart_tr'),ThisItem=ThisItemRow.attr('id'),ThisParentHidden=$(this).parents('body').find('div:hidden'),ThisHideForm=ThisParentHidden.find('#form_cart_remove');ThisHideForm.find("[name^='cart_id']").val(ThisItem);if(ThisItem!=''){appendLoad($("#form_cart_list"));ajaxCall(ThisHideForm,function(output){if(output.result=='success-remove'){if(checkValue(output.list.countCart)){$(".cart_count").text(output.list.countCart)}
cartListHTML(output);toastr.success($("."+output.result).text())}else if(output.result=='failed-remove'){toastr.error($("."+output.result).text())}else{alert('Opps! something when wrong')}
removeLoad($("#form_cart_list"))})}}
e.preventDefault()});$(document).on("change","#form_shipping",function(e){var This=$('#form_shipping')});$(document).on("click","#find_rest",function(e){var ThisForm=$('#form_findMerchant');ajaxCall(ThisForm,function(output){if(output.result=='success-list'){window.location.href=URL+'/merchant?r='+getUrlParam('r')}else if(output.result=='failed-no-nearby'){window.location.href=URL+'/find-merchant?r='+getUrlParam('r')}});e.preventDefault()});$(document).on("click",".find_rest2",function(e){var ThisParentHidden=$(this).parents('body').find('div:hidden'),ThisForm=ThisParentHidden.find('#form_getlatlng');ajaxCall(ThisForm,function(output){if(output.result=='success-area-only'||output.result=='success-mapping'){var AreaID=output.list.AreaID;if(checkValue(AreaID)){window.location.href=URL+'/home'}else{window.location.href=URL+'/location-nofound'}}else if(output.result=='failed-no-nearby'){window.location.href=URL+'/location-nofound'}});e.preventDefault()});$(document).on("click","#pac-input2",function(e){if($(this).is('[readonly]')){$(this).prop("disabled",!1);$("#gAddress").show()}
e.preventDefault()});$(document).on("click","#my_new_location",function(e){$("#gAddress, #pac-input2").hide();$("#pac-input").show();$('#pac-input').attr('readonly',!1);$("#pac-input").focus()});$(document).on("click","#map",function(e){$("#gAddress").hide()});$(document).on("click","#find_rest_radius",function(e){var ThisForm=$('#form_findMerchant_radius'),Dis=$("#custom_distance").val();ThisForm.find("#distance").val(Dis);ajaxCall(ThisForm,function(output){if(output.result=='success-list'){window.location.href=URL+'/merchant-nearby?r='+getUrlParam('r')+'&d='+Dis}else if(output.result=='failed-no-nearby'){window.location.href=URL+'/find-merchant-nearby?r='+getUrlParam('r')+'&d='+Dis}});e.preventDefault()});$(document).on("click","#find_nearest",function(e){var ThisForm=$('#form_nearest');ajaxCall(ThisForm,function(output){if(output.result=='success-list'){toastr.success($("."+output.result).text());window.location.href=URL+'/merchant?r='+getUrlParam('r')}else if(output.result=='failed-no-nearby'){toastr.error($("."+output.result).text());window.location.href=URL+'/map?r='+getUrlParam('r')}});e.preventDefault()});$(document).on("click","#carttoshipping",function(e){var ThisParentHidden=$(this).parents('body').find('div:hidden'),ThisForm=ThisParentHidden.find('#form_cart_min');var remarkBox=$(".crtextarea");if(remarkBox.length!==0){$.each(remarkBox,function(x,y){var Parents=$(this).parents(".tr_remark");cartRemark(Parents)});ajaxCall(ThisForm,function(output){if(output.result=='success-cart-min'){window.location.href=URL+'/shipping'}else if(output.result=="failed-minorder"){toastr.error(output.list.message)}else{toastr.error($(".failed-check-minorder").text())}})}
e.preventDefault()});$('#comment_form').submit(function(e){lockUnlockInput('lock');$('#comment_input, #comment_email, #comment_success').hide();$('.comment_loading').show();var ThisForm=$('#comment_form'),Rat=ThisForm.find('.rating-input'),count=0,CommentLi=ThisForm.parents('body').find('.customer_comment > ul');var foo=checkField(ThisForm);if(foo){ajaxCall(ThisForm,function(output){var writeComment=output.content.writeComment,HTML='';if(writeComment.result=='success'){HTML=commentHTML(writeComment.list);CommentLi.append(HTML);toastr.success($("."+writeComment.result).text());setTimeout(function(){window.location.reload(1)},1000)}else if(writeComment.result=='failed_merchant'){toastr.error($("."+writeComment.result).text())}else if(writeComment.result=='failed_content'){toastr.error($("."+writeComment.result).text())}else if(writeComment.result=='failed_login'){toastr.error($("."+writeComment.result).text());window.location.href=URL+'/login?redirect='+output.redirect}
resetField(ThisForm)})}
lockUnlockInput();e.preventDefault()});$(document).on("change","#filter_side_bar, #filter_side_bar_des",function(e){var ThisForm=$(this),HTML='';appendLoad(ThisForm);ajaxCall(ThisForm,function(output){if(output.result=='success-list'||output.result=='failed-list'){var list=output.list;var htmlDate='';if(list.alldate!=null&&list.alldate!=undefined&&list.alldate!=''){var $count=1;$.each(list.alldate,function(x,y){htmlDate+=['<div class="custom-control custom-radio mb-2">','<input type="radio" id="radio-sort-'+$count+'" name="filter_date" class="custom-control-input " value="'+x+'" '+(list.filter_date==x?'checked':'')+'>','<label class="custom-control-label" for="radio-sort-'+$count+'">'+y+'</label>','</div>',].join('');$count++})}
$('.filter_date').html(htmlDate);var htmlTime='';if(list.alltime!=null&&list.alltime!=undefined&&list.alltime!=''){var $count=1;$.each(list.alltime,function(x,y){htmlTime+=['<div class="custom-control custom-radio mb-2">','<input type="radio" id="radio-offers-'+$count+'" name="filter_time" class="custom-control-input " value="'+x+'" '+(list.filter_time==x?'checked':'')+'>','<label class="custom-control-label" for="radio-offers-'+$count+'">'+y+'</label>','</div>',].join('');$count++})}
$('.filter_time').html(htmlTime);if(list.merchant!=''&&list.merchant!='null'){$.each(list.merchant,function(x,y){var $txt_DeliveryBy='';switch(y.DeliveryTime){case 'yes':$txt_DeliveryBy='Deliver By Merchant';break;case 'no':$txt_DeliveryBy='Deliver By Halo';break}
if(y.PublicDriver){$txt_DeliveryBy+=' / Public'}
HTML+=['<div class="col-md-4 col-6 col-item mb-3">','<a href="product?id='+y.CustomerID+'&name='+encodeURIComponent(y.Company)+'" class="product_href" >','<div class="card card-merchant">','<div class="image-box">','<img class="card-img-top" src="'+y.Logo+'" data-src-retina="'+y.Logo+'" src="'+y.Logo+'">','</div>','<div class="card-body">','<h5 class="font-weight-bold">'+y.Company+' <div class="ratingbox"><ul>'+ratingCommentInput('Satisfaction','satisfaction',y.Rating,y.CustomerID,'view')+'</ul></div></h5>','<span class="text-success d-block"></span>','<span class="text-warning d-block mt-1"><i class="fa fa-fw fa-tag"></i> '+$txt_DeliveryBy+'</span>','<span class="text-warning d-block mt-1"><i class="fa fa-fw fa-tag"></i> RM'+y.MinAmount+' Min.</span>','<span class="text-warning d-block mt-1"><i class="fa fa-fw fa-tag"></i> RM'+y.DeliveryFee+' DeliveryFee.</span>','<span class="text-warning d-block mt-1"><i class="fa fa-fw fa-tag"></i> '+y.LastTimeDay_txt+'</span>','</div>','</div>','</a>','</div>',].join('')})}}else{HTML=['<li>Merchant No found</li>']}
$('.item_box').html(HTML).hide().fadeIn(300);removeLoad(ThisForm)})});$(document).on("click","#confirm-order",function(e){var ThisForm=$(".shipbox"),offset=-200;checked=ThisForm.find(".default_address");if(checked.val()>0){window.location.href=URL+'/confirm-order'}else{checkField(ThisForm);toastr.error($('.failed-address').text());$('html, body').animate({scrollTop:$('.failed-field').offset().top+offset},1000)}
e.preventDefault()});$(document).on("click","#molpay_checkout",function(e){var ThisForm=$("#form_payment_molpay");ajaxCall(ThisForm,function(output){toastr.error($('.'+output.result).text());if(output.result=='success'){if(output.list.PaymentMethod=='molpay'&&output.list!=''){window.location.href=output.list.redir}}});e.preventDefault()});$(document).on("click","#halo_wallet",function(e){var ThisForm=$("#form_payment_halo_wallet");ajaxCall(ThisForm,function(output){$('.'+output.result).show(0).delay(3000).hide(0);if(output.result=='success'){if(output.list.wallet.result=='success'){window.location.href=URL+'/orderview?oid='+output.list.wallet.oid}}});e.preventDefault()});$(document).on("submit","#form_payment",function(e){var ThisForm=$("#form_payment"),foo=!1;if(confirm("Are you sure you want to checkout?")){ajaxCall(ThisForm,function(output){if(output.result=='success'){toastr.success($("."+output.result).text());if((output.list.cod!=''&&output.list.cod!=null)&&output.list.cod.result=='success'){window.location.href=URL+'/orderview?oid='+output.list.cod.oid}else if((output.list.PaymentMethod=='molpay')&&output.list!=''){window.location.href=output.list.redir}else if((output.list.PaymentMethod=='paydibs')&&output.list!=''){if(checkValue(output.list.PaydibsURL)&&checkValue(output.list.Parameter)){redirectPost(output.list.PaydibsURL,output.list.Parameter)}}else if(output.list.wallet.result=='success'){window.location.href=URL+'/orderview?oid='+output.list.wallet.oid}}else if(output.result=='failed_wallet'){toastr.error($("."+output.result).text());setTimeout(function(){window.location.href=URL+'/wallet-deno'},1500)}else if(output.result=='failed_wallet_limit'){toastr.error($("."+output.result).text())}else if(output.result=='failed_stock'||output.result=='failed_minorder'){toastr.error(output.list.msg)}else{toastr.error($("."+output.result).text())}})}
e.preventDefault()});$(document).on("click",'.addtowishlist',function(e){var fa=$(this).find('#fa_love'),ThisParentHidden=$(this).parents('#popout_pro_append'),ThisForm=ThisParentHidden.find('#form_addtowishlist'),current=$(this),wishlisted_1=$('#wishlist_product_hidden_1').text(),wishlisted_2=$('#wishlist_product_hidden_2').text(),addtowishlist=current.attr('id');ajaxCall(ThisForm,function(output){var list=output.list,result=output.result;if(result=='success'){if(list.wishlist_status==0){fa.attr('class','fa fa-heart');toastr.success($(".success_wishlist").text())}else if(list.wishlist_status==1){fa.attr('class','fa fa-heart-o');toastr.success($(".remove_wishlist").text())}else{alert("Sorry, server error, please try again!")}}else if(result=='failed-login'){toastr.error($("."+output.result).text());window.location.href=URL+'/login?redirect='+output.redirect}});e.preventDefault()});function cartRemark(Parents){var remark=Parents.find("[name^='remark']").val(),hidden_remark=Parents.find("[name^='hidden_remark']").val(),cart_id=Parents.find("[name^='cart_item']").val()
form={type:'cart',action:'cart_remark',remark:remark,cart_id:cart_id};appendLoad(Parents.find(".lazy_btn"));if((remark!=hidden_remark)){appendLoad($("#form_cart_list"));ajaxCallJSON(form,function(output){if(output.result=='success_remark'){toastr.success($("."+output.result).text())}else{toastr.error($("."+output.result).text())}
removeLoad($("#form_cart_list"))})}
removeLoad(Parents.find(".lazy_btn"))}
$(document).on("click",".cart_remark_edit, .cart_remark_btn",function(e){var Parents=$(this).parents(".tr_remark");cartRemark(Parents);e.preventDefault()});$(document).focusout(".crtextarea",function(e){var remarkBox=$(".crtextarea");if(remarkBox.length!==0){$.each(remarkBox,function(x,y){var Parents=$(this).parents(".tr_remark");cartRemark(Parents)})}
e.preventDefault()});$(document).on("click",".product_href",function(e){var thisHref=$(this).attr('href');location.reload();window.location.href=thisHref;e.preventDefault()});$(document).on("click",".shipping_delete",function(e){var thisAddress=$(this).attr('data-address'),thisMember=$(this).attr('data-member');if(confirm("Are you sure you want to delete?")){$.ajax({type:'POST',url:'../Requires/ajax_remove_address.php',data:{'AddressID':thisAddress,'MemberID':thisMember},dataType:'json',success:function(data){if(data.result=='success-update'){var numShipping=$('.shipping_relative').length;numShipping=numShipping-1;if(numShipping<3){$("#shipping_address_new").show()}
$(".success-remove-addr").show(0).delay(3000).hide(0);$("#remove_address_"+thisAddress).hide()}}})}
e.preventDefault()});$(document).on("click","#map_skip, #map_ok",function(e){var ThisForm=($(this).parents('#form_delivery_to').length!==0?$(this).parents('#form_delivery_to'):$(this).parents('.form_delivery_to')),faa='';appendLoad(ThisForm.find("#map_skip, #map_ok"));faa=checkField($('#form_delivery_to'));if(faa){ajaxCall(ThisForm,function(output){var ThisForm2=$('#form_findMerchant');ajaxCall(ThisForm2,function(output){if(output.result=='success-list'){window.location.href=URL+'/merchant'}else if(output.result=='failed-no-nearby'){window.location.href=URL+'/location-nofound'}
removeLoad(ThisForm.find("#map_skip, #map_ok"))})})}else{removeLoad(ThisForm.find("#map_skip, #map_ok"))}
e.preventDefault()});$(document).on("click","#map_prev",function(e){var ThisForm2=$('#form_findMerchant');ajaxCall(ThisForm2,function(output){if(output.result=='success-list'){window.location.href=URL+'/home'}else if(output.result=='failed-no-nearby'){window.location.href=URL+'/location-nofound'}
removeLoad(ThisForm.find("#map_skip, #map_ok"))});e.preventDefault()});$(document).on("click","#pac-input",function(e){$(this).val('');e.preventDefault()});$(document).on("click","#confirm-map",function(e){var z=$.Event("keypress",{which:13});$('#pac-input').trigger(z);var input=document.getElementById('pac-input');google.maps.event.trigger(input,"focus",{});google.maps.event.trigger(input,'keydown',{keyCode:13});e.preventDefault()});$(document).on('click','.ajax_box_close, .ajax_update_status_bg',function(e){$('.ajax_update_status_box').hide();$('.ajax_update_status_box2').hide();e.preventDefault()});$(document).on("change","#addr_selcet",function(e){var AddressID=$(this).val(),Name=$('option:selected',this).attr('name'),Address=$('option:selected',this).attr('address'),Address2=$('option:selected',this).attr('address2'),Lat=$('option:selected',this).attr('lat'),Lng=$('option:selected',this).attr('lng'),ThisParent=$(this).parents(".form_delivery_to");ThisParent.find("#NeW_name").val(Name);ThisParent.find("#NeW_address").val(Address);ThisParent.find("#NeW_address2").val(Address2);ThisParent.find("#NeW_Lat").val(Lat);ThisParent.find("#NeW_Lng").val(Lng);e.preventDefault()});$(document).on("change","#pac-input",function(e){var Address=$(this).val(),ThisParentHidden=$(this).parents('body').find('div:hidden'),ThisParent=ThisParentHidden.find("#form_delivery_to");ThisParent.find("#NeW_address2").val(Address);e.preventDefault()});$(document).on("keypress","#pac-input",function(e){if(e.which==13){$(".ajax_update_status_box ").show()}})});$(document).ready(function(){class StickyNavigation{constructor(){this.currentId=null;this.currentTab=null;this.tabContainerHeight=70;let self=this;$('.et-hero-tab').click(function(){self.onTabClick(event,$(this))});$(window).scroll(()=>{this.onScroll()});$(window).resize(()=>{this.onResize()})}
onTabClick(event,element){event.preventDefault();let scrollTop2=$(element.attr('href')).offset().top-this.tabContainerHeight+1;$('html, body').animate({scrollTop:scrollTop2},600)}
onScroll(){this.checkTabContainerPosition();this.findCurrentTabSelector()}
onResize(){if(this.currentId){this.setSliderCss()}}
checkTabContainerPosition(){let offset=$('.et-hero-tabs').offset().top+$('.et-hero-tabs').height()-this.tabContainerHeight;if($(window).scrollTop()>offset){$('.et-hero-tabs-container').addClass('et-hero-tabs-container--top')}
else{$('.et-hero-tabs-container').removeClass('et-hero-tabs-container--top')}}
findCurrentTabSelector(element){let newCurrentId;let newCurrentTab;let self=this;$('.et-hero-tab').each(function(){let id=$(this).attr('href');let offsetTop=$(id).offset().top-self.tabContainerHeight;let offsetBottom=$(id).offset().top+$(id).height()-self.tabContainerHeight;if($(window).scrollTop()>offsetTop&&$(window).scrollTop()<offsetBottom){newCurrentId=id;newCurrentTab=$(this)}});if(this.currentId!=newCurrentId||this.currentId===null){this.currentId=newCurrentId;this.currentTab=newCurrentTab;this.setSliderCss()}}
setSliderCss(){let width=0;let left=0;if(this.currentTab){width=this.currentTab.css('width');left=this.currentTab.offset().left}
$('.et-hero-tab-slider').css('width',width);$('.et-hero-tab-slider').css('left',left)}}
if($('.et-hero-tab').length!==0){new StickyNavigation()}
$('.slider-nav').slick({slidesToShow:3,slidesToScroll:1,dots:!1,centerMode:!1,focusOnSelect:!0,prevArrow:'<a href="#" class="prev_cust_arr"><i class="fa fa-angle-left arrow_i" aria-hidden="true"></i></a>',nextArrow:'<a href="#" class="next_cust_arr"><i class="fa fa-angle-right arrow_i" aria-hidden="true"></i></a>',infinite:!1,responsive:[{breakpoint:768,settings:{centerPadding:'40px',slidesToShow:2}},{breakpoint:480,settings:{centerPadding:'40px',slidesToShow:1}}]});$(document).on('change','#select_shipping',function(e){var thisKey=$(this),thisVal=thisKey.val();$.ajax({type:'POST',url:URL+'/cms/Request/submit.php',data:{'data':'AddressID='+thisVal+'&type=cart&action=shipping_address_list'},dataType:'json',success:function(data){var list=data.list,result=data.result,output=list.list.address_data,This=$('#form_shipping');if(result=='success-selection'){var ThisForm=This.parents('body').find('#form_shipping');ThisForm.find('#email').val(output.Email);ThisForm.find('#name').val(output.Name);ThisForm.find('#address').val(output.Address);ThisForm.find('#postcode').val(output.Postcode);ThisForm.find('#city').val(output.City);ThisForm.find('#state').val(output.State);ThisForm.find('#AddressID').val(output.AddressID)}else{var ThisForm=This.parents('body').find('#form_shipping');ThisForm.find('#email').val('');ThisForm.find('#name').val('');ThisForm.find('#address').val('');ThisForm.find('#postcode').val('');ThisForm.find('#city').val('');ThisForm.find('#state').val('');ThisForm.find('#AddressID').val('')}}});e.preventDefault()});$('#new_shipping_button').click(function(e){var ThisHideForm=$('#form_new_shipping');ajaxCall(ThisHideForm,function(data){if(data.result=='success-insert')
{window.location.href=CurrentURL}
else if(data.result=='failed-insert')
{toastr.error($(".failed-insert").text())}});e.preventDefault()});var options={url:function(phrase){return URL+"/ezSearch"},getValue:function(element){removeLoad($(".easy-autocomplete"));return element.text},ajaxSettings:{dataType:"json",method:"POST",data:{dataType:"json"}},preparePostData:function(data){appendLoad($(".easy-autocomplete"));data.phrase=$("#ezsearch").val();data.Lat=$("#ezsearch").data("lat");data.Lng=$("#ezsearch").data("lng");return data},template:{type:"custom",method:function(value,item){return "<a href='"+item.url+"'><img src='cms/"+(item.Image)+"' / style='width:80px;margin-right:5px;'>"+value+"</a>"}},list:{maxNumberOfElements:10},requestDelay:400};var options2={url:function(phrase){return URL+"/ezSearch"},getValue:function(element){removeLoad($(".easy-autocomplete"));return element.text},ajaxSettings:{dataType:"json",method:"POST",data:{dataType:"json"}},preparePostData:function(data){appendLoad($(".easy-autocomplete"));data.phrase=$("#ezsearch2").val();data.Lat=$("#ezsearch2").data("Lat");data.Lng=$("#ezsearch2").data("Lng");return data},template:{type:"custom",method:function(value,item){return "<a href='"+item.url+"'><img src='cms/"+(item.Image)+"' class='c_img_search'/><span class='c_text_search'>"+value+"</span></a>"}},list:{maxNumberOfElements:10},requestDelay:400};$("#ezsearch").easyAutocomplete(options);$("#ezsearch2").easyAutocomplete(options2)})