function getStoreStates(n){return $("#lstStoreState").empty(),$("#lstStoreState").append('<option value="">Loading...<\/option>'),$("#lstStoreLocation").empty(),$("#lstStoreLocation").append('<option value="">Please select<\/option>'),$.ajax({type:"POST",url:BASE+"/Home/GetStoreStates",dataType:"json",data:{strCountry:$("#lstCountry").val()},success:function(t){$("#lstStoreState").empty();$("#lstStoreState").append('<option value="">Please select<\/option>');$.each(t,function(n,t){$("#lstStoreState").append('<option value="'+t.Value+'">'+t.Text+"<\/option>")});n&&($("#lstStoreState").val($("#lstStoreState").data("statepurchased")),getStoreLocations(!0))},error:function(n){alert("Failed to retrieve store states"+n)}}),!1}function getStoreLocations(n){return $("#lstStoreLocation").empty(),$("#lstStoreLocation").append('<option value="">Loading...<\/option>'),$.ajax({type:"POST",url:BASE+"/Home/GetStoreLocations",dataType:"json",data:{strState:$("#lstStoreState").val()},success:function(t){$("#lstStoreLocation").empty();$("#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"))},error:function(n){alert("Failed to retrieve store locations"+n)}}),!1}function onSubmit(){$("#frmEntry").valid()&&myApp.showPleaseWait()}var _gaq=_gaq||[],BASE,myApp;_gaq.push(["_setAccount","UA-35389744-1"]);_gaq.push(["_trackPageview"]),function(){var n=document.createElement("script"),t;n.type="text/javascript";n.async=!0;n.src=("https:"==document.location.protocol?"https://ssl":"http://www")+".google-analytics.com/ga.js";t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(n,t)}(),function(n,t,i){var r,u=n.getElementsByTagName(t)[0];n.getElementById(i)||(r=n.createElement(t),r.id=i,r.src="//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.0",u.parentNode.insertBefore(r,u))}(document,"script","facebook-jssdk");$(".faqs").click(function(){$("#modFAQs").modal("show")});$(".tandc").click(function(){$("#modTAndC").modal("show")});$(".privacy").click(function(){$("#modPrivacy").modal("show")});$(".prizes").click(function(){$("#modPrizes").modal("show")});$(".winners").click(function(){$("#modWinners").modal("show")});BASE=location.host.toLowerCase().indexOf("localhost")==-1?location.protocol+"//"+location.host+location.pathname:location.protocol+"//"+location.host;$("#lstCountry").val().length>0&&(onCountryChanged(!0),$("#txtPOPFileName").val(""));$("#lstCountry").change(function(){getStoreStates(!1)});$("#lstStoreState").change(function(){getStoreLocations(!1)});jQuery.validator.addMethod("enforcetrue",function(n,t){return t.checked});jQuery.validator.unobtrusive.adapters.addBool("enforcetrue");$(document).on("change",".btn-file :file",function(){var n=$(this),t=n.get(0).files?n.get(0).files.length:1,i=n.val().replace(/\\/g,"/").replace(/.*\//,"");n.trigger("fileselect",[t,i])});$(".btn-file :file").on("fileselect",function(n,t,i){var u=$(this).parents(".input-group").find(":text"),r=t>1?t+" files selected":i;u.length?u.val(r):r&&alert(r)});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")}}}();$("input, textarea").placeholder();$('.tt [data-toggle="tooltip"]').tooltip()