1 2// JavaScript Document 3 4/*** allows logging to Firebug without stressing out IE **********/ 5function log( elem ) { 6 if (typeof console != "undefined" ){ console.log( elem ); }; 7}; 8 9 10 11/*** mimics JS call to WebTrends script **********/ 12function dcsMultiTrack( param1, param2, param3, param4 ) { 13 log('WT hit logged - ' + param1 + " - " + param2 + " - " + param3 + " - " + param4); 14}; 15 16function gaClickLog( gaEvent, gaCategory, gaValue ) { 17 log('GA hit logged - ' + gaEvent + " - " + gaCategory + " - " + gaValue); 18} 19 20 21 22/***grabs URL parameter values **********/ 23function getParam(Param) 24{ 25 var PageURL = window.location.search.substring(1); 26 var URLVariables = PageURL.split('&'); 27 for (var i = 0; i < URLVariables.length; i++) 28 { 29 var ParameterName = URLVariables[i].split('='); 30 if ( ParameterName[0] == Param) 31 { 32 return ParameterName[1]; 33 } 34 } 35}; 36 37log("in devscripts"); 38 39$.extend({ 40 getValues: function(url) { 41 var result = null; 42 $.ajax({ 43 url: url, 44 type: 'GET', 45 data:'application/json', 46 dataType: 'json', 47 cache: false, 48 async: false, 49 success: function(data) { 50 result = data; 51 log( "inside ajax = " + data ); 52 }, 53 error: function (xhr, textMessage, thrownError) { 54 log(xhr.status); 55 log(textMessage); 56 log(thrownError); 57 } 58 }); 59 return result; 60 } 61 62}); 63 64$.extend({ 65 getHTML: function(url) { 66 var result = null; 67 $.ajax({ 68 url: url, 69 type: 'get', 70 data:'application/html', 71 dataType: 'html', 72 cache: false, 73 async: false, 74 success: function(data) { 75 result = $(data).find('.pageBuilder'); 76 //log( "inside html ajax = " + result); 77 } 78 }); 79 return result; 80 } 81}); 82 83/*function qs(str){ 84var url=unescape(document.location); 85var re=new RegExp('[&\\?]'+encodeURI(str)+'=','i'); 86 87if(!re.test(url)){return false;} 88else { return decodeURI(url.substring(url.indexOf('?')-1).split('#')[0].split(re)[1].split('&')[0]); 89} 90 91}*/ 92 93function pageName(str){ var re=new RegExp('^'+str+'$','i'); var pn=window.location.pathname; return re.test(pn.substring(pn.lastIndexOf('/')+1));} 94 95/*** finds date difference - a and b are javascript Date objects ***/ 96function dateDiffInDays(a, b) { 97 /*** Discard the time and time-zone information. ***/ 98 var utc1 = Date.UTC(a.getFullYear(), a.getMonth(), a.getDate()); 99 var utc2 = Date.UTC(b.getFullYear(), b.getMonth(), b.getDate()); 100 101 return Math.floor((utc2 - utc1) / _MS_PER_DAY); 102}; 103 104 function getCookie(name) { 105 var v = document.cookie.match('(^|;) ?' + name + '=([^;]*)(;|$)'); 106 return v ? v[2] : null; 107 } 108 109 function setCookie(name, value, days) { 110 var d = new Date; 111 d.setTime(d.getTime() + 24*60*60*1000*days); 112 document.cookie = name + "=" + value + ";path=/;expires=" + d.toGMTString(); 113 } 114 115 function deleteCookie(name) { setCookie(name, '', -1); } 116 117 118$(document).ready(function() { 119 120});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.