function ShowCart(){$("span#lblTotalPrice").text()=="$0.00"?($("div.orderplaced").hide(),$("div.noorderplaced").show(),$("div.order-information").css("min-height","auto")):($("div.noorderplaced").hide(),$("div.orderplaced").show(),$("div.order-information").css("min-height","auto"))}function SessionExpiryPopUp(){$.ajax({type:"POST",url:"/services/admin/PreOrder.asmx/PreOrderSessionExpiry",contentType:"application/json; charset=utf-8",data:"{cartSessionCookie: '"+GetCartSessionCookieValue()+"' }",timeout:1e4,dataType:"json",async:!1,success:function(n){n.d!=null&&($(n.d).modal(),document.cookie="PreCartId=; expires=Thu, 01 Jan 1970 00:00:01 GMT;path=/ ",setTimeout(function(){$("#simplemodal-container").attr("tabindex",-1).focus()},100))},error:function(){}})}function readCookie(n){for(var r=n+"=",u=document.cookie.split(";"),t,i=0;i<u.length;i++){for(t=u[i];t.charAt(0)==" ";)t=t.substring(1,t.length);if(t.indexOf(r)==0)return t.substring(r.length,t.length)}return null}function checkData(n,t){t.IsValid=!1;var i=document.getElementById("txtEmailAddress").value,r=document.getElementById("txtConfirmEmail").value;i.toUpperCase()==r.toUpperCase()&&(t.IsValid=!0)}function disableSearchBtn(n){var t="#btnSearch";n?$(t).removeAttr("disabled"):$(t).attr("disabled",!0)}function modalwithID(){return $("#confirmtxt").text("Are you sure you want to cancel your Christmas Pre- order(order ID:"+$("#txtConfirmationNo").val()+")?"),$("#basic-modal-content").modal(),!1}function validateEmail(n){var t=/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;return t.test(n)?!0:!1}function pagedisable(){MetaTitle=="Edit your Pre-order"&&($("#txtConfirmationNo").val().length>0&&$("#txtEmailAddress").val().length>0?$("#btnServerSubmit").prop("disabled",!1):$("#btnServerSubmit").prop("disabled",!0)),MetaTitle=="Forgotten your pre-order ID?"&&($("#txtFamilyName").val().length>0&&$("#txtEmailAddress").val().length>0?$("#btnServerSubmit").prop("disabled",!1):$("#btnServerSubmit").prop("disabled",!0)),MetaTitle=="CancelPreorder"&&($("#txtConfirmationNo").val().length>0&&$("#txtEmailAddress").val().length>0?$("#btnSubmit").prop("disabled",!1):$("#btnSubmit").prop("disabled",!0))}function validateSearch(){var n=!0;$("#searchTextPreOrder").val()==""&&(n=!1),disableSearchBtn(n)}function selectStore(n){var r=n.value,t=r.split("|");$("#hfStoreId").val(t[0]);var u=t[3].replace(/ /g,"-")+"-"+t[0],f="http://www.coles.com.au/store-locator/stores/"+t[4].toLowerCase()+"/"+u,i="<p class='heading'>"+t[1]+"<\/p>";i+="<p class='store-address-pre-order'>"+t[2]+","+t[3]+", "+t[4]+"  "+t[5]+"<\/br>",i+="Phone: "+t[6]+"<\/p>",i+="<a class='view-map' target='_blank' href='"+f+"'>View map and store opening hours<\/a><div class='clear'><\/div>",i+="<a href='#' role='button' onclick='changeStore();return false;'>Change Store<\/a>",document.getElementById("beforeSelection").style.display="none",document.getElementById("afterSelection").innerHTML=i,document.getElementById("afterSelection").style.display="block",$("#selectedStoretxt").text("Your selected store is:"),$("#afterSelection").attr("tabindex",-1).focus()}function changeStore(){$("#hfStoreId").val(""),$("#searchTextPreOrder").val(""),document.getElementById("afterSelection").innerHTML="",document.getElementById("afterSelection").style.display="none",document.getElementById("beforeSelection").style.display="block",document.getElementById("listHeading").innerHTML="",document.getElementById("storesList").innerHTML="",$(".simplePagerNav").empty(),$("#selectedStoretxt").text("Please enter the suburb or postcode of the store you wish to pick up your pre-order from and then select your store."),$("#searchText").focus()}function PrintElem(n){Popup($(n).html())}function Popup(n){var t=window.open("","_blank","height=600,width=800"),i;t.document.write('<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>Christmas Preo-order<\/title>'),t.document.write('<link href="/assets/coles/css/site.css" media="all" rel="stylesheet" type="text/css" /> <link rel="stylesheet" href="/assets/coles/css/xmas-pre-order-print.css" type="text/css" />'),t.document.write("<\/head><body>"),t.document.write(n),t.document.write("<\/body><\/html>"),i=function(){return Boolean(t.chrome)},i?(t.document.close(),t.focus(),t.print(),setTimeout(function(){t.close()},1e4)):(t.document.close(),t.focus(),t.print(),t.close())}var iPhone=!1,iPad=!1,orderPanel;rm={htmlbody:$("html, body"),init:function(){navigator.userAgent.toLowerCase().indexOf("ipad")!=-1&&$("body").addClass("ipad"),$(document).ready(function(){var t,i,r,n,u;$(".ie8").length&&(t=window.location.hash,t.length&&(ccoords=$(t).offset().top+-20,rm.htmlbody.scrollTop(ccoords))),$(".scLoadingIndication").length?(i="fade",r=!1):(i="slide",r=!0),$(".flexslider").length&&$(".flexslider").flexslider({animation:i,prevText:"&lsaquo;",nextText:"&rsaquo;",slideshowSpeed:5e3,slideshow:r,start:function(){$(".flex-direction-nav").first().appendTo(".carousel");var t=$(".flex-control-paging li"),n=t.length*t.outerWidth(!0)/2;$(".carousel .flex-control-paging").css({marginLeft:-n}),$("head").append('<style type="text/css">@media only screen and (max-width: 767px) {.carousel > .flex-direction-nav a.flex-prev { margin-left: '+(-n-20)+"px; }.carousel > .flex-direction-nav a.flex-next { margin-left: "+(n+8)+"px; }}<\/style>")}}),rm.setScrollLinks(),$("#storeMap1").length&&rm.mapData(),$.extend($.easing,{easeInBack:function(n,t,i,r,u,f){return f==undefined&&(f=1.70158),r*(t/=u)*t*((f+1)*t-f)+i},easeOutBack:function(n,t,i,r,u,f){return f==undefined&&(f=1.70158),r*((t=t/u-1)*t*((f+1)*t+f)+1)+i}}),typeof gigya!="undefined"&&(n=new gigya.socialize.UserAction,n.setUserMessage("This is the user message"),n.setTitle(document.title),n.setSubtitle("Subtitle"),n.setLinkBack($(location).attr("href")),n.setDescription($("meta[name=description]").attr("content")),n.addMediaItem({type:"image",src:"http://www.coles.com.au/assets/coles/images/elements/gigya-logo.png"}),u={containerID:"share-button",shareButtons:[{provider:"Share",iconImgUp:"http://www.coles.com.au/assets/coles/images/btn_share-button.png"}],iconsOnly:"true",showCounts:"none",showEmailButton:!0,userAction:n},gigya.socialize.showShareBarUI(u))})},setScrollLinks:function(){var n=rm.htmlbody.find("[data-scroll='true']");n.on("touchstart click",function(n){n.preventDefault(),coords=$(this).data("state")!=null?$(".states").find("h2."+$(this).data("state")).offset().top+-20:0,rm.htmlbody.animate({scrollTop:coords},"slow")})},sectionShow:function(){$(".in-this-section .button-secondary").on("touchstart click",function(n){$(".module-content").slideToggle(),$(this).text($(this).text()=="Show"?"Collapse":"Show"),$(this).parents(".in-this-section").toggleClass("closed"),n.preventDefault()})},headerElementShow:function(){$("header .search-popup a").on("touchstart click",function(n){n.preventDefault(),$(".search").slideToggle(),$(this).parents(".search-popup").toggleClass("open")})},mobileNav:function(){$(".nav-popup").on("touchstart click",function(n){n.preventDefault(),$("nav.mega-nav").toggleClass("open")})},equalHeights:function(){$(".products-listing.requires-equal-heights").imagesLoaded(function(){$(".requires-equal-heights").each(function(){var n=0;$(".height-content",this).each(function(){$(this).height()>n&&(n=$(this).height())}),$(".height-content",this).height(n+10)})})},accordionInit:function(){var i=$(".accordion-item").length,t,n=$(".accordion-control-all");$(".accordion-item").each(function(){var r=$(this),f=r.find(".button-secondary"),u=r.find(".accordion-content");($(".default-open").length<1&&r.index(".accordion-item")!==0||$(".default-open").length>=1&&!r.hasClass("default-open"))&&(f.text("+").attr("title","Expand"),r.addClass("closed"),u.height(0));r.find(".accordion-trigger").on("touchstart click",function(e){r.hasClass("closed")?(f.text("-").attr("title","Collapse"),r.removeClass("closed"),u.stop().animate({height:r.find(".accordion-content-inner").outerHeight(!0)},250,function(){u.css({height:"auto"})})):(f.text("+").attr("title","Expand"),r.addClass("closed"),u.stop().animate({height:0},150)),t=$(".accordion-item.closed").length,t===0?n.text("Collapse All").attr("title","Collapse All"):t===i&&n.text("Expand All").attr("title","Expand All"),e.preventDefault()})});n.on("touchstart click",function(t){$(this).text().toLowerCase().indexOf("expand all")!=-1?(n.text("Collapse All").attr("title","Collapse All"),$(".accordion-item.closed").find(".accordion-trigger").trigger("click")):(n.text("Expand All").attr("title","Expand All"),$(".accordion-item").not(".closed").find(".accordion-trigger").trigger("click")),t.preventDefault()})},adjustMegaMenuBorders:function(){var i={".catalogue-specials":[1,2],".location-hours":[1],".shop-online":[2],".our-range":[1,2],".hag":[1,2,3]},e=55,o='<div class="menu-section-border"><\/div>',u,f,t,n,r;for(t in i)if(i.hasOwnProperty(t))for(n=$(t),n.addClass("cbp-hropen-temp"),u=n.find(".cbp-hrsub").outerHeight(!0),f=n.find(".column").first().outerHeight(!0)||0,n.removeClass("cbp-hropen-temp"),r=0;r<i[t].length;r++)n.find(".columns").eq(i[t][r]).append(o).height(u-f-e)},googleMapsInit:function(n){function r(){var i=n[0],f={zoom:zoomLevel,center:new google.maps.LatLng(i.Latitude,i.Longitude),mapTypeId:google.maps.MapTypeId.ROADMAP},e=document.getElementById("storeMap"),r=new google.maps.Map(e,f);google.maps.event.addListener(r,"click",function(){t.close()}),u(r,n)}function u(n,t){for(var r,i=0;i<t.length;i++)r=t[i],f(n,r,i)}function f(n,r,u){for(var h=new google.maps.LatLng(r.Latitude,r.Longitude),f="<div class='row gmarker'><div class='small-12 large-12'><h3>"+r.Title+"<\/h3><p><strong>Address: <\/strong>"+r.Address+"<\/p><p><strong>Phone: <\/strong>"+r.Phone+"<\/p><ul>",o,s,e=0;e<r.Hours.length;e++)f+="<li>"+r.Hours[e]+"<\/li>";f+="<\/ul>",markerImage=u==0?"/assets/coles/images/elements/marker.png":r.BrandId==6?"/assets/coles/images/elements/marker-bilo.png":"/assets/coles/images/elements/marker-grey.png",o=new google.maps.Marker({map:n,title:r.Title,position:h,animation:google.maps.Animation.DROP,shadow:"/assets/coles/images/elements/marker-shadow.png",icon:markerImage}),google.maps.event.addListener(o,"click",function(){$.ajax({type:"POST",url:"/services/admin/storelocator.asmx/GetMapOpeninghoursExceptions",contentType:"application/json; charset=utf-8",data:"{ storeID: '"+r.Id+"' }",timeout:1e4,dataType:"json",success:function(i){var u,e;if(i.d.length>0)for(f+="<p><strong>Season trading hours<\/strong><\/p>",u=0;u<i.d.length;u++)f+="<table><thead><tr><th colspan='3'>"+i.d[u].Reason+"<\/th><\/tr><\/thead><tbody><tr>",i.d[u].Day!=""&&(f+="<td><strong>"+i.d[u].Day+"<\/strong><\/td>"),i.d[u].Date!=""&&(f+="<td>"+i.d[u].Date+"<\/td>"),i.d[u].Details!=""&&(f+="<td>"+i.d[u].Details+"<\/td>"),f+="<\/tr><\/tbody><\/table>";for(f+="<p><a href='"+r.StoreLink+"' class='button-secondary'>More information<\/a><\/p>",f+="<\/div><\/div>",t.setContent(f),t.open(n,o),f="<div class='row gmarker'><div class='small-12 large-12'><h3>"+r.Title+"<\/h3><p><strong>Address: <\/strong>"+r.Address+"<\/p><p><strong>Phone: <\/strong>"+r.Phone+"<\/p><ul>",e=0;e<r.Hours.length;e++)f+="<li>"+r.Hours[e]+"<\/li>";f+="<\/ul>"},error:function(){}})}),s=new google.maps.LatLng(r.Latitude,r.Longitude),i.extend(s)}var e=n.length,i=new google.maps.LatLngBounds,t=new google.maps.InfoWindow({});Modernizr.touch&&$(document.activeElement).blur(),r()},mapData:function(){rm.googleMapsInit(storeMapInfoList)}},$.rmPlaceHolders=function(){"placeholder"in document.createElement("input")||$("input[placeholder]").each(function(){var n=$(this),t=n.attr("placeholder");n.val(t).addClass("rmPrompt");n.on("focus",function(){$(this).val()==t&&$(this).val("").removeClass("rmPrompt")});n.on("blur",function(){$(this).val()==""&&$(this).val(t).addClass("rmPrompt")})})},$(function(){rm.init(),$.rmPlaceHolders(),cbpHorizontalMenu.init(),rm.accordionInit(),rm.sectionShow(),rm.headerElementShow(),rm.mobileNav(),rm.adjustMegaMenuBorders(),rm.equalHeights()});var PreorderPage="",setTimer="",cookieExpireTime=36e5,currentNo=0,dropval=1,expiryMessage='<div id="basic-modal-content-session"><h3>TEST MESSAGE==>The webpage has timed out<\/h3><p>For security reasons the webpage has timed out<\/p>';expiryMessage+='<p>Please return to the Christmas Pre-order home page to start again.<\/p><div class="row">',expiryMessage+='<button id="okClick" value="OK" onclick="window.location.href=\'/pre-order\';" class="modalCloseImg simplemodal-close button-secondary">Return to Pre-order Home page<\/button><\/div><\/div>',$(document).ready(function(){var i,u,n;/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)?$("#hlPreorderCCNo").show():$("#lblPreorderCCNo").show(),$("div.categoryMenu ul").each(function(){$(this).find("li").each(function(n){$(this).find("a").addClass("notCurrent"+(n+1))})});var t=window.location.href,r=t.substring(t.lastIndexOf("/")+1),f=r.length;f>0?r!="pre-order"&&$("div.categoryMenu ul li").find("a.notCurrent1").removeClass("selected"):(i=t.split("/"),u=i[i.length-2],u!="pre-order"&&$("div.categoryMenu ul li").find("a.notCurrent1").removeClass("selected")),n=readCookie("InStoreOrder"),n!=null&&n.length>0&&n=="true"&&($("ul.breadcrumbs li").first().hide(),$("a[href='http://www.flybuys.com.au']").attr("href","#!")),readCookie("PreCartId")!=null&&(clearTimeout(setTimer),setTimer=setTimeout(function(){SessionExpiryPopUp()},cookieExpireTime))}),Sys.Application.add_load(ShowCart);$("select").on("change",function(){$(this).next().focus()});$("[id$='ddlistPhone']").change(function(){$("#txtPhoneNo").val(""),dropval=$(this).val(),$(this).val()=="1"&&$("#txtPhoneNo").val()!=""?Page_ClientValidate("PreOrderPhoneNumber"):$("#txtPhoneNo").val()!=""&&Page_ClientValidate("PreOrderHomeNumber"),$(this).val()=="1"?($("#txtPhoneNo").attr("placeholder","Enter mobile number e.g. 0400 000 000"),$("#txtPhoneNo").attr("title","Enter mobile number example 0 4 0 0 0 0 0 0 0 0"),$("[id$='smsNotify']").css("display","block"),$("#chkIsNotifyBySMS").css("display","inline-block"),Page_ClientValidate("PreOrderPhoneNumber")):$(this).val()=="2"?($("#txtPhoneNo").attr("placeholder","Enter home phone number e.g. 03 5544 2211"),$("#txtPhoneNo").attr("title","Enter home phone number example 0 3 5 5 4 4 2 2 1 1"),$("[id$='smsNotify']").css("display","none"),$("#chkIsNotifyBySMS").css("display","none"),Page_ClientValidate("PreOrderHomeNumber")):($("#txtPhoneNo").attr("placeholder","Enter work phone number e.g. 03 5544 2211"),$("#txtPhoneNo").attr("title","Enter work phone number example 0 3 5 5 4 4 2 2 1 1"),$("[id$='smsNotify']").css("display","none"),$("#chkIsNotifyBySMS").css("display","none"),Page_ClientValidate("PreOrderHomeNumber"))}),$("#txtPhoneNo").focusout(function(){dropval=="1"&&$("#txtPhoneNo").val()!=""?Page_ClientValidate("PreOrderPhoneNumber"):$("#txtPhoneNo").val()!=""&&Page_ClientValidate("PreOrderHomeNumber")}),$("img").each(function(){$(".absoluteImage").attr("alt",""),$(".details").attr("alt",""),$(".shadow-img").attr("alt","")}),$("button.addPreorder").click(function(){$("div.noorderplaced").hide(),$("div.orderplaced").show(),$("div.order-information").css("min-height","auto")}),$("button#addPreorder").click(function(){$("div.noorderplaced").hide(),$("div.orderplaced").show(),$("div.order-information").css("min-height","auto")}),jQuery.ajaxSetup({xhr:function(){try{if(window.ActiveXObject)return new window.ActiveXObject("Microsoft.XMLHTTP")}catch(n){}return new window.XMLHttpRequest}}),StoreMeta=$('meta[name="contenttype"]').attr("content"),MetaTitle=$('meta[name="title"]').attr("content"),PreorderPage=$('meta[name="subject"]').attr("content"),StoreMeta=="Product"&&$("#addPreorder").click(function(n){var t=$("#content_1_itemID").val(),i=$("#ProductQty option:selected").text();return n.preventDefault(),AddPreOrder(t,i,0),!1}),StoreMeta=="Category"&&$(".addPreorder").click(function(n){var t=$(this).parent().find("input").val(),i=$(this).parent().find("select :selected").val();return n.preventDefault(),$(this).blur(),AddPreOrder(t,i,0),!1}),MetaTitle=="Your details"&&($(".suggest_container").hide(),$("#searchText").each(function(){$(this).bind("focus",function(){toggleInputText(this,""),validateSearch()}),initSuggest(this,"ac_results"),$(".suggest_container").show()})),$(".preOrderItemCount").keypress(function(n){var r,i,t;return(currentNo=$(".preOrderItemCount").val(),r=n.which||n.keyCode,n.which!=8&&n.which!=0&&n.which!=13&&(n.which<47||n.which>57))?!1:n.which==13?(i=$(this).parent().parent().find(".itemID").val(),t=parseInt($(this).val()),isNaN(t)||t<=0)?(alert("Please enter valid number between 0 to 10"),$(this).focus(),!1):(PreorderCountChangeControl(this,t),AddPreOrder(i,t,1),!1):void 0});$(".preOrderItemCount").on("keyup",function(){var n=parseInt($(this).val());if(!isNaN(n)&&n>10)return $(this).val(currentNo),!1});$(".preOrderItemCount").each(function(){var t=parseInt($(this).val());t<=1?($(this).parent().find(".decreaseCount").addClass("disabled"),$(this).parent().find(".increaseCount").removeClass("disabled")):t>=10?($(this).parent().find(".decreaseCount").removeClass("disabled"),$(this).parent().find(".increaseCount").addClass("disabled")):($(this).parent().find(".decreaseCount").removeClass("disabled"),$(this).parent().find(".increaseCount").removeClass("disabled"))}),$(".increaseCount").click(function(n){var r=$(this).parent().parent().find(".itemID").val(),i=$(this).parent().find(".preOrderItemCount"),t=parseInt(i.val())+1;return(PreorderCountChangeControl(this,t),t>10)?!1:(i.val(t),n.preventDefault(),AddPreOrder(r,t,1),!1)}),$(".decreaseCount").click(function(n){var r=$(this).parent().parent().find(".itemID").val(),i=$(this).parent().find(".preOrderItemCount"),t=parseInt(i.val())-1;return(PreorderCountChangeControl(this,t),t<1)?!1:(i.val(t),n.preventDefault(),AddPreOrder(r,t,1),!1)}),$(".preOrderItemCount").focusout(function(){var i=$(this).parent().parent().find(".itemID").val(),t=parseInt($(this).val());if(isNaN(t)||t<=0){alert("Please enter valid number between 0 to 10"),$(this).focus();return}PreorderCountChangeControl(this,t),AddPreOrder(i,t,1)}),$(".removeItem").click(function(){var n=$(this).parent().parent().find(".itemID").val();RemovePreOrder(n),".tally-list".length==0&&($("input[type=button] .button-secondary").disabled=!0)}),PreorderCountChangeControl=function(n,t){t<=1?($(n).parent().find(".decreaseCount").addClass("disabled"),$(n).parent().find(".increaseCount").removeClass("disabled")):t>=10?($(n).parent().find(".increaseCount").addClass("disabled"),$(n).parent().find(".decreaseCount").removeClass("disabled")):($(n).parent().find(".decreaseCount").removeClass("disabled"),$(n).parent().find(".increaseCount").removeClass("disabled"))},SetTimeout=function(){clearTimeout(setTimer),setTimer=setTimeout(function(){SessionExpiryPopUp()},cookieExpireTime)},AddPreOrder=function(n,t,i){if(SetTimeout(),isNaN(t)||t>10||t<=0){alert("Please enter valid number between 0 to 10");return}$.ajax({type:"POST",url:"/services/admin/PreOrder.asmx/AddPreOrder",contentType:"application/json; charset=utf-8",data:"{cartSessionCookie: '"+GetCartSessionCookieValue()+"', itemID: '"+n+"',qty: '"+t+"',orderType: '"+i+"' }",timeout:1e4,dataType:"json",async:!1,success:function(n){if(n.d.ErrorMessage!=null)alert(n.d.ErrorMessage);else if(n.d.EstimatedPrice>0&&($(".totalPrice").text("$"+n.d.EstimatedPrice),n.d.TotalItems<=1?$(".totalItemCount").text(n.d.TotalItems+" item"):$(".totalItemCount").text(n.d.TotalItems+" items"),n.d.TotalMultiBuyItems>1?$("#multibuyText").text("Multi buy platter savings included in total"):$("#multibuyText").text(""),$(".reviewPreoderButton").removeAttr("disabled"),n.d.ProductQty>0)){var t=$("#"+n.d.ProductId);$(t).text(n.d.ProductQty+" in pre-order"),$("#"+n.d.ProductId).css("visibility","visible"),n.d.IsMultiBy||($("input[value='"+n.d.ProductId+"']").parent().find(".productPrice").text(n.d.ProductTotalPrice),$("input[value='"+n.d.ProductId+"']").parent().find(".productPrice").prev().prev("span").empty().text("Estimated price Approx. $"+n.d.ProductTotalPrice))}$(".preorderQtyList option[value='1']").attr("selected","selected")},error:function(){}})},RemovePreOrder=function(n){SetTimeout(),$.ajax({type:"POST",url:"/services/admin/PreOrder.asmx/RemovePreOrder",contentType:"application/json; charset=utf-8",data:"{cartSessionCookie:'"+GetCartSessionCookieValue()+"', itemID: '"+n+"' }",timeout:1e4,dataType:"json",async:!1,success:function(t){t.d.ErrorMessage!=null?alert(t.d.ErrorMessage):($(".totalPrice").text("$"+t.d.EstimatedPrice),$("input[value='"+n+"']").parent().remove(),t.d.TotalMultiBuyItems>1?$("#multibuyText").text("Multi buy platter savings included in total"):$("#multibuyText").text(""),t.d.TotalItems<=0?$("#btnPreOrderContinue").addClass("disabled"):$("#btnPreOrderContinue").removeClass("disabled"))},error:function(){}})},GetCartSessionCookieValue=function(){for(var i="PreCartId=",r="",u=document.cookie.split(";"),n,t=0;t<u.length;t++){for(n=u[t];n.charAt(0)==" ";)n=n.substring(1);n.indexOf(i)==0&&(r=n.substring(i.length,n.length))}return r},$("#btnPreOrderContinue").click(function(){return $(this).is(".disabled")?!1:!0}),$(".reviewPreoderButton").click(function(){if($("#lblTotalItems").text().trim()=="0 item")return!1}),$("#btnCancelPreOrder").click(function(){return $("#rfvPreorderId").is(":visible")||$("#revPreorderId").is(":visible")||$("#rfvEmailAddress").is(":visible")||$("#revEmailAddress").is(":visible")?($("#content_1_Errmsg1").text(""),!1):($("#content_1_SummaryMessage").css("display","none"),$("#confirmtxt").text("Are you sure you want to cancel your Christmas Pre- order(order ID:"+$("#txtConfirmationNo").val()+")?"),$("#basic-modal-content").modal(),!1)}),$("#hfStoreId").length&&$("#hfStoreId").val().length>0&&($("#beforeSelection").hide(),$("#afterSelection").show(),$("#selectedStoretxt").text("Your selected store is:")),$("#hfStoreId").length&&($("#hfStoreId").val().length>0&&($("html").hasClass("ie8")||$("html").hasClass("ie9"))||($("#txtFirstName").attr("placeholder","Enter your first name"),$("#txtFamilyName").attr("placeholder","Enter your surname"),$("#txtEmailAddress").attr("placeholder","Enter email address e.g. name@email.com"),$("#txtConfirmEmail").attr("placeholder","Enter email address to confirm "),$("#txtFlybuysNo").attr("placeholder","Enter 16 digit flybuys number"),$(".preOrderPhoneType").val()==1?($("#txtPhoneNo").attr("placeholder","Enter mobile number e.g. 0400 000 000"),$("#txtPhoneNo").attr("title","Enter mobile number example 0 4 0 0 0 0 0 0 0 0")):$(".preOrderPhoneType").val()==2?($("#txtPhoneNo").attr("placeholder","Enter home phone number e.g. 03 5544 2211"),$("#txtPhoneNo").attr("title","Enter home phone number example 0 3 5 5 4 4 2 2 1 1")):($("#txtPhoneNo").attr("placeholder","Enter work phone number e.g. 03 5544 2211"),$("#txtPhoneNo").attr("title","Enter work phone number example 0 3 5 5 4 4 2 2 1 1"))));$("#txtEmailAddress").on("input paste",function(){this.value=this.value.toLowerCase()});$("#txtConfirmEmail").on("input paste",function(){this.value=this.value.toLowerCase()});btnModalClick=function(){var t=$("#txtConfirmationNo").val(),i=$("#txtEmailAddress").val();t.length>0&&!isNaN(t)&&validateEmail(i)?$("#content_1_SummaryMessage").css("display","none"):($("#content_1_SummaryMessage").css("display","block"),$("#content_1_Errmsg1").css("display","none"))},btnModalClickL=function(){var t=$("#txtFamilyName").val(),i=$("#txtEmailAddress").val();t.length>0&&isNaN(t)&&validateEmail(i)?$("#content_1_SummaryMessage").css("display","none"):($("#content_1_SummaryMessage").css("display","block"),$("#content_1_Errmsg1").css("display","none"))},orderPanel={id:".order-information",pinned:!1,scrollTop:0,bannerBottom:370,width:0,left:0,paddingLeft:0,paddingRight:0,setup:function(){this.bannerBottom=$(".page-banner").position().top+$(".page-banner").outerHeight(!0),$(orderPanel.id).html()!=null&&($(this.id).css({"min-height":$(this.id).innerHeight()+"px"}),$(".categoryMenu").html()!=null&&$(".categoryMenu").offset().top<$(this.id).offset().top&&(this.bannerBottom+=$(".categoryMenu").height()),this.update())},startScrolling:function(){return this.scrollTop=$(window).scrollTop(),this.scrollTop>=this.bannerBottom},update:function(n,t){$orderInfo=$(this.id),this.paddingLeft=parseInt($orderInfo.css("paddingLeft"),10),this.paddingRight=parseInt($orderInfo.css("paddingRight"),10),this.left=n==undefined?$orderInfo.offset().left+this.paddingLeft:n,this.width=t==undefined?$orderInfo.innerWidth()-this.paddingLeft-this.paddingRight+"px":t,this.redraw()},redraw:function(){$(this.id+" div").css({left:this.left+"px",width:this.width})},align:function(){this.startScrolling()?this.pinned||(this.update(),this.pinned=!0,$(this.id+" div").addClass("pinned")):this.pinned&&(this.update(0,"auto"),this.pinned=!1,$(this.id+" div").removeClass("pinned"))}},$(function(){$(orderPanel.id).html()!=null&&orderPanel.setup()}),$(window).resize(function(){$(orderPanel.id).html()!=null&&orderPanel.setup()}),$(window).scroll(function(){$(orderPanel.id).html()!=null&&orderPanel.align()});$("body").on("touchmove",function(){$(orderPanel.id).html()!=null&&orderPanel.align()})