var mboxCopyright="Copyright 1996-2010. Adobe Systems Incorporated. All rights reserved";mboxUrlBuilder=function(c,d){this.a=c;this.b=d;this.c=new Array();this.d=function(a){return a};this.f=null};mboxUrlBuilder.prototype.addParameter=function(a,b){var c=new RegExp("('|\")");if(c.exec(a)){throw"Parameter '"+a+"' contains invalid characters"}for(var d=0;d<this.c.length;d++){var e=this.c[d];if(e.name==a){e.value=b;return this}}var f=new Object();f.name=a;f.value=b;this.c[this.c.length]=f;return this};mboxUrlBuilder.prototype.addParameters=function(a){if(!a){return this}for(var b=0;b<a.length;b++){var d=a[b].indexOf("=");if(d==-1||d==0){continue}this.addParameter(a[b].substring(0,d),a[b].substring(d+1,a[b].length))}return this};mboxUrlBuilder.prototype.setServerType=function(a){this.o=a};mboxUrlBuilder.prototype.setBasePath=function(a){this.f=a};mboxUrlBuilder.prototype.setUrlProcessAction=function(a){this.d=a};mboxUrlBuilder.prototype.buildUrl=function(){var d=this.f?this.f:"/m2/"+this.b+"/mbox/"+this.o;var f=document.location.protocol=="file:"?"http:":document.location.protocol;var a=f+"//"+this.a+d;var g=a.indexOf("?")!=-1?"&":"?";for(var b=0;b<this.c.length;b++){var c=this.c[b];a+=g+encodeURIComponent(c.name)+"="+encodeURIComponent(c.value);g="&"}return this.t(this.d(a))};mboxUrlBuilder.prototype.getParameters=function(){return this.c};mboxUrlBuilder.prototype.setParameters=function(a){this.c=a};mboxUrlBuilder.prototype.clone=function(){var b=new mboxUrlBuilder(this.a,this.b);b.setServerType(this.o);b.setBasePath(this.f);b.setUrlProcessAction(this.d);for(var a=0;a<this.c.length;a++){b.addParameter(this.c[a].name,this.c[a].value)}return b};mboxUrlBuilder.prototype.t=function(a){return a.replace(/\"/g,"&quot;").replace(/>/g,"&gt;")};mboxStandardFetcher=function(){};mboxStandardFetcher.prototype.getType=function(){return"standard"};mboxStandardFetcher.prototype.fetch=function(a){a.setServerType(this.getType());document.write('<script src="'+a.buildUrl()+'" language="JavaScript"></script>')};mboxStandardFetcher.prototype.cancel=function(){};mboxAjaxFetcher=function(){};mboxAjaxFetcher.prototype.getType=function(){return"ajax"};mboxAjaxFetcher.prototype.fetch=function(b){b.setServerType(this.getType());var a=b.buildUrl();this.x=document.createElement("script");this.x.src=a;document.body.appendChild(this.x)};mboxAjaxFetcher.prototype.cancel=function(){};mboxMap=function(){this.y=new Object();this.z=new Array()};mboxMap.prototype.put=function(a,b){if(!this.y[a]){this.z[this.z.length]=a}this.y[a]=b};mboxMap.prototype.get=function(a){return this.y[a]};mboxMap.prototype.remove=function(a){this.y[a]=undefined};mboxMap.prototype.each=function(e){for(var d=0;d<this.z.length;d++){var a=this.z[d];var c=this.y[a];if(c){var b=e(a,c);if(b===false){break}}}};mboxFactory=function(c,a,d){this.E=false;this.C=c;this.D=d;this.F=new mboxList();mboxFactories.put(d,this);this.G=typeof document.createElement("div").replaceChild!="undefined"&&(function(){return true})()&&typeof document.getElementById!="undefined"&&typeof(window.attachEvent||document.addEventListener||window.addEventListener)!="undefined"&&typeof encodeURIComponent!="undefined";this.H=this.G&&mboxGetPageParameter("mboxDisable")==null;var e=d=="default";this.J=new mboxCookieManager("mbox"+(e?"":("-"+d)),(function(){return mboxCookiePageDomain()})());this.H=this.H&&this.J.isEnabled()&&(this.J.getCookie("disable")==null);if(this.isAdmin()){this.enable()}this.K();this.L=mboxGenerateId();this.M=mboxScreenHeight();this.N=mboxScreenWidth();this.O=mboxBrowserWidth();this.P=mboxBrowserHeight();this.Q=mboxScreenColorDepth();this.R=mboxBrowserTimeOffset();this.S=new mboxSession(this.L,"mboxSession","session",31*60,this.J);this.T=new mboxPC("PC",1209600,this.J);this.w=new mboxUrlBuilder(c,a);this.U(this.w,e);this.V=new Date().getTime();this.W=this.V;var f=this;this.addOnLoad(function(){f.W=new Date().getTime()});if(this.G){this.addOnLoad(function(){f.E=true;f.getMboxes().each(function(b){b.setFetcher(new mboxAjaxFetcher());b.finalize()})});this.limitTraffic(100,10368000);if(this.H){this.Z();this._=new mboxSignaler(function(b,g){return f.create(b,g)},this.J)}}};mboxFactory.prototype.isEnabled=function(){return this.H};mboxFactory.prototype.getDisableReason=function(){return this.J.getCookie("disable")};mboxFactory.prototype.isSupported=function(){return this.G};mboxFactory.prototype.disable=function(a,b){if(typeof a=="undefined"){a=60*60}if(typeof b=="undefined"){b="unspecified"}if(!this.isAdmin()){this.H=false;this.J.setCookie("disable",b,a)}};mboxFactory.prototype.enable=function(){this.H=true;this.J.deleteCookie("disable")};mboxFactory.prototype.isAdmin=function(){return document.location.href.indexOf("mboxEnv")!=-1};mboxFactory.prototype.limitTraffic=function(b,a){};mboxFactory.prototype.addOnLoad=function(a){if(this.isDomLoaded()){a()}else{var b=false;var c=function(){if(b){return}b=true;a()};this.hb.push(c);if(this.isDomLoaded()&&!b){c()}}};mboxFactory.prototype.getEllapsedTime=function(){return this.W-this.V};mboxFactory.prototype.getEllapsedTimeUntil=function(a){return a-this.V};mboxFactory.prototype.getMboxes=function(){return this.F};mboxFactory.prototype.get=function(a,b){return this.F.get(a).getById(b||0)};mboxFactory.prototype.update=function(a,b){if(!this.isEnabled()){return}if(!this.isDomLoaded()){var d=this;this.addOnLoad(function(){d.update(a,b)});return}if(this.F.get(a).length()==0){throw"Mbox "+a+" is not defined"}this.F.get(a).each(function(c){c.getUrlBuilder().addParameter("mboxPage",mboxGenerateId());c.load(b)})};mboxFactory.prototype.create=function(a,b,g){if(!this.isSupported()){return null}var d=this.w.clone();d.addParameter("mboxCount",this.F.length()+1);d.addParameters(b);var f=this.F.get(a).length();var h=this.D+"-"+a+"-"+f;var i;if(g){i=new mboxLocatorNode(g)}else{if(this.E){throw"The page has already been loaded, can't write marker"}i=new mboxLocatorDefault(h)}try{var m=this;var j="mboxImported-"+h;var n=new mbox(a,f,d,i,j);if(this.H){n.setFetcher(this.E?new mboxAjaxFetcher():new mboxStandardFetcher())}n.setOnError(function(e,c){n.setMessage(e);n.activate();if(!n.isActivated()){m.disable(60*60,e);window.location.reload(false)}});this.F.add(n)}catch(k){this.disable();throw'Failed creating mbox "'+a+'", the error was: '+k}var l=new Date();d.addParameter("mboxTime",l.getTime()-(l.getTimezoneOffset()*60000));return n};mboxFactory.prototype.getCookieManager=function(){return this.J};mboxFactory.prototype.getPageId=function(){return this.L};mboxFactory.prototype.getPCId=function(){return this.T};mboxFactory.prototype.getSessionId=function(){return this.S};mboxFactory.prototype.getSignaler=function(){return this._};mboxFactory.prototype.getUrlBuilder=function(){return this.w};mboxFactory.prototype.U=function(a,b){a.addParameter("mboxHost",document.location.hostname).addParameter("mboxSession",this.S.getId());if(!b){a.addParameter("mboxFactoryId",this.D)}if(this.T.getId()!=null){a.addParameter("mboxPC",this.T.getId())}a.addParameter("mboxPage",this.L);a.addParameter("screenHeight",this.M);a.addParameter("screenWidth",this.N);a.addParameter("browserWidth",this.O);a.addParameter("browserHeight",this.P);a.addParameter("browserTimeOffset",this.R);a.addParameter("colorDepth",this.Q);a.setUrlProcessAction(function(c){c+="&mboxURL="+encodeURIComponent(document.location);var d=encodeURIComponent(document.referrer);if(c.length+d.length<2000){c+="&mboxReferrer="+d}c+="&mboxVersion="+mboxVersion;return c})};mboxFactory.prototype.sb=function(){return""};mboxFactory.prototype.Z=function(){document.write("<style>.mboxDefault { visibility:hidden; }</style>")};mboxFactory.prototype.isDomLoaded=function(){return this.E};mboxFactory.prototype.K=function(){if(this.hb!=null){return}this.hb=new Array();var a=this;(function(){var b=document.addEventListener?"DOMContentLoaded":"onreadystatechange";var c=false;var d=function(){if(c){return}c=true;for(var f=0;f<a.hb.length;++f){a.hb[f]()}};if(document.addEventListener){document.addEventListener(b,function(){document.removeEventListener(b,arguments.callee,false);d()},false);window.addEventListener("load",function(){document.removeEventListener("load",arguments.callee,false);d()},false)}else{if(document.attachEvent){if(self!==self.top){document.attachEvent(b,function(){if(document.readyState==="complete"){document.detachEvent(b,arguments.callee);d()}})}else{var e=function(){try{document.documentElement.doScroll("left");d()}catch(f){setTimeout(e,13)}};e()}}}if(document.readyState==="complete"){d()}})()};mboxSignaler=function(f,d){this.J=d;var g=d.getCookieNames("signal-");for(var c=0;c<g.length;c++){var a=g[c];var b=d.getCookie(a).split("&");var e=f(b[0],b);e.load();d.deleteCookie(a)}};mboxSignaler.prototype.signal=function(b,a){this.J.setCookie("signal-"+b,mboxShiftArray(arguments).join("&"),45*60)};mboxList=function(){this.F=new Array()};mboxList.prototype.add=function(a){if(a!=null){this.F[this.F.length]=a}};mboxList.prototype.get=function(a){var b=new mboxList();for(var c=0;c<this.F.length;c++){var d=this.F[c];if(d.getName()==a){b.add(d)}}return b};mboxList.prototype.getById=function(a){return this.F[a]};mboxList.prototype.length=function(){return this.F.length};mboxList.prototype.each=function(b){if(typeof b!="function"){throw"Action must be a function, was: "+typeof(b)}for(var a=0;a<this.F.length;a++){b(this.F[a])}};mboxLocatorDefault=function(a){this.g="mboxMarker-"+a;document.write('<div id="'+this.g+'" style="visibility:hidden;display:none">&nbsp;</div>')};mboxLocatorDefault.prototype.locate=function(){var a=document.getElementById(this.g);while(a!=null){if(a.nodeType==1){if(a.className=="mboxDefault"){return a}}a=a.previousSibling}return null};mboxLocatorDefault.prototype.force=function(){var a=document.createElement("div");a.className="mboxDefault";var b=document.getElementById(this.g);b.parentNode.insertBefore(a,b);return a};mboxLocatorNode=function(a){this.Eb=a};mboxLocatorNode.prototype.locate=function(){return typeof this.Eb=="string"?document.getElementById(this.Eb):this.Eb};mboxLocatorNode.prototype.force=function(){return null};mboxCreate=function(a){var b=mboxFactoryDefault.create(a,mboxShiftArray(arguments));if(b){b.load()}return b};mboxDefine=function(b,a){var c=mboxFactoryDefault.create(a,mboxShiftArray(mboxShiftArray(arguments)),b);return c};mboxUpdate=function(a){mboxFactoryDefault.update(a,mboxShiftArray(arguments))};mbox=function(a,b,e,c,d){this.Kb=null;this.Lb=0;this.mb=c;this.nb=d;this.Mb=null;this.Nb=new mboxOfferContent();this.Fb=null;this.w=e;this.message="";this.Ob=new Object();this.Pb=0;this.Ib=b;this.g=a;this.Qb();e.addParameter("mbox",a).addParameter("mboxId",b);this.Rb=function(){};this.Sb=function(){};this.Tb=null};mbox.prototype.getId=function(){return this.Ib};mbox.prototype.Qb=function(){if(this.g.length>250){throw"Mbox Name "+this.g+" exceeds max length of 250 characters."}else{if(this.g.match(/^\s+|\s+$/g)){throw"Mbox Name "+this.g+" has leading/trailing whitespace(s)."}}};mbox.prototype.getName=function(){return this.g};mbox.prototype.getParameters=function(){var b=this.w.getParameters();var a=new Array();for(var d=0;d<b.length;d++){if(b[d].name.indexOf("mbox")!=0){a[a.length]=b[d].name+"="+b[d].value}}return a};mbox.prototype.setOnLoad=function(a){this.Sb=a;return this};mbox.prototype.setMessage=function(a){this.message=a;return this};mbox.prototype.setOnError=function(a){this.Rb=a;return this};mbox.prototype.setFetcher=function(a){if(this.Mb){this.Mb.cancel()}this.Mb=a;return this};mbox.prototype.getFetcher=function(){return this.Mb};mbox.prototype.load=function(a){if(this.Mb==null){return this}this.setEventTime("load.start");this.cancelTimeout();this.Lb=0;var b=(a&&a.length>0)?this.w.clone().addParameters(a):this.w;this.Mb.fetch(b);var d=this;this.Vb=setTimeout(function(){d.Rb("browser timeout",d.Mb.getType())},15000);this.setEventTime("load.end");return this};mbox.prototype.loaded=function(){this.cancelTimeout();if(!this.activate()){var a=this;setTimeout(function(){a.loaded()},100)}};mbox.prototype.activate=function(){if(this.Lb){return this.Lb}this.setEventTime("activate"+ ++this.Pb+".start");if(this.show()){this.cancelTimeout();this.Lb=1}this.setEventTime("activate"+this.Pb+".end");return this.Lb};mbox.prototype.isActivated=function(){return this.Lb};mbox.prototype.setOffer=function(a){if(a&&a.show&&a.setOnLoad){this.Nb=a}else{throw"Invalid offer"}return this};mbox.prototype.getOffer=function(){return this.Nb};mbox.prototype.show=function(){this.setEventTime("show.start");var a=this.Nb.show(this);this.setEventTime(a==1?"show.end.ok":"show.end");return a};mbox.prototype.showContent=function(a){if(a==null){return 0}if(this.Fb==null||!this.Fb.parentNode){this.Fb=this.getDefaultDiv();if(this.Fb==null){return 0}}if(this.Fb!=a){this.Xb(this.Fb);this.Fb.parentNode.replaceChild(a,this.Fb);this.Fb=a}this.Yb(a);this.Sb();return 1};mbox.prototype.hide=function(){this.setEventTime("hide.start");var a=this.showContent(this.getDefaultDiv());this.setEventTime(a==1?"hide.end.ok":"hide.end.fail");return a};mbox.prototype.finalize=function(){this.setEventTime("finalize.start");this.cancelTimeout();if(this.getDefaultDiv()==null){if(this.mb.force()!=null){this.setMessage("No default content, an empty one has been added")}else{this.setMessage("Unable to locate mbox")}}if(!this.activate()){this.hide();this.setEventTime("finalize.end.hide")}this.setEventTime("finalize.end.ok")};mbox.prototype.cancelTimeout=function(){if(this.Vb){clearTimeout(this.Vb)}if(this.Mb!=null){this.Mb.cancel()}};mbox.prototype.getDiv=function(){return this.Fb};mbox.prototype.getDefaultDiv=function(){if(this.Tb==null){this.Tb=this.mb.locate()}return this.Tb};mbox.prototype.setEventTime=function(a){this.Ob[a]=(new Date()).getTime()};mbox.prototype.getEventTimes=function(){return this.Ob};mbox.prototype.getImportName=function(){return this.nb};mbox.prototype.getURL=function(){return this.w.buildUrl()};mbox.prototype.getUrlBuilder=function(){return this.w};mbox.prototype._b=function(a){return a.style.display!="none"};mbox.prototype.Yb=function(a){this.ac(a,true)};mbox.prototype.Xb=function(a){this.ac(a,false)};mbox.prototype.ac=function(b,a){b.style.visibility=a?"visible":"hidden";b.style.display=a?"block":"none"};mboxOfferContent=function(){this.Sb=function(){}};mboxOfferContent.prototype.show=function(b){var a=b.showContent(document.getElementById(b.getImportName()));if(a==1){this.Sb()}return a};mboxOfferContent.prototype.setOnLoad=function(a){this.Sb=a};mboxOfferAjax=function(a){this.Wb=a;this.Sb=function(){}};mboxOfferAjax.prototype.setOnLoad=function(a){this.Sb=a};mboxOfferAjax.prototype.show=function(c){var b=document.createElement("div");b.id=c.getImportName();b.innerHTML=this.Wb;var a=c.showContent(b);if(a==1){this.Sb()}return a};mboxOfferDefault=function(){this.Sb=function(){}};mboxOfferDefault.prototype.setOnLoad=function(a){this.Sb=a};mboxOfferDefault.prototype.show=function(b){var a=b.hide();if(a==1){this.Sb()}return a};mboxCookieManager=function mboxCookieManager(b,a){this.g=b;this.dc=a==""||a.indexOf(".")==-1?"":"; domain="+a;this.ec=new mboxMap();this.loadCookies()};mboxCookieManager.prototype.isEnabled=function(){this.setCookie("check","true",60);this.loadCookies();return this.getCookie("check")=="true"};mboxCookieManager.prototype.setCookie=function(c,d,a){if(typeof c!="undefined"&&typeof d!="undefined"&&typeof a!="undefined"){var b=new Object();b.name=c;b.value=escape(d);b.expireOn=Math.ceil(a+new Date().getTime()/1000);this.ec.put(c,b);this.saveCookies()}};mboxCookieManager.prototype.getCookie=function(b){var a=this.ec.get(b);return a?unescape(a.value):null};mboxCookieManager.prototype.deleteCookie=function(a){this.ec.remove(a);this.saveCookies()};mboxCookieManager.prototype.getCookieNames=function(a){var b=new Array();this.ec.each(function(d,c){if(d.indexOf(a)==0){b[b.length]=d}});return b};mboxCookieManager.prototype.saveCookies=function(){var a=new Array();var b=0;this.ec.each(function(e,d){a[a.length]=e+"#"+d.value+"#"+d.expireOn;if(b<d.expireOn){b=d.expireOn}});var c=new Date(b*1000);document.cookie=this.g+"="+a.join("|")+"; expires="+c.toGMTString()+"; path=/"+this.dc};mboxCookieManager.prototype.loadCookies=function(){this.ec=new mboxMap();var c=document.cookie.indexOf(this.g+"=");if(c!=-1){var d=document.cookie.indexOf(";",c);if(d==-1){d=document.cookie.indexOf(",",c);if(d==-1){d=document.cookie.length}}var e=document.cookie.substring(c+this.g.length+1,d).split("|");var f=Math.ceil(new Date().getTime()/1000);for(var b=0;b<e.length;b++){var a=e[b].split("#");if(f<=a[2]){var g=new Object();g.name=a[0];g.value=a[1];g.expireOn=a[2];this.ec.put(g.name,g)}}}};mboxSession=function(c,d,a,e,b){this.rc=d;this.Ab=a;this.sc=e;this.J=b;this.tc=false;this.Ib=typeof mboxForceSessionId!="undefined"?mboxForceSessionId:mboxGetPageParameter(this.rc);if(this.Ib==null||this.Ib.length==0){this.Ib=b.getCookie(a);if(this.Ib==null||this.Ib.length==0){this.Ib=c;this.tc=true}}b.setCookie(a,this.Ib,e)};mboxSession.prototype.getId=function(){return this.Ib};mboxSession.prototype.forceId=function(a){this.Ib=a;this.J.setCookie(this.Ab,this.Ib,this.sc)};mboxPC=function(a,c,b){this.Ab=a;this.sc=c;this.J=b;this.Ib=typeof mboxForcePCId!="undefined"?mboxForcePCId:b.getCookie(a);if(this.Ib!=null){b.setCookie(a,this.Ib,c)}};mboxPC.prototype.getId=function(){return this.Ib};mboxPC.prototype.forceId=function(a){if(this.Ib!=a){this.Ib=a;this.J.setCookie(this.Ab,this.Ib,this.sc);return true}return false};mboxGetPageParameter=function(b){var a=null;var c=new RegExp(b+"=([^&]*)");var d=c.exec(document.location);if(d!=null&&d.length>=2){a=d[1]}return a};mboxSetCookie=function(b,c,a){return mboxFactoryDefault.getCookieManager().setCookie(b,c,a)};mboxGetCookie=function(a){return mboxFactoryDefault.getCookieManager().getCookie(a)};mboxCookiePageDomain=function(){var a=(/([^:]*)(:[0-9]{0,5})?/).exec(document.location.host)[1];var b=/[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/;if(!b.exec(a)){var c=(/([^\.]+\.[^\.]{3}|[^\.]+\.[^\.]+\.[^\.]{2})$/).exec(a);if(c){a=c[0]}}return a?a:""};mboxShiftArray=function(c){var a=new Array();for(var b=1;b<c.length;b++){a[a.length]=c[b]}return a};mboxGenerateId=function(){return(new Date()).getTime()+"-"+Math.floor(Math.random()*999999)};mboxScreenHeight=function(){return screen.height};mboxScreenWidth=function(){return screen.width};mboxBrowserWidth=function(){return(window.innerWidth)?window.innerWidth:document.documentElement?document.documentElement.clientWidth:document.body.clientWidth};mboxBrowserHeight=function(){return(window.innerHeight)?window.innerHeight:document.documentElement?document.documentElement.clientHeight:document.body.clientHeight};mboxBrowserTimeOffset=function(){return -new Date().getTimezoneOffset()};mboxScreenColorDepth=function(){return screen.pixelDepth};if(typeof mboxVersion=="undefined"){var mboxVersion=40;var mboxFactories=new mboxMap();var mboxFactoryDefault=new mboxFactory("statefarm.tt.omtrdc.net","statefarm","default")}if(mboxGetPageParameter("mboxDebug")!=null||mboxFactoryDefault.getCookieManager().getCookie("debug")!=null){setTimeout(function(){if(typeof mboxDebugLoaded=="undefined"){alert("Could not load the remote debug.\nPlease check your connection to Test&amp;Target servers")}},60*60);document.write('<script language="Javascript1.2" src="http://admin5.testandtarget.omniture.com/admin/mbox/mbox_debug.jsp?mboxServerHost=statefarm.tt.omtrdc.net&clientCode=statefarm"></script>')}function readCookie(e){var f=e+"=";var b=document.cookie.split(";");for(var d=0;d<b.length;d++){var a=b[d];while(a.charAt(0)==" "){a=a.substring(1,a.length)}if(a.indexOf(f)==0){return a.substring(f.length,a.length)}}return null};
