// Customer: KMart
// Version : DHTML Trigger 4.0
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;
}
var triggerParms = new Array(); 
var excludeList = new Array();
var flashTagList= new Array();
triggerParms["displayMode"] = 3; //0=disable, 1=popup then dhtml, 2=popup only, 3=default dhtml only
triggerParms["mid"] = "xN5cthFs4Ng1QUQJ4kENdQ=="; // model instance id
triggerParms["cid"] = "5AlZIBZxQAF9ZVYcRIEYwg=="; // customer id
triggerParms["lf"] = 3; // loyalty factor - number of pages viewed before survey pops up
triggerParms["sp"] = .4; // sample percentage - on page view after lf var, if your % is equal to this, survey pops
triggerParms["npc"] = 0; // no persistent cookies if 1 - 0 is off, so you will get a persistent cookie
triggerParms["rw"] = 129600; // resample wait (value in minutes) - time before you would be asked to take a survey again
triggerParms["pu"] = 0; // pop-under control - 0 - over main window; 1 - behind main window
triggerParms["olpu"] = 1; // On Load pop-under control - opposite value of pu
triggerParms["lfcookie"] = "ForeseeLoyalty_MID_xN5cthFs4N";
triggerParms["ascookie"] = "ForeseeSurveyShown_xN5cthFs4N";
triggerParms["width"] = 450; // survey width
triggerParms["height"] = 500; // survey height
triggerParms["domain"] = ".kmart.com"; // domain name
//triggerParms["omb"] = "1505-0186"; // OMB number
//triggerParms["cmetrics"] = "90010257"; // coremetrics client id
triggerParms["visualScienceId"] = 0;	// enable visual science code if 1
triggerParms["omnitureId"] = 0;		// enable omniture code if 1
triggerParms["cpp_1"] = "userURL:" + cppUrlPatch (window.location.href); //page you were on when survey popped
//triggerParms["cpp_5"] = "cpp_name:"+ cppUrlPatch("cpp_value");	//a placeholder for customer CPP's
triggerParms["capturePageView"] = 1; //other cpp should be passed 1 - on 0 - off
//excludeList[0] = "/exclude/"; //trigger script will not work under this path

//triggerParms["dcUniqueId"] = "TEST04JloZZN0k9cI1Ep5d"; //  (22 chars unique Id for double cookie I/II)
//triggerParms["midexp"] = 129600; // model instance expiry value
triggerParms["rso"]= 0; //user has chosen to use Retry Survey Option
triggerParms["aro"]= 0; //user has chosen to use Auto Retry Option, with SP=100
//triggerParms["rct"]= 1; //The maximum number of times allowed to serve a survey to a user
//triggerParms["rds"]= 1; //The minimum number of days to wait to serve a survey repeatedly
//triggerParms["mrd"]= 1; //The total number of days that a user can be re-served a survey

triggerParms["compliant508"] = 0; 	//508 compliant if 1

//DHTML Parameters
triggerParms["dhtmlIndex"]= 100;	// z-index s/b greater then client’s dhtml z-index (if exist) - default 100
triggerParms["dhtmlWidth"] = 400;	// welcome page width
triggerParms["dhtmlHeight"] = 290;	// welcome page height
triggerParms["dhtmlURL"]= "http://www.kmart.com/ue/home/FSRInvite.html";

//DHTML Positioning
//center		bottom-center		bottom-right		bottom-left          upper-right           upper-left
//x,y = (2,150)		x,y = (2,350)		x,y = (1.02,350)	x,y = (60,350)     x,y = (1.02,50)     x,y = (60,50)
//replace (x,y) below with any one of the above, default = center

var xCor=3.8;
var yCor=180;

triggerParms["dhtmlLeft"] = (self.screen.width - triggerParms["dhtmlWidth"])/xCor;			//invite page left position**DO NOT MODIFY**
triggerParms["dhtmlTop"] = Math.min((self.screen.height - triggerParms["dhtmlHeight"])/2,yCor);	//invite page top position**DO NOT MODIFY**

//FLASH Parameters - not to be used with other embedded objects e.g. (.dcr/.mov/.mpeg/.avi/.wma/.wmv/.aam/.rm/.ram)
triggerParms["flashDetect"]= 0;		// check if page has flash embedded with a valid browser & player ver before showing  dhtml - disable if 0
flashTagList[0]= "swf";			// flash src check for IE/NE complaint browsers
flashTagList[1]= "spl";			// splash src check for IE/NE complaint browsers
flashTagList[2]= "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000";	//activeX ID check for IE browsers only
triggerParms["inviteDelay"]= 1000;	// invite timeout in millisecs - default 1000ms=1sec

//List of Multiple Survey Vendors - uncomment variables below & add corresponding SP and URL
//var multiVendorSP= new Array();
//var multiVendorURL= new Array();
//multiVendorSP[0] = 0;		// sampling percentage for another vendor - disable if commented
//multiVendorURL[0] = "";	// absolute path to the third-party script - disable if commented

//Foresee System Paramters
triggerParms["captureTriggerVersion"] = "STD4.0";	// track latest trigger version