Diligent web site
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

custom.js 24KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732
  1. "use strict";
  2. function isOnScreen(elem) {
  3. // if the element doesn't exist, abort
  4. if( elem.length == 0 ) {
  5. return;
  6. }
  7. var $window = jQuery(window)
  8. var viewport_top = $window.scrollTop()
  9. var viewport_height = $window.height()
  10. var viewport_bottom = viewport_top + viewport_height
  11. var $elem = jQuery(elem)
  12. var top = $elem.offset().top
  13. var height = $elem.height()
  14. var bottom = top + height
  15. return (top >= viewport_top && top < viewport_bottom) ||
  16. (bottom > viewport_top && bottom <= viewport_bottom) ||
  17. (height > viewport_height && top <= viewport_top && bottom >= viewport_bottom)
  18. }
  19. // start custom scripts
  20. (function($) {
  21. jQuery(document).ready(function($){
  22. /*========== Swicher ==========*/
  23. /*========== Progress bar ==========*/
  24. function animate() {
  25. $(".progress-bar").each(function(){
  26. var progressValue = $(this).attr('data-value');
  27. $(this).animate({width: progressValue +'%'}, 6000);
  28. });
  29. }
  30. function scrollToID(url, id, speed) {
  31. if(url!==null)
  32. {
  33. window.location.href = url;
  34. }
  35. var offSet = 50;
  36. var obj = jQuery(id).offset();
  37. var targetOffset = 0;
  38. if(jQuery(id).length)
  39. {
  40. targetOffset = jQuery(id).offset().top - offSet;
  41. }
  42. jQuery('html,body').animate({ scrollTop: targetOffset }, speed)
  43. }
  44. function backToPreviousLink()
  45. {
  46. var loc = window.location;
  47. var responseFrom = loc.hash.lastIndexOf('=') + 1;
  48. if(loc.pathname.substring(loc.pathname.lastIndexOf('/') + 1, loc.pathname.length) == 'index.php' )
  49. {
  50. if(loc.hash.substring( responseFrom, loc.hash.length ) == 'about')
  51. {
  52. $('.about-section').addClass('active').append('<span class="nav-active-mark"></span>');
  53. }
  54. else if(loc.hash.substring( responseFrom, loc.hash.length ) == 'our_partners')
  55. {
  56. $('.our_partners-section').addClass('active').append('<span class="nav-active-mark"></span>');
  57. }
  58. else if(loc.hash.substring( responseFrom, loc.hash.length ) == 'contact')
  59. {
  60. $('.contact-section').addClass('active').append('<span class="nav-active-mark"></span>');
  61. }
  62. else
  63. {
  64. $('.intro-section').addClass('active').append('<span class="nav-active-mark"></span>');
  65. }
  66. }
  67. else if(loc.pathname.substring(loc.pathname.lastIndexOf('/') + 1, loc.pathname.length) == 'careers.php' )
  68. {
  69. $('.career-link').addClass('active').append('<span class="nav-active-mark"></span>');
  70. }
  71. else if(loc.pathname.substring(loc.pathname.lastIndexOf('/') + 1, loc.pathname.length) == 'apply.php' )
  72. {
  73. $('.career-link').addClass('active').append('<span class="nav-active-mark"></span>');
  74. }
  75. else if(loc.pathname.substring(loc.pathname.lastIndexOf('/') + 1, loc.pathname.length) == 'portfolio.php' )
  76. {
  77. $('.portfolio-link').addClass('active').append('<span class="nav-active-mark"></span>');
  78. }
  79. else if(loc.pathname.includes("services") )
  80. {
  81. $('.service-link').addClass('active').append('<span class="nav-active-mark"></span>');
  82. }
  83. else if(loc.pathname.includes("industries") )
  84. {
  85. $('.industries-link').addClass('active').append('<span class="nav-active-mark"></span>');
  86. }
  87. }
  88. //service and industry
  89. //homepage
  90. var previousLink;
  91. var indexPeviousSelectedLink = 0;
  92. $('#navigation .service-link').on('click', function()
  93. {
  94. $(".nav-active-mark").parent().removeClass("active").removeClass('up');
  95. $(".nav-active-mark").remove();
  96. $('#industriesMenu').css('display', 'none');
  97. $('#servicesMenu').toggle('active');
  98. if($('#header').hasClass('active_dropdown'))
  99. {
  100. if(previousLink != 'industries')
  101. {
  102. $('#header').removeClass('active_dropdown');
  103. //$(this).remove('.nav-active-mark').removeClass('active');
  104. backToPreviousLink();
  105. previousLink = '';
  106. }
  107. else if(previousLink !== undefined)
  108. {
  109. $(this).addClass('active').addClass("up").append('<span class="nav-active-mark"></span>');
  110. previousLink = 'services'
  111. //$(this).remove('.nav-active-mark').removeClass('active');
  112. }
  113. }
  114. else
  115. {
  116. $('#header').addClass('active_dropdown');
  117. $(this).addClass('active').addClass('up').append('<span class="nav-active-mark"></span>');
  118. previousLink = 'services';
  119. }
  120. });
  121. $('#navigation .industries-link').on('click', function()
  122. {
  123. $(".nav-active-mark").parent().removeClass("active").removeClass('up');
  124. $(".nav-active-mark").remove();
  125. $('#servicesMenu').css('display', 'none');
  126. $('#industriesMenu').toggle('active');
  127. if($('#header').hasClass('active_dropdown'))
  128. {
  129. if(previousLink != 'services')
  130. {
  131. $('#header').removeClass('active_dropdown');
  132. //$(this).remove('.nav-active-mark').removeClass('active');
  133. backToPreviousLink();
  134. previousLink = '';
  135. }
  136. else if(previousLink !== undefined)
  137. {
  138. //$(this).remove('.nav-active-mark').removeClass('active');
  139. $(this).addClass('up').addClass('active').append('<span class="nav-active-mark"></span>');
  140. previousLink = 'industries';
  141. }
  142. }
  143. else
  144. {
  145. $('#header').addClass('active_dropdown');
  146. $(this).addClass('up').addClass('active').append('<span class="nav-active-mark"></span>');
  147. previousLink = 'industries';
  148. }
  149. });
  150. $('#mobile-navigation .service-link').click(function(event){
  151. event.stopPropagation();
  152. var mobileDrodown = $(this).find('ul');
  153. if(mobileDrodown.is( ":hidden" ))
  154. {
  155. mobileDrodown.slideDown('slow');
  156. mobileDrodown.removeClass('active');
  157. }
  158. else
  159. {
  160. mobileDrodown.hide();
  161. mobileDrodown.addClass('active');
  162. }
  163. });
  164. $('#mobile-navigation .industries-link').click(function(event){
  165. event.stopPropagation();
  166. var mobileDrodown = $(this).find('ul');
  167. if(mobileDrodown.is( ":hidden" ))
  168. {
  169. mobileDrodown.slideDown('slow');
  170. mobileDrodown.removeClass('active');
  171. }
  172. else
  173. {
  174. mobileDrodown.hide();
  175. mobileDrodown.addClass('active');
  176. }
  177. });
  178. //homepage end
  179. //career
  180. var expand = false;
  181. $('.position').on('click', function(ev) {
  182. //ev.preventDefault();
  183. $(this).find(".chev").toggleClass('chevron--down chevron--up');
  184. $(this).closest(".position-cont").find(".collapse").toggleClass("show");
  185. $(this).toggleClass("active"); //css({"background-color": "#993c95", "color": "white"});
  186. expand= !expand;
  187. });
  188. $('.chev').on('click', function(ev) {
  189. //ev.preventDefault();
  190. $(this).toggleClass('chevron--down chevron--up');
  191. $(this).closest(".position-cont").find(".collapse").toggleClass("show");
  192. $(this).closest(".position").toggleClass("active"); //css({"background-color": "#993c95", "color": "white"});
  193. expand= !expand;
  194. });
  195. //end career
  196. //apply
  197. // $(".resume-cont").click(function()
  198. // {
  199. // $(".resume-file").click();
  200. // });
  201. if( $("#positions").length)
  202. {
  203. $("#positions").selectize({
  204. create: true,
  205. sortField: {
  206. field: 'text',
  207. direction: 'asc'
  208. },
  209. });
  210. }
  211. var resume = "";
  212. $("input:file").change(function (event){
  213. var fileName = $(this).val();
  214. var reader = new FileReader();
  215. reader.onload = function(e)
  216. {
  217. resume = e.target.result;
  218. }
  219. reader.readAsDataURL(this.files[0]);
  220. var fileExtensionAt = fileName.lastIndexOf(".") + 1;
  221. var fileExtension = fileName.substring(fileExtensionAt, fileName.length);
  222. if(fileName!="" && fileExtension == "doc" || fileExtension == "docx" || fileExtension == "pdf")
  223. {
  224. var from = fileName.lastIndexOf("\\") + 1;
  225. var to = fileName.length ;
  226. if(to < 12)
  227. {
  228. fileName = fileName.substring(from, to);
  229. }
  230. else
  231. {
  232. fileName = fileName.substring(from, from + 12) + " ...";
  233. }
  234. }
  235. else{
  236. fileName="Choose file";
  237. }
  238. $(".resume-file-cont label").html(fileName);
  239. });
  240. $(".btn-delete-file").click(function(e)
  241. {
  242. e.preventDefault();
  243. $(".resume-file-cont label").html("Choose file");
  244. });
  245. var btn_apply = $("#apply-submit");
  246. var apply_form = $("#apply-form");
  247. apply_form.bind('submit', function(ev) {
  248. ev.preventDefault();
  249. var resume_file = document.getElementById("resume-file").files[0];
  250. var data = new FormData(document.getElementById("apply-form"));
  251. data.append("resume", "'" + resume + "'");
  252. data.append("resume-file", resume_file);
  253. $.ajax({
  254. url: "job_apply.php?call=upload",
  255. method: "POST",
  256. data: data,
  257. contentType: false,
  258. cache: false,
  259. processData:false,
  260. success : function(data) {
  261. window.location.replace("careers.php?response=successful");
  262. },
  263. error: function(error)
  264. {
  265. console.log(console.error);
  266. }
  267. });
  268. });
  269. //apply end
  270. //contact form
  271. var contact_form = $("#contact-form");
  272. var contact_button = jQuery("#contact-form #submit");
  273. var status = jQuery(".log");
  274. contact_form.bind('submit', function(event)
  275. {
  276. event.preventDefault();
  277. var data = new FormData(document.getElementById("contact-form"));
  278. $.ajax({
  279. url: "contact_form.php",
  280. method: "POST",
  281. data: data,
  282. contentType: false,
  283. cache: false,
  284. processData:false,
  285. success : function(data) {
  286. window.location.replace("index.php");
  287. },
  288. error: function(error)
  289. {
  290. console.log(console.error);
  291. }
  292. });
  293. });
  294. $('.clear_storage').on('click', function(e){
  295. window.localStorage.clear();
  296. });
  297. var get_id = localStorage.getItem('pg_id');
  298. var setupUrl = false;
  299. // check page id, then scroll to its div
  300. if(get_id)
  301. {
  302. scrollToID(null, get_id, 300);
  303. }
  304. jQuery(document).ready(function()
  305. {
  306. var loc = window.location;
  307. if(!get_id && loc.pathname.substring(loc.pathname.lastIndexOf('/') + 1, loc.pathname.length) == 'index.php' && !setupUrl)
  308. {
  309. var sectionType = window.location.hash;
  310. var id = sectionType.substr(sectionType.indexOf('=') + 1, sectionType.length );
  311. id+="-section";
  312. if(id != "" && id != null)
  313. {
  314. var nav_link = "#navigation ."+ id +" > a";
  315. var item = $(nav_link);
  316. item.trigger('click');
  317. setupUrl =true;
  318. }
  319. }
  320. });
  321. $("#back-to-top").on('click', function()
  322. {
  323. $(window).scrollTop(0);
  324. $(this).removeClass('active');
  325. });
  326. // click event to scroll to div
  327. //section link in nav which refer to section on homepage
  328. $('.home_link').on('click', function(e){
  329. e.preventDefault();
  330. var id = '#'+$(this).data('id');
  331. localStorage.setItem('pg_id', id);
  332. var url = $(this).attr("href");
  333. scrollToID(url, id, 300);
  334. });
  335. //Link from our partners section on homepage which refer to section on portfolio page
  336. $('.partners_link').on('click', function(e){
  337. e.preventDefault();
  338. var id = '#'+$(this).data('id');
  339. localStorage.setItem('pg_id', id);
  340. var url = $(this).attr("href");
  341. scrollToID(url, id, 300);
  342. });
  343. var siteUrl = window.location.hash;
  344. window.addEventListener('scroll', function(e) {
  345. if($( document ).width() <= 768)
  346. {
  347. $("#back-to-top").addClass("active");
  348. }
  349. if($( document ).scrollTop() == 0)
  350. {
  351. $("#back-to-top").removeClass("active");
  352. }
  353. var loc = window.location;
  354. if(loc.pathname.substring(loc.pathname.lastIndexOf('/') + 1, loc.pathname.length) == 'index.php')
  355. {
  356. var newUrl = "";
  357. if( isOnScreen( $( '#intro-section' ) ) ) { /* Pass element id/class you want to check */
  358. $("nav li.active").removeClass("active").find('.nav-active-mark').remove();
  359. $("nav li.intro-section").addClass("active").append('<span class="nav-active-mark"></span>');
  360. //newUrl = siteUrl.substring(0, siteUrl.indexOf("/"));
  361. parent.location.hash = "?section=intro";
  362. }
  363. if( isOnScreen( $( '#about-section' ) ) ) { /* Pass element id/class you want to check */
  364. $("nav li.active").removeClass("active").find('.nav-active-mark').remove();
  365. $("nav li.about-section").addClass("active").append('<span class="nav-active-mark"></span>');
  366. parent.location.hash = "?section=about";
  367. }
  368. if( isOnScreen( $( '#our_partners-section' ) ) ) { /* Pass element id/class you want to check */
  369. $("nav li.active").removeClass("active").find('.nav-active-mark').remove();
  370. $("nav li.our_partners-section").addClass("active").append('<span class="nav-active-mark"></span>');
  371. parent.location.hash = "?section=our_partners";
  372. }
  373. if( isOnScreen( $( '#services-section' ) ) ) { /* Pass element id/class you want to check */
  374. $("nav li.active").removeClass("active").find('.nav-active-mark').remove();
  375. $("nav li.services-section").addClass("active").append('<span class="nav-active-mark"></span>');
  376. parent.location.hash = "?section=services";
  377. }
  378. if( isOnScreen( $( '#teams-wrap' ) ) ) { /* Pass element id/class you want to check */
  379. $("nav li.active").removeClass("active").find('.nav-active-mark').remove();
  380. $("nav li.teams-wrap").addClass("active").append('<span class="nav-active-mark"></span>');
  381. newUrl = siteUrl.substring(0, siteUrl.lastIndexOf("/") -1) + "teams-wrap";
  382. parent.location.hash = "?section=teams"
  383. }
  384. if( isOnScreen( $( '#contact-section' ) ) ) { /* Pass element id/class you want to check */
  385. $("nav li.active").removeClass("active").find('.nav-active-mark').remove();
  386. $("nav li.contact-section").addClass("active").append('<span class="nav-active-mark"></span>');
  387. parent.location.hash = "?section=contact"
  388. }
  389. }
  390. });
  391. //careers
  392. var loc = window.location;
  393. //response=successful
  394. var responseFrom = loc.search.lastIndexOf('=') + 1;
  395. if(loc.pathname.substring(loc.pathname.lastIndexOf('/') + 1, loc.pathname.length) == 'careers.php' && loc.search.substring( responseFrom, loc.search.length ))
  396. {
  397. $('.background-overlay').addClass('active');
  398. $('.apply-notification').addClass('active');
  399. }
  400. $('.close-notification').click(function()
  401. {
  402. window.location.replace("careers.php");
  403. }
  404. )
  405. //careers end
  406. /*========== Disables ==========*/
  407. if( /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) ) {
  408. $('#animate_css_file, #wow_js_file').remove();
  409. } else {
  410. /*========== WOW Animations ==========*/
  411. var wow = new WOW(
  412. {
  413. animateClass: 'animated',
  414. offset: 100
  415. }
  416. );
  417. wow.init();
  418. }
  419. /*========== Logo Retina ==========*/
  420. if( window.devicePixelRatio > 1 ) {
  421. var logoWidth = $('#logo img').width();
  422. var logoHeight = $('#logo img').height();
  423. $('#logo img').attr("src", "images/[email protected]");
  424. $('#logo img').css({ 'width': logoWidth , 'height': logoHeight });
  425. }
  426. /*========== Team Item Hover ==========*/
  427. $('.team-item').each(function(){
  428. var memberImage = $(this).find('.member-face').attr('style');
  429. var current = $(this).find('.change-color');
  430. $(this).find('.hex-in2.outer-hex').first().hover(function(){
  431. $(this).find('.member-face').css('background','#000');
  432. $(current).css('background-color','#f3b202');
  433. $(this).find('.socials').show();
  434. },function(){
  435. $(this).find('.socials').hide();
  436. $(this).find('.member-face').attr('style', memberImage);
  437. $(current).css('background-color','#000');
  438. });
  439. });
  440. /*========== Gallery Item Hover ==========*/
  441. $('.gallery-item').hover(function(){
  442. $(this).find('.gallery-info').stop(true,true).animate({ "top": "0" } );
  443. },function(){
  444. $(this).find('.gallery-info').stop(true,true).animate({ "top": "-999" } );
  445. });
  446. /*========== Pie Chart ==========*/
  447. $('.days').waypoint(function() {
  448. $('.chart').easyPieChart({
  449. easing: 'easeOutBounce',
  450. barColor: '#f3b202',
  451. trackColor: '#595959',
  452. lineWidth: '18',
  453. lineCap: 'butt',
  454. size: '160',
  455. scaleColor: false,
  456. onStep: function(from, to, percent) {
  457. $(this.el).find('.percent').text(Math.round(percent));
  458. }
  459. });
  460. });
  461. /*========== Smooth Scroll ==========*/
  462. $('a[href*=#]:not([href=#])').click(function() {
  463. $("#navigation ul > li").each( function(index)
  464. {
  465. var selected = $(this).find(".nav-active-mark");
  466. if(selected.length)
  467. {
  468. indexPeviousSelectedLink = index +1;
  469. }
  470. });
  471. $("li.active").removeClass("active").find('.nav-active-mark').remove();
  472. if(!$(this).parent().hasClass('service-link') && !$(this).parent().hasClass('industries-link'))
  473. {
  474. $('#servicesMenu').css('display', 'none');
  475. $('#industriesMenu').css('display', 'none');
  476. $('#header').removeClass('active_dropdown');
  477. }
  478. $(this).parent().addClass('active').end().append('<span class="nav-active-mark"></span>');
  479. if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
  480. var target = $(this.hash);
  481. target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
  482. if (target.length) {
  483. $('html,body').animate({
  484. scrollTop: target.offset().top - 53
  485. }, 1000);
  486. return false;
  487. }
  488. }
  489. });
  490. /*========== Graph Bars Animate ==========*/
  491. $('.days').waypoint(function() {
  492. $('.graph ul li.bar').each(function() {
  493. var curBarHeight = $(this).data('bar-height');
  494. $(this).animate({ height: curBarHeight }, 2000, "easeInOutBack");
  495. });
  496. });
  497. /*========== Intro Note Box Tooltip ==========*/
  498. /*$('.note-1').hover(function(){
  499. $(this).find('.note-tooltip').fadeIn();
  500. },function(){
  501. $(this).find('.note-tooltip').fadeOut();
  502. });
  503. */
  504. /*========== PrettyPhoto ==========*/
  505. $("a[data-rel^='prettyPhoto']").prettyPhoto({theme:'dark_rounded', hook: 'data-rel'});
  506. /*========== Flickr ==========*/
  507. var flickrImageSrc = [ ];
  508. var flickrLink = [ ];
  509. $('.flickr_badge_image').each(function(i){
  510. flickrImageSrc[i] = $(this).find('img').attr('src');
  511. flickrLink[i] = $(this).find('a').attr('href');
  512. });
  513. $('.flickr-item').each(function(i){
  514. $(this).find('.hex-area').css('background-image', 'url(' + flickrImageSrc[i] + ')');
  515. $(this).find('.flickr-link').attr('href', flickrLink[i] );
  516. });
  517. /*========== Window Resize ==========*/
  518. var windowWidth = $(window).width();
  519. var numberOfHexagon = windowWidth / 106;
  520. var offsetBackground = ((numberOfHexagon - 14) * 106 ) /2;
  521. $('#hexagon-overlay').css('background-position', offsetBackground + 'px' + ' ' + 'top');
  522. $(window).resize(function() {
  523. var currentWindowWidth = $(window).width();
  524. if(currentWindowWidth <= 940) return;
  525. $('#hexagon-overlay').css('background-position', - ( ( (windowWidth - currentWindowWidth)/2 ) - offsetBackground ) + 'px' + ' ' + 'top');
  526. });
  527. /*========== Mobile Menu ==========*/
  528. $('.mobile-nav-toggle').on('click',function(){
  529. if($(this).attr('class') == 'mobile-nav-toggle deactive') {
  530. $('#mobile-navigation').fadeIn();
  531. $(this).removeClass('deactive');
  532. } else {
  533. $('#mobile-navigation').fadeOut();
  534. $(this).addClass('deactive');
  535. }
  536. });
  537. $("#mobile-navigation li:not(.service-link):not(.industries-link) a").on("click", function(){
  538. $('#mobile-navigation').fadeOut();
  539. $(".mobile-nav-toggle").addClass('deactive');
  540. });
  541. $(window).resize(function(){
  542. var w = $(window).width();
  543. if(w > 767) {
  544. $('#mobile-navigation').fadeOut();
  545. $(".mobile-nav-toggle").addClass('deactive');
  546. }
  547. });
  548. /*========== Contact Form Validation ==========*/
  549. function isValidEmailAddress(emailAddress) {
  550. var pattern = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);
  551. return pattern.test(emailAddress);
  552. }
  553. /*========== FlexSlider ==========*/
  554. if($('.flexslider').length)
  555. {
  556. $('.flexslider').flexslider({
  557. animation: "fade",
  558. animationLoop: false,
  559. directionNav: false,
  560. slideshow: false
  561. });
  562. }
  563. }); // end jquery init
  564. })(jQuery);
  565. var verifyCallbackApply = function(response) {
  566. return new Promise(function(resolve, reject) {
  567. if (response) {
  568. //jQuery("#apply-form").submit();
  569. $('#apply-submit').removeAttr('disabled');
  570. }
  571. });
  572. };
  573. var verifyCallbackContact = function(response) {
  574. return new Promise(function(resolve, reject) {
  575. if (response) {
  576. //jQuery("#apply-form").submit();
  577. $('#contact-form #submit').removeAttr('disabled');
  578. }
  579. });
  580. };
  581. var onloadCallback = function () {
  582. if (jQuery('#googlecapatcha_apply').length) {
  583. recaptcha = grecaptcha.render('googlecapatcha_apply', {
  584. 'sitekey': "6Lc3Bt8ZAAAAACPv1F98oFvwPOYVyvWvmN1HYkrS",
  585. 'theme': 'light',
  586. 'callback': verifyCallbackApply
  587. });
  588. }
  589. if (jQuery('#googlecapatcha_contact').length)
  590. {
  591. recaptcha = grecaptcha.render('googlecapatcha_contact', {
  592. 'sitekey': "6Lc3Bt8ZAAAAACPv1F98oFvwPOYVyvWvmN1HYkrS",
  593. 'theme': 'light',
  594. 'callback': verifyCallbackContact
  595. });
  596. }
  597. };