function VoviciWebInterceptSurvey(){
this.utils=new VoviciSurveyUtils();
this.SurveyUrl="";
this.ExitSurveyUrl="";
this.FailoverToLayerWhenPopupsBlocked=false;
this.NthVisitorToInvite=1;
this.SurveyInNewWindow=false;
this.SurveyWindowWidth=785;
this.SurveyWindowHeight=700;
this.SurveyWindowLeftOffset=100;
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=320;
this.SurveyPromptDivHeight=228;
this.SurveyPromptDivLeftOffset=300;
this.SurveyPromptDivTopOffset=150;
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.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(){
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.AddUrlParameter=function(_14,val){
this.URLParameters[_14]=val;
};
this.LaunchExitSurvey=function(){
return this.ExitSurveyUrl!="";
};
};



function VoviciExitSurvey(){
};




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){
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;
};
};


