text: function processTimeShift(e){if(null!=e){var t=[{label:"None Selected",value:-1}];e.forEach(function(e){var a={label:e.timeShiftName,value:parseInt(e.timeShiftId)};t.push(a)});var a=$("#candidateTimeShiftPref");a.multiselect({nonSelectedText:"None Selected",includeSelectAllOption:!0,maxHeight:300}),a.multiselect("dataprovider",t),a.multiselect("rebuild")}}function processEducation(e){if(null!=e){var t=[{label:"None Selected",value:-1}];e.forEach(function(e){var a={label:e.educationName,value:parseInt(e.educationId)};t.push(a)});var a=$("#candidateHighestEducation");a.multiselect({nonSelectedText:"None Selected",includeSelectAllOption:!0,maxHeight:300}),a.multiselect("dataprovider",t),a.multiselect("rebuild")}}function processDegree(e){if(null!=e){var t=[{label:"None Selected",value:-1}];e.forEach(function(e){var a={label:e.degreeName,value:parseInt(e.degreeId)};t.push(a)});var a=$("#candidateHighestDegree");a.multiselect({nonSelectedText:"None Selected",includeSelectAllOption:!0,maxHeight:300}),a.multiselect("dataprovider",t),a.multiselect("rebuild")}}function processLanguage(e){var t=[],a=[];e.forEach(function(e){void 0;var n=e.languageId,o=e.languageName,l={};l.id=n,l.name=o,t.push(o),a.push(n);$("<option value="+n+"></option>").text(o);langArray.push(l)}),populateLanguages(t.reverse(),a.reverse())}function populateLanguages(e,t){var a,n=document.getElementById("language_details");for(a=0;a<e.length;a++)if(1==t[a]||2==t[a]||3==t[a]||4==t[a]||5==t[a]){var o=document.createElement("div");o.className="col-xs-12 col-sm-3",o.style="padding-top:8px",n.appendChild(o);var l=document.createElement("div");l.className="col-xs-12 col-sm-3",n.appendChild(l);var d=document.createElement("div");d.className="col-xs-12 col-sm-3",n.appendChild(d);var r=document.createElement("div");r.className="col-xs-12 col-sm-3",n.appendChild(r);var i=document.createElement("font");i.style="font-size:16px;font-weight:bold",o.appendChild(i);var c=document.createElement("div");l.appendChild(c);var s=document.createElement("div");d.appendChild(s);var p=document.createElement("div");r.appendChild(p),i.innerHTML='<span style="margin-top:8px">'+e[a]+"</span>",c.innerHTML='<div class="btn-group" style="margin:6px 0px" data-toggle="buttons"><label class="btn btn-custom-check"><input id='+t[a]+' type="checkbox" name="u" value=0 >Understand</label></div>',s.innerHTML='<div class="btn-group" style="margin:6px 0px" data-toggle="buttons"><label class="btn btn-custom-check"><input id='+t[a]+' type="checkbox" name="s" value=0 >Speak</label></div>',p.innerHTML='<div class="btn-group" style="margin:6px 0px"  data-toggle="buttons"><label class="btn btn-custom-check"><input id='+t[a]+' type="checkbox" name="rw" value=0 >Read/Write</label></div>'}}function processDataGetAssets(e){var t=$("#assets_details");e.forEach(function(e){void 0;var a=document.createElement("div");a.className="col-xs-12 col-sm-3 col-md-3",t.append(a);var n=document.createElement("label");n.type="checkbox",n["for"]="assetsCheckbox_"+e.assetTitle,n.style="margin:4px 10px",a.appendChild(n);var o=document.createElement("input");o.type="checkbox",o.id="assetsCheckboxId_"+e.assetId;var l=document.createElement("font");l.textContent=e.assetTitle,l.style="margin:8% 4%",a.appendChild(l),n.appendChild(o)})}function processIdProofsWithNumbers(e){if(null!=e){var t=$("#document_details");e.forEach(function(e){void 0;var a=document.createElement("div");a.className="col-sm-6 col-md-4",a.id="document_response_checkbox",t.append(a);var n=document.createElement("div");n.className="row",n.id="document_response_checkbox",n.style="padding:2% 0",a.appendChild(n);var o=document.createElement("div");o.className="row",o.id="document_response_input_"+e.idProofId,o.style="padding:2% 2%;display:none;",a.appendChild(o);var l=document.createElement("label");l.type="checkbox",l["for"]="idProofCheckbox_"+e.idProofId,l.style="margin:4px 10px",n.appendChild(l);var d=document.createElement("input");d.type="checkbox",d.id="idProofCheckbox_"+e.idProofId,d.onclick=function(){1==$("#idProofCheckbox_"+e.idProofId).prop("checked")?$("#document_response_input_"+e.idProofId).css("display","block"):($("#document_response_input_"+e.idProofId).css("display","none"),$("#Invalid_"+e.idProofId).css("display","none"))},l.appendChild(d);var r=document.createElement("font");r.textContent=e.idProofName,r.style="margin:8% 4%",n.appendChild(r);var i=document.createElement("p");i.id="Invalid_"+e.idProofId,i.textContent="(Invalid Number)",i.style="color:#ff1744;display:none;margin:1px 0 1px 42px;font-size:12px",n.appendChild(i);var c=document.createElement("p");c.id="idProofValueTd_"+e.idProofId,o.appendChild(c);var s=document.createElement("INPUT");s.className="form-control",s.setAttribute("type","text"),s.oninput=validateInput,s.placeholder=e.idProofName+" Number",s.setAttribute("id","idProofValue_"+e.idProofId),c.appendChild(s)})}}function validateInput(e,t){return null!=e&&null!=t||(e=this.id.split("_")[1],t=this.value),!$("input#idProofCheckbox_"+e).is(":checked")||(3==e?validateAadhar(t)?($("#Invalid_"+e).css("display","none"),!0):($("#Invalid_"+e).css("display","block"),!1):1==e?validateDL(t)?($("#Invalid_"+e).css("display","none"),!0):($("#Invalid_"+e).css("display","block"),!1):2==e?validatePASSPORT(t)?($("#Invalid_"+e).css("display","none"),!0):($("#Invalid_"+e).css("display","block"),!1):4!=e||(validatePAN(t)?($("#Invalid_"+e).css("display","none"),!0):($("#Invalid_"+e).css("display","block"),!1)))}function processAllJobRole(e,t){var a=[];null!=e&&0==jobRoleArray.length&&e.forEach(function(e){var t=e.jobName,n=parseInt(e.jobRoleId),o={};o.id=n,o.name=t,jobRoleArray.push(o),a.push(o)}),null!=jobRoleArray&&jobRoleArray.length>0&&$("#workedJobRole_"+t).tokenInput(jobRoleArray,{theme:"facebook",placeholder:"Job Role?",hintText:"Select job role",minChars:0,tokenLimit:1,zindex:9999,preventDuplicates:!0})}function getJobRoleArray(){return jobRoleArray}function processLocality(e){var t=[];null!=e&&(e.forEach(function(e){var a=e.localityId,n=e.localityName,o={};o.id=a,o.name=n,localityArray.push(o),t.push(o)}),null!=localityArray&&$("#candidateHomeLocality").tokenInput(getLocalityArray(),{theme:"facebook",placeholder:"job Localities?",hintText:"Start typing Area (eg. BTM Layout, Bellandur..)",minChars:0,tokenLimit:1,zindex:9999,preventDuplicates:!0}))}function getLocalityArray(){return localityArray}function openCandidatePreScreenModal(e,t){if(null!=t){var a="/support/api/getJobPostVsCandidate/";if(t=t.substring(3),null==a||null==e)return;if(a+="?",null!=e&&(a+="jobPostId="+e),null!=t&&(a+="&candidateMobile="+t),a+="&rePreScreen="+!0,1==modalOpenAttempt&&shouldShowPSModal&&$("#preScreenModal").modal(),0==modalOpenAttempt){modalOpenAttempt=1;try{$.ajax({type:"POST",url:"/getJobPostInfo/"+e+"/0",data:!1,contentType:!1,processData:!1,async:!1,success:processDataForJobPostLocationPrescreen})}catch(n){void 0}try{$.ajax({type:"GET",url:a,data:!1,async:!1,contentType:!1,processData:!1,success:processPreScreenData})}catch(n){void 0}}}}function processDataForJobPostLocationPrescreen(e){jobPostInfo=e,$("#ps_jobNameConfirmation").html(e.jobPostTitle),$("#ps_companyNameConfirmation").html(e.company.companyName)}function processPreScreenData(e){if(null==e||"SUCCESS"!=e.status)return null!=e&&"INVALID"==e.status?$.notify("Already Pre Screened","error"):$.notify("Request failed. Something went Wrong! Please Refresh","error"),void(shouldShowPSModal=!1);if(null==e.elementList||0==e.elementList.length){shouldShowPSModal=!1,$("#preScreenModal").modal("hide");var t=!0;return nfy("Interview Submitted successfully. ","success"),null!=jobPostInfo.recruiterProfile?(jobPostInfo.recruiterProfile.contactCreditCount>0&&(t=!0),jobPostInfo.recruiterProfile.interviewCreditCount>0&&(t=!1)):t=!1,t&&($("#postApplyMsg").html("We have received your job application. You can contact the recruiter directly on "+jobPostInfo.recruiterProfile.recruiterProfileMobile),$("#confirmationModal").modal("show")),void $.notify("Job Application Successfully Completed ","success")}if(!e.visible)return shouldShowPSModal=!1,void 0,$.notify("Job Application Successfully Completed ","success"),$("#preScreenModal").modal("hide"),void(e.interviewRequired?initInterviewModal(e.candidateId,e.jobPostId,!1):($("#postApplyMsg").html("We have received your job application. You can contact the recruiter directly on "+jobPostInfo.recruiterProfile.recruiterProfileMobile),$("#confirmationModal").modal("show")));void 0,$("html").removeClass("modal-open").addClass("modal-open"),$.notify("Please complete Job Application form","success");var a=$("#missingInfo"),n=document.createElement("div");n.className="row",a.append(n);var o=document.createElement("div");o.className="col-sm-12",o.setAttribute("data-toggle","collapse"),o.setAttribute("href","#jobDetailsInfoFillCol"),n.appendChild(o);var l=document.createElement("p");l.textContent="Please provide following details to apply for this job",l.id="panelHeader",l.onclick=function(){1==$("#jobDetailsInfoFillCol").hasClass("in")?$("#collapseIcon").removeClass("glyphicon-chevron-up").addClass("glyphicon-chevron-down"):$("#collapseIcon").removeClass("glyphicon-chevron-down").addClass("glyphicon-chevron-up")},o.appendChild(l);var d=document.createElement("span");d.className="glyphicon glyphicon-chevron-up pull-right",d.id="collapseIcon",d.setAttribute("aria-hidden",!0),l.appendChild(d);var r=document.createElement("div");r.style="padding:0 4%",r.id="jobDetailsInfoFillCol",r.className="col-sm-12 panel-collapse collapse in",n.appendChild(r);var i=document.createElement("ol");if(i.className="list-group",r.appendChild(i),propertyIdArray=[],null!=e){var c=e.elementList;candidateId=e.candidateId,jpId=e.jobPostId,c.forEach(function(e){var t,a,n,o="POST";if(null!=e){if(0==e.propertyId&&0==e.isMatching){propertyIdArray.push(e.propertyId);var l=[],d=e.jobPostElementList;d.forEach(function(e){l.push(e.object)});var r=document.createElement("li");r.textContent="Do you have the following document(s) ?",r.style="color:#09ac58",r.id="property_"+e.propertyId;var c=document.createElement("div");c.className="row";var s=document.createElement("div");s.className="col-sm-12 col-md-12",s.id="document_details",s.style="padding:2%",c.appendChild(s),r.appendChild(c),n=l,t=null,a=function(){processIdProofsWithNumbers(n)},i.appendChild(r)}else if(1==e.propertyId&&0==e.isMatching){propertyIdArray.push(e.propertyId);var p=[],d=e.jobPostElementList;d.forEach(function(e){p.push(e.object)});var m=document.createElement("li");m.textContent="Do you know following language(s) ?",m.id="property_"+e.propertyId;var c=document.createElement("div");c.className="row";var u=document.createElement("div");u.className="col-sm-12",u.id="language_details",u.style="padding:1%;",c.appendChild(u),m.appendChild(c),n=p,t=null,a=function(){processLanguage(n)},i.appendChild(m)}else if(2==e.propertyId&&0==e.isMatching){propertyIdArray.push(e.propertyId);var h=[],d=e.jobPostElementList;d.forEach(function(e){h.push(e.object)});var r=document.createElement("li");r.textContent="Do you own any of the following ?",r.id="property_"+e.propertyId;var c=document.createElement("div");c.className="row";var v=document.createElement("div");v.className="col-md-12",v.id="assets_details",v.style="padding:2% 0",n=h,t=null,a=function(){processDataGetAssets(n)},c.appendChild(v),r.appendChild(c),i.appendChild(r)}else if(3==e.propertyId&&0==e.isMatching&&null==e.candidateElement){propertyIdArray.push(e.propertyId);var y=document.createElement("li");y.textContent="Please mention your date of birth",y.id="property_"+e.propertyId,i.appendChild(y);var c=document.createElement("div");c.className="row";var f=document.createElement("div");f.className="col-xs-12 col-sm-5",f.style="padding:2% 3%",c.appendChild(f);var C=document.createElement("div");C.className="col-xs-12 col-sm-6",C.style="padding:1%",c.appendChild(C);var g=document.createElement("font");g.textContent="Date of birth",g.style="font-weight:bold",f.appendChild(g);var b=document.createElement("select");b.className="selectDropDown",b.id="dob_day",b.style="margin:0 1%",C.appendChild(b);var E=document.createElement("option");E.textContent="Day",b.appendChild(E);var x;for(x=1;x<=31;x++){var I=document.createElement("option");I.value=("0"+x).slice(-2),I.textContent=x,b.appendChild(I)}var N=document.createElement("select");N.className="selectDropDown",N.id="dob_month",N.style="margin:0 1%",C.appendChild(N);var k=document.createElement("option");for(k.textContent="Month",N.appendChild(k),x=1;x<=12;x++){I=document.createElement("option"),I.value=("0"+x).slice(-2);var w;switch(x){case 1:w="January";break;case 2:w="February";break;case 3:w="March";break;case 4:w="April";break;case 5:w="May";break;case 6:w="June";break;case 7:w="July";break;case 8:w="August";break;case 9:w="September";break;case 10:w="October";break;case 11:w="November";break;case 12:w="December"}I.textContent=w,N.appendChild(I)}var S=document.createElement("select");S.className="selectDropDown",S.id="dob_year",S.style="margin:0 1%",C.appendChild(S);var _=document.createElement("option");for(_.textContent="Year",S.appendChild(_),x=(new Date).getFullYear()-19;x>=(new Date).getFullYear()-80;x--)I=document.createElement("option"),I.value=x,I.textContent=x,S.appendChild(I);y.appendChild(c),i.appendChild(y)}else if(4==e.propertyId&&0==e.isMatching&&null==e.candidateElement&&null==e.candidateElementList){propertyIdArray.push(e.propertyId);var P=document.createElement("li");P.textContent="Do you have work experience?",P.id="property_"+e.propertyId;var c=document.createElement("div");c.className="row";var A=document.createElement("div");A.className="row",A.style="display: none;",A.id="companyDetailsCapture";var D=document.createElement("p");D.textContent="Where all have you worked before? ",D.style="margin-left:10px",A.appendChild(D);var j=document.createElement("div");j.className="row",j.id="row_1",j.style="margin:4px 0",A.appendChild(j);var M=document.createElement("div");M.className="col-sm-3",M.id="companyName",j.appendChild(M);var L=document.createElement("div");L.className="col-sm-3",L.id="workedJobRole",j.appendChild(L);var T=document.createElement("div");T.className="col-sm-4",T.id="workedCurrently",T.style="padding-top:1%;text-align:center",j.appendChild(T);var W=document.createElement("div");W.className="col-sm-2",j.appendChild(W);var R=document.createElement("input");R.className="form-control",R.type="text",R.placeholder="Company Name",R.id="companyName_1",R.onchange=enableAddBtn,M.appendChild(R);var J=document.createElement("input");J.id="workedJobRole_1",J.onchange=enableAddBtn,L.appendChild(J);var H=document.createElement("input");H.type="radio",H.style="margin:0 4%;",H.id="addCurrentlyWorking_1",H.name="addCurrently_Working",H.setAttribute("disabled",!0),H.value=0,T.appendChild(H);var B=document.createElement("button");B.className="form-control",B.type="button",B.setAttribute("disabled",!0),B.id="addCurrentlyWorkingBtn_1",B.value="Add",B.name="Add",B.style="background:#09ac58;color:#fff;font-size:12px",B.textContent="Add Company",B.onclick=addmoreCompany,W.appendChild(B),H.type="radio",H.style="margin:0 4%",H.id="addCurrentlyWorking_"+companyCount,H.name="addCurrently_Working",T.appendChild(H);var F=document.createElement("label");F.textContent="Is this your current company",F["for"]="addCurrentlyWorking_1",T.appendChild(F),t="/getAllJobs ",a=function(e){processAllJobRole(e,1),t=""};var O=document.createElement("div");O.className="col-xs-12 col-md-12",O.style="padding:2% 0;",c.appendChild(O);var Y=document.createElement("div");Y.className="col-xs-12 col-sm-5",Y.id="experienceQuestion",Y.style="padding:2% 3%;display:none",c.appendChild(Y);var Q=document.createElement("p");Q.textContent="How many year(s) of work experience do you have?",Y.appendChild(Q);var V=document.createElement("div");V.className="col-xs-12 col-md-6",V.id="experienceDuration",V.style="display:none;padding:1%",c.appendChild(V);var z=document.createElement("div");z.className="col-xs-12 col-sm-3 ",O.appendChild(z);var U=document.createElement("div");U.className="col-xs-12 col-sm-4",O.appendChild(U);var G=document.createElement("input");G.type="radio",G.id="candidateFresh",G.name="candidateExperience",G.value=0,G.onchange=hideExperienceCaptureDiv,z.appendChild(G);var q=document.createElement("label");q.textContent="I'm a fresher",q["for"]="candidateFresh",z.appendChild(q);var K=document.createElement("input");K.type="radio",K.id="candidateExp",K.name="candidateExperience",K.value=1,K.onchange=showExperienceCaptureDiv,U.appendChild(K);var X=document.createElement("label");X.textContent="I have work experience",X["for"]="candidateExp",U.appendChild(X);var Z=document.createElement("input");Z.className="form-control",Z.type="number",Z.value=0,Z.oninput=showExperienceBox,Z.id="candidateTotalExperienceYear",V.appendChild(Z);var ee=document.createElement("font");ee.textContent="Years",ee.style="font-weight:bold",V.appendChild(ee);var te=document.createElement("input");te.className="form-control",te.type="number",te.value=0,te.id="candidateTotalExperienceMonth",te.oninput=showExperienceBox,V.appendChild(te);var ae=document.createElement("font");ae.textContent="Months",ae.style="font-weight:bold",V.appendChild(ae);var ne=document.createElement("div");ne.className="col-xs-12 col-md-10",ne.id="experienceCurrently",ne.style="padding:2% 3%;display:none",c.appendChild(ne);var oe=document.createElement("p");oe.textContent="Are you currently working : ",ne.appendChild(oe);var le=document.createElement("input");le.id="currentlyWorking",le.type="checkbox",le.style="margin:0 2% 0 4%",le.onclick=disableCurrentCompanyOption,oe.appendChild(le);var de=document.createElement("label");de.textContent="Yes",de["for"]="currentlyWorking",oe.appendChild(de),P.appendChild(c),P.appendChild(A),i.appendChild(P)}else if(5==e.propertyId&&0==e.isMatching&&null==e.candidateElement&&null==e.candidateElementList){propertyIdArray.push(e.propertyId);var re=document.createElement("li");re.textContent="Please provide your education details",re.id="property_"+e.propertyId;var ie=document.createElement("div");ie.className="row",re.appendChild(ie);var ce=document.createElement("div");ce.className="row",re.appendChild(ce);var se=document.createElement("div");se.className="row",re.appendChild(se);var pe=document.createElement("div");pe.className="row",re.appendChild(pe);var me=document.createElement("div");me.className="col-xs-12 col-sm-5",me.id="education_details",ie.appendChild(me);var ue=document.createElement("div");ue.className="col-xs-12 col-sm-6",ue.id="education_details",ue.style="padding:1%",ie.appendChild(ue);var he=document.createElement("font");he.textContent="Highest education qualification? ",he.style="font-weight:bold;",me.appendChild(he);var ve=document.createElement("select");ve.id="candidateHighestEducation",ue.appendChild(ve);var ye=document.createElement("div");ye.className="col-xs-12 col-sm-5",ye.id="education_details",ce.appendChild(ye);var fe=document.createElement("div");fe.className="col-xs-12 col-sm-6",fe.id="education_details",fe.style="padding-top:3%",ce.appendChild(fe);var Ce=document.createElement("font");Ce.textContent="Have you successfully completed this course? ",Ce.style="font-weight:bold;",ye.appendChild(Ce);var ge=document.createElement("input");ge.type="radio",ge.style="margin:0 4% 0 0",ge.id="successYes",ge.name="candidateEducationCompletionStatus",ge.value=1,fe.appendChild(ge);var be=document.createElement("label");be.textContent="Yes",be["for"]="successConformationHEQ",fe.appendChild(be);var Ee=document.createElement("input");Ee.type="radio",Ee.style="margin:0 4% 0 8%",Ee.id="successNo",Ee.name="candidateEducationCompletionStatus",Ee.value=0,fe.appendChild(Ee);var xe=document.createElement("label");xe.textContent="No",xe["for"]="successConformationHEQ",fe.appendChild(xe);var Ie=document.createElement("div");Ie.className="col-xs-12 col-sm-5",Ie.id="education_details",se.appendChild(Ie);var $e=document.createElement("div");$e.className="col-xs-12 col-sm-6",$e.id="education_details",$e.style="padding:1%",se.appendChild($e);var Ne=document.createElement("font");Ne.textContent="Highest education degree? ",Ne.style="font-weight:bold;",Ie.appendChild(Ne);var ke=document.createElement("select");ke.id="candidateHighestDegree",$e.appendChild(ke);var we=document.createElement("div");we.className="col-xs-12 col-sm-5",we.style="padding:2% 3%",pe.appendChild(we);var Se=document.createElement("div");Se.className="col-xs-12 col-sm-6",Se.style="padding:1%",pe.appendChild(Se);var _e=document.createElement("font");_e.textContent="Last attended education institute?",_e.style="margin-top:8px;font-weight:bold",we.appendChild(_e);var Pe=document.createElement("input");Pe.className="form-control",Pe.type="text",Pe.placeholder="School/Institute Name",Pe.id="candidateEducationInstitute",Se.appendChild(Pe),t="/getAllEducation",a=function(e){processEducation(e),t=""},i.appendChild(re)}else if(6==e.propertyId&&0==e.isMatching&&null==e.candidateElement){propertyIdArray.push(e.propertyId);var Ae=document.createElement("li");Ae.textContent="Please mention your gender ",Ae.id="property_"+e.propertyId;var c=document.createElement("div");c.className="row";var De=document.createElement("div");De.className="col-sm-12 col-md-12",De.id="gender_details",De.style="padding:2% 0;";var je=document.createElement("div");je.className="col-xs-12 col-sm-3",De.appendChild(je);var Me=document.createElement("div");Me.className="col-xs-12 col-sm-3",De.appendChild(Me);var Le=document.createElement("label");Le.textContent="Male",Le["for"]="genderMale";var Te=document.createElement("input");Te.type="radio",Te.style="margin:0 8%",Te.id="genderMale",Te.name="gender",Te.value=0;var We=document.createElement("label");We.textContent="Female",We["for"]="genderFemale";var Re=document.createElement("input");Re.type="radio",Re.style="margin:0 8%",Re.id="genderFemale",Re.name="gender",Re.value=1,je.appendChild(Te),je.appendChild(Le),Me.appendChild(Re),Me.appendChild(We),c.appendChild(De),Ae.appendChild(c),i.appendChild(Ae)}else if(7==e.propertyId&&0==e.isMatching&&null==e.candidateElement){propertyIdArray.push(e.propertyId);var Je=document.createElement("li");Je.textContent="Please provide your salary details",Je.id="property_"+e.propertyId;var c=document.createElement("div");c.className="row";var He=document.createElement("div");He.className="col-xs-12 col-sm-5",He.id="salary_details";var Be=document.createElement("div");Be.className="col-xs-12 col-sm-6",Be.id="salary_response",Be.style="padding:1%";var Fe=document.createElement("font");Fe.textContent="Current/last drawn salary",Fe.style="margin-top:8px;font-weight:bold",He.appendChild(Fe);var Oe=document.createElement("input");Oe.className="form-control",Oe.type="number",Oe.placeholder="Salary",Oe.id="candidateLastWithdrawnSalary",Oe.oninput=invalidSalary,Be.appendChild(Oe);var Ye=document.createElement("p");Ye.id="invalidSalaryNotification",Ye.textContent="Invalid Salary Input Please enter a valid 'Last Withdrawn Salary' (Ex: 15000) in a month",Ye.style="color:#ff1744;display:none;margin:1px 0 1px 2px;font-size:12px",Be.appendChild(Ye);var Qe=document.createElement("span");Qe.className="label label-success",Qe.textContent="(InHand/Month)",Qe.style="margin:8px 16px;font-size:12px",He.appendChild(Qe),c.appendChild(He),c.appendChild(Be),Je.appendChild(c),i.appendChild(Je)}else if(8==e.propertyId&&0==e.isMatching&&null==e.candidateElementList){propertyIdArray.push(e.propertyId);var Ve=document.createElement("li");Ve.textContent="Which is your home locality? ",Ve.id="property_"+e.propertyId;var c=document.createElement("div");c.className="row";var ze=document.createElement("div");ze.className="col-sm-12 col-md-12",ze.id="locality_details",ze.style="padding:2%";var Ue=document.createElement("p");Ue.textContent="Locality",Ue.style="margin-left:18px;font-weight:bold";var Ge=document.createElement("input");Ge.id="candidateHomeLocality",Ve.appendChild(Ge),t="/getAllLocality",a=function(e){processLocality(e),t=""},Ue.appendChild(Ge),ze.appendChild(Ue),c.appendChild(ze),Ve.appendChild(c),i.appendChild(Ve)}else if(9==e.propertyId&&0==e.isMatching&&null==e.candidateElement){propertyIdArray.push(e.propertyId);var qe=document.createElement("li");qe.textContent="Time shift preferred",qe.id="property_"+e.propertyId;var c=document.createElement("div");c.className="row";var Ke=document.createElement("div");Ke.className="col-xs-12 col-sm-5",Ke.style="padding:2% 3%",c.appendChild(Ke);var Xe=document.createElement("div");Xe.className="col-xs-12 col-sm-6",Xe.style="padding:1%",c.appendChild(Xe);var Ze=document.createElement("font");Ze.textContent="Time shift",Ze.style="font-weight:bold",Ke.appendChild(Ze);var et=document.createElement("select");et.id="candidateTimeShiftPref",Xe.appendChild(et),t="/getAllShift",a=function(e){processTimeShift(e)},qe.appendChild(c),i.appendChild(qe)}if(null!=t)try{$.ajax({type:o,url:t,data:!1,async:!1,contentType:!1,processData:!1,success:a})}catch(tt){void 0}else void 0,"function"==typeof a&&(a(),a=null);if(5==e.propertyId)try{$.ajax({type:"POST",url:"/getAllDegree",data:!1,contentType:!1,processData:!1,success:processDegree})}catch(tt){void 0}}}),$("#preScreenModal").modal()}}function interviewButtonCondition(e){if(null!=e){var t="/support/api/shouldShowInterview/";if(null==t||null==e)return;t+="?",null!=e&&(t+="jobPostId="+e);try{$.ajax({type:"GET",url:t,data:!1,content:!1,processData:!1,success:function(t){processInterviewBtn(t,e)}})}catch(a){void 0}}}function disableCurrentCompanyOption(){if($("#currentlyWorking").is(":checked")){if($("#currentlyWorking").is(":checked"))for(var e=document.getElementsByName("addCurrently_Working"),t=0;t<e.length;t++)e[t].disabled=!1}else for(var e=document.getElementsByName("addCurrently_Working"),t=0;t<e.length;t++)e[t].disabled=!0,e[t].checked=!1}function enableAddBtn(){var e=this.id.split("_")[1];""==$("#companyName_"+e).val()||""==$("#workedJobRole_"+e).val()?$("#addCurrentlyWorkingBtn_"+e).prop("disabled",!0):$("#addCurrentlyWorkingBtn_"+e).prop("disabled",!1)}function addmoreCompany(){var e,t;if(0!=companyCount&&companyCount<=2){companyCount++;var a=document.createElement("div");a.className="row",a.id="row_"+companyCount,a.style="margin:4px 0";var n=document.createElement("div");n.className="col-sm-3",n.id="companyName",a.appendChild(n);var o=document.createElement("div");o.className="col-sm-3",o.id="workedJobRole",a.appendChild(o);var l=document.createElement("div");l.className="col-sm-4",l.id="workedCurrently",l.style="padding-top:1%;text-align:center",a.appendChild(l);var d=document.createElement("div");d.className="col-sm-2",a.appendChild(d);var r=document.createElement("input");r.className="form-control",r.type="text",r.placeholder="Company Name",r.id="companyName_"+companyCount,n.appendChild(r);var i=document.createElement("input");i.id="workedJobRole_"+companyCount,i.onchange=enableAddBtn,o.appendChild(i);var c=document.createElement("input");$("#currentlyWorking").is(":checked")?c.disabled=!1:c.disabled=!0;var s=document.createElement("button");s.className="form-control",s.type="button",s.setAttribute("disabled",!0),s.id="addCurrentlyWorkingBtn_"+companyCount,s.value="Add",s.style="background:#09ac58;color:#fff;font-size:12px",s.name="Add",s.textContent="Add Company",s.onclick=addmoreCompany,d.appendChild(s),c.type="radio",c.style="margin:0 4%",c.id="addCurrentlyWorking_"+companyCount,c.name="addCurrently_Working",l.appendChild(c);var p=document.createElement("label");p.textContent="Is this your current company",p["for"]="addCurrentlyWorking_"+companyCount,l.appendChild(p);var m=companyCount-1;$("#companyDetailsCapture").append(a),$("#addCurrentlyWorkingBtn_"+m).prop("disabled",!0),e="/getAllJobs ",t=function(t){processAllJobRole(t,companyCount),e=""}}else $.notify("Max 3 Addition Allowed","error");if(null!=e)if(null==jobRoleArray||0==jobRoleArray.length)try{$.ajax({type:"POST",url:e,data:!1,async:!1,contentType:!1,processData:!1,success:t})}catch(u){void 0}else t(null)}function hideExperienceCaptureDiv(){$("#candidateFresh").is(":checked")&&($("#experienceDuration").css("display","none"),$("#experienceQuestion").css("display","none"),$("#experienceCurrently").css("display","none"),$("#companyDetailsCapture").hide())}function showExperienceCaptureDiv(){$("#candidateExp").is(":checked")&&($("#experienceDuration").css("display","block"),$("#experienceQuestion").css("display","block"))}function showExperienceBox(){var e=$("#candidateTotalExperienceYear").val(),t=$("#candidateTotalExperienceMonth").val();!isNaN(e)&&parseInt(e)>0||!isNaN(t)&&parseInt(t)>0?($("#companyDetailsCapture").css("display","block"),$("#experienceCurrently").css("display","block")):($("#companyDetailsCapture").css("display","none"),$("#experienceCurrently").css("display","none"))}function invalidSalary(){var e=$("#candidateLastWithdrawnSalary").val();!isNaN(e)&&parseInt(e)>=1e3&&parseInt(e)<=99e3?$("#invalidSalaryNotification").css("display","none"):$("#invalidSalaryNotification").css("display","block")}function processInterviewBtn(e,t){null!=e&&(e.status==INTERVIEW_REQUIRED?$("#preScreenInterviewSetBtn").html("Schedule Interview"):$("#preScreenInterviewSetBtn").html("Apply"))}function submitPreScreen(){}var langArray=[],currentLocationArray=[],localityArray=[],jobRoleArray=[],propertyIdArray=[],candidateId,jpId,jobPostInfo,shouldShowPSModal=!0,modalOpenAttempt=0,companyCount=1;!function(){$("#preScreenInterviewSetBtn").click(function(){var e,t,a=!0,n=[],o=[],l={};$.each(propertyIdArray,function(d,r){if(a=!0,0==r){var i=[];$("#document_details").each(function(){$(this).find("input[type=checkbox]").each(function(){var e,o={};e=$(this).attr("id").split("_").slice(-1).pop();var l=$("input#idProofCheckbox_"+e).is(":checked"),d=validateInput(e,$("input#idProofValue_"+e).val().trim());if(d&&l?(o.idProofId=parseInt(e),o.idNumber=$("input#idProofValue_"+e).val().trim()):l&&!d&&(a=!1,$.notify("Please provide valid document details.","error")),jQuery.isEmptyObject(o)||i.push(o),!a){var c={propId:r,message:t,submissionStatus:a};n.push(c)}})}),l.idProofWithIdNumberList=i}else if(1==r){var c,s=[];$("#language_details input:checked").map(function(){c=0;var e,t=this.id,a=this.name,n={};for(var o in s)if(s[o].id==t){e=o,c=1;break}0==c?(n.id=t,n.u=0,n.rw=0,n.s=0,"u"==a?n.u=1:"rw"==a?n.rw=1:n.s=1,s.push(n)):"u"==a?s[e].u=1:"rw"==a?s[e].rw=1:s[e].s=1}).get();if(l.candidateKnownLanguageList=s,!a){var p={propId:r,message:t,submissionStatus:a};n.push(p)}}else if(2==r){var m=[];if($("#assets_details input:checked").each(function(){var e=parseInt($(this).attr("id").split("_").slice(-1).pop());m.push(e)}),l.assetIdList=m,!a){var p={propId:r,message:t,submissionStatus:a};n.push(p)}}else if(3==r){if("Day"==$("#dob_day").val()||"Month"==$("#dob_month").val()||"Year"==$("#dob_year").val())a=!1;else var u=$("#dob_year").val()+"-"+$("#dob_month").val()+"-"+$("#dob_day").val();""==u&&(a=!1);var h=String(u),v=new Date(h),y=new Date,f=new Date(y.setFullYear(y.getFullYear()-18));y=new Date;var C=new Date(y.setFullYear(y.getFullYear()-70));if(y=new Date,v>=f&&(e=0,a=!1),v<=C&&(e=0,a=!1),l.candidateDob=h,!a){$.notify("Please provide valid Date of birth","error");var p={propId:r,message:t,submissionStatus:a};n.push(p)}}else if(4==r){0==$('input:radio[name="candidateExperience"]:checked').length&&(a=!1,$.notify("Please select Fresher/Experienced.","error"));var g=parseInt($("#candidateTotalExperienceMonth").val()),b=parseInt($("#candidateTotalExperienceYear").val()),E=g+12*b,x=0==$("#candidateTotalExperienceMonth").val()&&0==$("#candidateTotalExperienceYear").val();
  $("input[id=candidateExp]").is(":checked")&&x&&($.notify("Please provide your total years of experience","error"),a=!1),$("input[id=candidateExp]").is(":checked")&&$("#currentlyWorking").is(":checked")&&!$("input[name=addCurrently_Working]").is(":checked")&&($.notify("Please provide your current company details and mark appropriately.","error"),a=!1);var I=1;for(o=[],I;I<=3;I++){var N={};""==$("#companyName_"+I).val()&&$("#workedJobRole_"+I).val()>0&&(t="please provide company name",$.notify("please provide company name","error"),a=!1),""!=$("#companyName_"+I).val()&&$("#workedJobRole_"+I).val()<0&&(t+=" | please provide Job Role",$.notify("please provide Job Role","error"),a=!1),""!=$("#companyName_"+I).val()&&$("#workedJobRole_"+I).val()>0&&(N.companyName=$("#companyName_"+I).val(),N.jobRoleId=$("#workedJobRole_"+I).val(),N.current=$("#addCurrentlyWorking_"+I).is(":checked")),jQuery.isEmptyObject(N)||o.push(N)}if(l.candidateTotalExperience=E,l.pastCompanyList=o,l.candidateIsEmployed=$("#currentlyWorking").is(":checked"),l.extraDetailAvailable=!0,!a){var p={propId:r,message:t,submissionStatus:a};n.push(p)}}else if(5==r){if(l.candidateEducationLevel=$("#candidateHighestEducation").val(),l.candidateDegree=$("#candidateHighestDegree").val(),l.candidateEducationInstitute=$("#candidateEducationInstitute").val(),l.candidateEducationCompletionStatus=parseInt($('input:radio[name="candidateEducationCompletionStatus"]:checked').val()),("-1"==$("#candidateHighestEducation").val()||$("#candidateHighestEducation").val()>3||null==$('input:radio[name="candidateEducationCompletionStatus"]:checked').val())&&("-1"!=$("#candidateHighestDegree").val()&&""!=$("#candidateEducationInstitute").val()||(a=!1,$.notify("Please provide full education details","error"))),!a){var p={propId:r,message:t,submissionStatus:a};n.push(p)}}else if(6==r){if(l.candidateGender=$('input:radio[name="gender"]:checked').val(),0==$('input:radio[name="gender"]:checked').length&&(a=!1,$.notify("Please provide your gender details","error")),!a){var p={propId:r,message:t,submissionStatus:a};n.push(p)}}else if(7==r){var k=$("#candidateLastWithdrawnSalary").val();if(!isNaN(k)&&parseInt(k)>=1e3&&parseInt(k)<=1e5)l.candidateLastWithdrawnSalary=parseInt($("#candidateLastWithdrawnSalary").val());else if(a=!1,$.notify("Please enter a valid 'Last Withdrawn Salary' per month. (Min: 1000, Max: 1,00,000)","error"),!a){var p={propId:r,message:"Please enter a valid 'Last Withdrawn Salary' per month. (Min: 1000, Max: 1,00,000)",submissionStatus:a};n.push(p)}}else if(8==r){var w=$("#candidateHomeLocality").val();if(null==w?(a=!1,$.notify("Please enter a valid Locality","error")):l.candidateHomeLocality=parseInt(w),!a){var p={propId:r,message:"Please enter a valid Home locality",submissionStatus:a};n.push(p)}}else if(9==r){var S=$("#candidateTimeShiftPref").val();if("-1"==S?(a=!1,$.notify("Please enter a valid time/shift preference (ex: Part time, Full time)","error")):l.candidateTimeShiftPref=$("#candidateTimeShiftPref").val(),!a){var p={propId:r,message:"Please enter a valid time preference",submissionStatus:a};n.push(p)}}});var d=!1;if(0==n.length){$("#preScreenInterviewSetBtn").prop("disabled",!0),$("#preScreenInterviewSetBtn").click(function(){return!1}),$("#preScreenInterviewSetBtn").unbind(),$("#preScreenInterviewSetBtn").removeAttr("onclick");try{$.ajax({type:"POST",url:"/updateCandidateDetailsViaPreScreen/?propertyIdList="+propertyIdArray+"&candidateMobile="+localStorage.getItem("mobile")+"&jobPostId="+jpId,contentType:"application/json; charset=utf-8",data:JSON.stringify(l),success:function(e){e.status==INTERVIEW_REQUIRED?($("#preScreenModal").modal("hide"),initInterviewModal(candidateId,jpId,d)):e.status==INTERVIEW_NOT_REQUIRED?($("#preScreenModal").modal("hide"),$("#postApplyMsg").html("We have received your job application. You can contact the recruiter directly on "+jobPostInfo.recruiterProfile.recruiterProfileMobile),$("#confirmationModal").modal("show"),$.notify("Successfully Submitted Application form. Thanks !","success")):$.notify("Something went wrong. Please try again !","success")}})}catch(r){void 0}return!0}})}();