function UpdateBillingState(){var n=encodeURIComponent($("#BillingAddress_Country").val());$("#BillingAddress_State_Refresh").load("/account/statedisplay?country="+n+"&idprefix=BillingAddress_",null,RebindBillingStateChange)}function RebindBillingStateChange(){$("#BillingAddress_State").change(function(){UpdateBillingCounty()});UpdateBillingCounty()}function UpdateBillingCounty(){var t=encodeURIComponent($("#BillingAddress_Country").val()),n=encodeURIComponent($("#BillingAddress_State").val()),i=encodeURIComponent($("#BillingAddress_County").val());$.ajax({url:"/account/countydisplay?country="+t+"&state="+n+"&county="+i+"&idprefix=BillingAddress_",type:"GET",cache:!1,success:function(t){$("#BillingAddress_County_Refresh").html(t);DisplayBillingCounty(n)}})}function DisplayBillingCounty(n){n===$("#BillingAddress_State").val()&&($("#BillingAddress_County option").length>1?$("#BillingAddress_County_Wrapper").show():$("#BillingAddress_County_Wrapper").hide())}function ChangeBillingAddressType(){var n=$("#BillingAddress_AddressType").val();n==="Personal"?($("#BillingAddress_Company_Wrapper").hide(),$("#BillingAddress_Department_Wrapper").hide()):($("#BillingAddress_Company_Wrapper").show(),$("#BillingAddress_Department_Wrapper").show())}function UpdateShippingState(){var n=encodeURIComponent($("#ShippingAddress_Country").val());$("#ShippingAddress_State_Refresh").load("/account/statedisplay?country="+n+"&idprefix=ShippingAddress_",null,RebindShippingStateChange)}function RebindShippingStateChange(){$("#ShippingAddress_State").change(function(){UpdateShippingCounty()});UpdateShippingCounty()}function UpdateShippingCounty(){var t=encodeURIComponent($("#ShippingAddress_Country").val()),n=encodeURIComponent($("#ShippingAddress_State").val()),i=encodeURIComponent($("#ShippingAddress_County").val());$.ajax({url:"/account/countydisplay?country="+t+"&state="+n+"&county="+i+"&idprefix=ShippingAddress_",type:"GET",cache:!1,success:function(t){$("#ShippingAddress_County_Refresh").html(t);DisplayShippingCounty(n)}})}function DisplayShippingCounty(n){n===$("#ShippingAddress_State").val()&&($("#ShippingAddress_County option").length>1?$("#ShippingAddress_County_Wrapper").show():$("#ShippingAddress_County_Wrapper").hide())}function ChangeShippingAddressType(){var n=$("#ShippingAddress_AddressType").val();n==="Personal"?($("#ShippingAddress_Company_Wrapper").hide(),$("#ShippingAddress_Department_Wrapper").hide()):($("#ShippingAddress_Company_Wrapper").show(),$("#ShippingAddress_Department_Wrapper").show())}$(document).ready(function(){$("#BillingAddress_Country").change(function(){UpdateBillingState()});$("#BillingAddress_State").change(function(){UpdateBillingCounty()});$("#BillingAddress_AddressType").change(function(){ChangeBillingAddressType()});$("#ShippingAddress_Country").change(function(){UpdateShippingState()});$("#ShippingAddress_State").change(function(){UpdateShippingCounty()});$("#ShippingAddress_AddressType").change(function(){ChangeShippingAddressType()});UpdateBillingCounty();ChangeBillingAddressType();UpdateShippingCounty();ChangeShippingAddressType()})