// Customer : SWAV Content
// Version : Standard Trigger 2.6
// this script implements the survey strategy. After number of pages visited is equal to or
// greater than 'stickFactor' apply the 'samplePercentage' rule to determine if this visitor
// gets the survey.

function cppUrlPatch(s) {
	var translated = "";
	var i; 
	var found = 0;
	for(i = 0; (found = s.indexOf(':', found)) != -1; ) {
		translated += s.substring(i, found) + "|";
		i = found + 1;
		found++;
	}
	translated += s.substring(i, s.length);
	return translated;
}

// ************* configuration variables - change the values, NOT THE NAMES **************
// parameter array which defines the behavior of the trigger - this must be included
// before the trigger script or if on-exit is  being done, must be included before the 
triggerParms = new Array();
triggerParms["mid"] = "6flEJ1Lay/UrZEcmALh1jA=="; // model instance id
triggerParms["cid"] = "podvF3NeoUT6X8MpZ45r5w=="; // customer id
triggerParms["lf"] =2; // loyalty factor
triggerParms["lfcookie"] = "ForeseeLoyalty_MID_impodvF3NeoU";
triggerParms["ascookie"] = "ForeseeSurveyShown_impodvF3NeoU";
triggerParms["sp"] = 1.0; // sample percentage
triggerParms["npc"] = 0; // no persistent cookies if 1
triggerParms["cpp_1"] = "userURL:"+ cppUrlPatch (window.location.protocol+"://" + window.location.host + window.location.pathname); // customer parameter 1 - optional. 
//triggerParms["cpp_2"] = "Browser:"+ cppUrlPatch (navigator.userAgent); // customer parameter 1 - optional. 
triggerParms["pu"] = 0; // pop-under control
triggerParms["rw"] = 129600; // resample wait (value in minutes)
triggerParms["dt"] = 0; // disable trigger if 1
triggerParms["width"] = 420; // used by version 2 standard trigger to resize the survey
triggerParms["height"] = 500; // used by version 2 standard trigger to resize the survey
triggerParms["domain"] = ".southwestvacations.com"; // domain attached to resample wait. Comment out the line if you want to use default domain.
triggerParms["path"] = "/"; // cookie path
//triggerParms["omb"] = "1505-0186"; // omb number
triggerParms["alt_width"] = 580; // used by version 2 standard trigger to resize the ADA Complaint survey
triggerParms["alt_height"] = 500; // used by version 2 standard trigger to resize the ADA Complaint survey

// these values will be set to "normal" values until we have version 2 triggers in production
// at that point, we will reset winOptWidth, winOptHeight, winOptTop, winOptLeft to
// 1, 1, 4000, 4000 respectively.  At that point the width and height above will be passed
// to the survey JSP page which will dynamically generate a JavaScript onLoad handler to 
// resize and translate to visible (for normal survey) or close off-screen (for failover)
triggerParms["winOptWidth"] = 1; // set to 1 for version 2 standard trigger
triggerParms["winOptHeight"] = 1; // set to 1 for version 2 standard trigger
triggerParms["winOptTop"] = 4000; // set to 4000 for version 2 standard trigger
triggerParms["winOptLeft"] = 4000; // set to 4000 for version 2 standard trigger

// if window contains one of these paths in its location while browsing 
// then the survey wont poped up. 
var excludeList = new Array();
//excludeList[0] = "/test/";//trigger script will not work under this path

