$(["requiredif","regularexpressionif","rangeif"]).each(function(n,t){$.validator.addMethod(t,function(n,t,i){var e="",o=t.name.lastIndexOf("."),s,u,r,h,f,c,l;if(o!=-1&&(e=t.name.substring(0,o+1).replace(".","_")),s="#"+e+i.dependentproperty,u=i.targetvalue,u=(u==null?"":u).toString(),r=$(s),r.length==0&&e.length>0?r=$("#"+i.dependentproperty):i.dependentproperty.length>0&&(r=$('input:radio[name="'+i.dependentproperty+'"]:checked')),r.length>0){h=r.attr("type");f="";switch(h){case"checkbox":f=r.attr("checked").toString();break;case"select":f=$("option:selected",r).text();break;default:f=r.val()}if(u.toLowerCase()===f.toLowerCase())return c=i.rule,l=i.ruleparam,$.validator.methods[c].call(this,n,t,l)}return!0});$.validator.unobtrusive.adapters.add(t,["dependentproperty","targetvalue","rule","ruleparam"],function(options){var rp=options.params.ruleparam;options.rules[t]={dependentproperty:options.params.dependentproperty,targetvalue:options.params.targetvalue,rule:options.params.rule};rp&&(options.rules[t].ruleparam=rp.charAt(0)=="["?eval(rp):rp);options.messages[t]=options.message})});$(function(){$.validator.addMethod("dynamicreqularexpression",function(n,t,i){var r=RegExp(i.pattern);return r.test(n)});$.validator.unobtrusive.adapters.add("dynamicreqularexpression",["pattern"],function(n){n.rules.dynamicreqularexpression={pattern:n.params.pattern};n.messages.dynamicreqularexpression=n.message})}($));!function(n){n.fn.viewportChecker=function(t){var i={classToAdd:"visible",classToRemove:"invisible",classToAddForFullView:"full-visible",removeClassAfterAnimation:!1,offset:100,repeat:!1,invertBottomOffset:!0,callbackFunction:function(){},scrollHorizontal:!1,scrollBox:window};n.extend(i,t);var u=this,r={height:n(i.scrollBox).height(),width:n(i.scrollBox).width()},f=window;return this.checkElements=function(){var t,e;i.scrollHorizontal?(t=n(f).scrollLeft(),e=t+r.width):(t=n(f).scrollTop(),e=t+r.height);u.each(function(){var u=n(this),f={},o={};if(u.data("vp-add-class")&&(o.classToAdd=u.data("vp-add-class")),u.data("vp-remove-class")&&(o.classToRemove=u.data("vp-remove-class")),u.data("vp-add-class-full-view")&&(o.classToAddForFullView=u.data("vp-add-class-full-view")),u.data("vp-keep-add-class")&&(o.removeClassAfterAnimation=u.data("vp-remove-after-animation")),u.data("vp-offset")&&(o.offset=u.data("vp-offset")),u.data("vp-repeat")&&(o.repeat=u.data("vp-repeat")),u.data("vp-scrollHorizontal")&&(o.scrollHorizontal=u.data("vp-scrollHorizontal")),u.data("vp-invertBottomOffset")&&(o.scrollHorizontal=u.data("vp-invertBottomOffset")),n.extend(f,i),n.extend(f,o),!u.data("vp-animated")||f.repeat){String(f.offset).indexOf("%")>0&&(f.offset=parseInt(f.offset)/100*r.height);var s=f.scrollHorizontal?u.offset().left:u.offset().top,l=f.scrollHorizontal?s+u.width():s+u.height(),h=Math.round(s)+f.offset,c=f.scrollHorizontal?h+u.width():h+u.height();f.invertBottomOffset&&(c-=2*f.offset);e>h&&c>t?(u.removeClass(f.classToRemove),u.addClass(f.classToAdd),f.callbackFunction(u,"add"),e>=l&&s>=t?u.addClass(f.classToAddForFullView):u.removeClass(f.classToAddForFullView),u.data("vp-animated",!0),f.removeClassAfterAnimation&&u.one("webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend",function(){u.removeClass(f.classToAdd)})):u.hasClass(f.classToAdd)&&f.repeat&&(u.removeClass(f.classToAdd+" "+f.classToAddForFullView),f.callbackFunction(u,"remove"),u.data("vp-animated",!1))}})},("ontouchstart"in window||"onmsgesturechange"in window)&&n(document).bind("touchmove MSPointerMove pointermove",this.checkElements),n(i.scrollBox).bind("load scroll",this.checkElements),n(window).resize(function(){r={height:n(i.scrollBox).height(),width:n(i.scrollBox).width()};u.checkElements()}),this.checkElements(),this}}(jQuery);!function(n){"use strict";"function"==typeof define&&define.amd?define(["jquery"],n):"undefined"!=typeof module&&module.exports?module.exports=n(require("jquery")):n(jQuery)}(function(n){var o=-1,r=-1,i=function(n){return parseFloat(n)||0},s=function(t){var f=1,e=n(t),u=null,r=[];return e.each(function(){var t=n(this),e=t.offset().top-i(t.css("margin-top")),o=r.length>0?r[r.length-1]:null;null===o?r.push(t):Math.floor(Math.abs(u-e))<=f?r[r.length-1]=o.add(t):r.push(t);u=e}),r},u=function(t){var i={byRow:!0,property:"height",target:null,remove:!1};return"object"==typeof t?n.extend(i,t):("boolean"==typeof t?i.byRow=t:"remove"===t&&(i.remove=!0),i)},t=n.fn.matchHeight=function(i){var r=u(i),f;return r.remove?(f=this,this.css(r.property,""),n.each(t._groups,function(n,t){t.elements=t.elements.not(f)}),this):this.length<=1&&!r.target?this:(t._groups.push({elements:this,options:r}),t._apply(this,r),this)},f,e;t.version="0.7.2";t._groups=[];t._throttle=80;t._maintainScroll=!1;t._beforeUpdate=null;t._afterUpdate=null;t._rows=s;t._parse=i;t._parseOptions=u;t._apply=function(r,f){var e=u(f),o=n(r),c=[o],l=n(window).scrollTop(),a=n("html").outerHeight(!0),h=o.parents().filter(":hidden");return h.each(function(){var t=n(this);t.data("style-cache",t.attr("style"))}),h.css("display","block"),e.byRow&&!e.target&&(o.each(function(){var i=n(this),t=i.css("display");"inline-block"!==t&&"flex"!==t&&"inline-flex"!==t&&(t="block");i.data("style-cache",i.attr("style"));i.css({display:t,"padding-top":"0","padding-bottom":"0","margin-top":"0","margin-bottom":"0","border-top-width":"0","border-bottom-width":"0",height:"100px",overflow:"hidden"})}),c=s(o),o.each(function(){var t=n(this);t.attr("style",t.data("style-cache")||"")})),n.each(c,function(t,r){var u=n(r),f=0;if(e.target)f=e.target.outerHeight(!1);else{if(e.byRow&&u.length<=1)return void u.css(e.property,"");u.each(function(){var t=n(this),u=t.attr("style"),i=t.css("display"),r;"inline-block"!==i&&"flex"!==i&&"inline-flex"!==i&&(i="block");r={display:i};r[e.property]="";t.css(r);t.outerHeight(!1)>f&&(f=t.outerHeight(!1));u?t.attr("style",u):t.css("display","")})}u.each(function(){var t=n(this),r=0;e.target&&t.is(e.target)||("border-box"!==t.css("box-sizing")&&(r+=i(t.css("border-top-width"))+i(t.css("border-bottom-width")),r+=i(t.css("padding-top"))+i(t.css("padding-bottom"))),t.css(e.property,f-r+"px"))})}),h.each(function(){var t=n(this);t.attr("style",t.data("style-cache")||null)}),t._maintainScroll&&n(window).scrollTop(l/a*n("html").outerHeight(!0)),this};t._applyDataApi=function(){var t={};n("[data-match-height], [data-mh]").each(function(){var i=n(this),r=i.attr("data-mh")||i.attr("data-match-height");t[r]=r in t?t[r].add(i):i});n.each(t,function(){this.matchHeight(!0)})};f=function(i){t._beforeUpdate&&t._beforeUpdate(i,t._groups);n.each(t._groups,function(){t._apply(this.elements,this.options)});t._afterUpdate&&t._afterUpdate(i,t._groups)};t._update=function(i,u){if(u&&"resize"===u.type){var e=n(window).width();if(e===o)return;o=e}i?r===-1&&(r=setTimeout(function(){f(u);r=-1},t._throttle)):f(u)};n(t._applyDataApi);e=n.fn.on?"on":"bind";n(window)[e]("load",function(n){t._update(!1,n)});n(window)[e]("resize orientationchange",function(n){t._update(!0,n)})});$(document).ready(function(){var t,u,h,s;$(".content-area .container").addClass("hide-block").viewportChecker({classToAdd:"visible-block animated fadeIn",offset:100});$(".news-area").each(function(n){var t=$(this),i=t.find(".news-item");i.matchHeight();n===1&&t.addClass("news-area--minor")});$(".content-area blockquote").each(function(){var t=$(this),n=t.html().split("<br>\n<br>"),i;n.length>1&&(i=n.pop(),t.empty().append('<div class="testimonial-copy">'+n.join("<br><br>")+"<\/div>").append('<cite class="testimonial-author">'+i+"<\/cite>"))});$(window).on("resize",function(){$("body").css({"margin-bottom":$("#footer").height()})}).resize();$(".quantity").on("click",function(){var n=+$(this).closest(".trip").data("price"),t=$("#quantity").val();$("#total").text(n*t)});$(".social-share").length&&$(".social-share").affix({offset:{top:$(".social-share").offset().top,bottom:$("footer").outerHeight(!0)+$(".application").outerHeight(!0)+40}});$("#connectionsArticles").on("shown.bs.collapse",function(){$(this).parent().find(".glyphicon-plus").removeClass("glyphicon-plus").addClass("glyphicon-minus")}).on("hidden.bs.collapse",function(){$(this).parent().find(".glyphicon-minus").removeClass("glyphicon-minus").addClass("glyphicon-plus")});$(window).bind("resize load",function(){$(this).width()<767?($("#accordion").find(".collapse").removeClass("in").parent().find(".glyphicon-plus").removeClass("glyphicon-plus").addClass("glyphicon-minus"),$("#accordion").find(".collapse").addClass("out").parent().find(".glyphicon-minus").removeClass("glyphicon-minus").addClass("glyphicon-plus")):($("#accordion").find(".collapse").removeClass("out").parent().find(".glyphicon-minus").removeClass("glyphicon-minus").addClass("glyphicon-plus"),$("#accordion").find(".collapse").addClass("in").parent().find(".glyphicon-plus").removeClass("glyphicon-plus").addClass("glyphicon-minus"),$(".in").height("100%"))});$("#SameAsPrimaryBilling_Selected").is(":checked")?$("#billing-group").hide("fast"):$("#billing-group").show("fast");$(document).on("click","#SameAsPrimaryBilling_Selected",function(){$("#SameAsPrimaryBilling_Selected").is(":checked")?($("#billing-group").hide("fast"),$("#InvoicingContact_ValidationRequired").val("false")):($("#billing-group").show("fast"),$("#InvoicingContact_ValidationRequired").val("true"))});$("#SameAsSchoolAddress_Selected").is(":checked")?$("#delivery-group").hide("fast"):$("#delivery-group").show("fast");$(document).on("click","#SameAsSchoolAddress_Selected",function(){$("#SameAsSchoolAddress_Selected").is(":checked")?($("#delivery-group").hide("fast"),$("#DeliveryAddress_ValidationRequired").val("false"),$("#SchoolAddress_CountryCheck").val("true")):($("#delivery-group").show("fast"),$("#DeliveryAddress_ValidationRequired").val("true"),$("#SchoolAddress_CountryCheck").val("false"))});$(document).on("change","#DeliveryAddress_Country",function(){$("#DeliveryAddress_Country option:selected").val()==="AUS"?$("#SchoolAddress_CountryCheck").val("false"):$("#SchoolAddress_CountryCheck").val("true")});$("form").submit(function(){var n=$(this).find("input[type=submit]:focus").attr("id");$("#btnAddToCart").length&&n==="btnAddToCart"&&($("#btnAddToCart").prop("disabled",!0),$("#btnHidden").val("Add to cart"));$("#btnAddToCartAuthFiles").length&&$("#btnAddToCartAuthFiles").prop("disabled",!0);$("#btnBuyNow").length&&n==="btnBuyNow"&&($("#btnBuyNow").prop("disabled",!0),$("#btnHidden").val("Buy now"))});$(document).on("click","#btnProceed",function(n){if($("form").validate().form()){n.preventDefault();var t=$(this).attr("data-type");$.ajax({url:"/umbraco/Surface/Product/TermsOfUse",data:{orderType:t},success:function(n){$("#termsOfUse").html(n);$("#termsOfUse").modal("show")},error:function(){alert("Terms of Use load failed.")}})}});$(document).on("click","#btnAgreeTermsOfUse",function(){$(this).closest("form").submit()});$(document).on("keyup","#NumberStudents",function(n){var t=n.target.value,i=$("#ProductCode").val();$.getJSON("/umbraco/Surface/Product/GetCataloguePrice",{productCode:i,numberStudents:t},function(n){var t=n.Currency,i=n.Rate.toFixed(2);$("#subscriptionPrice").html("<strong>"+t+" $"+i+"<\/strong>");$("#FinalSubscriptionCurrency").val(t);$("#FinalSubscriptionPrice").val(i)})});$(document).on("change","#Quantity",function(n){var i=n.target.value,t=$("#TicketPrice").val(),r=(t*i).toFixed(2),u=$("#TicketCurrency").val();$("#finalPrice").html("<strong>"+u+"&nbsp;$"+r+"<\/strong>");$("#TotalPrice").val(t)});$(document).on("change","#ScannerQuantity",function(n){var i=n.target.value,r=$("#Price").val(),t=(r*i).toFixed(2),u=$("#Currency").val();$("#barcodeScannerPrice").html(u+"&nbsp;$"+t);$("#TotalPrice").val(t)});if($.CookiesMessage({messageText:"We use technical and analytics cookies to ensure that we give you the best experience on our website.",messageBg:"#151515",messageColor:"#FFFFFF",messageLinkColor:"#F0FFAA",closeEnable:!1,closeColor:"#444444",closeBgColor:"#000000",acceptEnable:!0,acceptText:"Accept & Close",infoEnable:!1,cookieExpire:180}),$("#countdownTime").length>0){t=parseInt($("#countdownTime").val(),10)/1e3;u=$("#countdownDisplay")[0];function l(){var n=parseInt(t/60,10),i=parseInt(t%60,10);n=n<10?"0"+n:n;i=i<10?"0"+i:i;n==0&&i==0?(u.innerHTML="<span style='color:#a94442;'>Your cart has expired.<\/span>",a()):u.textContent="Your cart expires in : "+n+":"+i;t>0&&--t<0&&(t=parseInt($("#countdownTime").val(),10)/1e3)}h=setInterval(l,1e3);function a(){clearInterval(h)}}var i=$("#SchoolType"),n=$("#SchoolYearLevel"),f=$("#hdnSchoolYearLevel").val(),e=$("#hdnSchoolYearLevelOther").val(),o=$("#SchoolYearLevelOther"),r=$("#divSchoolYearLevelOther"),c=function(){o.val("");var t=n.val();t==="Other"?(r.show(),o.val(e)):r.hide()};$("#SchoolYearLevel > option").length===1&&(n.attr("disabled",!0),r.hide());s=function(){var t=i.val();n.find("option:gt(0)").remove();n.find("option:eq(0)").attr("selected","selected");$.ajax({type:"GET",url:window.location.protocol+"//"+window.location.host+"/umbraco/surface/product/GetSchoolYearLevels?schoolType="+t,success:function(t){var i,r,u;for(n.attr("disabled",!1),i=0;i<t.length;i++)r=t[i],u=r,n.append($("<option>",{value:r,text:u})),f!==""&&n.val(f),c()}})};i.length>0&&i[0].selectedIndex>0&&s();i.change(function(){o.val("");r.hide();f="";e="";s()});n.change(function(){e="";c()});$(".shop-grid .thumbnail").matchHeight()});!function(n){n.CookiesMessage=function(t){function u(t){var r="",i,u;1==t.closeEnable&&(r+='<a href="#" id="band-cookies-close" style="background-color:'+t.closeBgColor+';"><svg version="1.1" id="band-cookies-close-icon" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="16px" height="16px" viewBox="248.5 248.5 15 15" enable-background="new 248.5 248.5 15 15" xml:space="preserve" ><polygon id="x-mark-icon" points="263.5,260.876 258.621,255.999 263.499,251.121 260.876,248.5 256,253.377 251.122,248.5 248.5,251.121 253.378,255.999 248.5,260.878 251.121,263.5 256,258.62 260.879,263.499" style="fill:'+t.closeColor+';"/><\/svg><\/a>');i="";1==t.acceptEnable&&(i+='<a href="#" id="band-cookies-ok">'+t.acceptText+"<\/a>");1==t.infoEnable&&(i+='<a href="'+t.infoUrl+'" id="band-cookies-info">'+t.infoText+"<\/a>");u='<div id="band-cookies"><p>'+t.messageText+i+"<\/p>"+r+"<\/div>";n("body").prepend(u);n("#band-cookies").hide().slideDown();n("#band-cookies").css({"background-color":t.messageBg,color:t.messageColor});n("#band-cookies p a").css({color:t.messageLinkColor})}function f(n){return n.replace(/^\s+|\s+$/g,"")}function e(n){var u=!1,t,r;if(document.cookie)for(t=document.cookie.split(";"),i=0;i<t.length;i++)r=t[i].split("="),f(r[0])==n&&(u=r[1]);return u}function o(n,t,i,r){var u=new Date,f;u.setTime(u.getTime()+864e5*i);f="expires="+u.toUTCString();document.cookie=n+"="+t+"; "+f+"; path="+r+";"}t=n.extend({messageText:"We use technical and analytics cookies to ensure that we give you the best experience on our website.",messageBg:"#151515",messageColor:"#FFFFFF",messageLinkColor:"#F0FFAA",closeEnable:!0,closeColor:"#444444",closeBgColor:"#000000",acceptEnable:!0,acceptText:"Accept & Close",infoEnable:!0,infoText:"More Info",infoUrl:"#",cookieExpire:180},t);var r="cookie_consent",s="Cookies policy accepted",h="/",c=e(r);c||u(t);n("#band-cookies-ok").on("click",function(i){i.preventDefault();o(r,s,t.cookieExpire,h);n("#band-cookies").slideToggle()});n("#band-cookies-close").on("click",function(t){t.preventDefault();n("#band-cookies").slideToggle()})}}(jQuery)