<\/div>');
}
else if ($('marketingSlot')) {
//alert('marketingSlot');
new Insertion.After('marketingSlot','
![McAfee Secure sites help keep you safe from identity theft, credit card fraud, spyware, spam, viruses and online scams](//images.scanalert.com/meter/www.gap.com/63.gif)
<\/div>');
}
}
/*
Universal Cookie Cutter
Version 2.1
Created to streamline cross-brand A/B testing
New version modularizes variables
instantiate new object:
MyCookieCutter = new universalCookieCutter([CookieVarName], // name of your cookie variable
[CookieUsedName], // name of cookie used (usually 'mktUniversalPersist')
[CookieValueBase], // name of base cookie value so AB tests can be distinguished (ONOctFSEG)
[ForcedModeBaseName], // distinct base string for forced mode, (oldnavyabmode), etc
[SegmentBreakdown] // segment breakdowns separated by "-" (80-10-10) highest to lowest values
[eVar you are using] // OPTIONAL can be either ABTestVariables.eVar24 or ABTestVariables.eVar36 - enter either "24", "36" or "" (blank)
[Piperlime-only segment] // Piperlime often doesn't segment, scan for this variable and overwrite it.
);
A sample instantiation:
ONBRABCookieCutter = new universalCookieCutter("ONBRAB","mktUniversalPersist","ONBRDecXSEG","onbrabmode","70-10-10-5-5","24","0625FSSegE");
*/
var universalCookieCutter = Class.create();
universalCookieCutter.prototype = {
initialize:function(CookieVarName,CookieUsedName,CookieValueBase,ForcedModeBaseName,SegmentBreakdown,theEvar,plExcept) {
//Keeping it neat by having two discreet variables that check for and gather cookie information
this.EvarToUse = theEvar != "" ? theEvar : false;
this.CookieVariableName = CookieVarName;
this.CookieUsed = CookieUsedName;
this.CookieValueBase = CookieValueBase;
this.SegBreakdown = SegmentBreakdown.split("-");
this.DoesTheCookieExist = gidLib.getCookieVar(this.CookieUsed, this.CookieVariableName);
this.RetrievedCookieValue = gidLib.getCookieVar(this.CookieUsed, this.CookieVariableName);
this.QuickSegment = '';
this.piperlimeException = plExcept;
this.userNeedsSync = false;
this.ForcedModeBase = ForcedModeBaseName;
this.ModeArrayIndex = this.SegBreakdown.length; //segment breakdown determines how many segments too!
this.modeArray = new Array();
this.modeArray[0] = "a";
this.modeArray[1] = "b";
this.modeArray[2] = "c";
this.modeArray[3] = "d";
this.modeArray[4] = "e";
this.modeArray[5] = "f";
this.modeArray[6] = "g";
//alert(this.piperlimeException);
if (location.href.indexOf(this.ForcedModeBase) >= 1) {
this.forcedMode();
}else{
this.cookieScanner();
}
},
forcedMode:function() {
for (i = 0; i < this.ModeArrayIndex; i++) {
if (location.href.indexOf(this.ForcedModeBase + "=" + this.modeArray[i]) >= 1) {
//alert('you are in segment ' + this.modeArray[i].toUpperCase() + ' / ' + this.SegBreakdown[i] + '% of the population');
this.UserSegment = this.CookieValueBase + this.modeArray[i].toUpperCase();
this.QuickSegment = this.modeArray[i].toUpperCase();
}
}
gidLib.setCookieVar(this.CookieUsed,this.CookieVariableName,this.UserSegment);
if (this.EvarToUse) {
this.setABTestVariable(this.UserSegment);
}
userNeedsSync = true;
//alert("Forced: Cookie set.");
},
cookieScanner:function() {
//If the cookie isn't available, bake one!
if (this.DoesTheCookieExist) {
if (this.EvarToUse) {
this.setABTestVariable(this.RetrievedCookieValue);
}
for (i = 0; i < this.ModeArrayIndex; i++) {
if (this.RetrievedCookieValue == (this.CookieValueBase + this.modeArray[i].toUpperCase())) {
this.QuickSegment = this.modeArray[i].toUpperCase();
break;
}
}
} else {
this.tagManager();
}
},
tagManager:function() {
//Breaking out the segmentation into specified percentages
this.Segmentation = Math.floor((Math.random()*100)+1); // chooses 1 to 100
//alert("Seg: " + this.Segmentation);
this.FloorThreshold = 0;
this.TopThreshold = 0;
for (i = 0; i < this.ModeArrayIndex; i++){
this.TopThreshold = this.FloorThreshold + parseInt(this.SegBreakdown[i]);
if ((this.Segmentation > this.FloorThreshold) && (this.Segmentation <= this.TopThreshold)){
// put me in this segment
this.UserSegment = this.CookieValueBase + this.modeArray[i].toUpperCase();
this.QuickSegment = this.modeArray[i].toUpperCase();
break;
} else {
// add top to floor and try next segment
this.FloorThreshold = this.TopThreshold;
}
}
gidLib.setCookieVar(this.CookieUsed,this.CookieVariableName,this.UserSegment);
if (this.EvarToUse) {
this.setABTestVariable(this.UserSegment);
}
//userNeedsSync = true;
//alert("Tag Manager: Cookie set.");
},
setABTestVariable: function(setValue) {
thisEvar = 'eVar' + this.EvarToUse;
ABTestVariables[thisEvar] = setValue;
}
};
// immediately instantiate cookie cutter, must be in-line, not after load or onDOMready.
/* -- McAfee Start -- */
// for McAfee Secure Badge AB Test
var BadgeABCookieCutter = new universalCookieCutter("BADGEAB","mktUniversalPersist","BadgeFeb11SEG","badgeabmode","50-50","42","PLOLParticipates");
// for mcafee badge test only
var badgeSegmentValue = gidLib.getCookieVar("mktUniversalPersist", "BADGEAB");
if ( badgeSegmentValue == "BadgeFeb11SEGA" && (location.href.indexOf('/buy/shopping_bag.do') > 1 || location.href.indexOf('/buy/shopping_bag_save_item.do') > 1 || location.href.indexOf('/buy/shopping_bag_move_item.do') > 1 || location.href.indexOf('buy/shopping_bag_delete_item.do') > 1 )) {
//alert("Badge test segment A");
Event.observe(window, 'load', showBadgeShopbag);
}
/* -- McAfee End -- */
/* -- Romance Start -- */
var RomanceABCookieCutter = new universalCookieCutter("ROMAB", "mktUniversalPersist", "romSEG", "romABMode", "50-50", "21", "0");
var executeRomanceTest = function() {
var romanceSegmentValue = gidLib.getCookieVar("mktUniversalPersist", "ROMAB");
if (romanceSegmentValue == "romSEGA") {
var headID = document.getElementsByTagName("head")[0];
var cssNode = document.createElement('link');
cssNode.type = 'text/css';
cssNode.rel = 'stylesheet';
cssNode.href = '/Asset_Archive/GPWeb/content/0001/678/547/assets/romance.css';
cssNode.media = 'screen';
headID.appendChild(cssNode);
}
};
Event.observe(window, 'load', executeRomanceTest);
/* -- Romance End -- */
//
if (window['productReviewService'] && productReviewService.controller.dataLoadManager.parsePaginatedDataResponse) {
productReviewService.controller.dataLoadManager.parsePaginatedDataResponse = function(transport,callBack) {
var response = null;
var responseJSON = null;
response = transport.responseText.replace(/(\n|\r)/g,"");
try {
responseJSON = response.evalJSON(clientBrowser.userAgent.indexOf('Safari') < 0);
if (responseJSON) {
var customerReviews = productReviewService.controller.dataLoadManager.ModelDataBuilder.mapCustomerReviews(responseJSON);
var productReview = productReviewService.model.data.productReviews[0];
productReview.customerReviews = productReview.customerReviews.concat(customerReviews.array);
Object.extend(productReview.customerReviewsMap, customerReviews.hash);
productReviewService.model.data.isDataLoading = false;
productReviewService.model.data.isAllDataLoaded = true;
productReviewService.controller.productManager.view.productReviewDetails.setDataToPage();
gidLib.inProgressIndicator.close();
if (callBack && callBack.callBackMethod) callBack.callBackMethod(callBack.callBackArgs);
}
} catch(e) {
e;
}
};
}
첫댓글 장바구니 상품쇼핑백부분을 합계부분까지 복사하여주세요^^