
﻿function MicroCartJS(){var a;$(document).ready(function(){});this.ShowNotification=function(b){$("#NotificationItems").html(b);$("#MicroCartNotification").stop(true,true);if($("html").hasClass("ie7")||$("html").hasClass("ie8"))$("#MicroCartNotification").show();else $("#MicroCartNotification").fadeIn(500);clearTimeout(a);a=setTimeout("MicroCartJS.HideNotification()",1e4)};this.HideNotification=function(){clearTimeout(a);if($("html").hasClass("ie7")||$("html").hasClass("ie8"))$("#MicroCartNotification").hide();else $("#MicroCartNotification").fadeOut(1e3)};this.UpdateCart=function(a){$("#MicroCartTotalAmount").html(a.TotalFormatted);$("#MicroCartTotalItems").html("("+a.TotalItemCount+") Item(s)")};this.ShowDetails=function(){$("#MicroCartDetails").show()};this.HideDetails=function(){$("#MicroCartDetails").hide()}}MicroCartJS=new MicroCartJS;function Guest(){var b="shop.skypoint.com.au",d,a,e=0;this.mainContentIframe="PSMainContentIframe";this.modalIframe="PSModalIframe";this.init=function(){typeof FB!="undefined"&&FB.init({appId:"141185185945068",status:true,cookie:true,xfbml:true})};this.ShowModal=function(c){var d=new Date,a="http://"+b+"/iframe/GuestModal?";if(c)a+="message="+c+"&";a+="c="+d.getMilliseconds();$("#guestpopup").removeClass("cartGuestModal");jQuery.facebox('<iframe id="PSModalIframe" class="PSModalIframe" src="'+a+'" width="710px" height="50px" frameborder="0"></iframe>')};this.ShowModalCreate=function(c){var d=new Date,a="http://"+b+"/iframe/GuestModal?";if(c)a+="message="+c+"&";a+="create=1&c="+d.getMilliseconds();$("#guestpopup").removeClass("cartGuestModal");jQuery.facebox('<iframe id="PSModalIframe" class="PSModalIframe" src="'+a+'" width="710px" height="50px" frameborder="0"></iframe>')};this.ShowModalCartLogin=function(d){var e=new Date,a="http://"+b+"/iframe/CartGuestModal?";a+="c="+e.getMilliseconds();a+="&ciid="+d;jQuery.facebox('<iframe id="PSModalIframe" class="PSModalIframe" src="'+a+'" width="710px" height="50px" frameborder="0"></iframe>');$("#guestpopup").addClass("cartGuestModal");if($(window).width()>=$("#facebox .popup").width()){var c=20;$("#facebox").css("left",$(window).width()/2-$("#facebox .popup").width()/2+c)}};this.ShowModalCartLoginIE7=function(c){var e=new Date,a="http://"+b+"/iframe/CartGuestModal?";a+="c="+e.getMilliseconds();a+="&ciid="+c;var d="popUp";window.open(url,d);event.preventDefault()};this.HideGuestModal=function(){jQuery(document).trigger("close.facebox")};this.GetETicket=function(a){$("#ETicketText").html("Requesting...");$.ajax({url:"/GuestAjax/RequestETicket",type:"POST",dataType:"json",data:{OrderID:a},success:function(b){if(b.success)$("#ETicketText").html("<a href='/Guest/DownloadETicket/"+a+"'>Click here to download your E-ticket</a>");else $("#ETicketText").html("There was an error requesting your E-Ticket")}})};this.UnlinkFB=function(){if(a)return;$.ajax({url:"/GuestAjax/UndoFBLink",type:"POST",dataType:"json",data:{},success:function(b){if(b.success){$("#LinkToFBContainer").html(this.FBJustUnlinked);a=true}else alert(b.message)}})};this.LinkToFB=function(){if(a)return;FB.login(function(a){if(a.session)if(a.perms)c(a.session.uid);else alert("Didn't grant permissions");else alert("didn't log in or grant permissions")},{perms:"publish_stream"})};function c(b){$.ajax({url:"/GuestAjax/DoFBLink",type:"POST",dataType:"json",data:{uid:b},success:function(c){if(c.success){d=b;$("#LinkToFBContainer").html(this.FBJustLinked);a=true}else alert(c.message)}})}this.ResetPassword=function(){$.ajax({url:"/GuestAjax/LoginGuest",type:"POST",dataType:"json",data:{username:$("#LoginUsername").val(),password:$("#LoginPassword").val()},success:function(a){a.success}})};this.toggleAddressInput=function(a){if($("#"+a+"AddressSelector").val()==""){$("#"+a+"AddressInput").slideDown();$("#"+a+"AddressInput input").removeAttr("disabled")}else{$("#"+a+"AddressInput").slideUp();$("#"+a+"AddressInput input").attr("disabled","disabled")}};this.AddNewAddress=function(a){$("#Edit"+a+"Form input").val("");$("#Edit"+a+"Form input").removeAttr("disabled");$("#Edit"+a+"Form select").removeAttr("disabled");$("#Edit"+a+"Form select").get(0).selectedIndex=0;$("#"+a+"State").val("");$("#"+a+"Country").val("");$("#"+a+"AddressEditButtons").hide();$("#"+a+"PreSavedAddress").show();$("#"+a+"AddressInput").show();$("#Edit"+a+"Form").slideDown();switch(a){case"Billing":EditingBillingAddress=false;break;case"Postal":EditingPostalAddress=false;break;case"Shipping":EditingShippingAddress=false}};this.EditAddress=function(a){var b;switch(a){case"Billing":EditingBillingAddress=true;b=BillingAddress;break;case"Postal":EditingPostalAddress=true;b=PostalAddress;break;case"Shipping":EditingShippingAddress=true;b=ShippingAddress}$("#"+a+"StreetAddress").val(b.AddressLine);$("#"+a+"StreetAddress2").val(b.AddressLine2);$("#"+a+"City").val(b.City);$("#"+a+"Country").val(b.Country);$("#"+a+"State").val(b.State);$("#"+a+"Postcode").val(b.Postcode);$("#"+a+"AddressEditButtons").hide();$("#"+a+"PreSavedAddress").hide();$("#Edit"+a+"Form input").removeAttr("disabled");$("#Edit"+a+"Form select").removeAttr("disabled");$("#"+a+"AddressInput").show();$("#Edit"+a+"Form").slideDown()};this.HideFacebox=function(){var b=true;try{var a=document.getElementById(GuestJS.modalIframe);if(a.contentWindow.IframeGuestJS.guestcartitemid&&a.contentWindow.IframeGuestJS.guestcartitemid!=0)b=confirm("Are you sure you wish to close the Guest Entry box? Doing so will delete all newly added details entered so far.\n\nClick 'Cancel' to continue entering Guest Details.")}catch(c){}return b};this.CancelAddress=function(a){$("#"+a+"AddressEditButtons").show();$("#"+a+"PreSavedAddress").hide();$("#Edit"+a+"Form").slideUp();$("#Edit"+a+"Form select").selectedIndex=0;$("#Edit"+a+"Form Input").val("");$("#"+a+"AddressSelector").selectedIndex=0;$("#"+a+"AddressSelector").val("")};this.ResizeFrame=function(b){var a=document.getElementById(b);a.height=a.contentWindow.document.body.offsetHeight}}GuestJS=new Guest;function navSpacer(){return}function Page(){var a="//shop.skypoint.com.au";this.ShowUpSell=function(e,f){var d,b,c;c={};d=new Date;b=a+"/iframe/upsell/{0}?".f(f);$(e.UpdatedCartItems).each(function(){c[this.Subclass]=this.Quantity});b+=decodeURIComponent($.param(c));b+="&"+d.getMilliseconds();$.facebox.settings.faceboxHtml='\t\t\t<div id="facebox" style="display:none;"> \t\t\t\t<div class="popup"> \t\t\t\t\t<div class="wrapper"> \t\t\t\t\t\t<div id="upsellpopup" class="psmodalbox"> \t\t\t\t\t\t\t<div class="guestModalClose"><div id="closeModalHitbox" onclick="$.facebox.close()"></div> \t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t<div class="title"> \t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t<div class="content"> \t\t\t\t\t\t\t</div> \t\t\t\t\t\t\t<div class="footer"> \t\t\t\t\t\t\t</div> \t\t\t\t\t\t</div> \t\t\t\t\t</div> \t\t\t\t</div> \t\t\t</div>';$.facebox('<iframe id="PSModalIframe" class="PSModalIframe" src="'+b+'" width="492px" height="60px" frameborder="0"></iframe>');$("#PSModalIframe").load(function(){var a=$(this)[0],c=a.contentWindow?a.contentWindow:a.contentDocument.defaultView,b=$(this).contents().find("#yes_please");if(b===undefined)return;$(b).click(function(){$(e.UpdatedCartItems).each(function(){c.CartJS.RemoveCartItem(this.CartItemID,this.Name)});$.facebox.close()})})}}String.prototype.f=function(){var a=arguments;return this.replace(/\{\{|\}\}|\{(\d+)\}/g,function(b,c){return b=="{{"?"{":b=="}}"?"}":a[c]})};Page=new Page


