// -- START WebTrends --
//******************************************************************************************************
//
// Use this special duplicate version of the base script in the header to handle events in which
// the script at the bottom loads too late. It will set a bypass flag after it writes to SDC and that will
// make it skip the second/bttom script so to avoiid duplicate hits.
//
//******************************************************************************************************
// DATE MODIFICATION Author
//======================================================================================================
// 03/15/08 Allow for bypassFlag to be passed in for times we may NOT want to run the bottom script ms
// 02/29/08 dummy out WT.vt_sid so to override SDCv8.0. This rids the spaces that are added from multiple IPs ms
// 01/22/08 clear out/reinitialize parms so not to carryover persistent values when passing to dcsMultiTrackTOP. ms
// 12/2007 Re-allow WT.ti (ie page title) name/value pair to come thru to the SDC log. Space not an issue anymore.
// 09/2007 clone base tag and create this "top" version for events needing it before bottom tag loads ms
// 05/2007 change from wls.cingular.com to wls.wireless.att.com to reflect new SDC domain ms
// 05/25/2007
// 1) allow for "bref" when building campaign id ms
// 2) REenabled "q_returnUrl" for edatamart to use ms
// 04/2007
// 1) add the path to the session cookie ms
// 2) REenabled "browserid" for edatamart to use ms
// 03/2007:
// 1) stop toJSONString from writing to SDC logs (i.e. arrays WT[N] & DCS[N]) ms
// to conserve space.
// 2) added function setCookieTop(). ms
// 3) added function chkForSourceTop(). ms
// 4) commented "WT.sp" to keep from writing to SDC logs to conserve space. ms
// 10/30/2006: mshmagin
// 1)For those parms being built in "dcsqry", check to see if we want to strip it from SDC log entry.
// 2)Remove WT.ti (i.e. page title) name/value pair from the SDC log. It's taking up log space.
// 3)Created/added function "trackObject" to help track forms & gifs.
// 06/2006 added cookie/parm "inUser" for filtering out dev/tester work. mshmagin
// 02/2006 added dcsMultiTrack() function to support tracking event commands, gifs, pdfs etc. mshmagin
// 04/2006 added dcsQPTop() function mshmagin
// 04/2006 rename ip for 'cingular.com' too 'www.cingular.com' mshmagin
var gImages=new Array;
var gIndex=0;
var DCS=new Object();
var WT=new Object();
var DCSext=new Object();
var gQP=new Array();
// ms 05/2007 change from wls.cingular.com to wls.wireless.att.com to reflect new SDC domain:
var gDomain="wls.wireless.att.com";
var gDcsId="dcsw1sx8x45vbwmw7v63tbf8m_1h2f";
// M.S.: 04/2006 REenabled browserid for edatamart to use
// M.S.: 10/2006 REMOVE the process that converts cookie "browserid" & avoid it being written the SDC log
// ==================================== Convert these possible cookies to parms: ============================================
dcs_cookieTop("browserid");
// M.S.: 10/2006 REMOVE the process that converts cookie "DSESSIONID" & avoid it being written the SDC log
//dcs_cookieTop("DSESSIONID");
// ==================================================================================================================
// M.S.: 06/2006 added cookie/parm process for filtering out 'dev' work. This cookie is set in the dev landing page &
// will be converted to a parm here. We will filter out, in WT, based on this parm (ie intUser=Y).
// ==================================================================================================================
dcs_cookieTop("intUser");
if ((typeof(gConvert)!="undefined")&&gConvert&&(document.cookie.indexOf(gFpc+"=")==-1))
{
document.write("");
}
// ====================================================================================================
//Look for a cookie and, if found, create the SDC parm for it:
function dcs_cookieTop(NAME){
var cookies = document.cookie;
var pos = cookies.indexOf(NAME + "=");
if (pos != -1){
var start = pos + NAME.length + 1;
var end = cookies.indexOf(";", start);
if (end == -1) end = cookies.length;
var cookievalue = cookies.substring(start,end);
cookievalue = unescape(cookievalue);
DCSext[NAME] = cookievalue;
// MS 03/2007 added to return the cookievalue:
return cookievalue;
}
}
// =============== end function dcs_cookieTop() =========================================
// ====================================================================================================
// M.S.: 02/2006 added dcsMultiTrack() function to support tracking event commands, gifs, pdfs etc.
// ====================================================================================================
function dcsMultiTrackTop(){
// Note to developer: should you wish to NOT bypass the bottom script then call this with a name/value of: 'bypassFlag','N'
//----------------------------------------------------------------------------------------
// ms 01/22/08 clear out/reinitialize parms so not to carryover persistent values when passing to dcsMultiTrackTOP.
// ms 01/22/08 initialize all PREVIOUS except for specific parms we want to keep from page to page:
for (N in DCSext){
if (DCSext[N]) {
if (N != "browserid" && N != "wtABTest") {
DCSext[N]="";
}
}
}
// ms 01/22/08 initialize the "pn_sku" & tx_u:
for (N in WT){
if (WT[N]) {
if (N == "pn_sku" || N == "tx_u"){
WT[N]="";
}
}
}
// ms 03/15/08 Allow for bypassFlag to be passed in for times we may NOT want to bottom script
bp = "Y";
//---Load up arrays from the passed in parms to this multitrack call:
for (var i=0;i3){
if ((navigator.appName=="Microsoft Internet Explorer")&&document.body){
WT.bs=document.body.offsetWidth+"x"+document.body.offsetHeight;
}
else if (navigator.appName=="Netscape"){
WT.bs=window.innerWidth+"x"+window.innerHeight;
}
}
WT.fi="No";
if (window.ActiveXObject){
if ((typeof(gFV)!="undefined")&&(gFV.length>0)){
WT.fi="Yes";
WT.fv=gFV;
}
}
else if (navigator.plugins&&navigator.plugins.length){
for (var i=0;i0){
for (var i=0;i0)){
window.location=gHref;
gHref="";
}
}
function dcsCreateImageTop(dcsSrc){
// first see if browser version supports this object:
if (document.images){
gImages[gIndex]=new Image;
if ((typeof(gHref)!="undefined")&&(gHref.length>0)){
gImages[gIndex].onload=gImages[gIndex].onerror=dcsLoadHref;
}
gImages[gIndex].src=dcsSrc;
gIndex++;
}
else {
document.write('
');
}
}
function dcsMetaTop(){
var elems;
if (document.all){
elems=document.all.tags("meta");
}
else if (document.documentElement){
elems=document.getElementsByTagName("meta");
}
if (typeof(elems)!="undefined"){
for (var i=1;i<=elems.length;i++){
var meta=elems.item(i-1);
if (meta.name){
if (meta.name.indexOf('WT.')==0){
WT[meta.name.substring(3)]=meta.content;
}
else if (meta.name.indexOf('DCSext.')==0){
DCSext[meta.name.substring(7)]=meta.content;
}
else if (meta.name.indexOf('DCS.')==0){
DCS[meta.name.substring(4)]=meta.content;
}
}
}
}
}
function dcsTagTop(){
var P="http"+(window.location.protocol.indexOf('https:')==0?'s':'')+"://"+gDomain+(gDcsId==""?'':'/'+gDcsId)+"/dcs.gif?";
for (N in DCS){
if (DCS[N]) {
// MS 03/2007 stop toJSONString from writing to SDC logs to conserve space:
if (N != "toJSONString") {
P+=ATop(N,DCS[N]);
}
}
}
for (N in WT){
if (WT[N]) {
//==========================================================================================================
// 12/2007 Re-allow WT.ti (ie page title) name/value pair to come thru to the SDC log. Space not an issue anymore.
// MS 03/2007 stop toJSONString from writing to SDC logs to conserve space
// mshmagin 10/30/2006 remove WT.ti (ie page title) name/value pair from the SDC log. It's taking up log space.
if (N == "toJSONString"){
continue;
}
//==========================================================================================================
P+=ATop("WT."+N,WT[N]);
}
}
for (N in DCSext){
if (DCSext[N]) {
// MS 03/2007 stop toJSONString from writing to SDC logs to conserve space:
if (N != "toJSONString") {
P+=ATop(N,DCSext[N]);
}
}
}
if (P.length>2048&&navigator.userAgent.indexOf('MSIE')>=0){
P=P.substring(0,2040)+"&WT.tu=1";
}
dcsCreateImageTop(P);
}
function dcsFuncTop(func){
if (typeof(window[func])=="function"){
window[func]();
}
}
//=====================================================================================================================
//mshmagin 05/23/2007: reallow "q_returnUrl" back into the logs, to be used by edatamart
//mshmagin 10/30/2006:
// Function "stripParms" will strip certain PARMS (they must exist as PARMS on the URL) from the URL before writing to SDC logs.
// We do this so to help make the SDC logs smaller & thus reduce processing time for Webtrends.
// The list of parms to strip is contained in a variable below.
// mshmagin 10/30/2006 remove specific parms (eg _DARGS, q_returnUrl, etc.) from the URL before writing to SDC server:
// mshmagin 10/30/2006 remove WT.ti (ie page title) name/value pair from the SDC log. It's taking up log space.
function stripParmsTop(v){
//**********************************************************************************************************************
// These are the list of any VISIBLE parms we wish to remove from Webtrends SDC logs.
// This is case sensitive. Also, try to separate them with a comma for readability purposes:
var excludeTheseParmsValues="_DARGS,dsessionid,DSESSIONID,_requestid";
//**********************************************************************************************************************
//initialize:
var newdcsqry = "";
var newParmKnt = 0;
// Get Entire Query String:
var query = v;
// Split entire query at each ampersand:
var pairs = query.split("&");
// Begin loop through the query string:
for (var i = 0; i < pairs.length; i++) {
var value = pairs[i];
// Look for position of the "?" of the parm in the query string:
var startptr = pairs[i].indexOf('?');
if (startptr == -1) // "?" not found
{
//reset position to beginning:
startptr=0;
}
else
{
//reset position to just after the "?":
startptr=startptr+1;
value = pairs[i].substring(startptr);
}
// Look for postion of the "=" of the parm in the query string:
var endptr = pairs[i].indexOf('=');
if (endptr == -1) // "=" not found
{
//reset position to beginning: FIX THIS IE if not found
endptr=0;
}
//get the argname & see if it's in the list above to strip out:
var argname = pairs[i].substring(startptr,endptr);
parms_Found_Or_Not_Indicator1 = excludeTheseParmsValues.indexOf(argname);
if (parms_Found_Or_Not_Indicator1 == -1 ) { // "-1" means requested stripped parm not found on URL so keep it:
// write it back with either a "?" or a "&":
if (newParmKnt > 0)
{
// not first value, so stick ampersand in front:
newdcsqry = newdcsqry+"&"+value;
newParmKnt = newParmKnt + 1;
}
else
{
// first value so, stick question mark in front:
newdcsqry = newdcsqry+"?"+value;
newParmKnt = newParmKnt + 1;
}
} //endif
} //endfor
return newdcsqry;
} //end function
//===========================================================================================
// MS: 10/2006 Use function "trackObject" to help track forms & gifs.
// A virtual link is passed & written to SDC so SmartView can map to it.
function trackObjectTop(objLink){
var gDomain="wls.cingular.com";
var gDcsId="dcsw1sx8x45vbwmw7v63tbf8m_1h2f";
var dCurrent=new Date();
var dcsdat=dCurrent.getTime();
var dcssip=window.location.hostname;
if (dcssip == 'cingular.com'){
dcssip = 'www.cingular.com';
}
var dcsref=window.location.href;
var dcsuri="/"+objLink.pathname;
var P="http://"+gDomain+(gDcsId==""?'':'/'+gDcsId)+"/dcs.gif?&dcsdat="+dcsdat+"&dcssip="+dcssip+"&dcsuri="+dcsuri+"&dcsref="+dcsref;
//write to SDC log:
dcsCreateImageTop(P);
} //end function
// =============== end function trackObjectTop() =========================================
function setCookieTop ( name, value, exp_y, exp_m, exp_d, path, domain, secure ){
var cookie_string = name + "=" + escape ( value );
if ( exp_y ) {
var expires = new Date ( exp_y, exp_m, exp_d );
cookie_string += "; expires=" + expires.toGMTString();
}
if ( path ) {
cookie_string += "; path=" + escape ( path );
}
if ( domain ) {
cookie_string += "; domain=" + escape ( domain );
}
if ( secure ) {
cookie_string += "; secure";
}
document.cookie = cookie_string;
}
// =============== end function setCookieTop() =========================================
/**************************************************************************************************************************/
/* MS 03/2007 Interrogate URL for the parm "source" & "bref", return value back & assign it as the campaign, pass it across all pages, and finally, assign it to a WT campaign. */
function chkForSourceTop() {
var src = dcsQPTop("source");
var bref = dcsQPTop("bref");
if (src == "" && bref == "")
{
// there is NO "source" or "bref" parm on the URL:
var saFlowType1Val = dcs_cookieTop("saFlowType1"); // check for the existence of the first cookie
if (saFlowType1Val == null)
{
// do nothing (saFlowType1 NOT found)
}
else
{
// saFlowType1 found, write the parm for it to SDC for the present page:
document.write('');
var saFlowType2Val = dcs_cookieTop("saFlowType2"); // check for the existence of the second cookie
if (saFlowType2Val == null)
{
// do nothing (saFlowType2 NOT found)
}
else
{
// saFlowType2 found, write the parm for it to SDC for the present page:
document.write('');
}
}
}
else
{
// there is a "source" or "bref" parm on the URL:
if (src.substr(0,1) == "E" || src.substr(0,1) == "I" || bref.substr(0,1) == "E" || bref.substr(0,1) == "I") // NOTE: only "E"xternal or "I"nternal campaign codes
{
if (src !="")
{
WT.mc_id = src;
}
else
{
WT.mc_id = bref;
}
var cv = WT.mc_id; //set campaign val variable
//==================================================================
// now check to see if this was the second most recent campaign:
var saFlowType1Val = dcs_cookieTop("saFlowType1"); // get the cookie
if (saFlowType1Val == null)
{
// No previous saFlowType1 found, it's the first campaign:
setCookieTop("saFlowType1",cv,"","","","/","","");
document.write('');
}
else
{
// previous saFlowType1 found, flip-flop them & write them both out to SDC:
// make the "most recent campaign value" to be the first campaign:
setCookieTop("saFlowType1",cv,"","","","/","","");
document.write('');
// make the previous campaign to be the second campaign:
setCookieTop("saFlowType2",saFlowType1Val,"","","","/","","");
document.write('');
}
//==================================================================
} // end if
} // end else
} // end function
// =============== end function chkForSourceTop() =========================================
// -- END WebTrends --