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('
');
jQuery('#toolTipName').insertBefore(jQuery('table#ToolTipFrame'));
jQuery('div#toolTip').append('
Click State or City Location for details
'); 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.
').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 = "We’ll call you back as soon as possible. Talk to you soon.