
/*
Popup 2.1
copyright 2000, 2001,2002, 2003, 2006 Time, Inc.
design, code: Gary Poster, updates by Colin Rudd
if collapsed, see [full_filename].bak.js on staging server for original version
*/
var G_=new Object();G_.loc=self.location.href.toLowerCase();G_.dest="";G_.now=new Date();G_.nowN=G_.now.getTime();G_.seed=Math.random();G_.imageLoad=new Image();G_.horizMargin=10;G_.vertMargin=25;G_.horizBorder=4;G_.topBorder=15;G_.mo=2678400000;G_.popFeatures="";G_.popURL="";G_.positioning="";G_.countdown="";{var agt=navigator.userAgent.toLowerCase();G_.appName=navigator.appName.toLowerCase();G_.major=parseInt(navigator.appVersion);G_.minor=parseFloat(navigator.appVersion);G_.nav=((agt.indexOf('mozilla')!=-1)&&(agt.indexOf('spoofer')==-1)&&(agt.indexOf('compatible')==-1)&&(agt.indexOf('opera')==-1)&&(agt.indexOf('webtv')==-1)&&(G_.appName.indexOf('netscape')!=-1));G_.nav4=(G_.nav&&G_.major==4&&G_.minor>4.05);G_.nav6up=(G_.nav&&(G_.major>=5));if(typeof navigator.vendorSub!="undefined"){G_.navMajor=parseInt(navigator.vendorSub);}else G_.navMajor=0;G_.ie=(agt.indexOf("msie")!=-1);G_.ieMinor=G_.ie?parseFloat(agt.slice(agt.indexOf("msie")+4)):0;G_.ieMajor=parseInt(G_.ieMinor);G_.aol=(agt.indexOf("aol")!=-1);G_.aolMinor=G_.aol?parseInt(agt.slice(agt.indexOf("aol")+3)):0;G_.aol7up=G_.aolMinor>=7;G_.firefox=(agt.indexOf("firefox/")!=-1);G_.win2000=(agt.indexOf("windows nt 5.0")!=-1);G_.winXP=(agt.indexOf("windows nt 5.1")!=-1);G_.win31=((agt.indexOf("windows 3.1")!=-1)||(agt.indexOf("win16")!=-1)||(agt.indexOf("windows 16-bit")!=-1));G_.win=((agt.indexOf("win")!=-1)||(agt.indexOf("16bit")!=-1));G_.mac=(agt.indexOf("mac")!=-1);G_.macX=(agt.indexOf("mac os x")!=-1);var host=self.location.hostname.toLowerCase().split(".");if(host.length>2){var myX=host[host.length-1];if(myX=="com"||myX=="edu"||myX=="net"||myX=="org"||myX=="gov")G_.domain=host.slice(host.length-2).join(".");else if(host.length>3)G_.domain=host.slice(host.length-3).join(".");}};G_.compPath='http://i.timeinc.net/subs/popup2/comp/';if(!document.cookie)document.cookie="PopUpCalls=0;path=/;";var P_execute;if(document.cookie){var P_execute=true;if(G_.macX||G_.win2000||G_.winXP){if(G_.major>=5||(G_.ie&&G_.ieMajor>=6)){document.write('<scr'+'ipt language="JavaScript1.4" type="text/javascript" src="'+G_.compPath+'moz5_2.js"></scr'+'ipt>');}else P_execute=false;}else P_execute=false;};function G_readString(delineators){if(delineators&&delineators.constructor==Array){var theArray=this.split(delineators[0]);if(delineators.length>1)for(var i=0;i<theArray.length;i++)theArray[i]=theArray[i]._read(delineators.slice(1));return theArray;};return false;};String.prototype._read=G_readString;function G_packArray(delineators){var theString="";for(var i=0;i<this.length;i++){var temp=this[i];if(typeof(temp)=="object"&&temp.constructor==Array)temp=temp._pack(delineators.slice(1));if(temp)theString+=temp+delineators[0];};return theString.slice(0,-(delineators[0].length));};Array.prototype._pack=G_packArray;function argToArr(a){var r=[];for(var i=0; i<a.length; i++)r[r.length]=a[i];return r;};function gPopUp(isPreExpire,popupStyle){if(isPreExpire){P_magicIframe(); return;};if(popupStyle||(typeof G_.formLayerArgs!="undefined")){switch(popupStyle){case 1:P_makeFormLayer(G_.formLayerArgs,G_.popURL); break;case 2:P_makeBareFormLayer(G_.formLayerArgs,G_.popURL); break;};return;};if(G_.popURL){window.open(G_.popURL,"POPUP",G_.popFeatures);}else if(G_.aolURL)window.location.href=G_.aolURL;else if(G_.flashDiv){window.document.body.appendChild(G_.flashDiv);window.document.body.appendChild(G_.trackingGIF);}};function P__ruleSet(){function update(){if(this instanceof P__meta||this instanceof P__seq){G_._c[this.chipId][1]=G_.nowN;G_._c[this.chipId][2]=parseInt(G_._c[this.chipId][2])+1;};this.par._updated[this.par._updated.length]=this.name;};function test(){if(P_execute&&this.cycle*3600000+parseInt(G_._c[this.chipId][1])<=G_.nowN&&(this.impression<0||parseInt(G_._c[this.chipId][2])<this.impression)){if(this.isPreExpire&&!P_crtnDetect("PREEXPIRE"))return false;if(this.popupStyle&&!P_formLayer())return false;if(this.rules)return eval(this.rules);return true;};return false;};this.constr=P__ruleSet;this._test=test;this.update=update;};function P__ruleSet_i(o,a){o.name=a[0];o.rules=a[1];o.cycle=a[2]||0;o.start=a[3]||0;o.impression=isNaN(a[4])?-1:a[4];o.par=a[5];o.chipId=0;if(o.par){while(o.chipId<G_._c.length&&G_._c[o.chipId][0]&&G_._c[o.chipId][0]!=o.name)o.chipId++;if(o.chipId==G_._c.length)G_._c[o.chipId]=[o.name,0,0];else if(!G_._c[o.chipId][1]||parseInt(G_._c[o.chipId][1])<o.start)G_._c[o.chipId][2]=0;}};function P__meta(){this.constr=P__meta;P__ruleSet_i(this,argToArr(arguments))};P__meta.prototype=new P__ruleSet();function P__popup(){function test(){return this._test();};function launch(){if(this._test()){this.update();return this;};return false;};function pre(time){if(this._test()){if(this.image){if(time)setTimeout("G_.imageLoad.src=\""+this.image+"\"",time);else G_.imageLoad.src=this.image;};return true;};return false;};function pop(noC){var popA=this.source.split("?");var popAb=popA[1]?popA[1]._read(["&","="]):[];popAb=popAb.concat([["LOC",escape(document.location.host+document.location.pathname)],["NOWN",G_.nowN],["UPDATED",escape(this.par._updated.join("~"))],["_T",escape(G_._t)]]);G_.popURL=popA[0]?popA[0]+"?"+popAb._pack(["&","="]):0;G_.positioning=(G_.ie?",left=":",screenX=")+Math.max(((screen.width-this.width-2*G_.horizMargin)*this.pLeft/100+G_.horizMargin-G_.horizBorder),0)+(G_.ie?",top=":",screenY=")+Math.max(((screen.height-this.height-2*G_.vertMargin)*this.pTop/100+G_.vertMargin-G_.topBorder),0);if(G_.win2000&&G_.ie&&G_.ieMajor<=6&&!G_.aol7up)G_.positioning="";G_.popFeatures=this.winOpts+(this.winOpts?",":"")+(G_.ie||G_.nav6up?"height=":"innerHeight=")+this.height+(G_.ie||G_.nav6up?",width=":",innerWidth=")+this.width+G_.positioning;if(this.popupStyle){G_.positioning=Math.max((((G_.ie?document.documentElement.clientWidth||document.body.clientWidth:window.innerWidth)-this.width-25)*this.pLeft/100),0)+","+Math.max((((G_.ie?document.documentElement.clientHeight||document.body.clientHeight:window.innerHeight)-this.height-25)*this.pTop/100)+(document.documentElement.scrollTop||document.body.scrollTop),100);G_.formLayerArgs=G_.positioning+","+this.width+","+this.height+","+this.layerHover+","+this.layerZindex;};if(this.delay){this.delay*=1000;var start_of_countdown=new Date().getTime();var list=document.cookie._read([/;\s*/,"="]);for(var i=0; i<list.length; i++){if(list[i][0]==("PopUpCalls"+G_._t+"_DELAYED")){this.delay-=(start_of_countdown-parseInt(list[i][1],10));start_of_countdown=parseInt(list[i][1],10);break;}};var kill=new Date(new Date().getTime()+this.delay);G_.isPreExpire=this.isPreExpire;G_.popupStyle=this.popupStyle;document.cookie="PopUpCalls"+G_._t+"_DELAYED="+start_of_countdown+"; expires="+kill.toUTCString()+"; path=/"+(G_.domain?"; domain=."+G_.domain:"");G_.countdown=window.setTimeout('gPopUp(G_.isPreExpire,G_.popupStyle);',this.delay);}else gPopUp(this.isPreExpire,this.popupStyle);self.focus();var then=new Date(G_.nowN+3*G_.mo);var newMix="";for(var i=0; i<G_._c.length; i++){if(G_._c[i][1]&&parseInt(G_._c[i][1])>(G_.nowN-3*G_.mo)){if((!G_.popURL)&&G_._c[i][1]<G_.nowN){for(var j=0; j<this.par._updated.length; j++){if(G_._c[i][0]==this.par._updated[j]){G_._c[i][1]=G_.nowN;G_._c[i][2]++;}}};newMix+=G_._c[i].join("|")+"~";}};if(!G_.popURL){for(i=0; i<this.par._updated.length; i++){if(newMix.indexOf(this.par._updated[i])==-1){newMix+=this.par._updated[i]+"|"+G_.nowN+"|1|~";}}};var cookie_instr='document.cookie="PopUpCalls'+G_._t+'='+escape(newMix.slice(0,-1))+'; expires='+then.toGMTString()+'; path=/'+(G_.domain?'; domain=.'+G_.domain:'')+'"';if(!noC){if(this.delay)var cookie_countdown=window.setTimeout(cookie_instr,this.delay);else eval(cookie_instr);}};this.constr=P__popup;this.launch=launch;this.pre=pre;this.test=test;this.pop=pop;};P__popup.prototype=new P__ruleSet();function P__popup_i(o,a){P__ruleSet_i(o,a.slice(12));o.source=a[0];o.delay=a[1];o.width=a[2];o.height=a[3];o.image=a[4];o.pLeft=isNaN(a[5])||a[5]<0||a[5]>100?50:a[5];o.pTop=isNaN(a[6])||a[6]<0||a[6]>100?50:a[6];o.winOpts=a[7];o.isPreExpire=parseInt(a[8]);o.popupStyle=parseInt(a[9]);o.layerHover=parseInt(a[10]);o.layerZindex=a[11];};function P_popup(){this.constr=P_popup;P__popup_i(this,argToArr(arguments));};P_popup.prototype=new P__popup();function P__group(){function itemChance(item,chance){this.i=item;this.c=chance;};function addItems(children){for(var i=0;i<children.length;i++)this.items[this.items.length]=new itemChance(children[i],isNaN(children[i+1])?1:children[++i]);};function test(){if(this._test()&&this.items.length)for(var i=0;i<this.items.length;i++)if(this.par[this.items[i].i].test())return true;return false;};function getItem(){if(this._test()&&this.items.length){var temp=[];var totalChances=0;for(var i=0;i<this.items.length;i++)if(this.par[this.items[i].i].test()){temp[temp.length]=this.items[i];totalChances+=this.items[i].c;};if(temp.length==0)return false;if(totalChances==0)return this.par[temp[0].i];var choice=Math.floor(G_.seed*totalChances);var count=0;for(var i=0;i<temp.length;i++)if(choice<(count+=temp[i].c))return this.par[temp[i].i];};return false;};function launch(){var theItem=this.getItem();if(theItem){this.update();return theItem.launch();};return false;};function pre(time){var theItem=this.getItem();if(theItem)return theItem.pre(time);return false;};this.constr=P__group;this.add=addItems;this.getItem=getItem;this.launch=launch;this.test=test;this.pre=pre;};P__group.prototype=new P__ruleSet();function P__group_i(o,a){P__ruleSet_i(o,a);o.items=[];o.chances=[];};function P_group(){this.constr=P_group;P__group_i(this,argToArr(arguments));};P_group.prototype=new P__group();function P__seq(){function addItems(children){this.items=this.items.concat(children);};function launch(){if(this.par.meta._test()&&this._test()&&this.items.length){var i=0;var theItem;while(i<this.items.length&&!(theItem=this.par[this.items[i]].launch()))i++;if(theItem){this.update();this.par.meta.update();theItem.pop((this.name=="unload"&&G_.nav4));return true;}};return false;};function pre(time){if(!this.par.meta._test()||!this._test()||!this.items.length)return false;var i=0;while(i<this.items.length&&!this.par[this.items[i]].pre(time))i++;return(i<this.items.length);};this.constr=P__seq;this.add=addItems;this.launch=launch;this.pre=pre;};P__seq.prototype=new P__ruleSet();function P__seq_i(o,a){P__ruleSet_i(o,a);o.items=[];};function P_seq(){this.constr=P_seq;P__seq_i(this,argToArr(arguments));};P_seq.prototype=new P__seq();function P__(){function addPop(source,delay,width,height,image,pLeft,pTop,winOpts,isPreExpire,popupStyle,layerHover,layerZindex,name,rules,cycle,start,impression){this[name]=new P_popup(source,delay,width,height,image,pLeft,pTop,winOpts,isPreExpire,popupStyle,layerHover,layerZindex,name,rules,cycle,start,impression,this);};function addGrp(name,rules,cycle,start,impression){this[name]=new P_group(name,rules,cycle,start,impression,this);};function addSeq(name,rules,cycle,start,impression){this[name]=new P_seq(name,rules,cycle,start,impression,this);};function add(name,children){this[name].add(children);};if(!G_._c)P_getCookie();this._p=addPop;this._g=addGrp;this._s=addSeq;this._add=add;this._updated=[];this.meta=new P__meta("meta","",0,0,-1,this);this._s("load");this._s("unload");this.meta.rules='!P_locIs("cp.","/privacy","cnn=yes","google=yes") && !(P_locIs("/time/subscriber/"))';this.meta.cycle=0;this.meta.start=0;this.meta.impression=-1;this._g("non_sub",'!P_crtnDetect("NEWSUB")&&!P_crtnDetect("CURRENTSUB")&&!P_crtnDetect("MAGICDN")',24,0,-1);this._add("unload",["non_sub"]);this.load.rules='';this.load.cycle=168;this.load.start=0;this.load.impression=-1;this.unload.rules='!P_destIs("cnn.com","pathfinder.com","timeinc.net","time.com","secure.customersvc.com","ads.web.aol.com","time-planner.com", "timemediakit.com","ultramercial.com")';this.unload.cycle=0;this.unload.start=0;this.unload.impression=-1;};G_._t="TD";G_.ignoreFrames=true;function P_destIs(){for(var i=0;i<arguments.length;i++)if(G_.dest.toLowerCase().indexOf(arguments[i].toLowerCase())>-1)return true;return false;};function P_locIs(){for(var i=0;i<arguments.length;i++)if(G_.loc.toLowerCase().indexOf(arguments[i].toLowerCase())>-1)return true;return false;};function P_crtnDetect(){var userType=arguments[0];var c=document.cookie._read([/;\s*/,"="]);var crtnString;var TICM_renew=1;for(var i=0;i<c.length;i++){if(unescape(c[i][0])=="ITG_CUR")crtnString=unescape(c[i][1]);if(unescape(c[i][0])=="TICM_renew")TICM_renew=unescape(c[i][1]);};if(typeof crtnString=="undefined"&&userType=="NOCURTAINCOOKIE"){return true;};if(typeof crtnString=="undefined")return false;if(userType=="CURRENTSUB"){if(!crtnString.match(/NEWSUB|NEWSSTAND|REF/)||crtnString.match(/MAGICDN/))return true;};if(userType=="PREEXPIRE"&&TICM_renew==1){if(!((G_.win2000||G_.winXP)&&(G_.ie||G_.firefox)))return false;if(crtnString.match(/NEWSUB|NEWSSTAND|REF|MAGICDN/))return false;var subscriber=crtnString.split("|");if(0<=(subscriber[2]*1000-G_.nowN)&&(subscriber[2]*1000-G_.nowN)<=G_.mo*3){G_.preExpCrtnString=crtnString;return true;};};if(crtnString.indexOf(userType)>-1)return true;return false;};function P_magicIframe(){var magicResults=G_.popURL.split("/rd")[0]+"/preexpireresult.html";var preExp=document.createElement("iframe");preExp.setAttribute("id","ifPreExp");preExp.src="http://curtain.timeinc.net/reval.jhtml?cookie="+G_.preExpCrtnString+"&url="+escape(magicResults)+"&checkPreExpire=true&zone="+G_._t;preExp.style.width="1px";preExp.style.height="1px";preExp.style.borderWidth="0px";preExp.scrolling="no";window.document.body.appendChild(preExp);};function P_getCookie(){var c=document.cookie._read([/;\s*/,"="]);G_._c=[];for(var i=0;i<c.length;i++)if(unescape(c[i][0])=="PopUpCalls"+G_._t&&c[i][1]){G_._c=unescape(c[i][1])._read(["~","|"]);break;}};
