var url="assets/json/",allJobList="",prevButton=document.getElementById("page-prev"),nextButton=document.getElementById("page-next"),currentPage=1,itemsPerPage=8,getJSON=function(e,t){var a=new XMLHttpRequest;a.open("GET",url+e,!0),a.responseType="json",a.onload=function(){var e=a.status;t(200===e?null:e,a.response)},a.send()};function loadJobListData(e,t){var a=Math.ceil(e.length/itemsPerPage);a<(t=t<1?1:t)&&(t=a),document.querySelector("#job-list").innerHTML="",1==currentPage?(itemsPerPage=7,document.querySelector("#job-list").insertAdjacentHTML("afterbegin",'

Velzon invites young professionals for an intership!

Don\'t miss your opportunity to improve your skills!

')):itemsPerPage=8;for(var n=(t-1)*itemsPerPage;n'+e+""}),e[n]&&(document.querySelector("#job-list").innerHTML+='
'+e[n].jobTitle+'

'+e[n].companyName+'

'+e[n].location+'
'+e[n].postDate+'

'+e[n].description+'

'+i+'
')}document.getElementById("total-result").innerHTML=e.length,selectedPage();var s=document.getElementById("searchJob");s.addEventListener("keyup",function(){0"+a+"";document.addEventListener("click",function(e){"A"==e.target.nodeName&&e.target.classList.contains("clickPageNumber")&&(currentPage=e.target.textContent,loadJobListData(allJobList,currentPage))}),selectedPage()}getJSON("job-grid-list.json",function(e,t){null!==e?console.log("Something went wrong: "+e):(loadJobListData(allJobList=t,currentPage),paginationEvents())});var searchElementList=document.getElementById("searchJob");function filterData(){for(var s=document.getElementById("idStatus").value,l=document.getElementById("datepicker").value,o=document.getElementById("idType").value,r=l.split(" to ")[0],d=l.split(" to ")[1],e=allJobList.filter(function(t){var e=t.status,a=!1,n=!1,i=!1,a="all"==e||"all"==s||e==s;return t.requirement.map(function(e){i="all"==e||"all"==o||t.requirement.includes(o)}),n=new Date(t.postDate)>=new Date(r)&&new Date(t.postDate)<=new Date(d),a&&i&&n||(a&&i&&""==l?a&&i:i&&n&&""==l?i&&n:void 0)}),t=document.getElementById("page-num"),a=(t.innerHTML="",Math.ceil(e.length/itemsPerPage)),n=1;n"+n+"";loadJobListData(e,currentPage)}searchElementList.addEventListener("keyup",function(){var e=searchElementList.value.toLowerCase();t=e;for(var t,e=allJobList.filter(function(e){return-1!==e.jobTitle.toLowerCase().indexOf(t.toLowerCase())}),a=(0==e.length?document.getElementById("pagination-element").style.display="none":document.getElementById("pagination-element").style.display="flex",document.getElementById("page-num")),n=(a.innerHTML="",Math.ceil(e.length/itemsPerPage)),i=1;i"+i+"";loadJobListData(e,currentPage)});