if (typeof wm_indiv_stats == 'undefined') { wm_indiv_stats = new Object(); // object to add the individual parameters } (function(){ function getWiredMinds() { var wiredminds = { getlist : "", www_server : "www.count.carrierzone.com", app_server : "www.count.carrierzone.com", cnt_server : "count.carrierzone.com", app_server_proto : "", cnt_server_proto : "", numberOfCalls : 0, wm_track_url : "", wm_track_alt : "", wm_cvid : 0, placeOverlay : false, placeHeatmap : false, placeOverlayMenu : false, overlayKeyLength : 32, wm_page_name_value : null, ovk : null, overlayScriptUrl : '', validateUrl : '', still_alive_interval : 5000, // msecs! still_alive_time_max : 30*60*1000, // msecs! still_alive_time_remaining : 0, still_alive_request : false, use_image_container : true, wm_use_ic : 0, cntParamContainer: {}, getOverlayScriptUrl : function (){ var proto = wiredminds.getProtoApp(); return proto+'//' + wiredminds.app_server + '/app/frontend/Ajax/overlay/OverlayManager.php?objMethod=loadScript'; }, getValidateUrl : function (){ var proto = wiredminds.getProtoApp(); return proto+'//' + wiredminds.app_server + '/app/frontend/Ajax/overlay/OverlayManager.php?objMethod=validateExternalKey'; }, createRandomKey : function () { var keyLenght = 16; var now = new Date(); var outputStr = ''; var inputNum = now.getTime(); inputNum = inputNum.toString(); var newInputNum = 0; var conStr = ''; var partition = 3; while (outputStr.length < keyLenght) { // Add random value if (inputNum.length==0) { do { newInputNum = Math.round(Math.random()*123); } while (newInputNum<48 || newInputNum>57 && newInputNum<65 || newInputNum>80 && newInputNum<97 || newInputNum>122); inputNum = newInputNum.toString(); } // Separate numbers out of string partition = 3; do { conStr = parseInt(inputNum.substr(0, partition)); partition--; } while ((conStr<48 || conStr>57 && conStr<65 || conStr>80 && conStr<97 || conStr>122) && partition>0); inputNum = inputNum.substr(partition+1); // Convert and add new character if (conStr<48 || conStr>57 && conStr<65 || conStr>80 && conStr<97 || conStr>122) { outputStr += conStr.toString(); } else { outputStr += String.fromCharCode(conStr); } } if (outputStr.length > keyLenght) { outputStr = outputStr.substr(0, keyLenght); } return outputStr; }, get_GET_value:function ( get_param_name ) { if (!window) {return '';} if (!window.location) {return '';} if (!window.location.search) {return '';} var search=window.location.search.substr(1); var assignments=search.split('&'); for( var i=0; i 0) || wiredminds.use_image_container ) { var CT_container=new Image(); CT_container.src=WMCT_URL; } else { //NOTE: Important to first insert the node before assigning innerHTML, because IE(6) would count twice otherwise! var ndDiv=document.createElement('div'); var bodyEl = document.getElementsByTagName('body')[0]; ndDiv = bodyEl.insertBefore(ndDiv, bodyEl.firstChild); ndDiv.innerHTML='' + wiredminds.wm_track_alt + ''; } wiredminds.numberOfCalls++; }, countpix : function (pixcode) { wiredminds.setTrackParam('wm_pixelcode', pixcode); wiredminds.count(); }, count_flash : function (flashArgs) { if ( typeof(flashArgs) != 'string') { return; } if ( flashArgs == '') { return; } if ( flashArgs.substr(0,1) == '&') { flashArgs='t2=1'+flashArgs; } wiredminds.count_URL(flashArgs); }, getPageName : function (ext){ // auto-detect page name, if necessary if (wiredminds.getTrackParam('wm_page_name') === null) { //Decode to make sure it does not get double encoded var wm_page_name_value = decodeURIComponent(document.location.pathname); // replace '/' with '|' wm_page_name_value = wm_page_name_value.replace(/^\ trackEvent: function(eventStr){ if(this.placeOverlayMenu == false){ if ((typeof(eventStr) == 'undefined') && (eventStr != '')){ return; // no event string given, do nothing } var myDate = new Date(); wiredminds.getlist = "t="+myDate.getTime(); // Clear/Initialize the get list. // NOTE: Clearing the getlist is a must! // Otherwise subsequent calls to count // (e.g. by using onClick="") would // append their values to the old get list. // First the required parameters if (wiredminds.getTrackParam('wm_custnum') !== null) { wiredminds.add_to_list('custnum',wiredminds.getTrackParam('wm_custnum')); } else { return; // no customer number given, do nothing } wiredminds.add_to_list('wm_event', eventStr); wiredminds.count_URL(wiredminds.getlist); } }, setTrackParam: function(paramName, paramValue) { wiredminds['cntParamContainer'][paramName] = paramValue; }, getTrackParam: function(paramName) { //First check if the param is set internally if (typeof wiredminds['cntParamContainer'][paramName] != 'undefined') { return wiredminds['cntParamContainer'][paramName]; } //To be backwards compatible, also check for global variable if (typeof window[paramName] != 'undefined') { return window[paramName]; } return null; }, setInternParam: function(paramName, paramValue) { wiredminds[paramName] = paramValue; }, getInternParam: function(paramName) { if (typeof wiredminds[paramName] != 'undefined') { return wiredminds[paramName]; } return null; }, setIndivParam: function(paramName, paramValue) { //Create object if it does not yet exist if (typeof wiredminds['cntParamContainer']['wm_indiv_stats'] != 'object') { wiredminds['cntParamContainer']['wm_indiv_stats'] = new Object(); // object to add the individual parameters } wiredminds['cntParamContainer']['wm_indiv_stats'][paramName] = paramValue; }, getIndivParam: function(paramName) { //First check if the param is set internally if ((typeof wiredminds['cntParamContainer']['wm_indiv_stats'] == 'object') && (typeof wiredminds['cntParamContainer']['wm_indiv_stats'][paramName] != 'undefined')) { return wiredminds['cntParamContainer']['wm_indiv_stats'][paramName]; } //To be backwards compatible, also check for global variable if ((typeof window['wm_indiv_stats'] != 'undefined') && (typeof window['wm_indiv_stats'][paramName] != 'undefined')) { return window['wm_indiv_stats'][paramName]; } return null; }, push: function() { var called = 0; var args = arguments; if (args.length > 0) { for (var i=0; i client_h) && (click_x > (client_w - scrollbarWidth))) { return; } // Add the width/height of scroll to coordinate click_x = click_x + scrollx; click_y = click_y + scrolly; var click_x_orig = click_x; var wm_content_width = wiredminds.getTrackParam('wm_content_width'); if (wm_content_width !== null){ wm_content_width = parseInt(wm_content_width); if (!isNaN(wm_content_width) && (wm_content_width <= body_w)){ click_x = (click_x - (body_w - wm_content_width)/2 ); } } var page_name = wiredminds.getPageName(); var params = new Array( 'custnum=' + wiredminds.getTrackParam('wm_custnum'), 'pagename=' + encodeURIComponent(page_name), 'cx=' + Math.round(click_x), 'cy=' + Math.round(click_y), 'body_height=' + Math.round(body_h), 'browser=' + browser ); if (wm_content_width !== null){ if (!isNaN(wm_content_width) && (wm_content_width > 0)){ max_allowed_x = ((body_w - wm_content_width)/2) + wm_content_width; params.push('content=' + parseInt(wm_content_width)); } } // send request if ((click_x > 0) && (click_x_orig < max_allowed_x)){ var proto = wiredminds.getProto(); var count_heat_URL = proto + '//' + wiredminds.cnt_server + wiredminds.cnt_path; var heatmap_container = new Image(); heatmap_container.src=count_heat_URL + '?' + params.join('&'); } }, getScrollbarWidth: function() { var scr = null; var inn = null; var wNoScroll = 0; var wScroll = 0; // Outer scrolling div scr = document.createElement('div'); scr.style.position = 'absolute'; scr.style.top = '-1000px'; scr.style.left = '-1000px'; scr.style.width = '100px'; scr.style.height = '50px'; // Start with no scrollbar scr.style.overflow = 'hidden'; // Inner content div inn = document.createElement('div'); inn.style.width = '100%'; inn.style.height = '200px'; // Put the inner div in the scrolling div scr.appendChild(inn); // Append the scrolling div to the doc document.body.appendChild(scr); // Width of the inner div sans scrollbar wNoScroll = inn.offsetWidth; // Add the scrollbar var browser = wiredminds.getBrowser(); if (browser.search(/IE/) != -1) { scr.style.overflow = 'scroll'; } else { scr.style.overflow = 'auto'; } // Width of the inner div width scrollbar wScroll = inn.offsetWidth; // Remove the scrolling div from the doc document.body.removeChild(document.body.lastChild); // Pixel width of the scroller return (wNoScroll - wScroll); }, registerHeatmapEvent: function(eventType) { var eventHandlerName = 'getClick'; if (typeof wiredminds[eventHandlerName] === 'function') { if (document.addEventListener) { document.addEventListener(eventType, wiredminds[eventHandlerName], false); } else if (document.attachEvent){ var ieEventType = 'on'+eventType; document.attachEvent(ieEventType, wiredminds[eventHandlerName]); } } }, getBrowser: function() { var version = navigator.appVersion; if (version.search(/MSIE 6/i) != -1) return "IE6"; if (version.search(/MSIE 7/i) != -1) return "IE7"; if (version.search(/MSIE 8/i) != -1) return "IE8"; if (version.search(/MSIE 9/i) != -1) return "IE9"; if (version.search(/MSIE/i) == -1) return "Others"; } }; return wiredminds; } function initWMObj() { //If it is not yet our object, but an array. Then save the array, create our object and pass the array to our push function. if (typeof wiredminds != 'undefined' && typeof wiredminds.push=="function" && wiredminds.constructor==Array) { var wiredmindsObj = getWiredMinds(); wiredmindsObj.push.apply(wiredmindsObj, wiredminds); wiredminds = wiredmindsObj; } else { if (typeof wiredminds == 'undefined') { wiredminds = getWiredMinds(); } } } //Init the object initWMObj(); })(); function click_track(ext) { wiredminds.push(['count', ext]); } var getClick = function(e){ wiredminds.push(['getClick', e]); }