function VoviciWebInterceptSurvey(){
this.utils=new VoviciSurveyUtils();
this.SurveyUrl="";
this.ExitSurveyUrl="";
this.ShoppingCartAbandonmentSurveyUrl="";
this.ShoppingCartCompletedSurveyUrl="";
this.FailoverToLayerWhenPopupsBlocked=false;
this.ShoppingCartCookieName="";
this.ShoppingCartRegex="";
this.PurchaseMadeCookieName="";
this.PurchaseMadeRegex="";
this.WatcherJavascriptUrl="/common/js/VoviciSurveyInvite.js";
this.NthVisitorToInvite=1;
this.SurveyInNewWindow=false;
this.SurveyWindowWidth=625;
this.SurveyWindowHeight=400;
this.SurveyWindowLeftOffset=200;
this.SurveyWindowTopOffset=100;
this.SurveyWindowDecorationOptions="scrollbars=yes, resizable=true, location=no, toolbar=no, menubar=no";
this.SurveyWindowName="VoviciSurvey";
this.CookieDomain="";
this.CookieValue="1";
this.CookieDuration="";
this.CookiePath="/";
this.CookieName="VOVICI_SURVEY_INVITE";
this.LaunchExitSurveyCookieValue="2";
this.InviteStyle="popup";
this.SurveyPrompt="We'd like your input! Please take a few moments to complete a brief survey.";
this.SurveyPromptDivInnerHtml="<map name=\"VoviciSurveyPromptMap\">"+"<area id=\"VoviciSurveyPromptYesButton\" shape=\"rect\" coords=\"65,125,225,175\" >"+"<area id=\"VoviciSurveyPromptNoButton\" shape=\"rect\" coords=\"340,125,500,175\" >"+"<area shape=\"default\" nohref>"+"</map><img src=\"surveyinvite1.gif\" border=\"0\" usemap=\"#VoviciSurveyPromptMap\">";
this.SurveyPromptDivYesButtonId="VoviciSurveyPromptYesButton";
this.SurveyPromptDivNoButtonId="VoviciSurveyPromptNoButton";
this.SurveyPromptDivWidth=575;
this.SurveyPromptDivHeight=179;
this.SurveyPromptDivLeftOffset=200;
this.SurveyPromptDivTopOffset=100;
this.SurveyFrameName="VoviciSurveyFrameOuterDiv";
this.SurveyInnerFrameName="VoviciSurveyFrameInnerDiv";
this.SurveyDisplayFrameInnerHtml="<div id=\""+this.SurveyFrameName+"\" style=\"background-color:#FFFFFF;border: 1px solid #E2E5E7;\">"+"  <div id=\""+this.SurveyPromptDivNoButtonId+"\" style=\"text-align:right; color: red\">[x]</div>"+"<div id=\""+this.SurveyInnerFrameName+"\" ></div>"+"</div>";
this.URLParameters=new Array();
this.SurveyPromptDivName="VoviciSurveyInvite_Prompt";
this.div;
this.toString=function(){
return "VoviciWebInterceptSurvey internal state:"+"\n\tDebuggingEnabled: "+this.utils.DebuggingEnabled+"\n\tSurveyUrl: "+this.GetSurveyUrl()+"\n\tNthVisitorToInvite: "+this.NthVisitorToInvite+"\n\tInviteStyle: "+survey.InviteStyle+"\n"+"\n\tSurveyPrompt: "+this.SurveyPrompt+"\n\tSurveyPromptDivName: "+this.SurveyPromptDivName+"\n\tSurveyPromptDivInnerHtml: "+this.SurveyPromptDivInnerHtml+"\n\tSurveyPromptDivYesButtonId: "+this.SurveyPromptDivYesButtonId+"\n\tSurveyPromptDivNoButtonId: "+this.SurveyPromptDivNoButtonId+"\n\tSurveyPromptDivWidth: "+this.SurveyPromptDivWidth+"\n\tSurveyPromptDivHeight: "+this.SurveyPromptDivHeight+"\n\tSurveyPromptDivLeftOffset: "+this.SurveyPromptDivLeftOffset+"\n\tSurveyPromptDivTopOffset: "+this.SurveyPromptDivTopOffset+"\n"+"\n\tSurveyInNewWindow: "+this.SurveyInNewWindow+"\n\tSurveyWindowWidth: "+this.SurveyWindowWidth+"\n\tSurveyWindowHeight: "+this.SurveyWindowHeight+"\n\tSurveyWindowLeftOffset: "+this.SurveyWindowLeftOffset+"\n\tSurveyWindowTopOffset: "+this.SurveyWindowTopOffset+"\n\tSurveyWindowDecorationOptions: "+this.SurveyWindowDecorationOptions+"\n\tSurveyWindowName: "+this.SurveyWindowName+"\n"+"\n\tSurveyFrameName: "+this.SurveyFrameName+"\n\tSurveyInnerFrameName: "+this.SurveyInnerFrameName+"\n\tSurveyDisplayFrameInnerHtml : "+this.SurveyDisplayFrameInnerHtml+"\n"+"\n\tCookieDomain: "+this.CookieDomain+"\n\tCookieName: "+this.CookieName+"\n\tCookieValue: "+this.CookieValue+"\n\tCookiePath: "+this.CookiePath+"\n\tCookieDuration: "+this.CookieDuration+"\n\nCookies:\n\n"+"\n\t"+this.CookieName+": "+this.utils.GetCookie(this.CookieName)+"\n"+"\n\tLaunchExitSurvey: "+this.LaunchExitSurvey()+"\n\tFailoverToLayerWhenPopupsBlocked: "+this.FailoverToLayerWhenPopupsBlocked+"\n\tExitSurveyUrl: "+this.GetExitSurveyUrl()+"\n\tShoppingCartAbandonmentSurveyUrl: "+this.GetShoppingCartAbandonmentSurveyUrl()+"\n\tShoppingCartCompletedSurveyUrl: "+this.GetShoppingCartCompletedSurveyUrl()+"\n\tShoppingCartCookieName: "+this.ShoppingCartCookieName+"\n\tShoppingCartRegex: "+this.ShoppingCartRegex+"\n\tPurchaseMadeCookieName: "+this.PurchaseMadeCookieName+"\n\tPurchaseMadeRegex: "+this.PurchaseMadeRegex+"\n\tWatcherJavascriptUrl: "+this.WatcherJavascriptUrl;
};
this.DebuggingEnabled=function(_1){
this.utils.DebuggingEnabled=_1;
};
this.Load=function(){
var _2=this;
this.utils.DebugLog("Adding window.onload handler for Web Intercept Survey Load");
this.utils.AddEvent(window,"load",function(){
_2.CheckForInvite();
});
};
this.TestLoad=function(){
var _3=this;
this.utils.AddEvent(window,"load",function(){
_3.YesButtonClicked();
});
};
this.CheckForInvite=function(){
if(this.utils.GetCookie(this.CookieName)==this.LaunchExitSurveyCookieValue){
if(this.LaunchExitSurvey()){
this.ExitSurvey();
}
}else{
if(this.utils.GetCookie(this.CookieName)!=this.CookieValue){
this.utils.SetCookie(this.CookieName,this.CookieValue,this.CookieDomain,this.CookieDuration,this.CookiePath);
if(this.utils.GetRandom(this.NthVisitorToInvite)==this.NthVisitorToInvite){
this.Invite();
}
}
}
};
this.Invite=function(){
if(this.InviteStyle=="popup"){
if(confirm(this.SurveyPrompt)){
this.YesButtonClicked();
}
}else{
this.Create(this.SurveyPromptDivName,this.SurveyPromptDivInnerHtml,this.SurveyPromptDivYesButtonId,this.SurveyPromptDivNoButtonId,this.SurveyPromptDivWidth,this.SurveyPromptDivHeight,this.SurveyPromptDivLeftOffset,this.SurveyPromptDivTopOffset);
}
};
this.Create=function(id,_5,_6,_7,_8,_9,_a,_b){
this.utils.DebugLog("VoviciWebInterceptSurvey.Create");
var _c="VoviciSurveyPromptContainer_"+id;
this.SurveyPromptDivName=id;
var _d=document.createElement("div");
_d.style.display="none";
_d.setAttribute("id",_c);
_d.setAttribute("name",_c);
_d.innerHTML=_5;
document.body.appendChild(_d);
this.div=document.getElementById(this.SurveyPromptDivName);
this.div.style.width=_8?_8:575;
this.div.style.height=_9?_9:179;
if((_a||_b)||(_a&&_b)){
this.div.style.position="absolute";
this.div.style.left=_a?_a:200;
this.div.style.top=_b?_b:200;
}
var _e=this;
if(_6){
var _f=document.getElementById(_6);
if(_f){
this.utils.AddEvent(_f,"click",function(){
_e.YesButtonClicked();
});
}
}
if(_7){
var no=document.getElementById(_7);
if(no){
this.utils.AddEvent(no,"click",function(){
_e.NoButtonClicked();
});
}
}
_d.style.display="block";
};
this.YesButtonClicked=function(){
this.Hide();
if(this.LaunchExitSurvey()){
this.utils.SetCookie(this.CookieName,this.LaunchExitSurveyCookieValue,this.CookieDomain,this.CookieDuration,this.CookiePath);
this.ExitSurvey();
}else{
if(this.SurveyInNewWindow){
var _11="width="+this.SurveyWindowWidth+",height="+this.SurveyWindowHeight+","+"top="+this.SurveyWindowTopOffset+",left="+this.SurveyWindowLeftOffset+","+this.SurveyWindowDecorationOptions;
var _12=window.open(this.GetSurveyUrl(),this.SurveyWindowName,_11);
_12.focus();
}else{
window.location=this.GetSurveyUrl();
}
}
return false;
};
this.ExitSurvey=function(){
var _13=new VoviciExitSurvey();
_13.CookieDomain=this.CookieDomain;
_13.CookieValue=this.CookieValue;
_13.CookieDuration=this.CookieDuration;
_13.CookiePath=this.CookiePath;

// START Update Script code
_13.Invitation_State_CookieName =this.CookieName; 
_13.Invitation_State_CookieInvited = this.LaunchExitSurveyCookieValue;
// END Update Script code

_13.ShoppingCartCookieName=this.ShoppingCartCookieName;
_13.ShoppingCartRegex=this.ShoppingCartRegex;
_13.PurchaseMadeCookieName=this.PurchaseMadeCookieName;
_13.PurchaseMadeRegex=this.PurchaseMadeRegex;
_13.PromptToTakeTheSurvey=false;
_13.WatcherJavascriptUrl=this.WatcherJavascriptUrl;
_13.ExitSurveyUrl=this.ExitSurveyUrl;
_13.ShoppingCartAbandonmentSurveyUrl=this.ShoppingCartAbandonmentSurveyUrl;
_13.ShoppingCartCompletedSurveyUrl=this.ShoppingCartCompletedSurveyUrl;
_13.FailoverToLayerWhenPopupsBlocked=this.FailoverToLayerWhenPopupsBlocked;
_13.URLParameters=this.URLParameters;
_13.SurveyWindowWidth=this.SurveyWindowWidth;
_13.SurveyWindowHeight=this.SurveyWindowHeight;
_13.SurveyWindowLeftOffset=this.SurveyWindowLeftOffset;
_13.SurveyWindowTopOffset=this.SurveyWindowTopOffset;
_13.SurveyWindowDecorationOptions=this.SurveyWindowDecorationOptions;
_13.SurveyFrameName=this.SurveyFrameName;
_13.SurveyInnerFrameName=this.SurveyInnerFrameName;
_13.SurveyDisplayFrameInnerHtml=this.SurveyDisplayFrameInnerHtml;
_13.DebuggingEnabled(this.utils.DebuggingEnabled);
_13.SetupWatcher();
return false;
};
this.NoButtonClicked=function(){
this.utils.SetCookie(this.CookieName,this.CookieValue,this.CookieDomain,this.CookieDuration,this.CookiePath);
this.Hide();
return false;
};
this.Hide=function(){
if(this.div){
this.div.style.display="none";
}
};
this.Show=function(){
if(this.div){
this.div.style.display="block";
}
};
this.GetSurveyUrl=function(){
return this.SurveyUrl;
};
this.GetExitSurveyUrl=function(){
return this.utils.AddUrlParameters(this.ExitSurveyUrl,this.URLParameters);
};
this.GetShoppingCartAbandonmentSurveyUrl=function(){
return this.utils.AddUrlParameters(this.ShoppingCartAbandonmentSurveyUrl,this.URLParameters);
};
this.GetShoppingCartCompletedSurveyUrl=function(){
return this.utils.AddUrlParameters(this.ShoppingCartCompletedSurveyUrl,this.URLParameters);
};
this.AddUrlParameter=function(_14,val){
this.URLParameters[_14]=val;
};
this.LaunchExitSurvey=function(){
return this.ExitSurveyUrl!=""||this.ShoppingCartAbandonmentSurveyUrl!=""||this.ShoppingCartCompletedSurveyUrl!="";
};
};
function VoviciExitSurvey(){
this.utils=new VoviciSurveyUtils();
this.WatcherJavascriptUrl="/common/js/VoviciSurveyInvite.js";
this.ExitSurveyUrl="";
this.ShoppingCartAbandonmentSurveyUrl="";
this.ShoppingCartCompletedSurveyUrl="";
this.FailoverToLayerWhenPopupsBlocked=false;
this.NthVisitorToInvite=1;
this.SurveyInNewWindow=false;
this.SurveyWindowWidth=625;
this.SurveyWindowHeight=400;
this.SurveyWindowLeftOffset=200;
this.SurveyWindowTopOffset=100;
this.SurveyWindowDecorationOptions="scrollbars=yes, resizable=true, location=no, toolbar=no, menubar=no";
this.SurveyWindowName="VoviciExitSurvey";
this.CookieDomain="";
this.CookieValue="1";
this.CookieDuration="1440";
this.CookiePath="/";
this.CookieName="VOVICI_EXIT_SURVEY_INVITE";
// START Update Script code
this.Invitation_State_CookieName = "";
this.Invitation_State_CookieInvited = "";
// END Update Script code
this.ShoppingCartCookieName="";
this.ShoppingCartRegex="";
this.PurchaseMadeCookieName="";
this.PurchaseMadeRegex="";
this.PromptToTakeTheSurvey=true;
this.InviteStyle="popup";
this.SurveyPrompt="We'd like your input! Please take a few moments to complete a brief survey.";
this.SurveyPromptDivInnerHtml="<map name=\"VoviciSurveyPromptMap\">"+"<area id=\"VoviciSurveyPromptYesButton\" shape=\"rect\" coords=\"65,125,225,175\" >"+"<area id=\"VoviciSurveyPromptNoButton\" shape=\"rect\" coords=\"340,125,500,175\" >"+"<area shape=\"default\" nohref>"+"</map><img src=\"surveyinvite1.gif\" border=\"0\" usemap=\"#VoviciSurveyPromptMap\">";
this.SurveyPromptDivYesButtonId="VoviciSurveyPromptYesButton";
this.SurveyPromptDivNoButtonId="VoviciSurveyPromptNoButton";
this.SurveyPromptDivWidth=575;
this.SurveyPromptDivHeight=179;
this.SurveyPromptDivLeftOffset=200;
this.SurveyPromptDivTopOffset=100;
this.WatcherMessageDivName="VoviciWatcherMessage";
this.WatcherMessage="<div style=\"height:100px;text-align:left;padding-left:3px; font: bold 14px arial, helvetica, sans-serif; color:E20074;\">The T-mobile visitor survey will appear in this window when you leave the website. Please do not close this window if you wish to take part in the survey.</div>";
this.SurveyFrameName="VoviciSurveyFrameOuterDiv";
this.SurveyInnerFrameName="VoviciSurveyFrameInnerDiv";
this.SurveyDisplayFrameInnerHtml="<div id=\""+this.SurveyFrameName+"\" style=\"background-color:#FFFFFF;border: 1px solid #E2E5E7;\">"+"  <div id=\""+this.SurveyPromptDivNoButtonId+"\" style=\"text-align:right; color: red\">[x]</div>"+"<div id=\""+this.SurveyInnerFrameName+"\" ></div>"+"</div>";
this.SurveyPromptDivName="VoviciExitSurveyInvite_Prompt";
this.TimerInterval=new Number(1000);
this.TimerId;
this.Watcher;
this.WatcherWindowName="VoviciExitSurveyWatcher";
this.WatcherWindowDecorationOptions="scrollbars=no, resizable=true, location=no, toolbar=no, menubar=no";
this.URLParameters=new Array();
};
VoviciExitSurvey.prototype.DebuggingEnabled=function(_16){
this.utils.DebuggingEnabled=_16;
};
VoviciExitSurvey.prototype.toString=function(){
return "VoviciExitSurvey internal state:"+"\n\tDebuggingEnabled: "+this.utils.DebuggingEnabled+"\n\tFailoverToLayerWhenPopupsBlocked: "+this.FailoverToLayerWhenPopupsBlocked+"\n\tExitSurveyUrl: "+this.GetExitSurveyUrl()+"\n\tShoppingCartAbandonmentSurveyUrl: "+this.GetShoppingCartAbandonmentSurveyUrl()+"\n\tShoppingCartCompletedSurveyUrl: "+this.GetShoppingCartCompletedSurveyUrl()+"\n\tNthVisitorToInvite: "+this.NthVisitorToInvite+"\n"+"\n\tInviteStyle: "+this.InviteStyle+"\n\tPromptToTakeTheSurvey: "+this.PromptToTakeTheSurvey+"\n\tSurveyPrompt: "+this.SurveyPrompt+"\n\tSurveyPromptDivName: "+this.SurveyPromptDivName+"\n\tSurveyPromptDivInnerHtml: "+this.SurveyPromptDivInnerHtml+"\n\tSurveyPromptDivYesButtonId: "+this.SurveyPromptDivYesButtonId+"\n\tSurveyPromptDivNoButtonId: "+this.SurveyPromptDivNoButtonId+"\n\tSurveyPromptDivWidth: "+this.SurveyPromptDivWidth+"\n\tSurveyPromptDivHeight: "+this.SurveyPromptDivHeight+"\n\tSurveyPromptDivLeftOffset: "+this.SurveyPromptDivLeftOffset+"\n\tSurveyPromptDivTopOffset: "+this.SurveyPromptDivTopOffset+"\n"+"\n\tSurveyInNewWindow: "+this.SurveyInNewWindow+"\n\tSurveyWindowWidth: "+this.SurveyWindowWidth+"\n\tSurveyWindowHeight: "+this.SurveyWindowHeight+"\n\tSurveyWindowLeftOffset: "+this.SurveyWindowLeftOffset+"\n\tSurveyWindowTopOffset: "+this.SurveyWindowTopOffset+"\n\tSurveyWindowDecorationOptions: "+this.SurveyWindowDecorationOptions+"\n\tSurveyWindowName: "+this.SurveyWindowName+"\n"+"\n\tSurveyFrameName: "+this.SurveyFrameName+"\n\tSurveyInnerFrameName: "+this.SurveyInnerFrameName+"\n\tSurveyDisplayFrameInnerHtml : "+this.SurveyDisplayFrameInnerHtml+"\n"+"\n\tTimerInterval: "+this.TimerInterval+"\n"+"\n\tCookieDomain: "+this.CookieDomain+"\n\tCookieName: "+this.CookieName+"\n\tCookieValue: "+this.CookieValue+"\n\tCookiePath: "+this.CookiePath+"\n\tCookieDuration: "+this.CookieDuration+"\n\nCookies:\n\n"+"\n\t"+this.CookieName+": "+this.utils.GetCookie(this.CookieName);
};
VoviciExitSurvey.prototype.GetExitSurveyUrl=function(){
return this.utils.AddUrlParameters(this.ExitSurveyUrl,this.URLParameters);
};
VoviciExitSurvey.prototype.GetShoppingCartAbandonmentSurveyUrl=function(){
return this.utils.AddUrlParameters(this.ShoppingCartAbandonmentSurveyUrl,this.URLParameters);
};
VoviciExitSurvey.prototype.GetShoppingCartCompletedSurveyUrl=function(){
return this.utils.AddUrlParameters(this.ShoppingCartCompletedSurveyUrl,this.URLParameters);
};
VoviciExitSurvey.prototype.AddUrlParameter=function(_17,val){
this.URLParameters[_17]=val;
};
VoviciExitSurvey.prototype.Load=function(){
var _19=this;
this.utils.DebugLog("Adding window.onload handler for SetupWatcher");
this.utils.AddEvent(window,"load",function(){
_19.SetupWatcher();
});
};
VoviciExitSurvey.prototype.SetupWatcher=function(){
this.utils.DebugLog("SetupWatcher starting..");
var _1a=new Boolean(false);
var _1b=new Boolean(false);
this.WatcherLaunch();
this.Check(_1a,_1b);
var _1c=this;
this.utils.DebugLog("Setting timer for Check at interval "+this.TimerInterval);
this.TimerId=setInterval(function(){
_1c.Check(_1a,_1b);
},this.TimerInterval);
};
VoviciExitSurvey.prototype.WatcherLaunch=function(){
var _1d=this.utils.GetCookie(this.CookieName);
this.utils.DebugLog("WatcherLaunch: "+_1d);
var _1e=new Boolean(true);
var _1f=new Boolean(true);
// START Update Script code
var _1g = this.utils.GetCookie(this.Invitation_State_CookieName);
if((!_1d||_1d=="") || _1g =="2"){

this.Check(_1e,_1f);
this.utils.DebugLog("Opening watcher window");
var _20=(document.all)?window.screenLeft:window.screenX;
var top=(document.all)?window.screenTop:window.screenY;
var _22=300;
var _23=50;
var _24="width="+_22+",height="+_23+","+"top="+top+",left="+_20+","+this.WatcherWindowDecorationOptions;
var _25=window.open("",this.WatcherWindowName,_24);
	if (_25) {
		try {
		_25.document.write("<html><head><title>Vovici Exit Survey Watcher</title></head></html>");
		} catch(e) {
			return;
		}
	}
if(_25){
this.Watcher=_25;
var _26="";

for (var key in this.URLParameters){
       // Try to find '&' character in KEY, because all parameters in URL format must have '&' before key name
       //   watcher.AddUrlParameter('each', "function(iterator, context) {    var index = 0;    iterator = iterator.bind(context);    try {      this._each(function(value) {        iterator(value, index++);      });    } catch (e) {      if (e != $break) throw e;    }    return this;  }");
       //   watcher.AddUrlParameter('&page', "/D:/Projects/Test.html");
       if(key.toString().indexOf('&') != -1)
        _26 += "   watcher.AddUrlParameter('" + key + "', \"" + this.URLParameters[key] + "\");\n"
   }
   var writeHTML = "<html><head><title>Vovici Exit Survey Watcher</title>\n"+"<script type='text/javascript' language='javascript' src='"+this.WatcherJavascriptUrl+"'></script>\n"+"<script type='text/javascript' language='javascript'>\n"+"<!--\n"+"function LoadWatcher() {\n"+"  var watcher = new VoviciSurveyWatcher();\n"+"  watcher.DebuggingEnabled("+this.utils.DebuggingEnabled+");\n"+"  watcher.ExitSurveyUrl ='"+this.ExitSurveyUrl+"';\n"
// START Update Script code
				+ "  watcher.Invitation_State_CookieName ='" + this.Invitation_State_CookieName + "';\n"
				+ "  watcher.Invitation_State_CookieValue ='" + this.CookieValue + "';\n"
				+ "  watcher.CookieDomain ='" + this.CookieDomain + "';\n"
				+ "  watcher.CookieDuration ='" + this.CookieDuration + "';\n"
				+ "  watcher.CookiePath ='" + this.CookiePath + "';\n"
// END Update Script code				
                + "  watcher.ShoppingCartAbandonmentSurveyUrl ='"+this.ShoppingCartAbandonmentSurveyUrl+"';\n"+"  watcher.ShoppingCartCompletedSurveyUrl ='"+this.ShoppingCartCompletedSurveyUrl+"';\n"+_26+"  watcher.ShoppingCartCookieName ='"+this.ShoppingCartCookieName+"';\n"+"  watcher.ShoppingCartRegex ='"+this.ShoppingCartRegex+"';\n"+"  watcher.PurchaseMadeCookieName ='"+this.PurchaseMadeCookieName+"';\n"+"  watcher.PurchaseMadeRegex ='"+this.PurchaseMadeRegex+"';\n"+"  watcher.PromptToTakeTheSurvey = "+this.PromptToTakeTheSurvey+";\n"+"  watcher.WatcherMessageDivName='"+this.WatcherMessageDivName+"';\n"+"  watcher.SurveyPromptDivName='"+this.SurveyPromptDivName+"';\n"+"  watcher.SurveyPromptDivYesButtonId='"+this.SurveyPromptDivYesButtonId+"';\n"+"  watcher.SurveyPromptDivNoButtonId='"+this.SurveyPromptDivNoButtonId+"';\n"+"  watcher.SurveyPromptDivWidth= "+this.SurveyPromptDivWidth+";\n"+"  watcher.SurveyPromptDivHeight= "+this.SurveyPromptDivHeight+";\n"+"  watcher.SurveyPromptDivLeftOffset= "+this.SurveyPromptDivLeftOffset+";\n"+"  watcher.SurveyPromptDivTopOffset= "+this.SurveyPromptDivTopOffset+";\n"+"  watcher.SurveyWindowWidth= "+this.SurveyWindowWidth+";\n"+"  watcher.SurveyWindowHeight= "+this.SurveyWindowHeight+";\n"+"  watcher.SurveyWindowLeftOffset= "+this.SurveyWindowLeftOffset+";\n"+"  watcher.SurveyWindowTopOffset= "+this.SurveyWindowTopOffset+";\n"+"  watcher.WatcherLoad();\n"+"}\n"+"// -->\n"+"</script>\n</head>\n<body onload='LoadWatcher()'>\n"+"<div id='"+this.SurveyPromptDivName+"' style='display:none'>"+this.SurveyPromptDivInnerHtml+"</div>\n<div id='"+this.WatcherMessageDivName+"'>"+this.WatcherMessage+"</div>\n"+"</body>\n</html>";
				
	this.Watcher.document.write(writeHTML);

this.Watcher.document.close();
if(!this.Watcher.opener){
this.Watcher.opener=self;
}
if(!this.TimerId){
var _28=this;
this.TimerId=setInterval(function(){
_28.Check(_1e,_1f);
},this.TimerInterval);
}
}else{
if(this.FailoverToLayerWhenPopupsBlocked){
var _29=new VoviciSurveyWatcher();
_29.IsAPopup=false;
_29.DebuggingEnabled(this.utils.DebuggingEnabled);
_29.ExitSurveyUrl=this.ExitSurveyUrl;
// START Update Script code
_29.Invitation_State_CookieName = this.Invitation_State_CookieName;
_29.Invitation_State_CookieValue = this.CookieValue;
_29.CookieDomain = this.CookieDomain;
_29.CookieDuration = this.CookieDuration;
_29.CookiePath = this.CookiePath;
// END Update Script code
_29.ShoppingCartAbandonmentSurveyUrl=this.ShoppingCartAbandonmentSurveyUrl;
_29.ShoppingCartCompletedSurveyUrl=this.ShoppingCartCompletedSurveyUrl;
_29.URLParameters=this.URLParameters;
_29.ShoppingCartCookieName=this.ShoppingCartCookieName;
_29.ShoppingCartRegex=this.ShoppingCartRegex;
_29.PurchaseMadeCookieName=this.PurchaseMadeCookieName;
_29.PurchaseMadeRegex=this.PurchaseMadeRegex;
_29.PromptToTakeTheSurvey=this.PromptToTakeTheSurvey;
_29.WatcherMessageDivName=this.WatcherMessageDivName;
_29.SurveyPromptDivName=this.SurveyPromptDivName;
_29.SurveyPromptDivYesButtonId=this.SurveyPromptDivYesButtonId;
_29.SurveyPromptDivNoButtonId=this.SurveyPromptDivNoButtonId;
_29.SurveyPromptDivWidth=this.SurveyPromptDivWidth;
_29.SurveyPromptDivHeight=this.SurveyPromptDivHeight;
_29.SurveyPromptDivLeftOffset=this.SurveyPromptDivLeftOffset;
_29.SurveyPromptDivTopOffset=this.SurveyPromptDivTopOffset;
_29.SurveyWindowWidth=this.SurveyWindowWidth;
_29.SurveyWindowHeight=this.SurveyWindowHeight;
_29.SurveyWindowLeftOffset=this.SurveyWindowLeftOffset;
_29.SurveyWindowTopOffset=this.SurveyWindowTopOffset;
_29.SurveyFrameName=this.SurveyFrameName;
_29.SurveyInnerFrameName=this.SurveyInnerFrameName;
_29.SurveyDisplayFrameInnerHtml=this.SurveyDisplayFrameInnerHtml;
_29.Activate();
}
}
}else{
this.Test(true);
}
};
VoviciExitSurvey.prototype.ChangeLinks=function(){
this.utils.DebugLog("ExitSurveyChangeLinks..");
var _2a=document.getElementsByTagName("a");
var _2b=this;
for(var i=0;i<_2a.length;i++){
if(_2a[i].href!=""){
this.utils.DebugLog("Adding ExitSurveyWatcherLaunch to link to "+_2a[i].href);
var obj=_2a[i];
_2a[i].onclick=function(){
_2b.ExitSurveyWatcherLaunch();
};
}
}
};
VoviciExitSurvey.prototype.Check=function(_2e,_2f){
if(_2e==false){
if(this.utils.GetCookie(this.CookieName)!=""){
this.Update();
return null;
}
}else{
if(_2f==true){
this.Update();
return null;
}else{
if(this.utils.GetCookie(this.CookieName)!=""){
this.Update();
return null;
}else{
this.Clear();
return null;
}
}
}
};
VoviciExitSurvey.prototype.Update=function(){
this.utils.SetCookie(this.CookieName,Date(),this.CookieDomain,this.CookieDuration,this.CookiePath);
};
VoviciExitSurvey.prototype.CheckCookie=function(_30){
strDate=this.utils.GetCookie(_30);
if(strDate!=null&&strDate!=""){
return true;
}else{
return false;
}
};
VoviciExitSurvey.prototype.Clear=function(){
if(this.TimerId){
clearTimeout(this.TimerId);
}
if(this.utils.GetCookie(this.CookieName)!=""){
this.utils.DeleteCookie(this.CookieName);
}
return null;
};
VoviciExitSurvey.prototype.Test=function(_31){
var _32=this.utils.GetCookie(this.CookieName);
if(_31==false){
if(_32!=""){
this.utils.DebugLog("ExitSurveyTest: "+_32);
}
}else{
this.utils.DebugLog("Watcher Window already launched! Close the watcher window and try again!");
}
};
function VoviciSurveyWatcher(){
this.utils=new VoviciSurveyUtils();
this.CookieName="VOVICI_EXIT_SURVEY_INVITE";
// START Update Script code
this.Invitation_State_CookieName = "";
this.Invitation_State_CookieValue = ""; 
this.CookieDomain = "";
this.CookieDuration = "";
this.CookiePath = "";
// END Update Script code
this.PromptToTakeTheSurvey=true;
this.ExitSurveyUrl="";
this.ShoppingCartAbandonmentSurveyUrl="";
this.ShoppingCartCompletedSurveyUrl="";
this.ShoppingCartCookieName="";
this.ShoppingCartRegex="";
this.PurchaseMadeCookieName="";
this.PurchaseMadeRegex="";
this.SurveyUrl="";
this.SurveyPromptDivName="VoviciSurveyInvite_Prompt";
this.SurveyPromptDivYesButtonId="VoviciSurveyPromptYesButton";
this.SurveyPromptDivNoButtonId="VoviciSurveyPromptNoButton";
this.WatcherMessageDivName="VoviciWatcherMessage";
this.SurveyPromptDivWidth=575;
this.SurveyPromptDivHeight=179;
this.SurveyPromptDivLeftOffset=200;
this.SurveyPromptDivTopOffset=100;
this.SurveyWindowWidth=400;
this.SurveyWindowHeight=600;
this.SurveyWindowLeftOffset=100;
this.SurveyWindowTopOffset=100;
this.SurveyFrameName="VoviciSurveyFrameOuterDiv";
this.SurveyInnerFrameName="VoviciSurveyFrameInnerDiv";
this.SurveyDisplayFrameInnerHtml="<div id=\""+this.SurveyFrameName+"\" style=\"background-color:#FFFFFF;border: 1px solid #E2E5E7;\">"+"  <div id=\""+this.SurveyPromptDivNoButtonId+"\" style=\"text-align:right; color: red\">[x]</div>"+"<div id=\""+this.SurveyInnerFrameName+"\" ></div>"+"</div>";
this.TimerId;
this.TimerInterval=new Number(8000);
this.IsAPopup=true;
this.IFrameObj;
this.URLParameters=new Array();
};
VoviciSurveyWatcher.prototype.DebuggingEnabled=function(_33){
this.utils.DebuggingEnabled=_33;
};
VoviciSurveyWatcher.prototype.Load=function(){
this.utils.AddEvent(window,"load",function(){
watcher.WatcherLoad();
});
};
VoviciSurveyWatcher.prototype.WatcherLoad=function(){
this.utils.DebugLog("Load");
self.blur();
var _34=this;
this.utils.AddEvent(window,"unload",function(){
_34.Unload();
});
_34.StartChecking();
};
VoviciSurveyWatcher.prototype.StartChecking=function(){
this.utils.DebugLog("StartChecking");
this.Blur();
this.Clear();
this.CheckCondition();
var _35=this;
this.TimerId=setInterval(function(){
_35.CheckCondition();
},this.TimerInterval);
};
VoviciSurveyWatcher.prototype.Unload=function(){
this.utils.DebugLog("Unload");
this.Clear();
if(this.utils.GetCookie(this.Invitation_State_CookieName)==this.Invitation_State_CookieValue){
 	window.self.focus();	
}
this.utils.DeleteCookie(this.CookieName);
};
VoviciSurveyWatcher.prototype.Blur=function(){
this.utils.DebugLog("Blur");
if(!this.utils.DebuggingEnabled){
window.self.blur();
}
};
VoviciSurveyWatcher.prototype.CheckCondition=function(){
this.utils.DebugLog("CheckCondition");
var _36=new Date();
var _37;
var _38;
var _39=this.utils.GetCookie(this.CookieName);
var _3a=new Number(-1);
if(_39!=""){
_37=new Date(_39);
_38=new Date();
_38.setDate(_36.getDate());
_38=new Date(_38.toGMTString());
_3a=_38-_37;
this.Hide();
this.Test();
}else{
this.Clear();
this.Activate();
return null;
}
if((_3a==-1)||(_3a>=this.TimerInterval)){
this.Clear();
this.Activate();
return null;
}
};
VoviciSurveyWatcher.prototype.Clear=function(){
if(this.TimerId){
clearTimeout(this.TimerId);
}
return null;
};
VoviciSurveyWatcher.prototype.Hide=function(){
this.Blur();
};
VoviciSurveyWatcher.prototype.GetExitSurveyUrl=function(){
return this.utils.AddUrlParameters(this.ExitSurveyUrl,this.URLParameters);
};
VoviciSurveyWatcher.prototype.GetShoppingCartAbandonmentSurveyUrl=function(){
return this.utils.AddUrlParameters(this.ShoppingCartAbandonmentSurveyUrl,this.URLParameters);
};
VoviciSurveyWatcher.prototype.GetShoppingCartCompletedSurveyUrl=function(){
return this.utils.AddUrlParameters(this.ShoppingCartCompletedSurveyUrl,this.URLParameters);
};
VoviciSurveyWatcher.prototype.AddUrlParameter=function(_3b,val){
this.URLParameters[_3b]=val;
};
VoviciSurveyWatcher.prototype.Activate=function(){
// START Update Script code
this.utils.SetCookie(this.Invitation_State_CookieName, this.Invitation_State_CookieValue, this.CookieDomain, this.CookieDuration, this.CookiePath);
// END Update Script code
this.utils.DeleteCookie(this.CookieName);
if(!this.IsAPopup){
window.focus();
}
var _3d=document.getElementById(this.WatcherMessageDivName);
if(_3d){
_3d.style.display="none";
}
if(this.PromptToTakeTheSurvey){
try{
window.resizeTo(this.SurveyPromptDivWidth,this.SurveyPromptDivHeight);
window.moveTo(this.SurveyPromptDivLeftOffset,this.SurveyPromptDivTopOffset);
}
catch(error){
}
var _3e=document.getElementById(this.SurveyPromptDivName);
if(_3e){
_3e.style.display="block";
}
var _3f=this;
if(this.SurveyPromptDivYesButtonId){
var yes=document.getElementById(this.SurveyPromptDivYesButtonId);
if(yes){
this.utils.AddEvent(yes,"click",function(){
_3f.YesButtonClicked();
});
}
}
if(this.SurveyPromptDivNoButtonId){
var no=document.getElementById(this.SurveyPromptDivNoButtonId);
if(no){
this.utils.AddEvent(no,"click",function(){
_3f.NoButtonClicked();
});
}
}
}else{
this.YesButtonClicked();
}
};
VoviciSurveyWatcher.prototype.HidePrompt=function(){
var _42=document.getElementById(this.SurveyPromptDivName);
if(_42){
_42.style.display="none";
}
var _43=document.getElementById(this.SurveyFrameName);
if(_43){
_43.style.display="none";
}
};
VoviciSurveyWatcher.prototype.YesButtonClicked=function(){
// START Update Script code
this.utils.SetCookie(this.Invitation_State_CookieName, this.Invitation_State_CookieValue, this.CookieDomain, this.CookieDuration, this.CookiePath);
// END Update Script code
if(this.IsAPopup){
try{
window.resizeTo(this.SurveyWindowWidth,this.SurveyWindowHeight);
window.moveTo(this.SurveyWindowLeftOffset,this.SurveyWindowTopOffset);
}
catch(error){
}
window.location=this.GetExitSurveyUrl();
return false;
}else{
this.HidePrompt();
var _44=document.getElementById(this.SurveyFrameName);
if(_44&&_44.parentNode&&_44.parentNode.removeChild){
_44.parentNode.removeChild(_44);
}
var _45=document.getElementById(this.SurveyPromptDivNoButtonId);
if(_45&&_45.parentNode&&_45.parentNode.removeChild){
_45.parentNode.removeChild(_45);
}
var obj=this;
this.SurveyLayer=this.utils.CreateLayer(this.SurveyFrameName,this.SurveyDisplayFrameInnerHtml,obj,"",this.SurveyPromptDivNoButtonId,this.SurveyWindowWidth,this.SurveyWindowHeight,this.SurveyWindowLeftOffset,this.SurveyWindowTopOffset);
this.LoadSurveyInIFrame();
}
};
VoviciSurveyWatcher.prototype.NoButtonClicked=function(){
if(this.IsAPopup){
window.close();
}else{
this.HidePrompt();
}
return false;
};
VoviciSurveyWatcher.prototype.LoadSurveyInIFrame=function(){
if(!document.createElement){
return true;
}
" + this.SurveyInnerFrameName + ";
var _47=document.getElementById(this.SurveyInnerFrameName);
if(!_47){
return true;
}
var _48;
if(!this.IFrameObj&&document.createElement){
try{
var _49=document.createElement("iframe");
_49.setAttribute("id","VoviciSurveyIFrame");
_49.style.position="relative";
_49.style.border="0px";
_49.style.width="100%";
_49.style.height="100%";
this.IFrameObj=_47.appendChild(_49);
if(document.frames){
this.IFrameObj=document.frames["VoviciSurveyIFrame"];
}
}
catch(exception){
iframeHTML="<iframe id=\"VoviciSurveyIFrame\" style=\"";
iframeHTML+="position:relative;";
iframeHTML+="border:0px;";
iframeHTML+="width:100%;";
iframeHTML+="height:100;";
iframeHTML+="\"></iframe>";
_47.innerHTML+=iframeHTML;
this.IFrameObj=new Object();
this.IFrameObj.document=new Object();
this.IFrameObj.document.location=new Object();
this.IFrameObj.document.location.iframe=document.getElementById("VoviciSurveyIFrame");
this.IFrameObj.document.location.replace=function(_4a){
this.iframe.src=_4a;
};
}
}
if(navigator.userAgent.indexOf("Gecko")!=-1&&!this.IFrameObj.contentDocument){
setTimeout(this.LoadSurveyInIFrame,10);
return false;
}
if(this.IFrameObj.contentDocument){
_48=this.IFrameObj.contentDocument;
}else{
if(this.IFrameObj.contentWindow){
_48=this.IFrameObj.contentWindow.document;
}else{
if(this.IFrameObj.document){
_48=this.IFrameObj.document;
}else{
return true;
}
}
}
_48.location.replace(this.GetExitSurveyUrl());
return false;
};
VoviciSurveyWatcher.prototype.Test=function(){
this.utils.DebugLog("cookie: "+this.utils.GetCookie(this.CookieName));
};
function VoviciSurveyUtils(){
this.DebuggingEnabled=false;
this.DebugDivName="VoviciSurveyInvite_DebugOutput";
this.DebugDiv;
this.DebugLog=function(_4b){
if(this.DebuggingEnabled){
this.CreateDebugDiv();
if(this.DebugDiv){
this.DebugDiv.appendChild(document.createTextNode(_4b));
this.DebugDiv.appendChild(document.createElement("br"));
}else{
}
}
};
this.CreateDebugDiv=function(){
if(!this.DebugDiv){
var div=document.getElementById(this.DebugDivName);
if(div){
this.DebugDiv=div;
}else{
if(document.body){
this.DebugDiv=document.createElement("div");
this.DebugDiv.id=this.DebugDivName;
document.body.appendChild(this.DebugDiv);
}
}
}
};
this.AddEvent=function(obj,_4e,fn){
if(obj.addEventListener){
obj.addEventListener(_4e,fn,false);
return true;
}else{
if(obj.attachEvent){
var r=obj.attachEvent("on"+_4e,fn);
return r;
}else{
return false;
}
}
};
this.RemoveEvent=function(obj,_52,fn){
if(obj.removeEventListener){
obj.removeEventListener(_52,fn,false);
return true;
}else{
if(obj.detachEvent){
var r=obj.detachEvent("on"+_52,fn);
return r;
}else{
return false;
}
}
};
this.SetCookie=function(_55,_56,_57,_58,_59){
var _5a=_55+"="+_56+";";
if(_57){
_5a+=" domain="+_57+";";
}
if(_59){
_5a+=" path="+_59+";";
}
var _5b=this.GetCookieExpireDate(_58);
if(_5b){
_5a+=" expires="+_5b.toGMTString()+";";
}
document.cookie=_5a;
};
this.GetCookie=function(_5c){
arg=_5c+"=";
alen=arg.length;
clen=document.cookie.length;
i=0;
while(i<clen){
j=i+alen;
if(document.cookie.substring(i,j)==arg){
return this.GetCookieValue(j);
}
i=document.cookie.indexOf(" ",i)+1;
if(i===0){
break;
}
}
};
this.GetCookieValue=function(_5d){
endstr=document.cookie.indexOf(";",_5d);
if(endstr==-1){
endstr=document.cookie.length;
}
return unescape(document.cookie.substring(_5d,endstr));
};
this.GetCookieExpireDate=function(_5e){
if(_5e==""||_5e==0){
return "";
}
if(_5e=="today"){
var _5f=new Date();
_5f.setDate(_5f.getDate()+1);
_5f.setHours(0);
_5f.setMinutes(1);
_5f.setSeconds(0);
_5f.setMilliseconds(0);
return _5f;
}else{
var _60=new Date();
_60.setTime(_60.getTime()+_5e*60*1000);
return _60;
}
};
this.DeleteCookie=function(_61){
var _62=new Date();
_62.setTime(_62.getTime()-1);
document.cookie=_61+="=; expires="+_62.toGMTString();
};
this.GetRandom=function(max){
if(max==1){
return 1;
}else{
return (Math.floor(Math.random()*max))+1;
}
};
this.CookieMatchesRegex=function(_64,_65){
var _66=this.GetCookie(_64);
if(_66){
return _66.match(new RegExp(_65));
}
return false;
};
this.AddUrlParameters=function(_67,_68){
if(_68){
var out=_67;
if(!/\?/.test(out)){
out+="?";
}
var _6a=0;
for(var key in _68){
if(key.toString().indexOf('&') != -1){ 
out+=(_6a>0?"&":"")+key+"="+escape(_68[key]);
}
}
return out;
}else{
return _67;
}
};
this.GetLayerWidth=function(_6c){
var _6d=0;
if(typeof (window.innerWidth)=="number"){
_6d=window.innerWidth;
}else{
if(document.documentElement&&document.documentElement.clientWidth){
_6d=document.documentElement.clientWidth;
}else{
if(document.body&&document.body.clientWidth){
_6d=document.body.clientWidth;
}
}
}
if(_6c){
return Math.min(_6c,_6d);
}else{
return _6d;
}
};
this.GetLayerHeight=function(_6e){
var _6f=0;
if(typeof (window.innerHeight)=="number"){
_6f=window.innerHeight;
}else{
if(document.documentElement&&document.documentElement.clientHeight){
_6f=document.documentElement.clientHeight;
}else{
if(document.body&&document.body.clientHeight){
_6f=document.body.clientHeight;
}
}
}
if(_6e){
return Math.min(_6e,_6f);
}else{
return _6f;
}
};
this.CreateLayer=function(id,_71,obj,_73,_74,_75,_76,_77,_78){
var _79="VoviciSurveyPromptContainer_"+id;
var _7a=document.createElement("div");
_7a.style.display="none";
_7a.setAttribute("id",_79);
_7a.setAttribute("name",_79);
_7a.innerHTML=_71;
document.body.appendChild(_7a);
var div=document.getElementById(id);
var _7c=this.GetLayerWidth();
var _7d=this.GetLayerHeight();
var _7e=_75?this.GetLayerWidth(_75):(_7c*0.9);
var _7f=_76?this.GetLayerHeight(_76):(_7d*0.9);
div.style.width=_7e;
div.style.height=_7f;
div.style.position="absolute";
div.style.left=_77?_77:Math.abs(_7c-_7e)/2;
div.style.top=_78?_78:Math.abs(_7d-_7f)/2;
if(_73){
var yes=document.getElementById(_73);
if(yes){
this.AddEvent(yes,"click",function(){
obj.YesButtonClicked();
});
}
}
if(_74){
var no=document.getElementById(_74);
if(no){
this.AddEvent(no,"click",function(){
obj.NoButtonClicked();
});
}
}
_7a.style.display="block";
return _7a;
};
};


