function btnInfo(){$.ajax({type:"POST",url:"/MyEdjoin/wishListStatus",data:{applicantID:applicantID,postingID:postingID},beforeSend:function(){}}).done(function(n){n.haserrors?bootbox.alert(n.msg):n.data<=0?$.ajax({type:"POST",url:"/MyEdjoin/AddToWishList",data:{postingID:postingID},beforeSend:function(){}}).done(function(n){n.haserrors?bootbox.alert(n.msg):bootbox.alert("This Job Posting has been added to your wish list")}):($("#wishListModal").modal("hide"),bootbox.alert("You have either already started the application progress or this job is already in your wish list",function(){window.location.reload()}))})}function showJobPostingInfo(){appType==="offsite"&&$(".btnapply").text("CLICK HERE TO APPLY (OFFSITE)");appType==="shortandlong"&&$(".btnapplySF").show();appType==="shortform"&&($(".btnapply").hide(),$(".btnapplySF").show());appType==="expired"&&($(".btnapply").hide(),$(".disablePosting").html('<h4 style="text-align:center;">This job posting has expired<\/h4>'));appType==="blank"&&$(".btnapply").hide();appType===""&&($(".btnapply").hide(),$(".disablePosting").html("<h4>The EDJOIN online application is not being used with this posting. Please review the posting for instructions on how to apply or contact the Employer by emailing/calling the contact person listed with the posting information above.<\/h4>"));var n=new Date;n.valueOf()<Date.parse(postingDate)&&($(".btnapply").hide(),$(".disablePosting").html("<h4>This job posting will open on "+new Date(postingDate).toLocaleDateString()+"<\/h4>"))}function openLoginModal(){$("#myModalLabel").text(passTitle);$("#myModal").modal("show");$("#internalModalContainer").show()}function applyReg(){$.ajax({type:"POST",url:"/Apps/ApplyOnlineReg",data:{postingID:postingID},beforeSend:function(){$(".btnapply").removeClass("btn-primary").addClass("disabled").prop("disabled",!0)}}).done(function(n){$(".btnapply").removeClass("disabled").addClass("btn-primary").prop("disabled",!1);n.haserrors?bootbox.alert(n.msg):n.id===0?($("#signInModal").modal("hide"),bootbox.alert(n.msg,function(){window.location=n.data})):n.id===-5?($("#signInModal").modal("hide"),bootbox.confirm(n.msg,function(t){t&&(window.location=n.data)})):window.location=n.data;$.doTimeout(6e3,function(){$("#btnlogin").removeClass("disabled").addClass("btn-primary");$("#btnlogin").text("Login");$("#btnlogin").prop("disabled",!1)})})}function onSignIn(n){var i;if($("#signInModal").hasClass("modal hide fade in")){i=$("#keepLoggedIn").is(":checked")?!0:!1;var t=n.getBasicProfile(),u=t.getGivenName(),f=t.getFamilyName(),r=t.getEmail();$.ajax({type:"POST",url:"/Account/AuthenticateGoogleSignIn",data:{username:r,fname:u,lname:f,email:r,keepLoggedIn:i},beforeSend:function(){}}).done(function(n){n.haserrors?($("#signInModal").modal("hide"),bootbox.confirm(n.msg,function(){$("#btnlogin").removeClass("disabled").addClass("btn-primary");$("#btnlogin").text("Login");$("#btnlogin").prop("disabled",!1);gapi.auth2.getAuthInstance().disconnect()})):appType==="shortform"?($("#signInModal").modal("hide"),$("#myModal").modal("show"),$("#internalModalContainer").show()):appType==="online"?passRequired?($("#signInModal").modal("hide"),$("#myModal").modal("show"),$("#internalModalContainer").show()):applyReg():appType==="shortandlong"?($("#signInModal").modal("hide"),bootbox.alert("You are now signed in pleased click the apply button to begin your application, thank you.",function(){window.location.reload()})):applyReg()})}}function onFailure(n){console.log(n)}function renderButton(){gapi.signin2.render("my-signin2",{scope:"profile email",width:240,height:50,longtitle:!0,theme:"dark",onsuccess:onSignIn,onfailure:onFailure})}function validatelogin(){$.ajax({type:"POST",url:"/Account/AuthenticateLogin",data:$("#signInForm").serialize(),beforeSend:function(){$("#btnlogin").removeClass("btn-primary").addClass("disabled").prop("disabled",!0).text("Logging In...")}}).done(function(n){if(n.haserrors)if(n.isConfirmed===!1){$("#signInModal").modal("hide");$("#emailModal").modal("show");$("span.userEmail").html(n.email);$("body").on("click",function(){$("#emailModal").is(":visible")&&($("#emailModal").modal("hide"),$.ajax({type:"POST",url:"/Account/ValidateEmail",data:$("#signInForm").serialize(),beforeSend:function(){showloadingmodal("Loading...")}}).done(function(n){if(n.haserrors)bootbox.confirm(n.msg,function(){$("#password").val("");$("#username").focus();$("#btnlogin").removeClass("disabled").addClass("btn-primary");$("#btnlogin").text("Login");$("#btnlogin").prop("disabled",!1)});else{hideloadingmodal(0);$("#notifyModal").modal("show");$("#emailModal").modal("hide");$("body").on("click",function(){$("#notifyModal").is(":visible")&&window.location.reload()});$("body").on("keydown",function(n){var t=n.keyCode?n.keyCode:n.which?n.which:n.charCode;console.log(t);$("#notifyModal").is(":visible")&&t===13&&window.location.reload()})}}))});$("body").on("keydown",function(n){var t=n.keyCode?n.keyCode:n.which?n.which:n.charCode;$("#emailModal").is(":visible")&&t===13&&($("#emailModal").modal("hide"),$.ajax({type:"POST",url:"/Account/ValidateEmail",data:$("#signInForm").serialize(),beforeSend:function(){showloadingmodal("Loading...")}}).done(function(n){if(n.haserrors)bootbox.confirm(n.msg,function(){$("#password").val("");$("#username").focus();$("#btnlogin").removeClass("disabled").addClass("btn-primary");$("#btnlogin").text("Login");$("#btnlogin").prop("disabled",!1)});else{hideloadingmodal(0);$("#notifyModal").modal("show");$("#emailModal").modal("hide");$("body").on("click",function(){$("#notifyModal").is(":visible")&&window.location.reload()});$("body").on("keydown",function(n){var t=n.keyCode?n.keyCode:n.which?n.which:n.charCode;$("#notifyModal").is(":visible")&&t===13&&window.location.reload()})}}))})}else bootbox.alert(n.msg),$("#signInModal").modal("hide"),$("#signInModal").trigger("reset"),$("#btnlogin").removeClass("disabled").addClass("btn-primary"),$("#btnlogin").text("Login"),$("#btnlogin").prop("disabled",!1);else appType==="shortform"?($("#signInModal").modal("hide"),$("#myModal").modal("show"),$("#internalModalContainer").show()):appType==="online"?passRequired?($("#signInModal").modal("hide"),$("#myModal").modal("show"),$("#internalModalContainer").show()):applyReg():appType==="shortandlong"?($("#signInModal").modal("hide"),bootbox.alert("You are now signed in pleased click the apply button to begin your application, thank you.",function(){window.location.reload()})):applyReg()})}function validateLoginForWish(n){$.ajax({type:"POST",url:"/Account/AuthenticateLogin",data:$("#wishListSignInForm").serialize(),beforeSend:function(){$("#btnloginWishList").removeClass("btn-primary").addClass("disabled").prop("disabled",!0).text("Logging In...")}}).done(function(t){if(t.haserrors)if(t.isConfirmed===!1){$("#wishListModal").modal("hide");$("#emailModal").modal("show");$("span.userEmail").html(t.email);$("body").on("click",function(){$("#emailModal").is(":visible")&&($("#emailModal").modal("hide"),$.ajax({type:"POST",url:"/Account/ValidateEmail",data:$("#wishListSignInForm").serialize(),beforeSend:function(){showloadingmodal("Loading...")}}).done(function(n){if(n.haserrors)bootbox.confirm(n.msg,function(){$("#password").val("");$("#username").focus();$("#btnloginWishList").removeClass("disabled").addClass("btn-primary");$("#btnloginWishList").text("Login");$("#btnloginWishList").prop("disabled",!1)});else{hideloadingmodal(0);$("#notifyModal").modal("show");$("#emailModal").modal("hide");$("body").on("click",function(){$("#notifyModal").is(":visible")&&window.location.reload()});$("body").on("keydown",function(n){var t=n.keyCode?n.keyCode:n.which?n.which:n.charCode;$("#notifyModal").is(":visible")&&t===13&&$("#notifyModal").modal("hide")})}}))})}else bootbox.alert(t.msg),$("#wishListModal").modal("hide"),$("#wishListModal").trigger("reset"),$("#btnloginWishList").removeClass("disabled").addClass("btn-primary"),$("#btnloginWishList").text("Login"),$("#btnloginWishList").prop("disabled",!1);else n.attr("id")==="lnkViewWish"?window.location=viewWishlist:($("#wishListModal").modal("hide"),btnInfo()),$.doTimeout(6e3,function(){$("#btnloginWishList").removeClass("disabled").addClass("btn-primary");$("#btnloginWishList").text("Login");$("#btnloginWishList").prop("disabled",!1)})})}function resetPassword(){$("#forgotForm").valid()?(console.log($("#forgotPassword").val()),$.ajax({type:"POST",url:"/Account/GetPassword",data:{email:$("#forgotPassword").val()},beforeSend:function(){}}).done(function(n){n.haserrors?($("#forgotPasswordModal").modal("hide"),$("#forgotPassword").val(""),bootbox.alert(n.msg)):(bootbox.alert("Please check your inbox shortly for an email to reset your password.  If you do not receive an email in your inbox after approximately 10-15 minutes, <b>check your spam/junk mail folder<\/b>.  Thank you. "),$("#forgotPasswordModal").modal("hide"))})):passwordValidator.focusInvalid()}function register(n){var t={username:$("#registerUsername").val(),password:$("#registerPassword").val(),fname:$("#fname").val(),lname:$("#lname").val(),email:$("#email").val(),homePhone:$("#homePhone").val(),mailingaddress:$("#mailingAddress").val(),city:$("#city").val(),state:$("#state").val(),zipcode:$("#zipcode").val(),country:$("#country").val()};$.ajax({type:"POST",url:"/Account/RegisterNewApplicant",data:t,beforeSend:function(){n.addClass("disabled").prop("disabled",!0)}}).done(function(t){n.removeClass("disabled").addClass("btn-primary").prop("disabled",!1);t.haserrors?(bootbox.alert(t.msg),$("#registerModal").modal("hide")):appType==="shortform"?($("#registerModal").modal("hide"),$("#myModal").modal("show"),$("#internalModalContainer").show()):appType==="online"?passRequired?($("#registerModal").modal("hide"),$("#myModal").modal("show"),$("#internalModalContainer").show()):bootbox.alert("Registration Successful!  You are now logged-in and will be redirected to the application pages of this job posting.",function(){applyReg()}):appType==="shortandlong"?($("#registerModal").modal("hide"),bootbox.alert("Registration Successful!  You are now logged-in and able to apply.",function(){window.location.reload()})):bootbox.alert("Registration Successful!  You are now logged-in and will be redirected to the application pages of this job posting.",function(){applyReg()})})}$(document).ready(function(){var i,r,f,e;if($(window).bind("pageshow",function(n){n.originalEvent.persisted&&window.location.reload()}),postingVideo.indexOf("embed")!=-1){var s=postingVideo.split("embed/"),t=s[1],h=t.indexOf("&quot"),c=t.substring(0,h);$("#videoContainer").html('<iframe width="100%" height="100%" src="https://www.youtube.com/embed/'+c+'" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen><\/iframe>')}else if(postingVideo.indexOf(".be")!=-1)i=postingVideo.split("be/"),r=i[1],$("#videoContainer").html('<iframe width="100%" height="100%" src="https://www.youtube.com/embed/'+r+'" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen><\/iframe>');else if(postingVideo.indexOf("list")!=-1){var l=postingVideo.split("watch?v="),u=l[1],a=u.indexOf("&amp;"),v=u.substring(0,a);$("#videoContainer").html('<iframe width="100%" src="https://www.youtube.com/embed/'+v+'" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen><\/iframe>')}else f=postingVideo.split("="),e=f[1],$("#videoContainer").html('<iframe width="100%" height="100%" src="https://www.youtube.com/embed/'+e+'" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen><\/iframe>');$("#linksHeader").hide();$("#internalModalContainer").hide();$.trim($("#links").text())===""&&$("#links").hide();(_showJobDescriptionsLink==="True"||$.trim($("#links").text())!=="")&&$("#linksHeader").show();_showJobDescriptionsLink==="False"&&$.trim($("#links").text())===""&&($("#linksHeader").hide(),$("#districtLinks").hide());_showJobDescriptionsLink==="False"&&$("#jobDescLink").hide();populateselect($("#state"),states,!0,"");showJobPostingInfo();var n=$("#signInForm").validate({debug:!0,errorElement:"span",errorClass:"help-block errortext",errorPlacement:function(n,t){t.before(n)},success:function(n){n.remove()},rules:{username:"required",password:"required"},messages:{username:"Username is required",password:"Password is required"},onsubmit:!1}),y=$("#wishListSignInForm").validate({debug:!0,errorElement:"span",errorClass:"help-block errortext",errorPlacement:function(n,t){t.before(n)},success:function(n){n.remove()},rules:{username:"required",password:"required"},messages:{username:"Username is required",password:"Password is required"},onsubmit:!1}),o=$("#registerModalForm").validate({debug:!0,errorElement:"span",errorClass:"help-block errortext",errorPlacement:function(n,t){t.before(n)},success:function(n){n.remove()},rules:{fname:"required",lname:"required",email:{required:!0,email:!0,equalTo:"#email"},confirmEmail:{required:!0,equalTo:"#email"},homePhone:"required",mailingAddress:"required",city:"required",username:"required",password:{required:!0,minlength:6},confirmPassword:{required:!0,equalTo:"#registerPassword"}},messages:{fname:"First name is required",lname:"Last name is required",email:{required:"Email is required",equalTo:"Please enter a valid email address"},confirmEmail:{required:"Confirm email is required",equalTo:"Email and Verify Email must match"},homePhone:"Home phone is required",mailingAddress:"Mailing address is required",city:"City is required",username:"Username is required",password:{required:"Password is required",minlength:"Password must be at least 6 characters long"},confirmPassword:{required:"Confirm password is required",equalTo:"Password and Verify Password must match"}},onsubmit:!1});$("#signInModal").on("click","#btnClearSignIn",function(t){t.preventDefault();$("#username").empty();$("#password").empty();n.resetForm()});$("#wishListModal").on("click","#btnClearSignIn",function(n){n.preventDefault();$("#username").empty();$("#password").empty();y.resetForm()});$("#signInModalContainer").on("submit","#signInForm",function(t){t.preventDefault();$("#signInForm").valid()?validatelogin():n.focusInvalid()});$("#signInModal").on("click","#registerLink",function(n){n.preventDefault();window.open($(this).attr("href"),"_blank");location.reload()});$("#signInForm").on("keydown",function(t){var i=t.keyCode?t.keyCode:t.which?t.which:t.charCode;i===13&&($("#signInForm").valid()?validatelogin():n.focusInvalid())});$("#registerModal").on("click","#btnRegister",function(n){var t=$(this);n.preventDefault();$("#registerModalForm").valid()?register(t):o.focusInvalid()});$("#registerModalForm").on("keydown",function(n){var t=$(this),i=n.keyCode?n.keyCode:n.which?n.which:n.charCode;i===13&&($("#registerModalForm").valid()?register(t):o.focusInvalid())});$("#forgotPasswordModal").on("submit","#forgotForm",function(n){n.preventDefault();resetPassword()});$("#signInModalContainer").on("click","#forgotbtn",function(){$("#signInModal").modal("hide")});$("#wishListModalContainer").on("click","#forgotbtn",function(){$("#wishListModal").modal("hide")});optionShow1=="False"?($("#option1").show(),$("#printOption1").show()):($("#option1").hide(),$("#printOption1").hide());optionShow2=="False"?($("#option2").show(),$("#printOption2").show()):($("#option2").hide(),$("#printOption2").hide());optionShow3=="False"?($("#option3").show(),$("#printOption3").show()):($("#option3").hide(),$("#printOption3").hide());optionShow4=="False"?($("#option4").show(),$("#printOption4").show()):($("#option4").hide(),$("#printOption4").hide());optionShow5=="False"?($("#option5").show(),$("#printOption5").show()):($("#option5").hide(),$("#printOption5").hide());optionShow6=="False"?($("#option6").show(),$("#printOption6").show()):($("#option6").hide(),$("#printOption6").hide());optionShow7=="False"?($("#option7").show(),$("#printOption7").show()):($("#option7").hide(),$("#printOption7").hide());$("#internalModalContainer").on("submit","#internalForm",function(n){n.preventDefault();$("#dialogError").empty();$("#inhousePassword").val().length>0?$.ajax({type:"POST",url:"/Apps/CheckInternalPostPassword",data:{postingID:postingID,password:$("#inhousePassword").val(),app:appType,isLong:isLong},beforeSend:function(){$("#btnPasswordSubmit").removeClass("btn-primary").addClass("disabled").prop("disabled",!0)}}).done(function(n){$("#btnPasswordSubmit").removeClass("disabled").addClass("btn-primary").prop("disabled",!1);n.haserrors?$("#dialogError").text(n.msg):window.location=n.data}):$("#dialogError").text("Password is required")});$(".row").on("click",".btnapply",function(n){n.preventDefault();isLong=!0;appType=="offsite"?window.location=offsiteurl:userID==0?$("#signInModal").modal("show"):(appType=="shortandlong"&&(isInHouse?openLoginModal():applyReg()),appType=="online"&&(passRequired?openLoginModal():applyReg()))});$(".row").on("click",".btnapplySF",function(n){n.preventDefault();isLong=!1;userID==0?$("#signInModal").modal("show"):(appType=="shortform"||appType=="shortandlong")&&openLoginModal()});$(".printHide").on("click","#btndescription",function(n){n.preventDefault();var t=$(this).data("descriptionid");window.open("/Home/JobDescription/"+t,"Popup","height=600,width=800,scrollbars=1,menubar=1")});$(".printHide").on("click","#btnPdfDescription",function(n){n.preventDefault();window.open("/JobDescriptions/"+AccountID+"/"+JobDescriptionURL,"Popup","height=600,width=800,scrollbars=1,menubar=1")})});$("#lnkViewWish").on("click",function(n){n.preventDefault();var t=$(this);userID==0?bootbox.confirm("You must be logged in to view your wish list.  Click the <b>OK<\/b> button to login or click <b>Cancel<\/b> to stay on the current page.",function(n){if(n){$("#wishListModal").modal("show");$("#wishListModalContainer").on("submit","#wishListSignInForm",function(n){n.preventDefault();$("#wishListSignInForm").valid()?validateLoginForWish(t):wishListValidator.focusInvalid()});$("#wishListSignInForm").on("keydown",function(n){var i=n.keyCode?n.keyCode:n.which?n.which:n.charCode;i===13&&($("#wishListSignInForm").valid()?validateLoginForWish(t):wishListValidator.focusInvalid())})}}):window.location=viewWishlist});$("#lnkaddWish").on("click",function(n){n.preventDefault();var t=$(this);userID==0?bootbox.confirm("You must be logged in to add this job to your wish list.  Click the <b>OK<\/b> button to login or click <b>Cancel<\/b> to stay on the current page.",function(n){if(n){$("#wishListModal").modal("show");$("#wishListModalContainer").on("submit","#wishListSignInForm",function(n){n.preventDefault();$("#wishListSignInForm").valid()?validateLoginForWish(t):wishListValidator.focusInvalid()});$("#wishListSignInForm").on("keydown",function(n){var i=n.keyCode?n.keyCode:n.which?n.which:n.charCode;i===13&&($("#wishListSignInForm").valid()?validateLoginForWish(t):wishListValidator.focusInvalid())})}}):userID>0&&btnInfo()});var keeponline="false";$('input[type="checkbox"]').on("change",function(n){n.target.checked?(keeponline="true",$("#keepLoggedInModal").modal(),$("#signInModal").modal("hide"),$("#wishListModal").modal("hide")):keeponline="false"});$("#keepLoggedInModal").on("click","#btnKeepLoggedIn",function(n){n.preventDefault();$("#keepLoggedIn").prop("checked")?keeponline="true":(keeponline="false",$("#keepLoggedInModal").modal("hide"));$("#keepLoggedInModal").modal("hide");$("#signInModal").modal()})