/* * @version ecomfw.js v2.6.3:1101 01.11.2010 * @author Paul Bronshteyn * @author Russell Munson * @comment Built by a geek loaded on caffeine ... * @copyright (c) Conde Nast Digital */ if(typeof CNP==="undefined"||!CNP){var CNP={}}CNP.ecom=(function(){var ab="ecom",W=null,q=null,k=true,Q=false,L={idx:0},ad="",p=[],F=document,y=location,s=y.search,al=ab+"_test",T="ecommerce_test_site",P=0,v=false,H="Please enter a valid ",V=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i,aj=/(^\d{5}$)|(^\d{5}-\d{4}$)/,R=navigator.userAgent.toLowerCase(),f={safari:/webkit/.test(R),opera:/opera/.test(R),msie:/msie/.test(R)&&!/opera/.test(R),moz:/mozilla/.test(R)&&!/(compatible|webkit)/.test(R)},E=((f.moz||f.safari)?"offset":"scroll")+"Height",U={},ae=function(am){var ap=z("div"),ao=z("iframe"),an=jQuery(window);ap.id=ab+"usc";F.body.style.overflow="hidden";Z(ap.style,{width:F.body.scrollWidth+"px",height:F.body.scrollHeight+"px",filter:"alpha(opacity = 80)",opacity:".80",zIndex:110000000,position:"absolute",left:"0px",top:"0px",background:"#000000"});O(F.body,ap,"ap");aa(true);Z(ao,{id:ab+"usf",src:h(g(am).replace(/^https*:\/\//g,x()),"iframe","true"),width:749,height:669,scrolling:"no"});Z(ao.style,{background:"#ffffff",border:"0px",position:"absolute",zIndex:120000000,left:(an.width()/2-ao.width/2)+"px",top:(an.scrollTop()+(an.height()/7))+"px"});O(F.body,ao,"ap");j("load",ao,function(){try{this.height=this.contentDocument.body[E]+"px"}catch(aq){}});j("resize",window,function(){var ar=e(ab+"usc"),aq=e(ab+"usf");ar.style.width=F.body.scrollWidth+"px";ar.style.height=F.body.scrollHeight+"px";aq.style.left=(an.width()/2-aq.width/2)+"px";aq.style.top=(an.scrollTop()+(an.height()/7))+"px"});ap=ao=null},z=function(an,am){return(am||F).createElement(an)},e=function(an,am){return(am||F).getElementById(an)},l=function(am,an){return(an||F).getElementsByTagName(am)||[]},O=function(an,ao,am){(am==="rm"?an.removeChild(ao):(am==="ap"?an.appendChild(ao):false))},c=function(an,am){an.style.display=(am==="hide"?"none":"block")},Y=function(an,am){an.innerHTML=am},aa=function(ap){var ao=l("select"),an=0,am=ao.length;for(;anPlease try again.");c(aC)},5000)}return false})},r=function(ap){var ao=l("input",L[ap].p),an=0,am=ao.length,aq=h(s,"as"),ar;for(;an>16,(ap&65280)>>8,ap&255)}if(aq.charCodeAt(ao-2)===61){return am.substring(0,am.length-2)}else{if(aq.charCodeAt(ao-1)===61){return am.substring(0,am.length-1)}else{return am}}}},af=function(){var an=z("div"),am=z("a");an.id=al;Y(an,"!!! ATTENTION !!! YOU ARE USING ECOM PREVIEW SERVER !!! ATTENTION !!!
");Z(an.style,{zIndex:100000000,backgroundColor:"#FFD700",color:"#809000",padding:"4px",fontWeight:"bold",textAlign:"center",border:"1px solid #333",marginBottom:"10px",position:"fixed",width:"100%",top:"0px"});Y(am,"[ return to normal mode ]");am.href="#";O(an,am,"ap");O(F.body,an,"ap");j("click",am,function(ao){N.del(al);O(F.body,(ao.srcElement||ao.target).parentNode,"rm");y.search=h(s,T,"");return false});an=am=null},ai={pingPath:"status.jsp",offerPath:"targetedOffer.jsp",subPath:"embeddedForm.jsp",showPath:"showOffer.jsp",docDomain:true,domain:w(),host:"magazine."+this.domain,path:"/ecom/",user:M(),section:C(),timeout:2,https:false,callback:null,params:{},cdn:false,onload:false,contentEnc:"xml",jsEnc:"true"};return{start:function(am){if(h(s,"nojoy")==="1"){return k=Q=false}for(var ao in ai){ai[ao]=h(s,ab+ao)||(am||{})[ao]||ai[ao]}if(ai.cdn===false){var an=h(s,T)||N.get(al)||"";if(an){N.set(al,an);j("load",self,af);ai.host=an}else{N.del(al)}}else{N.del(al)}if(ai.docDomain&&ai.domain){F.domain=ai.domain}ai.host=x()+ai.host.replace(/^https*:\/\/|\/+$/g,"")+ai.path;ac();j("load",self,function(){mboxCreate=function(){return false};if(h(s,"ecomupsell")==="true"){ae(g(h(s,"ecomupsellurl")).replace(/^https*:\/\//g,x()))}if(ai.onload){ai.onload=false;for(var ap;ap=p.shift();){ak(ap)}}});ad=h(s,"nojoytgt");P=(h(s,"edebug")==="1")?1:0;if(P){v=h(s,"targetVer")||false}},mbox:function(an,am){if(typeof an.getUID==="function"){u(an.getUID(),ai.showPath,{placementId:am},"mbox")}},setCallback:function(an){var am=an.name;for(var ao=0;ao]*>([\s\S]*?)<\/script>/i)||[null,null])[1]);if(a(ar)){return}Y(L[ax].p,ar.replace(//g,""));switch(o(l("placementType",ay)[0])){case"Banner":case"Link":if(!an){break}var av=z("script");av.type="text/javascript";av.id=ab+"js"+ax;if(f.msie){av.text=an}else{O(av,F.createTextNode(an),"ap")}O(L[ax].p,av,"ap");O(L[ax].p,av,"rm");av=null;break;case"embeddedForm":B(ax);break;case"autoSub":r(ax);break;case"testPlacement":case"testPlacement_Banner":case"testPlacement_Link":t(ax,an);break;case"testPlacement_autoSub":t(ax,an);r(ax);break;case"testPlacement_embeddedForm":t(ax,an);B(ax);break}if(L[ax].callafter){X(L[ax].callafter,L[ax].fid)}}else{if(l("response",ay)[0]){clearTimeout(L[ax].frmto);var aq=e("frm_error_"+ax,L[ax].doc);if(l("errors",ay)[0]){var am="",aw=l("error",ay),au=0,ap=aw.length;for(;au"}Y(aq,am);c(aq)}else{c(aq,"hide");Y(aq,"");if(l("ccUpsellPage",ay)[0]){ae(o(l("ccUpsellPage",ay)[0]).replace(/^https*:\/\//g,x()))}l("form",L[ax].p)[0].reset()}L[ax].btn.disabled="";L[ax].btn.value="Submit"}}}else{Y(L[ax].p,ao)}ah(ax);n(ax)}}})(); /*************************************** * Validate Registration URL * and Show Popup when validated success * */ CN.validateRegistration=(function(){ var url_Param_ecomUpsellURL, url_window=window.location.href; return { checkSuccessURL : function() { if(CN.url.params("ecomUpsell", url_window)=="true") { url_Param_ecomUpsellURL=decodeURIComponent(decodeURIComponent(CN.url.params("ecomUpsellURL", url_window))); url_Param_ecomUpsellURL=url_Param_ecomUpsellURL.replace(/^https*:\/\//g, window.location.protocol+"//"); window.open(url_Param_ecomUpsellURL, "PaymentPage", "menubar=1,status=0,resizable=0,toolbar=0,scrollbars=0,width=910,height=560,left="+((screen.width)/3)+",top="+((screen.height)/3)); } } }; })(); jQuery(document).ready(function() { CN.validateRegistration.checkSuccessURL(); });