
   if(!dbugScripts("commerce",["commerce.tron.door.js"])) {
   /*	commerce.tron.door.js - packed	*/
       var AboutBlog=new Class({Implements:[Options],options:{containerElement:$("aboutBlog"),linkElement:$("stayConnected"),blogHasNewsletter:true,contactXpos:"42px",rssXpos:"80px",twitterXpos:"120px",facebookXpos:"159px",linkedinXpos:"199px",emailXpos:"2px",emailsubscribedXpos:"2px",yPos:"31px"},initialize:function(E){var D=this;this.setOptions(E);if(this.options.linkElement==""){this.options.linkElement=this.options.containerElement.getNext();}var A=this.options.containerElement.getChildren();A.each(function(H){H.addEvent("mouseenter",function(){D.swapTxt(H);});});var C=new Array("facebook","linkedin","twitter");for(var F=0;F<C.length;F++){var B=C[F];if($(B)){$(B).addEvent("click",function(H){new Jlogger({tag:B+"Follow",ctype:"stayConnected",cval:B+"Btn",element:$(B).getElement("a"),event:"click",fireOnce:true});});}}this.options.containerElement.setStyle("background-position",this.options.emailXpos+" "+this.options.yPos);NewNewsletter.updateOnRefresh();if(!UserVars.isLoggedIn()){CURS.Manager.addEvent("onLogin",function(){(function(){dbug.log("firing delay func");try{if(!NewNewsletter.reloc){window.location=PageVars.getRefreshPath({subscribe:true,unsubscribe:false});}}catch(H){dbug.log("Newsletter onlogin event failure: %o",H);}}).delay(20);});try{$E(".subscribe").addEvent("click",function(H){if(H.stop){H.stop();}var I=$(H.target).getParent("[newsletter]");if(I){Cookie.write("addNL",I.getProperty("newsletter"));}CURS.Manager.checkLogin({loginHed:"Log in to CNET to subscribe",registerHed:"Join CNET to subscribe",appId:(PageVars.get("siteId","number")==4)?47:16});});$("stayConnected").getElement("a").cloneEvents($("email"),"click");}catch(G){dbug.log("No subscribe element on page!");}}else{try{$E(".subscribe").addEvent("click",function(H){if(H.stop){H.stop();}new NewNewsletter.Manage(H.target);});$("stayConnected").getElement("a").cloneEvents($("email"),"click");}catch(G){dbug.log("No subscribe element on page!");}}try{new NewNewsletter.Prefs("newsletterPrefsModal",{triggerSel:".updatePrefs"});}catch(G){}},swapTxt:function(E){var D=E.get("id");this.options.linkElement.fade("hide");$("stayConnected").getElement("a").removeEvents("click");var C=this.options.yPos;var A=this.options.emailXpos+" "+C;var B="Subscribe to e-mail updates";switch(D){case"contact":A=this.options.contactXpos+" "+C;B="Contact Editors";break;case"rss":A=this.options.rssXpos+" "+C;B="Add RSS Feed";break;case"twitter":A=this.options.twitterXpos+" "+C;B="Follow us on Twitter";break;case"facebook":A=this.options.facebookXpos+" "+C;B="Friend us on Facebook";break;case"linkedin":A=this.options.linkedinXpos+" "+C;B="Follow us on LinkedIn";break;case"email":A=this.options.emailXpos+" "+C;B="Subscribe to e-mail updates";break;case"emailsubscribed":A=this.options.emailsubscribedXpos+" "+C;B="You are subscribed to e-mail updates";break;default:}this.options.containerElement.tween("background-position",A);this.options.linkElement.getElement("a").removeEvents("click");this.options.linkElement.getElement("a").set("href",$(D).getElement("a").getProperty("href"));this.options.linkElement.getElement("a").set("text",B);if(D=="email"){this.options.linkElement.getElement("a").cloneEvents($("email"),"click");}this.options.linkElement.fade(1);}});var NewNewsletter=new Hash({Manage:new Class({options:{submitUrl:"/8674-4_"+PageVars.get("siteId")+"-0.html",nlIdKey:"newsletter",unsubscribeHTML:'<a href="http://www.cnet.com/newsletters" target="new">You are subscribed to e-mail updates</a>'},initialize:function(B,A){B=$(B);if(B.get("tag")!="li"){B=B.getParent("[newsletter]");}this.shell=(B.getProperty(this.options.nlIdKey))?B:B.getParent("["+this.options.nlIdKey+"]");this.id=this.shell.getProperty(this.options.nlIdKey);if(B.hasClass("subscribe")){this.action="subscribe";}else{this.action=null;}this.waiter=new Waiter(this.shell);this.pingServer();},updateState:function(){$("email").set("id","emailsubscribed");$("stayConnected").set("html",this.options.unsubscribeHTML);$("stayConnected").set("style","background-position: 249px -469px;");$("emailsubscribed").removeEvents("click");$("emailsubscribed").removeClass("subscribe");$("emailsubscribed").set("href","http://www.cnet.com/newsletters");$("emailsubscribed").set("target","new");},pingServer:function(){var A="";A+="action="+(this.action);A+="&"+(this.action)+"Ids="+this.shell.getProperty("newsletter");new Request({url:this.options.submitUrl,method:"get",data:A,onRequest:function(){this.waiter.start();}.bind(this),onComplete:function(B){this.waiter.stop();B=JSON.decode(B);if(B&&B.status&&B.status=="success"){this.updateState();}}.bind(this)}).send();}}),updateOnRefresh:function(){var B=new Cookie("addNL");if(B.read()){var C=$E("li[newsletter="+B.read()+"]");if(C){new Fx.Scroll(window).toElement(C);var A=C.getElement(".subscribe");if(A){new NewNewsletter.Manage(A);}}B.dispose();}},Prefs:new Class({Implements:Options,options:{triggerSel:".nlPrefsLink"},initialize:function(B,A){this.setOptions(A);this.shell=$(B).inject(document.body);this.triggers=$$(this.options.triggerSel);this.triggers.addEvent("click",this.toggle.bind(this));this.shell.getElements(".closeModal").addEvent("click",this.hide.bind(this));this.initPrefs();this.ping=new Request({url:"/8674-4-0.html",method:"get"});},initPrefs:function(){this.shell.getElements("input[type=radio]").each(function(A){A.addEvent("click",this.updateRadio.pass(A,this));}.bind(this));},updateRadio:function(A){if(A.hasClass("ping")){this.pingPref({action:"updateMailPref",mailPref:A.get("value")});}this.notifyUpdate(A);},notifyUpdate:function(C){var B=new Element("span",{text:"preference saved",styles:{opacity:0,color:"#C00","font-weight":"bold"}}).inject(C.getParent("label"));var A=function(){if(B.getStyle("opacity")>0.1){(function(){B.morph({opacity:0});}).delay(1500);}else{B.dispose();}};B.set("morph",{duration:250,onComplete:A}).morph({opacity:1});},pingPref:function(A){A=A||{};this.ping.send(new Hash(A).toQueryString());},show:function(){this.shell.setPosition({});this.shell.setStyle("top",window.getScrollTop()+50);this.shell.setStyle("display","block");},hide:function(){this.shell.setStyle("display","none");},toggle:function(){if(this.shell.getStyle("display")=="none"){this.show();}else{this.hide();}}}),resetReloc:function(){NewNewsletter.reloc=false;CURS.Manager.removeEvent("onClose",NewNewsletter.resetReloc);}});PageTools.ShareShell=new Class({Implements:Options,options:{nestedElem$$:".shareHead, .shareContent"},initialize:function(B,C,A){B=$(B);if(B.retrieve("shareShell")){return false;}this.setOptions(A);this.trigger=B;this.trigger.store("shareShell",this);this.data=(C)?new Hash(C):PageVars.data;this.setEvents(this.trigger);return this;},open:function(){var B,A;if(this.showing&&!this.shareShell){return ;}if(this.shareShell&&this.showing){this.show();}else{if(this.shareShell){this.showing=this.show.delay(100,this);}else{this.showing=true;B=this.data;A=(B.get("siteId")==4)?20:(B.get("siteId")==162)?100:1;new Request({url:"/8791-"+A+"_"+B.get("siteId")+"-0.html?nomesh",data:{shareURL:B.get("shareURL"),shareTitle:B.get("shareTitle"),shareDescription:B.get("shareDescription").replace(/ More$/,"")},onSuccess:this.createShareShell.bind(this)}).send();}}},setEvents:function(A){if(!this.bound){this.bound={show:this.open.bind(this),hide:function(){this.hiding=(function(){this.showing=$clear(this.showing);this.hide();}).delay(50,this);}.bind(this),mousemove:this.checkMousePosition.bind(this)};}$$(A).addEvent("mouseenter",this.bound.show);if(A==this.trigger){this.trigger.addEvent("mouseleave",function(){if(this.showing){this.showing=$clear(this.showing);}});}else{$$(A).addEvent("mouseleave",this.bound.hide);}},checkMousePosition:function(A){if(this.checkPos){this.checkPos=$clear(this.checkPos);}this.checkPos=this.checkPosition.delay(20,this,A);},checkPosition:function(D){var E=false,C=D.page,A;for(A=0;A<this.areas.length;A++){var B=this.areas[A];if(B.left<=C.x&&B.right>=C.x){if(B.top<=C.y&&B.bottom>=C.y){E=true;break;}}}if(!E){this.hide();}},createShareShell:function(A){var B=this.trigger;B.getParent().setStyles("width",B.getComputedSize().totalWidth);this.shareShell=new Element("div",{id:"shareDropDown"}).inject(document.body);this.shareShell.set("html",A);this.trigger.removeEvent("mouseleave",this.bound.hide);this.nestedElements=this.shareShell.getElements(this.options.nestedElem$$);this.setEvents(this.shareShell);this.open();},positionShareShell:function(){var A;this.shareShell.setPosition({relativeTo:this.trigger,position:(this.trigger.hasClass("anchorLeft"))?"upperLeft":"upperRight",edge:(this.trigger.hasClass("anchorLeft"))?"upperLeft":"upperRight",offset:{x:(this.trigger.hasClass("anchorLeft"))?(Browser.Engine.trident4)?-6:-11:(Browser.Engine.trident4)?8:12,y:(Browser.Engine.trident4)?-5:-6}});if(Browser.Engine.trident){A=getElementCoordinates(this.trigger);this.shareShell.setStyles({top:A.top-6,left:A.left-6});}this.areas=[];this.nestedElements.each(function(B){this.areas.push(getElementCoordinates(B));},this);if(PageTools.initialFontSize){this.shareShell.getElement(".shareHead").setStyle("font-size",PageTools.initialFontSize+"%");}},show:function(){if(this.hiding){this.hiding=$clear(this.hiding);}this.positionShareShell();this.shareShell.setStyle("display","block");window.addEvent("mousemove",this.bound.mousemove);},hide:function(){if(this.shareShell){this.shareShell.setStyle("display","none");}window.removeEvent("mousemove",this.bound.mousemove);}});var getElementCoordinates=function(A){var C=A=$(A),B=A.getCoordinates();if(Browser.Engine.trident){B.top=0;B.left=0;do{B.top+=C.offsetTop;B.left+=C.offsetLeft;}while(C=C.offsetParent);B.bottom=B.top+B.height;B.right=B.left+B.width;}return B;};window.addEvent("domready",function(){$$(".shopperSpecials li").each(function(B){if(B.getElement(".email")){B.getElement(".email").addEvent("click",function(){PageTools.email({href:B.getElement(".assetHed a").getAttribute("href"),title:encodeURIComponent(B.getElement(".assetHed a").get("text")),description:encodeURIComponent(B.getElement(".assetBody").get("text"))});});}});$$(".shopperSpecials .shareIco").each(function(B){if(B.retrieve("shareShell")){return false;}var A=B.getParent("li");var C=$merge(PageVars.data.getClean(),{shareURL:A.getElement(".assetHed a").getProperty("href"),shareTitle:A.getElement(".assetHed a").get("text"),shareDescription:A.getElement(".assetBody").get("text")});new PageTools.ShareShell(B,C);});$$("a.toolTipElement").each(function(A){var B=A.getParent().getElement("ul.data");if(B){A.store("tip:text",B.getParent().get("html"));}else{A.store("tip:text","Information not available");}});if($$(".imageGalleries a").length){$$(".imageGalleries a").each(function(A){new Element("div",{"class":"imageOverlay",html:A.getElement("img").get("alt")}).inject(A);A.addEvents({mouseenter:function(){A.getElement(".imageOverlay").setStyle("display","block");},mouseleave:function(){A.getElement(".imageOverlay").setStyle("display","none");}});});}$$("a.iBox").each(function(C,A){var D="iBox"+A;var B=new Element("div",{id:D,"class":"iBox"}).set("html",'<a class="closeSticky">close</a><iframe frameborder="0" scrolling="auto" src="'+C.get("href")+'" hspace="0" width="520px" height="253px"></iframe>');C.addEvent("click",function(E){E.stop();new StickyWinModal({content:B,width:520,height:253,modalOptions:{modalStyle:{"background-color":"#666666",opacity:0.6}}});});});if($("aboutCNET")){new AboutBlog({containerElement:$("aboutCNET"),linkElement:$("stayConnected"),contactXpos:"-1px",rssXpos:"31px",twitterXpos:"63px",facebookXpos:"95px",linkedinXpos:"127px",emailXpos:"-33px",emailsubscribedXpos:"-33px",yPos:"-508px"});}});
   }
       
