871 lines
35 KiB
JavaScript
871 lines
35 KiB
JavaScript
jQuery(document).ready(function ($) {
|
||
//validator init
|
||
var bvdoptions = {
|
||
offset: {x: -130, y: 0},
|
||
position: {x: 'right', y: 'top'},
|
||
validateActionsAttr: "data-validate-actions",
|
||
errorMessageAttr: "data-error-message"
|
||
}
|
||
|
||
$('#cbm-get-help-form').bValidator(bvdoptions);
|
||
$('#cbm-contact-form').bValidator(bvdoptions);
|
||
$('#rfq-step0-form-new').bValidator(bvdoptions);
|
||
|
||
//int phone number
|
||
if(typeof $.fn.intlTelInput !== 'undefined') {
|
||
$('#txt_phone_zero_new, #txt_phone, #txt_phone_bottom').intlTelInput({
|
||
utilsScript: "assets/js/utils.js",
|
||
|
||
initialCountry: "auto",
|
||
geoIpLookup: function(success, failure) {
|
||
var countryCode = getCookie("CountryCode") ? getCookie("CountryCode") : 'us' ;
|
||
console.log(countryCode);
|
||
success(countryCode);
|
||
},
|
||
separateDialCode: "true",
|
||
customPlaceholder: function(selectedCountryPlaceholder, selectedCountryData) {
|
||
return "e.g. " + selectedCountryPlaceholder;
|
||
},
|
||
//hiddenInput: "full"
|
||
});
|
||
}
|
||
|
||
// Changes by Viktor
|
||
//////////////////////////////////replace phone number
|
||
function formatPhoneNumber(phoneNumberString) {
|
||
var cleaned = ('' + phoneNumberString).replace(/\D/g, '')
|
||
var match = cleaned.match(/^(\d{3})(\d{3})(\d{4})$/)
|
||
if (match) {
|
||
return match[1] + '.' + match[2] + '.' + match[3]
|
||
}
|
||
return null
|
||
}
|
||
|
||
var sitephone = getCookie("SitePhone");
|
||
console.log("sitephone: " + sitephone);
|
||
if (sitephone !== null && sitephone != "") {
|
||
jQuery("a.chphone").each(function (index) {
|
||
var newPhone = formatPhoneNumber(sitephone);
|
||
if (jQuery(this).text().substring(0, 4).toLowerCase() == "call") {
|
||
jQuery(this).text("Call: " + newPhone);
|
||
} else if (jQuery(this).contents().length > 1) {
|
||
jQuery(this).contents().filter(function () {
|
||
return this.nodeType == 3;
|
||
}).last().replaceWith(formatPhoneNumber(newPhone));
|
||
} else {
|
||
jQuery(this).text(formatPhoneNumber(newPhone));
|
||
}
|
||
jQuery(this).attr("href", "tel:" + sitephone);
|
||
jQuery(this).attr("content", sitephone);
|
||
//console.log( index + ": " + $( this ).text() );
|
||
});
|
||
}
|
||
|
||
//////////////////////////////////////////////////////////
|
||
|
||
|
||
function setCookie(cname, cvalue, exdays) {
|
||
var d = new Date();
|
||
d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
|
||
var expires = "expires=" + d.toUTCString();
|
||
document.cookie = cname + "=" + cvalue + "; " + expires + "; path=/";
|
||
}
|
||
|
||
function getCookie(cname) {
|
||
var name = cname + "=";
|
||
var ca = document.cookie.split(';');
|
||
for (var i = 0; i < ca.length; i++) {
|
||
var c = ca[i];
|
||
while (c.charAt(0) == ' ') c = c.substring(1);
|
||
if (c.indexOf(name) == 0) return c.substring(name.length, c.length);
|
||
}
|
||
return "";
|
||
}
|
||
|
||
function eraseCookie(name) {
|
||
setCookie(name, "", -1);
|
||
}
|
||
|
||
var SITE = SITE || {};
|
||
|
||
SITE = {
|
||
navResize: function () {
|
||
var offset = jQuery(window).scrollTop(),
|
||
h = jQuery('#header');
|
||
if (offset > 40) {
|
||
h.addClass('small');
|
||
} else {
|
||
h.removeClass('small');
|
||
}
|
||
h = jQuery('#mobile-header');
|
||
if (offset > 40) {
|
||
h.addClass('small');
|
||
} else {
|
||
h.removeClass('small');
|
||
}
|
||
},
|
||
|
||
initMobileMenu: function () {
|
||
jQuery('.left-off-canvas-menu li.has-dropdown > a').each(function (idx, obj) {
|
||
jQuery(obj).on('click', function () {
|
||
if (jQuery(this).hasClass('open')) {
|
||
jQuery(this).removeClass('open');
|
||
} else {
|
||
jQuery(this).addClass('open');
|
||
}
|
||
jQuery(this).parent().find('ul.sub-menu').slideToggle();
|
||
});
|
||
});
|
||
jQuery('#mobile-header .left-off-canvas-toggle').on('click', function () {
|
||
jQuery('div.off-canvas-wrap').addClass('move-right');
|
||
});
|
||
jQuery('#header .medium-left-off-canvas-toggle').on('click', function () {
|
||
jQuery('div.off-canvas-wrap').addClass('move-right');
|
||
});
|
||
jQuery('.left-off-canvas-menu .left-off-canvas-toggle').on('click', function () {
|
||
});
|
||
jQuery('.exit-off-canvas').click(function () {
|
||
jQuery('div.off-canvas-wrap').removeClass('move-right');
|
||
});
|
||
jQuery('.left-off-canvas-menu .left-off-canvas-toggle').click(function () {
|
||
jQuery('div.off-canvas-wrap').removeClass('move-right');
|
||
});
|
||
},
|
||
initRightToggleMenu: function () {
|
||
if (Modernizr.mq("screen and (max-width:1024px)")) {
|
||
jQuery("body").toggleClass("body");
|
||
} else {
|
||
var s = skrollr.init({
|
||
mobileDeceleration: 1,
|
||
edgeStrategy: 'set',
|
||
forceHeight: false,
|
||
smoothScrolling: true,
|
||
smoothScrollingDuration: 100,
|
||
beforerender: function (data) {
|
||
return data.direction == 'down';
|
||
},
|
||
easing: {
|
||
WTF: Math.random,
|
||
inverted: function (p) {
|
||
return 1 - p;
|
||
}
|
||
}
|
||
});
|
||
}
|
||
let touchEvent = 'ontouchstart' in window ? 'touchstart' : 'click';
|
||
jQuery('.request-help-trigger').on(touchEvent, function (e) {
|
||
if (jQuery(this).hasClass('pull')) {
|
||
jQuery('.request-help-trigger').removeClass('pull');
|
||
jQuery('.request-help-form').removeClass('pull');
|
||
jQuery('.request-help-shadow').removeClass('pull');
|
||
} else {
|
||
jQuery('.request-help-trigger').addClass('pull');
|
||
jQuery('.request-help-form').addClass('pull');
|
||
jQuery('.request-help-shadow').addClass('pull');
|
||
}
|
||
});
|
||
jQuery('.request-help-shadow').on(touchEvent, function(e) {
|
||
jQuery('.request-help-trigger').removeClass('pull');
|
||
jQuery('.request-help-form').removeClass('pull');
|
||
jQuery('.request-help-shadow').removeClass('pull');
|
||
});
|
||
jQuery('.submit-case-btn').on(touchEvent, function(e) {
|
||
jQuery('.request-help-trigger').addClass('pull');
|
||
jQuery('.request-help-form').addClass('pull');
|
||
jQuery('.request-help-shadow').addClass('pull');
|
||
});
|
||
jQuery('.dfc_request_trigger').on(touchEvent, function(e) {
|
||
jQuery('.request-help-trigger').addClass('pull');
|
||
jQuery('.request-help-form').addClass('pull');
|
||
jQuery('.request-help-shadow').addClass('pull');
|
||
});
|
||
jQuery('.request-help-trigger').hover(function () {
|
||
jQuery(this).addClass('hover');
|
||
}, function () {
|
||
jQuery(this).removeClass('hover');
|
||
});
|
||
jQuery('.request-help-trigger').on(touchEvent, function () {
|
||
jQuery(this).trigger('hover');
|
||
}).on('touchend', function () {
|
||
jQuery(this).removeClass('hover');
|
||
});
|
||
},
|
||
initCircleAnimation: function () {
|
||
jQuery('.circle').each(function (idx, obj) {
|
||
jQuery(obj).on('click', function () {
|
||
jQuery('html, body').animate({
|
||
scrollTop: jQuery(this).parent().offset().top
|
||
}, 1000);
|
||
});
|
||
});
|
||
}
|
||
};
|
||
|
||
SITE.initRightToggleMenu();
|
||
SITE.initCircleAnimation();
|
||
|
||
|
||
});
|
||
jQuery(document).ready(function () {
|
||
if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent)
|
||
|| /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0, 4))) {
|
||
jQuery('.click2text_footer').show();
|
||
}
|
||
|
||
jQuery('a.click2text_link').click(function () {
|
||
var url = window.location.href;
|
||
var matches = url.match(/^https?\:\/\/(?:www\.)?([^\/?#]+)(?:[\/?#]|$)/i);
|
||
var domain = matches && matches[1];
|
||
var cust_srv_code = '';
|
||
var cust_srv_code_txt = '';
|
||
var csc_cookie_name = '';
|
||
if (domain == 'digitalforensics.com' || domain == 'digitalinvestigation.com' || domain == 'cyberblackmail911.com' || domain == 'sextortion.co.uk'|| domain == 'forensicaccountingcorp.com') {
|
||
csc_cookie_name = 'AdsCustomerCode';
|
||
cust_srv_code = getCookieValue(csc_cookie_name);
|
||
if (cust_srv_code != '') {
|
||
cust_srv_code_txt = ' Code: ' + cust_srv_code + '.';
|
||
}
|
||
}
|
||
//var sms_text = encodeURI('I found you on '+domain+'.'+cust_srv_code_txt+' I need help with ');
|
||
var sms_text = encodeURI('I found you on ' + domain + '. I need help with ');
|
||
var userAgent = navigator.userAgent || navigator.vendor || window.opera;
|
||
|
||
_paq.push(['setCustomVariable',
|
||
// Index, the number from 1 to 5 where this custom variable name is stored
|
||
2,
|
||
// Name, the name of the variable, for example: Gender, VisitorType
|
||
"From-SMS",
|
||
// Value, for example: "Male", "Female" or "new", "engaged", "customer"
|
||
cust_srv_code,
|
||
// Scope of the custom variable, "visit" means the custom variable applies to the current visit
|
||
"visit"
|
||
]);
|
||
_paq.push(['trackPageView']);
|
||
|
||
if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) {
|
||
window.location.href = 'sms://+12168779886&body=' + sms_text;
|
||
// window.location.href = 'sms://+18882885963&body=' + sms_text;
|
||
} else {
|
||
window.location.href = 'sms://+12168779886?body=' + sms_text;
|
||
// window.location.href = 'sms://+18882885963?body=' + sms_text;
|
||
}
|
||
});
|
||
|
||
var url = window.location.href;
|
||
var matches = url.match(/^https?\:\/\/(?:www\.)?([^\/?#]+)(?:[\/?#]|$)/i);
|
||
var domain = matches && matches[1];
|
||
var cust_srv_code = '';
|
||
var cust_srv_code_txt = '';
|
||
var csc_cookie_name = '';
|
||
|
||
csc_cookie_name = 'AdsCustomerCode';
|
||
cust_srv_code = getCookieValue(csc_cookie_name);
|
||
if (cust_srv_code != '') {
|
||
cust_srv_code_txt = ' Code: ' + cust_srv_code + '.';
|
||
jQuery('input#rh_customer_service_code').val(cust_srv_code);
|
||
}
|
||
|
||
|
||
if (jQuery('#agree input').length) {
|
||
jQuery('#agree input').insertBefore('.checker');
|
||
}
|
||
jQuery('.request-help-trigger.for-mobile').hover(function () {
|
||
jQuery(this).stop(true, true).hide(1);
|
||
jQuery('.request-help-trigger.for-desktop').stop(true, true).show(1);
|
||
});
|
||
jQuery('.request-help-trigger.for-desktop').hover(function () {
|
||
}, function () {
|
||
jQuery(this).stop(true, true).hide(1);
|
||
jQuery('.request-help-trigger.for-mobile').stop(true, true).show(1);
|
||
});
|
||
if (jQuery(".first-block h1 i").length) {
|
||
jQuery('.first-block h1 i').parent().next().css('padding-left', '60px');
|
||
}
|
||
jQuery('#map-country').change(function () {
|
||
if (jQuery('#map-country').val() != "us") {
|
||
window.location.href = local_data.home_url + "/locations/" + jQuery('#map-country').val();
|
||
} else {
|
||
window.location.href = local_data.home_url + "/locations/";
|
||
}
|
||
});
|
||
jQuery('#svg_map').click(function () {
|
||
jQuery('#msg_title').text(jQuery('#toolTipName').text());
|
||
jQuery('select.map-state option').filter(function () {
|
||
return jQuery(this).html() == jQuery('#toolTipName').text();
|
||
}).attr('selected', 'selected');
|
||
});
|
||
jQuery('.request-help-trigger').click(function () {
|
||
});
|
||
if (jQuery('.chosen-select').length) {
|
||
/*jQuery(".chosen-select").chosen({
|
||
disable_search_threshold: 10
|
||
});*/
|
||
}
|
||
jQuery('.radio').click(function () {
|
||
name = jQuery(this).children('input[type=radio]').first().attr('name');
|
||
value = jQuery(this).children('input[type=radio]').first().attr('value');
|
||
jQuery('input[name=' + name + ']').removeAttr('current');
|
||
jQuery('input[name="' + name + '"][value="' + value + '"]').attr('current', 'current');
|
||
if (jQuery('input[name=' + name + ']:checked').val() == 'yes') {
|
||
jQuery('input[name=encryption_type_c]').removeClass('hidden');
|
||
jQuery('input[name=encryption_type_c]').addClass('validation');
|
||
} else {
|
||
jQuery('input[name=encryption_type_c]').addClass('hidden');
|
||
jQuery('input[name=encryption_type_c]').removeClass('validation');
|
||
}
|
||
});
|
||
jQuery('#map-country').val(jQuery('#all_maps_holder > div').first().attr('code'));
|
||
if (jQuery("#msg_title").length) {
|
||
jQuery('#msg_title').text("Office Locations");
|
||
}
|
||
if (jQuery("#usaHtmlMapStateInfo").length) {
|
||
jQuery("#usaHtmlMapStateInfo").html(local_data.map_text);
|
||
}
|
||
if (jQuery("#canadaHtmlMapStateInfo").length) {
|
||
jQuery("#canadaHtmlMapStateInfo").html(local_data.map_text);
|
||
}
|
||
if (jQuery("#ukcountiesHtmlMapStateInfo").length) {
|
||
jQuery("#ukcountiesHtmlMapStateInfo").html(local_data.map_text);
|
||
}
|
||
if (jQuery('div#toolTip').length) {
|
||
jQuery('#toolTipImage').append('<img src="' + local_data.home_url + '/wp-content/themes/foundation/assets/img/ma-icon.png">');
|
||
jQuery('#toolTipName').insertBefore(jQuery('table#ToolTipFrame'));
|
||
jQuery('div#toolTip').append('<div id="tooltipImageLeft"><img src="' + local_data.home_url + '/wp-content/themes/foundation/assets/img/ma-icon.png" /></div>');
|
||
jQuery('div#tooltipImageLeft').after('<p class="location-link">Click State or City Location for details</p>');
|
||
jQuery('#tooltipImageLeft').insertBefore('#ToolTipFrame');
|
||
}
|
||
jQuery(".popup_image").click(function () {
|
||
jQuery(".popup_image").fancybox({
|
||
'showNavArrows': true,
|
||
helpers: {
|
||
overlay: {
|
||
closeClick: true,
|
||
speedOut: 200,
|
||
showEarly: true,
|
||
locked: true
|
||
}
|
||
},
|
||
scrolling: 'no',
|
||
autoSize: false
|
||
});
|
||
});
|
||
if (jQuery('#ToolTip').children('ul').length) {
|
||
jQuery('#ToolTipFrame ul').remove();
|
||
}
|
||
var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
|
||
if (is_chrome) {
|
||
}
|
||
if (jQuery('#share').length) {
|
||
jQuery('#share, .shareOpt').hover(function () {
|
||
jQuery('#share').addClass('social-background');
|
||
}, function () {
|
||
jQuery('#share').removeClass('social-background');
|
||
});
|
||
jQuery('.shareOpt').hover(function () {
|
||
}, function () {
|
||
var el = jQuery('.shareOpt'),
|
||
newone = el.clone(true);
|
||
el.before(newone);
|
||
jQuery("." + el.attr("class") + ":last").remove();
|
||
});
|
||
}
|
||
});
|
||
|
||
function load_state_info(select, info) {
|
||
css_id = jQuery(select).attr('id');
|
||
jQuery('#msg_title').text(jQuery("#" + css_id + " option:selected").text());
|
||
jQuery('#usaHtmlMapStateInfo').html(info[jQuery("#" + css_id).val()]);
|
||
}
|
||
|
||
function isValidEmailAddress(emailAddress) {
|
||
var pattern = new RegExp(/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i);
|
||
return pattern.test(emailAddress);
|
||
};
|
||
jQuery.fn.isOnScreen = function () {
|
||
var win = jQuery(window);
|
||
var viewport = {
|
||
top: win.scrollTop(),
|
||
left: win.scrollLeft()
|
||
};
|
||
viewport.right = viewport.left + win.width();
|
||
viewport.bottom = viewport.top + win.height();
|
||
var bounds = this.offset();
|
||
bounds.right = bounds.left + this.outerWidth();
|
||
bounds.bottom = bounds.top + this.outerHeight();
|
||
return (!(viewport.right < bounds.left || viewport.left > bounds.right || viewport.bottom < bounds.top || viewport.top > bounds.bottom));
|
||
};
|
||
|
||
function getParameterByName(name) {
|
||
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
|
||
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
|
||
results = regex.exec(location.search);
|
||
return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
|
||
}
|
||
|
||
function getCookieValue(a) {
|
||
var b = document.cookie.match('(^|[^;]+)\\s*' + a + '\\s*=\\s*([^;]+)');
|
||
return b ? b.pop() : '';
|
||
}
|
||
|
||
function phonefilter(number) {
|
||
if(typeof $.fn.intlTelInput !== 'undefined'){
|
||
if ($(this).intlTelInput("isValidNumber")) {
|
||
return true;
|
||
} else return false;
|
||
} else {
|
||
if (number.replace(/[^\d]/g, '').length > 0) {
|
||
return true;
|
||
} else return false;
|
||
}
|
||
}
|
||
|
||
//add survey popup
|
||
|
||
(function(w, d, s, u, f, m, n, o) {
|
||
o = 'https://survey.digitalforensics.com';
|
||
w[f] = w[f] || function() {
|
||
(w[f].p = w[f].p || []).push(arguments);
|
||
};
|
||
m = d.createElement(s), n = d.getElementsByTagName(s)[0];
|
||
m.async = 1;
|
||
m.src = o + u;
|
||
n.parentNode.insertBefore(m, n);
|
||
zs_intercept(o, 'DzD74P', {
|
||
"displayPeriod": 4,
|
||
"position": 2,
|
||
"vMaps": [{
|
||
"var_type": 1,
|
||
"c_var_id": "521366000030322511",
|
||
"var_name": "CustomerCode"
|
||
}]
|
||
});
|
||
})(window, document, 'script', '/api/v1/public/livesurveys/DzD74P/popup/script', 'zs_intercept');
|
||
|
||
function zsShowPopup() {
|
||
var i = setInterval(function() {
|
||
if (window.zsShowFrame !== undefined) {
|
||
window.zsShowFrame();
|
||
clearInterval(i);
|
||
}
|
||
}, 300); }
|
||
|
||
// Right Get Help Now Form
|
||
$("#main_send_request_new").click(function () {
|
||
|
||
event.preventDefault();
|
||
|
||
if (jQuery('#rfq-step0-form-new').data('bValidators').first.validate()) {
|
||
jQuery("#help_step1").hide();
|
||
jQuery("#help_step2").show();
|
||
data = jQuery("#rfq-step0-form-new").serialize();
|
||
//get domain name from url
|
||
url = window.location.href;
|
||
var matches = url.match(/^https?\:\/\/(?:www\.)?([^\/?#]+)(?:[\/?#]|$)/i);
|
||
var domain = matches && matches[1];
|
||
var countryIso = $("#txt_phone_zero_new").intlTelInput("getSelectedCountryData").iso2;
|
||
var countryName = getCountryName(countryIso.toUpperCase()); // $("#txt_phone_zero_new").intlTelInput("getSelectedCountryData").name;
|
||
var d = $("#txt_phone_zero_new").intlTelInput("getSelectedCountryData").dialCode;
|
||
var fullPhone = $("#txt_phone_zero_new").intlTelInput("getNumber");
|
||
data = data + "&form=" + domain+"&iso=" + countryIso + "&fullPhone=" + encodeURIComponent(fullPhone) + "&dialCode=" + d + "&countryName=" + countryName;
|
||
|
||
grecaptcha.ready(function () {
|
||
grecaptcha.execute('6LdfE98UAAAAAE71oW3zy3xzYxvP0_hjTB9xA0VK', {action: 'step0'}).then(function (token) {
|
||
data = data + "&token=" + token;
|
||
jQuery.post("https://www.digitalforensics.com/index.php",
|
||
data
|
||
, function (data) {
|
||
if (data != null) {
|
||
if( typeof(zsShowPopup) == "function"){zsShowPopup();} else console.log('zsShowPopup() function is not defined')
|
||
dataLayer.push({'event': 'shortform'});
|
||
$success_message = 'Thank you for contacting us.<br>';
|
||
if(data['case_number']) $success_message += 'Your case number is <b>'+ data['case_number'] +'</b>.<br>';
|
||
$success_message += 'A specialist will contact you back shortly, you can always call or chat with a specialist for more information.</div>';
|
||
jQuery("#help_step2").hide();
|
||
jQuery('#help_step3').html($success_message);
|
||
jQuery("#help_step3").show(function () {
|
||
setTimeout(function () {
|
||
jQuery('.request-help-trigger').removeClass('pull');
|
||
jQuery('.request-help-form').removeClass('pull');
|
||
jQuery(".request-help-shadow").removeClass("pull");
|
||
}, 5000);
|
||
});
|
||
}
|
||
}, "json");
|
||
});
|
||
});
|
||
}
|
||
});
|
||
|
||
// Main Get Hel Now Form
|
||
$("#cbm-send-request").click(function () {
|
||
if (jQuery('#cbm-get-help-form').data('bValidators').first.validate()) {
|
||
data = jQuery("#cbm-get-help-form").serialize();
|
||
$("#cbm-form-main").hide();
|
||
$("#cbm-form-loader").show();
|
||
url = window.location.href;
|
||
var matches = url.match(/^https?\:\/\/(?:www\.)?([^\/?#]+)(?:[\/?#]|$)/i);
|
||
var domain = matches && matches[1];
|
||
var countryIso = $("#txt_phone").intlTelInput("getSelectedCountryData").iso2;
|
||
var countryName = getCountryName(countryIso.toUpperCase()); //$("#txt_phone").intlTelInput("getSelectedCountryData").name;
|
||
var d = $("#txt_phone").intlTelInput("getSelectedCountryData").dialCode;
|
||
var fullPhone = $("#txt_phone").intlTelInput("getNumber");
|
||
data = data + "&form=" + domain+"&iso=" + countryIso + "&fullPhone=" + encodeURIComponent(fullPhone) + "&dialCode=" + d + "&countryName=" + countryName;
|
||
|
||
grecaptcha.ready(function () {
|
||
grecaptcha.execute('6LdfE98UAAAAAE71oW3zy3xzYxvP0_hjTB9xA0VK', {action: 'step0'}).then(function (token) {
|
||
data = data + "&token=" + token;
|
||
jQuery.post("https://www.digitalforensics.com/index.php", data, function (data) {
|
||
if (data != null) {
|
||
dataLayer.push({'event': 'shortform'});
|
||
if( typeof(zsShowPopup) == "function"){zsShowPopup();} else console.log('zsShowPopup() function is not defined')
|
||
dataLayer.push({'event': 'shortform'});
|
||
$("#cbm-form-loader").hide();
|
||
$("#cbm-form-top").html("<h2>Thank you <br>We will contact you <span>ASAP</span></h2>");
|
||
}
|
||
}, "json");
|
||
});
|
||
});
|
||
}
|
||
});
|
||
|
||
//Bottom Get Help Now Form
|
||
$('#cbm-send-message').click(function () {
|
||
|
||
if ($("#message").is(":visible")) {
|
||
$("#message").slideUp(750, function () {
|
||
$('#message').hide();
|
||
});
|
||
}
|
||
|
||
if (jQuery('#cbm-contact-form').data('bValidators').first.validate()) {
|
||
data = jQuery("#cbm-contact-form").serialize();
|
||
var name = $("#cbm-contact-form input[name=txt_first_name]").val();
|
||
$('#cbm-send-message').after('<img src="assets/img/ajax-loader.gif" class="loader" />').attr('disabled', 'disabled');
|
||
url = window.location.href;
|
||
var matches = url.match(/^https?\:\/\/(?:www\.)?([^\/?#]+)(?:[\/?#]|$)/i);
|
||
var domain = matches && matches[1];
|
||
var countryIso = $("#txt_phone_bottom").intlTelInput("getSelectedCountryData").iso2;
|
||
var countryName = getCountryName(countryIso.toUpperCase()); // $("#txt_phone_bottom").intlTelInput("getSelectedCountryData").name;
|
||
var d = $("#txt_phone_bottom").intlTelInput("getSelectedCountryData").dialCode;
|
||
var fullPhone = $("#txt_phone_bottom").intlTelInput("getNumber");
|
||
data = data + "&form=" + domain+"&iso=" + countryIso + "&fullPhone=" + fullPhone + "&dialCode=" + d + "&countryName" + countryName;
|
||
// console.log(data);
|
||
// return false;
|
||
grecaptcha.ready(function () {
|
||
grecaptcha.execute('6LdfE98UAAAAAE71oW3zy3xzYxvP0_hjTB9xA0VK', {action: 'step0'}).then(function (token) {
|
||
data = data + "&token=" + token;
|
||
jQuery.post("https://www.digitalforensics.com/index.php", data, function (data) {
|
||
if (data != null) {
|
||
dataLayer.push({'event': 'shortform'});
|
||
if( typeof(zsShowPopup) == "function"){zsShowPopup();} else console.log('zsShowPopup() function is not defined')
|
||
dataLayer.push({'event': 'shortform'});
|
||
document.getElementById('message').innerHTML = "<div class='alert alert-success' style='margin-top:15px;'><h3>Thank you <strong>" + name + "</strong>.</h3><p>We’ll call you back as soon as possible. Talk to you soon.</p></div>";
|
||
$('#message').slideDown('slow');
|
||
$('.contact-form img.loader').fadeOut('slow', function () {
|
||
$(this).remove()
|
||
});
|
||
$('#cbm-send-message').removeAttr('disabled');
|
||
}
|
||
}, "json");
|
||
});
|
||
});
|
||
}
|
||
});
|
||
|
||
|
||
$(window).scroll(function () {
|
||
var aTop = 10;
|
||
var smVisible = false;
|
||
if ($(this).scrollTop() >= aTop && !smVisible) {
|
||
$('#services').removeClass("hidden-xs");
|
||
$('#about').removeClass("hidden-xs");
|
||
$('#features').removeClass("hidden-xs");
|
||
$('#overview').removeClass("hidden-xs");
|
||
$('#faq').removeClass("hidden-xs");
|
||
$('#contact').removeClass("hidden-xs");
|
||
$('#services').removeClass("hidden-sm");
|
||
$('#about').removeClass("hidden-sm");
|
||
$('#features').removeClass("hidden-sm");
|
||
$('#overview').removeClass("hidden-sm");
|
||
$('#faq').removeClass("hidden-sm");
|
||
$('#contact').removeClass("hidden-sm");
|
||
smVisible = true;
|
||
}
|
||
});
|
||
|
||
//Add captcha on first name focus
|
||
|
||
var reCaptchaFocus = function () {
|
||
var head = document.getElementsByTagName('head')[0];
|
||
var script = document.createElement('script');
|
||
script.type = 'text/javascript';
|
||
script.src = 'https://www.google.com/recaptcha/api.js?render=6LdfE98UAAAAAE71oW3zy3xzYxvP0_hjTB9xA0VK';
|
||
head.appendChild(script);
|
||
|
||
// remove focus to avoid js error:
|
||
// Uncaught Error: reCAPTCHA has already been rendered in this element at Object.kh
|
||
document.getElementById('txt_first_name_zero_new').removeEventListener('focus', reCaptchaFocus);
|
||
document.getElementById('txt_first_name').removeEventListener('focus', reCaptchaFocus);
|
||
document.getElementById('txt_first_name_bottom').removeEventListener('focus', reCaptchaFocus);
|
||
};
|
||
// add initial event listener to our basic HTML form
|
||
document.getElementById('txt_first_name_zero_new').addEventListener('focus', reCaptchaFocus, false);
|
||
document.getElementById('txt_first_name').addEventListener('focus', reCaptchaFocus, false);
|
||
document.getElementById('txt_first_name_bottom').addEventListener('focus', reCaptchaFocus, false);
|
||
|
||
var isoCountries = {
|
||
'AF' : 'Afghanistan',
|
||
'AX' : 'Aland Islands',
|
||
'AL' : 'Albania',
|
||
'DZ' : 'Algeria',
|
||
'AS' : 'American Samoa',
|
||
'AD' : 'Andorra',
|
||
'AO' : 'Angola',
|
||
'AI' : 'Anguilla',
|
||
'AQ' : 'Antarctica',
|
||
'AG' : 'Antigua And Barbuda',
|
||
'AR' : 'Argentina',
|
||
'AM' : 'Armenia',
|
||
'AW' : 'Aruba',
|
||
'AU' : 'Australia',
|
||
'AT' : 'Austria',
|
||
'AZ' : 'Azerbaijan',
|
||
'BS' : 'Bahamas',
|
||
'BH' : 'Bahrain',
|
||
'BD' : 'Bangladesh',
|
||
'BB' : 'Barbados',
|
||
'BY' : 'Belarus',
|
||
'BE' : 'Belgium',
|
||
'BZ' : 'Belize',
|
||
'BJ' : 'Benin',
|
||
'BM' : 'Bermuda',
|
||
'BT' : 'Bhutan',
|
||
'BO' : 'Bolivia',
|
||
'BA' : 'Bosnia And Herzegovina',
|
||
'BW' : 'Botswana',
|
||
'BV' : 'Bouvet Island',
|
||
'BR' : 'Brazil',
|
||
'IO' : 'British Indian Ocean Territory',
|
||
'BN' : 'Brunei Darussalam',
|
||
'BG' : 'Bulgaria',
|
||
'BF' : 'Burkina Faso',
|
||
'BI' : 'Burundi',
|
||
'KH' : 'Cambodia',
|
||
'CM' : 'Cameroon',
|
||
'CA' : 'Canada',
|
||
'CV' : 'Cape Verde',
|
||
'KY' : 'Cayman Islands',
|
||
'CF' : 'Central African Republic',
|
||
'TD' : 'Chad',
|
||
'CL' : 'Chile',
|
||
'CN' : 'China',
|
||
'CX' : 'Christmas Island',
|
||
'CC' : 'Cocos (Keeling) Islands',
|
||
'CO' : 'Colombia',
|
||
'KM' : 'Comoros',
|
||
'CG' : 'Congo',
|
||
'CD' : 'Congo, Democratic Republic',
|
||
'CK' : 'Cook Islands',
|
||
'CR' : 'Costa Rica',
|
||
'CI' : 'Cote D\'Ivoire',
|
||
'HR' : 'Croatia',
|
||
'CU' : 'Cuba',
|
||
'CY' : 'Cyprus',
|
||
'CZ' : 'Czech Republic',
|
||
'DK' : 'Denmark',
|
||
'DJ' : 'Djibouti',
|
||
'DM' : 'Dominica',
|
||
'DO' : 'Dominican Republic',
|
||
'EC' : 'Ecuador',
|
||
'EG' : 'Egypt',
|
||
'SV' : 'El Salvador',
|
||
'GQ' : 'Equatorial Guinea',
|
||
'ER' : 'Eritrea',
|
||
'EE' : 'Estonia',
|
||
'ET' : 'Ethiopia',
|
||
'FK' : 'Falkland Islands (Malvinas)',
|
||
'FO' : 'Faroe Islands',
|
||
'FJ' : 'Fiji',
|
||
'FI' : 'Finland',
|
||
'FR' : 'France',
|
||
'GF' : 'French Guiana',
|
||
'PF' : 'French Polynesia',
|
||
'TF' : 'French Southern Territories',
|
||
'GA' : 'Gabon',
|
||
'GM' : 'Gambia',
|
||
'GE' : 'Georgia',
|
||
'DE' : 'Germany',
|
||
'GH' : 'Ghana',
|
||
'GI' : 'Gibraltar',
|
||
'GR' : 'Greece',
|
||
'GL' : 'Greenland',
|
||
'GD' : 'Grenada',
|
||
'GP' : 'Guadeloupe',
|
||
'GU' : 'Guam',
|
||
'GT' : 'Guatemala',
|
||
'GG' : 'Guernsey',
|
||
'GN' : 'Guinea',
|
||
'GW' : 'Guinea-Bissau',
|
||
'GY' : 'Guyana',
|
||
'HT' : 'Haiti',
|
||
'HM' : 'Heard Island & Mcdonald Islands',
|
||
'VA' : 'Holy See (Vatican City State)',
|
||
'HN' : 'Honduras',
|
||
'HK' : 'Hong Kong',
|
||
'HU' : 'Hungary',
|
||
'IS' : 'Iceland',
|
||
'IN' : 'India',
|
||
'ID' : 'Indonesia',
|
||
'IR' : 'Iran, Islamic Republic Of',
|
||
'IQ' : 'Iraq',
|
||
'IE' : 'Ireland',
|
||
'IM' : 'Isle Of Man',
|
||
'IL' : 'Israel',
|
||
'IT' : 'Italy',
|
||
'JM' : 'Jamaica',
|
||
'JP' : 'Japan',
|
||
'JE' : 'Jersey',
|
||
'JO' : 'Jordan',
|
||
'KZ' : 'Kazakhstan',
|
||
'KE' : 'Kenya',
|
||
'KI' : 'Kiribati',
|
||
'KR' : 'Korea',
|
||
'KW' : 'Kuwait',
|
||
'KG' : 'Kyrgyzstan',
|
||
'LA' : 'Lao People\'s Democratic Republic',
|
||
'LV' : 'Latvia',
|
||
'LB' : 'Lebanon',
|
||
'LS' : 'Lesotho',
|
||
'LR' : 'Liberia',
|
||
'LY' : 'Libyan Arab Jamahiriya',
|
||
'LI' : 'Liechtenstein',
|
||
'LT' : 'Lithuania',
|
||
'LU' : 'Luxembourg',
|
||
'MO' : 'Macao',
|
||
'MK' : 'Macedonia',
|
||
'MG' : 'Madagascar',
|
||
'MW' : 'Malawi',
|
||
'MY' : 'Malaysia',
|
||
'MV' : 'Maldives',
|
||
'ML' : 'Mali',
|
||
'MT' : 'Malta',
|
||
'MH' : 'Marshall Islands',
|
||
'MQ' : 'Martinique',
|
||
'MR' : 'Mauritania',
|
||
'MU' : 'Mauritius',
|
||
'YT' : 'Mayotte',
|
||
'MX' : 'Mexico',
|
||
'FM' : 'Micronesia, Federated States Of',
|
||
'MD' : 'Moldova',
|
||
'MC' : 'Monaco',
|
||
'MN' : 'Mongolia',
|
||
'ME' : 'Montenegro',
|
||
'MS' : 'Montserrat',
|
||
'MA' : 'Morocco',
|
||
'MZ' : 'Mozambique',
|
||
'MM' : 'Myanmar',
|
||
'NA' : 'Namibia',
|
||
'NR' : 'Nauru',
|
||
'NP' : 'Nepal',
|
||
'NL' : 'Netherlands',
|
||
'AN' : 'Netherlands Antilles',
|
||
'NC' : 'New Caledonia',
|
||
'NZ' : 'New Zealand',
|
||
'NI' : 'Nicaragua',
|
||
'NE' : 'Niger',
|
||
'NG' : 'Nigeria',
|
||
'NU' : 'Niue',
|
||
'NF' : 'Norfolk Island',
|
||
'MP' : 'Northern Mariana Islands',
|
||
'NO' : 'Norway',
|
||
'OM' : 'Oman',
|
||
'PK' : 'Pakistan',
|
||
'PW' : 'Palau',
|
||
'PS' : 'Palestinian Territory, Occupied',
|
||
'PA' : 'Panama',
|
||
'PG' : 'Papua New Guinea',
|
||
'PY' : 'Paraguay',
|
||
'PE' : 'Peru',
|
||
'PH' : 'Philippines',
|
||
'PN' : 'Pitcairn',
|
||
'PL' : 'Poland',
|
||
'PT' : 'Portugal',
|
||
'PR' : 'Puerto Rico',
|
||
'QA' : 'Qatar',
|
||
'RE' : 'Reunion',
|
||
'RO' : 'Romania',
|
||
'RU' : 'Russian Federation',
|
||
'RW' : 'Rwanda',
|
||
'BL' : 'Saint Barthelemy',
|
||
'SH' : 'Saint Helena',
|
||
'KN' : 'Saint Kitts And Nevis',
|
||
'LC' : 'Saint Lucia',
|
||
'MF' : 'Saint Martin',
|
||
'PM' : 'Saint Pierre And Miquelon',
|
||
'VC' : 'Saint Vincent And Grenadines',
|
||
'WS' : 'Samoa',
|
||
'SM' : 'San Marino',
|
||
'ST' : 'Sao Tome And Principe',
|
||
'SA' : 'Saudi Arabia',
|
||
'SN' : 'Senegal',
|
||
'RS' : 'Serbia',
|
||
'SC' : 'Seychelles',
|
||
'SL' : 'Sierra Leone',
|
||
'SG' : 'Singapore',
|
||
'SK' : 'Slovakia',
|
||
'SI' : 'Slovenia',
|
||
'SB' : 'Solomon Islands',
|
||
'SO' : 'Somalia',
|
||
'ZA' : 'South Africa',
|
||
'GS' : 'South Georgia And Sandwich Isl.',
|
||
'ES' : 'Spain',
|
||
'LK' : 'Sri Lanka',
|
||
'SD' : 'Sudan',
|
||
'SR' : 'Suriname',
|
||
'SJ' : 'Svalbard And Jan Mayen',
|
||
'SZ' : 'Swaziland',
|
||
'SE' : 'Sweden',
|
||
'CH' : 'Switzerland',
|
||
'SY' : 'Syrian Arab Republic',
|
||
'TW' : 'Taiwan',
|
||
'TJ' : 'Tajikistan',
|
||
'TZ' : 'Tanzania',
|
||
'TH' : 'Thailand',
|
||
'TL' : 'Timor-Leste',
|
||
'TG' : 'Togo',
|
||
'TK' : 'Tokelau',
|
||
'TO' : 'Tonga',
|
||
'TT' : 'Trinidad And Tobago',
|
||
'TN' : 'Tunisia',
|
||
'TR' : 'Turkey',
|
||
'TM' : 'Turkmenistan',
|
||
'TC' : 'Turks And Caicos Islands',
|
||
'TV' : 'Tuvalu',
|
||
'UG' : 'Uganda',
|
||
'UA' : 'Ukraine',
|
||
'AE' : 'United Arab Emirates',
|
||
'GB' : 'United Kingdom',
|
||
'US' : 'United States',
|
||
'UM' : 'United States Outlying Islands',
|
||
'UY' : 'Uruguay',
|
||
'UZ' : 'Uzbekistan',
|
||
'VU' : 'Vanuatu',
|
||
'VE' : 'Venezuela',
|
||
'VN' : 'Viet Nam',
|
||
'VG' : 'Virgin Islands, British',
|
||
'VI' : 'Virgin Islands, U.S.',
|
||
'WF' : 'Wallis And Futuna',
|
||
'EH' : 'Western Sahara',
|
||
'YE' : 'Yemen',
|
||
'ZM' : 'Zambia',
|
||
'ZW' : 'Zimbabwe'
|
||
};
|
||
|
||
function getCountryName (countryCode) {
|
||
if (isoCountries.hasOwnProperty(countryCode)) {
|
||
return isoCountries[countryCode];
|
||
} else {
|
||
return countryCode;
|
||
}
|
||
}
|