function getStoreGroups(n){return $("#lstStoreGroup").empty(),$("#lstStoreGroup").append('<option value="">Loading...<\/option>'),$("#lstStoreLocation").empty(),$("#lstStoreLocation").append('<option value="">Please select<\/option>'),$.get(BASE+"/api/lists/groups",{strState:$("#lstStoreState").val()}).done(function(t){$("#lstStoreGroup").empty();$("#lstStoreGroup").append('<option value="">Please select<\/option>');$.each(t,function(n,t){$("#lstStoreGroup").append('<option value="'+t.Value+'">'+t.Text+"<\/option>")});n&&($("#lstStoreGroup").val($("#lstStoreGroup").data("storegroup")),getStoreLocations(!0))}).fail(function(n){alert("Failed to retrieve store groups.\r"+JSON.stringify(n))}),!1}function getStoreLocations(n){return $("#lstStoreLocation").empty(),$("#lstStoreLocation").append('<option value="">Loading...<\/option>'),$.get(BASE+"/api/lists/locations",{strState:$("#lstStoreState").val(),strGroup:$("#lstStoreGroup").val()}).done(function(t){$("#lstStoreLocation").empty();$("#lstPurchaseMethod").val()!="ONLINE"&&$("#lstStoreLocation").append('<option value="">Please select<\/option>');$.each(t,function(n,t){$("#lstStoreLocation").append('<option value="'+t.Value+'">'+t.Text+"<\/option>")});n&&$("#lstStoreLocation").val($("#lstStoreLocation").data("storelocation"))}).fail(function(n){alert("Failed to retrieve store locations.\r"+JSON.stringify(n))}),!1}function onSubmit(){$("#frmEntry").valid()&&(myApp.showPleaseWait(),$("#frmEntry").submit())}var BASE,pathParts,myApp;location.host.toLowerCase().indexOf("localhost")==-1?(pathParts=location.pathname.split("/"),BASE=location.protocol+"//"+location.host+"/"+pathParts[1]):BASE=location.protocol+"//"+location.host;$("#lstStoreState").length>0&&$("#lstStoreState").val().length>0&&getStoreGroups(!0);$("#lstState").change(function(){$("#lstStoreState").val($("#lstState").val());getStoreGroups(!1)});$("#lstStoreState").change(function(){getStoreGroups(!1)});$("#lstStoreGroup").change(function(){getStoreLocations(!1)});myApp=myApp||function(){var n=$('<div id="pleaseWaitDialog" class="modal fade" data-backdrop="static" data-keyboard="false"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><h2 class="text-center">Processing...<\/h2><\/div><div class="modal-body"><div class="progress progress-striped active"><div class="progress-bar" style="width: 100%;"><\/div><\/div><\/div><\/div><\/div><\/div>');return{showPleaseWait:function(){n.modal()},hidePleaseWait:function(){n.modal("hide")}}}();$("#txtOccupationSpecified").length>0&&($("#txtOccupationSpecified").val().length==0&&$("#divOccupationSpecified").hide(),$("#lstOccupation").change(function(){$(this).val()==="Other"?$("#divOccupationSpecified").show():($("#divOccupationSpecified").hide(),$("#txtOccupationSpecified").val(""))}))