var g_software_term_array = new Array(); //Google Analytics function trackEvent(category, action, label, value, debug){ var debug_global = false; var success_flag = false; if (typeof(debug) == 'undefined') debug = false; //Classic Analytics if (typeof(_gaq) !== 'undefined'){ if(typeof (label) === 'undefined'){ label = 'No Label'; } if(typeof(value) === 'undefined'){ value = null; } _gaq.push(['_trackEvent', category, action, label, value]); success_flag = true; if (debug || debug_global){ console.log(['Classic Analytics Event Tracking', category, action, label, value]); } } //Universal Analytics if( typeof(ga) !== 'undefined'){ ga('send', 'event', category, action, label, value); success_flag = true; if(debug || debug_global){ console.log(['Universal Analytics Event Tracking', category, action, label, value]); } } if(!success_flag){ console.log(['Event Tracking Failed', category, action, label, value]); } } function trackSocialEvent(socialNetwork, socialAction, socialTarget, debug){ var debug_global = false; var success_flag = false; if (typeof(debug) == 'undefined') debug = false; //Classic Analytics if(typeof(_gaq) !== 'undefined'){ if(typeof (socialTarget) === 'undefined'){ socialTarget = null; } _gaq.push(['_trackSocial', socialNetwork, socialAction, socialTarget]); success_flag = true; if (debug || debug_global) console.log(['Classic Analytics Social Tracking', socialNetwork, socialAction, socialTarget]); } //Universal Analytics if(typeof(ga) !== 'undefined'){ if(typeof (socialTarget) === 'undefined'){ socialTarget = null; } ga('send', 'social', socialNetwork, socialAction, socialTarget); success_flag = true; if (debug || debug_global) console.log(['Universal Analytics Social Tracking', socialNetwork, socialAction, socialTarget]); } if(!success_flag){ console.log(['Social Event Tracking Failed', socialNetwork, socialAction, socialTarget]); } } function logView(post_id){ $.ajax({ type: 'POST', url: 'https://www.business-software.com/wp-content/plugins/bs-framework/bs-ajax/view-log.php', data: { action: 'ajax_log_view', post_id: post_id }, success: function(ret){ } }); } function setCookie(c_name, value, exdays) { var exdate = new Date(); exdate.setDate(exdate.getDate() + exdays); var c_value = value + ((exdays == null) ? "" : "; expires=" + exdate.toUTCString()); c_value = c_value + ";path=/"; document.cookie = c_name + "=" + c_value; } function getCookie(name) { var value = "; " + document.cookie; var parts = value.split("; " + name + "="); if (parts.length == 2) return parts.pop().split(";").shift(); } function IsJsonString(str) { try { JSON.parse(str); } catch (e) { return false; } return true; } setCookie('track_me',"0",-1); setCookie('ad_tracking',"",-1); setCookie('ad_tracking_seen',"",-1); function DoNotTrack(){ setCookie('post_id_tracker', "" , 7); setCookie('post_term_tracker', "" , 7); setCookie('trackme', JSON.stringify(1) , 7); document.location.reload(); } function DoTrack(){ setCookie('post_id_tracker', "" , 7); setCookie('post_term_tracker', "" , 7); setCookie('trackme', JSON.stringify(0) , 7); document.location.reload(); } function TrackSinglePage(intID , strTerms){ var cookieString1; var cookieString2; cookieString1 = getCookie("post_term_tracker"); cookieString2 = getCookie("post_id_tracker"); if( !parseInt(getCookie("trackme"))){ if(cookieString1 && cookieString1.length > 0){ var intLimit = 45; if(cookieString1.split(",").length > intLimit){ var strTempArray = []; cookieString1.split(",").reverse().forEach(function(strValue, intKey, mixArray){ if(intKey < intLimit) strTempArray.push(strValue); }); var strTempString = ""; strTempArray.reverse().forEach(function(strValue,intKey, mixArray){ strTempString = strTempString + strValue; if(intKey != intLimit - 1) strTempString = strTempString + ","; }); cookieString1 = strTempString; } cookieString1 = cookieString1 + "," + strTerms; }else cookieString1 = strTerms; setCookie("post_term_tracker",cookieString1, 7); if(cookieString2 && cookieString2.length > 0){ var intLimit = 20; if(cookieString2.split(",").length > intLimit){ var strTempArray = []; cookieString2.split(",").reverse().forEach(function(strValue, intKey, mixArray){ if(intKey < intLimit) strTempArray.push(strValue); }); var strTempString = ""; strTempArray.reverse().forEach(function(strValue,intKey, mixArray){ strTempString = strTempString + strValue; if(intKey != intLimit - 1) strTempString = strTempString + ","; }); cookieString2 = strTempString; } cookieString2 = cookieString2 + "," + intID; } else cookieString2 = intID; setCookie("post_id_tracker",cookieString2, 7); } } function trackTwitter(intent_event) { if (intent_event) { var opt_pagePath; if (intent_event.target && intent_event.target.nodeName == 'IFRAME') { opt_target = extractParamFromUri(intent_event.target.src, 'url'); } trackSocialEvent('twitter', 'tweet', opt_pagePath); } } function extractParamFromUri(uri, paramName) { if (!uri) { return; } var regex = new RegExp('[\\?&#]' + paramName + '=([^&#]*)'); var params = regex.exec(uri); if (params != null) { return unescape(params[1]); } return; } function LinkedInShare() { trackSocialEvent('LinkedIn', 'Share'); } function getQuerystring(key, default_) { if (default_==null) default_=""; key = key.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); var regex = new RegExp("[\\?&]"+key+"=([^&#]*)"); var qs = regex.exec(window.location.href); if(qs == null) return default_; else return qs[1]; } jQuery(document).ready(function(){ jQuery("#hot-topics ul.menu li a").each(function(){ jQuery(this).click(function(){ trackEvent('Hot Topics',jQuery(this).html()); }); }); var timer1, timer2; var current_text = jQuery('#primary-nav #menu-item- a').text(); jQuery('#primary-nav #menu-item- a').addClass('sf-with-ul'); jQuery('#primary-nav #menu-item- a').html(current_text + ' ยป'); jQuery('#primary-nav #menu-item- a').hover( function() { clearTimeout(timer2); jQuery('#primary-nav #menu-item- a').addClass('active_nav'); if (jQuery('#resource-center-nav').is(":visible")) { } else { jQuery('#resource-center-nav').slideToggle('fast',function() { }); } }, function() { timer1 = setTimeout( function() { jQuery('#resource-center-nav').hide(); jQuery('#primary-nav #menu-item- a').removeClass('active_nav'); }, 200 ); } ); jQuery('#resource-center-nav').hover( function() { clearTimeout(timer1); jQuery('#resource-center-nav').show(); jQuery('#primary-nav #menu-item- a').addClass('active_nav'); }, function() { timer2 = setTimeout(function() { jQuery('#resource-center-nav').hide(); jQuery('#primary-nav #menu-item- a').removeClass('active_nav'); }, 200); } ); jQuery('.product-feature-link').click(function() { var feature_details = this.hash; if(jQuery(this).hasClass('product-feature-expand')) { jQuery(this).removeClass('product-feature-expand'); jQuery(this).addClass('product-feature-collapse'); } else if(jQuery(this).hasClass('product-feature-collapse')) { jQuery(this).removeClass('product-feature-collapse'); jQuery(this).addClass('product-feature-expand'); } jQuery(feature_details).slideToggle('slow', function() { }); }); var other_comments_display_count = 3; var other_comments_count = jQuery('#other-comments ul li').size(); if (other_comments_count <= other_comments_display_count) { jQuery('#other-comments .request-more-content').hide(); } jQuery('#other-comments .show-more-comments-link').click(function() { if (other_comments_display_count < other_comments_count) { other_comments_display_count += 5; jQuery(this).show_comment_list(); if (other_comments_display_count >= other_comments_count - 1) { jQuery(this).text('No more comments'); jQuery(this).addClass('no-more-comments'); } } }); jQuery.fn.show_comment_list = function() { jQuery('#other-comments ul') .find('li:lt('+other_comments_display_count+')') .show('slow') .end(); hide_index = other_comments_display_count - 1; jQuery('#other-comments ul') .find('li:gt('+hide_index+')') .hide() .end(); } jQuery(this).show_comment_list(); }); jQuery(document).ready(function(){ jQuery(".textinput").focus(function(srcc) { if (jQuery(this).val() == jQuery(this)[0].title) { jQuery(this).val(""); } jQuery(this).css('color', '#333'); }); jQuery(".textinput").blur(function() { if (jQuery(this).val() == '') { jQuery(this).val($(this)[0].title); jQuery(this).css('color', '#8e8e8e'); } else { jQuery(this).css('color', '#333'); } }); jQuery(".textinput").focus(); jQuery(".textinput").blur(); }); function adImpressionHandler(adType,adLabel,adLocation, ad){ switch(adType.toLowerCase()) { case "ab": if(ad.offset().top < $(window).height() + $(window).scrollTop()){ trackEvent( adType, 'Inline Impression - ' + adLocation, adLabel); } else $(document).scroll(function(){ if(ad.offset().top < $(window).height() + $(window).scrollTop() && ad.attr("id") != 'impressed'){ ad.attr("id","impressed"); trackEvent(adType, 'Inline AB Impression - ' + adLocation, adLabel); } }); break; case "inline content": $(document).scroll(function(){ if(ad.offset().top < $(window).height() + $(window).scrollTop() && ad.attr("id") != 'impressed'){ ad.attr("id","impressed"); trackEvent(adType, 'Inline Content Impression - ' + adLocation, adLabel); } }); break; case "Sidebar": trackEvent(adType, 'Sidebar Impression - ' + adLocation, adLabel); break; default: trackEvent(adType, 'Default Impression - ' + adLocation, adLabel); break; } } jQuery(document).ready(function($){ $(".bs-shortcode").each(function(index, value){ $.post("/ajax/inline-ad-shortcode", { "post_id" : $(value).attr("data-post-id") , "ad_id" : $(value).attr("data-ad-id"), "ad_rank" : $(value).attr("data-rank")} ,function(data){ var objData = eval(data); var strHTML = objData[0]['html'].replace(/\\"/g, '"'); strHTML = strHTML.replace(/\\'/g, "'"); $(value).html(strHTML); $(value).attr('data-ad-name', escapeHTML(objData[0]['name'])); $(value).attr('data-ad-id', objData[0]['id']); $(value).attr('data-ad-location', objData[0]['ad_location_id']); $(value).children("a").click(function(e){ trackEvent('Inline Ads', "Click", $(this).parent().attr("data-ad-id") + '-' + $(this).parent().attr("data-ad-name") + '-' + $(this).parent().attr("data-ad-location")); }); }); }); }); jQuery(document).ready(function($){ $("span[data-label]").each(function(index, value){ $.post("/ajax/trackable-ad-shortcode", { "post_id" : $(value).attr("data-post-id") , "ad_id" : $(value).attr("data-ad-id"), "ad_rank" : $(value).attr("data-rank"), "ad_type" : $(value).attr("data-adtype"), "ad_location" : $(value).attr("data-ad-location")} ,function(data){ var adType = $(value).attr('data-adtype'); var adLabel = $(value).attr('data-label'); var adLocation = $(value).attr('data-ad-location'); if(typeof adLocation === 'undefined') adLocation = $(value).attr('data-location'); var theseTrackChildren = $(value).find('[data-track], a'); var theseCloseChildren = $(value).children('[data-close]'); $(theseTrackChildren).each(function(){ $(this).click(function(){ trackEvent( adType, 'Click - ' + adLocation, adLabel); }); }); $(theseCloseChildren).each(function(){ $(this).click(function(){ trackEvent(adType, 'Close - ' + adLocation, adLabel); }); }); window.adImpressionHandler(adType, adLabel, adLocation, $(value)); }); }); $(".bs-trackable-shortcode").each(function(index, value){ $.post("/ajax/trackable-ad-shortcode", { "post_id" : $(value).attr("data-post-id") , "ad_id" : $(value).attr("data-ad-id"), "ad_rank" : $(value).attr("data-rank"), "ad_type" : $(value).attr("data-adtype"), "ad_location" : $(value).attr("data-ad-location")} ,function(data){ var objData = $.parseJSON(data); var strHTML = objData['html'].replace(/\\"/g, '"'); $(value).html(strHTML); $(value).attr('data-ad-name', escapeHTML(objData['ad_name'])); $(value).attr('data-ad-id', objData['ad_id']); var ads = $("span[data-label]"); ads.each(function(){ var adType = $(this).attr('data-adtype'); var adLabel = $(this).attr('data-label'); var adLocation = $(this).parent().attr('data-ad-location'); if(typeof adLocation === 'undefined') adLocation = $(this).attr('data-location'); var theseTrackChildren = $(this).find('[data-track], a'); var theseCloseChildren = $(this).children('[data-close]'); $(theseTrackChildren).find("a").each(function(){ $(this).attr("href" , $(this).attr("href") + "?ref=" + adLabel.replace(" ", "_") + ":" + adLocation.replace(" ", "_") + ":" + adType.replace(" ", "_")); }) $(theseTrackChildren).each(function(){ $(this).click(function(){ trackEvent(adType, 'Click - ' + adLocation, adLabel); }); }); $(theseCloseChildren).each(function(){ $(this).click(function(){ trackEvent(adType, 'Close - ' + adLocation, adLabel); }); }); window.adImpressionHandler(adType, adLabel, adLocation, $(this)); }); }); }); }); jQuery(document).ready(function(){ var loadUrl = "/wp-content/plugins/gfe-uber-v2/gfe-uber-post.php"; jQuery.ajaxSetup ({ cache: false }); /** * Trigger search results */ jQuery(".more-articles").live("click", function(){ var results = this.hash; var element_id = jQuery(this).attr('id'); var current = jQuery('#' + element_id + '-current-count').text(); var technology_terms = jQuery('#'+element_id+'-terms input[name=gfe_tax_technology-terms]').val(); var business_need_terms = jQuery('#'+element_id+'-terms input[name=gfe_tax_business_need-terms]').val(); var vendor_terms = jQuery('#'+element_id+'-terms input[name=gfe_tax_vendor-terms]').val(); jQuery('#'+element_id+'-'+current).html('
Loading...
'); jQuery.ajax({ type: "POST", url: loadUrl, data: { src: 'resource-center-article-request', button: element_id, results_id: results, technology: technology_terms, business_needs: business_need_terms, vendors: vendor_terms, count: current}, cache: false, success: function(html) { jQuery(results).append(html); jQuery('#'+element_id+'-'+current).remove(); } }); }); }); function validateEmail($email) { var emailReg = /^([\w-\.]+@([\w-]+\.)+[\w-]{2,4})?$/; return emailReg.test( $email );}