
   if(!dbugScripts("shopper",["shopper.tron.mlp.js"])) {
   /*	shopper.tron.mlp.js - packed	*/
       Element.implement({tidy:function(){try{this.set("value",this.get("value").tidy());}catch(A){dbug.log("element.tidy error: %o",A);}},getTextInRange:function(B,A){return this.get("value").substring(B,A);},getSelectedText:function(){if(Browser.Engine.trident){return document.selection.createRange().text;}return this.get("value").substring(this.getSelectionStart(),this.getSelectionEnd());},getSelectionStart:function(){if(Browser.Engine.trident){var B=(Browser.Engine.trident4)?3:2;this.focus();var A=document.selection.createRange();if(A.compareEndPoints("StartToEnd",A)!=0){A.collapse(true);}return A.getBookmark().charCodeAt(2)-B;}return this.selectionStart;},getSelectionEnd:function(){if(Browser.Engine.trident){var B=(Browser.Engine.trident4)?3:2;var A=document.selection.createRange();if(A.compareEndPoints("StartToEnd",A)!=0){A.collapse(false);}return A.getBookmark().charCodeAt(2)-B;}return this.selectionEnd;},getSelectedRange:function(){return{start:this.getSelectionStart(),end:this.getSelectionEnd()};},setCaretPosition:function(A){if(A=="end"){A=this.get("value").length;}this.selectRange(A,A);return this;},getCaretPosition:function(){return this.getSelectedRange().start;},selectRange:function(C,A){this.focus();if(Browser.Engine.trident){var B=this.createTextRange();B.collapse(true);B.moveStart("character",C);B.moveEnd("character",A-C);B.select();return this;}this.setSelectionRange(C,A);return this;},insertAtCursor:function(C,A){var D=this.getSelectionStart();var B=this.getSelectionEnd();this.set("value",this.get("value").substring(0,D)+C+this.get("value").substring(B,this.get("value").length));if($pick(A,true)){this.selectRange(D,D+C.length);}else{this.setCaretPosition(D+C.length);}return this;},insertAroundCursor:function(C,A){C=$extend({before:"",defaultMiddle:"SOMETHING HERE",after:""},C);value=this.getSelectedText()||C.defaultMiddle;var F=this.getSelectionStart();var B=this.getSelectionEnd();if(F==B){var E=this.get("value");this.set("value",E.substring(0,F)+C.before+value+C.after+E.substring(B,E.length));this.selectRange(F+C.before.length,B+C.before.length+value.length);E=null;}else{E=this.get("value").substring(F,B);this.set("value",this.get("value").substring(0,F)+C.before+E+C.after+this.get("value").substring(B,this.get("value").length));var D=F+C.before.length;if($pick(A,true)){this.selectRange(D,D+E.length);}else{this.setCaretPosition(D+E.length);}}return this;}});Element.Properties.inputValue={get:function(){switch(this.get("tag")){case"select":vals=this.getSelected().map(function(C){var B=$pick(C.get("value"),C.get("text"));return(B=="")?C.get("text"):B;});return this.get("multiple")?vals:vals[0];case"input":switch(this.get("type")){case"checkbox":return this.get("checked")?this.get("value"):false;case"radio":var A;if(this.get("checked")){return this.get("value");}$(this.getParent("form")||document.body).getElements("input").each(function(B){if(B.get("name")==this.get("name")&&B.get("checked")){A=B.get("value");}},this);return A||null;}case"input":case"textarea":return this.get("value");default:return this.get("inputValue");}},set:function(A){switch(this.get("tag")){case"select":this.getElements("option").each(function(C){var B=$pick(C.get("value"),C.get("text"));if(B==""){B=C.get("text");}C.set("selected",$splat(A).contains(B));});break;case"input":if(["radio","checkbox"].contains(this.get("type"))){this.set("checked",$type(A)=="boolean"?A:$splat(A).contains(this.get("value")));break;}case"textarea":case"input":this.set("value",A);break;default:this.set("inputValue",A);}return this;},erase:function(){switch(this.get("tag")){case"select":this.getElements("option").each(function(A){A.erase("selected");});break;case"input":if(["radio","checkbox"].contains(this.get("type"))){this.set("checked",false);break;}case"input":case"textarea":this.set("value","");break;default:this.set("inputValue","");}return this;}};window.addEvent("domready",function(){var B=new Element("div").setStyles({position:"fixed",top:0,right:0}).inject(document.body);var A=(B.offsetTop===0);B.dispose();Browser.set("supportsPositionFixed",A);});Element.implement({pin:function(B){if(this.getStyle("display")=="none"){dbug.log("cannot pin "+this+" because it is hidden");return ;}if(B!==false){var C=this.getPosition();if(!this.get("pinned")){var E={top:(C.y-window.getScroll().y),left:(C.x-window.getScroll().x)};if(Browser.get("supportsPositionFixed")){this.setStyle("position","fixed").setStyles(E);}else{this.setStyles({position:"absolute",top:C.y,left:C.x});window.addEvent("scroll",function(){if(this.get("pinned")){var F={top:(E.top.toInt()+window.getScroll().y),left:(E.left.toInt()+window.getScroll().x)};this.setStyles(F);}}.bind(this));}this.set("pinned",true);}}else{var D;if(!Browser.Engine.trident){if(this.getParent().getComputedStyle("position")!="static"){D=this.getParent();}else{D=this.getParent().getOffsetParent();}}var C=this.getPosition(D);this.set("pinned",false);var A=(Browser.get("supportsPositionFixed"))?{top:(C.y+window.getScroll().y),left:(C.x+window.getScroll().x)}:{top:(C.y),left:(C.x)};this.setStyles($merge(A,{position:"absolute"}));}return this;},unpin:function(){return this.pin(false);},togglepin:function(){this.pin(!this.get("pinned"));}});var StyleWriter=new Class({createStyle:function(A,B){window.addEvent("domready",function(){try{if($(B)&&B){return ;}var C=new Element("style",{id:B||""}).inject($$("head")[0]);if(Browser.Engine.trident){C.styleSheet.cssText=A;}else{C.set("text",A);}}catch(D){dbug.log("error: %s",D);}}.bind(this));}});var StickyWin=new Class({Implements:[Options,Events,StyleWriter],options:{closeClassName:"closeSticky",pinClassName:"pinSticky",content:"",zIndex:10000,className:"",width:false,height:false,timeout:-1,allowMultipleByClass:false,allowMultiple:true,showNow:true,useIframeShim:true,iframeShimSelector:""},css:'.SWclearfix:after {content: "."; display: block; height: 0; clear: both; visibility: hidden;}.SWclearfix {display: inline-table;}* html .SWclearfix {height: 1%;}.SWclearfix {display: block;}',initialize:function(A){this.options.inject={target:document.body,where:"bottom"};this.setOptions(A);this.id=this.options.id||"StickyWin_"+new Date().getTime();this.makeWindow();if(this.options.content){this.setContent(this.options.content);}if(this.options.timeout>0){this.addEvent("onDisplay",function(){this.hide.delay(this.options.timeout,this);}.bind(this));}if(this.options.showNow){this.show();}this.createStyle(this.css,"StickyWinClearFix");},toElement:function(){return this.win;},makeWindow:function(){this.destroyOthers();if(!$(this.id)){this.win=new Element("div",{id:this.id}).addClass(this.options.className).addClass("StickyWinInstance").addClass("SWclearfix").setStyles({display:"none",position:"absolute",zIndex:this.options.zIndex}).inject(this.options.inject.target,this.options.inject.where).store("StickyWin",this);}else{this.win=$(this.id);}if(this.options.width&&$type(this.options.width.toInt())=="number"){this.win.setStyle("width",this.options.width.toInt());}if(this.options.height&&$type(this.options.height.toInt())=="number"){this.win.setStyle("height",this.options.height.toInt());}return this;},show:function(){this.fireEvent("onDisplay");this.showWin();if(this.options.useIframeShim){this.showIframeShim();}this.visible=true;return this;},showWin:function(){this.win.setStyle("display","block");if(!this.positioned){this.position();}},hide:function(A){if(!A||$type(A)=="event"){this.fireEvent("onClose");}this.hideWin();if(this.options.useIframeShim){this.hideIframeShim();}this.visible=false;return this;},hideWin:function(){this.win.setStyle("display","none");},destroyOthers:function(){if(!this.options.allowMultipleByClass||!this.options.allowMultiple){$$("div.StickyWinInstance").each(function(A){if(!this.options.allowMultiple||(!this.options.allowMultipleByClass&&A.hasClass(this.options.className))){A.dispose();}},this);}},setContent:function(A){if(this.win.getChildren().length>0){this.win.empty();}if($type(A)=="string"){this.win.set("html",A);}else{if($(A)){this.win.adopt(A);}}this.win.getElements("."+this.options.closeClassName).each(function(B){B.addEvent("click",this.hide.bind(this));},this);this.win.getElements("."+this.options.pinClassName).each(function(B){B.addEvent("click",this.togglepin.bind(this));},this);return this;},position:function(){this.positioned=true;this.win.setPosition({relativeTo:this.options.relativeTo,position:this.options.position,offset:this.options.offset,edge:this.options.edge});if(this.shim){this.shim.position();}return this;},pin:function(A){if(!this.win.pin){dbug.log("you must include element.pin.js!");return this;}this.pinned=$pick(A,true);this.win.pin(A);return this;},unpin:function(){return this.pin(false);},togglepin:function(){return this.pin(!this.pinned);},makeIframeShim:function(){if(!this.shim){var A=(this.options.iframeShimSelector)?this.win.getElement(this.options.iframeShimSelector):this.win;this.shim=new IframeShim(A,{display:false,name:"StickyWinShim"});}},showIframeShim:function(){if(this.options.useIframeShim){this.makeIframeShim();this.shim.show();}},hideIframeShim:function(){if(this.options.useIframeShim){this.shim.hide();}},destroy:function(){if(this.win){this.win.dispose();}if(this.options.useIframeShim){this.shim.dispose();}if($("modalOverlay")){$("modalOverlay").dispose();}}});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 FormRecycler={Base:new Class({Implements:[Options,Events],options:{clone:false,findLocalData:$lambda({}),resetOnMove:true,resetOnHide:false},initialize:function(B,A){this.setOptions(A);this.shell=(this.options.clone)?$(B).clone():$(B);this.form=(this.shell.get("tag")=="form")?this.shell:this.shell.getElement("form");if(!this.form){return null;}this.findLocalData=this.options.findLocalData;this.form.store("mobileForm",this);this.fireEvent("onInitialize");return this;},relocateForm:function(A){this.removeLocalParams();if(this.options.resetOnMove){this.form.reset();this.fireEvent("onReset");}this.setLocalData(this.findLocalData(A));this.fireEvent("onRelocate",A);},removeLocalParams:function(){this.form.getElements("input").each(function(A){if(A.getProperty("local")){A.dispose();}});},setLocalData:function(A){if(!A||$type(A)!="object"){return null;}$each(A,function(C,B){new Element("input",{type:"hidden",name:B,value:C,local:"true"}).inject(this.form);},this);},move:function(A){A=$(A);if(!A){return false;}this.relocateForm(A);return A;},toElement:function(){return this.shell;}})};$extend(FormRecycler,{Inline:new Class({Extends:FormRecycler.Base,Implements:Chain,options:{hideFormsInParent:true,revealOptions:{},firstParent:null},initialize:function(B,A){A=$merge(this.options,A||{});this.parent(B,A);if(!this.form){return null;}this.form.store("mobileForm",this);this.currentParent=$(this.options.firstParent)||null;this.shell.set("reveal",$merge(this.options.revealOptions,{onComplete:this.callChain.bind(this)}));return this;},relocateForm:function(A){this.parent(A);A.adopt(this.shell);this.currentParent=A;this.callChain();},move:function(A){this.clearChain();A=$(A);if(!A){return ;}if(this.currentParent==A){if(this.options.hideFormsInParent){this.hideOthers();}this.shell.get("reveal").toggle();return ;}this.chain(this.relocateForm.pass(A,this),this.show.bind(this));this.hide();},show:function(){if(this.shell.get("reveal").hiding){this.show.delay(10,this);return ;}if(this.options.hideFormsInParent){this.hideOthers();}this.shell.reveal();this.fireEvent("onShow");},hideOthers:function(){this.currentParent.getElements("form").each(function(A){try{if(A!=this.form){A.retrieve("mobileForm").toElement().dissolve();}}catch(B){dbug.log(B);}});},hide:function(){this.shell.dissolve();this.fireEvent("onHide");}}),GlobalModal:new Class({Extends:FormRecycler.Base,options:{modalOptions:{}},initialize:function(B,A){A=$merge(this.options,A||{});this.parent(B,A);try{this.modal=new GlobalModal($merge(this.options.modalOptions||{},{content:this.shell}));}catch(C){dbug.log("Modal failure: %o",C);}},move:function(A){A=this.parent(A);if(!A){return false;}this.show();},show:function(){this.modal.show();this.fireEvent("onShow");},hide:function(){this.modal.hide();this.fireEvent("onHide");}})});var CommentForm=new Class({Extends:FormRecycler.Inline,commentOptions:{submitElems:false,closeElems:false,useValidator:true,validatorOptions:{},useTextFieldCounter:true,textFieldCounterOptions:{}},initialize:function(B,A){this.parent(B,$merge(this.commentOptions,A));try{this.validator=(this.options.useValidator)?new FormValidator(this.form,this.options.validatorOptions):false;}catch(C){dbug.log("Validator addition failed: %o",C);this.validator=false;}this.waiter=false;this.form.set("send",{onRequest:function(){if(!this.waiter){this.waiter=new Waiter(this.form);}this.waiter.start();}.bind(this),onComplete:function(){if(this.waiter){this.waiter.stop();}}.bind(this),onSuccess:this.handlePostResponse.bind(this),onFailure:this.handleFailure.bind(this)});if(this.options.useTextFieldCounter&&window.TextFieldCounter){this.textCounters=new TextFieldCounter(this.form,this.options.textFieldCounterOptions);}if(this.options.submitElems){this.form.getElements(this.options.submitElems).addEvent("click",this.doSubmit.bind(this));}if(this.options.closeElems){this.form.getElements(this.options.closeElems).addEvent("click",this.hide.bind(this));}this.form.addEvent("submit",function(D){D.stop();this.doSubmit();}.bind(this));},doSubmit:function(){if(!UserVars.isLoggedIn()){return false;}this.form.getElements("input[type=text], textarea").each(function(A){A.set("value",A.get("value").trim());});if(this.validator&&!this.validator.validate()){return false;}this.form.send();},hide:function(){this.parent();if(this.validator){this.chain(function(){this.validator.reset();if(this.options.useTextFieldCounter){this.textCounters.resetAllCounters();}this.fireEvent("onReset");this.callChain();}.bind(this));}},handlePostResponse:function(F){var E=JSON.decode(F);this.hide();this.thanks=new Element("div",{id:"thankYou","class":"userSubmit userReviewForm thankyou"}).inject(this.shell,"before");if(E.responseMessages){new Element("h4",{html:E.responseMessages[0].replace(", !",", "+UserVars.getDisplayName()+"!")}).inject(this.thanks);if(E.responseMessages.length>1){for(var D=1;D<E.responseMessages.length;D++){new Element("span",{"class":"pleaseSubmit",html:E.responseMessages[D]}).inject(this.thanks);}}}if(E.links){var C=new Element("ul",{"class":"viewLinks"}).inject(this.thanks);var B=function(H,G){C.adopt(new Element("li").adopt(new Element("a",{href:G,text:H,"class":"readMoreLinks"})));};if(E.links.READ_YOUR_REVIEW){this.reviewLink=E.links.READ_YOUR_REVIEW;B("Read your review",this.reviewLink);}if(E.links.READ_YOUR_UPDATE){B("Read your update",E.links.READ_YOUR_UPDATE);}if(E.links.READ_YOUR_REPLY){this.replyLink=E.links.READ_YOUR_REPLY;B("Read your reply",this.replyLink);}if(E.links.READ_MORE_USER_REVIEWS){B("Read more user reviews",E.links.READ_MORE_USER_REVIEWS);}if(E.links.BACK_TO_PRODUCT_REVIEW){this.overviewLink=E.links.BACK_TO_PRODUCT_REVIEW;B("Back to product review",this.overviewLink);}}var A=new Element("p",{"class":"closeButton"}).inject(this.thanks);A.adopt(new Element("a",{"class":"flexButton black",text:"Close",events:{click:function(){this.thanks.dissolve();}.bind(this)}}));this.fireEvent("onCommentSuccess",arguments);},handleFailure:function(){this.writeMessage('This action was not completed. Please try again, or notify us at our <a href="http://cnet.custhelp.com/">Help Center</a>.');},writeMessage:function(A){new Element("div",{html:A}).inject(this.shell,"before");}});var HelpfulVote=new Class({launchElem:null,Implements:[Options],options:{responseKey:"response",responseSuccess:1},initialize:function(B,A){B.stop();this.setOptions(A);this.launchElem=$(B.target);if(this.errorDiv){this.errorDiv.empty();}if(!CURS.Manager.checkLogin({loginHed:"Log in to CNET to vote for this review",registerHed:"Join CNET to vote for this review",appId:88,nextAction:this.makeRequest.bind(this),cval:"helpful"})){return false;}},makeRequest:function(){new Request({url:this.launchElem.get("href"),method:"get",onComplete:function(A){A=JSON.decode(A);this[(A&&A.status==this.options.responseSuccess)?"success":"failure"](A);}.bind(this)}).send();new Jlogger({tag:"submitHelpful"}).ping();},success:function(A){if(A[this.options.responseKey]){var B=A[this.options.responseKey];if($type(B)=="array"){B=B[0];}this.findParent().set("html",B);}},failure:function(A){if(A&&A.errors){$each(A.errors,function(B){this.getErrorDiv().appendText(B.message);}.bind(this));}else{this.getErrorDiv().set("html",'We\'re sorry, but an error has occurred. Please try again or contact our <a href="http://cnet.custhelp.com/" target="_new">Help Center</a>.');}},findParent:function(){return(this.launchElem.hasClass("rateUR"))?this.launchElem:this.launchElem.getParent(".rateUR");},getErrorDiv:function(){if(!this.errorDiv){this.errorDiv=this.findParent().getElement("div.error")||new Element("div",{"class":"error"}).inject(this.findParent(),"top");}return this.errorDiv;}});var StarPower=new Class({Extends:Tips,options:{timeOut:700,maxTitleChars:50,maxOpacity:0.9,offsets:{x:-14,y:24},starTips:{"0.5":"Abysmal::0.5 star out of 5","1":"Terrible::1 star out of 5","1.5":"Poor::1.5 stars out of 5","2":"Mediocre::2 stars out of 5","2.5":"OK::2.5 stars out of 5","3":"Good::3 stars out of 5","3.5":"Very good::3.5 stars out of 5","4":"Excellent::4 stars out of 5","4.5":"Outstanding::4.5 stars out of 5","5":"Spectacular::5 stars out of 5"},clickToRateString:"Click to rate this product",removeUserRating:true,userRatingDuration:3000,useHalfStars:true,onRate:function(A){}},initialize:function(C,A){this.elements=$$(C);if(A.starTips){this.options.starTips=A.starTips;}if($defined(A.useHalfStars)){this.options.useHalfStars=A.useHalfStars;}var B=new MobileChecker();this.isTouchy=B.isTouch();if(this.isTouchy){this.bound={click:this.hoverStars.bind(this)};}else{this.bound={mousemove:this.hoverStars.bind(this),mouseleave:this.hoverStars.bind(this),click:this.hoverStars.bind(this)};}this.parent(this.elements,A);},attach:function(A){A.each(function(B){B.store("defaultClass",B.get("class"));B.addEvents(this.bound);},this);},detach:function(A){A.each(function(B){B.removeEvents(this.bound);},this);},getTarget:function(B){if(this.elements.contains(B)){return B;}var A;this.elements.each(function(C){if(C.hasChild(B)){A=C;}});return A;},hoverStars:function(F){var C=this.getTarget(F.target);switch(F.type){case"mousemove":var A=this.convert(C,this.calc(F),true).toString();if(A=="0"){break;}var E=this.options.starTips[this.convert(C,this.calc(F),true).toString()];C.store("tip:title",E.split("::")[0]);C.store("tip:text",this.options.clickToRateString+" "+E.split("::")[1]);this.elementEnter(F,C);C.set("class",C.get("class").replace(/userRate\d\w?/,this.convert(C,this.calc(F))));C.addClass("userStars");break;case"mouseout":this.elementLeave.bindWithEvent(this,C)(F);C.set("class",C.retrieve("defaultClass"));break;case"click":var B=this.convert(C,this.calc(F),true);var D=this.convert(C,this.calc(F));C.store("rating",B);C.store("defaultClass",C.get("class"));if(this.isTouchy){this.addUserRating(C,F);}this.fireEvent("onRate",[B,D]);break;}},show:function(){this.fireEvent("onShow",this.tip);},hide:function(){this.fireEvent("onHide",this.tip);},addUserRating:function(C,E){var A=this.options.starTips[this.convert(C,this.calc(E),true).toString()].split("::");var B=C.getParent();var D=(!B.getElement(".user_rating"))?this.injectUserRating(B):B.getElement(".user_rating");this.updateUserRating(D,A);},injectUserRating:function(B){var D=new Element("div",{"class":"user_rating",style:"position: relative; left: 105px; top: -17px;height:0px;"});var A=new Element("span",{"class":"user_title_rating"});var C=new Element("span",{"class":"user_text_rating"});D.grab(A);D.grab(C);B.grab(D);return D;},updateUserRating:function(C,A){C.getElement(".user_title_rating").set("html",A[0]);C.getElement(".user_text_rating").set("html"," "+A[1]);if(this.options.removeUserRating){if(this.ur_timer){clearTimeout(this.ur_timer);}var D=new Fx.Tween(C,{onComplete:function(){C.destroy();}.bind(this)});var B=function(){D.start("opacity",0);}.bind(this);this.ur_timer=B.delay(this.options.userRatingDuration,this);}},calc:function(B){var C=$(B.target).getPosition().x;var A=B.page.x-C;return A;},convert:function(C,F,E){var G="userRate";var B=Math.round(C.getSize().x/5);var A=(F/B).toInt();var D=F/B-A;if(this.options.useHalfStars){if(D>0.5){A++;}G+=A;if(D<=0.5){G+="h";A+=0.5;}}else{if(D){A++;}G+=A;}return E?A:G;}});var ThumbScroller=new Class({Extends:Fx.Scroll,scrollOptions:{thumbs:".box",axis:"x",thumbContainer:null,nav:{},startIndex:0,tolerance:0},initialize:function(A,B){if(typeof (A)=="string"){if($(A).retrieve("thumbscroller")){return false;}}else{if(A.retrieve("thumbscroller")){return false;}}this.parent(A,$merge(this.scrollOptions,B));this.element.store("thumbscroller",this);this.element.setStyle("overflow","hidden");this.computeDimensions();this.initNav();this.toIndex(this.options.startIndex);this.lastScroll=null;this.fireEvent("onInitialize");return this;},computeDimensions:function(){this.thumbs=this.element.getElements(this.options.thumbs);this.setParentSize();this.positions=this.getLocations();return this;},isAtEnd:function(A){A=A||this.getRange();var B=A[A.length-1];return(B.index==this.thumbs.length-1&&(B.type!="partial"||B.tolerated));},isAtStart:function(A){A=A||this.getRange();var B=A[0];return(B.index==0&&(B.type!="partial"||B.tolerated));},getLocations:function(){return this.thumbs.map(function(B){var C=B.getComputedSize()[this.getDir("total")];var A=B.getPosition(B.getParent())[this.getDir("xy")];return{size:C,start:A,end:C+A};},this);},initNav:function(){try{if(typeof (this.options.nav.next)=="string"){$$(this.options.nav.next).addEvent("click",this.toNextScreen.bind(this));}else{if(this.options.nav.next instanceof Array){this.options.nav.next[0].addEvent("click",this.toNextScreen.bind(this));}else{this.options.nav.next.addEvent("click",this.toNextScreen.bind(this));}}if(typeof (this.options.nav.previous)=="string"){$$(this.options.nav.previous).addEvent("click",this.toPreviousScreen.bind(this));}else{if(this.options.nav.previous instanceof Array){this.options.nav.previous[0].addEvent("click",this.toPreviousScreen.bind(this));}else{this.options.nav.previous.addEvent("click",this.toPreviousScreen.bind(this));}}if(typeof (this.options.nav.start)=="string"){$$(this.options.nav.start).addEvent("click",this.toStart.bind(this));}else{if(this.options.nav.start instanceof Array){this.options.nav.start[0].addEvent("click",this.toStart.bind(this));}else{this.options.nav.start.addEvent("click",this.toStart.bind(this));}}if(typeof (this.options.nav.end)=="string"){$$(this.options.nav.end).addEvent("click",this.toEnd.bind(this));}else{if(this.options.nav.end instanceof Array){this.options.nav.end[0].addEvent("click",this.toEnd.bind(this));}else{this.options.nav.end.addEvent("click",this.toEnd.bind(this));}}}catch(A){}},getDir:function(A){switch(A){case"total":if(this.options.axis=="y"){return"totalHeight";}return"totalWidth";case"dir":if(this.options.axis=="y"){return"height";}return"width";case"xy":default:if(this.options.axis=="y"){return"y";}return"x";}},getStart:function(A){if(this.options.axis=="y"){return[0,A];}return[A,0];},getStartPx:function(A){if(!A){return 0;}return this.positions[A].start-(this.positions[A].start-this.positions[A-1].end);},setParentSize:function(){var A=(this.options.thumbContainer)?this.element.getElement(this.options.thumbContainer):this.element.getElement(this.options.thumbs).getParent();var B=0;$each(this.thumbs,function(C){B+=C.getComputedSize({styles:["padding","border","margin"]})[this.getDir("total")];},this);A.setStyle(this.getDir("dir"),B);},getRange:function(E){if(isNaN(E)){E=this.element.getScroll()[this.getDir("xy")];}var D=this.element.getComputedSize({styles:["padding"]})[this.getDir("total")];var C=[];for(var A=0;A<this.positions.length;A++){var B=this.withinRange(this.positions[A],E,E+D);if(B){C.push($merge(B,{index:A}));if(B.where=="end"){break;}}}return C;},withinRange:function(C,B,A){if(C.end>B&&C.end<=A){if(C.start>=B){return{type:"full"};}else{return{type:"partial",where:"start",tolerated:((B-C.start)<=this.options.tolerance)};}}else{if(C.start>=B&&C.start<A){return{type:"partial",where:"end",tolerated:((C.start-A)<this.options.tolerance)};}else{if(C.start<B&&C.end>A){return{type:"full"};}}}return false;},toNextScreen:function(){var A=this.getRange();if(A.getLast().type=="partial"&&!A.getLast().tolerated&&A.length>1){this.start.run(this.getStart(this.getStartPx(A.getLast().index)),this);}else{if($(this.thumbs[A.getLast().index+1])){this.start.run(this.getStart(this.getStartPx(A.getLast().index+1)),this);}else{this.toEnd();}}this.lastScroll="next";},toPreviousScreen:function(){var A=this.getRange();var C=(A[0].type=="partial"&&!A[0].tolerated&&A.length>1)?A[0].index:A[0].index-1;if(!this.positions[C]){this.toStart();return ;}var B=this.positions[C].end-this.element.getComputedSize({styles:["padding"]})[this.getDir("total")];var E=this.getRange(B);var D=(E[0].type=="partial"&&E.length>1)?E[0].index+1:E[0].index;this.start.run(this.getStart(this.getStartPx(D)),this);this.lastScroll="previous";},toIndex:function(A){this.start.run(this.getStart(this.getStartPx(parseInt(A))),this);},toStart:function(){if(this.options.axis=="y"){this.toTop();}else{this.toLeft();}},toEnd:function(){if(this.options.axis=="y"){this.toBottom();}else{this.toRight();}}});var JsonP=new Class({Implements:[Options,Events],options:{callBackKey:"callback",queryString:"",data:{},timeout:5000,retries:0},initialize:function(B,A){this.setOptions(A);this.url=this.makeUrl(B).url;this.fired=false;this.scripts=[];this.requests=0;this.triesRemaining=[];},request:function(C,E){var B=this.makeUrl(C);if(!$chk(E)){E=this.requests;this.requests++;}if(!$chk(this.triesRemaining[E])){this.triesRemaining[E]=this.options.retries;}var D=this.triesRemaining[E];dbug.log("retrieving by json script method: %s",B.url);var A=(Browser.Engine.trident)?50:0;(function(){var F=new Element("script",{src:B.url,type:"text/javascript",id:"jsonp_"+B.index+"_"+E});this.fired=true;this.addEvent("onComplete",function(){try{F.dispose();}catch(G){}}.bind(this));F.inject(document.head);if(D){(function(){this.triesRemaining[E]=D-1;if(F.getParent()&&D){dbug.log("removing script (%o) and retrying: try: %s, remaining: %s",E,D);F.dispose();this.request(C,E);}}).delay(this.options.timeout,this);}}.bind(this)).delay(A);return this;},makeUrl:function(B){var A;if(JsonP.requestors.contains(this)){A=JsonP.requestors.indexOf(this);}else{A=JsonP.requestors.push(this)-1;JsonP.requestors["request_"+A]=this;}if(B){var D=(B.test("\\?"))?"&":"?";var C=B+D+this.options.callBackKey+"=JsonP.requestors.request_"+A+".handleResults";if(this.options.queryString){C+="&"+this.options.queryString;}C+="&"+Hash.toQueryString(this.options.data);}else{var C=this.url;}return{url:C,index:A};},handleResults:function(A){dbug.log("jsonp received: ",A);this.fireEvent("onComplete",[A,this]);}});JsonP.requestors=[];var RVP={options:{domain:"http://reviews.cnet.com",rtssUrl:"/9804-4_7-0-0.html",validPageTypes:[4505,4852,4864,4507,4540,4510,4014,1714]},imagesLoaded:false,Thumb:new Class({Implements:Events,options:{defaultImage:"http://www.cnet.com/b.gif"},initialize:function(B,A){this.data=B;this.thumb=this.makeElem(A);this.thumb.store("rvpThumb",this);new Tips(this.thumb,{className:"rvpTip"});this.thumb.addEvent("mouseenter",function(){RVP.prodHover.ping();this.image.morph({"border-color":"#CC0000"});}.bind(this));this.thumb.addEvent("mouseleave",function(){if(!this.thumb.getElement("input[type=checkbox]").checked){this.image.morph({"border-color":"#CCCCCC"});}}.bind(this));return this;},makeElem:function(A){this.imageIsSet=false;var B=new Element("li",{title:this.makeProductName(this.data.productName),productId:this.data.productId});var C=new Element("a",{href:this.getProductLink()}).inject(B);this.image=new Element("img",{src:this.options.defaultImage}).inject(C);if(A<8){this.setImage();}new Element("span").inject(B).adopt(new Element("input",{type:"checkbox",name:"prodId",value:this.data.productId}));return B;},getProductLink:function(){if(PageVars.get("siteId","number")==9){this.data.productLink=this.data.productLink.replace("/4505-","/4014-").replace("_7-","_9-");}return this.data.productLink+"?tag=box4505";},setImage:function(){if(!this.imageIsSet){this.image=new Element("img",{src:this.data.productImage}).replaces(this.image);this.verifyImage();}this.imageIsSet=true;},verifyImage:function(){var B=this.image;if(B.naturalWidth===undefined){B=$(new Image());B.set("src",this.image.get("src"));}var A=this.testValid.pass(B,this);if(!B.complete){if(!(B.onreadystatechange===undefined)){$(B).onreadystatechange=A;}else{B.addEvent("load",A);}}else{A();}},testValid:function(A){if(A.readyState=="complete"||A.complete){var B=(A.naturalWidth!=undefined)?A.naturalWidth:A.width;if(B==1){this.image.setStyle("background","#FFF url(http://i.i.com.com/cnwk.1d/i/dl/global/image_not_available.gif) no-repeat center center");}}this.fireEvent("onImageSet");},makeProductName:function(A){if(A.length<30){return A;}var B=A.substr(0,A.lastIndexOf(" ",30));return B+"...";},remove:function(){try{this.thumb.set("morph",{onComplete:function(){this.thumb.dispose();RVP.scroller.computeDimensions().fireEvent("onComplete");}.bind(this)});this.thumb.morph({width:0});}catch(A){dbug.log("Failed to remove thumb: %o",A);}}}),add:function(A){this.getRTSS("addProducts",A);},remove:function(A){A=$splat(A);var B=[];A.each(function(C){C=C.retrieve("rvpThumb");B.push(C.data.productId);C.remove();});this.getRTSS("removeProducts",B);},clearHistory:function(){this.getRTSS("clearHistory");var A=$("recentlyViewedProds").getElement(".rvpShell");A.set("morph",{duration:250,onComplete:function(){A.getElements("li").dispose();A.setStyle("opacity",1);RVP.setBoxDisplay();}});A.morph("opacity",0);},getStored:function(){var B=Cookie.get("RVPstore");var A=false;B=(B)?B.split(":"):[];if(RVP.options.validPageTypes.contains(PageVars.get("pageType","number"))){A=PageVars.get("assetId");}else{if(PageVars.get("pageType","number")==4504){A=new Link({href:location.href}).getQuery("id");}}if(!A){return null;}if($type(A)!="array"){A=[A];}A.each(function(C){B.erase(C);B.unshift(C);});return(B.length)?B:null;},saveStored:function(A){A=A||this.getStored();if(A){Cookie.write("RVPstore",A.join(":"),{path:"/",duration:31,domain:"cnet.com"});}},getRTSS:function(B,D){B=B||"retrieveHistory";try{D=(D)?"productIds="+$splat(D).join("&productIds="):"";var A={startAt:0,maxHits:0,_siteid_:PageVars.get("siteId","number"),_editionid_:3,cmd:B};new JsonP(this.options.domain+this.options.rtssUrl,{queryString:D,data:A,onComplete:function(E){this.products=E;try{this.waiter.stop();}catch(F){}if(["addProducts","retrieveHistory"].contains(B)){this.updateData(E);}else{this.setBoxDisplay();}}.bind(RVP)}).request();}catch(C){}},setBoxDisplay:function(){var B=$("recentlyViewedProds");var A=B.getElement(".invite");if(this.products.products.length<3){var C=null;if(this.products.products.length==2){C="You can create side-by-side comparisons of the products that interest you most.";}else{C="When you look at products on CNET, we'll keep track of them here.";}A.set("text",C);A.setStyle("display","block");}else{A.hide("display","none");}var D=B.getElement(".compareSel a");if(B.getParent(".coco")){if(!this.products.products.length){D.morph({opacity:0.3});D.removeEvent("click",RVP.addToCompare);}else{D.morph({opacity:1});D.addEvent("click",RVP.addToCompare);}}else{if(this.products.products.length<2){D.morph({opacity:0.3});D.removeEvent("click",RVP.compareSelected);}else{D.morph({opacity:1});D.addEvent("click",RVP.compareSelected);}}B.getElements("li.removeSel, li.clearAll").setStyle("display",((this.products.products.length)?"block":"none"));B.getElements("li.empty").setStyle("display",((this.products.products.length)?"none":"block"));if(!this.products.products.length){B.getElement("#scrollLeft").addClass("leftInactive");B.getElement("#scrollRight").addClass("rightInactive");}},updateData:function(A){$each(this.products.products,function(D,C){new RVP.Thumb(D,C).thumb.inject($E("#recentlyViewedProds ul.thumbContainer"));});RVP.scroller=new ThumbScroller($("recentlyViewedProds").getElement(".rvpShell"),{thumbs:".thumbContainer li",thumbContainer:"ul.thumbContainer",nav:{next:"#scrollRight",previous:"#scrollLeft"}});RVP.scroller.addEvent("onComplete",function(){var G=RVP.scroller;$$(G.options.nav.next).removeClass("rightInactive");$$(G.options.nav.previous).removeClass("leftInactive");var E=G.getRange();if(G.isAtEnd(E)){$$(G.options.nav.next).addClass("rightInactive");}if(G.isAtStart(E)){$$(G.options.nav.previous).addClass("leftInactive");}if(G.lastScroll=="next"){if(!this.imagesLoaded){var F=E.length;var C=E[0].index;var D=$$("#recentlyViewedProds ul.thumbContainer li");for(C;(C<(E.length*3)+C&&C<D.length);C++){D[C].retrieve("rvpThumb").setImage();if(C==D.length-1){this.imagesLoaded=true;}}}}}.bind(this));var B=this.products.products.length;B=(B>2)?2:B;new Jlogger({tag:"box-imp"+B,ctype:"tooltype;action",cval:"box;imp"+B}).ping();this.setBoxDisplay();},buildContainer:function(){var A=new Element("div",{id:"recentlyViewedProds"});A.set("html",'            <strong><span>My recently viewed products</span></strong>            <div class="rvpBar">                <a id="scrollLeft" class="leftInactive"></a>                    <div class="rvpShell">                         <ul class="thumbContainer"></ul>                    </div>                <a id="scrollRight" class="rightInactive"></a>                <div class="invite" style="display: none"></div>            </div>            <ul class="rvpTools">                <li class="compareSel"><a class="flexButton" title="Select two or more products to compare."><b>Compare</b></a></li>                <li class="empty" style="display:none">Your history is now empty.</li>                <li class="removeSel"><a>Remove selected</a></li>                <li class="clearAll"><a>Clear all</a></li>            </ul>        ');return A;},compareSelected:function(){var A=$("recentlyViewedProds").getElements("input").filter(function(C){return C.checked;});if(A.length>1){var B="";A.each(function(C){B+="id="+C.get("value")+"&";});window.location="/4504-4_7-0.html?"+B+"&tag=boxcoco";}else{alert("You must select at least two products to compare.");}},addToCompare:function(){var A=$("recentlyViewedProds").getElements("input").filter(function(D){return D.checked;});var C=A.map(function(D){return D.get("value");});var B=new Link({href:location.href});C.combine(B.getQuery("id"));B.mergeQueryString({tag:"boxcomp",id:C});window.location.search=B.get("search");},setTracking:function(){new Jlogger({tag:"box-scroll-right",ctype:"tooltype;action",cval:"box;scrllrght",element:$("recentlyViewedProds").getElement("#scrollRight"),event:"click",fireOnce:true,onPing:function(){this.general.ping();}.bind(this)});new Jlogger({tag:"box-scroll-left",ctype:"tooltype;action",cval:"box;scrllft",event:"click",element:$("recentlyViewedProds").getElement("#scrollLeft"),fireOnce:true,onPing:function(){this.general.ping();}.bind(this)});new Jlogger({tag:"box-remove",ctype:"tooltype;action",cval:"box;remove",event:"click",element:$("recentlyViewedProds").getElement(".removeSel a"),fireOnce:true,onPing:function(){this.general.ping();}.bind(this)});new Jlogger({tag:"box-rm-all",ctype:"tooltype;action",cval:"box;rm-all",event:"click",element:$("recentlyViewedProds").getElement(".clearAll a"),fireOnce:true,onPing:function(){this.general.ping();}.bind(this)});this.general=new Jlogger({tag:"box-general",ctype:"tooltype;action",cval:"box;general",fireOnce:true});this.prodHover=new Jlogger({tag:"box-prod-hover",ctype:"tooltype;action",cval:"box;hover",fireOnce:true,onPing:function(){this.general.ping();}.bind(this)});if([4014,4366,4504,4566,1714,1724,1726].contains(PageVars.get("pageType","number"))){new JlScroller({scrollTo:{top:"recentlyViewedProds"},event:"scrollTo",tag:"box-scroll-to",ctype:"tooltype;action",cval:"box;scrollto",fireOnce:true});}$("recentlyViewedProds").getElement(".compareSel a").addEvent("click",function(){this.general.ping();}.bind(this));}};RVP.saveStored();window.addEvent("domready",function(){if($("toolboxHistory")){if(!Cookie.read("XCLGFbrowser")){new Jlogger({tag:"missing-sess-cookie"}).ping();return ;}$("toolboxHistory").adopt(RVP.buildContainer());RVP.waiter=new Waiter($("recentlyViewedProds").getElement(".rvpShell")).start();var A=RVP.getStored();if(A){RVP.add(A);if(Cookie.read("RVPstore")){Cookie.dispose("RVPstore",{path:"/",domain:"cnet.com"});}}else{RVP.getRTSS();}$("recentlyViewedProds").getElement(".removeSel a").addEvent("click",function(){var D=$("recentlyViewedProds");var C=D.getElements("input").filter(function(E){return E.checked;});var B=C.map(function(E){return E.getParent("li");});RVP.remove(B);});$("recentlyViewedProds").getElement(".clearAll a").addEvent("click",function(){RVP.clearHistory();});new Tips($("recentlyViewedProds").getElement(".compareSel a"),{className:"rvpTip"});if($("recentlyViewedProds").getParent(".coco")){$("recentlyViewedProds").getElement(".compareSel a b").set("text","Add to comparison");$("recentlyViewedProds").getElement(".compareSel a").store("tip:title","Select one or more products to add to the comparison chart.");}RVP.setTracking();}});var TeaseToggle=new Class({Implements:Options,options:{triggerSelectors:".teasetoggle",triggerWhenOpen:"Collapse",triggerWhenClosed:"Expand",revealOptions:null},initialize:function(A,C,B){this.setOptions(B);this.container=$(A);this.toggleElem=$(C);this.container.store("teasetoggle",this);if(this.options.revealOptions){this.toggleElem.set("reveal",revealOptions);}this.initTriggers();this.state=(this.isOpen())?"open":"closed";},initTriggers:function(){this.triggers=this.container.getElements(this.options.triggerSelectors);this.triggers.addEvent("click",this.toggle.bind(this));},isOpen:function(){return this.toggleElem.isVisible();},toggle:function(){if(this.isOpen()){this.hide();}else{this.show();}return this;},updateTriggers:function(A){this.triggers.each(function(B){if(!B.hasClass("noupdate")){B.set("html",((A=="open")?this.options.triggerWhenOpen:this.options.triggerWhenClosed));}}.bind(this));},show:function(){this.toggleElem.reveal();this.updateTriggers("open");return this;},hide:function(){this.toggleElem.dissolve();this.updateTriggers("closed");return this;}});var TextFieldCounter=new Class({Implements:[Options,Events],options:{countUpdateSelector:".cnt",fieldSelector:"textarea",commonParentSelector:"dd",errorClass:"validation-advice",findCounter:function(A){return A.getParent(this.options.commonParentSelector).getElement(this.options.countUpdateSelector);}},initialize:function(B,A){this.setOptions(A);this.form=$(B);this.findCounter=this.options.findCounter;this.form.getElements(this.options.fieldSelector).each(this.setFieldValidation.bind(this));this.fireEvent("onInit");},setFieldValidation:function(D){var B=D.get("validatorProps");if(!B){return ;}if(window.MooTools&&MooTools.version=="1.2dev"){if($type(B)!="object"){B=JSON.decode(B);}else{if(typeOf(B)!="object"){B=JSON.decode(B);}}}if(!B&&!B.maxLength){return ;}try{var A=this.findCounter(D);}catch(C){var A=null;}if(!A){return ;}D.addEvent("keyup",function(){var E=D.value.trim().length;A.set("text",E);if((E<(B.minLength||0))||(E>B.maxLength)){A.addClass(this.options.errorClass);}else{A.removeClass(this.options.errorClass);}}.bind(this));},resetCounter:function(B){var A=this.findCounter(B);if(!A){return ;}A.set("text","0").removeClass(this.options.errorClass);},resetAllCounters:function(){this.form.getElements(this.options.fieldSelector).each(this.resetCounter.bind(this));}});FormValidator.implement({test:function(C,E,F){E=$(E);if(E.hasClass("ignoreValidation")){return true;}F=$pick(F,false);if(E.hasClass("warnOnly")){F=true;}var D=true;if(E){var B=this.getValidator(C);if(B){D=B.test(E);if(!D&&B.getError(E)){if(F){E.addClass("warning");}var A=this.makeAdvice(C,E,B.getError(E),F);this.insertAdvice(A,E);this.showAdvice(C,E);}else{this.hideAdvice(C,E);}this.fireEvent("onElementValidate",[D,E]);}}if(F){return true;}return D;}});var commentsForms={setTextCounter:function(C){var B=C.get("validatorProps");if(!B){return ;}B=JSON.decode(B);if(!B&&!B.maxLength){return ;}var A=C.getParent("dd").getElement(".cnt");if(!A){return ;}C.addEvent("keyup",function(){var D=this.value.trim().length;A.set("text",D);if((D<(B.minLength||0))||(D>B.maxLength)){A.addClass("validation-advice");}else{A.removeClass("validation-advice");}});},resetTextCounter:function(){this.form.getElements("span.cnt").each(function(A){A.set("text","0").removeClass("validation-advice");});},findMessageId:function(C){var B=null;var A=C;do{B=A.getProperty("messageId");}while(!B&&(A=A.getParent("li")));if(!B){return false;}var D={messageID:B};if(A.get("commentId")){D.commentId=A.get("commentId");}return D;}};commentsForms.ReplyForm=new Class({Extends:CommentForm,initialize:function(B,A){this.parent(B,A);this.form.set("send",{onSuccess:this.handlePostResponse.bind(this),onFailure:this.handleFailure.bind(this),onRequest:function(){this.thanks=new Element("div",{"class":"userReviewForm thankyou"}).inject(this.shell,"before");new Element("span",{html:"Thank you for submitting a reply, "+UserVars.getDisplayName()+"!"}).inject(new Element("h2").inject(this.thanks));this.thanks.getElement("h2").adopt(new Element("a",{"class":"closeConfirm",text:"close",events:{click:function(){this.thanks.dissolve();}.bind(this)}}));new Element("div",{text:"Note that your submission may not appear immediately on our site."}).inject(this.thanks);this.hide();this.fireEvent("onCommentSuccess");}.bind(this)});},handlePostResponse:function(E){var C=JSON.decode(E);var D=$A(C.responseMessages);dbug.log("status = "+C.status+"  num messages = "+D.length);if(C.links){var B=new Element("ul",{"class":"viewLinks"}).inject(this.thanks);var A=function(G,F){B.adopt(new Element("li").adopt(new Element("a",{href:F,text:G,"class":"readMore"})));};if(C.links.READ_YOUR_REPLY){A("Read your reply",C.links.READ_YOUR_REPLY);}if(C.links.READ_MORE_USER_REVIEWS){A("Read more user reviews",C.links.READ_MORE_USER_REVIEWS);}if(C.links.BACK_TO_PRODUCT_REVIEW){A("Back to product review",C.links.BACK_TO_PRODUCT_REVIEW);}}},handleFailure:function(){return null;}});var initializeComments=new Class({initialize:function(){this.setUpComments();this.initLinks();},setUpComments:function(){try{commentsForms.reply=new commentsForms.ReplyForm("replyReview",{findLocalData:commentsForms.findMessageId,resetOnHide:false,submitElems:".submit a.submitButton",closeElems:".submit .cancel a",validatorOptions:{evaluateFieldsOnBlur:false,evaluateFieldsOnChange:false,evaluateOnSubmit:false}});commentsForms.reply.form.getElements("textarea").each(commentsForms.setTextCounter);commentsForms.reply.addEvent("onReset",commentsForms.resetTextCounter);commentsForms.reply.addEvent("onCommentSuccess",function(){new Jlogger({tag:"replyReview"}).ping();});}catch(D){dbug.log("Reply form initialization failed: %o",D);}try{commentsForms.offensive=new CommentForm("ropReview",{findLocalData:commentsForms.findMessageId,resetOnHide:false,submitElems:".submit. a.submitButton",closeElems:".submit .cancel a",useValidator:false});commentsForms.offensive.addEvent("onCommentSuccess",function(){new Jlogger({tag:"ropReview"}).ping();});}catch(D){dbug.log("Offensive form initialization failed: %o",D);}try{commentsForms.email=new CommentForm("emailReview",{findLocalData:commentsForms.findMessageId,resetOnHide:false,submitElems:".submit a.submitButton",closeElems:".submit .cancel a",validatorOptions:{evaluateFieldsOnBlur:false,evaluateFieldsOnChange:false,evaluateOnSubmit:false}});commentsForms.email.form.getElements("textarea").each(commentsForms.setTextCounter);commentsForms.email.addEvent("onReset",commentsForms.resetTextCounter);commentsForms.email.addEvent("onCommentSuccess",function(){var E=commentsForms.submit.thanks.getElement("a.updateReview");if(E){E.addEvent("click",function(){window.location=CURS.getRefreshPath();});return ;}new Jlogger({tag:"emailReview"}).ping();});}catch(D){dbug.log("Email form initialization failed: %o",D);}try{$$(".userStars").each(function(E){new StarPower(E,{starTips:{"1":"Terrible::Click to rate this product 1 star out of 5","2":"Mediocre::Click to rate this product 2 stars out of 5","3":"Good::Click to rate this product 3 stars out of 5","4":"Excellent::Click to rate this product 4 stars out of 5","5":"Spectacular::Click to rate this product 5 stars out of 5"},useHalfStars:false,onRate:function(G,F){$("rating").set("value",G*2);$$(".userStars").each(function(H){if(!H.hasClass(F)){var I=H.get("class").match(/userRate\d+h*/)[0];H.removeClass(I);H.addClass(F);H.store("rating",G);H.store("defaultClass",F);}});}});});if($("prodSubmitReview")){if($("rating").get("value")!="-1"){$("userStars").set("class",$("userStars").get("class").replace(/userRate\d\w?/,sp.convert($("rating").get("value").toInt()*10)));}var C=function(){commentsForms.submit=new CommentForm("prodSubmitReview",{clone:false,resetOnHide:false,submitElems:".submit a.submitButton",validatorOptions:{evaluateFieldsOnBlur:false,evaluateFieldsOnChange:false,evaluateOnSubmit:false}});commentsForms.submit.validator.addAllThese([["starsvalidation",{errorMsg:"Please select a star rating.",test:function(E){return(E.value!="-1");}}],["validate-opt-length",{errorMsg:"This field must be blank, or between 10 and 5000 characters",test:function(G,F){var E=G.value.length;return(!E||(E>=F.minLength&&E<=F.maxLength));}}]]);commentsForms.submit.form.getElements("textarea").each(commentsForms.setTextCounter);commentsForms.submit.addEvent("onCommentSuccess",function(){try{new Fx.Scroll(window).toElement(commentsForms.submit.thanks);}catch(E){}new Jlogger({tag:"submitNew"}).ping();});commentsForms.submit.form.getElement("div.invite").setStyle("display","none");commentsForms.submit.form.getElement("div.loggedin").setStyle("display","block");};var A=$("prodSubmitReview").getElements(".invite a, textarea, .userStars, .submit a");A.each(function(E){if(E.getProperty("disabled")){E.removeProperty("disabled");}});if(!UserVars.isLoggedIn()){var B=function(E){CURS.Manager.checkLogin({registerHed:"Join CNET to submit a review",loginHed:"Log in to CNET to submit a review",appId:"88",cval:"userreview"});};A.addEvent("click",B);CURS.Manager.addEvent("onLogin",function(){A.removeEvent("click",B);C();});}else{C();}}}catch(D){dbug.log("Submission form initialization failed: %o",D);}try{$E("#prodSubmitReview .previewButton").addEvent("click",function(){var E=$("previewHTML").get("html");E=E.substitute($extend($("prodSubmitReview").toQueryString().parseQuery(),{date:new Date().toString(),username:UserVars.getDisplayName()}));commentsForms.preview=commentsForms.preview||new StickyWin({showNow:false});commentsForms.preview.setContent(E);commentsForms.preview.win.getElement(".submitButton").addEvent("click",function(){commentsForms.preview.hide();commentsForms.submit.doSubmit();});commentsForms.preview.show();});}catch(D){dbug.log("Failed to init preview: %o",D);}try{commentsForms.update=new CommentForm("updateReview",{clone:false,resetOnHide:false,submitElems:".submit a.submitButton",validatorOptions:{evaluateFieldsOnBlur:false,evaluateFieldsOnChange:false,evaluateOnSubmit:false}});commentsForms.update.form.getElements("textarea").each(commentsForms.setTextCounter);commentsForms.update.addEvent("onCommentSuccess",function(){new Jlogger({tag:"updateReview"}).ping();});if(commentsForms.update.form&&!UserVars.isLoggedIn()){commentsForms.update.form.addEvent("click",function(){CURS.Manager.checkLogin({registerHed:"Join CNET to update your review",loginHed:"Log in to CNET to update your review",appId:"88",cval:"update"});});}CURS.Manager.addEvent("onLogin",function(){commentsForms.update.form.getElements("textarea").removeProperty("disabled");});}catch(D){dbug.log("Update form initialization failed: %o",D);}},initLinks:function(A){A=$(A)||$(document.body);A.getElements(".replyUR a.reply").addEvent("click",function(B){CURS.Manager.checkLogin({registerHed:"Join CNET to reply to this review",loginHed:"Log in to CNET to reply to this review",appId:"88",nextAction:function(){commentsForms.reply.move($(B.target).getParent("li"));},cval:"reply"});});A.getElements(".postTools a.report").addEvent("click",function(B){CURS.Manager.checkLogin({registerHed:"Join CNET to report this comment",loginHed:"Log in to CNET to report this comment",appId:"88",nextAction:function(){commentsForms.offensive.move($(B.target).getParent("li"));},cval:"rop"});});A.getElements(".postTools a.email").addEvent("click",function(B){CURS.Manager.checkLogin({registerHed:"Join CNET to e-mail this to a friend",loginHed:"Log in to CNET to e-mail this to a friend",appId:"88",nextAction:function(){commentsForms.email.move($(B.target).getParent("li"));},cval:"emailfriend"});});A.getElements("p.rateUR a").addEvent("click",function(B){new HelpfulVote(B,{responseKey:"responseMessages",responseSuccess:"success"});});}});window.addEvent("domready",function(){$$("#deleteReview, .deleteComment").each(function(B){var A=new CommentForm(B,{clone:false,resetOnHide:false,submitElems:"a.submitButton",closeElems:".cancel a",useValidator:false,firstParent:B.getParent("li")});B.getParent("li").getElement(".admin .delete").addEvent("click",function(C){A.show();});});$$("#editReview, .editComment").each(function(B){var A=new CommentForm(B,{clone:false,resetOnHide:false,submitElems:"a.submitButton",closeElems:".cancel a",useValidator:false,firstParent:B.getParent("li")});B.getParent("li").getElement(".admin .edit").addEvent("click",function(C){A.show();});});$$(".contentTools a.share").each(function(A){A.addEvent("mouseenter",PageTools.openShare.bind(PageTools));});$$(".contentTools a.email").each(function(A){A.addEvent("click",PageTools.email);});$$(".contentTools a.print").each(function(A){A.addEvent("click",PageTools.print);});});window.addEvent("domready",function(){new initializeComments();});
   }
       
