var InsightExpress={};InsightExpress.LogText='';InsightExpress.Log=function(s,s2){if(!InsightExpress.LogText)InsightExpress.LogText='';InsightExpress.LogText+=s+(s2?' = '+s2:'')+'\n'};InsightExpress.Dump=function(el){if(el==null) return'NULL';var s='';for(var key in el) if(el[key])s+=key+'='+el[key]+', ';return s;};InsightExpress.Extend=function(subclass,superclass,args){function Dummy(){};if(superclass) Dummy.prototype=superclass.prototype;subclass.prototype=new Dummy();subclass.prototype.constructor=subclass;if(superclass){subclass.superclass=superclass;subclass.superproto=superclass.prototype;};InsightExpress.Implement(subclass,args);};InsightExpress.Implement=function(c,proto){for(var i in proto){c.prototype[i]=proto[i];}};InsightExpress.AddProps=function(c,proto){for(var i in proto){if(typeof proto[i]!='function')c[i]=proto[i];}};InsightExpress.ForEach=function(array,func){for(var i=0;i');try{InsightExpress.Log("Top Location",InsightExpress.TopDoc.location||'');InsightExpress.Log("Location",document.location||'');}catch(e){};InsightExpress.Log("InIFrame",InsightExpress.InIFrame||'false');InsightExpress.Log("SupportsLocalStorage",InsightExpress.SupportsLocalStorage);InsightExpress.OnLoad();};if(document.readyState==="complete"){InsightExpress.ready();} else{if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);InsightExpress.ready();},false);}else if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);InsightExpress.ready();}});if(document.documentElement.doScroll&&window==window.top)(function(){if(InsightExpress.isReady)return;try{document.documentElement.doScroll("left");}catch(error){setTimeout(arguments.callee,0);return;};InsightExpress.ready();})();};InsightExpress.AddEvent(window,"load",InsightExpress.ready);};InsightExpress.AltDown=false;InsightExpress.KeyUp=function(e){InsightExpress.AltDown=false;};InsightExpress.KeyDown=function(e){e=e||window.event;var code=e.keyCode||e.which;if(code==18) InsightExpress.AltDown=true;else if(code==101&&InsightExpress.AltDown) alert(InsightExpress.LogText+"\n"+(InsightExpress.Analytics?InsightExpress.Analytics.ParamString():''));else if(code==102&&InsightExpress.AltDown) InsightExpress.OnLoad();else if(code==105) InsightExpress.ClearLocalStorage();};try{InsightExpress.SupportsLocalStorage=(typeof window.localStorage!='undefined')&&window.localStorage!=null;InsightExpress.SupportsGlobalStorage=(typeof window.globalStorage!='undefined')&&window.globalStorage!=null;;}catch(err){};InsightExpress.InIFrame=false;InsightExpress.ClearLocalStorage=function(){if(!InsightExpress.SupportsLocalStorage) return;for(var i=0;i0) this.init(Settings);};InsightExpress.Invite.prototype.init=function(Settings){this.Settings=Settings;};InsightExpress.Invite.ShouldShow=function(invite){var allow=true;if(invite&&invite.Settings.Disallow&&invite.Settings.Disallow.UserAgents){InsightExpress.ForEach(invite.Settings.Disallow.UserAgents,function(){var re=new RegExp(this,'i');if(re.test(navigator.userAgent)){InsightExpress.Log('User agent blocked: '+this);allow=false;}});};if(document.referrer&&invite&&invite.Settings.Disallow&&invite.Settings.Disallow.Referrers){InsightExpress.ForEach(invite.Settings.Disallow.Referrers,function(){var re=new RegExp(this,'i');if(re.test(document.referrer)){InsightExpress.Log('Referrer blocked: '+this);allow=false;}});};if(InsightExpress.TopDoc&&invite&&invite.Settings.Disallow&&invite.Settings.Disallow.Locations){InsightExpress.ForEach(invite.Settings.Disallow.Locations,function(){var re=new RegExp(this,'i');if(re.test(InsightExpress.TopDoc.location)){InsightExpress.Log('Location blocked: '+this);allow=false;}});};if(invite&&invite.Settings.Disallow&&invite.Settings.Disallow.QueryString){InsightExpress.ForEach(invite.Settings.Disallow.QueryString,function(){if(location.search.toLowerCase().indexOf(this.toLowerCase())>=0){InsightExpress.Log('QueryString blocked: '+this);allow=false;}});};if(invite&&invite.Settings.Disallow&&invite.Settings.Disallow.Variables){InsightExpress.ForEach(invite.Settings.Disallow.Variables,function(){if(window[this]){InsightExpress.Log('Variable blocked: '+this);allow=false;}});};if(invite&&invite.Settings&&invite.Settings.Disallow&&invite.Settings.Disallow.SafeGuard&&typeof(window.inviteAllowedSafeGuard)=="function"){if(!inviteAllowedSafeGuard()){InsightExpress.Log('SafeGuard blocked');allow=false;}};if(invite&&invite.Settings&&invite.Settings.Disallow&&invite.Settings.Disallow.REMO){if(typeof(window.sitePerformedInvite)=='function'&&window.sitePerformedInvite()){InsightExpress.Log('REMO blocked');allow=false;}};if(InsightExpress.SupportsLocalStorage&&invite&&invite.Settings&&invite.Settings.CampaignID){if(window.localStorage.getItem('IXAIInvited'+invite.Settings.CampaignID)=='true'){InsightExpress.Log('localStorage blocked');allow=false;}};return allow;};InsightExpress.Invite.DidShow=function(invite){if(typeof(window.siteInvited)=='function') siteInvited('IX');if(InsightExpress.SupportsLocalStorage&&invite&&invite.Settings&&invite.Settings.CampaignID) window.localStorage.setItem('IXAIInvited'+invite.Settings.CampaignID,true);if(invite.Settings.Type!='Popup'||invite.Settings.OnDomainExit){setTimeout(function(){InsightExpress.InviteImage=new Image();InsightExpress.InviteImage.src=InsightExpress.Protocol+InsightExpress.DomainName+'/adserver/showInvite.aspx?ImageOnly=true&bannerID='+invite.Settings.BannerID+"&esi=true";},1000);}};InsightExpress.PopUpInvite=function(Settings){if(arguments.length>0) this.init(Settings);this.win=null;this.OnShown=null,this.OnHide=null;this.ShowTweens=[],this.HideTweens=[];this.Accepted=false;};InsightExpress.PopUpInvite.prototype=new InsightExpress.Invite();InsightExpress.PopUpInvite.prototype.constructor=InsightExpress.Invite;InsightExpress.PopUpInvite.superclass=InsightExpress.Invite.prototype;InsightExpress.PopUpInvite.prototype.init=function(Settings){InsightExpress.PopUpInvite.superclass.init.call(this,Settings);this.Settings.Animate=false;};InsightExpress.PopUpInvite.prototype.Show=function(second){InsightExpress.Log("Show called");var me=this;if(!second&&this.Settings.OnExit){InsightExpress.AddEvent(window,'unload',function(){me.Show(true);});InsightExpress.Log("Added onexit handler");return;} else if(!second&&this.Settings.OnDomainExit){var _ixx,_ixy;if(window.screenTop){_ixx=window.screenLeft;_ixy=window.screenTop;}else{_ixx=window.screenX;_ixy=window.screenY;};try{var exitChecker=window.open('about:blank','exitChecker','width=200,height=200,scrollbars=no,left='+_ixx+',top='+_ixy);if(exitChecker){exitChecker.document.write(InsightExpress.PopUpInvite.DomainExit.Content);exitChecker._Settings=this.Settings;exitChecker._Settings.DomainName=InsightExpress.DomainName;exitChecker.blur();if(navigator.userAgent.toLowerCase().indexOf('chrome')>-1){setTimeout(function(){window.blur();},100);}}}catch(e){InsightExpress.Log("Error= "+InsightExpress.Dump(e));if(exitChecker) exitChecker.close();};return;};var center='';if(this.Settings.Centered&&this.Settings.Centered.Vertical) center+=',top='+((screen.height/2)-(parseInt(this.Settings.Height)/2));else if(this.Settings.Location&&this.Settings.Location.Top) center+=',top='+this.Settings.Location.Top;if(this.Settings.Centered&&this.Settings.Centered.Horizontal) center+=',left='+((screen.width/2)-(parseInt(this.Settings.Width)/2));else if(this.Settings.Location&&this.Settings.Location.Left) center+=',left='+this.Settings.Location.Left;var fn=function(){var s='';if(InsightExpress.Analytics) s=InsightExpress.Analytics.ParamString();me.win=window.open('http://'+InsightExpress.DomainName+'/adserver/invites/GetContent.aspx?'+s+'&'+InsightExpress.QueryString,'ix_accept','width='+me.Settings.Width+',height='+me.Settings.Height+center+(me.Settings.PopupSettings?','+me.Settings.PopupSettings:''));if(me.win){if(me.Settings.PopUnder){me.win.blur();if(navigator.userAgent.toLowerCase().indexOf('chrome')>-1){setTimeout(function(){window.blur();},100);}}};if(InsightExpress.ClickAction) document.location=InsightExpress.ClickAction;};if(second) fn();else setTimeout(fn,1000);InsightExpress.Log("Show completed");};InsightExpress.PopUpInvite.prototype.ShowContent=function(){var div=document.createElement('DIV');if(this.Settings.Flash){InsightExpress.Log('Invite type','Flash');var so=new SWFObject(this.Settings.Flash,"mymovie","100%","100%","8","");so.addParam("wmode","transparent");if(this.Settings.FlashVars){for(var key in this.Settings.FlashVars) so.addVariable(key,this.Settings.FlashVars[key]);};InsightExpress.Log('Flash created');so.write(div);InsightExpress.Log('Flash appended');} else div.innerHTML=this.Settings.Html;this.el=div;InsightExpress.AddProps(div.style,this.Settings.Style);document.body.appendChild(div);InsightExpress.Log("ShowContent completed");this.Shown();};InsightExpress.PopUpInvite.prototype.Shown=function(){InsightExpress.Log("Shown called");var me=this;if(this.Settings.HideDelay) setTimeout(function(){me.Hide();},this.Settings.HideDelay);if(this.OnShown) this.OnShown();InsightExpress.ForEach(InsightExpress.getElementsByClassName(this.el,'*','closeLink'),function(){this.onclick=function(){me.Hide();return false;}});InsightExpress.ForEach(InsightExpress.getElementsByClassName(this.el,'*','maybeLaterLink'),function(){this.onclick=function(){me.Hide();return false;}});InsightExpress.ForEach(InsightExpress.getElementsByClassName(this.el,'*','acceptLink'),function(){this.href=me.Settings.AcceptUrl;if(!me.Settings.ReuseWindow)this.target='_blank';this.onclick=function(){me.Accept(this);return true;}});InsightExpress.ForEach(InsightExpress.getElementsByClassName(this.el,'*','privacyLink'),function(){this.href=me.Settings.PrivacyUrl;this.target='_blank';});InsightExpress.ForEach(InsightExpress.getElementsByClassName(this.el,'*','faqLink'),function(){this.href=me.Settings.FaqUrl;this.target='_blank';});InsightExpress.Log("Shown completed");};InsightExpress.PopUpInvite.prototype.Accept=function(lnk){InsightExpress.Log("Accept called");var me=this;this.Accepted=true;if(this.el&&!document.all) this.el.innerHTML='

Loading...

';if(!me.Settings.ReuseWindow) setTimeout(function(){me.Hide(true);},500);else if(me.Settings.Resize) window.resizeTo(me.Settings.Resize.Width,me.Settings.Resize.Height);return true;};InsightExpress.PopUpInvite.prototype.Hide=function(forceHide){if(!forceHide&&(this.Hiding||this.Accepted))return;this.Hiding=true;InsightExpress.Log("Hide called");window.close();InsightExpress.Log("Hide completed");};InsightExpress.PopUpInvite.prototype.Hid=function(){if(this.OnHide) this.OnHide();InsightExpress.Log("Hidden");};InsightExpress.Analytics={};InsightExpress.Analytics.TotalTimeInView=0;InsightExpress.Analytics.Params={};InsightExpress.Analytics.AddParam=function(name,value){InsightExpress.Analytics.Params[name]=value;};InsightExpress.Analytics.GetScroll=function(){var scrOfX=0,scrOfY=0;var doc=InsightExpress.TopDoc;if(typeof(window.pageYOffset)=='number'){scrOfY=window.pageYOffset;scrOfX=window.pageXOffset;}else if(doc.body&&(doc.body.scrollLeft||doc.body.scrollTop)){scrOfY=doc.body.scrollTop;scrOfX=doc.body.scrollLeft;}else if(doc.documentElement&&(doc.documentElement.scrollLeft||doc.documentElement.scrollTop)){scrOfY=doc.documentElement.scrollTop;scrOfX=doc.documentElement.scrollLeft;};return{x:scrOfX,y:scrOfY};};InsightExpress.Analytics.ParamString=function(){var s='';for(var i in InsightExpress.Analytics.Params) s+=(s.length>0?'&':'')+'_'+i+'='+InsightExpress.Analytics.Params[i];return s;};InsightExpress.Analytics.FindAdUnit=function(parentNode){if(!parentNode||!parentNode.childNodes||!parentNode.childNodes.length) return null;for(var i=0;i","OnExit":true,"OnDomainExit":false,"Animate":false,"ID":719,"QueryString":"esi=true&bannerID=163481&referer=www.psychiatrictimes.com&siteID=N3340.MartiniMedia&placementID=225187372&creativeID=36401767","BannerID":163481,"CampaignID":2013});InsightExpress.CurrentInvite=invite;if(!InsightExpress.Invite.ShouldShow(invite)){InsightExpress.Log('Should not show');if(InsightExpress.ClickAction) document.location=InsightExpress.ClickAction;return;};invite.OnShown=function(){};if(InsightExpress.Tween&&invite.Settings.FadeIn) invite.ShowTweens.push(new InsightExpress.Tween.FadeIn(invite.Settings.FadeIn,function(){return invite.el;}));if(InsightExpress.Tween&&''+invite.Settings.Animate!='false'){invite.ShowTweens.push(new InsightExpress.Tween(6000,25,function(pct){var middle=InsightExpress.Browser.GetWidth()/2-invite.Settings.Width/2;invite.el.style.bottom='0px';invite.el.style.left=middle-(middle*pct)+'px';}));};if(InsightExpress.Tween&&invite.Settings.FadeOut) invite.HideTweens.push(new InsightExpress.Tween.FadeOut(invite.Settings.FadeOut,function(){return invite.el;}));if(invite.Settings.ShowDelay){var me=invite;setTimeout(function(){me.Show();},invite.Settings.ShowDelay);} else invite.Show();InsightExpress.Invite.DidShow(invite);}