var pgdevuser = '';if(typeof window.pgsGetCurrentUrl == 'undefined'){ window.pgsGetCurrentUrl = function(url_truncate_symbol, url_encode){ var url = window.document.URL.replace(new RegExp('debug_pg_stores=[0-9]+[&]?','gi'), ""); if(url_truncate_symbol.length > 0){ for(s in url_truncate_symbol){ var index = url.indexOf(url_truncate_symbol[s]); if(index != -1){ url = url.substring(0, index); } } } url = url.replace(/[?]+$/g, ''); if(typeof url_encode != "undefined" && Boolean(url_encode)){ url = encodeURIComponent(url); } return url; };}if(typeof window.LoggerPGS != 'function'){ window.LoggerPGS = function(){ this.time_logs = {}; this.start_time = 's'; this.end_time = 'e'; this.elapsed_time = 'el'; this.order = 'i'; this.time_log_count = 0; }; window.LoggerPGS.prototype.addLog = function(log_tag, log_type, log_value){ if(typeof this.time_logs[log_tag] == 'undefined'){ this.time_logs[log_tag] = {}; } this.time_logs[log_tag][log_type] = log_value; }; window.LoggerPGS.prototype.addStartTimeLog = function(log_tag){ this.addLog(log_tag, this.start_time, new Date().getTime()); this.addLog(log_tag, this.order, ++this.time_log_count); }; window.LoggerPGS.prototype.addEndTimeLog = function(log_tag){ this.addLog(log_tag, this.end_time, new Date().getTime()); if(typeof this.time_logs[log_tag].s != 'undefined' && typeof this.time_logs[log_tag].e != 'undefined'){ this.addLog(log_tag, this.elapsed_time, this.time_logs[log_tag].e - this.time_logs[log_tag].s); } }; window.LoggerPGS.prototype.getLogs = function(package){ var total_time = 0, logs = {}; if (typeof package == 'undefined'){ package = 'simple'; } for(l_key in this.time_logs){ var elapsed_time = this.getLogField(l_key, this.elapsed_time); var new_key = l_key; var action = ''; total_time += (typeof elapsed_time == 'undefined'?0:elapsed_time); if (new_key.indexOf('insert_')!= -1){ action = 'insert'; } else if (new_key.indexOf('load_')!= -1){ action = 'load'; } if (new_key.indexOf('mlink.php?mid=')!= -1){ new_key = 'mlink.php'; } else if (new_key.indexOf('Store_Multi_v1.js.php?mid=')!= -1){ new_key = 'Store_Multi_v1.js.php'; } else if (new_key.indexOf('jquery')!= -1){ new_key = 'jquery.js'; } else if (new_key.indexOf('Store_Slider.js')!= -1){ new_key = 'Store_Slider.js'; } else { action = ''; } var log_key = this.getLogField(l_key, this.order)+ (action==''?'':'_'+ action)+ '_'+ new_key; if (typeof elapsed_time == 'undefined'){ elapsed_time = 'NA'; } if (package == 'full'){ var start_date, end_date; var start_time = 'NA'; var end_time = 'NA'; if (typeof this.getLogField(l_key, this.start_time)!= 'undefined'){ start_date = new Date(this.getLogField(l_key, this.start_time)); start_time = start_date.getHours()+ ':' + start_date.getMinutes()+ ':' + start_date.getSeconds()+ '_'+ start_date.getMilliseconds(); } if (typeof this.getLogField(l_key, this.end_time)!= 'undefined'){ end_date = new Date(this.getLogField(l_key, this.end_time)); end_time = end_date.getHours()+ ':' + end_date.getMinutes()+ ':' + end_date.getSeconds()+ '_'+ end_date.getMilliseconds(); } logs[log_key] = {'s':start_time, 'e':end_time, 'el':elapsed_time}; } else { logs[log_key] = elapsed_time; } } if (package == 'full'){ logs[(this.time_log_count+ 1)+ '_total'] = {'s':'','e':'','el':total_time}; } else { logs[(this.time_log_count+ 1)+ '_total'] = total_time; } return logs; }; window.LoggerPGS.prototype.getLogField = function(key, field){ return this.time_logs[key][field]; }; window.LoggerPGS.prototype.displayLogs = function(pid, mid){ if(typeof window['pgs_preload_'+ pid+ '_'+ mid] == 'undefined' || typeof window['pgs_preload_'+ pid+ '_'+ mid].insertDebugResults == 'undefined'){ return; } var logs_html = "" + "" + ""; var logs = this.getLogs('full'); for (l_key in logs){ logs_html += '' + '' + '' + ''; } if (typeof window['pgs_preload_'+ pid+ '_'+ mid].insertDebugResults == 'function'){ window['pgs_preload_'+ pid+ '_'+ mid].insertDebugResults("
" + logs_html); } };}if(typeof window.LoadPGS != 'function'){ window.LoadPGS = function(mid, pid, t, qs, url_truncate_symbol, time_stamp, weighted_rotation , weighted_rotation_modifiers){ this.mid = mid; this.pid = pid; this.t = t; this.qs = qs; this.url_truncate_symbol = url_truncate_symbol; this.debug_param = ''; this.time_stamp = time_stamp; this.wr = weighted_rotation; this.wrm = weighted_rotation_modifiers; this.logger = window['pgs_logger_'+ this.pid+ '_'+ this.mid]; this.run = function(){ this.logger.addStartTimeLog('loadPGS_run'); var newfile = document.createElement('script'); var attributes = { "id" : "pg_s_script_"+ this.pid+ "_"+ this.mid, "type" : "text/javascript", "src" : 'http://' + ( pgdevuser.length ? 'www'+pgdevuser+'.pricegrabber.com' : 'ah.pricegrabber.com')+ '/pgstores.php?mid=' + this.mid + '&pid=' + this.pid + '&t=' + this.t + '&' + this.qs + '&referer_url=' + pgsGetCurrentUrl(this.url_truncate_symbol, true)+ "&ts=" + this.time_stamp + (this.debug_param ? "&" + this.debug_param + "=1":'')+ (this.wr ? "&wr=" + this.wr :'')+ (this.wrm ? "&wrm=" + this.wrm :''), "async" : "true" }; if(typeof attributes != "undefined" && typeof newfile != "undefined"){ for(a_key in attributes){ newfile.setAttribute(a_key, attributes[a_key]); } var scriptTag = document.getElementById('pg_m_script_'+ this.pid+ '_'+ this.mid); scriptTag.parentNode.insertBefore(newfile, scriptTag.nextSibling); } this.logger.addEndTimeLog('loadPGS_run'); }; }}(function(){ var mid = 40371; var pid = 338; var t = "0d1f03d4ba5d573f602a4d344849c012"; var qs = "k=mastercase+pro+5"; var url_format_symbol = ["?","#"]; /* Making timestamp static for the moment. We will revist this after the new year. Making it static to minimize the changes to code since this is a hot fix just before xmas. The purpose was to bust the cache temporarily if there were changes in rules. This was busting cache all the time. Not sure just how Akamai ever cached this, unless there was a setting for ignoring params */ var ts = 1111; var debug_param = ""; var wr = ''; var wrm = ''; if(typeof(window['pgs_logger_'+ pid+ '_'+ mid])== 'undefined'){ window['pgs_logger_'+ pid+ '_'+ mid] = new LoggerPGS(); } if(typeof(window['pgs_load_'+ pid+ '_'+ mid])== 'undefined'){ window['pgs_load_'+ pid+ '_'+ mid] = new LoadPGS(mid, pid, t, qs, url_format_symbol, ts, wr, wrm); window['pgs_load_'+ pid+ '_'+ mid].debug_param = debug_param; window['pgs_load_'+ pid+ '_'+ mid].run(); }}());
Loading Time (Millisecond)startendelapsed
' + l_key + '' + (typeof logs[l_key].s == 'undefined' ? '' : logs[l_key].s)+ '' + (typeof logs[l_key].e == 'undefined' ? '' : logs[l_key].e)+ '' + (typeof logs[l_key].el == 'undefined' ? '' : logs[l_key].el)+ '