
   if(!dbugScripts("commerce",["reviews.tron.r2d2.js"])) {
   /*	reviews.tron.r2d2.js - packed	*/
       var ActivityMonitor=new Class({Implements:[Options,Events],options:{waitPeriod:15*1000,inactivePeriod:3*60*1000,events:["scroll","mousemove","keypress","click"],element:document},active:true,initialize:function(A){this.setOptions(A);this.element=$(this.options.element);this.bindEvents();window.addEvent("domready",this.startMonitor.bind(this));},startMonitor:function(){this.setWaitPeriod();this.setPageEvents(this.bound.deactivateUser,false,"blur");this.setPageEvents(this.bound.reactivateUser,false,"focus");},stopMonitor:function(){if(this.waiting){this.waiting=$clear(this.waiting);}if(this.testing){this.testing=$clear(this.testing);}this.setPageEvents(this.bound.deactivateUser,"remove","blur");this.setPageEvents(this.bound.reactivateUser,"remove","focus");this.setPageEvents(this.bound.passTest,"remove");this.setPageEvents(this.bound.reactivateUser,"remove");},bindEvents:function(){var A=this.bound={};A.passTest=this.passTest.bind(this);A.reactivateUser=this.reactivateUser.bind(this);A.deactivateUser=this.deactivateUser.bind(this);},passTest:function(){this.setPageEvents(this.bound.passTest,"remove");this.testing=$clear(this.testing);this.inactiveStart=null;this.setWaitPeriod();},failTest:function(){this.deactivateUser();},setWaitPeriod:function(){$clear(this.waiting);this.waiting=this.setTesting.delay(this.options.waitPeriod,this);},setTesting:function(){this.setPageEvents(this.bound.passTest);this.inactiveStart=$time();$clear(this.testing);this.testing=this.failTest.delay(this.options.inactivePeriod,this);},setPageEvents:function(C,A,B){$splat(B||this.options.events).each(function(D){this.element[((A)?"remove":"add")+"Event"](D,C);},this);},deactivateUser:function(){this.waiting=$clear(this.waiting);this.testing=$clear(this.testing);if(this.active){if(!this.inactiveStart){this.inactiveStart=$time();}this.active=false;this.setPageEvents(this.bound.reactivateUser);this.fireEvent("onDeactivate");}},reactivateUser:function(){if(!this.active){this.active=true;this.setPageEvents(this.bound.reactivateUser,"remove");this.setWaitPeriod();this.fireEvent("onReactivate",(this.inactiveStart)?($time()-this.inactiveStart):null);this.inactiveStart=null;}},isActive:function(){return !!this.active;},getInactiveTime:function(){var A=$time();if(this.active){return 0;}return A-this.inactiveStart;}});ActivityMonitor.Scheduled=new Class({Implements:[Options,Events],options:{decay:null,startNow:true},initialize:function(B,C,A){this.fn=B;this.monitor=ActivityMonitor.monitor||(ActivityMonitor.monitor=new ActivityMonitor());this.period=C;this.setOptions(A);this.setBound();if(this.options.startNow){this.start();}else{this.resume();}},setBound:function(){var A=this.bound={};A.reactivate=this.reactivate.bind(this);A.deactivate=this.deactivate.bind(this);},deactivate:function(){if(!this.options.decay){this.delaying=$clear(this.delaying);}},reactivate:function(B){var A;this.delaying=$clear(this.delaying);B=B||0;A=$time();if((A+B>this.scheduledUpdate)){this.fireFunc();}else{this.delayedUpdate(this.scheduledUpdate-A);}},stop:function(){this.delaying=$clear(this.delaying);this.monitor.removeEvent("onReactivate",this.bound.reactivate);this.monitor.removeEvent("onDeactivate",this.bound.deactivate);},start:function(){this.resume(true);this.fireFunc();},resume:function(A){this.monitor.addEvent("onReactivate",this.bound.reactivate);this.monitor.addEvent("onDeactivate",this.bound.deactivate);if(!A){this.delayedUpdate();}},delayedUpdate:function(A){A=A||this.period;this.scheduledUpdate=$time()+A;if(!this.monitor.isActive()){if(this.options.decay){A=Math.max(this.options.decay*this.monitor.getInactiveTime(),this.period);}else{return ;}}this.delaying=this.fireFunc.delay(A,this);},fireFunc:function(){this.fn();this.delayedUpdate();}});Function.implement({scheduled:function(C,D,B){if(this.scheduledJob){if(["stop","start","resume"].contains(C)){this.scheduledJob[C];return ;}}B=B||{};var A=B.args;if(A){delete B.args;}return this.scheduledJob=new ActivityMonitor.Scheduled(this.bind(D,A),C,B);}});ActivityMonitor.monitor=new ActivityMonitor();var Accordion=new Class({Extends:Fx.Elements,options:{display:0,show:false,height:true,width:false,opacity:true,fixedHeight:false,fixedWidth:false,wait:false,alwaysHide:false},initialize:function(){var C=Array.link(arguments,{container:Element.type,options:Object.type,togglers:$defined,elements:$defined});this.parent(C.elements,C.options);this.togglers=$$(C.togglers);this.container=$(C.container);this.previous=-1;if(this.options.alwaysHide){this.options.wait=true;}if($chk(this.options.show)){this.options.display=false;this.previous=this.options.show;}if(this.options.start){this.options.display=false;this.options.show=false;}this.effects={};if(this.options.opacity){this.effects.opacity="fullOpacity";}if(this.options.width){this.effects.width=this.options.fixedWidth?"fullWidth":"offsetWidth";}if(this.options.height){this.effects.height=this.options.fixedHeight?"fullHeight":"scrollHeight";}for(var B=0,A=this.togglers.length;B<A;B++){this.addSection(this.togglers[B],this.elements[B]);}this.elements.each(function(E,D){if(this.options.show===D){this.fireEvent("active",[this.togglers[D],E]);}else{for(var F in this.effects){E.setStyle(F,0);}}},this);if($chk(this.options.display)){this.display(this.options.display);}},addSection:function(E,C,G){E=$(E);C=$(C);var F=this.togglers.contains(E);var B=this.togglers.length;this.togglers.include(E);this.elements.include(C);if(B&&(!F||G)){G=$pick(G,B-1);E.inject(this.togglers[G],"before");C.inject(E,"after");}else{if(this.container&&!F){E.inject(this.container);C.inject(this.container);}}var A=this.togglers.indexOf(E);E.addEvent("click",this.display.bind(this,A));if(this.options.height){C.setStyles({"padding-top":0,"border-top":"none","padding-bottom":0,"border-bottom":"none"});}if(this.options.width){C.setStyles({"padding-left":0,"border-left":"none","padding-right":0,"border-right":"none"});}C.fullOpacity=1;if(this.options.fixedWidth){C.fullWidth=this.options.fixedWidth;}if(this.options.fixedHeight){C.fullHeight=this.options.fixedHeight;}C.setStyle("overflow","hidden");if(!F){for(var D in this.effects){C.setStyle(D,0);}}return this;},display:function(A){A=($type(A)=="element")?this.elements.indexOf(A):A;if((this.timer&&this.options.wait)||(A===this.previous&&!this.options.alwaysHide)){return this;}this.previous=A;var B={};this.elements.each(function(E,D){B[D]={};var C=(D!=A)||(this.options.alwaysHide&&(E.offsetHeight>0));this.fireEvent(C?"background":"active",[this.togglers[D],E]);for(var F in this.effects){B[D][F]=C?0:E[this.effects[F]];}},this);return this.start(B);}});Fx.Slide=new Class({Extends:Fx,options:{mode:"vertical"},initialize:function(B,A){this.addEvent("complete",function(){this.open=(this.wrapper["offset"+this.layout.capitalize()]!=0);if(this.open&&Browser.Engine.webkit419){this.element.dispose().inject(this.wrapper);}},true);this.element=this.subject=$(B);this.parent(A);var C=this.element.retrieve("wrapper");this.wrapper=C||new Element("div",{styles:$extend(this.element.getStyles("margin","position"),{overflow:"hidden"})}).wraps(this.element);this.element.store("wrapper",this.wrapper).setStyle("margin",0);this.now=[];this.open=true;},vertical:function(){this.margin="margin-top";this.layout="height";this.offset=this.element.offsetHeight;},horizontal:function(){this.margin="margin-left";this.layout="width";this.offset=this.element.offsetWidth;},set:function(A){this.element.setStyle(this.margin,A[0]);this.wrapper.setStyle(this.layout,A[1]);return this;},compute:function(E,D,C){var B=[];var A=2;A.times(function(F){B[F]=Fx.compute(E[F],D[F],C);});return B;},start:function(B,E){if(!this.check(arguments.callee,B,E)){return this;}this[E||this.options.mode]();var D=this.element.getStyle(this.margin).toInt();var C=this.wrapper.getStyle(this.layout).toInt();var A=[[D,C],[0,this.offset]];var G=[[D,C],[-this.offset,0]];var F;switch(B){case"in":F=A;break;case"out":F=G;break;case"toggle":F=(this.wrapper["offset"+this.layout.capitalize()]==0)?A:G;}return this.parent(F[0],F[1]);},slideIn:function(A){return this.start("in",A);},slideOut:function(A){return this.start("out",A);},hide:function(A){this[A||this.options.mode]();this.open=false;return this.set([-this.offset,0]);},show:function(A){this[A||this.options.mode]();this.open=true;return this.set([0,this.offset]);},toggle:function(A){return this.start("toggle",A);}});Element.Properties.slide={set:function(B){var A=this.retrieve("slide");if(A){A.cancel();}return this.eliminate("slide").store("slide:options",$extend({link:"cancel"},B));},get:function(A){if(A||!this.retrieve("slide")){if(A||!this.retrieve("slide:options")){this.set("slide",A);}this.store("slide",new Fx.Slide(this,this.retrieve("slide:options")));}return this.retrieve("slide");}};Element.implement({slide:function(D,E){D=D||"toggle";var B=this.get("slide"),A;switch(D){case"hide":B.hide(E);break;case"show":B.show(E);break;case"toggle":var C=this.retrieve("slide:flag",B.open);B[(C)?"slideOut":"slideIn"](E);this.store("slide:flag",!C);A=true;break;default:B.start(D,E);}if(!A){this.eliminate("slide:flag");}return this;}});var SocialBar=new Class({Implements:Options,options:{listName:"My Saved Articles",isBlogPage:false},loggedInAtLoad:UserVars.get("loggedIn")==1||UserVars.get("rememberMe")==1,buildSaveToList:function(){this.element.getElements(this.wrapper$$+" .saveIcon").each(function(A){A.removeEvents("click");A.addEvent("click",function(B){CURS.Manager.checkLogin({loginHed:"Log in to CNET to add this product to your list",registerHed:"Join CNET to add this product to your list",appId:222,cval:"userlist",nextAction:function(){var E=B.target;var D=E.get("aid");var C=E.get("atype");var F=E.get("aname");var G=E.get("aimage");if(D&&C&&F){new Request.JSON({url:"/8691-"+PageVars.get("nodeId")+"_"+PageVars.get("siteId")+"-0.html?viewType=json",data:{description:"",listItemsJson:'[{"assetId":'+D+',"assetTypeId":'+C+',"name":"'+F+'","image":"'+G+'"}]',listTypeId:"14",name:this.options.listName,isPrivate:"true"},onSuccess:function(H){if(!this.loggedInAtLoad){window.location.reload();}H=H.response;function L(){E.set("html","saved");E.addClass("saved");E.removeProperties("aid","atype","aname","aimage");}if(H.status.$=="success"||H.status.$=="pending"){L();if(this.checkCookie("cnet_savedArticleCallout",2)){CnetToolbar.Base.displaySavedArticleMessage();}}else{if(H.errors.error!=null){if(H.errors.error instanceof Array){var M=H.errors.error;}else{var M=[H.errors.error];}var K=false;for(var I in M){I=M[I];if(!K){for(var J in I){if(J=="@name"&&I[J]=="PRODUCT_ALREADY_EXISTS"){dbug.log("item already exists");K=true;L();}else{if(J=="@name"&&I[J]=="LIST_SIZE_MAX_EXCEEDED_EXCEPTION"){dbug.log("save limit reached");this.displayAlert("Saved Item limit exceeded",'<p>We\'re sorry, but you cannot save more than 100 articles.</p><p>To make room for more, remove one or more from your <a href="http://www.cnet.com/3460-4_1-2.html">Saved Articles list</a>.</p>','<a class="flexButton" href="http://www.cnet.com/3460-4_1-2.html">Manage list</a>');K=true;}}}}}if(!K){dbug.log("list failure");this.displayAlert("Error","<p>We're sorry, but an unexpected error occurred while saving your article. Please try again.</p>");}}}new Jlogger({tag:"saveArticle"}).ping();}.bind(this),onfailure:function(){dbug.log("list failure");this.displayAlert("Error","<p>We're sorry, but an unexpected error occurred while saving your article. Please try again.</p>");},method:"post"}).send();}}.bind(this)});}.bind(this));}.bind(this));},checkCookie:function(C,B){var A=(!Cookie.read(C)||$type(Cookie.read(C).toInt())!="number")?1:Cookie.read(C).toInt()+1;if(A>B){return false;}else{Cookie.write(C,A,{duration:365,domain:".cnet.com",path:"/"});return true;}},displayAlert:function(B,A,C){new StickyWinModal({content:'<div class="globalModal yodaPopup"><div class="formHead clearfix"><h2>'+B+'</h2><a class="closeModal" onclick="this.getParent(\'.StickyWinInstance\').dispose(); $$(\'#modalOverlay\').dispose();">close</a></div><div class="formBody">'+A+'</div><div class="formFooter">'+C+"</div></div>",modalOptions:{modalStyle:{"background-color":"#666666",opacity:0.6}}});},setBlogStats:function(){var A=UserVars.get("ursRegId");this.element.getElements(this.wrapper$$).each(function(D){var B,F;if(!this.options.isBlogPage){B=D.getElements(".comments")[0];if(B!=undefined&&B!=null){F=B.get("aid");var E=B.get("cid");}}else{B=D.getElements(".saveIcon")[0];if(B!=undefined&&B!=null){F=B.get("aid");}}if((F&&E)||(F&&A)){var H=this.options.isBlogPage;var C=new Date();var G=this.loggedInAtLoad;new Request.JSON({url:"/posidn/rest/v1.0/blogRelatedStatsResource",method:"get",data:{viewType:"json",communityId:E,assetId:F,ownerId:A,listItemTypeId:"14","posidn.useSampleValues":"true",refresh:C.getTime()},onSuccess:function(I){I=I.CNETResponse;var M;if(!H){M=this.getElements(".comments")[0];var K=0;if(M!=null){try{for(var J in I.Comments){if(J=="@numFound"){K=I.Comments[J];}}}catch(L){}M.set("text",K+" "+M.get("text"));M.removeProperties("aid","cid");}}if(G&&A!=null){M=this.getElements(".saveIcon")[0];try{for(J in I.ListItems){if(J=="@numFound"&&I.ListItems[J]>0){M.addClass("saved");M.set("text","saved");M.removeProperties("aid","aname","atype");}}}catch(L){}}}.bind(D),onfailure:function(){if(!H){var I=this.getElements(".comments")[0];if(I!=null){I.set("text","0 "+I.get("text"));I.removeProperties("aid","cid");}}}.bind(D)}).send();}}.bind(this));},buildShareIcons:function(){$$(".socialBar a.twitter-share-button").each(function(A){A.hide();});$$(".socialBar .fbShare").each(function(B){try{FB.XFBML.parse(B);}catch(A){}});},initialize:function(B,A){if(B!=undefined){if(PageVars.get("pageType")==8300||PageVars.get("pageType")==8301){this.options.isBlogPage=true;}this.element=B;this.setOptions(A);if(this.options.isBlogPage){this.wrapper$$=".contentTools";}else{this.wrapper$$=".socialBar";}this.buildSaveToList();this.setBlogStats();this.buildShareIcons();}}});if(window.PageVars&&!PageVars.get("loadTime")){PageVars.set("loadTime",$time());}var FrontDoorRiver=new Class({Implements:[Options,Events],options:{pageType:8330,list$:"pe-socialMediaMain",getMore$:"ajaxMorePostings",refresh$:"refreshBar",storage$:"newContent",recentTab$:"recentTab",popularTab$:"popularTab",activity:"cnetRiverUpdater",period:30000,params:{nomesh:true,noluke:true,activityname:"cnetRiverUpdater"},filterTagSelector:".filterTag",fetchType:"recent",ugcSavedListName:"My Saved Articles",moreTrackingType:"redir"},initialize:function(B,A){this.element=$(B);this.setOptions(A);this.monitor=CBSi.monitor||false;this.setRequestors();this.setElems();this.initTabs();this.initButtons("recent");this.initEntries();this.initFilters();this.setTimestampUpdates(this.elems.list.getProperty("timestamp"));this.recentCheck=this.fetchData.scheduled(this.options.period,this,{args:"update",startNow:false,decay:0.5});if(typeof (SocialBar)=="function"&&typeof (SocialBar.prototype)=="object"){new SocialBar($("pe-socialMediaMain"),{listName:this.options.ugcSavedListName});}},setElems:function(){var A=this.options;this.elems={list:$(A.list$),storage:$(A.storage$)};this.buttons={getMore:$(A.getMore$),refresh:$(A.refresh$)};if(Browser.Engine.trident){this.buttons.refresh.set("reveal",{onComplete:this.elems.list.toggleClass.bind(this.elems.list,"ieredraw")});}this.tabs={getRecent:$(A.recentTab$),getPopular:$(A.popularTab$)};if(this.tabs.getRecent){this.tabs.container=this.tabs.getRecent.getParent("ul");}},initTabs:function(){if(this.tabs.getRecent){this.tabs.getRecent.addEvent("click",function(A){A.stop();if(!this.tabs.getRecent.hasClass("active")){new Jlogger({cval:"cnetRiver;latestSort",ctype:"testevent;click"}).ping();this.resetRiver("recent");this.options.fetchType="recent";}}.bind(this));}if(this.tabs.getPopular){this.tabs.getPopular.addEvent("click",function(A){A.stop();if(!this.tabs.getPopular.hasClass("active")){new Jlogger({cval:"cnetRiver;trendSort",ctype:"testevent;click"}).ping();this.resetRiver("popular");this.options.fetchType="popular";}}.bind(this));}},setRequestors:function(){this.updater=new Request({url:PageVars.getPath({pageType:this.options.pageType}),method:"get",onSuccess:this.updateRecentPostings.bind(this)});this.updater.riverType="update";this.requestor=new Request({url:PageVars.getPath({pageType:this.options.pageType}),method:"get",onRequest:function(){if(!["update","more"].contains(this.requestor.riverType)){this.elems.list.tween("opacity",0.5);try{new Element("li",{"class":"loading"}).inject(this.tabs.container);}catch(A){}}else{if(this.requestor.riverType=="more"){this.buttons.getMore.getElement(".viewMore").addClass("loading");}}}.bind(this),onComplete:function(){var B;if(!["update","more"].contains(this.requestor.riverType)){try{B=this.tabs.container.getElement(".loading");if(B){B.destroy();}}catch(A){}this.elems.list.tween("opacity",1);}else{if(this.requestor.riverType=="more"){B=this.buttons.getMore.getElement(".loading");if(B){B.removeClass("loading");}}}}.bind(this),onSuccess:this.parseEntries.bind(this),autoCancel:true});},fetchData:function(B){var A=(B=="update")?this.updater:this.requestor;A.riverType=B;A.send({data:this.getParams(B)});},getParams:function(B){var D={};if($E("#cnetRiver.mpRiver")){var C="";$$("#riverFilter .filters table input[type=checkbox]").each(function(F){if(F.checked){C+=F.get("value")+",";}});if(C.charAt(C.length-1)==","){C=C.slice(0,-1);}var A=$E("#sortSelect").getSelected()[0].getProperty("value");}switch(B){case"update":if($E("#cnetRiver.mpRiver")&&$E("#sortSelect").getSelected()[0].getProperty("value")=="popularity"){break;}else{D=$merge(D,{begin:this.getDateLandmark(this.elems.list.getElement(".riverPost").getProperty("date"))});}break;case"more":if($E("#cnetRiver.mpRiver")){marketplaceRiverPage=26;if($E("#sortSelect").getSelected()[0].getProperty("value")=="popularity"){dbug.log("more:marketplace:popularity");var E=$$("#pe-socialMediaMain>li").length;if(!E){E=0;}D=$merge(D,{start:E,categories:C,orderBy:A,style:"mf"});}else{dbug.log("more:marketplace:date");D=$merge(D,{limit:marketplaceRiverPage,categories:C,orderBy:A,end:this.getDateLandmark(this.elems.list.getElements(".riverPost").getLast().getProperty("date"),"previous"),style:"mf"});}}else{dbug.log("more:date");D=$merge(D,{end:this.getDateLandmark(this.elems.list.getElements(".riverPost").getLast().getProperty("date"),"previous")});}break;case"popular":D=$merge(D,{queryType:"juciCombinedSearch",orderBy:"socialScore~desc",minSocialScore:1,limit:100});case"recent":D=$merge(D,{uniqueId:this.getRoundedUpdateId(2)});}if(this.options.keywordFilter&&this.options.keywordFilter!=""){D=$merge(D,{keywords:'"'+this.options.keywordFilter+'"'});}return $merge(this.options.params,D);},getRoundedUpdateId:function(A){var B=Math.floor($time()/10000);return Math.floor(B-B%((A||1)*6));},getDateLandmark:function(C,B){var A=this.getDateFromTimestamp(C),D=1000*((B=="previous")?-1:1);A.setTime(A.getTime()+D);return this.getTimestampFromDate(A);},parseEntries:function(C,A){var B=this.getDataFromResponse(A);switch(this.requestor.riverType){case"recent":this.loadRecentPostings(B);break;case"popular":this.loadPopular(B);break;case"more":this.updateMorePostings(B);break;}if(typeof (SocialBar)=="function"&&typeof (SocialBar.prototype)=="object"){new SocialBar($("pe-socialMediaMain"),{listName:this.options.ugcSavedListName});}},getDataFromResponse:function(B){var E={},A=B.getElementsByTagName("pageElement"),D=0,C,F;for(D;D<A.length;D++){C=A[D].getElementsByTagName("name")[0].firstChild.nodeValue;F=A[D].getElementsByTagName("html")[0].firstChild.nodeValue;switch(C){case".socialMediaMain":E.html=new Element("div",{html:F}).getChildren();break;case".riverCounter":E.count=F.toInt();break;case".timestamp":E.timestamp=F;break;default:E[C]=F;}}return E;},loadPopular:function(A){this.elems.list.empty().addClass("trendingList");A.html.each(function(C,B){if(B>=25){C.addClass("hidden").setStyle("display","none");}C.inject(this.elems.list);},this);this.initEntries();},loadRecentPostings:function(A){this.elems.list.empty().removeClass("trendingList");A.html.each(this.elems.list.adopt.bind(this.elems.list));this.initEntries();},updateRecentPostings:function(D,A){var C=this.getDataFromResponse(A),B;if(C.count!=this.lastCount){if(C.html.length){this.elems.storage.empty();C.html.each(this.elems.storage.adopt.bind(this.elems.storage));B=this.buttons.refresh.get("html");if(C.count==1){B=B.replace("are","is").replace("posts.","post.").replace("postings.","post.");}else{B=B.replace("is","are").replace(/postings*\./,"posts.").replace("post.","posts.");}this.buttons.refresh.set("html",B);this.buttons.refresh.getElement("span").set("text",C.count);this.buttons.refresh.reveal();}this.lastCount=C.count;if(typeof (SocialBar)=="function"&&typeof (SocialBar.prototype)=="object"){new SocialBar($("pe-socialMediaMain"),{listName:this.options.ugcSavedListName});}}},updateMorePostings:function(B){dbug.log("update more postings");var A=new Element("ul",{styles:{display:"none"}}).inject(this.element);B.html.each(A.adopt.bind(A));if(!$E("#cnetRiver.mpRiver")){if(Browser.Engine.trident){B.html[0].set("tween",{onComplete:this.elems.list.toggleClass.bind(this.elems.list,"ieredraw")});}}this.initEntries(A);B.html.each(function(C){C.setStyle("opacity",0).inject(this.elems.list).tween("opacity",1);},this);A.destroy();},refreshRecentPostings:function(){var A=$A(this.elems.storage.getChildren()),B;this.initEntries(this.elems.storage);this.buttons.refresh.dissolve();this.lastCount=0;while(B=A.pop()){B.setStyle("opacity",0).inject(this.elems.list,"top").tween("opacity",1);}if($(this.options.list$).getElement("li.riverSponsor")){this.positionRiverAd($(this.options.list$).getElement("li.riverSponsor"));}new Jlogger({cval:"cnetRiver;refresh",ctype:"testevent;click"}).ping();},initEntries:function(A){A=A||this.elems.list;this.initVideos(A);A.getElements(".assetThumb img").each(function(B){if(!B.getProperty("src")){B.getParent(".assetThumb").dispose();}});A.getElements(".assetRatings a").removeProperty("href");},positionRiverAd:function(A){A.inject($(this.options.list$).getElements("li.riverPost")[3],"after");},resetRiver:function(A){this.elems.storage.empty();if(A=="popular"){this.fetchData("popular");this.tabs.getPopular.addClass("active");this.tabs.getRecent.removeClass("active");this.recentCheck.stop();}else{if(A=="recent"){this.fetchData("recent");this.tabs.getRecent.addClass("active");this.tabs.getPopular.removeClass("active");this.recentCheck.resume();}}this.initButtons(A);},initButtons:function(A){A=A||"recent";if(!this.buttons.getMore.getElement(".viewMore")){this.buttons.getMore.set("html",'<span class="viewMore">'+this.buttons.getMore.get("text")+"</span>");}this.buttons.getMore.setStyle("display","block").removeEvents("click");this.buttons.refresh.setStyle("display","none").removeEvents("click");if(A=="recent"){this.buttons.refresh.addEvent("click",this.refreshRecentPostings.bind(this));this.buttons.getMore.addEvent("click",function(){this.fetchData("more");if(this.options.moreTrackingType=="levt-mpdoor"){new JloggerLEVT.RIA({applicationTags:{mapp:"marketplace",comp:"river",comptyp:"load_more",riaevent:"click",objtyp:"",objnm:""}}).ping();}else{new Jlogger({cval:"cnetRiver;viewMore-latest",ctype:"testevent;click"}).ping();}}.bind(this));}else{if(A=="popular"){this.buttons.getMore.addEvent("click",function(){this.showMorePopular();new Jlogger({cval:"cnetRiver;viewMore-trend",ctype:"testevent;click"}).ping();}.bind(this));}}},showMorePopular:function(){var A=this.elems.list.getElements(".riverPost.hidden");for(var B=0;B<25&&A[B];B++){A[B].removeClass("hidden").setStyles({opacity:0,display:"block"}).tween("opacity",1);}if(!A[B]){this.buttons.getMore.dissolve();}},initVideos:function(A){A=A||this.elems.list;A.getElements(".videoLauncher").each(function(E){var C=E.getParent("li"),F=C.retrieve("riverVideo:launcher"),B,D;if(!F){C.addClass("videoPost");F=function(){var G=new Element("div",{"class":"productVideo"}).inject(C);new Element("a",{"class":"dragHandle",text:"drag"}).inject(G);new Element("a",{"class":"closeVideo closeSticky",text:"Close"}).inject(G);new Element("div",{"class":"vidShell"}).inject(G);(function(){loadGeckoVideoPlayer({parentElement:C.getElement(".vidShell"),flashVars:{contentType:"id",contentValue:E.getElement("img").getProperty("videoId")}},"feature");B=new StickyWinFx({draggable:true,content:G,relativeTo:E,position:"upperLeft",onClose:function(){this.win.destroy();C.store("riverVideo:stickywin",null);}});C.store("riverVideo:stickywin",B);if(Browser.Engine.trident){D=getElementCoordinates(E);B.win.setStyles({top:D.top,left:D.left});}}).lazy(window.GeckoVideoPlayer,CBSi.lazy.videoPlayer);};C.store("riverVideo:launcher",F);}E.addEvent("click",function(){if(!C.retrieve("riverVideo:stickywin")){C.retrieve("riverVideo:launcher")();}});});},getDateFromTimestamp:function(A){A=A.match(/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/);if(!A){return ;}return(new Date(A[1],A[2].toInt()-1,A[3],A[4],A[5],A[6])||null);},zeroFill:function(A,B){B=B||2;A=A.toString();while(A.length<B){A="0"+A;}return A;},getTimestampFromDate:function(A){var C="",B=this.zeroFill;if(!A||!$type(A)=="date"){return C;}C=A.getFullYear().toString()+B(A.getMonth()+1)+B(A.getDate())+B(A.getHours())+B(A.getMinutes())+B(A.getSeconds());return C;},getAgoDate:function(B,C){var D=Math.round((B-C)/1000),F,A,E;if(D<60){A=D;F="second";}else{if(D<60*60){A=Math.floor(D/60);F="minute";}else{if(D<60*60*24){A=Math.floor(D/(60*60));F="hour";}else{if(D<60*60*24*7){A=Math.floor(D/(60*60*24));F="day";}else{A=Math.floor(D/(60*60*24*7));F="week";}}}}E=A+" "+F+((A>1)?"s":"")+" ago";return E;},setTimestampUpdates:function(A){if(!A){return ;}this.timestampOffset=(PageVars.get("loadTime")||$time())-this.getDateFromTimestamp(A);this.timestamper=this.updateTimestamps.scheduled(60000,this);},updateTimestamps:function(){var A=$time()-this.timestampOffset;this.element.getElements("li.riverPost").each(function(B){B.getElement(".assetTime").set("text",this.getAgoDate(A,this.getDateFromTimestamp(B.getProperty("date"))));},this);},initFilters:function(){this.lastCount=0;var A=window.location.href.split("?");if(A.length>1){var B=A[1].parseQueryString();if(B.filterTag){this.options.keywordFilter=B.filterTag;}}if(this.options.filterTagSelector&&this.options.filterTagSelector!=""){$$(this.options.filterTagSelector).addEvent("click",function(C){C.stop();if(C.target.hasClass("all")){this.options.keywordFilter="";}else{this.options.keywordFilter=C.target.get("text");}$$(this.options.filterTagSelector).each(function(D){if(D.get("text")==this.options.keywordFilter||(this.options.keywordFilter==""&&D.hasClass("all"))){D.addClass("selected");}else{D.removeClass("selected");}}.bind(this));this.resetRiver(this.options.fetchType);new Jlogger({cval:"cnetRiver;filter"+this.options.fetchType,ctype:"testevent;click"}).ping();}.bind(this));}return false;}});var Drag=new Class({Implements:[Events,Options],options:{snap:6,unit:"px",grid:false,style:true,limit:false,handle:false,invert:false,preventDefault:false,modifiers:{x:"left",y:"top"}},initialize:function(){var B=Array.link(arguments,{options:Object.type,element:$defined});this.element=$(B.element);this.document=this.element.getDocument();this.setOptions(B.options||{});var A=$type(this.options.handle);this.handles=(A=="array"||A=="collection")?$$(this.options.handle):$(this.options.handle)||this.element;this.mouse={now:{},pos:{}};this.value={start:{},now:{}};this.selection=(Browser.Engine.trident)?"selectstart":"mousedown";this.bound={start:this.start.bind(this),check:this.check.bind(this),drag:this.drag.bind(this),stop:this.stop.bind(this),cancel:this.cancel.bind(this),eventStop:$lambda(false)};this.attach();},attach:function(){this.handles.addEvent("mousedown",this.bound.start);return this;},detach:function(){this.handles.removeEvent("mousedown",this.bound.start);return this;},start:function(C){if(this.options.preventDefault){C.preventDefault();}this.fireEvent("beforeStart",this.element);this.mouse.start=C.page;var A=this.options.limit;this.limit={x:[],y:[]};for(var D in this.options.modifiers){if(!this.options.modifiers[D]){continue;}if(this.options.style){this.value.now[D]=this.element.getStyle(this.options.modifiers[D]).toInt();}else{this.value.now[D]=this.element[this.options.modifiers[D]];}if(this.options.invert){this.value.now[D]*=-1;}this.mouse.pos[D]=C.page[D]-this.value.now[D];if(A&&A[D]){for(var B=2;B--;B){if($chk(A[D][B])){this.limit[D][B]=$lambda(A[D][B])();}}}}if($type(this.options.grid)=="number"){this.options.grid={x:this.options.grid,y:this.options.grid};}this.document.addEvents({mousemove:this.bound.check,mouseup:this.bound.cancel});this.document.addEvent(this.selection,this.bound.eventStop);},check:function(A){if(this.options.preventDefault){A.preventDefault();}var B=Math.round(Math.sqrt(Math.pow(A.page.x-this.mouse.start.x,2)+Math.pow(A.page.y-this.mouse.start.y,2)));if(B>this.options.snap){this.cancel();this.document.addEvents({mousemove:this.bound.drag,mouseup:this.bound.stop});this.fireEvent("start",this.element).fireEvent("snap",this.element);}},drag:function(A){if(this.options.preventDefault){A.preventDefault();}this.mouse.now=A.page;for(var B in this.options.modifiers){if(!this.options.modifiers[B]){continue;}this.value.now[B]=this.mouse.now[B]-this.mouse.pos[B];if(this.options.invert){this.value.now[B]*=-1;}if(this.options.limit&&this.limit[B]){if($chk(this.limit[B][1])&&(this.value.now[B]>this.limit[B][1])){this.value.now[B]=this.limit[B][1];}else{if($chk(this.limit[B][0])&&(this.value.now[B]<this.limit[B][0])){this.value.now[B]=this.limit[B][0];}}}if(this.options.grid[B]){this.value.now[B]-=(this.value.now[B]%this.options.grid[B]);}if(this.options.style){this.element.setStyle(this.options.modifiers[B],this.value.now[B]+this.options.unit);}else{this.element[this.options.modifiers[B]]=this.value.now[B];}}this.fireEvent("drag",this.element);},cancel:function(A){this.document.removeEvent("mousemove",this.bound.check);this.document.removeEvent("mouseup",this.bound.cancel);if(A){this.document.removeEvent(this.selection,this.bound.eventStop);this.fireEvent("cancel",this.element);}},stop:function(A){this.document.removeEvent(this.selection,this.bound.eventStop);this.document.removeEvent("mousemove",this.bound.drag);this.document.removeEvent("mouseup",this.bound.stop);if(A){this.fireEvent("complete",this.element);}}});Element.implement({makeResizable:function(A){return new Drag(this,$merge({modifiers:{x:"width",y:"height"}},A));}});Drag.Move=new Class({Extends:Drag,options:{droppables:[],container:false},initialize:function(C,B){this.parent(C,B);this.droppables=$$(this.options.droppables);this.container=$(this.options.container);if(this.container&&$type(this.container)!="element"){this.container=$(this.container.getDocument().body);}C=this.element;var D=C.getStyle("position");var A=(D!="static")?D:"absolute";if(C.getStyle("left")=="auto"||C.getStyle("top")=="auto"){C.position(C.getPosition(C.offsetParent));}C.setStyle("position",A);this.addEvent("start",function(){this.checkDroppables();},true);},start:function(B){if(this.container){var D=this.element,J=this.container,E=J.getCoordinates(D.offsetParent),F={},A={};["top","right","bottom","left"].each(function(K){F[K]=J.getStyle("padding-"+K).toInt();A[K]=D.getStyle("margin-"+K).toInt();},this);var C=D.offsetWidth+A.left+A.right,I=D.offsetHeight+A.top+A.bottom;var H=[E.left+F.left,E.right-F.right-C];var G=[E.top+F.top,E.bottom-F.bottom-I];this.options.limit={x:H,y:G};}this.parent(B);},checkAgainst:function(B){B=B.getCoordinates();var A=this.mouse.now;return(A.x>B.left&&A.x<B.right&&A.y<B.bottom&&A.y>B.top);},checkDroppables:function(){var A=this.droppables.filter(this.checkAgainst,this).getLast();if(this.overed!=A){if(this.overed){this.fireEvent("leave",[this.element,this.overed]);}if(A){this.overed=A;this.fireEvent("enter",[this.element,A]);}else{this.overed=null;}}},drag:function(A){this.parent(A);if(this.droppables.length){this.checkDroppables();}},stop:function(A){this.checkDroppables();this.fireEvent("drop",[this.element,this.overed]);this.overed=null;return this.parent(A);}});Element.implement({makeDraggable:function(A){return new Drag.Move(this,A);}});var StickyWinFx=new Class({Extends:StickyWin,options:{fade:true,fadeDuration:150,draggable:false,dragOptions:{},dragHandleSelector:".dragHandle",resizable:false,resizeOptions:{},resizeHandleSelector:""},setContent:function(A){this.parent(A);if(this.options.draggable){this.makeDraggable();}if(this.options.resizable){this.makeResizable();}return this;},hideWin:function(){if(this.options.fade){this.fade(0);}else{this.parent();}},showWin:function(){if(this.options.fade){this.fade(1);}else{this.parent();}},fade:function(B){if(!this.fadeFx){this.win.setStyles({opacity:0,display:"block"});var A={property:"opacity",duration:this.options.fadeDuration};if(this.options.fadeTransition){A.transition=this.options.fadeTransition;}this.fadeFx=new Fx.Tween(this.win,A);}if(B>0){this.win.setStyle("display","block");this.position();}this.fadeFx.clearChain();this.fadeFx.start(B).chain(function(){if(B==0){this.win.setStyle("display","none");}}.bind(this));return this;},makeDraggable:function(){dbug.log("you must include Drag.js, cannot make draggable");},makeResizable:function(){dbug.log("you must include Drag.js, cannot make resizable");}});var StickyWinModal,StickyWinFxModal;(function(){var A=function(C){return{Extends:C,initialize:function(D){D=D||{};this.setModalOptions($merge(D.modalOptions||{},{onModalHide:function(){this.hide(false);}.bind(this)}));this.parent(D);},show:function(D){if($pick(D,true)){this.modalShow();this.win.getElements(this.modalOptions.elementsToHide).setStyle("opacity",1);}this.parent();},hide:function(D){if($pick(D,true)){this.modalHide();}this.parent($pick(D,true));}};};StickyWinModal=new Class(A(StickyWin));StickyWinModal.implement(new Modalizer);StickyWinFxModal=(typeof StickyWinFx!="undefined")?new Class(A(StickyWinFx)):$empty;try{StickyWinFxModal.implement(new Modalizer());}catch(B){}})();if(typeof Drag!="undefined"){StickyWinFx.implement({makeDraggable:function(){var C=this.toggleVisible(true);if(this.options.useIframeShim){this.makeIframeShim();var B=(this.options.dragOptions.onComplete||$empty);this.options.dragOptions.onComplete=function(){B();this.shim.position();}.bind(this);}if(this.options.dragHandleSelector){var A=this.win.getElement(this.options.dragHandleSelector);if(A){A.setStyle("cursor","move");this.options.dragOptions.handle=A;}}this.win.makeDraggable(this.options.dragOptions);if(C){this.toggleVisible(false);}},makeResizable:function(){var C=this.toggleVisible(true);if(this.options.useIframeShim){this.makeIframeShim();var B=(this.options.resizeOptions.onComplete||$empty);this.options.resizeOptions.onComplete=function(){B();this.shim.position();}.bind(this);}if(this.options.resizeHandleSelector){var A=this.win.getElement(this.options.resizeHandleSelector);if(A){this.options.resizeOptions.handle=this.win.getElement(this.options.resizeHandleSelector);}}this.win.makeResizable(this.options.resizeOptions);if(C){this.toggleVisible(false);}},toggleVisible:function(A){if(!this.visible&&Browser.Engine.webkit&&$pick(A,true)){this.win.setStyles({display:"block",opacity:0});return true;}else{if(!$pick(A,false)){this.win.setStyles({display:"none",opacity:1});return false;}}return false;}});}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;};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);}});window.addEvent("domready",function(){$$(".prodRate .toolTipElement").each(function(A){var B=A.getParent("div").getElement(".data");if(B){A.store("tip:text",B.get("html"));}else{A.store("tip:text","Product summary not available");}});});var tokenizer=function(B,D){var C,A=0;C[0]=B;while(C[A].indexOf(D)>=0){C[A+1]=C[A].substring(C[A].indexOf(",")+1);C[A]=C[A].substring(0,C[A].indexOf(","));A++;}return C;};var originalTweetAssets="";window.addEvent("domready",function(){var A=function(B){var C;if(B){if(originalTweetAssets!=null&&originalTweetAssets!=""){if(listings.options.params.assets!=null&&listings.options.params.assets!=""){listings.options.params.assets+=","+originalTweetAssets;}else{listings.options.params.assets=originalTweetAssets;}}}else{var D=tokenizer(listings.options.params.assets,",");listings.options.params.assets="";for(C=0;C<D;C++){if(D[C]=="97"||D[C]=="81"||D[C]=="87"){if(originalTweetAssets!=null&&originalTweetAssets!=""){originalTweetAssets+=","+D[C];}else{originalTweetAssets=D[C];}}else{if(listings.options.params.assets==""){listings.options.params.assets=D[C];}else{listings.options.params.assets+=","+D[C];}}}}new ContentUpdater("cnetRiverUpdater",{".socialMediaMain":{element:$("pe-socialMediaMain"),onRequest:function(){if(!this.waiter){this.waiter=new Waiter($("pe-socialMediaMain"));}this.waiter.start();},onComplete:function(){if(this.waiter){this.waiter.stop();}$("ajaxMorePostings").getParent().set("class",$("ajaxMorePostings").getParent().get("class"));},onSuccess:function(){listings.options.params.start=0;listings.tempStart=0;listings.initEntries();if(sponsoredListing!=null&&!this.element.getElement("li.riverSponsor")){sponsoredListing.getElement("li.riverSponsor").clone().inject(this.element.getElements("li.riverPost")[3],"after");}}}},{url:PageVars.getPath({pageType:8330}),data:{limit:listings.options.params.limit,assets:listings.options.params.assets,sites:listings.options.params.sites,categories:listings.options.params.categories,nomesh:true,refresher:new Date().getSeconds().toString()+new Date().getMilliseconds().toString(),start:0,socialType:listings.options.socialType,listName:listings.options.ugcSavedListName,filterTagSelector:listings.options.filterTagSelector},evalScripts:(Browser.Engine.trident)}).send();};if($("tweetsOn")!=null&&$("tweetsOff")!=null){window.addEvent("domready",function(){$("tweetsOn").addEvent("click",function(){Cookie.write("tweetCookie","on",{duration:30});$("tweetsOff").getParent().removeClass("active");$("tweetsOn").getParent().addClass("active");A(true);});$("tweetsOff").addEvent("click",function(){Cookie.write("tweetCookie","off",{duration:30});$("tweetsOn").getParent().removeClass("active");$("tweetsOff").getParent().addClass("active");A(false);});if(Cookie.read("tweetCookie")=="off"){$("tweetsOff").fireEvent("click");}});}});
   }
       
