/* * * * -meta--- * version: * builddate: 2015-03-26T17:24:42.114Z * generator: interleave@0.5.24 * * * */ // req: /** * Cleansheet Module Specificiation * @author Matthew Wright - June 2009 * @module cleansheet */ /** * HPMMD object definition - Hewlett-Packard Metrics Metadata Dictionary Object. * Primary container of all analytic metadata used on any HP.com web page * @class hpmmd * @example hpmmd.page.name="Some Name"; hpmmd.user.id="User's ID"; */ var hpmmd = window.hpmmd || { /** * Type identifies the kind of HP Analytic standard the dictionary follows. * "Cleansheet Wash" will be the default for this file. * @property type * @type string * @default "Cleansheet Wash" * @example // Triggers the Purchase analytic event - single event only hpmmd.page.events=["Purchase"]; // Triggers two analytic events simultaneously hpmmd.page.events=["Shopping Cart Add","Shopping Cart View"]; **/ type: 'Cleansheet Wash', /** * The page container contains all data that applies to the page context itself. * @property page * @type Object * @default {events:[]} // Empty event array **/ page: { /** * The event array defines any analytic events (page views, cart actions, lead generation, etc) leveraged by different tag vendors * @property events * @type Array * @default [] **/ events: []}, product: {}, user: {}, legacy: {}, promo: {} }; // hpmmd.timer=hpmmd.timer||{ start: (new Date()).getTime(), condition: "load-imd"}; hpmmd.code = {version: "20150326A"}; var _mbootstrap; hpmmd.log = (function () { /* Window logging function */ /* https://raw.github.com/cpatik/console.log-wrapper/master/consolelog.js */ /* BEGIN OF FILE */ // Tell IE9 to use its built-in console if (Function.prototype.bind && ( typeof console === 'object' || typeof console === 'function') && typeof console.log == "object") { ["log", "info", "warn", "error", "assert", "dir", "clear", "profile", "profileEnd"].forEach(function (method) { console[method] = this.call(console[method], console); }, Function.prototype.bind); } // log() -- The complete, cross-browser (we don't judge!) console.log wrapper for his or her logging pleasure this.log = function () { log.history = log.history || []; // store logs to an array for reference log.history.push(arguments); // Modern browsers if (typeof console != 'undefined' && typeof console.log == 'function') { // Opera 11 if (window.opera) { var i = 0; while (i < arguments.length) { console.log("Item " + (i + 1) + ": " + arguments[i]); i++; } } // All other modern browsers else if ((Array.prototype.slice.call(arguments)).length == 1 && typeof Array.prototype.slice.call(arguments)[0] == 'string') { console.log((Array.prototype.slice.call(arguments)).toString()); } else { console.log(Array.prototype.slice.call(arguments)); } } // IE8 else if (!Function.prototype.bind && typeof console != 'undefined' && typeof console.log == 'object') { Function.prototype.call.call(console.log, console, Array.prototype.slice.call(arguments)); } // IE7 and lower, and other old browsers else if(!/hpsc/gi.test(window.location.href)) {//load except in HPSC // Inject Firebug lite if (!document.getElementById('firebug-lite')) { // Include the script var script = document.createElement('script'); script.type = "text/javascript"; script.id = 'firebug-lite'; // If you run the script locally, point to /path/to/firebug-lite/build/firebug-lite.js script.src = 'https://getfirebug.com/firebug-lite.js'; // If you want to expand the console window by default, uncomment this line //document.getElementsByTagName('HTML')[0].setAttribute('debug','true'); document.getElementsByTagName('HEAD')[0].appendChild(script); setTimeout(function () { log(Array.prototype.slice.call(arguments)); }, 2000); } else { // FBL was included but it hasn't finished loading yet, so try again momentarily setTimeout(function () { log(Array.prototype.slice.call(arguments)); }, 500); } } }; this.warn = this.log; this.error = this.log; if (typeof(console) !== 'undefined' && typeof(console.warn) !== 'undefined' && typeof(console.error) !== 'undefined') { this.warn = console.warn; this.error = console.error; } /* End of File */ return { log: function (msg) { log("Analytics: " + msg); }, warn: function (msg) { warn("Analytics: " + msg); }, error: function (msg) { error("Analytics: " + msg); } }; })(); (function () { var cookieKillList = [ (/^(QSI_History.+)\=/) ]; function fixCookies(maxLengthBeforeFixingCookies) { function killCookie(name) { document.cookie = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;'; } var cookie = document.cookie, hpComCookies = cookie.split("; "); if (cookie.length > maxLengthBeforeFixingCookies) { for (var j = 0, m = cookieKillList.length; j < m && document.cookie.length > maxLengthBeforeFixingCookies; j++) { for (var i = 0, l = hpComCookies.length; i < l && document.cookie.length > maxLengthBeforeFixingCookies; i++) { var testResult = cookieKillList[j].exec(hpComCookies[i]); if (testResult) { killCookie(testResult[0]); } } } } } fixCookies(6000); /* function testCondition1() { function setCookieset1() { document.cookie = "s_test1=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test2=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test3=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test4=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test5=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test6=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test7=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test8=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test9=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test10=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test11=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test12=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test13=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test14=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test15=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test16=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test17=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test18=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test19=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test20=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test21=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test22=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test23=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test24=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test25=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test26=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test27=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test28=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test29=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test30=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test41=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test42=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test43=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test44=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test45=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test46=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test47=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test48=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test49=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test50=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; } function setCookieset2() { document.cookie = "s_test51=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test52=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test53=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test54=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test55=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test56=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test57=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test58=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test59=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test60=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test61=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test62=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test63=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test64=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test65=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test66=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test67=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test68=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test69=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test70=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test71=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test72=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test73=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test74=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test75=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test76=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test77=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test78=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test79=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test80=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test81=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test82=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test83=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test84=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test85=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test86=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test87=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test88=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test89=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; document.cookie = "s_test90=32d37eb59a7c3735635db329adad86d7ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4ddbea519e4d03cfb96beb773e7745ed4"; } cookieKillList.push(/^(s_test\d+)\=/); hpmmd.log.log("Start Test 1: Cookie size before test: " +document.cookie.length); setCookieset1(); hpmmd.log.log("Test 1: Cookie size artificially high, testing trimming if no size adjustments are needed"); fixCookies(8000); hpmmd.log.log("Test 1 Result: should be no more than 8000 characters: " +document.cookie.length); hpmmd.log.log("Start Test 2: Cookie size before: " +document.cookie.length); setCookieset1(); hpmmd.log.log("Test 2: Cookie size artificially high, trimmed to at least 4000 characters"); fixCookies(4000); hpmmd.log.log("Test 2 Result: Should be at least 4000 characters: " +document.cookie.length); hpmmd.log.log("Start Test 2: Cookie size before: " +document.cookie.length); setCookieset1(); hpmmd.log.log("Test 2: Cookie size artificially high, trimmed to at least 2000 characters"); fixCookies(2000); hpmmd.log.log("Test 2 Result: Should be at least 2000 characters: " +document.cookie.length); } testCondition1(); */ })(); function _checkReady(f) { var checks = hpmmd.isready_checks || 50; var now = (new Date()).getTime(); hpmmd.isready = ( typeof (window.s_gi) === "function" && hpmmd.xstate === true && !!hpmmd.beacon && !!hpmmd.beacon.repaint && (now - hpmmd.beacon.lastsent) > 250); hpmmd.log.log("Inside _checkReady:" + JSON.stringify({isready: hpmmd.isready, xstate: hpmmd.xstate, checks: hpmmd.isready_checks || checks})) if (hpmmd.isready !== true) { hpmmd.isready_checks = checks * 2; //Changed to checks since hpmmd.isready_checks is undefined the first time if (checks < 7000) { setTimeout(function () { _checkReady(f); }, hpmmd.isready_checks); } } else { if (typeof(_mbootstrap) === "object") {/*If bootstrap exists*/ if(/h41111\/(rfg_formprocessor|campaigns)/gi.test(window.location.href) || /hpshopping\.in/gi.test(window.location.href) || /unit9\.net/gi.test(window.location.href) || /softwaresupport\.hp\.com/gi.test(window.location.href) || /noncaas=true/gi.test(window.location.href) || (!!window._mbootstrap && (window._mbootstrap.stage.isdev || window._mbootstrap.stage.isitg))){ f(); } else { _mbootstrap.checkCaas.ready(f); } } else { /*regular way*/ f(); } } } function trackMetrics(type, attri) { hpmmd.trackMetricsQueue = hpmmd.trackMetricsQueue || []; hpmmd.trackMetricsQueue.push({attributes: attri, lasttype: type}); function f() { var commonFunction = hpmmd.beacon.repaint.common, params = hpmmd.trackMetricsQueue.pop(), trackMetricsFunction = hpmmd.beacon.repaint[params.lasttype]; hpmmd.beacon.attributes = params.attributes; hpmmd.beacon.lasttype = params.lasttype; if (typeof (commonFunction) == "function") { commonFunction(); } if (typeof(trackMetricsFunction) == "function") { trackMetricsFunction(); } hpmmd.beacon.lastsent = (new Date()).getTime(); } hpmmd.log.log("Trackmetrics Invoked:" + type + ", parameters=" + JSON.stringify(attri)); _checkReady(f); } function s_extendObject(object) { function deepCopy(container, incrementalObject) { for (var i in incrementalObject) { hpmmd[container][i] = incrementalObject[i]; } } if (!!object.page) { deepCopy("page", object.page); } if (!!object.promo) { deepCopy("promo", object.promo); } if (!!object.product) { deepCopy("product", object.product); } if (!!object.user) { deepCopy("user", object.user); } if (!!object.legacy) { deepCopy("legacy", object.legacy); } } function s_beacon_repaint()//overrides should be defined in here. { return { "common": function () { //Video Tracking - Close Video Patch if (hpmmd.video && hpmmd.video.isVideoTracking && !hpmmd.beacon.attributes.videoTrackCall) { hpmmd.video.implicit_close = true; s_hp_bcVideoTrack("close", {}); /* trackMetrics("brightcove-video", {"action" : "close", "videoTrackCall" : true}); */ } if (hpmmd.video) { hpmmd.video.isVideoTrack = false; } //End Patch if (hpmmd.beacon.attributes.sitesearch_keyword) { hpmmd.search = {sitesearch: {}}; hpmmd.search.sitesearch.keyword = hpmmd.beacon.attributes.sitesearch_keyword; hpmmd.search.sitesearch.type = hpmmd.beacon.attributes.sitesearch_type || "general-sitesearch"; } hpmmd.page.events = hpmmd.beacon.attributes.events || hpmmd.page.events; // hpmmd.page.baynote={}; // hpmmd.page.baynote.success=hpmmd.beacon.attributes["baynote_success"]||null; if(typeof(hpmmd.beacon.attributes.subpage)!=="undefined" || typeof(hpmmd.beacon.attributes.id) !=="undefined"){ hpmmd.page.subpage = hpmmd.beacon.attributes.subpage || hpmmd.beacon.attributes.id; } var assets = hpmmd.beacon.attributes.assets || [], i; hpmmd.product.list = []; for (i = assets.length - 1; i >= 0; i--) { hpmmd.product.list.push({ name: assets[i] }); } /*Leadgen execption for events 2, 3 and 12 and EG pages*/ if(/jumpid=(em_|ba_|ps_|af_|sc_|mb_)/gi.test(window.location.href) && !! hpmmd.ck.get('eg_serial') && hpmmd.ck.get('eg_serial') !==""){ //CHECK IF EVENTS MATCH AND THEN APPEND :R to parent_page if(!!hpmmd.beacon.attributes.events && hpmmd.beacon.attributes.events.length>0 && (hpmmd.beacon.attributes.events.indexOf("Unqualified Lead Value Start")!==-1 || hpmmd.beacon.attributes.events.indexOf("Unqualified Lead Value")!==-1 || hpmmd.beacon.attributes.events.indexOf("Mktg Download Click")!==-1)){ hpmmd.page.previous_page = hpmmd.beacon.attributes.parent_page+":r" || null; } else{ hpmmd.page.previous_page = hpmmd.beacon.attributes.parent_page || null; } } /*Regular logic*/ else{ hpmmd.page.previous_page = hpmmd.beacon.attributes.parent_page || null; /*Save parent page on a cookie for RFG iframe forms (so it can be read in the iframe)*/ if(typeof(hpmmd.beacon.attributes.name)!=="undefined" && hpmmd.beacon.attributes.name.indexOf("Request_Sales_Agent")!=-1){ var expires = new Date(); var prodStr= (!!hpmmd.beacon.attributes.assets)?"|"+hpmmd.beacon.attributes.assets:""; expires.setTime(expires.getTime() + (20 * 60 * 1000)); //20 minutes document.cookie="rfg_prv_pg="+hpmmd.page.previous_page+prodStr+";expires="+ expires.toGMTString() + "; domain=.hp.com;path=/"; } } try { var persnalzFlag = (hpmmd.beacon.attributes.personalization) ? (hpmmd.beacon.attributes.personalization) + "" : false; if (persnalzFlag) { var dID = hpmmd.beacon.attributes.id || hpmmd.beacon.attributes.name; hpmmd.personalDL = hpmmd.beacon.attributes.personalization; hpmmd.download = { id: dID }; } } catch (e) { } }, "none": function () { }, "newPage": function () {// Common page beacon call var override = hpmmd.page.override, trackMetricsNameAttribute = hpmmd.beacon.attributes.name, trackMetricsIDAttribute = hpmmd.beacon.attributes.id, trackMetricsSubpageAttribute = hpmmd.beacon.attributes.subpage || trackMetricsIDAttribute; /*SW 3.0 NEW PAGE TEMPORARY PARAMETER OVERRIDE*/ if (/3.0/.test(hpmmd.metatags.analytics_template_name)) { if (trackMetricsNameAttribute.indexOf("tsg.software") != -1) { trackMetricsNameAttribute = trackMetricsNameAttribute.replace("tsg.software", "3.0"); } } else if(/SSS - Software 2.0/gi.test(hpmmd.metatags.analytics_template_name) && typeof(hpmmd.metatags.sub_bu)!=="undefined"){ trackMetricsNameAttribute= trackMetricsNameAttribute.toLowerCase(); trackMetricsNameAttribute = trackMetricsNameAttribute.replace(hpmmd.metatags.analytics_template_name.toLowerCase(), hpmmd.metatags.sub_bu.toLowerCase()); } var pageNameOverrideSites = ["/us/en/software-solutions/saas-agile-manager-software.html", "/us/en/software-solutions/mobile-application-development.html", "/us/en/software-solutions/monitor-web-application-performance.html", "/us/en/software-solutions/saas-help-desk-service-anywhere.html", "/business-solutions/","/make-it-matter/"], doOverrideLogic = false; for (var i = 0, l = pageNameOverrideSites.length; i < l; i++) { if (window.location.href.indexOf(pageNameOverrideSites[i]) !== -1) { doOverrideLogic = true; } } if (typeof(trackMetricsNameAttribute) !== "undefined") { if ( (trackMetricsNameAttribute.indexOf("3.0/") !== -1 || trackMetricsNameAttribute.indexOf("tsg.software/") !== -1) && ((/hp.com\/[^\/]+\/[^\/]+\/software/i).test(window.location.href)) || (/hp.com\/[^\/]+\/[^\/]+\/leadgen\/leadgen_preview.html\?.*software.*/i).test(window.location.href)) { doOverrideLogic = true; } if(/leadgen\/(dlc|leadgen)_preview\.html/gi.test(window.location.href) || /ssl\/(dlc|leadgen)\/(software|document)_(register|download|agreement)\.html/gi.test(window.location.href) || /h41111\/rfg_formprocessor/gi.test(window.location.href)){ doOverrideLogic=true; } } if (doOverrideLogic) { if (!!trackMetricsSubpageAttribute && !!trackMetricsIDAttribute) { trackMetricsSubpageAttribute = trackMetricsSubpageAttribute + ":" + trackMetricsIDAttribute; } if (!!trackMetricsSubpageAttribute && !!trackMetricsNameAttribute) { override.template_name = hpmmd.page.name = trackMetricsNameAttribute; override.subpage = hpmmd.page.subpage = trackMetricsSubpageAttribute; } if (!!trackMetricsNameAttribute && !trackMetricsSubpageAttribute) { override.subpage = hpmmd.page.subpage = trackMetricsNameAttribute; } } else if (hpmmd.beacon.attributes.metatag_override == true) { override.template_name = override.template = hpmmd.page.name = trackMetricsNameAttribute; override.subpage = hpmmd.page.subpage = trackMetricsSubpageAttribute; } else { trackMetricsNameAttribute = trackMetricsNameAttribute || trackMetricsSubpageAttribute || hpmmd.page.name; override.template_name = hpmmd.page.name = trackMetricsNameAttribute; if (typeof(JSON) !== "undefined") { var jsonStringAttributes = JSON.stringify(hpmmd.beacon.attributes).toLowerCase(); jsonStringAttributes = jsonStringAttributes.replace(/[\"\']+/g, ""); jsonStringAttributes = jsonStringAttributes.replace(/\s+/g, " "); jsonStringAttributes = "n.p:" + jsonStringAttributes; hpmmd.debug = {"prop70": jsonStringAttributes}; } } hpmmd.beacon.jobs[0][0] = "omni"; // Reset the main beacon to "active" hpmmd.beacon.showlib.omni(); hpmmd.beacon.override = []; }, "newLink": function () {// Common link tracking beacon call // var bn=hpmmd.page.baynote; hpmmd.beacon.attributes.type = hpmmd.beacon.attributes.type || g_hp_newLinkType(); hpmmd.beacon.attributes.id = hpmmd.beacon.attributes.id || "Generic-Link:" + window.location.hostname + window.location.pathname; hpmmd.beacon.jobs[0][0] = "omni"; // Reset the main beacon to "active" if (hpmmd.beacon.attributes.assets) { hpmmd.beacon.override = { linkTrackVars: "products,events,eVar75,prop13", linkTrackEvents: "event12,event3,event2,event50" }; } /* 2011-02-14: Capture search keyword as part of search bounce project */ hpmmd.page.search_bounce = hpmmd.beacon.attributes.keyword; /* End Changes */ // var bn=hpmmd.page.baynote; // bn.linkname=(!bn.success?null:hpmmd.beacon.attributes["name"]); hpmmd.beacon.showlib.omni(); hpmmd.beacon.override = []; }, "linkClick": function () { var pattern = /^(home|home\s\d|home\s\d\.\d|welcome.home)$/i; if (pattern.test(hpmmd.page.name)) { var url = hpmmd.beacon.attributes.url, id = hpmmd.beacon.attributes.id, test = /http[s]?\:\/\/([^\/]+)/i, t; hpmmd.ck.set("h_cm2", _set(id)); /* if(url!=null&&(t=test.exec(url))!=null&& (t[1].indexOf(".hp.com")==-1 || // It's NOT an HP.com domain t[1].indexOf("shopping1.hp.com")!=-1 // It's an Atlas domain )) { // Do an immediate beacon if the URL exists and doesn't match HP.com domain hpmmd.product.list.push({name: "homepage-message-click:"+id}); hpmmd.promo.internal=id; // Set eVar13 hpmmd.beacon.override={linkTrackVars:"eVar13",linkTrackEvents:"None"}; s_beacon_repaint()["newLink"](); } */ } }, /* "timer" : function() { hpmmd.beacon.override = { // linkTrackVars : "prop60", linkTrackVars : "", linkTrackEvents : "None" }; s_beacon_repaint().newLink(); }, */ "personalizationClick": function () { var oldjobs = hpmmd.beacon.jobs; hpmmd.beacon.override = { linkTrackVars: "events,eVar52", linkTrackEvents: "event59" }; var tID = hpmmd.beacon.attributes.id; hpmmd.personalizeTrack = { id: tID }; s_beacon_repaint().newLink(); hpmmd.beacon.jobs = oldjobs; }, "personalizationImpression": function () { var oldjobs = hpmmd.beacon.jobs; hpmmd.personalCont = hpmmd.beacon.attributes.id; hpmmd.beacon.jobs = [ ["omni", "hpcspersimpressions", s_hp_personalContentConfig, 0] ]; hpmmd.beacon.override = { linkTrackVars: "products,events", linkTrackEvents: "event1" }; s_beacon_repaint().newLink(); hpmmd.beacon.jobs = oldjobs; }, "personalizationA-B": function () { var oldjobs = hpmmd.beacon.jobs; hpmmd.pAB = hpmmd.beacon.attributes.id; hpmmd.beacon.jobs = [ ["omni", s_hp_proRSLogic() + ",hpcspersimpressions", s_hp_personalAB, 0] ]; hpmmd.beacon.override = { linkTrackVars: "eVar26,events", linkTrackEvents: "None" }; s_beacon_repaint().newLink(); hpmmd.beacon.jobs = oldjobs; }, "dynamicFacet": function () { // Event 50 + eVar7 + product string = EB // Event50 + product string = Product Facets var f = hpmmd.beacon.attributes.facets || [], facets = f[0] || "", prefix = "products-facet:", i, p; if (facets.indexOf("eb:") === 0) {// EB Facets prefix = ""; hpmmd.product.facet_flag = "eb"; } hpmmd.product = hpmmd.product || {}; if (facets.length > 2) { p = facets.split(","); for (i = 0; i < p.length; i++) { p[i] = prefix + p[i]; } hpmmd.product.facets = p; } else { return; } hpmmd.beacon.attributes.type = "link"; hpmmd.beacon.override = { linkTrackVars: "products,events,eVar7", linkTrackEvents: "event50" }; s_beacon_repaint().newPage(); }, "genericFacet": function () { var f = hpmmd.beacon.attributes.facets || [], facets = f[0] || "", prefix = "facet:", i, p; hpmmd.product = hpmmd.product || {}; if (!!facets && facets.length > 2) { p = facets.split(","); for (i = 0; i < p.length; i++) { p[i] = prefix + p[i]; } hpmmd.page.facets = p; } else { return; } hpmmd.beacon.attributes.type = "link"; hpmmd.beacon.override = { linkTrackVars: "prop55", linkTrackEvents: "none" }; s_beacon_repaint().newLink(); }, "optimost.recipe": function () { hpmmd.abmvt = {}; var f = hpmmd.beacon.attributes.recipe || ""; hpmmd.abmvt.recipe = f; hpmmd.beacon.attributes.type = "link"; hpmmd.beacon.override = { linkTrackVars: "eVar27", linkTrackEvents: "event59" }; s_beacon_repaint().newLink(); }, "new.profile": function () { hpmmd.user_profile_type = {}; var f = hpmmd.beacon.attributes.user_profile_type || ""; hpmmd.user_profile_type = f; hpmmd.beacon.attributes.type = "link"; hpmmd.beacon.override = { linkTrackVars: "eVar57", linkTrackEvents: "none" }; s_beacon_repaint().newLink(); }, "hubContent": function () { hpmmd.search.internal.keyword = hpmmd.beacon.attributes.search_term; hpmmd.search.internal.number_results = hpmmd.beacon.attributes.number_results; hpmmd.search.internal.application = hpmmd.beacon.attributes.application; hpmmd.search.internal.page_type = hpmmd.beacon.attributes.search_type; hpmmd.page.application = "hub"; s_beacon_repaint().newPage(); }, "productRecom": function () {// Pradeep SV - 20110213 var precID = hpmmd.beacon.attributes.id; var precPro = hpmmd.beacon.attributes.product; var precFHID = hpmmd.beacon.attributes.FHID; hpmmd.product = hpmmd.product || {}; hpmmd.product.precID = precID; if (precID == 'hprecom') { hpmmd.product.precPro = precPro; hpmmd.product.precFHID = precFHID; } else { return; } //hpmmd.beacon.attributes["type"]=hpmmd.beacon.attributes["type"]||"link"; hpmmd.beacon.override = { linkTrackVars: "products,events,eVar35,prop2", linkTrackEvents: "event51" }; s_beacon_repaint().newPage(); }, /* "baynotepilot": function() { hpmmd.page.baynote.group=hpmmd.beacon.attributes["group"]; hpmmd.beacon.attributes["name"]=hpmmd.beacon.attributes["name"]||"Baynote Pilot: Set AB Group"; s_beacon_repaint()["newLink"](); }, */ "internalSearch": function () { hpmmd.page.search_term = hpmmd.beacon.attributes.search_term; /* hpmmd.page.events.push("Internal Search"); //will create a more dynamic function to handle overrides in the future. hpmmd.beacon.override={linkTrackVars:"prop11,prop12,prop13,prop14,prop15,prop16,prop17,prop18,prop19,prop20,prop21,prop22,events",linkTrackEvents:"event12"}; hpmmd.beacon.showlib["omnisearch"](); */ s_beacon_repaint().newPage(); }, "promoClick": function () { s_beacon_repaint().linkClick(); }, "promoImpression": function () { var id = hpmmd.beacon.attributes.id; if (!!hpmmd.page.abtest && id != hpmmd.promo.internal) { hpmmd.promo.internal = id; hpmmd.page.events = ["Track Open Banner Impression"]; var oldjobs = hpmmd.beacon.jobs; hpmmd.beacon.jobs = [ ["omni", "hphqemeaov2banners", s_hp_basicDatapassConfig, 0] ]; hpmmd.beacon.override = { linkTrackVars: "products,events,eVar1", linkTrackEvents: "event9,event1" }; s_beacon_repaint().newPage(); hpmmd.beacon.jobs = oldjobs; } }, "promoClosedImpression": function () { var ids = hpmmd.beacon.attributes.messages, hn = window.location.hostname; hpmmd.promo.impressions = ids; // if(!(hn.indexOf("www8.hp.com")==-1&&hn.indexOf("www.hp.com")==-1&&hn.indexOf("welcome.hp.com")==-1)) { return; } // Do NOT use in PRO hpmmd.page.events = ["Track Closed Banner Impression"]; var oldjobs = hpmmd.beacon.jobs; hpmmd.beacon.jobs = [ ["omni", "hphqemeaov2banners", s_hp_basicDatapassConfig, 0] ]; hpmmd.beacon.override = { linkTrackVars: "products,events,eVar1", linkTrackEvents: "event9,event1" }; if (!!window.s && !!window.s._il && !!window.s._il[0]) { hpmmd.inherit = window.s._il[0]; } s_beacon_repaint().newPage(); hpmmd.beacon.jobs = oldjobs; }, "global-inav": function () { var eVar13Value = hpmmd.beacon.attributes.link_id || "no inav-value set"; if (typeof(_mbootstrap) !== "undefined") { var reHomePages = [(/www.hp.com\/?$/), (/www.hp.com\/[\?\#]/), (/www8.hp.com\/([^\/]+)\/([^\/]+)\/home.html/), (/welcome.hp.com\/country\/([^\/]+)\/([^\/]+)\/welcome\.html/), (/h20158.www2.hp.com\/gms\/al\/sq\/$/),(/www\.hp\.com\/country\/([^\/]+)\/([^\/]+)(\/hho)?\/welcome\.html/),(/www\.hp\.com\/country\/([^\/]+)\/([^\/]+)(\/uc)?\/welcome\.html/)], setEVar13 = _mbootstrap._.reduce(reHomePages, function (matches, item) { return matches || item.test(window.location.href); }, false); if (setEVar13) { eVar13Value = "home:" + eVar13Value; } else if((!!hpmmd.metatags.analytics_template_name && hpmmd.metatags.analytics_template_name==="welcome-home") && !!window._mbootstrap && (window._mbootstrap.stage.isdev || window._mbootstrap.stage.isitg)){ eVar13Value = "home:" + eVar13Value; } } hpmmd.ck.set("h_inavclk", eVar13Value); }, "scrollEvent": function () { }, "buyFromClick": function () { var src = hpmmd.beacon.attributes.source, prod_id = hpmmd.beacon.attributes.product_id; if (!!prod_id && prod_id.length > 0) { hpmmd.product.list = [ { name: prod_id.toLowerCase() } ]; } hpmmd.page.product_service = hpmmd.beacon.attributes.product_category; if (src === "reseller") { hpmmd.page.reseller_name = hpmmd.beacon.attributes.reseller_name; hpmmd.page.events = ["Online Reseller Sales Lead"]; } else { hpmmd.page.events = ["Online HP Sales Lead"]; } hpmmd.beacon.override = { linkTrackVars: "products,events,eVar30,eVar73", linkTrackEvents: "event10,event14,event40,event41" }; s_beacon_repaint().newLink(); }, "support_topic": function () { hpmmd.user.harris_survey_id = hpmmd.beacon.attributes.harris_id; hpmmd.page.template_name = hpmmd.beacon.attributes.template; hpmmd.beacon.override = { linkTrackVars: "prop1,prop3,prop5" }; s_beacon_repaint().newLink(); }, "unqualifiedLeadValue": function () { hpmmd.page.events.push("Unqualified Lead Value"); s_beacon_repaint().newPage(); }, "unqualifiedLeadStart": function () { hpmmd.page.events.push("Unqualified Lead Value Start"); hpmmd.beacon.override = { linkTrackVars: "products,events", linkTrackEvents: "event2" }; s_beacon_repaint().newLink(); }, "mktgDownloadClick": function () { // var bn=hpmmd.page.baynote; var hn = window.location.hostname, href = window.location.href, tmplinkname; hpmmd.page.events = ["Mktg Download Click"]; hpmmd.product.list = [ { name: hpmmd.beacon.attributes.id } ]; // tmplinkname=bn.linkname=(!bn.success?null:hpmmd.beacon.attributes["id"]); hpmmd.beacon.attributes.type = "download"; //will create a more dynamic function to handle overrides in the future. hpmmd.beacon.override = { linkTrackVars: "products,events", linkTrackEvents: "event12" }; // if(!(window.baynote_suppressflag!=null&&bn.linkname==null)) {s_beacon_repaint()["newLink"]();} s_beacon_repaint().newLink(); }, "page.content":function(){ hpmmd.sw_vars = {}; hpmmd.page.events = hpmmd.sw_vars.events = hpmmd.beacon.attributes.events; if(!!hpmmd.beacon.attributes.content_string){ hpmmd.sw_vars.content_string=hpmmd.beacon.attributes.content_string; hpmmd.beacon.override = { linkTrackVars:"events,eVar31", linkTrackEvents:"event79" }; } if(!!hpmmd.beacon.attributes.gsc_content_string){ hpmmd.sw_vars.gsc_content_string=hpmmd.beacon.attributes.gsc_content_string; hpmmd.beacon.override = { linkTrackVars:"events,eVar32", linkTrackEvents:"event79" }; } hpmmd.page.name=hpmmd.beacon.attributes.name; if(!!hpmmd.beacon.attributes.content_list3){ hpmmd.sw_vars.content_list3=hpmmd.beacon.attributes.content_list3; hpmmd.beacon.override = { linkTrackVars:"list3", linkTrackEvents:"event101" }; } s_beacon_repaint().newLink(); }, "recommendation.click": function () { hpmmd.page.events = ["Recommendation Click"]; hpmmd.product.list = [ { name: hpmmd.beacon.attributes.recommendedAsset } ]; hpmmd.sw_vars = {}; hpmmd.sw_vars.baseAsset = hpmmd.beacon.attributes.assets; delete hpmmd.beacon.attributes.assets; hpmmd.page.previous_page = hpmmd.beacon.attributes.parent_page; hpmmd.page.name = hpmmd.beacon.attributes.name; //will create a more dynamic function to handle overrides in the future. hpmmd.beacon.override = { linkTrackVars: "products,events,eVar51,eVar75", linkTrackEvents: "event76" }; // if(!(window.baynote_suppressflag!=null&&bn.linkname==null)) {s_beacon_repaint()["newLink"]();} s_beacon_repaint().newLink(); }, "recommendation.impressions": function () { hpmmd.page.events = ["Recommendation Impressions"]; var assetList="", beaconRecomm=hpmmd.beacon.attributes.recommendedAssets; if(hpmmd.beacon.attributes.recommendedAssets.length>1){ for(var i=0;i=0){if(c[t].href===e.urls[0]){l("css");break}}r+=1;if(e){if(r<200){setTimeout(h,50)}else{l("css")}}}}return{css:function(e,t,s,n){f("css",e,t,s,n)},js:function(e,t,s,n){f("js",e,t,s,n)}}}(this.document); (function() { var w = window, d = document, isjQ = typeof (jQuery) != "undefined"; window._domReady=window._domReady||{}; var DomReady=window._domReady; if (!window._domReady.inject) { DomReady.inject = function(x) {/* Used to include other files on the page */ if (d.getElementsByTagName) { var h = d.getElementsByTagName("head")[0], s = d.createElement("script"); s.type = 'text/javascript'; s.async = true; s.src = x; h.appendChild(s); } }; DomReady.injectSmartScript = function(coreURL) { var isSSL = (window.location.protocol.toLowerCase().indexOf('https') != -1); if (isSSL && coreURL.indexOf("http:") != -1) { coreURL = coreURL.replace("http:", "https:"); if (coreURL.indexOf("welcome.hp-ww.com") != -1) { coreURL = coreURL.replace("welcome.hp-ww.com", "secure.hp-ww.com"); } } DomReady.inject(coreURL); }; DomReady.injectSmartScriptWhenReady = function(coreURL) { DomReady.ready(function() { _domReady.injectSmartScript(coreURL); }); }; DomReady.onload = function(f) { if ( typeof (f) != "function") { return; } if (w.addEventListener) { w.addEventListener("load", f, false); } else if (w.attachEvent) { w.attachEvent("onload", f); } else if (isjQ) { jQuery(w).load(f); } // jQuery }; } // Everything that has to do with properly supporting our document ready event. Brought over from the most awesome jQuery. var userAgent = navigator.userAgent.toLowerCase(); // Figure out what browser is being used var browser = { version : (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [])[1], safari : /webkit/.test(userAgent), opera : /opera/.test(userAgent), msie : (/msie/.test(userAgent)) && (!/opera/.test(userAgent)), mozilla : (/mozilla/.test(userAgent)) && (!/(compatible|webkit)/.test(userAgent)) }; var readyBound = false; var isReady = false; var readyList = []; // Handle when the DOM is ready function domReady() { // Make sure that the DOM is not already loaded if (!isReady) { // Remember that the DOM is ready isReady = true; if (readyList) { for (var fn = 0; fn < readyList.length; fn++) { readyList[fn].call(window, []); } readyList = []; } } } // From Simon Willison. A safe way to fire onload w/o screwing up everyone else. function addLoadEvent(func) { var oldonload = window.onload; if ( typeof window.onload != 'function') { window.onload = func; } else { window.onload = function() { if (oldonload) { oldonload(); } func(); }; } } // does the heavy work of working through the browsers idiosyncracies (let's call them that) to hook onload. function bindReady() { if (readyBound) { return; } readyBound = true; // Mozilla, Opera (see further below for it) and webkit nightlies currently support this event if (document.addEventListener && !browser.opera) { // Use the handy event callback document.addEventListener("DOMContentLoaded", domReady, false); } // If IE is used and is not in a frame // Continually check to see if the document is ready if (browser.msie && window == top) (function() { if (isReady) return; try { // If IE is used, use the trick by Diego Perini // http://javascript.nwbox.com/IEContentLoaded/ document.documentElement.doScroll("left"); } catch(error) { setTimeout(arguments.callee, 0); return; } // and execute any waiting functions domReady(); })(); if (browser.opera) { document.addEventListener("DOMContentLoaded", function() { if (isReady) return; for (var i = 0; i < document.styleSheets.length; i++) if (document.styleSheets[i].disabled) { setTimeout(arguments.callee, 0); return; } // and execute any waiting functions domReady(); }, false); } if (browser.safari) { var numStyles; (function() { if (isReady) return; if (document.readyState != "loaded" && document.readyState != "complete") { setTimeout(arguments.callee, 0); return; } if (numStyles === undefined) { var links = document.getElementsByTagName("link"); for (var i = 0; i < links.length; i++) { if (links[i].getAttribute('rel') == 'stylesheet') { numStyles++; } } var styles = document.getElementsByTagName("style"); numStyles += styles.length; } if (document.styleSheets.length != numStyles) { setTimeout(arguments.callee, 0); return; } // and execute any waiting functions domReady(); })(); } // A fallback to window.onload, that will always work addLoadEvent(domReady); } // This is the public function that people can use to hook up ready. DomReady.ready = function(fn, args) { // Attach the listeners bindReady(); // If the DOM is already ready if (isReady) { // Execute the function immediately fn.call(window, []); } else { // Add the function to the wait list readyList.push(function() { return fn.call(window, []); }); } }; bindReady(); DomReady.onReady = DomReady.ready; })(); /* load the privacy cookie js */ function s_hp_doPrivacyCheck() { var results=(/hpeuck_prefs\=\d(\d)\d/).exec(document.cookie); if(!!results&&results.length>1) { if(results[1]==="0") { hpmmd.beacon_ignore=true; return true;} } return false; } (function () { function loadScript(url) { var script = document.createElement("script"); script.type = "text/javascript"; script.src = url; document.getElementsByTagName("head")[0].appendChild(script); } if(hpmmd.type.indexOf("Legacy")!==-1) { //load the privacy cookie js var jsScript,hpeuck_loaded=window.hpeuck_loaded||false; /*jslint vars: true */ /* if(typeof hpeuck_loaded === 'undefined') { var hpeuck_loaded = false; } */ /*jslint vars: false */ if (document.location.protocol === "https:") { jsScript = "https://ssl.www8.hp.com/uk/en/system/include/privacy_cookie.JS"; } else { jsScript = "http://www8.hp.com/uk/en/system/include/privacy_cookie.JS"; } if(!hpeuck_loaded) { loadScript(jsScript); } } /* if(hpmmd.type.indexOf("Legacy")!=-1) { window.hpeuck_loaded=false; var jsScript; if (document.location.protocol == "https:") { jsScript = "https://ssl.www8.hp.com/uk/en/system/include/privacy_cookie.JS"; } else { jsScript = "http://www8.hp.com/uk/en/system/include/privacy_cookie.JS" } if(!window.hpeuck_loaded) { LazyLoad.js(jsScript,function() { window.hpeuck_loaded = true; s_hp_doPrivacyCheck(); }); } } else { s_hp_doPrivacyCheck(); } */ s_hp_doPrivacyCheck(); }()); hpmmd.ck = {"get":function (k) { var c = ' ' + document.cookie, s = c.indexOf(' ' + k + '='), e = s < 0 ? s : c.indexOf(';', s), v = s < 0 ? '' : c.substring(s + 2 + k.length, e < 0 ? c.length : e); return v; }, "set":function (k, v, e) { var exp = new Date((new Date().getTime()) + e * 86400000); document.cookie = k + "=" + escape(v) + (!!e ? "; expires=" + exp.toGMTString() : "") + "; path=/; domain=.hp.com"; return v; }, "setraw":function (k, v, e) { var exp = new Date((new Date().getTime()) + e * 86400000); document.cookie = k + "=" + v + (!!e ? "; expires=" + exp.toGMTString() : "") + "; path=/; domain=.hp.com"; return v; } }; /*jshint asi:true */ hpmmd.gQuery = function (param, url) { var b, m, l, k, j, i, h, g, f, e, d, c; b = (!!url ? url : window.location.href).toLowerCase(); param = param.toLowerCase(); b = b.split('?'); m = b.length; if (m > 1) { for (l = 0; l < m; l++) { i = b[l].split('&'); j = i.length; for (k = 0; k < j; k++) { g = i[k].split('='); if (g[0] == param)h = g[1] } f = b[l].split('%26'); e = f.length; for (d = 0; d < e; d++) { c = f[d].split('%3d'); if (c[0] == param)h = c[1] } } } h = h ? h : ''; return h; }; /*jshint asi:false */ /* function s_hp_getPrevPageClick() { var r = s_hp_linkPromoTrack("h_cm2"), lpi = s_hp_overrideClickmap("h_cm"), newEvar13 = hpmmd.ck.get("h_inavclk"); if (!!newEvar13 && newEvar13 !== "-") { newEvar13 = hpmmd.page.country + ":" + hpmmd.page.language + ":" + unescape(newEvar13); } hpmmd.page.previous_page_click = newEvar13 || r || lpi || null; r = hpmmd.page.previous_page_click; if (r) { hpmmd.promo.internal = r; hpmmd.legacy.promo = {internal:lpi}; } return r; } */ function s_hp_linkPromoTrack(cookieName) { var t = hpmmd.ck.get(cookieName); if (!!t && t.length > 1) { t = unescape(t); hpmmd.ck.set(cookieName, "i"); } else { t = null; } return t; } function s_hp_overrideClickmap(cookieName) { var t = hpmmd.ck.get(cookieName); t = (!t ? "" : unescape(t)); if (t.length > 1) { hpmmd.ck.set(cookieName, "i"); t3 = unescape(t).split("="); if (t3.length > 2) { t3 = t.split("="); } t2 = unescape(t3[t3.length - 1]).split("&oid="); t = unescape(t2[t2.length - 1]).split("&")[0]; t = t.toLowerCase().indexOf("welcomeov2") != -1 ? t : ""; } else { t = ""; } return t; } function _cleanInternationalUnicode(x) { return x.replace(/([^\w\-\?\:\'\"\[\]\{\}\|\\\/\,\.<>\!\@\#\$\%\^\*\(\)\+\=])+/g, "~"); } function _clean(x) { var bl = /\s*[\u2014\u2013\u2012]+\s*/g; return (!x ? null : (x + "").toLowerCase().replace(/\s+/g, " ").replace(bl, " ").replace(/^\s*(.*)\s*$/, "$1")); } function _set(x) { var p = hpmmd.legacy.prefix, r, a = _clean(x); if (!(!p || !x)) { r = (p.toLowerCase() + a).replace(/^(cs:)+/i, "cs:"); if (r.indexOf("cs:error") === 0) { r = 'D="cs:error:"+c49'; } } return r; } function _setProp6(x){ var p = hpmmd.legacy.prefix, r, a = _clean(x); if (!(!p || !x)) { r = (p.toLowerCase() + a).replace(/^(cs:)+/i, "cs:"); } return r; } function _setifnull(sobj, ref, value) { var c = sobj[ref]; if (!(!!c && c.length > 0)) { sobj[ref] = c = (ref.indexOf("products") != -1 || ref.indexOf("event") != -1 ? value : _set(value)); } return c; } function s_hp_trackExitLinks(event) { try { var obj; event = event ? event : window.event; if (event.target) { obj = event.target; } else if (event.srcElement) { obj = event.srcElement; } if (obj.href) { var exitLinks = hpmmd.omniture.object.linkInternalFilters; var exitArray = exitLinks.split(','); if (s.trackExternalLinks === false) { isExitLink = true; for (i = 0; i < exitArray.length; i++) { if (obj.href.toLowerCase().indexOf(exitArray[i].toLowerCase()) > -1) { isExitLink = false; } } exitURLStart = obj.href.substring(obj.href.indexOf('//') + 2, obj.href.length); if (exitURLStart.indexOf('/') > -1) { exitURLEnd = exitURLStart.indexOf('/'); } else { exitURLEnd = exitURLStart.length; } var exitDomain = exitURLStart.substring(0, exitURLEnd); if (isExitLink) { trackMetrics('customExit'); } } } } catch (e) { } } hpmmd.omniture = { load_plugins:function (s) { window.s = s; /* Assign to the global namespace */ s.getQueryParam = new Function("p", "d", "u", "h", "" + "var s=this,v='',i,j,t;d=d?d:'';u=u?u:(s.pageURL?s.pageURL:s.wd.loca" + "tion);if(u=='f')u=s.gtfs().location;while(p){i=p.indexOf(',');i=i<0" + "?p.length:i;t=s.p_gpv(p.substring(0,i).toLowerCase(),(u+'').toLowerCase(),h);if(t){t=t.indexOf('#" + "')>-1?t.substring(0,t.indexOf('#')):t;}if(t)v+=v?d+t:t;p=p.substrin" + "g(i==p.length?i:i+1)}return v"); s.p_gpv = new Function("k", "u", "h", "" + "var s=this,v='',q;j=h==1?'#':'?';i=u.indexOf(j);if(k&&i>-1){q=u.sub" + "string(i+1);v=s.pt(q,'&','p_gvf',k)}return v"); s.p_gvf = new Function("t", "k", "" + "if(t){var s=this,i=t.indexOf('='),p=i<0?t:t.substring(0,i),v=i<0?'T" + "rue':t.substring(i+1);if(p.toLowerCase()==k.toLowerCase())return s." + "epa(v)}return''"); /* * Plug-in: crossVisitParticipation v1.6 - stacks values from * specified variable in cookie and returns value */ s.crossVisitParticipation = new Function("v", "cn", "ex", "ct", "dl", "ev", "dv", "" + "var s=this,ce;if(typeof(dv)==='undefined')dv=0;if(s.events&&ev){var" + " ay=s.split(ev,',');var ea=s.split(s.events,',');for(var u=0;u0&&arry[arry.length-1][0]==v)arry[ar" + "ry.length-1]=[v,new Date().getTime()];else arry[arry.length]=[v,new" + " Date().getTime()];var start=arry.length-ct<0?0:arry.length-ct;var " + "td=new Date();for(var x=start;x-1){q=u.substring(i+1);v" + "=s.pt(q,'&','p_gvfne',k)}return v"); s.p_gvfne = new Function("t", "k", "" + "if(t){var s=this,i=t.indexOf('='),p=i<0?t:t.substring(0,i),v=i<0?'T" + "rue':t.substring(i+1);if(p.toLowerCase()==k.toLowerCase())return v;" + "}return ''"); /* s.join: 1.0 - s.join(v,p) */ s.join = new Function("v", "p", "" + "var s = this;var f,b,d,w;if(p){f=p.front?p.front:'';b=p.back?p.back" + ":'';d=p.delim?p.delim:'';w=p.wrap?p.wrap:'';}var str='';for(var x=0" + ";x-1?i:l.length;a[x" + "++]=l.substring(0,i);l=l.substring(i+d.length);}return a"); /******************************************************************** * * Main Plug-in code (should be in Plug-ins section) * *******************************************************************/ /* * Plugin: getActionDepth v1.0 - Returns the current * page number of the visit */ s.getActionDepth = new Function("c", "" + "var s=this,v=1,t=new Date;t.setTime(t.getTime()+1800000);" + "if(!s.c_r(c)){v=1}if(s.c_r(c)){v=s.c_r(c);v++}" + "if(!s.c_w(c,v,t)){s.c_w(c,v,0)}return v;"); /* Previous Value - used for deduplicating previous jumpids */ s.getPreviousValue = new Function("v", "c", "el", "" + "var s=this,t=new Date,i,j,r='';t.setTime(t.getTime()+1800000);if(el" + "){if(s.events){i=s.split(el,',');j=s.split(s.events,',');for(x in i" + "){for(y in j){if(i[x]==j[y]){if(s.c_r(c)) r=s.c_r(c);v?s.c_w(c,v,t)" + ":s.c_w(c,'no value',t);return r}}}}}else{if(s.c_r(c)) r=s.c_r(c);v?" + "s.c_w(c,v,t):s.c_w(c,'no value',t);return r}"); /******************************************************************** * * Main Plug-in code (should be in Plug-ins section) * *******************************************************************/ /* * Plugin Utility: apl v1.1 */ s.apl = new Function("l", "v", "d", "u", "" + "var s=this,m=0;if(!l)l='';if(u){var i,n,a=s.split(l,d);for(i=0;i=0){x=x.substring(0,i)+n+x." + "substring(i+o.length);i=x.indexOf(o,i+l)}return x"); /******************************************************************** * * Config variables (should be above doPlugins section) * *******************************************************************/ s.ActionDepthTest = true /******************************************************************** * * Commented example of how to use this is doPlugins function * *******************************************************************/ /******************************************************************** * * Supporting functions that may be shared between plug-ins * *******************************************************************/ /* * Utility Function: vpr - set the variable vs with value v */ s.vpr = new Function("vs", "v", "if(typeof(v)!='undefined'){var s=this; eval('s.'+vs+'=\"'+v+'\"')}"); /* * Utility Function: split v1.5 - split a string (JS 1.0 compatible) */ s.split = new Function("l", "d", "" + "var i,x=0,a=new Array;while(l){i=l.indexOf(d);i=i>-1?i:l.length;a[x++]=l.substring(0,i);l=l.substring(i+d.length);}return a"); /* * Plugin Utility: Replace v1.0 */ s.repl = new Function("x", "o", "n", "" + "var i=x.indexOf(o),l=n.length;while(x&&i>=0){x=x.substring(0,i)+n+x.substring(i+o.length);i=x.indexOf(o,i+l)}return x"); /* Video Tacking */ s.m_Media_c = "var m=s.m_i('Media');if(m.completeByCloseOffset==undefined)m.completeByCloseOffset=1;if(m.completeCloseOffsetThreshold==undefined)m.completeCloseOffsetThreshold=1;m.cn=function(n){var m=" + "this;return m.s.rep(m.s.rep(m.s.rep(n,\"\\n\",''),\"\\r\",''),'--**--','')};m.open=function(n,l,p,b){var m=this,i=new Object,tm=new Date,a='',x;n=m.cn(n);if(!l)l=-1;if(n&&p){if(!m.l)m.l=new Object;" + "if(m.l[n])m.close(n);if(b&&b.id)a=b.id;if(a)for (x in m.l)if(m.l[x]&&m.l[x].a==a)m.close(m.l[x].n);i.n=n;i.l=l;i.o=0;i.x=0;i.p=m.cn(m.playerName?m.playerName:p);i.a=a;i.t=0;i.ts=0;i.s=Math.floor(tm" + ".getTime()/1000);i.lx=0;i.lt=i.s;i.lo=0;i.e='';i.to=-1;i.tc=0;i.fel=new Object;i.vt=0;i.sn=0;i.sx=\"\";i.sl=0;i.sg=0;i.sc=0;i.us=0;i.co=0;i.cot=0;i.lm=0;i.lom=0;m.l[n]=i}};m._delete=function(n){var" + " m=this,i;n=m.cn(n);i=m.l[n];m.l[n]=0;if(i&&i.m)clearTimeout(i.m.i)};m.close=function(n){this.e(n,0,-1)};m.play=function(n,o,sn,sx,sl){var m=this,i;i=m.e(n,1,o,sn,sx,sl);if(i&&!i.m){i.m=new Object;" + "i.m.m=new Function('var m=s_c_il['+m._in+'],i;if(m.l){i=m.l[\"'+m.s.rep(i.n,'\"','\\\\\"')+'\"];if(i){if(i.lx==1)m.e(i.n,3,-1);i.m.i=setTimeout(i.m.m,1000)}}');i.m.m()}};m.complete=function(n,o){th" + "is.e(n,5,o)};m.stop=function(n,o){this.e(n,2,o)};m.track=function(n){this.e(n,4,-1)};m.bcd=function(vo,i){var m=this,ns='a.media.',v=vo.linkTrackVars,e=vo.linkTrackEvents,pe='m_i',pev3,c=vo.context" + "Data,x;c['a.contentType']='video';c[ns+'name']=i.n;c[ns+'playerName']=i.p;if(i.l>0){c[ns+'length']=i.l;}c[ns+'timePlayed']=Math.floor(i.ts);if(!i.vt){c[ns+'view']=true;pe='m_s';i.vt=1}if(i.sx){c[ns" + "+'segmentNum']=i.sn;c[ns+'segment']=i.sx;if(i.sl>0)c[ns+'segmentLength']=i.sl;if(i.sc&&i.ts>0)c[ns+'segmentView']=true}if(!i.cot&&i.co){c[ns+\"complete\"]=true;i.cot=1}if(i.lm>0)c[ns+'milestone']=i" + ".lm;if(i.lom>0)c[ns+'offsetMilestone']=i.lom;if(v)for(x in c)v+=',contextData.'+x;pev3='video';vo.pe=pe;vo.pev3=pev3;var d=m.contextDataMapping,y,a,l,n;if(d){vo.events2='';if(v)v+=',events';for(x i" + "n d){if(x.substring(0,ns.length)==ns)y=x.substring(ns.length);else y=\"\";a=d[x];if(typeof(a)=='string'){l=m.s.sp(a,',');for(n=0;n0?i.l:1)+d+m.s.ape(i.p)+d+Math.floor(i.t)+d+i.s+d+(i.to>=0?'L'+Math.fl" + "oor(i.to):'')+i.e+(x!=0&&x!=2?'L'+Math.floor(o):'');vo.pe=pe;vo.pev3=pev3};m.e=function(n,x,o,sn,sx,sl,pd){var m=this,i,tm=new Date,ts=Math.floor(tm.getTime()/1000),c,l,v=m.trackVars,e=m.trackEvent" + "s,ti=m.trackSeconds,tp=m.trackMilestones,to=m.trackOffsetMilestones,sm=m.segmentByMilestones,so=m.segmentByOffsetMilestones,z=new Array,j,t=1,w=new Object,x,ek,tc,vo=new Object;n=m.cn(n);i=n&&m.l&&" + "m.l[n]?m.l[n]:0;if(i){if(o<0){if(i.lx==1&&i.lt>0)o=(ts-i.lt)+i.lo;else o=i.lo}if(i.l>0)o=o0){i.x=(i.o/i.l)*100;i.x=i.x>100?100:i.x}if(i.lo<0)i.lo=o;tc=i.tc;w.name" + "=n;w.length=i.l;w.openTime=new Date;w.openTime.setTime(i.s*1000);w.offset=i.o;w.percent=i.x;w.playerName=i.p;if(i.to<0)w.mediaEvent=w.event='OPEN';else w.mediaEvent=w.event=(x==1?'PLAY':(x==2?'STOP" + "':(x==3?'MONITOR':(x==4?'TRACK':(x==5?'COMPLETE':('CLOSE'))))));if(!pd){if(i.pd)pd=i.pd}else i.pd=pd;w.player=pd;if(x>2||(x!=i.lx&&(x!=2||i.lx==1))) {if(!sx){sn=i.sn;sx=i.sx;sl=i.sl}if(x){if(x==1)i" + ".lo=o;if((x<=3||x==5)&&i.to>=0){t=0;v=e=\"None\";if(i.to!=o){l=i.to;if(l>o){l=i.lo;if(l>o)l=o}z=tp?m.s.sp(tp,','):0;if(i.l>0&&z&&o>=l)for(j=0;j=c){t=1;j=z.length;w.mediaEvent=w.event='MILESTONE';i.lm=w.milestone=c}}z=to?m.s.sp(to,','):0;if(z&&o>=l)for(j=0;j=c){t=1;j=z" + ".length;w.mediaEvent=w.event='OFFSET_MILESTONE';i.lom=w.offsetMilestone=c}}}}if(i.sg||!sx){if(sm&&tp&&i.l>0){z=m.s.sp(tp,',');if(z){z[z.length]='100';l=0;for(j=0;j0?i.l:'E');l=0;for(j=0;j=0)t=1}if(x>=2&&i.lo=0&&x<=3){ti=ti?ti:0;if(ti&&i.ts>=ti){t=1;w.mediaEvent=w.event='SECONDS'}}i.lt=ts;i.lo=o}if(!x||i.x>" + "=100){x=0;m.e(n,2,-1,0,0,-1,pd);v=e=\"None\";w.mediaEvent=w.event=\"CLOSE\"}if(x==5||(m.completeByCloseOffset&&(!x||i.x>=100)&&i.l>0&&o>=i.l-m.completeCloseOffsetThreshold)){w.complete=i.co=1;t=1}e" + "k=w.mediaEvent;if(ek=='MILESTONE')ek+='_'+w.milestone;else if(ek=='OFFSET_MILESTONE')ek+='_'+w.offsetMilestone;if(!i.fel[ek]) {w.eventFirstTime=true;i.fel[ek]=1}else w.eventFirstTime=false;w.timePl" + "ayed=i.t;w.segmentNum=i.sn;w.segment=i.sx;w.segmentLength=i.sl;if(m.monitor&&x!=4)m.monitor(m.s,w);if(x==0)m._delete(n);if(t&&i.tc==tc){vo=new Object;vo.contextData=new Object;vo.linkTrackVars=v;vo" + ".linkTrackEvents=e;if(!vo.linkTrackVars)vo.linkTrackVars='';if(!vo.linkTrackEvents)vo.linkTrackEvents='';if(m.trackUsingContextData)m.bcd(vo,i);else m.bpe(vo,i,x,o);m.s.t(vo);if(i.us){i.sn=sn;i.sx=" + "sx;i.sc=1;i.us=0}else if(i.ts>0)i.sc=0;i.e=\"\";i.lm=i.lom=0;i.ts-=Math.floor(i.ts);i.to=o;i.tc++}}}return i};m.ae=function(n,l,p,x,o,sn,sx,sl,pd,b){var m=this,r=0;if(n&&(!m.autoTrackMediaLengthReq" + "uired||(length&&length>0)) &&p){if(!m.l||!m.l[n]){if(x==1||x==3){m.open(n,l,p,b);r=1}}else r=1;if(r)m.e(n,x,o,sn,sx,sl,pd)}};m.a=function(o,t){var m=this,i=o.id?o.id:o.name,n=o.name,p=0,v,c,c1,c2,x" + "c=m.s.h,x,e,f1,f2='s_media_'+m._in+'_oc',f3='s_media_'+m._in+'_t',f4='s_media_'+m._in+'_s',f5='s_media_'+m._in+'_l',f6='s_media_'+m._in+'_m',f7='s_media_'+m._in+'_c',tcf,w;if(!i){if(!m.c)m.c=0;i='s" + "_media_'+m._in+'_'+m.c;m.c++}if(!o.id)o.id=i;if(!o.name)o.name=n=i;if(!m.ol)m.ol=new Object;if(m.ol[i])return;m.ol[i]=o;if(!xc)xc=m.s.b;tcf=new Function('o','var e,p=0;try{if(o.versionInfo&&o.curre" + "ntMedia&&o.controls)p=1}catch(e){p=0}return p');p=tcf(o);if(!p){tcf=new Function('o','var e,p=0,t;try{t=o.GetQuickTimeVersion();if(t)p=2}catch(e){p=0}return p');p=tcf(o);if(!p){tcf=new Function('o'" + ",'var e,p=0,t;try{t=o.GetVersionInfo();if(t)p=3}catch(e){p=0}return p');p=tcf(o)}}v=\"var m=s_c_il[\"+m._in+\"],o=m.ol['\"+i+\"']\";if(p==1){p='Windows Media Player '+o.versionInfo;c1=v+',n,p,l,x=-" + "1,cm,c,mn;if(o){cm=o.currentMedia;c=o.controls;if(cm&&c){mn=cm.name?cm.name:c.URL;l=cm.duration;p=c.currentPosition;n=o.playState;if(n){if(n==8)x=0;if(n==3)x=1;if(n==1||n==2||n==4||n==5||n==6)x=2;}" + "';c2='if(x>=0)m.ae(mn,l,\"'+p+'\",x,x!=2?p:-1,0,\"\",0,0,o)}}';c=c1+c2;if(m.s.isie&&xc){x=m.s.d.createElement('script');x.language='jscript';x.type='text/javascript';x.htmlFor=i;x.event='PlayStateC" + "hange(NewState)';x.defer=true;x.text=c;xc.appendChild(x);o[f6]=new Function(c1+'if(n==3){x=3;'+c2+'}setTimeout(o.'+f6+',5000)');o[f6]()}}if(p==2){p='QuickTime Player '+(o.GetIsQuickTimeRegistered()" + "?'Pro ':'')+o.GetQuickTimeVersion();f1=f2;c=v+',n,x,t,l,p,p2,mn;if(o){mn=o.GetMovieName()?o.GetMovieName():o.GetURL();n=o.GetRate();t=o.GetTimeScale();l=o.GetDuration()/t;p=o.GetTime()/t;p2=o.'+f5+" + "';if(n!=o.'+f4+'||p5){x=2;if(n!=0)x=1;else if(p>=l)x=0;if(p5)m.ae(mn,l,\"'+p+'\",2,p2,0,\"\",0,0,o);m.ae(mn,l,\"'+p+'\",x,x!=2?p:-1,0,\"\",0,0,o)}if(n>0&&o.'+f7+'>=10){m.ae(mn,l" + ",\"'+p+'\",3,p,0,\"\",0,0,o);o.'+f7+'=0}o.'+f7+'++;o.'+f4+'=n;o.'+f5+'=p;setTimeout(\"'+v+';o.'+f2+'(0,0)\",500)}';o[f1]=new Function('a','b',c);o[f4]=-1;o[f7]=0;o[f1](0,0)}if(p==3){p='RealPlayer '" + "+o.GetVersionInfo();f1=n+'_OnPlayStateChange';c1=v+',n,x=-1,l,p,mn;if(o){mn=o.GetTitle()?o.GetTitle():o.GetSource();n=o.GetPlayState();l=o.GetLength()/1000;p=o.GetPosition()/1000;if(n!=o.'+f4+'){if" + "(n==3)x=1;if(n==0||n==2||n==4||n==5)x=2;if(n==0&&(p>=l||p==0))x=0;if(x>=0)m.ae(mn,l,\"'+p+'\",x,x!=2?p:-1,0,\"\",0,0,o)}if(n==3&&(o.'+f7+'>=10||!o.'+f3+')){m.ae(mn,l,\"'+p+'\",3,p,0,\"\",0,0,o);o.'" + "+f7+'=0}o.'+f7+'++;o.'+f4+'=n;';c2='if(o.'+f2+')o.'+f2+'(o,n)}';if(m.s.wd[f1])o[f2]=m.s.wd[f1];m.s.wd[f1]=new Function('a','b',c1+c2);o[f1]=new Function('a','b',c1+'setTimeout(\"'+v+';o.'+f1+'(0,0)" + "\",o.'+f3+'?500:5000);'+c2);o[f4]=-1;if(m.s.isie)o[f3]=1;o[f7]=0;o[f1](0,0)}};m.as=new Function('e','var m=s_c_il['+m._in+'],l,n;if(m.autoTrack&&m.s.d.getElementsByTagName){l=m.s.d.getElementsByTag" + "Name(m.s.isie?\"OBJECT\":\"EMBED\");if(l)for(n=0;n parseInt(cpv)) { ps = pv - Math.round(vph / dh * 100); s.c_w('s_ppv', pv + '|' + ps); hpmmd.log.log("Writing page view cookie: " + pv + '|' + ps); } } else { s.c_w('s_ppv', ''); } } } catch (e) { } }; /* s.getPPVCalc = new Function("", "" + "var s=window.s,d=s.d,dh=Math.max(Math.max(d.body.scrollHeight,d.documentElement." + "scrollHeight),Math.max(d.body.xoffsetHeight,d.documentElement.of" + "fsetHeight),Math.max(d.body.clientHeight,d.documentElement.clie" + "ntHeight)),vph=d.clientHeight||Math.min(d.documentElement.clien" + "tHeight,d.body.clientHeight),st=s.wd.pageYOffset||(s.wd.document." + "documentElement.scrollTop||s.wd.document.body.scrollTop),vh=st+vph," + "pv=Math.round(vh/dh*100),cv=s.c_r('s_ppv'),cpi=cv.indexOf('|'),cpv=" + "'',ps='';try{if(cpi!=-1){cpv=cv.substring(0,cpi);ps=parseInt(cv.substri" + "ng(cpi+1));}else{cpv=ps=0;}if(pv<=100){if(pv>parseInt(cpv)){ps=pv-M" + "ath.round(vph/dh*100);s.c_w('s_ppv',pv+'|'+ps);}}else{s.c_w('s_ppv'" + ",'');}}catch(e){hpmmd.log.log('ERROR: getPPVCalc: '+e)}"); */ s.getPPVSetup = function () { var s = this; if (s.wd.addEventListener) { s.wd.addEventListener('load', s.getPPVCalc, false); s.wd.addEventListener('scroll', s.getPPVCalc, false); s.wd.addEventListener('resize', s.getPPVCalc, false); } else if (s.wd.attachEvent) { s.wd.attachEvent('onload', s.getPPVCalc); s.wd.attachEvent('onscroll', s.getPPVCalc); s.wd.attachEvent('onresize', s.getPPVCalc); } }; /* s.getPPVSetup = new Function("", "" + "var s=this;if(s.wd.addEventListener){s.wd.addEventListener('load',s" + ".getPPVCalc,false);s.wd.addEventListener('scroll',s.getPPVCalc,fals" + "e);s.wd.addEventListener('resize',s.getPPVCalc,false);}else if(s.wd" + ".attachEvent){s.wd.attachEvent('onload',s.getPPVCalc);s.wd.attachEv" + "ent('onscroll',s.getPPVCalc);s.wd.attachEvent('onresize',s.getPPVCa" + "lc);}"); */ var percentViewed = unescape(s.c_r("s_ppv")); s.prop60 = percentViewed; // Set the value to replicate whatever the previous page value existed in the cookie s.c_w("s_ppv", "0", (new Date("Jan 1, 2000 00:00:00"))); /* function doGetPPVSetup(countdown) { countdown=countdown-1; if(countdown < 0) {return;} if(!!window.s.d) { s.getPPVSetup(); } else setTimeout(function() {doGetPPVSetup(countdown)},1000); } doGetPPVSetup(10); */ s.getPPVSetup(); } } })(); /* if (hpmmd.page.country == "uk") { window.dfaConfig = { CSID : '1516691', // DFA Client Site ID SPOTID : '2326416', // DFA Spotlight ID tEvar : 'eVar58', // Transfer variable, typically the "View Through" eVar. errorEvar : 'eVar60', // DFA error tracking (optional) timeoutEvent : 'event51', // Tracks timeouts/empty responses (optional) requestURL : "http://fls.doubleclick.net/json?spot=[SPOTID]&src=[CSID]&var=[VAR]&host=integrate.112.2o7.net%2Fdfa_echo%3Fvar%3D[VAR]%26AQE%3D1%26A2S%3D1&ord=[RAND]", // the DFA request URL maxDelay : "2550", // The maximum time to wait for DFA servers to respond, in milliseconds. visitCookie : "s_dfa", // The name of the visitor cookie to use to restrict DFA calls to once per visit. clickThroughParam : "dfaid", // A query string paramter that will force the DFA call to occur. searchCenterParam : undefined, // SearchCenter identifier. newRsidsProp : undefined //"prop34" // Stores the new report suites that need the DFA tracking code. (optional) }; //************************ END DFA Variables ************************ s.maxDelay = dfaConfig.maxDelay; s.loadModule("Integrate"); s.Integrate.onLoad = function(s, m) { var dfaCheck = s.partnerDFACheck(dfaConfig); if (dfaCheck) { s.Integrate.add("DFA"); s.Integrate.DFA.tEvar = dfaConfig.tEvar; s.Integrate.DFA.errorEvar = dfaConfig.errorEvar; s.Integrate.DFA.timeoutEvent = dfaConfig.timeoutEvent; s.Integrate.DFA.CSID = dfaConfig.CSID; s.Integrate.DFA.SPOTID = dfaConfig.SPOTID; s.Integrate.DFA.get(dfaConfig.requestURL); s.Integrate.DFA.setVars = function(s, p) { if (window[p.VAR]) {// got a response if (!p.ec) {// no errors s[p.tEvar] = "DFA-" + (p.lis ? p.lis : 0) + "-" + (p.lip ? p.lip : 0) + "-" + (p.lastimp ? p.lastimp : 0) + "-" + (p.lastimptime ? p.lastimptime : 0) + "-" + (p.lcs ? p.lcs : 0) + "-" + (p.lcp ? p.lcp : 0) + "-" + (p.lastclk ? p.lastclk : 0) + "-" + (p.lastclktime ? p.lastclktime : 0) } else if (p.errorEvar) {// got an error response, track s[p.errorEvar] = p.ec; } } else if (p.timeoutEvent) {// empty response or timeout s.events = ((!s.events || s.events == '') ? '' : (s.events + ',')) + p.timeoutEvent; // timeout event } } } } // Partner Plugin: DFA Check 1.0 - Restrict DFA calls to once a visit, per report suite, per click // through. Used in conjunction with VISTA. Deduplicates SCM hits. s.partnerDFACheck = new Function("cfg", "" + "var s=this,c=cfg.visitCookie,src=cfg.clickThroughParam,scp=cfg.searchCenterParam,p=cfg.newRsidsProp,tv=cfg.tEvar,dl=',',cr,nc,q,g,gs,i,j,k,fnd,v=1,t=new Date,cn=0,ca=new Array,aa=new Array,cs=new A" + "rray;t.setTime(t.getTime()+1800000);cr=s.c_r(c);if(cr){v=0;}ca=s.split(cr,dl);aa=s.split(s.un,dl);for(i=0;i=1;"); // Module: Integrate s.m_Integrate_c = "var m=s.m_i('Integrate');m.add=function(n,o){var m=this,p;if(!o)o='s_Integrate_'+n;if(!s.wd[o])s.wd[o]=new Object;m[n]=new Object;p=m[n];p._n=n;p._m=m;p._c=0;p._d=0;p.disable=0;p.get" + "=m.get;p.delay=m.delay;p.ready=m.ready;p.beacon=m.beacon;p.script=m.script;m.l[m.l.length]=n};m._g=function(t){var m=this,s=m.s,i,p,f=(t?'use':'set')+'Vars',tcf;for(i=0;i=5&&(!s.isopera||s.apv>=7)){tcf=new Function('s','p','f','var e;try{p[f](s,p)}catch(e){}');tcf(s,p,f)}else p[f](s,p)}}};m._t=function(){this._g(1)};m._fu=function" + "(p,u){var m=this,s=m.s,x,v,tm=new Date;if(u.toLowerCase().substring(0,4) != 'http')u='http://'+u;if(s.ssl)u=s.rep(u,'http:','https:');p.RAND=Math&&Math.random?Math.floor(Math.random()*1000000000000" + "0):tm.getTime();p.RAND+=Math.floor(tm.getTime()/10800000)%10;for(x in p)if(x&&x.substring(0,1)!='_'&&(!Object||!Object.prototype||!Object.prototype[x])){v=''+p[x];if(v==p[x]||parseFloat(v)==p[x])u=" + "s.rep(u,'['+x+']',s.rep(escape(v),'+','%2B'))}return u};m.get=function(u,v){var p=this,m=p._m;if(!p.disable){if(!v)v='s_'+m._in+'_Integrate_'+p._n+'_get_'+p._c;p._c++;p.VAR=v;p._d++;m.s.loadModule(" + "'Integrate:'+v,m._fu(p,u),0,1,p._n)}};m.delay=function(){var p=this;if(p._d<=0)p._d=1};m.ready=function(){var p=this,m=p._m;p._d=0;if(!p.disable)m.s.dlt()};m._d=function(){var m=this,i,p;for(i=0;i<" + "m.l.length;i++){p=m[m.l[i]];if(p&&!p.disable&&p._d>0)return 1}return 0};m._x=function(d,n){var p=this[n],x;if(!p.disable){for(x in d)if(x&&(!Object||!Object.prototype||!Object.prototype[x]))p[x]=d[" + "x];p._d--}};m.beacon=function(u){var p=this,m=p._m,s=m.s,imn='s_i_'+m._in+'_Integrate_'+p._n+'_'+p._c,im;if(!p.disable&&s.d.images&&s.apv>=3&&(!s.isopera||s.apv>=7)&&(s.ns6<0||s.apv>=6.1)){p._c++;i" + "m=s.wd[imn]=new Image;im.src=m._fu(p,u)}};m.script=function(u){var p=this,m=p._m;if(!p.disable)m.s.loadModule(0,m._fu(p,u),0,1)};m.l=new Array;if(m.onLoad)m.onLoad(s,m)"; try { window.s = s; s.m_i("Integrate"); delete (window.s); } catch(e) { hpmmd.log("error", "Omniture Module Load: Survey or Integrate:", e); } } */ /* if (hpmmd.page.region == "emea") { s.m_Survey_c = "var m=s.m_i(\"Survey\");m.launch=function(i,e,c,o,f){this._boot();var m=this,g=window.s_sv_globals||{},l,j;if(g.unloaded||m._blocked())return 0;i=i&&i.constructor&&i.constructor==Array?" + "i:[i];l=g.manualTriggers;for(j=0;j 4) l[l.length - 4]=null;l[l.length]=impr;m._execute();};m." + "_rr=function(){var g=window.s_sv_globals||{},f=g.onScQueueEmpty||0;if(f)f();};m._blocked=function(){var m=this,g=window.s_sv_globals||{};return !m._booted||g.stop||!g.pending&&!g.triggerRequested;}" + ";m._execute=function(){if(s_sv_globals.execute)setTimeout(\"s_sv_globals.execute();\",0);};m._boot=function(){var m=this,s=m.s,w=window,g,c,d=s.dc,e=s.visitorNamespace,n=navigator.appName.toLowerCa" + "se(),a=navigator.userAgent,v=navigator.appVersion,h,i,j,k,l,b;if(w.s_sv_globals)return;if(!((b=v.match(/AppleWebKit\\/([0-9]+)/))?521>26^i.charCodeAt(k);b[i]={url:g.url+\"/suites/\"+(h%251+100)+\"/\"+encodeURIComponent(i.replace(/\\|/,\"||\").replace(/\\//,\"|-\"))};++g.pending;}}g.suit" + "es=b;setTimeout(\"s_sv_globals.module._load();\",0);m._booted=1;};m._param=function(c,n,v){var p=\"s_sv_\",w=window,u=\"undefined\";if(typeof c[n]==u)c[n]=typeof w[p+n]==u?v:w[p+n];};m._load=functi" + "on(){var m=this,g=s_sv_globals,q=g.suites,r,i,n=\"s_sv_sid\",b=m.s.c_r(n);if(!b){b=parseInt((new Date()).getTime()*Math.random());m.s.c_w(n,b);}for(i in q){r=q[i];if(!r.requested){r.requested=1;m._" + "script(r.url+\"/list.js?\"+b);}}};m._loaded=function(r,b,d,i,l){var m=this,g=s_sv_globals,n=g.incomingLists;--g.pending;if(!g.commonRevision){g.bulkRevision=b;g.commonRevision=r;g.commonUrl=g.url+" + "\"/common/\"+b;}else if(g.commonRevision!=r)return;if(!l.length)return;n[n.length]={r:i,l:l};if(g.execute)g.execute();else if(!g.triggerRequested){g.triggerRequested=1;m._script(g.commonUrl+\"/trig" + "ger.js\");}};m._script=function(u){var d=document,e=d.createElement(\"script\");e.type=\"text/javascript\";e.src=u;d.getElementsByTagName(\"head\")[0].appendChild(e);};if(m.onLoad)m.onLoad(s,m)"; try { window.s = s; s.m_i("Survey"); delete (window.s); } catch (e) { hpmmd.log("error", "Omniture Module Load: Survey or Integrate:", e); } } */ } }; function s_hp_addPlugins(s) { try { (function includeSpecificOmnitureIntegrations(s) { /* Survey logic: Performed contextually only on EMEA site pages */ if (s.prop13.indexOf("hphqemea") != -1) { s.loadModule("Survey"); s.Survey.suites = "hphqemeauk"; window.s_sv_dynamic_root = "survey.112.2o7.net/survey/dynamic"; window.s_sv_gather_root = "survey.112.2o7.net/survey/gather"; } })(s); s.tnt = s.trackTNT(); /* Track T&T Variables */ } catch (e) { hpmmd.log("error", "Issue with Survey:includeSpecificOmnitureIntegrations", e); } if (typeof (FB) != 'undefined') { s.fbLike = function (fbsub, fbvars, fbevent, fbpref) { clearInterval(fblikeInterval); FB.Event.subscribe(fbsub, function (href, widget) { s.linkTrackVars = fbvars; s.linkTrackEvents = fbevent; s.events = fbevent; s.tl(this, 'o', fbpref + ":" + href); }); }; var fblikeInterval = setInterval(function () { s.fbLike("edge.create", "none", "none", "fb:like"); }, 100); } /* Code part for Search Center Bounce Rate Implementation */ /* Set Landing Page and Second Page Event */ /* if (s.ActionDepthTest) { s.pdvalue = s.getActionDepth("s_depth"); if (s.pdvalue == 1) s.events = s.apl(s.events, 'event47', ',', 2); if (s.pdvalue == 2) s.events = s.apl(s.events, 'event48', ',', 2); } s.ActionDepthTest = false; */ } /*jslint nomen: true*/ var _KSVideoModule = _KSVideoModule || {}; _KSVideoModule.bcVideoArray = []; _KSVideoModule.intervalArray = []; _KSVideoModule.experienceIDArray = []; _KSVideoModule.isInVideoArray = function (arr, findValue, argGetPosition) { var i = arr.length, a, getPosition = argGetPosition || false; if (i > 0) { while (i--) { if (arr[i].vid === findValue) { a = (getPosition) ? i : true; return a; } } } a = (getPosition) ? 0 : false; return a; }; _KSVideoModule.stopPreviousVideo = function (previousVideo) { var test_defined = false, test_playing = false; try { test_defined = brightcove.instances[previousVideo.experienceID].modules.videoPlayer.isPlayerDefined(); } catch (e) { } if (test_defined) { try { test_playing = brightcove.instances[previousVideo.experienceID].modules.videoPlayer.isPlaying(); } catch (e) { } } if (!test_defined && !test_playing) { previousVideo.state = 'stop'; if (previousVideo.intervalID) { clearInterval(previousVideo.intervalID); } if(!!s.Media){ s.Media.stop(previousVideo.displayName, previousVideo.position); } } if (!test_defined && !!s.Media) { s.Media.close(previousVideo.displayName); } return ''; }; _KSVideoModule.checkAlive = function () { var rval = false, vidModuleStack = _KSVideoModule.videocontrol.video_modules, test = true, i; if (_KSVideoModule.isVideoTracking) { return; } /* If we're not tracking videos, don't worry */ if (_KSVideoModule.videocontrol.video_modules.length === 0) { /* If the video modules property is at zero because we're switching back and forth between videos, take the first enabled video from the list of existing videos */ for (i in brightcove.instances) { if (brightcove.instances.hasOwnProperty(i) && test && brightcove.instances[i].modules.videoPlayer.getEnabled() && brightcove.instances[i].modules.videoPlayer.getVisible()) { test = false; _KSVideoModule.videocontrol.video_modules.push(brightcove.instances[i].modules.videoPlayer.getEnabled()); } } } try { rval = vidModuleStack[vidModuleStack.length - 1].getEnabled(); _KSVideoModule.bcLastVideo.position = vidModuleStack[vidModuleStack.length - 1].getVideoPosition() || _KSVideoModule.bcLastVideo.position; /* Is last video being played still visible, then we don't autoclose */ } catch (e) { } if (!rval) { _KSVideoModule.stopPreviousVideo(_KSVideoModule.bcLastVideo); } }; _KSVideoModule.videoTrack = function (action, eventdata) { var metatags = hpmmd.metatags || {}, displayName = eventdata.media.displayName || "Title Error"; var country = metatags.target_country || "err", websection = metatags.web_section_id || "err", business_unit = metatags.bu || "err", displayPrefix = country + ":" + business_unit + ":" + websection + ":"; if (displayName.indexOf(displayPrefix) == -1) { displayName = displayPrefix + displayName; } var currentVideo = { "vid":eventdata.media.id, "duration":eventdata.duration, "position":eventdata.position, "displayName":displayName, "positionInArray":_KSVideoModule.isInVideoArray(_KSVideoModule.bcVideoArray, eventdata.media.id, true), "isInArray":_KSVideoModule.isInVideoArray(_KSVideoModule.bcVideoArray, eventdata.media.id, false), "state":action }; currentVideo.experienceID = currentVideo.experienceID || _KSVideoModule.lastExperienceID; if (action !== 'begin' && currentVideo.isInArray) { currentVideo.hasBegan = _KSVideoModule.bcVideoArray[currentVideo.positionInArray].hasBegan || false; _KSVideoModule.bcVideoArray[currentVideo.positionInArray] = currentVideo; } else if (!currentVideo.isInArray) { _KSVideoModule.bcVideoArray.push(currentVideo); } // if (_KSVideoModule.bcLastVideo && currentVideo.vid !== _KSVideoModule.bcLastVideo.vid && _KSVideoModule.isTracking && _KSVideoModule.bcVideoArray.length > 1) { if (_KSVideoModule.bcLastVideo && currentVideo.vid !== _KSVideoModule.bcLastVideo.vid && _KSVideoModule.bcVideoArray.length > 1) { if (_KSVideoModule.bcLastVideo.intervalID) { clearInterval(_KSVideoModule.bcLastVideo.intervalID); } _KSVideoModule.stopPreviousVideo(_KSVideoModule.bcLastVideo); } switch (action) { case 'begin': _KSVideoModule.isTracking = true; currentVideo.hasBegan = true; if (currentVideo.isInArray) { _KSVideoModule.bcVideoArray[currentVideo.positionInArray].hasBegan = true; } /*11182014 - SW SMART PLAYER API FIX, ENSURE MEDIA MODULE EXIST*/ if(!!!s.Media){ _KSVideoModule.loadMediaModule(); } s.Media.open(currentVideo.displayName, currentVideo.duration, 'brightcove'); s.Media.play(currentVideo.displayName, 0); s.pageName = "cs:video:"+currentVideo.displayName; //create a temporary s.pageName if (!!s.pageName && s.pageName.indexOf("cs:video:") == 0) { s.eVar55 = ""; if (!!s.events) { s.events = s.events.replace(/event4\,?/, ""); } } s.t(); //send page beacon to Omniture with temporary s.pageName break; case 'play': _KSVideoModule.isTracking = true; /*if (currentVideo.position === 0 && currentVideo.hasBegan) { s.Media.open(currentVideo.displayName, currentVideo.duration, 'brightcove'); s.Media.play(currentVideo.displayName, 0); } else { s.Media.play(currentVideo.displayName, currentVideo.position); }*/ s.Media.play(currentVideo.displayName, currentVideo.position); break; case 'complete': _KSVideoModule.isTracking = false; if (_KSVideoModule.bcLastVideo.intervalID) { window.clearInterval(_KSVideoModule.bcLastVideo.intervalID); } s.Media.stop(currentVideo.displayName, currentVideo.duration); s.Media.close(currentVideo.displayName); break; case 'stop': _KSVideoModule.isTracking = false; if (_KSVideoModule.bcLastVideo.intervalID) { clearInterval(_KSVideoModule.bcLastVideo.intervalID); } s.Media.stop(currentVideo.displayName, currentVideo.position); break; case 'close': _KSVideoModule.isTracking = false; if (_KSVideoModule.bcLastVideo.intervalID) { clearInterval(_KSVideoModule.bcLastVideo.intervalID); } s.Media.stop(currentVideo.displayName, currentVideo.duration); s.Media.close(currentVideo.displayName); _KSVideoModule.videocontrol.video_modules.shift(); break; } _KSVideoModule.bcLastVideo = currentVideo; if (action !== 'begin' && currentVideo.isInArray) { currentVideo.hasBegan = _KSVideoModule.bcVideoArray[currentVideo.positionInArray].hasBegan || false; _KSVideoModule.bcVideoArray[currentVideo.positionInArray] = currentVideo; } if (action === 'play') { _KSVideoModule.bcLastVideo.intervalID = setInterval(_KSVideoModule.checkAlive, 1000); _KSVideoModule.intervalArray.push(_KSVideoModule.bcLastVideo.intervalID); } return ''; }; _KSVideoModule.bcTrackFN = { onPlay:function (e) { _KSVideoModule.videoTrack("play", e); }, onStop:function (e) { _KSVideoModule.videoTrack("stop", e); }, onBegin:function (e) { _KSVideoModule.videoTrack("begin", e); }, onComplete:function (e) { _KSVideoModule.videoTrack("complete", e); } }; function initializeVideoTracking() { // (function () { if (typeof(pExperienceID) === 'undefined') { var pExperienceID; } _KSVideoModule.bcTrackFN.onTemplateLoadedOld = window.onTemplateLoaded || function (e) { }; _KSVideoModule.videocontrol = { video_modules:[] }; window.onTemplateLoaded = function (pExperienceID) { _KSVideoModule.bcTrackFN.experience = _KSVideoModule.bcTrackFN.experience || []; _KSVideoModule.bcTrackFN.experience[pExperienceID] = { onPlay:function (e) { _KSVideoModule.videoTrack("play", e); }, onStop:function (e) { _KSVideoModule.videoTrack("stop", e); }, onBegin:function (e) { _KSVideoModule.videoTrack("begin", e); }, onComplete:function (e) { _KSVideoModule.videoTrack("complete", e); } }; _KSVideoModule.bcTrackFN.onTemplateLoadedDefined = true; _KSVideoModule.bcTrackFN.onTemplateLoadedOld(pExperienceID); bcEvt = (typeof(APIModules)!=="undefined")?BCMediaEvent:brightcove.api.events.MediaEvent; bcExp = (typeof(APIModules)!=="undefined")?brightcove.getExperience(pExperienceID):brightcove.api.getExperience(pExperienceID); modVP = (typeof(APIModules)!=="undefined")?bcExp.getModule(APIModules.VIDEO_PLAYER):bcExp.getModule(brightcove.api.modules.APIModules.VIDEO_PLAYER); try { modVP.addEventListener(bcEvt.BEGIN, _KSVideoModule.bcTrackFN.experience[pExperienceID].onBegin); modVP.addEventListener(bcEvt.STOP, _KSVideoModule.bcTrackFN.experience[pExperienceID].onStop); modVP.addEventListener(bcEvt.COMPLETE, _KSVideoModule.bcTrackFN.experience[pExperienceID].onComplete); modVP.addEventListener(bcEvt.PLAY, _KSVideoModule.bcTrackFN.experience[pExperienceID].onPlay); } catch (e) { trackMetrics("errorCondition", {"error_code":"modVPnull:" + pExperienceID}); } _KSVideoModule.videocontrol.video_modules.push(modVP); _KSVideoModule.experienceIDArray.push(pExperienceID); _KSVideoModule.lastExperienceID = pExperienceID; hpmmd.video = hpmmd.video || {}; if (!hpmmd.video.omniobject || !!!s.Media) { _KSVideoModule.loadMediaModule(); } }; } // ()); _KSVideoModule.loadMediaModule = function(){ var s_account = s_hp_proRSLogic() || "hphqvideoignore"; hpmmd.video.omniobject = window.s = s_gi(s_account); window.s = s; s_hp_commonConfig(s); try { if (!s.getQueryParam) { hpmmd.omniture.load_plugins(s); } s.m_i("Media"); s.loadModule("Media"); s.Media.autoTrack = false; s.Media.trackMilestones = "25"; s.Media.segmentByMilestones = true; s.Media.completeByCloseOffset = true; s.Media.completeCloseOffsetThreshold = 0; s.Media.trackVars = "None"; s.Media.trackEvents = "None"; s.Media.trackUsingContextData = true; s.Media.contextDataMapping = { 'a.media.name':'eVar70', 'a.media.segment':'eVar71', 'a.contentType':'eVar72', 'a.media.segmentView':'event97', "a.media.complete":"event98", 'a.media.timePlayed':'event99', 'a.media.view':'event100', 'a.media.milestones':'None' }; } catch (e) { if (!!console && !!console.warn) { console.warn("error" + ":Omniture Module Load: Media:" + e); } } } _domReady.ready(function () { if(typeof(brightcove)!=="undefined" && window.location.href.indexOf("videoDebug=true")===-1) { if(typeof(APIModules) === "undefined" && typeof(brightcove.api) === "undefined") { var bcAdmin = "http://admin.brightcove.com/js/APIModules_all.js", bcSecureAdmin = "https://sadmin.brightcove.com/js/APIModules_all.js"; LazyLoad.js((document.location.protocol === 'http:') ? bcAdmin : bcSecureAdmin, initializeVideoTracking); } else { initializeVideoTracking(); } } }); /* * This is DOM-ready-specific code that only executes for Cleansheet and Cleansheet Wash code */ hpmmd.stage = (function (srch) { function attach(a, suf) { return (a.indexOf(suf) != -1 ? a : a.replace(".js", suf + ".js")); } r = { name: "pro", addSuffix: function (a) { return a; } }; if ((/[\?\&]hpanalyticsitg\=/).test(srch)) { r = { name: "itg", addSuffix: function (a) { return attach(a, "_itg"); } }; } if ((/[\?\&]hpanalyticsdev\=/).test(srch)) { r = { name: "dev", addSuffix: function (a) { return attach(a, "_dev"); } }; } return r; })(window.location.search || ""); var ommitBrowsersDOMReady = /MSIE 6/i.test(navigator.userAgent) || (hpmmd.beacon == "immediate"), isBadBrowser = ommitBrowsersDOMReady; var isHomePage = (function () { var r = false, p = window.location.pathname, f = window.location.hostname + p, r1 = /.+\/.+\/home.html$/, r2 = /country\/.+\/.+\/welcome.html$/; return ((r1.test(p) || r2.test(p) || f === "www.hp.com/") ? true : false); })(); // _prv_loadMetatags(); // if (!s_doABTestPlugin(window.doABTest, "test")) { // /* Immediate execution */ // s_hp_ABTestSwitchingLogic("http://welcome.hp-ww.com/cma/ng/lib/abmvt/abmvt"); if (!window._mbootstrap && (window.location.pathname.indexOf("search/search-results.html") != -1 || hpmmd.page.region === "emea" || hpmmd.page.bu === 'tsg')) { /* Dom REady condition pages */ _domReady.ready(function () { // hpmmd.timer.dom = (new Date()).getTime(); _mbootstrap.checkCaas.ready(s_hp_doAnalyticsLogic); }); } else { /* Immediate Pages */ /*checkCaas function only if _mboostrap object exist*/ if (typeof(_mbootstrap) === "object") { if(/h41111\/(rfg_formprocessor|campaigns)/gi.test(window.location.href) || /hpshopping\.in/gi.test(window.location.href) || /unit9\.net/gi.test(window.location.href) || /softwaresupport\.hp\.com/gi.test(window.location.href) || /noncaas=true/gi.test(window.location.href) || (!!window._mbootstrap && (window._mbootstrap.stage.isdev || window._mbootstrap.stage.isitg))){ s_hp_doAnalyticsLogic(); } else { _mbootstrap.checkCaas.ready(s_hp_doAnalyticsLogic); } } else {/*Otherwise backward compatible way*/ s_hp_doAnalyticsLogic() } /* _domReady.ready(function() { // hpmmd.timer.dom = (new Date()).getTime(); }); */ /* _domReady.onload(function() { hpmmd.timer.load = (new Date()).getTime(); }); */ } // } _domReady.ready(function () { try { for (var i = 0; i < document.links.length; i++) { lnk = document.links[i]; if (lnk.addEventListener) { lnk.addEventListener('click', s_hp_trackExitLinks, false); } else if (lnk.attachEvent) { lnk.attachEvent('onclick', s_hp_trackExitLinks); } } } catch (e) { } }); function s_doABTestPlugin(flag, actionValue) { return false; if (window.location.href.indexOf("faketest=") != -1) { flag = "HomepageUSOnly"; }/* Default Faketest */ var rval = false, isdefined = (!!flag && typeof (flag) == "string"); if (!isdefined) { return rval; } // Definitions: var tmpck = { "get" : function(k) { var c = ' ' + document.cookie, s = c.indexOf(' ' + k + '='), e = s < 0 ? s : c.indexOf(';', s), v = s < 0 ? '' : c.substring(s + 2 + k.length, e < 0 ? c.length : e); return v; }, "set" : function(k, v, e) { var exp = new Date((new Date().getTime()) + e * 86400000); document.cookie = k + "=" + escape(v) + (!!e ? "; expires=" + exp.toGMTString() : "") + "; path=/; domain=.hp.com"; } }; var abdefs = { "HomepageUSOnly" : { name : "homepage", regex : ["http...welcome.hp.com/country/(us/en)/welcome.html", "http...www.hp.com/country/(us/en)/welcome.html", "http...(www).hp.com/$"], compare : "http://" + window.location.hostname + window.location.pathname, report_suite : "hpcssprint22ab", cookie : "hptest20120530a", sample : 0.1, duration : 1, // rollout:"http://welcome.hp.com/country/us/en/cs/home_d.html", // Force rollout to a final page regardless map : { "homepage-us/en" : ["http://welcome.hp.com/country/us/en/cs/home_a.html", "http://welcome.hp.com/country/us/en/cs/home.html"], "homepage-www" : ["http://welcome.hp.com/country/us/en/cs/home_a.html", "http://welcome.hp.com/country/us/en/cs/home.html"] } } }; function _prvDoRedirect(d) { var df = document.referrer, l = location, lh = "http://" + window.location.hostname + window.location.pathname; if (lh != d) { if (df) { tmpck.set("ab_ref", df); } location.href = d; return true; } return false; } if (actionValue == "test") { var _fullTest=function(abtest, name, namedate, samplesize, testduration, hponlyflag) { var testName = name, testNameDate = namedate, sampleSize = samplesize, duration = testduration; function doABTest(actions) { if (!!actions && !!actions.constructor && actions.constructor.toString().indexOf("Array") != -1) { var c = parseInt(tmpck.get(testName),10); var alreadyInTest = tmpck.get(testNameDate).length > 1; if (window.location.href.indexOf("faketest=") != -1) { alreadyInTest = false; c = NaN; sampleSize = 1; } if (!alreadyInTest) { /* function RNG(seed) { (function(j, i, f, m, k, n, o) { function q(b) { var c, e, a = this, g = b.length, d = 0, h = a.c = a.d = a.f = 0; a.a = []; a.e = []; for (g || ( b = [g++]); d < f; ) a.a[d] = d++; for ( d = 0; d < f; d++) c = a.a[d], h = h + c + b[d % g] & f - 1, e = a.a[h], a.a[d] = e, a.a[h] = c; a.b = function(b) { var d = a.a, c = a.c + 1 & f - 1, e = d[c], g = a.d + e & f - 1, h = d[g]; d[c] = h; d[g] = e; for (var i = d[e + h & f - 1]; --b; ) c = c + 1 & f - 1, e = d[c], g = g + e & f - 1, h = d[g], d[c] = h, d[g] = e, i = i * f + d[e + h & f - 1]; a.c = c; a.d = g; return i }; a.b(f) } function p(b, c, e, a) { e = []; if (c && typeof b == "object") for (a in b) if (a.indexOf("S") < 5) try { e.push(p(b[a], c - 1)) } catch(g) { } return e.length ? e : "" + b } function l(b, c, e, a) { b += ""; for ( a = e = 0; a < b.length; a++) { var g = c, d = a & f - 1, h = (e ^=c[a & f - 1] * 19) + b.charCodeAt(a); g[d] = h & f - 1 } b = ""; for (a in c) b += String.fromCharCode(c[a]); return b } i.seedrandom = function(b, c) { var e = [], a, b = l(p( c ? [b, j] : arguments.length ? b : [(new Date).getTime(), j, window], 3), e); a = new q(e); l(a.a, j); i.random = function() { for (var b = a.b(m), d = o, c = 0; b < k; ) b = (b + c) * f, d *= f, c = a.b(1); for (; b >= n; ) b /= 2, d /= 2, c >>>= 1; return (b + c) / d }; return b }; o = i.pow(f, m); k = i.pow(2, k); n = k * 2; l(i.random(), j) })([], Math, 256, 6, 52); var r = ["mnt6QYQli1NmRkeRwmao", "qQZ6WRI4JVq7RBnSNNhGfj", "ubFUkcue1RD1ECaj", "JI6mtbp8VzGWXUEz8Vn2Bl", "C0nMBBusbXv9EVPFOW5bJ", "cljGbLQF3gcBglPR8g", "uLM9L3PWe47419syK24In", "LKQhhtab4v2fSZZnmjhY", "qUhwTZdjUzGV0LVUHw1Zd", "B5RaWNaAWHa7prDOJ6pC", "ED0XPvntMongREcGXU40", "DWlcNl4cFfJXGrW2geA", "E20T5keLndOC6IchX4ILPa", "fbvSzuIvqnQHI245K5xgp", "WNN9TRqJAhdX9ZQMfAY", "EoY3QZ6eaRKfQb5h6y", "D6nCLOgFlI65gN01vxWc7Ei", "rv7h7NXNnTsIjYDtnTvK", "7JL7AqdLOdHOq0CF00Z", "i1GJtXlC8OdrTsDGCb", "mrkaeItGZvDJxfONqNB30Yz", "CUICJl2f4dc1WOI2V8Tc", "DFn5Pfl2m9Yq2EAZNan", "5ygbIEdcNHemxgCRWB", "DEhh8t0i7h2hlUxMOSAdenm", "5fmoYvCeajs0xqdKBqs2Y", "TbWcH01Q2MH2iGOwxuF", "vHwJDcddOocT9OpsM", "c9Rtjes2oibJEH2GOeI6HKB", "j1qjdA93VtK47msH9gNYJ", "vMfE9nnZCNriyeh5ezc3", "hu58bOTIP8c0MDvR"]; this.m = 0x100000000; this.a = 1103515245; this.c = 12345; Math.seedrandom(new Date().getTime() + window._rngmouse || ""); seed = seed ? seed : r[Math.floor(Math.random() * 100000000) % 32]; Math.seedrandom(seed + "|" + tmpck.get("s_vi") + navigator.userAgent + (new Date()).getTime()); // if(document.getElementById && oldmouse!=null) {document.onmouseover=oldmouse;} } */ var RNG={ nextRange:function(start,end) { return Math.floor(Math.random()*end)+start; }, nextFloat:function() { return Math.random(); } }; /* RNG.prototype.nextInt = function() { return (this.a * (Math.floor(Math.random() * (this.m - 1))) + this.c) % this.m; } RNG.prototype.nextRange = function(start, end) { var rangeSize = end - start; var randomUnder1 = this.nextInt() / this.m; return start + Math.floor(randomUnder1 * rangeSize); } RNG.prototype.nextFloat = function() { return this.nextInt() / (this.m - 1); } */ c = (RNG.nextFloat() >= (1 - sampleSize)) ? RNG.nextRange(0, actions.length) : -1; if (c >= 0) { tmpck.set(testName, c, duration); tmpck.set("hpabfirstpg", testName); tmpck.set(testNameDate, testName + c, duration); } } if ((c >= 0 && c < actions.length)) { redir = actions[c][0]; return redir(actions[c][1]); } } return false; } function _prv_abTrigger(t) { var map = t.map, n = t.name, re = t.regex, curl = t.compare, i, reres, rval = []; try { for ( i = re.length - 1; i >= 0; i--) { if (!reres) { reres = curl.match(new RegExp(re[i], "i")); } } if (!!reres && reres.length > 1) { if (t.rollout) { return [t.rollout]; } var cc = reres[1]; rval = map[n + "-" + cc]; if (rval.length <= 1) { rval = map[n + "-" + cc]; rval[1] = rval[0]; } } } catch(x) { hpmmd.log.log("AB Testing _prv_abTrigger" + JSON.stringify(x) ); } return !!rval ? rval : []; } function checkValidUsers(hponlyflag) { return true; /* var hpignore = false, srchEx = window.location.search.indexOf("viewonly=1") != -1, ckEx = tmpck.get("tmpIgnore3").length > 0, ckExHP = tmpck.get("tmpIgnoreHP").length > 0, check = (hponlyflag == true ? (!hpignore) : (srchEx || hpignore || ckEx)); if (check) { tmpck.set((hponlyflag == true ? "tmpIgnoreHP": "tmpIgnore3"), "1", 30); return false; } return true; */ } if (window.location.search.indexOf("viewonly=1") != -1) { return false; } var trig = _prv_abTrigger(abtest), i; if (trig.length > 0) { if (checkValidUsers(hponlyflag === true || hponlyflag === "hp" ? true : null)) { if (trig.length == 1 || (trig.length > 1 && trig[0] === trig[1])) { return _prvDoRedirect(trig[0]); } var nrTest = []; for ( i = 0; i < trig.length; i++) { nrTest[i] = [_prvDoRedirect, trig[i]]; } return doABTest(nrTest); } } return false; }; if (window.location.search.indexOf("viewonly=1") != -1) { return false; } // US Only Redirection: /* if(flag=="HomepageUSOnly"&& typeof(window._prv_getIPSegment)=="function" &&_prv_getIPSegment()==="hp") { return _prvDoRedirect("http://www8.hp.com/us/en/home.html"); // tmpck.set("hpcshponlyab", 0, 1); // tmpck.set("hpabfirstpg", "hpcshponlyab"); // tmpck.set("hptest20101022", "hpcshponlyab"+"0", 1); } */ // Do all tests if (isdefined && !!abdefs[flag]) { rval = _fullTest(abdefs[flag], abdefs[flag].report_suite, abdefs[flag].cookie, abdefs[flag].sample, abdefs[flag].duration, (abdefs[flag].hp === true ? true : false)); } } if (actionValue == "checkvalidtest") { var k, robj = {}, rsid; for (k in abdefs) { rsid = abdefs[k].report_suite; robj[rsid] = abdefs[k].cookie; } return robj; } return rval; } /* * Core files in general are all shared between legacy, cleansheet, and possibly ATLAS files. * Please make updates here that will impact everyone. */ function s_hp_washConfig(s) { var page = hpmmd.page, l = window.location, hn = l.hostname, path = l.pathname, dt = document.title || "no title", mt = hpmmd.metatags; page.name = page.name || (hn.split(".")[0] + ":" + path + ":" + dt.replace((/[^\w\-\s\,]+/g), "-")).toLowerCase().replace((/\s+/g), " "); page.section = page.section || mt.web_section_id; } function s_hp_commonConfig(s) { var wlh = window.location.href, df = hpmmd.page.download_types || "exe,zip,wav,mp3,mov,mpg,avi,wmv,doc,pdf,xls,tgz,msi", rem = hpmmd.page.disable_downloads; s.charSet = "UTF-8"; s.currencyCode = hpmmd.product.currency || "USD"; s.trackDownloadLinks = true; s.trackExternalLinks = true; s.trackInlineStats = true; s.linkDownloadFileTypes = (!rem ? df : df.split("," + rem).join("")); /*jshint scripturl:true */ s.linkInternalFilters = "javascript:,hp.,.hp,compaq.,.compaq,.hpgivingcards."; /*jshint scripturl:false */ s.linkLeaveQueryString = false; s.linkTrackVars = "prop73"; s.linkTrackEvents = "None"; s.visitorNamespace = "hpcorp"; s.dc = "112"; s.trackingServer = "met1.hp.com"; s.trackingServerSecure = "met2.hp.com"; s.vmk = "4A466CB3"; var r = hpmmd.ck.get("ab_ref"); if (!!r && r.length > 2) { s.referrer = r; hpmmd.ck.set("ab_ref", "i", -1); } var hr=hpmmd.ck.get('hp_hr'); if(!!hr && hr.length>2){ s.referrer = s.prop59 = hr; var expires = new Date("Thu, 01 Jan 1970 00:00:00 GMT"); s.c_w("hp_hr", "-", expires); } var tver = hpmmd.version || "ERROR", cver = hpmmd.code.version || "ERROR"; tver = (tver.indexOf("WASH") != -1 ? "wash" : "tridn-" + tver) + (typeof(_mbootstrap) !== "undefined" ? ":bs-" + _mbootstrap.version : ""); s.prop22 = tver + ":js-" + cver; } function s_hp_basicGivingCardConfig(s) { if (hpmmd.beacon.attributes && hpmmd.beacon.attributes.merchant && hpmmd.beacon.attributes.merchant.list) { var a = hpmmd.beacon.attributes.merchant.list, b = []; for (i in hpmmd.beacon.attributes.merchant.list) { b[i] = hpmmd.beacon.attributes.merchant.list[i].name; } s.list1 = b.join(','); } } function s_hp_doIncludeNonOmnitureFiles() {/* Requires: Country Code */ var cc = hpmmd.page.country, tms = hpmmd.metatags.tms; tms = (tms == "no" ? false : true); /* s_hp_includeJavaScriptFile("http://welcome.hp.com/cma/metrics/survey/sv_cleansheet.js"); */ function includePersonalization(personalizationFile) { s_hp_includeJavaScriptFile("http://welcome.hp-ww.com/cma/region/emea/personalization/" + personalizationFile); } function includeBlueKai(cc) { if (tms && !window._mbootstrap) { if (!!hpmmd.stage.name && hpmmd.stage.name !== "pro") { s_hp_includeJavaScriptFile("http://www.hp.com/cma/ng/lib/bluekai/hpbluekai.js", true); } else { s_hp_includeJavaScriptFile("http://welcome.hp-ww.com/cma/ng/lib/bluekai/hpbluekai.js", true); } } } /* if (cc == "de" || cc == "fr") { includePersonalization("omniture-additions_criteo_base62.js"); } if (cc == "ch") { includePersonalization("omniture-additions_fh_base62.js"); } if (cc == "es" || cc == "uk") { includePersonalization("criteo_base62.js"); } var ccb1 = (!!cc ? cc.toLowerCase() : "") + ":"; var brcl = "emea_middle_east:lamerica_nsc_cnt_amer:gr:za:pt:mx:se:"; if (brcl.indexOf(ccb1) != -1) { includePersonalization("bounce_base62.js"); } */ /* To include Bounce Rate Script to fire survey */ // var cc_bounce_survey = "emea_middle_east:lamerica_nsc_cnt_amer:gr:za:pt:mx:se:de:"; /* if(cc_bounce_survey.indexOf(ccb1)!=-1) { s_hp_includeJavaScriptFile("http://www.hp.com/cma/metrics/survey/sv_bounce.js"); } End of Bounce rate Script */ includeBlueKai(cc); } function s_hp_doAnalyticsLogic() { if (s_hp_initTagLogic()) { _prv_loadMetatags(); hpmmd.legacy.prefix = "CS:"; var account = s_hp_dynamicAccount(window.location.href, "hpcserror") || "hphqglobal"; /* hpmmd.page.account||{}; Unknown error */ /*jshint laxbreak:true */ hpmmd.page.account = account; switch (hpmmd.type) { case "CS Error State": hpmmd.csstate = 'Tridion:Error State'; hpmmd.beacon.jobs.push(["omni", "hpcserror", s_hp_basicOmniConfig, 0]); break; case "Cleansheet Wash": hpmmd.csstate = 'Non-Tridion'; hpmmd.version = "WASH"; hpmmd.beacon.jobs.push(["omni", account, function (s) { s_hp_washConfig(s); s_hp_basicOmniConfig(s); }, 0]); break; case "GivingCard Deployment": account = hpmmd.page.account = (window.location.host.indexOf('www.hpgivingcards.com') > -1) ? 'hpcsepc2give' : 'hpcsepc2givedev'; hpmmd.csstate = 'Non-Tridion'; hpmmd.version = "WASH"; hpmmd.beacon.jobs.push(["omni", account, function (s) { s_hp_washConfig(s); s_hp_basicOmniConfig(s); s_hp_basicGivingCardConfig(s); }, 0]); break; /* case "HP Default Cleansheet Implementation": Not required - falls through to this case by default */ default: if (!hpmmd.csstate) { hpmmd.csstate = 'Tridion:Error State'; } hpmmd.beacon.jobs.push(["omni", account, s_hp_basicOmniConfig, 0]); /* hpmmd.beacon.jobs.push(["omnisearch","hpcsintsearchdev", s_hp_searchOmniConfig,0]); */ break; } /* Decoupled Omniture script: version s_hp_includeJavaScriptFile("http://www.hp.com/cma/ng/lib/sc/s_code.js"); Inline Omniture Script: Activate the beacon */ try { _prv_showBeacon("omni", { type: "codeload" }); } catch (err) { } /* s_doAdditionalBeacons(account,1); Launch additional beacons using s_account logic */ hpmmd.xstate = true; } /* Include all other JavaScripts */ s_hp_doIncludeNonOmnitureFiles(); } function sStackPush(newevent, events) { if (!newevent) { newevent = ""; } if (!events) { events = newevent; newevent = ""; } var el = (!events ? [] : (newevent + "," + events).replace(/\s+/g, "").split(",")), i, t = el.join(","), r1 = new RegExp(newevent + "$"), tie = {}; el = el.concat(!newevent); for (i = el.length - 1; i >= 0; i--) { t = el[i]; if (!(!!t && t.length > 1 && !tie[t])) { el.splice(i, 1); } else { tie[t] = 1; } } return el.join(","); } function s_hp_proRSLogic() { var ra = ["hphqglobal,hpcsglobal"]; var whiteList = ["hphqeasybuyv2", "hpcsecapjnzhhos", "hphqwwcsnhpparts", "hphqwwnetworking", "hphqces*", "hphq-ces-*", "hphqwwserviceportal", "hphqescomsml", "hphqwwcommunities", "hphqwwrole", "hphqsmbstore", "hpcsecapjindiahhos"], blackList = [], override = ["hpcsredirect"]; // ra = ra.concat(!!s_hp_abTest ? s_hp_abTest("hpcssprint1ab|hpcssprint2ab|hpcssprint3ab|hpcssprint4ab|hpcssprint22ab|hpcshponlyab") : []); function supportLogic(lifecycle, websection, region, lang) { if (lifecycle == "support" && (websection == "r11498" || websection == "r11690" || websection == "r4155")) { var lmap = { "ar": "arabic", "cs": "czech", "da": "danish", "nl": "dutch", "en": "english", "fi": "finnish", "fr": "french", "de": "german", "gr": "greek", "el": "hebrew", "he": "hebrew", "hu": "hungarian", "it": "italian", "ja": "japanese", "ko": "korean", "no": "norwegian", "pl": "polish", "pt": "portuguese", "ru": "russian", "zh": "simpchinese", "es": "spanish", "sv": "swedish", "zt": "tradchinese", "tr": "turkish" }; if (lang.indexOf("el") != -1) { lang = (hpmmd.metatags.locale.full == "el-gr" ? "gr" : "el"); } if (lang.indexOf("zh") != -1) { switch (hpmmd.metatags.locale.full) { /* Traditional Chinese */ case "zh-hant": case "zh-tw": case "zh-hk": lang = "zt"; break; /* Simplified Chinese */ case "zh-hans": case "zh-cn": lang = "zh"; break; default: lang = "zh"; break; } } else { lang = (lang.indexOf("-") != -1 ? lang.split("-")[1] : lang); /* This is an error: site not metatag compliant */ } hpmmd.account = "hphq-ces-global,hphq-ces-" + region + "," + "hphq-ces-" + (lmap[lang] || "error"); if (window.location.href.match("http://h10025.www1.hp.com/ewfrf/wc/product\\?cc=us&lc=en&product=5264758")) { hpmmd.account = hpmmd.account + "," + 'hpcshpcinstantinkpro'; } } } supportLogic(hpmmd.metatags.lifecycle, hpmmd.metatags.web_section_id, hpmmd.legacy.region, (hpmmd.metatags.translate_language || hpmmd.metatags.language)); if (!(hpmmd.account && hpmmd.account.indexOf("hphq-ces") != -1)) { var regionrs = (hpmmd.page.rs_region ? "hpcs" + hpmmd.page.rs_region : ""), cc = hpmmd.page.country, bu = (!!hpmmd.page.bu ? hpmmd.page.bu : ""); /* Cleansheet Region Code */ if (regionrs) { /* ra.push(regionrs); */ /* Add Cleansheet Region Report suite */ if (regionrs.indexOf("hpcsamerus") != -1) { ra.push(regionrs); } var regLegacy = "hphq" + hpmmd.legacy.region; ra.push(regLegacy); /* Adding Legacy Region Report Suite */ if (cc.indexOf("emea_middle_east") != -1) { cc = "me"; } if (cc.indexOf("lamerica_nsc_cnt_amer") != -1) { cc = "ns"; } if (cc.indexOf("lamerica_nsc_carib") != -1) { cc = "cb"; } if (cc != "us") { var tmpcc = cc; if (cc.indexOf("rs") != -1) { tmpcc = "cs"; } ra.push(regLegacy + tmpcc); } var matchURL = window.location.href; if ((/www[0-9]\.hp\.com\/([\#a-zA-Z]{0,2})\/([a-zA-Z]{0,2})\/m\//).test(matchURL) || /\/m\//gi.test(matchURL) || (/m\.hp\.com\/([\#a-zA-Z]{0,2})\/([a-zA-Z]{0,2})\//).test(matchURL)) { ra.push("hphqmobile"); } //Adding new Graphic Arts web_section_id pages to the GA report on CS pages if( !!hpmmd.metatags.web_section_id && hpmmd.metatags.web_section_id.toLowerCase() == "r10931"){ ra.push("hphqwwgraphicarts"); } } /* Busines Unit Specific Logic */ if (bu.indexOf("tsg") != -1) { ra.push("hphqwwesg"); ra.push("hpcstsg"); } if(/h21007\.www2\.hp\.com\/portal\/site\/dspp/gi.test(window.location.href)){ ra.push("hphqwwdspp"); } if(/printsuppliespro\.glb\.itcs\.hp\.com\/ifttt/gi.test(window.location.href)){ ra.push("hphqwwprintsuppliespro"); } /* if (bu.indexOf("psg") != -1) { ra.push("hpcspsg"); } if (bu.indexOf("ipg") != -1) { ra.push("hpcsipg"); } */ } if (typeof (hpmmd.account) != "undefined") { var m = false, n = false, w; for (k = 0; k < whiteList.length; k++) { w = whiteList[k]; if (w.indexOf("*") != -1) { m = m || RegExp(w.replace(/\*+/g, ".*")).test(hpmmd.account); } else { m = m || w.indexOf(hpmmd.account) != -1; } } for (k = 0; k < blackList.length; k++) { w = blackList[k]; if (w.indexOf("*") != -1) { n = n || RegExp(w.replace(/\*+/g, ".*")).test(hpmmd.account); } else { n = n || w.indexOf(hpmmd.account) != -1; } } if (n === false && m === true) { ra.push(hpmmd.account); } if (override.join(":").indexOf(hpmmd.account) != -1) { ra = [hpmmd.account]; } } return ra.join(","); } function s_hp_dynamicAccount(matchStr, defaultRS) { var defaultDevReportSuite = "hpcorpsprint1"; var hpdynamic_accountmap = [ ["hpshopping.co|extweb.hp.com|houston.hp.com|atlanta.hp.com|austin.hp.com|m.hp.com|re:stg\\.www\\d\\.hp\\.com|h20352.www2.hp.com|hpswlabs.adapps.hp.com", function () { hpmmd.csstate = 'Tridion:DEV'; return defaultDevReportSuite; }], /* Pipe delimited list of all domains and corresponding accounts */ ["re:\\.hp\\.com|compaq.|letsbuy.com|purchasedge|hpshopping.in|hpshopping.co.nz|hpautodelivery.com", function () { hpmmd.csstate = 'Tridion'; return s_hp_proRSLogic(); }] ]; /* Process Dynamic Accounts */ var rs = defaultRS, i, checkMatch = false; for (i = hpdynamic_accountmap.length - 1; i >= 0; i--) { var sa = hpdynamic_accountmap[i][0].split("|"), j; for (j = sa.length - 1; j > -1; j--) { var s = sa[j]; if (!checkMatch && ((s.indexOf("re:") === 0 && (new RegExp(s.substr(3))).test(matchStr)) || (matchStr.indexOf(s) != -1))) { rs = hpdynamic_accountmap[i][1](); checkMatch = true; } else if(!!!_mbootstrap && /sitebuilder/.test(window.location.href)){ checkMatch = false; } } } if (!!_mbootstrap && !!_mbootstrap.stage && _mbootstrap.stage.ispro !== true) { rs = defaultDevReportSuite; if (window.location.hostname.indexOf("hpswlabs.adapps.hp.com") !== -1) { rs = "hphqglobaltestdev"; } } return rs; } /* function s_hp_ABTestSwitchingLogic(abFile) { // Fix wrong segment detection problem for static CS pages var wlp = window.location.pathname; if (wlp.indexOf("/country/") != -1 && wlp.indexOf("/cs/") != -1) { window._prv_getIPSegment = function () { return "non-hp"; }; } _prv_loadMetatags(); var reg = hpmmd.legacy.region.toUpperCase(); reg = (reg == "NA" ? "AMER" : (reg == "LA" ? "AMER" : reg)); // if(typeof window.doABTest!="function") { s_hp_includeJavaScriptFile(abFile+reg+".js"); } window.s_hp_abTest = function (cookiePatterns) { var isab = hpmmd.ck.get("hpabmvt"), gwoc = hpmmd.ck.get("__utmx"), wl = window.location.href; if (!!isab && !!gwoc && isab.indexOf("20100508") != -1 && gwoc.length > 1) { if (wl.indexOf("/country/uk/en/welcome.html") != -1) { hpmmd.ck.set("hpcssprint2ab", 1, 30); hpmmd.ck.set("hpabfirstpg", "hpcssprint2ab"); } if (wl.indexOf("/country/uk/en/cs/home.html") != -1) { hpmmd.ck.set("hpcssprint2ab", 0, 30); hpmmd.ck.set("hpabfirstpg", "hpcssprint2ab"); } if (wl.indexOf("/country/uk/en/cs/home_c.html") != -1) { hpmmd.ck.set("hpcssprint2ab", 2, 30); hpmmd.ck.set("hpabfirstpg", "hpcssprint2ab"); } } var c = document.cookie, ca = cookiePatterns.split("|"), i, acctArray = [], fpObj = {}, validcheck = s_doABTestPlugin(window.doABTest, "checkvalidtest") || {}; // if(hpmmd.ck.get("tmpIgnore2").length>0) return acctArray; for (i = ca.length - 1; i > -1; i--) { var v = ca[i], r = new RegExp("^.*(" + v + ")\\=(\\d).*$"), validTest = true; // validTest=(!validcheck[v]?false:c.indexOf(validcheck[v])!=-1); if (validTest && r.test(c)) { var av = c.replace(r, "$1$2"); if (av.indexOf("hpcssprint22ab") != -1) { //s_hp_includeJavaScriptFile2("welcome.hp.com","/cma/metrics/survey/sv_cleansheet.js"); if (av.indexOf("hpcssprint22ab0") != -1) { acctArray.push("hphqglobaljan11testa"); } if (av.indexOf("hpcssprint22ab1") != -1) { acctArray.push("hphqglobaljan11testb"); } if (av.indexOf("hpcssprint22ab2") != -1) { acctArray.push("hphqglobaljan11testc"); } if (av.indexOf("hpcssprint22ab3") != -1) { acctArray.push("hphqglobaljan11testd"); } } else { acctArray.push(av); } fpObj[v] = av; } } hpmmd.page.abtest = hpmmd.page.abtest || fpObj; c = hpmmd.ck.get("hpabfirstpg"); if (c.length > 0) { hpmmd.page.abtest.hpabfirstpg = c; hpmmd.ck.set("hpabfirstpg", "-1", -1); } if (acctArray.join("").indexOf("hpcshponlyab") != -1) { s_hp_includeJavaScriptFile("http://welcome.hp-ww.com/cma/metrics/survey/sv_emp_homepage.js"); } return acctArray; }; } */ function s_hp_basicOmniConfig(s) { var wlh = window.location.href, metatags = hpmmd.metatags || {}; s_hp_commonConfig(s); /* Omniture Config */ /* To do: Mapping should be changed to be more dynamic. Center for handling where things point. */ /* Mapping */ /* site-specific - always define first */ var account = s_hp_proRSLogic(), /* Prop13 value */ web_section_id = metatags.web_section_id || "", /* Web Section ID - used in a variety of ways */ beaconType = hpmmd.beacon.attributes.type, /* Type of Beacon - either Link type or otherwise */ isLink = !(!beaconType || (!!beaconType && (beaconType == "none" || beaconType == "codeload"))), chaosVariablesFlowThroughOnLink = (account.indexOf("hphqescomsml") != -1) || // If SML, then let Chaos variable flow through (web_section_id.indexOf("r11554") != -1)// Allow Chaos variables to flow through on all links from web section r11554 ; if (!isLink || (isLink && chaosVariablesFlowThroughOnLink)) { s.prop1 = _set(hpmmd.page.traffic1); s.prop2 = _set(hpmmd.page.traffic2); s.prop3 = _set(hpmmd.page.traffic3); if (hpmmd.page.traffic4 || metatags.lifecycle !== 'support') { s.prop4 = _set(hpmmd.page.traffic4); } s.prop5 = _set(hpmmd.page.traffic5); s.eVar73 = _set(hpmmd.page.conv73); s.eVar74 = _set(hpmmd.page.conv74); s.eVar75 = _set(hpmmd.page.conv75); var slt = ""; for (i = 1, j = 1; i < 6; i++) { if (typeof (s["prop" + i]) != "undefined") { slt += ",prop" + i; } if (typeof (s["eVar7" + (j + 2)]) != "undefined") { slt += ",eVar" + (i + 2); } j = (j < 4 ? j + 1 : j); } s.linkTrackVars = (slt.length > 1 ? slt + ",channel" : s.linkTrackVars); } s.prop22 = _set(s.prop22); s.prop51 = _set(metatags.hp_design_version || "cs:error"); s.eVar61 = _set(hpmmd.searchFeature); /* Process Overrides */ var pg = hpmmd.page, override = pg.override, overrideVariable = null; if (!!override) { overrideVariable = ""; if (!!override.section) { pg.section = override.section; overrideVariable += "Y"; } else { overrideVariable += "N"; } if (!!override.template) { pg.name = override.template; overrideVariable += "Y"; } else { overrideVariable += "N"; } if (!!override.subpage) { pg.subpage = override.subpage; overrideVariable += "Y"; } else { overrideVariable += "N"; } } s.prop74 = _set(overrideVariable || "NNN"); /* Support Variables */ var t2, mt = metatags, mprd = hpmmd.product.list, ch, url = window.location.href, t = (/country\/[^\/]+\/[^\/]+\/cs\/([^\/\.]+)/i).exec(url); var psku = mt.product_number || "not-applicable", pcat = pg.product_service || mt.product_service_name || "not-applicable"; pcat = pcat.replace(/\s*[\\\/]\s*/g, ":"); if (psku !== "not-applicable" && mprd.length === 0) { mprd.push({ name: psku }); hpmmd.page.events.push("Catalog Product View"); } var urlarray = window.location.pathname.split("/"); var lang = (metatags.translate_language || pg.language), cl = pg.country + ":" + lang; /* var cl=pg.country + ":"+pg.language; */ /* ((pg.language.indexOf("-")!=-1&&pg.language.indexOf(pg.country)!=-1)?pg.language.split("-")[0]:pg.language); */ ch = (!t ? pg.sectiontaxonomy || pg.section : ("home:index".indexOf(t[1]) != -1 ? "hp-gw" : t[1])) || "hp-marketing"; if (ch.indexOf("/") === 0) { t = ch.split("/"); ch = (t.length > 3 ? t[3] : "hp-gw"); } /* ch=(_prv_MapDefault(ch,1,"-",ch)); */ ch = ch.split("hp-").join(""); ch = (ch.length < 2 ? "gw" : ch); var chanlist = "privacy|contact-hp|survey|hp"; if (chanlist.indexOf(ch) != -1) { ch = "gw"; } var ch2 = urlarray.slice(4, 5).join(""); if (ch2.length > 0 && ch2.indexOf(".htm") == -1 && ch2 !== "cs") { ch += ":" + ch2.split("hp-").join(""); } if (!!pg.section) { ch = pg.section; } ch = ch.replace(/software\-solutions/ig, "software"); var pn = pg.name, spn = pg.subpage ? pn + ":" + pg.subpage : pn; if (pg.abtest) { t = pg.abtest.hpabfirstpg; switch (t) { case "hpcssprint1ab": abval = ":" + pg.abtest[t].toLowerCase(); s.eVar25 = (cl + abval); spn += abval; break; case "hpcssprint2ab": abval = ":" + pg.abtest[t].toLowerCase(); s.eVar26 = (cl + abval); spn += abval; break; case "hpcssprint3ab": abval = ":" + pg.abtest[t].toLowerCase(); s.eVar27 = (cl + abval); spn += abval; break; /* case "hpcssprint4ab": abval=":"+pg.abtest[t].toLowerCase();s.eVar28=(cl+abval); spn+=abval; break; case "hpcshponlyab": abval=":"+pg.abtest[t].toLowerCase();s.eVar28=(cl+abval); spn+=abval; break; */ case "hpcssprint22ab": abval = ":" + pg.abtest[t].toLowerCase(); s.eVar28 = (cl + abval); break; } pg.abtest.hpabfirstpg = null; } /* Omniture basic mapping */ if (!(pn && pn.length > 0)) { pg.name = "ERR: " + url.split("://")[1]; } s.eVar30 = _set(pcat); s.prop34 = "D=v30"; s.channel = _set(ch); s.server = _set(!!( t = pg.server) ? t.toLowerCase() : window.location.hostname.toLowerCase()); // hpmmd.ck.setraw("s_ppn", hpmmd.ck.get("s_pn")); // hpmmd.ck.setraw("s_pn", ch + ":" + cl + ":" + _cleanInternationalUnicode(spn)); // hpmmd.ck.setraw("s_re", _cleanInternationalUnicode(pg.major_region)); s.pageName = _set(ch + ":" + cl + ":" + spn); //Channel + [Country Language] + Specific Page Name if (!!metatags.web_section_id && "r4155:r11498:r11690:r2515".indexOf(metatags.web_section_id.toLowerCase()) != -1) { s.pageName = _set(ch + ":" + spn); } /* * Commenting Out Till Ready * * if(hpmmd.metatags.web_section_id === 'r4155'){ * s.pageName = _set(ch+":"+spn); //Channel + Specific Page Name * } else { * s.pageName = _set(ch+":"+cl+":"+spn); //Channel + [Country Language] + Specific Page Name * } * */ s.hier1 = 'D=' + pg.major_region + '+":"+pageName'; /* Proposed: Channel + [Country Language] + Specific Page Name (D=s_pn) */ s.eVar46 = _set(ch + ":" + pn); s.prop11 = "D=v46"; s.prop7 = _set(pg.country); s.prop8 = _set(lang); // s.prop73 = "D=s_ppn"; s.prop75 = _set(pg.major_region); s.prop9 = _set(pg.segment); s.prop10 = _set(pg.lifecycle); s.prop12 = _set(mt.web_section_id); s.prop13 = _set(s_hp_proRSLogic()); /* s.prop14=_set(hpmmd.user.usersegment); Removing due to inaccuracy */ s.prop16 = _set(pg.bu); if (!!hpmmd.page.sub_business_unit && s.prop13.indexOf("hpcstsg") !== -1) { s.prop5 = _set(hpmmd.page.sub_business_unit); s.eVar23 = "D=c5"; } /* Tactical measures - */ var st = document.getElementById("search_term"); st = pg.search_term || ( st ? st.value : null); s.prop6 = _setProp6(st); /*Added custom function to skip "cs:error" on prop6 to allow error "word" searches */ /* s.prop47=_set(pg.search_type); s.prop48=_set(pg.search_referrer); */ s.prop49 = _set(window.location.hostname + window.location.pathname); s.prop50 = 'D="cs:"+g'; if (!!hpmmd.beacon.attributes && !!hpmmd.beacon.attributes.error_code) { var myhost = window.location.hostname.split(".")[0], mysearch = window.location.search || ""; s.prop60 = hpmmd.beacon.attributes.error_code + ":" + myhost + window.location.pathname + mysearch; } /* _set(window.location.href); Enable dynamic syntax */ //Moved following code set to globalNavMeasurement.js --> around line ~70 /*var seg = hpmmd.ck.get("hp_cust_seg_sel") || ""; seg = (seg.length > 0 ? seg.toLowerCase() : "noseg"); s.prop21 = 'D="cs:' + seg + '|"+pageName';*/ /* eCommerce Variables */ s.eVar1 = _set(cl + ":" + pg.segment); /* s.eVar10=_set(hpmmd.user.usersegment); */ /* eVar13 capture */ /* s.eVar13 = _set(s_hp_getPrevPageClick()); */ /* commerce tactical measures */ /* s.eVar55=s.pageName; */ s.eVar55 = "D=pageName"; if (s.prop6) { s.eVar6 = "D=c6"; } /* s.eVar50=s.prop48; */ var preg = hpmmd.page.product_registration, pregSch, pk = ""; try { pregSch = document.getElementById("prodReg_form:productNamesTxt"); pregSch = !!pregSch ? pregSch.innerHTML : null; } catch (e) { } if (preg) { if (preg.results === 0 || preg.results === "0") { s.prop15 = _set("role:" + preg.keyword); } else { pk = "role:" + preg.keyword; if (pk.charAt(5) == " ") { pk = "role:" + pk.slice(6); } s.prop6 = _set(pk); } } else if (pregSch) { pk = "role:" + pregSch; pk = pk.replace(/\(|\)/g, ""); pk = pk.toLowerCase(); s.prop6 = _set(pk); } /* Wash & Other platform reporting */ /*s.prop51=_set(hpmmd.csstate+(window.location.hostname.indexOf("compaq.")!=-1?":compaq.com":""));*/ /*s.prop51=_set(metatags["hp_design_version"]||hpmmd.csstate+(window.location.hostname.indexOf("compaq.")!=-1?":compaq.com":""));*/ s.prop51 = _set(metatags.hp_design_version || "cs:error"); /* Autoevents: */ if (s.pageName.indexOf("Article Detail") != -1) { hpmmd.page.events = "Article Content Consumption"; } /* To Do: Have a separate section to map query params to the hpmmd object */ /* post click variables traffic */ s.prop23 = _set(s_hp_getQueryParam("search_result_type")); s.prop24 = _set(s_hp_getQueryParam("search_position")); /* post click variables commerce */ if (!s.eVar23) { s.eVar23 = _set(s_hp_getQueryParam("search_result_type")); } s.eVar24 = _set(s_hp_getQueryParam("search_position")); /* Manage arrays */ /* map events */ var events = { "Purchase": "purchase", "Dynamic Facets": "event50", "Product Recommendation Pilot": "event51", // for testing - fixed misspelling of pilot "Unqualified Lead Value": "event3", "Unqualified Lead Value Start": "event2", "Non-HP Leads": "event10", "Legacy General Download": "event7", "Other Gated Asset Click": "event7", "Use-Learn Download Click": "event11", "Mktg Download Click": "event12", "Recommendation Impressions": "event73", "Recommendation Click": "event76", "Article Or Content Consumption": "event45", "Track Open Banner Impression": "event1", "Optimost Test Trigger": "event59", "Partner Links": "event14", "Online Reseller Sales Lead": "event41", "Online HP Sales Lead": "event40", "Shopping Cart View": "scView", "Shopping Cart Add": "scAdd", "Shopping Cart Remove": "scRemove", "Shopping Cart Start Checkout": "scCheckout", "Generic Form Completion": "event8", "Site Event 60": "event60", "Site Event 61": "event61", "Site Event 62": "event62", "Site Event 63": "event63", "Site Event 64": "event64", "Catalog Product View": "prodView", //GivingCardEvents "gc.internal.search": "event52", "gc.apply.facet": "event53", "gc.print.plugin.no": "event54", "gc.print.plugin.install": "event55", "gc.print.plugin.yes": "event56", "gc.print.pdf": "event57", "gc.print.complete": "event58", "gc.select.artwork": "event60", "gc.preview.artwork": "event61", "gc.preview.merchant": "event62", "gc.select.merchant": "event63", "gc.personalization": "event70", "gc.personalize.recipient.display": "event71", "gc.personalize.recipient.apply": "event72", "gc.personalize.sender.display": "event73", "gc.personalize.sender.apply": "event74", "gc.personalize.sentiment.display": "event75", "gc.personalize.sentiment.apply": "event76", "gc.personalize.amount.display": "event77", "gc.personalize.amount.apply": "event78", "Content Click": "event79", "Content Impression":"event101" }; /* map products */ var prod = ""; var b = hpmmd.product.list; for (i = b.length - 1; i > -1; i--) { if (!!b[i].name) { prod += ";" + b[i].name; if (!!b[i].units) { prod += ";" + b[i].units; sales = b[i].revenue || b[i].total_price; if (!!sales) { prod += ";" + sales; } } prod += ","; } } /*Leadgen Serialization*/ if(!! hpmmd.ck.get('s_vi') && hpmmd.ck.get('s_vi') !=="" && !! hpmmd.ck.get('eg_serial') && hpmmd.ck.get('eg_serial') !==""){ var dt = new Date(), dd = dt.getDate(), mm = dt.getMonth()+1, hh=dt.getHours(); if(dd<10){dd='0'+dd} if(mm<10){mm='0'+mm} dt = mm+dd+hh; var prod_list= (prod!=="")?prod.split(":")[5].substring(0,8):""; events["Unqualified Lead Value Start"]=events["Unqualified Lead Value Start"].replace("event2","event2:"+hpmmd.ck.get('s_vi').substring(34,40)+dt+prod_list); } /*Bind Events*/ var ev = ""; var tv_b = hpmmd.page.events || []; var c = []; for (var i = tv_b.length - 1; i > -1; i--) { s.events = sStackPush(events[tv_b[i]], s.events); } try { if (!!s.events && !!window.abmvt && !!window.abmvt.track) { if (s.events.indexOf("event3") !== -1) { window.abmvt.track("response.complete"); } if (s.events.indexOf("event2") !== -1) { window.abmvt.track("response.start"); } if (s.events.indexOf("event12") !== -1) { window.abmvt.track("marketing.download"); } } } catch (e) { } var f = hpmmd.product.facets || [], tmpprod = ""; if (f.length > 0) { for (i = f.length - 1; i >= 0; i--) { if (f[i].length > 2) { tmpprod += ";" + f[i] + ","; } else { tmpprod += ";products-facet:clear facet,"; } } s.events = sStackPush(events["Dynamic Facets"], s.events); tmpprod = tmpprod.substr(0, tmpprod.length - 1); // Trim last character } if (hpmmd.product.facet_flag == "eb") { s.eVar7 = _set(tmpprod); } else { prod += tmpprod; } if (typeof (hpmmd.page.facets) == "object") {// Generic Facets s.prop55 = _set(hpmmd.page.facets.join("|")); } /* Metadata Addition for BlueKai: set scView event on all Cart View conditions in legacy, CS, and Atlas */ (function (country, url, s) { hpmmd.bluekai = { name: s.pageName || window.location.pathname }; if (country == "us" && url.indexOf("cart") != -1) { if ((/cart\/basket\.asp/i).test(url) || (/dcart\/cart\.asp/i).test(url)) { hpmmd.bluekai.isCart = true; } } })(pg.country, url, s); /* Product recom - test - Pradeep SV:20110213 , further updated by Ram 20110519// */ if (hpmmd.product.precFHID) { s.events = sStackPush(events["Product Recommendation Pilot"], s.events); s.eVar35 = _set(hpmmd.product.precFHID); s.prop2 = "D=v35"; } var pr = hpmmd.product.precPro || []; if (pr.length > 0) { prod = ";" + pr; /* s.events=sStackPush(events["Product Recommendation Pilot"],s.events); // Fixed misspelling */ /* s.eVar35 = hpmmd.product.precFHID; */ } /* End of Product recom - test // */ s.products = prod; // (prod!==""?prod:s.products); s_hp_doGeoRedirectCheck(s, s.pageName, s.channel); if (typeof (s_hp_jumpIdProcessing) !== "undefined") { s_hp_jumpIdProcessing(s); } s_hp_addPlugins(s); // Include plugins// // s_hp_setBouceRateEvent(s); //Trigger bounce Rate event // /* SearchCenter Campaign Stacking */ /* * Commented out per Deepak's discussion: July 22, 2011 var scmcvp=s.getQueryParamNoEncode('s_kwcid','',s.pageURL); s.eVar44 = s.crossVisitParticipation(scmcvp,'s_cpmscm','90','8','>','purchase'); // Modified eVar Number to align with CS Standards eVar38>eVar44 - Pradeep SV 20101119 // */ /* Personalization Value Mapping // */ var pntemp = s.pageName; if (pntemp.indexOf("cs:gw:de:de-de:home") > -1) {// Check if its DE home page // if (window.s_prop2) {// Check if s_prop2 is defined // _setifnull(s, "prop2", window.s_eVar35 || s.eVar35 || window.s_prop2 || s.prop2); /* s.eVar35 = window.s_prop2; */ } } /* End of Personalization mapping // */ /* AB Testing request by Liviu and Artur // */ if (window.s_hp_ab_globalheader) { s.eVar25 = _set(cl + ":" + window.s_hp_ab_globalheader); } /* Homepage Search Engine reqt - Bing-Yahoo request by Liviu and Artur - Pradeep SV - 20110204*/ var ccb1 = hpmmd.page.country + ":"; var brcl = "emea_middle_east:lamerica_nsc_cnt_amer:gr:za:pt:mx:se:"; if (brcl.indexOf(ccb1) != -1) { if (window.s_prop2) {// Check if s_prop2 is defined // _setifnull(s, "prop2", window.s_prop2); s.eVar25 = _set(window.s_prop2); } } /* 2011-02-14: Capture search keyword as part of search bounce project */ if (hpmmd.page.search_bounce) { s.prop1 = _set(cl + ":" + "searchbox:" + hpmmd.page.search_bounce); } /* End Changes */ /* Internal Search Mapping */ var srch = hpmmd.search || {}, isrch; if (!!srch && !!srch.internal) { isrch = srch.internal; _setifnull(s, "prop1", isrch.keyword || s.prop1); _setifnull(s, "prop2", isrch.number_results || s.prop2); _setifnull(s, "prop3", isrch.application || s.prop3); _setifnull(s, "prop4", hpmmd.page.application || s.prop4); _setifnull(s, "prop5", isrch.page_type || s.prop5); } /* Site search setup */ if (srch && srch.sitesearch) { s.prop36 = _set(srch.sitesearch.keyword); s.eVar36 = "D=c36"; s.prop37 = _set(srch.sitesearch.type); s.eVar37 = "D=c37"; if (hpmmd.page.section == "ces") { s.events = "event37"; } } /* Product Recommendation Code - Request by Liviu, Hilmar - Pradeep SV - 20110213, further updated by Ram to exclude certain prop1 values. 20110523*/ if (!!window.s_hp_recom && s_hp_recom === true) { if (!hpmmd.product.precID) { s.prop1 = window.s_prop1 || s.prop1; s.eVar51 = "D=c1"; _setifnull(s, "products", window.s_products || s.products); s.eVar27 = window.s_eVar27 || s.eVar27; if (/^recom:[u|d][k|e]_[e|d][n|e]_[A|B]\|H\|$/.test(s.prop1)) { s.prop1 = ""; s.eVar51 = ""; s.eVar27 = ""; } } } /* End of Product Recommendation Code */ /* Used for product OID tracking */ if (hpmmd.page.oid) { s.prop35 = _set(cl + ":" + hpmmd.page.oid.join("|")); } /* Personalization Pilot - 2011-09-27 */ if (hpmmd.user.personalization_pilot) { s.eVar52 = _set(hpmmd.user.personalization_pilot); } /*Recommendations click & Recommendation Impressions logic 06/30/2014*/ if(!!hpmmd.sw_vars && !!hpmmd.sw_vars.baseAsset){ s.eVar51 = hpmmd.sw_vars.baseAsset; } if(document.cookie.indexOf("lookbookAB20150304")!=-1 && hpmmd.ck.get('lookbookAB20150304')!=""){ s.eVar27 = _set("Lookbook AB test"+":"+hpmmd.ck.get('lookbookAB20150304')); } /*Page Content call 3/3/2015*/ if(!!hpmmd.sw_vars && !!hpmmd.sw_vars.content_string){ s.eVar31=_set(hpmmd.sw_vars.content_string); } if(!!hpmmd.sw_vars && !!hpmmd.sw_vars.gsc_content_string){ s.eVar32=_set(hpmmd.sw_vars.gsc_content_string); } if(!!hpmmd.sw_vars && !!hpmmd.sw_vars.content_list3){ s.list3=hpmmd.sw_vars.content_list3; } if(!!hpmmd.gQuery("gclid")){ s.eVar54 = _set(hpmmd.gQuery("gclid")); } if(s.prop13.indexOf('hpcstsg')!=-1){ s.pageURL=window.location.href; } s.eVar75 = _set(hpmmd.page.previous_page || null); (function doBlueKai(cc, pn, ev) { /* if(navigator.userAgent.indexOf("MSIE ")!=-1) { return; } Don't execute on IE browsers */ var inflag = true, pageNamefilters = [(/cs:gw:.+:home.*/), (/gw\:.+welcome.*/)]; var isssl = (window.location.protocol.indexOf("https") != -1 ? true : false); var urlFilters = [(/\/webapp\/shopping\/cart_detail\.do/)]; for (i = pageNamefilters.length - 1; i >= 0; i--) { if (!!pageNamefilters[i].exec(pn)) { inflag = false; } } for (i = urlFilters.length - 1; i >= 0; i--) { if (!!urlFilters[i].exec(window.location.href)) { inflag = false; } } if (ev.indexOf("sc") != -1 || ev.indexOf("purchase") != -1) { inflag = false; } /* if(!isssl&&inflag&&cc=="us") { // Include Bluekai across all CS Pages s_hp_includeJavaScriptFile("//www.hp.com/cma/ng/lib/bluekai/hpbluekai.js"); } */ })(pg.country || "", s.pageName || "", s.events || ""); /* Harris Survey */ if (typeof (hpmmd.user.harris_survey_id) != "undefined") { s.prop1 = _set(hpmmd.user.harris_survey_id); s.prop3 = _set(hpmmd.page.template_name); s.prop5 = _set(hpmmd.page.template_name + "|" + ch + ":" + cl + ":" + spn); } /* 2012-01-04 Personalization Code for Fred Hopper */ var a = hpmmd.personalization; if (a) { i = 0; s.prop1 = _set(a.impression); s.eVar51 = "D=c1"; for (i = 0; i < a.products.length; i++) { a.products[i] = ";" + a.products[i]; } s.products = a.products.join(","); s.eVar27 = _set(a.abflag); } /* ESupport specific logic & assignments */ if (hpmmd.link) { s.eVar73 = _set(hpmmd.link.ces_link_type); s.eVar74 = _set(hpmmd.link.ces_link_type2); } s.prop27 = _set(hpmmd.page.cesPage); if (hpmmd.page.section === 'ces') {// CES overrides s.products = window.s_products || null; if (!!s.products && s.products.length > 0) { s.events = (s.events || "") + ",event5"; } } /*opt in / opt out value*/ var opt_stat = hpmmd.ck.get("h_opt-status"); if (!!opt_stat && opt_stat.length > 1) { opt_stat = unescape(opt_stat + ""); var cnty = (metatags.target_country) ? metatags.target_country : ""; s.eVar67 = _set(cnty + ":" + opt_stat); } /*personalized links next page clicks*/ var pPrvClk = hpmmd.ck.get("h_personalization"); if (!!pPrvClk && pPrvClk.length > 1) { pPrvClk = unescape(pPrvClk + ""); s.eVar52 = _set(pPrvClk); s.events = sStackPush("event59", s.events); hpmmd.ck.set("h_personalization", "", -1); } /* personalization tracking - 2012-04-10 */ try { if (hpmmd.personalizeTrack) { s.eVar52 = _set(hpmmd.personalizeTrack.id); s.events = sStackPush("event59", s.events); hpmmd.personalizeTrack.id = ""; } } catch (e) { } /*personalized links download clicks*/ try { if (!!hpmmd.personalDL) { s.eVar52 = _set(hpmmd.personalDL); s.events = sStackPush("event59", s.events); if (!!hpmmd.beacon.override.linkTrackVars && !!hpmmd.beacon.override.linkTrackEvents) { hpmmd.beacon.attributes.personalization = false; } hpmmd.personalDL = ""; } } catch (e) { } (function () { var subsection = hpmmd.page.subsection, analytics_section = metatags.analytics_section, analytics_template = metatags.analytics_template; if (!!analytics_section) { subsection = analytics_section + (analytics_template ? ":" + analytics_template : ""); } s.prop25 = _set(hpmmd.page.subsection || subsection); })(); if (!!hpmmd.page.reseller_name && !s.eVar73) { s.eVar73 = _set(hpmmd.page.reseller_name); } (function () { var dimid = s_hp_getQueryParam("dimid"), dicid = s_hp_getQueryParam("dicid"); if (!!dimid && dimid.length > 2) { s.eVar10 = _set(dimid + (!!dicid && dicid.length > 2 ? "|" + dicid : "")); hpmmd.ck.set("EMID", dimid, 90); s.prop24 = "D=\"cs:" + dimid + "|\"+pageName"; } })(); (function () { function clearClickTrackingCookies() { var expires = new Date("Thu, 01 Jan 1970 00:00:00 GMT"); s.c_w("h_inavclk", "-", expires); s.c_w("h_cm", "-", expires); s.c_w("h_cm2", "-", expires); } function setSegmentCK() { var expires = new Date(), seg_tag = (document.getElementsByName('segment').length > 0)?document.getElementsByName('segment')[0].getAttribute('content'):null, cookie_name=""; expires.setTime(expires.getTime() + (30 * 24 * 60 * 60 * 1000)); //30 days if (!!seg_tag) { seg_tag=seg_tag.toLowerCase().replace(/^\s+|\s+$/g, ''); //Homepage use case, don't write the cookie unless it doesn't exist, if it exists don't write it again. if (seg_tag != "segment neutral" || s.c_r("hp_last_segment") === "") { switch (seg_tag) { case "smb": case "commercial.smb": cookie_name="commercial.smb"; break; case "hho": case "consumer.home": case "commercial.hho": case "consumer": case "consumer-public": cookie_name="consumer.home"; break; case "commercial.b2b": case "leb": case "large": case "commercial": case "commercial.large": var sub_bu=""; if(document.getElementsByName('sub_bu').length>0){ sub_bu="."+document.getElementsByName('sub_bu')[0].getAttribute('content').toLowerCase(); } else if(typeof(hpmmd)==="object"){ sub_bu=(!!hpmmd.page.sub_business_unit)?"."+hpmmd.page.sub_business_unit:""; } cookie_name="commercial.large"+sub_bu; break; case "ghe": case "commercial.pubsector": cookie_name="commercial.pubsector"; break; case "ga": case "commercial.ga": cookie_name="commercial.ga"; break; case "segment neutral": case "any": case "neutral": case "segment-neutral": case "products": if(!!!s.c_r("hp_last_segment")){ cookie_name="segment neutral"; } else{ cookie_name=s.c_r("hp_last_segment"); } break; case "partner": case "partners": cookie_name="partners"; break; case "corporate": if (s.c_r("hp_last_segment") === "segment neutral" || s.c_r("hp_last_segment") === "" || s.c_r("hp_last_segment") == "any") { cookie_name="corporate"; } break; default: if (seg_tag == "consumer.home" || seg_tag == "commercial.smb" || seg_tag=="commercial.large" || seg_tag=="commercial.pubsector" || seg_tag=="commercial.ga" || seg_tag=="partners" || seg_tag=="segment neutral"){ cookie_name=seg_tag; } break; } if(!!cookie_name){ document.cookie = "hp_last_segment="+cookie_name+";expires=" + expires.toGMTString() + "; domain=.hp.com;path=/"; } } } else { //Segment metatag is not defined var smt; if(document.getElementsByName('segment').length === 0){ smt = document.createElement("meta"); smt.setAttribute("name", "segment"); document.getElementsByTagName("head")[0].appendChild(smt); }else{ smt = document.getElementsByName("segment")[0]; } if (/(shopping|store).hp.com/.test(window.location.href)) { cookie_name="consumer.home"; smt.setAttribute("content", "consumer.home"); } else if (/shopping\d?.hp.com/.test(window.location.href)) { cookie_name="commercial.smb"; smt.setAttribute("content", "commercial.smb"); } else { //Set segment neutral cookie only if cookie value is undefined or cookie doesn't exist. if (s.c_r("hp_last_segment") === "") cookie_name="segment neutral"; smt.setAttribute("content", "segment neutral"); } // document.head.appendChild(smt); document.cookie = "hp_last_segment="+cookie_name+";expires=" + expires.toGMTString() + "; domain=.hp.com;path=/"; } document.cookie = "hp_cust_seg_sel=-;expires=" + new Date("Thu, 01 Jan 1970 00:00:00 GMT") + "; domain=.hp.com;path=/"; } var inavcookieValue = s.c_r("h_inavclk"), legacyeVar13 = s.c_r("h_cm") || s.c_r("h_cm2"), metatags = hpmmd.metatags || {}, _setValue = (typeof(_set) == "function" ? _set : function (x) { return x }), country = hpmmd.page.country || metatags.target_country || "us", language = hpmmd.page.language || metatags.language || "en"; if (!!window.jsmd) { metatags = jsmd.mdata.metatags; } else if (typeof(window.dictionary) !== "undefined") { metatags = dictionary.get("metatags"); } if (!!inavcookieValue && inavcookieValue !== "-") { s.eVar68 = unescape(inavcookieValue); s.prop68 = "D=v68"; s.events = ( !!s.events ? s.events + ",event69" : "event69"); if (inavcookieValue.indexOf("home:") == 0) { s.eVar13 = country + ":" + language + ":" + inavcookieValue.replace("home:", ""); // s.eVar68 = s.eVar68.replace("home:",""); } clearClickTrackingCookies(); } else if (!!legacyeVar13) { s.eVar13 = unescape(legacyeVar13); clearClickTrackingCookies(); } s.prop51 = s.prop51 + ":" + (metatags.hp_inav_version || "hflegacy"); s.prop73 = s.getPreviousValue(s.pageName, "s_prevPage"); s.eVar69 = "D=c73"; var setProp21 = function(){ var seg = s.c_r("hp_last_segment") || ""; seg = (seg.length > 0 ? seg.toLowerCase() : "noseg"); s.prop21 = 'D="cs:' + seg ; }; if (typeof(_mbootstrap) === "object") { _mbootstrap.checkCaas.ready(setSegmentCK); _mbootstrap.checkCaas.ready(setProp21); } else{ setSegmentCK(); setProp21(); } })(); (function () { var product_service_name = hpmmd.page.product_service_name || metatags.product_service_name; if (!!product_service_name) { var listProducts = product_service_name.split("/"), lastProduct = listProducts[listProducts.length - 1]; if (lastProduct.length > 5) { s.pageName = s.pageName + ":" + lastProduct; } } })(); (function (w, s) { function readCookie(c) { var unescape = (typeof(unescape) == "function" ? unescape : decodeURIComponent), r = new RegExp(c + "\\=([^\\;]+)"), found = r.exec(document.cookie); return found ? unescape(found[1]) : null } var numberOfCheckTimes = 2; function latentFindBluekaiId() { if (--numberOfCheckTimes <= 0) { return; } if (!!w._bluekai_guid) { try { document.cookie = "bkguid=" + w._bluekai_guid + ";domain=.hp.com;path=/"; } catch (e) { } } else { setTimeout(latentFindBluekaiId, 5000); } } var bluekaiId = w._bluekai_guid || readCookie("bkguid"); if (!!bluekaiId) { s.prop71 = "bkguid:" + unescape(bluekaiId); } else { setTimeout(latentFindBluekaiId, 2000); } })(window, s); hpmmd.user.bluekai_id = s.prop71; if (!!hpmmd.abmvt) { s.eVar27 = hpmmd.abmvt.recipe; s.events = sStackPush(events["Optimost Test Trigger"], s.events); } if(!!hpmmd.user_profile_type){ s.eVar57 = hpmmd.user_profile_type; } if (!!hpmmd.debug) { s.prop70 = hpmmd.debug.prop70; } if (typeof window.s_currencyCode != "undefined") {//Check for s_CurrencyCode existance and assign to s.currencyCode variable s.currencyCode = window.s_currencyCode; } } function s_hp_personalContentConfig(s) { s_hp_basicOmniConfig(s); s.events = "event1"; s.products = hpmmd.personalCont; hpmmd.personalCont = ""; } /*PersonalizationA-B*/ function s_hp_personalAB(s) { s_hp_basicOmniConfig(s); s.eVar26 = hpmmd.pAB; } function s_hp_basicDatapassConfig(s) { s_hp_commonConfig(s); if (hpmmd.page.events[0] == "Track Open Banner Impression") { s.events = sStackPush("event1", s.events); s.eVar1 = _set(hpmmd.promo.internal); } if (hpmmd.page.events[0] == "Track Closed Banner Impression") { var implist = hpmmd.promo.impressions, i; s.events = sStackPush("event9", s.events); s.products = ""; for (i = 0; i < implist.length; i++) { s.products += ";" + implist[i] + ","; } s.products.substring(0, s.products.length - 1); } } function s_hp_searchOmniConfig(s) { /* Traffic */ s.prop14 = _set(hpmmd.page.sort); s.prop15 = _set(hpmmd.page.refine_path); s.prop16 = _set(hpmmd.page.result_set); s.prop17 = _set(hpmmd.page.numchosen); s.prop18 = _set(hpmmd.page.search_platform); s.prop19 = _set(hpmmd.page.numrecords); s.prop20 = _set(hpmmd.page.numrefine); s.prop21 = _set(hpmmd.page.active_correct); s.prop22 = _set(hpmmd.page.passive_correct); /* Commerce */ s.eVar15 = _set(hpmmd.page.refine_path); s.eVar16 = _set(hpmmd.page.result_set); s.eVar17 = _set(hpmmd.page.numchosen); s.eVar18 = _set(hpmmd.page.search_platform); s.eVar19 = _set(hpmmd.page.numrecords); s.eVar20 = _set(hpmmd.page.numrefine); s.eVar21 = _set(hpmmd.page.active_correct); s.eVar22 = _set(hpmmd.page.passive_correct); if (hpmmd.page.numrecords === 0 || hpmmd.page.numrecords === "0") { s.eVar25 = _set(hpmmd.page.search_term); } s_hp_basicOmniConfig(s); } function s_hp_basicGAConfig(s) { /* GA basic Mapping */ } function s_manage_overrides(s) { /* Temporary until more dynamic mapping worked out. */ var fg = false; if (!!hpmmd.beacon.override.linkTrackVars) { s.linkTrackVars = hpmmd.beacon.override.linkTrackVars; try { if (hpmmd.beacon.attributes.personalization === "true") { s.linkTrackVars += ",eVar52"; fg = true; } } catch (e) { } } if (!!hpmmd.beacon.override.linkTrackEvents) { s.linkTrackEvents = hpmmd.beacon.override.linkTrackEvents; try { if (hpmmd.beacon.attributes.personalization === "true") { s.linkTrackEvents += ",event59"; fg = true; } } catch (e) { } } if (fg) { hpmmd.beacon.attributes.personalization = false; } } function _prv_checkValidUserAgents() { var ua = navigator.userAgent.toLowerCase(); if (ua.indexOf("gomezagent") != -1 || ua.indexOf("catchpoint") != -1) return false; return true; } function s_hp_initTagLogic() { if (window.hpmmd) { if (!hpmmd.product.list) { hpmmd.product.list = []; } if (!hpmmd.search) { hpmmd.search = { internal: {}, external: {} }; } /* hpmmd.state="domready"; */ if (!_prv_checkValidUserAgents()) { return false; } hpmmd.user.usersegment = _prv_getIPSegment(hpmmd.user.ip); /* hpmmd.ck={"get":function(k){var c=' '+document.cookie,s=c.indexOf(' '+k +'='),e=s<0?s:c.indexOf(';',s),v=s<0?'':c.substring(s+2 +k.length,e<0?c.length:e);return v}, "set":function(k,v,e){var exp=new Date((new Date().getTime())+e*86400000); document.cookie=k+"="+escape(v)+ (e!=null?"; expires="+exp.toGMTString():"") +"; path=/; domain=.hp.com"; return v;}, "setraw":function(k,v,e){var exp=new Date((new Date().getTime())+e*86400000); document.cookie=k+"="+v+ (e!=null?"; expires="+exp.toGMTString():"") +"; path=/; domain=.hp.com"; return v;} }; hpmmd.gQuery=function(param,url){var b,m,l,k,j,i,h,g,f,e,d,c;b=(url!=null?url:window.location.href);b=b.split('?');m=b.length;if(m>1){for(l=0;l 0) { if (currPageName.toString().length > 15) { currPageName = currPageName.substr(currPageName.length - 15); } var links = document.getElementsByTagName('a'); var currPageNameConst = 'current-pagename-15chars'; for (i = 0; i < links.length; ++i) { if (links[i].attributes.onclick) { var onClickStr = links[i].attributes.onclick.value; if (onClickStr.indexOf(currPageNameConst, 0) >= 0) { links[i].attributes.onclick.value = ''; //The attribute is deleted before adding the new Event, for it not to be called twice var newOnClickStr = onClickStr.replace(currPageNameConst, currPageName).replace('catch()', 'catch(err)'); /*jshint evil:true */ $(links[i]).addEvent('click', new Function(newOnClickStr)); /*jshint evil:false */ } } } } else { /* throw ( { message : "The page has an empty page title tag" }); */ } } else { /* throw ( { message : "The page doesn't have defined a page title tag" }); */ } } catch (e) { hpmmd.log.warn("Issue with s_hp_addPageTitleToMetricsCode" + JSON.stringify(e)); } } function s_hp_doGeoRedirectCheck(s, pn, sec) { var check_geoLo = hpmmd.ck.get('geoLocation'); //_Ck_.get('geoLocation'); var dbg_geo = hpmmd.ck.get('geoLocationDBG'); var us_cookie = hpmmd.ck.get('lang'); //_Ck_.get('lang'); var rexp = /^([a-z])([a-z])-(([a-z])+(_)?)*([a-z]+)$/i; if (check_geoLo == 'redirection') { if (us_cookie.match(rexp)) { if (!!us_cookie.split("-")[1]) { if (us_cookie != 'en-us') { if (sec == "cs:gw" && pn.indexOf(":home") > -1) { s.eVar24 = _set((dbg_geo.length > 0 ? "GeoRedirectDBG: " + pn + " " + unescape(dbg_geo) : "GeoRedirect: " + pn)); s.prop24 = s.eVar24; hpmmd.ck.set('geoLocation', 'i', -1); hpmmd.ck.set('geoLocationDBG', 'i', -1); } } } } } } /* function _doOrAddLoad(f) { function _addLoadEvent(func) { if (window.addEventListener) // W3C standard { window.addEventListener('load', func, false); } else if (window.attachEvent) // MS Browsers { window.attachEvent('onload', func); } else { if(typeof(window.onload)=="function") { var old = window.onload; window.onload = function() { old(); func(); }; } else { window.onload=func; } } } if(document && document.getElementById && document.getElementsByTagName && document.body && document.head) { try {f();} catch(e){} } else { _addLoadEvent(f); } } */ /* * Deprecated - using Bluekai */ /* function s_doAdditionalBeacons(rsid,option) { var _wd=window.document,isSSL=window.location.protocol.indexOf("https")!=-1; var isPotentialRetargetPage=(!isSSL&&rsid.indexOf("hphqnahpshopping")==-1&&(rsid.indexOf("hphqna")!=-1||rsid.indexOf("hphqwwcesna")!=-1||rsid.indexOf("hphq-ces-na")!=-1||rsid.indexOf("hpcorpsprint1")!=-1)); if(!isPotentialRetargetPage) {return;} function _prvDoDC(dctype,src,type,cat,ord,qty,cost) { var axel = Math.random()+""; var num= axel * 10000000000000; _wd = window.document; var hp_ssl=(window.location.protocol.toLowerCase().indexOf('https')!=-1); var url = "http://fls.doubleclick.net"; if(hp_ssl==true) { url="https://fls.doubleclick.net"; } switch(dctype) { case 1: url+="/activityi;src="+src+";type="+type+";cat="+cat+";ord="+ord+";num="+num+ "?"; break; case 2: url+="/activityi;src="+src+";type="+type+";cat="+cat+";;qty="+qty+";cost="+cost+";ord="+num+ "?"; break; case 3: url+="/activityi;src="+src+";type="+type+";cat="+cat+";ord="+num+";num="+num+ "?"; break; // unique tag - don't use unless you have to case 4: url+="/activityi;src="+src+";type="+type+";cat="+cat+";ord="+num+"?"; break; // unique tag - don't use unless you have to } return url; } function _doInsertBeacon(payload) { if(_wd.getElementById) { var target=_wd.getElementById("retarget_zone"),p=_wd.createElement("p"); if(target == null) { var target = document.createElement('div'); target.setAttribute("id","retarget_zone"); target.style.border = '0px'; target.style.width = '0px'; target.style.height = '0px'; _wd.body.appendChild(target); } if(payload.indexOf("/activityi;src")!=-1) { // DC iFrame var sifr=_wd.getElementById("hpdc"); if(sifr == null) { var sifr = document.createElement('IFRAME'); sifr.setAttribute("id","hpdc"); sifr.style.border = '0px'; sifr.style.width = '0px'; sifr.style.height = '0px'; sifr.src=payload; target.appendChild(sifr); } else { sifr.src=payload; } } else { p.innerHTML=payload; target.appendChild(p); } } } var index={ "DCHHO": _prvDoDC(1,"2305757","hpcom559","hpcom619","1"), "DCOther": _prvDoDC(1,"2964791","hpcom779","hpcom893","1"), "RightMedia": "", "DCAdExchange":"\"\"", "TurnAccuen":"" }; if(isPotentialRetargetPage) { if(option!=1) { // Complex _domReady.ready(function(){ for(var i in index) { _doInsertBeacon(index[i]); } }); } else { // Simplified _domReady.ready(function(){ _doInsertBeacon(index["DCHHO"]); }); } } } */ function s_beacon_plugins() { return { "none": function () { }, "omni": function () { var b = window.hpmmd.beacon.jobs; for (var i = b.length - 1; i > -1; i--) { if (b[i][0] == "omni") { var s = s_gi(b[i][1]); if (!!hpmmd.inherit) { for (var j = 0; j < 75; j++) { var eVar = "eVar" + j, prop = "prop" + j; if (!!hpmmd.inherit[eVar]) { s[eVar] = hpmmd.inherit[eVar]; } if (!!hpmmd.inherit[prop]) { s[prop] = hpmmd.inherit[prop]; } } s.pageName = hpmmd.inherit.pageName; s.products = hpmmd.inherit.products; s.events = hpmmd.inherit.events; s.channel = hpmmd.inherit.channel; s.server = hpmmd.inherit.server; s.campaign = hpmmd.campaign; //AOID ENABLEMENT RALLY US20 } var load_plugins = hpmmd.omniture.load_plugins; if (typeof (load_plugins) == "function") { load_plugins(s); } if (typeof (hpmmd.omniture.do_once) == "function") { hpmmd.omniture.do_once(s); } hpmmd.omniture = { object: s, load_plugins: load_plugins }; /* Check for search clickthrough */ if (s_hp_getQueryParam("search_result_type") !== "") hpmmd.page.events.push("Internal Search Clickthrough"); b[i][2](s); // Configure & Map Variables s_manage_overrides(s); s.pageName = s.pageName.replace(/(3\.0[\:\/])+/, "3.0:"); s.pageName = s.pageName.replace(/([\/\\])+/ig, "$1"); s.pageName = s.pageName.replace(/([\:\;])+/ig, "$1"); s.pageName = s.pageName.replace(/:SSS\s?-?\sSoftware\s?2.0\s?-?\s?Detail\s?-?\sSoftware[:|\/]/gi,":2.0:"); if (!!s.pageName && s.pageName.length > 100) { s.pageName = s.pageName.substr(0, 99) + "~"; } if (!!s.eVar55 && s.eVar55.length > 254) { s.eVar55 = _set(s.eVar55.substr(0, 253) + "~"); } var t = hpmmd.beacon.attributes.type; var n = hpmmd.beacon.attributes.name; var pc = hpmmd.metatags.page_content; n = _set(n || hpmmd.beacon.attributes.id); s.p = ""; /*jshint loopfunc:true */ var doRound = function (tstart, tend) { var tmp = (tend - tstart) / 1000.0; if (tmp < 2) { tmp = Math.round(tmp * 10) / 10; } else { tmp = Math.round(tmp); } return (tmp === 0 ? "<0.1" : tmp); }; /*jshint loopfunc:false */ // s.prop60 = "n/a or link"; /* if (hpmmd.timer.start) { // s.prop60 = _set(hpmmd.timer.condition + ":" + doRound(hpmmd.timer.start, (new Date()).getTime())); if (hpmmd.timer.finished) { // s.prop60 = _set(hpmmd.timer.condition + ":" + "start->pixel-end:" + doRound(hpmmd.timer.start, hpmmd.timer.finished)); } if (hpmmd.timer.dom) { // s.prop60 += "|start->dom:" + doRound(hpmmd.timer.start, hpmmd.timer.dom); } if (hpmmd.timer.load) { // s.prop60 += "|dom->load:" + doRound(hpmmd.timer.dom, hpmmd.timer.load); } } */ /* if(b[i][1].indexOf("hphqwwesg")===-1&&b[i][1].indexOf("hpcstsg")===-1) { */ if (b[i][1].indexOf("hphqemeaov2banners") !== -1) { s.products = (s.products || "").toLowerCase(); s.trackInlineStats = false; } if (b[i][1].indexOf("hpcsimpressions") !== -1) { s.trackInlineStats = false; } if (!!s.linkTrackVars) { s.linkTrackVars = s.linkTrackVars + ",prop73"; } (function () { // Exception case: supress eVar55 & event4 on conditons when a video page view is called // Approved 8 Nov 2013 Deepak Bahree, John Lee. if (!!s.pageName && s.pageName.indexOf("cs:video:") == 0) { s.eVar55 = ""; if (!!s.events) { s.events = s.events.replace(/event4\,?/, ""); } } })(); if (!(!!hpmmd.beacon_ignore)) { switch (!!t ? t.toLowerCase() : "") { case "exit": s_code = s.tl(this, 'e', n); break; case "download": s_code = s.tl(this, 'd', n); break; case "link": case "custom": case "datapass": s_code = s.tl(this, 'o', n); break; case "personal_links": // s.prop60 = ""; s_code = s.t(); break; case "none": break; default: if (pc === "error_page" || pc === "error") { s.pageType = "errorPage"; s.pageName = ""; } else { s.events = sStackPush("event4", s.events); } s_code = s.t(); } } /** * User: Matt Wright * Date: 7/31/13 * Time: 10:23 PM */ function waitForChangedBeacon() { var beaconURL = window["s_i_" + s.visitorNamespace], pageURL = window.location.href, tmpStorageString = localStorage["omnibeacon"]||"", tmpStorage = JSON.parse(tmpStorageString||"{}"); if (!!beaconURL) { if(!tmpStorage[pageURL]) { tmpStorage[pageURL]=[]; } if (tmpStorage[pageURL].contains(beaconURL.src)) { setTimeout(waitForChangedBeacon, 200); } else { tmpStorage[pageURL].push(beaconURL.src); localStorage["omnibeacon"] = JSON.stringify(tmpStorage); } } else { setTimeout(waitForChangedBeacon, 200); } } if (typeof(Array.prototype.contains) == "function" && typeof(localStorage) !== "undefined" && window.location.search.indexOf("hpanalytics") !== -1 && "s_i_" + s.visitorNamespace == "s_i_hpcorp") { setTimeout(waitForChangedBeacon, 100); } hpmmd.beacon.lastsent = (new Date()).getTime(); hpmmd.omniture.events = s.events; /* if(s_code) document.write(s_code); */ b[i][3]++; b[i][0] = "omni:complete"; s.products = null; s.events = null; s.eVar68 = null; /* s.prop73 = s.pageName; */ hpmmd.page.events = []; hpmmd.product.list = []; hpmmd.promo = {}; // Reset promotion containers /* hpmmd.timer={}; */ // hpmmd.timer.finished = (new Date()).getTime(); } } } }; } /* End Pack Section */ function s_hp_includeJavaScriptFile(hp_path, flag) { var wl = window.location, wlh = wl.hostname, hn = "http://www.hp.com", shn = "https://www.hp.com", d = document, hp = hp_path, ssl = (wl.protocol.toLowerCase().indexOf('https') != -1), urlre = /^(http[s]?\:\/\/[^\/]+)(\/?.*)$/; if (wlh.indexOf("welcome.") != -1) { hn = "http://welcome.hp-ww.com"; shn = "https://secure.hp-ww.com"; } if (urlre.test(hp)) { hp = ( ssl ? hp.replace(urlre, shn + "$2") : hp.replace(urlre, hn + "$2")); } if (typeof (flag) !== "undefined") { hp = hpmmd.stage.addSuffix(hp); } /*jshint evil:true */ _domReady.ready(new Function("_domReady.inject('" + hp + "');")); /*jshint evil:false */ // EVal required to ensure IE 6 compat } function g_hp_newLinkType() { var sec = hpmmd.page.section + "", v = "link", pcont = hpmmd.metatags.page_content + ""; sec = sec.toLowerCase(); pcont = pcont.toLowerCase(); if (sec == "product registration:prodsearch" || pcont == "register_search" || pcont == "register_login") { v = "none"; } return v; } /* Empty legacy function calls */ function s_sendAnalyticsEvent(addlAccount, pageName) { trackMetrics("genericLegacyPage", { name: pageName }); } function s_sendCustomLinkEvent(addlAccount, linkName) { trackMetrics("genericLegacyLink", { name: linkName, type: "link" }); } function s_sendDownloadLinkEvent(addlAccount, linkName) { trackMetrics("genericLegacyLink", { name: linkName, type: "download" }); } function s_sendExitLinkEvent(addlAccount, linkName) { trackMetrics("genericLegacyLink", { name: linkName, type: "exit" }); } /* Warning - this code is common across Atlas, Cleansheet, and Legacy platforms. * Do *NOT* modify unless you know what you're doing */ function s_hp_jumpIdProcessing(s) { var hpmmd = (window.jsmd ? jsmd.plugin : window.hpmmd || {ck: {}}), cookieBaseObject = hpmmd.ck || hpmmd.cookie || {}, cookieSet = cookieBaseObject.set || s_vp_setPersistentCookieExact, cookieGet = cookieBaseObject.get || function (x) { s.c_r(x); }, getQueryParam = hpmmd.gQuery ? function (x) { return hpmmd.gQuery(x); } : function (x) { return s.getQueryParam(x); }; // var s_hp_jumpid_mixedcase = false; // var h_um = window.location.href; window.s_setJumpid = function (jumpid) { cookieSet("hpjumpidv2", jumpid, 30); }; /* var kwcid = cookieGet("s_kwcid").split("\"").join(""); if (!!kwcid && kwcid.length > 0) { cookieSet("s_kwcid", "i", -1); if (h_um.indexOf("s_kwcid=") == -1) { h_um = (h_um.indexOf("?") != -1) ? h_um.split("?").join("?s_kwcid=" + kwcid + "&") : h_um + "?s_kwcid=" + kwcid; } } */ /* Kenshoo Logic: 3/21/2011 */ s.eVar54 = getQueryParam("k_clickid") || ""; /* End Kenshoo Logic */ /*AOID ENABLEMENT, RALLY US20: READ AOID QUERYSTRING CODE AND ASSIGN IT TO HPMMD CAMPAIGN VARIABLE, TO LATER PASS IT TO THE S OBJECT ON CLEANSHEET_WEB s_beacon_plugins function, otherwise if passed directly to S object it will be overriden in the load_plugins(s) function for homepage */ var aoid = getQueryParam("aoid") || ""; if (aoid.length > 0 && !(hpmmd.campaign != null && hpmmd.campaign.length > 0)) { s.campaign = hpmmd.campaign = aoid; } /*hootpostid mapping to eVar29*/ var hootpostid=getQueryParam("hootpostid") || ""; if(hootpostid!=""){ s.eVar29=hootpostid; } /*mailzqj mapping to eVar20*/ var mailzqj = getQueryParam("mailzqj") || ""; if(mailzqj!="" && mailzqj.length<11){ s.eVar20=_set(mailzqj); } var jumpid = getQueryParam("jumpid") || "", jumpidc = cookieGet("hpjumpidv2") || cookieGet("atlasjumpid"); if (!!jumpidc && (jumpid.length < 3 || jumpid.indexOf("in_") === 0)) { // Use Jumpid Cookie if it's already defined - otehrwise use existing jumpid jumpidc = jumpidc.split("\"").join(""); cookieSet("hpjumpidv2", "i", -1); // Reset the jumpid cookie to expire with no value cookieSet("atlasjumpid", "i", -1); // Reset the jumpid cookie to expire with no value jumpid = jumpidc.length > 3 ? jumpidc : jumpid; } // if (jumpid.indexOf("TC") === 0) { // s_hp_jumpid_mixedcase = true; // /* Temp fix: rename jumpid in Omniture URL to jumpid_t ONLY IF it's not a TC parameter */ // if (h_um.indexOf("jumpid=") == -1) { // h_um = (h_um.indexOf("?") != -1) ? h_um.split("?").join("?jumpid=" + jumpid + "&") : h_um + "?jumpid=" + jumpid; // } // /* End of Temp Fix: */ // } /* else { h_um=h_um.split("jumpid=").join("jumpid_t="); // Swap the jumpid for jumpid_t since Search Center will look at all jumpid values in the URL - // Remove this once we fix teh HP software issues with not persisting the search center s_kwcid parameter } */ // s.pageURL = h_um; // Remove this once we fix teh HP software issues with not persisting the search center s_kwcid parameter // h_um = (window.location.href.indexOf("<") != -1) ? escape(window.location.href.substring(0, 100).toLowerCase()) : window.location.href.toLowerCase(); // No cross-site scripting attempts /* if (!s_hp_jumpid_mixedcase) { */ jumpid = jumpid.toLowerCase(); /* } */ /* Remove pound sign on improperly formed Jumpid pages */ jumpid = jumpid.split("#")[0]; /* * Check to see if the previous jumpid is identicial to the current jumpid. If not, then */ var prevJumpid = s.getPreviousValue(jumpid || "-", "ddj"); s.eVar15 = s.eVar16 = s.eVar17 = s.eVar18 = s.eVar19 = ""; if (jumpid.length > 3 && prevJumpid !== jumpid) { jumpid = (jumpid.indexOf("<") != -1) ? escape(jumpid) : jumpid; // No cross-site scripting attempts if (window.s_hp_doFilterJumpids) { jumpid = s_hp_doFilterJumpids(jumpid); } // Call custom jumpid filter function if it exists var s_jumpIdType = jumpid.substring(0, 3); if (typeof RegExp != "undefined") { // Pull MCC code from the Jumpid, if defined var getMCC = /mcc\|([A-Za-z0-9]+)/i; if (getMCC.test(jumpid)) { r = getMCC.exec(jumpid); if (r.length > 0) { s.eVar9 = "||" + r[1]; } } } // var loc = "15"; /*DART logic filter for evar 15 starts*/ var strip_jumpid = jumpid; var isDart = jumpid.indexOf("dm:") !=-1; var isSf= jumpid.indexOf("sf:")!= -1; if (isDart) { strip_jumpid = jumpid.split("/dm:")[0]; } if(isSf){ strip_jumpid = jumpid.split("/sf:")[0]; } /* var reg = /dm:[^\/]*[^\/]?/gi; var dart_jumpid = reg.exec(jumpid); if (isDart) { var sub_jmpids = jumpid.split("/dm:"); var strip_index = sub_jmpids.indexOf(dart_jumpid[0]) sub_jmpids.splice(strip_index, 1); strip_jumpid = sub_jmpids.join("/"); } else { strip_jumpid = jumpid; } */ /*DART LOGIC filter evar 15 ends*/ switch (s_jumpIdType) { case 'ps_': case 'va_': case 'af_': case 'mb_': case 'sc_': case 'em_': case 'ba_': if(strip_jumpid.length<14 || (!!s.prop5 && s.prop5.indexOf('tsg.software')!=-1) || /(ba_r329_hhoaffiliate|ps_r329_hhosem|ba_r329_hhocse|ba_r329_hhodisplay|sc_r329_hhosocial|em_r329_hho_.*)/gi.test(strip_jumpid)){ s.eVar15 = strip_jumpid; s.eVar17 = jumpid; if(typeof(sStackPush)==="function"){ s.events=sStackPush("event80",s.events); } else{ s.events = ( !!s.events ? s.events + ",event80" : "event80"); } } break; case 'in_': s.eVar16 = jumpid; // loc = "16"; break; case 're_': s.eVar18 = jumpid; // loc = "18"; break; case 'TC|': case 'TC-': s.eVar15 = strip_jumpid; s.eVar17 = jumpid; if(typeof(sStackPush)==="function"){ s.events=sStackPush("event80",s.events); } else{ s.events = ( !!s.events ? s.events + ",event80" : "event80"); } break; case 'sh_': s.eVar15 = strip_jumpid; s.eVar17 = jumpid; if(typeof(sStackPush)==="function"){ s.events=sStackPush("event80",s.events); } else{ s.events = ( !!s.events ? s.events + ",event80" : "event80"); } if (!document.referrer) { ( function () { var a = jumpid, b = []; b = a.split("_"); if (b.length > 2 && b[2]) { s.referrer = "http://" + b[2] + ".com"; } }()); } break; case 'cp_': s.eVar18 = jumpid; // loc = "18"; break; default: if (jumpid.indexOf("ex_") !== 0) { s.eVar19 = jumpid; } // loc = "19"; break; } /* s.eVar20="D=v"+loc; */ /* s.prop17 = 'D=v' + loc + '+"|"+c49'; if (hpmmd.page.region === "na" && !s.prop4) { s.prop4 = s.prop17; } */ /* if(s_hp_jumpid_prop && s_hp_jumpid_prop.length>0) { s_hp_jumpid_prop=s_hp_jumpid_prop.split("_").join("."); eval(s_hp_jumpid_prop + "='" + jumpid + "'"); } */ /* if (window.s_hp_doFilterJumpids) { jumpid = s_hp_doFilterJumpids(jumpid); } */ } /* else { // No Jumpid found: set jumpid pathing within NA Region still if (hpmmd.page.region === "na" && !s.prop4 && hpmmd.metatags.lifecycle !== 'support') { s.prop4 = 'D="|"+c49'; } } */ /* if(hpmmd.ck.get("hpjidc").indexOf("37")!=-1) { s.events=sStackPush("event37",s.events); } */ } function _prv_loadMetatags() { /* Purpose of function: * Load all page-level metatags for use in tracking */ // if(!hpmmd.metatags) { // Only collect the metatags if the container is empty hpmmd.metatags = {}; // Initialize container var mt = document.getElementsByTagName("meta"), i, mtt = hpmmd.metatags, pg = hpmmd.page; // Local variables for helpers for (i = mt.length - 1; i >= 0; i--) {// Dump all metatags into the hpmmd object if (mt[i].name.length > 0) { hpmmd.metatags[mt[i].name.toLowerCase()] = (mt[i].content ? mt[i].content.toLowerCase() : ""); } } var l = document.getElementsByTagName("html")[0].lang; // Capture the page's language value from the language attribute /* Metadata Mapping - Assign specific meta tags as metadata values for use by the analytics script */ hpmmd.page.override = { template:mtt.analytics_template_name || null, section:mtt.analytics_section || null, subpage:mtt.analytics_subpage || null }; pg.subpage = mtt.simple_title; pg.sub_business_unit = mtt.sub_bu; pg.country = (!!mtt.target_country ? mtt.target_country : "ERROR"); if(!!mtt.segment){ switch(mtt.segment.toLowerCase().replace(/^\s+|\s+$/g, '')){ case "hho": case "consumer.home": case "commercial.hho": case "consumer": case "consumer-public": mtt.segment = "consumer.home"; break; case "smb": case "commercial.smb": mtt.segment = "commercial.smb"; break; case "leb": case "commercial.large": case "commercial.b2b": case "commercial": case "large": var sub_bu=""; if(document.getElementsByName('sub_bu').length>0){ sub_bu="."+document.getElementsByName('sub_bu')[0].getAttribute('content').toLowerCase(); } else if(typeof(hpmmd)==="object"){ sub_bu=(!!hpmmd.page.sub_business_unit)?"."+hpmmd.page.sub_business_unit:""; } mtt.segment = "commercial.large"+sub_bu; break; case "ga": case "commercial.ga": mtt.segment = "commercial.ga"; break; case "ghe": case "commercial.pubsector": mtt.segment = "commercial.pubsector"; break; case "segment neutral": case "any": case "neutral": case "segment-neutral": case "products": mtt.segment ="segment neutral"; break; case "partner": case "partners": mtt.segment ="partners"; break; case "corporate": mtt.segment ="corporate"; break; case "": mtt.segment ="unspecified segment"; break; default: mtt.segment="undefined segment"; break; } } pg.segment = (!!mtt.segment ? mtt.segment : "unspecified segment"); pg.hp_inav_version = mtt.hp_inav_version || "hf-legacy"; pg.lifecycle = (!!mtt.lifecycle ? mtt.lifecycle : "ERROR"); pg.bu = (!!mtt.bu ? mtt.bu : (!!mtt.business_unit ? mtt.business_unit : "ERROR")); _prv_defRegion(hpmmd.page.country); /* Language Code modifications */ ws = hpmmd.metatags.web_section_id; var ls = l.split("-"), lc = ls[0], lc2 = (ls.length > 1 ? ls[1] : lc); if (hpmmd.page.section == "ces" && (ws == "r11498" || ws == "r4155" || ws == "r11690")) {// Only activate on Wildcat & consumer support forums var test = "ab:aa:af:ak:sq:am:ar:an:hy:as:av:ae:ay:az:bm:ba:eu:be:bn:bh:bi:bs:br:bg:my:ca:ch:ce:ny:zh:cv:kw:co:cr:hr:cs:da:dv:nl:dz:en:eo:et:ee:fo:fj:fi:fr:ff:gl:ka:de:el:gn:gu:ht:ha:he:hz:hi:ho:hu:ia:id:ie:ga:ig:ik:io:is:it:iu:ja:jm:jv:kl:kn:kr:ks:kk:km:ki:rw:ky:kv:kg:ko:ku:kj:la:lb:lg:li:ln:lo:lt:lu:lv:gv:mk:mg:ms:ml:mt:mi:mr:mh:mn:na:nv:nb:nd:ne:ng:nn:no:ii:nr:oc:oj:cu:om:or:os:pa:pi:fa:pl:ps:pt:qu:rm:rn:ro:ru:sa:sc:sd:se:sm:sg:sr:gd:sn:si:sk:sl:so:st:es:su:sw:ss:sv:ta:te:tg:th:ti:bo:tk:tl:tn:to:tr:ts:tt:tw:ty:ug:uk:ur:uz:ve:vi:vo:wa:cy:wo:fy:xh:yi:yo:za:zu:"; if (test.indexOf(lc + ":") == -1) {// Invalid Language code if (test.indexOf(lc2 + ":") == -1) { lc = "en"; // Assume EN if second parameter is invalid } else { lc = lc2; // Use second paramter if it's a valid language code } } } else { lc = l; // All non-support uses the original two character code } hpmmd.metatags.language = lc; var r = (/([^\-]+\-x\-mtfrom\-)?(.+)/), t = r.exec(lc); if (t) { hpmmd.metatags.translate_language = t[2]; } if (!!lc2 && lc2.length == 2) {// Temporary fix for holiday hpmmd.metatags.locale = { language:lc.toLowerCase(), region:lc2.toLowerCase(), full:l.toLowerCase() }; } pg.language = (!!mtt.language ? mtt.language : "ERROR"); } if (!!_domReady && typeof (s_hp_addPageTitleToMetricsCode) !== "undefined") { _domReady.ready(s_hp_addPageTitleToMetricsCode); //} /* if(hpmmd.state=="domready") s_hp_addPageTitleToMetricsCode(); */ } function _prv_defRegion(cc) { if (!!hpmmd.page) { // Classify the region based on country code / lookup var cc1 = (!!cc ? cc.toLowerCase() : "") + ":"; var ap = "au:cn:hk:hk:in:id:jp:kr:my:nz:ph:sg:tw:th:vn:", emea = "emea_africa:at:be:be:by:bg:hr:cz:dk:ee:fi:fr:de:gr:hu:ie:il:it:kz:lv:lt:emea_middle_east:nl:no:pl:pt:ro:ru:rs:sa:sk:si:za:es:se:ch:ch:tr:ua:uk:", na = "us:ca:", la = "ar:bo:br:jm:lamerica_nsc_carib:lamerica_nsc_cnt_amer:cl:co:ec:mx:py:pe:pr:uy:ve:", caemea = "al:am:az:ba:dz:ge:is:ke:ks:ma:md:mk:mt:ng:tn:pk:bd:lk:"; /* Assume US / NA If not already defined */ hpmmd.page.major_region = "ams"; hpmmd.page.region = "na"; hpmmd.page.rs_region = (cc == "us" ? "amerus" : "amerlaca"); hpmmd.legacy.region = "na"; if (na.indexOf(cc1) != -1) { return; } if ((caemea + emea).indexOf(cc1) != -1) {/* Assume EMEA if country is defined */ hpmmd.page.major_region = "emea"; hpmmd.page.region = "emea"; hpmmd.page.rs_region = "emea"; hpmmd.legacy.region = "emea"; return; } if (ap.indexOf(cc1) != -1) {/* Assume APJ if country is defined and matches lookup */ hpmmd.page.major_region = "apj"; hpmmd.page.region = "apj"; hpmmd.page.rs_region = "apj"; hpmmd.legacy.region = "ap"; return; } if (la.indexOf(cc1) != -1) {/* Assume Americas if country is defined */ hpmmd.page.major_region = "ams"; hpmmd.page.region = "la"; hpmmd.page.rs_region = "amerlaca"; hpmmd.legacy.region = "la"; return; } } } if (!!window._mbootstrap) { curlDefine("VideoAnalytics/Core", ["Lodash", "debug/HPLog"], function (_, log) { var hasRunConfiguration = false, s; function commonVideoConfiguration(omniture_object) { if (!hasRunConfiguration) { s = s || omniture_object || window.s; try { if (typeof(s_hp_commonConfig) == "function") { s_hp_commonConfig(s); } if (!s.getQueryParam) { hpmmd.omniture.load_plugins(s); } s.m_i("Media"); s.loadModule("Media"); s.Media.autoTrack = false; s.Media.trackMilestones = "25"; s.Media.segmentByMilestones = true; s.Media.completeByCloseOffset = true; s.Media.completeCloseOffsetThreshold = 0; s.Media.trackVars = "None"; s.Media.trackEvents = "None"; s.Media.trackUsingContextData = true; s.Media.contextDataMapping = { 'a.media.name': 'eVar70', 'a.media.segment': 'eVar71', 'a.contentType': 'eVar72', 'a.media.segmentView': 'event97', "a.media.complete": "event98", 'a.media.timePlayed': 'event99', 'a.media.view': 'event100', 'a.media.milestones': 'None' }; hasRunConfiguration = true; } catch (e) { log.error("Omniture Module Load: Media:" + e); } } } var currentPlayingVideo, videoState = "ready", currentPlayingTime = 0; var common_event_handlers = { setVideoName: function (baseVideoName) { var metatags = hpmmd.metatags || {}, country = metatags.target_country || "err", websection = metatags.web_section_id || "err", business_unit = metatags.bu || "err", displayPrefix = country + ":" + business_unit + ":" + websection + ":"; if (baseVideoName.indexOf(displayPrefix) == -1) { baseVideoName = displayPrefix + baseVideoName; } return baseVideoName; }, onStart: function (videoName, videoTotalLength, videoPlayerType) { currentPlayingVideo = videoName = common_event_handlers.setVideoName(videoName); currentPlayingTime = 0; s.Media.open(videoName, videoTotalLength, videoPlayerType); s.Media.play(videoName, currentPlayingTime); videoState = "playing"; }, onPlay: function (videoName, videoPosition, videoPlayerType) { videoName = common_event_handlers.setVideoName(videoName); if (videoName !== currentPlayingVideo) { //Case: New video played - old video is not terminated common_event_handlers.onStop(currentPlayingVideo, currentPlayingTime); common_event_handlers.onStart(videoName, 0, videoPlayerType); } else { switch (videoState) { case "playing": case "stopped": //Case: Existing video restarted from a stopped or scrubbed position s.Media.play(videoName, videoPosition); break; default: // Otherwise, we assume the video is ready or ended, so it's a start position common_event_handlers.onStart(videoName, 0, videoPlayerType); break; } } videoState = "playing"; }, onStop: function (videoName, videoPosition) { videoName = common_event_handlers.setVideoName(videoName); s.Media.stop(videoName, videoPosition); videoState = "stopped"; }, onEnd: function (videoName, videoTotalLength) { videoName = common_event_handlers.setVideoName(videoName); // s.Media.stop(videoName, videoTotalLength); s.Media.close(videoName); videoState = "end"; } }; return { commonVideoAnalyticsConfiguration: commonVideoConfiguration, hasConfiguredVideoAnalytics: function () { return hasRunConfiguration; }, commonVideoEventHandler: common_event_handlers, getVideoState: function () { return videoState; }, setVideoState: function (vState) { videoState = vState; }, getCurrentPlayingVideo: function () { return currentPlayingVideo; }, updateCurrentPlayingTime: function (position) { currentPlayingTime = position; } }; }); // Youtube-specific Video Tracking requirements curlDefine("VideoAnalytics/YoutubeModule", ["VideoAnalytics/Core", "Lodash", "debug/HPLog"], function (coreVideo, _, log) { var YOUTUBE_INITIAL_SCANTIME = 5000, YOUTUBE_RECURRING_SCANTIME = 15000, YOUTUBE_MAX_SCANS = 20; var player, ytPlayerDomIds = [], ytLastVideosPlayed=[],ytPlayerObjects = [], currentReady = [], previousEvent, scanCounter = 0; function nameExtractionFromURL(youtubeEmbedPlayerURL) { var badName = "YTVideo", youtube_id = "", youtubeRegexEmbedPlayerURI = /youtube\.com\/embed\/([^\?\&]+)/, youtubeRegexThumbnailPlayerURI = /youtube\.com\/watch.+v\=([^\&]+)/; youtube_id = youtubeRegexEmbedPlayerURI.exec(youtubeEmbedPlayerURL) || youtubeRegexThumbnailPlayerURI.exec(youtubeEmbedPlayerURL) || [false, "unknown"]; badName = badName + "_" + youtube_id[1]; return {name: shortName(youtube_id[1]), youtube_id: youtube_id[1]}; } function shortName(id) { return "YTVideo_" + id; } function checkForYoutubeEmbeddedIFrames() { var iframes = document.getElementsByTagName("iframe") || []; return _.reduce(iframes, function (result, iframe) { if (iframe.src && iframe.src.indexOf("youtube.com") !== -1) { result.push(iframe); } return result; }, []); } function loadYoutubeAPIScripts(loadJSAPIFlag, callback) { if (!!loadJSAPIFlag) { if (!window.onYouTubeIframeAPIReady) { window.onYouTubeIframeAPIReady = callback; } else { window.__backuponYouTubeIframeAPIReady = window.onYouTubeIframeAPIReady; window.onYouTubeIframeAPIReady = function () { __backuponYouTubeIframeAPIReady(); callback(); } } var tag = document.createElement('script'); tag.src = window.location.protocol + "//www.youtube.com/iframe_api"; var firstScriptTag = document.getElementsByTagName('script')[0]; firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); } } function registerExistingYoutubePlayerObject(player) { player.addEventListener("onReady", standardYoutubeOnReadyEventListenter); } function init() { log.log("Starting init...scanning for youtube players"); var tmpYoutubePlayerDomIds = []; tmpYoutubePlayerDomIds = _.reduce(checkForYoutubeEmbeddedIFrames(), function (result, iframe) { // Each of these iframes are Youtube iframes - so assign an ID if they don't already // have an ID attribute. This is required when initializing the youtube player object. if (!iframe.id) { iframe.id = nameExtractionFromURL(iframe.src).name; } //If there's no enablejsapi parameter add it if(!/enablejsapi=1/gi.test(iframe.src)){ var sym=(iframe.src.indexOf("?")!=-1)?"&":"?"; iframe.src=iframe.src+sym+"enablejsapi=1"; } //If there's no origin parameter add it, youtube made this "mandatory" by mistake although its doc says optional if(!/origin=/gi.test(iframe.src)){ iframe.src=iframe.src+"&origin="+window.location.host; } // Create a new youtube player object if we haven't already done this previously if (!_.contains(ytPlayerDomIds, iframe.id)) { result.push(iframe.id); log.log("Saving YT Players: " + iframe.id); var eventStructure = { // 'onStateChange': standardYoutubeOnStateChangeEventListener, 'onReady': standardYoutubeOnReadyEventListenter }; ytPlayerObjects[iframe.id] = new YT.Player(iframe.id, { events: eventStructure }); } return result; }, []); // Keep track of all the Youtube DOM ids that have players so that we don't check for them again ytPlayerDomIds = _.union(ytPlayerDomIds, tmpYoutubePlayerDomIds); } function standardYoutubeOnReadyEventListenter(event) { var youtubeVideoNameObject = nameExtractionFromURL(event.target.getVideoUrl()); log.log("onReady: " + JSON.stringify(youtubeVideoNameObject)); coreVideo.commonVideoAnalyticsConfiguration(); coreVideo.setVideoState("ready"); event.target.addEventListener("onStateChange", standardYoutubeOnStateChangeEventListener); } function standardYoutubeOnStateChangeEventListener(event) { // Helper function: waits until the video duration is available before executing the callback function waitAndGetVideoDuration(player, callback) { if (player.getDuration() > 0) { callback(); } else { setTimeout(function () { waitAndGetVideoDuration(player, callback) }, 100); } } // Sometimes duplicate event handlers are registered (don't know why this happens) // To avoid excessive event noise, this is a quick check that never processes the same even twice. if (previousEvent === event) { return; } else { previousEvent = event; } // Initialize variables var player = event.target, youtubeVideoNameObject = nameExtractionFromURL(player.getVideoUrl()), youtubeVideoId = youtubeVideoNameObject.name, youtubeProperVideoName = coreVideo.commonVideoEventHandler.setVideoName(youtubeVideoNameObject.youtube_id); log.log("onStateChange: " + youtubeProperVideoName + "," + JSON.stringify(youtubeVideoNameObject)); try { coreVideo.updateCurrentPlayingTime(player.getCurrentTime()); switch (event.data) { case YT.PlayerState.CUED: log.log("State: Cued"); break; case YT.PlayerState.BUFFERING: case YT.PlayerState.PLAYING: log.log("State: Playing"); // If the core video has just been loaded ('ready' state) OR if the youtube video name // doesn't match the existing video player name, then we assume this is a new // video start condition var checkYTPlayed = function(videoURL){ if(hpmmd.page.sub_business_unit.indexOf("tsg.software")!==-1){ /*This logic only applies in SW pages */ if(ytLastVideosPlayed.length==0){ return true; /*video has not played*/ } else{ var nfound=true; for(var i=0;i 0; if (youtubeEmbedIframeCheck) { if (typeof(YT) == "undefined") { loadYoutubeAPIScripts(true, init); } youtubeVideoScanner(); } }, YOUTUBE_INITIAL_SCANTIME); } // Expose routines that will be used by calling modules return { // Link to the video initialization routine - scans DOM for youtube videos and registers them init: init, // Link to the helper function that calls the interval scanner / API scripts the first time video is initiated // This is the routine that starts the iterative scanner initializeAPIScriptsAndSetupIntervalScanner: initializeAPIScriptsAndSetupIntervalScanner, registerExistingYoutubePlayerObject: registerExistingYoutubePlayerObject }; }); curlRequire(["VideoAnalytics/YoutubeModule"], function (youtubeVideoModule) { youtubeVideoModule.initializeAPIScriptsAndSetupIntervalScanner(); }); } //###Key Youtube Test Cases //* **Case 1:** Youtube embedded player / non-compliant: //http://h30406.www3.hp.com/campaigns/2012/wwcampaign/Discover/index.php //http://www.hp.com/go/ci // * **Precondition:** // 1. Page loads with an embedded Youtube player in an iframe // 2. Analytics code is not explicitely called or activated. // * **Postcondition:** if (!_mbootstrap) { // Qualtrics loader script // AMD compatible // Avoiding dependencies (i.e. jQuery) for simple