site.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. var googlecaptcha = "";
  2. var isAdditionalScriptLoaded = false;
  3. function showRandomBanner() {
  4. var e = [1, 2];
  5. randNum = e[Math.floor(Math.random() * e.length)], $("#banner-" + randNum).addClass("activeSlide"), $("body").hasClass("page-id-2") && $("#banner-2").hasClass("activeSlide") && $(".topheader").removeClass("style_one").addClass("style_two")
  6. }
  7. function resendotp() {
  8. var e = jQuery("#isd").val(),
  9. t = jQuery("#number").val();
  10. jQuery("#otp").val();
  11. return $("#resendLink").hide(), $("#resendCounter").show(), "" == e || null == e || null == e ? (alert("Invalid Country Code"), !1) : "" == t || null == t || null == t ? (alert("Invalid Mobile Number Code"), !1) : void $.ajax({
  12. type: "POST",
  13. url: "https://msg91.com/otp/sendotp_action_layer.php?action=retryOTP",
  14. data: {
  15. countryCode: e,
  16. mobileNumber: t
  17. },
  18. dataType: "json",
  19. error: function(e, t, o) {
  20. console.log(e), alert("Something bad happens. please reload page.")
  21. },
  22. success: function(e) {
  23. if ("success" === e.status) {
  24. alert(e.message), jQuery("#resendLink").hide();
  25. var t = 19,
  26. o = setInterval(function() {
  27. $("#resendCounter").html("Retry in " + t + " Second"), t--
  28. }, 1e3);
  29. setTimeout(function() {
  30. jQuery("#resendLink").show(), jQuery("#resendCounter").hide(), clearInterval(o)
  31. }, 2e4)
  32. } else alert(e.message)
  33. }
  34. })
  35. }
  36. jQuery(document).ready(function(r) {
  37. if (showRandomBanner(), (r = jQuery)(".carousel").carousel({
  38. interval: !1
  39. }), r(".built_tab-section").appendTo(".built-tab-widget"), 0 != r(".grid-sizer").length) {
  40. r(".grid").masonry({
  41. itemSelector: ".grid-item",
  42. columnWidth: ".grid-sizer",
  43. percentPosition: !0
  44. });
  45. var e = document.querySelector(".grid"),
  46. t = new Masonry(e, {
  47. itemSelector: ".grid-item",
  48. columnWidth: ".grid-sizer",
  49. percentPosition: !0
  50. });
  51. imagesLoaded(e).on("progress", function() {
  52. t.layout()
  53. })
  54. }
  55. if (0 != r(".grid-sizer-thum").length) {
  56. r(".grid-thum").masonry({
  57. itemSelector: ".grid-item-thum",
  58. columnWidth: ".grid-sizer-thum",
  59. percentPosition: !0
  60. });
  61. var o = document.querySelector(".grid-thum");
  62. t = new Masonry(o, {
  63. itemSelector: ".grid-item-thum",
  64. columnWidth: ".grid-sizer-thum",
  65. percentPosition: !0
  66. });
  67. imagesLoaded(o).on("progress", function() {
  68. t.layout()
  69. })
  70. }
  71. r(".cat-filt a").click(function() {
  72. r(this).text();
  73. r(".blog-list.grid-thum li.grid-item-thum").hide();
  74. var e, t = r(this).attr("data-class");
  75. ".allInclass" == t ? (r(".blog-list.grid-thum li.grid-item-thum").show(), (e = r(".grid-thum").masonry({
  76. itemSelector: ".grid-item-thum",
  77. percentPosition: !0,
  78. columnWidth: ".grid-sizer-thum"
  79. })).imagesLoaded().progress(function() {
  80. e.masonry()
  81. })) : (r(".blog-list.grid-thum").find(t).show(), (e = r(".grid-thum").masonry({
  82. itemSelector: ".grid-item-thum",
  83. percentPosition: !0,
  84. columnWidth: ".grid-sizer-thum"
  85. })).imagesLoaded().progress(function() {
  86. e.masonry()
  87. }));
  88. return !1
  89. }), r('.home-tabs li a[data-toggle="tab"]').on("hide.bs.tab", function(e) {
  90. var t = r(r(e.target).attr("href"));
  91. r(r(e.relatedTarget).attr("href")).index() < t.index() ? (t.css("position", "relative").css("right", "0").show(), t.animate({
  92. right: "-100%"
  93. }, 700, function() {
  94. t.css("right", 0).removeAttr("style")
  95. })) : (t.css("position", "relative").css("left", "0").show(), t.animate({
  96. left: "-100%"
  97. }, 700, function() {
  98. t.css("left", 0).removeAttr("style")
  99. }))
  100. }), r('.home-tabs li a[data-toggle="tab"]').on("show.bs.tab", function(e) {
  101. var t = r(r(e.target).attr("href")),
  102. o = r(r(e.relatedTarget).attr("href"));
  103. t.index() > o.index() ? (t.css("position", "relative").css("right", "-2500px"), t.animate({
  104. right: "0"
  105. }, 700)) : (t.css("position", "relative").css("left", "-2500px"), t.animate({
  106. left: "0"
  107. }, 700))
  108. }), r('.home-tabs li a[data-toggle="tab"]').on("shown.bs.tab", function(e) {}), r(window).scroll(function() {
  109. 30 <= r(window).scrollTop() ? r(".navbar-custom").addClass("fixedHeader") : r(".navbar-custom").removeClass("fixedHeader")
  110. }), r(".pageLoopList .col-sm-6.col-md-4:nth-child(2) .thumbnail").addClass("onfocus"), r(".pageLoopList a.thumbnail").hover(function() {
  111. r(".pageLoopList a.thumbnail").removeClass("onfocus")
  112. }), r(".pageLoopList a.thumbnail").mouseleave(function() {
  113. r(".pageLoopList .col-sm-6.col-md-4:nth-child(2) .thumbnail").addClass("onfocus")
  114. }), r(".per_sms_cost i.fa").click(function() {
  115. r(".per_sms_cost ul").slideToggle()
  116. }), r(".topheader .nav.navbar-nav li a").on("click", function(e) {
  117. "" !== this.hash && e.preventDefault()
  118. }), r(".anchor-clicked a").on("click", function(e) {
  119. if ("" !== this.hash) {
  120. e.preventDefault();
  121. var t = this.hash;
  122. r("html, body").animate({
  123. scrollTop: r(t).offset().top - 100
  124. }, 800, function() {
  125. window.location.hash = t
  126. })
  127. }
  128. }), r(".startupagain").css("display", "none"), r("#startupForm input").on("change", function() {
  129. r(".startupagain").css("display", "block"), r(".productStartup").hide(), r("." + r("input[name=radioName]:checked", "#startupForm").val()).show()
  130. }), r(".card").hover(function() {
  131. r(".card").hasClass("onfocus") && r(".card").removeClass("onfocus")
  132. }), jQuery(".sendotp").click(function() {
  133. if ("" != googlecaptcha) {
  134. var e = {};
  135. e.countryCode = jQuery("#isd").val(), e.mobileNumber = jQuery("#number").val(), e.grecaptcharesponse = googlecaptcha, jQuery.post("https://msg91.com/otp/sendotp_action_layer.php?action=verifyRecaptcha", e, function(e) {
  136. if ("success" === e.status) {
  137. jQuery(".otpsend").hide(), jQuery(".otpverify").show(), grecaptcha.reset(), jQuery("#resendLink").hide();
  138. var t = 19,
  139. o = setInterval(function() {
  140. jQuery("#resendCounter").html("Retry in " + t + " Second"), t--
  141. }, 1e3);
  142. setTimeout(function() {
  143. jQuery("#resendCounter").hide(), jQuery("#resendLink").show(), clearInterval(o)
  144. }, 2e4)
  145. } else alert(e.message)
  146. }, "json")
  147. } else alert("Verifcation not done, please check the checkbox")
  148. }), jQuery(".verifyotp").click(function() {
  149. var e = {};
  150. e.countryCode = jQuery("#isd").val(), e.mobileNumber = jQuery("#number").val(), e.otp = jQuery("#otp").val(), jQuery.post("https://msg91.com/otp/sendotp_action_layer.php?action=verifyOTP", e, function(e) {
  151. "success" === e.status ? (alert("You are successfully verified"), jQuery(".otpsend").show(), jQuery(".otpverify").hide(), jQuery("#isd").val(""), jQuery("#number").val("")) : alert(data.message)
  152. }, "json")
  153. })
  154. }),
  155. // function () {
  156. // }();
  157. jQuery(document).ready(function() {
  158. var i = 0;
  159. function format(option) {
  160. if (!option.id) {
  161. return option.text;
  162. }
  163. var ob = '<span class="country-select"><span class="flag ' + jQuery(option.element).data('image') + '"></span></span> ' + ' ' + option.text; // replace image source with option.img (available in JSON)
  164. return ob;
  165. };
  166. $("#country3").select2({
  167. placeholder: "Select something!!",
  168. width: "50%",
  169. allowClear: true,
  170. templateResult: format,
  171. templateSelection: function(option) {
  172. if (option.id.length > 0) {
  173. return '<span class="country-select"><span class="flag ' + jQuery(option.element).data('image') + '"></span></span> ' + option.text;
  174. } else {
  175. return option.text;
  176. }
  177. },
  178. escapeMarkup: function(m) {
  179. return m;
  180. }
  181. });
  182. });
  183. function loadAdditionalScript() {
  184. $.getScript("https://assets.calendly.com/assets/external/widget.js");
  185. // $.getScript("https://random-scripts.herokuapp.com/superform/superform.js");
  186. isAdditionalScriptLoaded = true;
  187. }
  188. $('[data-target="#talkToSales_dialog"]').click(function() {
  189. if (isAdditionalScriptLoaded) {
  190. return;
  191. }
  192. loadAdditionalScript();
  193. });
  194. window.onload = function() {
  195. setTimeout(function() { loadAdditionalScript(); }, 300);
  196. }
  197. // function () {
  198. // var e, t, o = document,
  199. // r = o.getElementById,
  200. // a = o.createElement,
  201. // s = o.getElementsByTagName,
  202. // n = "typeform-share";
  203. // r.call(o, n) || ((e = a.call(o, "script")).id = n, e.src = "https://embed.typeform.com/embed.js", (t = s.call(o, "script")[0]).parentNode.insertBefore(e, t))
  204. // }();
  205. // Get SMS Pricing
  206. function getSmsPricing(){
  207. var data={};
  208. data['country']=jQuery('#country3').val();
  209. data['type']=jQuery('#type').val();
  210. data['noOfSMS']=jQuery('#noOfSMS').val();
  211. data['routeType']=jQuery('#type').val() || 4;
  212. data['action']='511';
  213. data['currency']=jQuery('#currency').val();
  214. data['request']='pricing_details';
  215. if (data.noOfSMS >= 500000) {
  216. document.getElementById('get-custom-quote').style.display="block";
  217. document.getElementById('TotalCost').style.display="none";
  218. document.getElementById('main-smscount').style.display="none";
  219. return;
  220. }
  221. else {
  222. try{
  223. document.getElementById('get-custom-quote').style.display="none";
  224. document.getElementById('TotalCost').style.display="block";
  225. document.getElementById('main-smscount').style.display="block";
  226. }catch(err){
  227. }
  228. }
  229. try{
  230. jQuery.get(pricing_url,data,function(result){
  231. var obj = result;
  232. var array = $.map(obj , function(value, index) {
  233. return [value];
  234. });
  235. jQuery('.rcost').html(result.amountPerSms + '/');
  236. jQuery('.tcost').text(result.totalAmount);
  237. }, 'jsonp')
  238. }catch(err){
  239. }
  240. };
  241. getSmsPricing();
  242. jQuery(document).ready(function(){
  243. jQuery('.inputid').on('keyup, keydown', function(){
  244. setTimeout(function(){ getSmsPricing(); }, 300);
  245. // jQuery('#noOfSMS').val(jQuery('#noOfSMS').val().substr(0, 11));
  246. });
  247. jQuery('.inputidselectcountry').on('change', function(){
  248. setTimeout(function(){ getSmsPricing(); }, 300);
  249. });
  250. jQuery('.types li, .currencys li').on('click', function(){
  251. setTimeout(function(){ getSmsPricing(); }, 300);
  252. });
  253. getSmsPricing();
  254. })