var Ios=navigator.platform=="iPad"||navigator.platform=="iPhone";function ShowDialog(b,d,a,e,c){if(Ios){$("html, body").animate({scrollTop:0},"fast")}$("#PopupDialog").load(b,function(){$("#PopupDialog").dialog({title:d,width:a,height:e,modal:true,buttons:c,close:function(){CloseDialog()}})})}function CloseDialog(){$("#PopupDialog").empty().dialog("destroy")}function ajaxOk(a){var b=($(a).find("Status").text()=="OK");if(!b){alert($(a).find("ErrorMessage").text())}return b}var AddressName="";function PrintFaveCard(){var a=window.open("/Faves/PrintCard.aspx","","width=450px,height=300px,toolbar=no")}function ShowOrder(a){ShowDialog("/Order/ViewOrder.aspx?OrderID="+a,"View Order #"+a,640,480)}function SaveOrderAsFave(a){self.location="/Faves/SaveOrder.aspx?OrderId="+a}var map;var foodIcon;function cmkr(d,c,b){point=new GLatLng(d,c);var a=new GMarker(point,foodIcon);GEvent.addListener(a,"click",function(){a.openInfoWindowHtml(b)});map.addOverlay(a)}function createHomeMarker(a){var b=new GIcon({image:"http://maps.google.com/mapfiles/kml/pal3/icon56.png",shadow:"http://maps.google.com/mapfiles/kml/pal3/icon56s.png",iconSize:new GSize(32,32),shadowSize:new GSize(59,32),iconAnchor:new GPoint(16,32),infoWindowAnchor:new GPoint(16,0)});return new GMarker(a,{icon:b,title:"My Location",clickable:false,draggable:true})}function ChangeLocation(a){$("#divChangeLocationLink").css("display","none");$("#divChangeLocation").css("display","block");$("#"+a).focus();$("#divNewLocation").toggle("fast")}function ChangeDeliveryAddress(a){if($("#"+a).val()=="0"){CreateNewAddress()}else{setTimeout("__doPostBack('ctl00$cph$selDeliveryMode','')",0)}}function CreateNewAddress(){$("#VendorMap").css("visibility","hidden");ShowDialog("/Order/AddNewAddress.aspx","Add New Address",600,250)}function SaveNewAddress(){var b=document.getElementById("newAddressForm");if(b.contactdetails.value.length<10||b.contactdetails.value.length>20){alert("Please enter a contact phone number for deliveries to this address")}else{AddressName=b.streetaddress.value;var a="/ajax/addDeliveryAddress.aspx?Building="+escape(b.building.value)+"&StreetAddress="+escape(AddressName)+"&City="+escape(b.city.value)+"&ZipCode="+escape(b.zipcode.value)+"&ContactDetails="+escape(b.contactdetails.value)+"&Instructions="+escape(b.instructions.value);$.get(a,ProcessNewAddress)}}function imposeMaxLength(b,a){if(b.value.length>a){b.value=b.value.substring(0,a)}};