var currentTab=0;function showTab(e){var t=document.getElementsByClassName("tab");t[e].style.display="block",0==e?(document.getElementById("prevBtn").style.display="none",document.getElementById("form-submit").style.display="none",document.getElementById("nextBtn").style.display="inline"):(document.getElementById("prevBtn").style.display="inline",document.getElementById("nextBtn").style.display="inline"),e==t.length-1?(document.getElementById("form-submit").style.display="inline",document.getElementById("nextBtn").style.display="none"):(document.getElementById("form-submit").style.display="none",document.getElementById("nextBtn").innerHTML="Next  <i class='fa fa-angle-double-right'></i>"),stepIndicator(e),topIndicator(e)}function nextPrev(e){var t=document.getElementsByClassName("tab");return!(1==e&&!validateForm())&&(t[currentTab].style.display="none",!((currentTab+=e)>=t.length)&&void showTab(currentTab))}function validateForm(){var e,t=!0;return e=document.getElementsByClassName("tab")[currentTab].getElementsByClassName("form-control"),$(e).each(function(){""==$(this).val()&&$(this).prop("required")?($(this).addClass("invalid"),submitMSG(!1,"Please Fillup all red mark fields to continue"),t=!1):($(this).removeClass("invalid"),submitMSG("hide",""),t=!0)}),t&&(document.getElementsByClassName("step")[currentTab].className+=" finish"),t}function stepIndicator(e){var t,n=document.getElementsByClassName("step");for(t=0;t<n.length;t++)n[t].className=n[t].className.replace(" active","");n[e].className+=" active"}function topIndicator(e){var t,n=document.getElementsByClassName("indicator");for(t=0;t<n.length;t++)n[t].className=n[t].className.replace(" active","");n[e].className+=" active"}function submitMSG(e,t){if(1==e)var n="h3 text-center fadeInDown animated text-success easy_error_msg";else if(0==e)n="h3 text-center fadeInUp animated text-danger easy_error_msg";else $("#msgSubmit").removeClass();$("#msgSubmit").removeClass().addClass(n).text(t),$("html, body").animate({scrollTop:$("#msgSubmit").offset().top},1e3)}showTab(currentTab);