
 //dbugScripts - will include non-compressed versions of this code if "jsdebug=true" is in the url of this page,
 //otherwise it will execute this code.

 if(!dbugScripts("http://publish.cnet.com:8100/html/rb/js/tron/shopper/",["shopper.tron.shopgrok.js"])) {
 /*	shopper.tron.shopgrok.js - packed	*/
       var MobileForm=new Class({Implements:[Options,Chain,Events],options:{clone:false,onInitialize:$empty,findLocalData:$lambda({}),resetOnMove:true,resetOnHide:false,onBeforeShow:$empty,hideFormsInParent:true,revealOptions:{},firstParent:null},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.currentParent=$(this.options.firstParent)||null;this.fireEvent("onInitialize");this.form.store("mobileForm",this);this.shell.set("reveal",$merge(this.options.revealOptions,{onComplete:this.callChain.bind(this)}));return this;},relocateForm:function(A){this.removeLocalParams();A.adopt(this.shell);this.currentParent=A;if(this.options.resetOnMove){this.form.reset();this.fireEvent("onReset");}this.setLocalData(this.findLocalData(A));this.fireEvent("onRelocate");this.callChain();},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){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();},hideOthers:function(){this.currentParent.getElements("form").each(function(A){try{if(A!=this.form){A.retrieve("mobileForm").shell.dissolve();}}catch(B){dbug.log(B);}});},hide:function(){this.shell.dissolve();}});var CommentForm=new Class({Extends:MobileForm,commentOptions:{submitElems:false,closeElems:false,useValidator:true,validatorOptions:{}},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.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();this.fireEvent("onReset");this.callChain();}.bind(this));}},handlePostResponse:function(F){var D=JSON.decode(F);var E=$A(D.responseMessages);dbug.log("status = "+D.status+"  num messages = "+E.length);this.hide();this.thanks=new Element("div",{"class":"userReviewForm thankyou"}).inject(this.shell,"before");if(D.responseMessages){new Element("h2",{html:"<span>"+(D.responseMessages[0].replace(", !",", "+UserVars.getDisplayName()+"!"))+"</span>"}).adopt(new Element("a",{"class":"closeConfirm",text:"close",events:{click:function(){this.thanks.dissolve();}.bind(this)}})).inject(this.thanks);if(D.responseMessages.length>1){for(var C=1;C<D.responseMessages.length;C++){new Element("div",{html:D.responseMessages[C]}).inject(this.thanks);}}}if(D.links){var B=new Element("ul",{"class":"viewLinks"}).inject(this.thanks);var A=function(H,G){B.adopt(new Element("li").adopt(new Element("a",{href:G,text:H,"class":"readMore"})));};if(D.links.READ_YOUR_REVIEW){A("Read your review",D.links.READ_YOUR_REVIEW);}if(D.links.READ_YOUR_UPDATE){A("Read your update",D.links.READ_YOUR_UPDATE);}if(D.links.READ_YOUR_REPLY){A("Read your reply",D.links.READ_YOUR_REPLY);}if(D.links.READ_MORE_USER_REVIEWS){A("Read more user reviews",D.links.READ_MORE_USER_REVIEWS);}if(D.links.BACK_TO_PRODUCT_REVIEW){A("Back to product review",D.links.BACK_TO_PRODUCT_REVIEW);}}this.fireEvent("onCommentSuccess");},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 commentsForms={findMessageId:function(C){var B=null;var A=C;do{B=A.getProperty("messageId");}while(!B&&(A=A.getParent("dl")));if(!B){return false;}return{messageId:B};},ReplyForm:new Class({Extends:CommentForm,initialize:function(B,A){this.parent(B,A);this.form.set("send",{onSuccess:this.handlePostResponse.bind(this)});},handlePostResponse:function(C){var A=JSON.decode(C);var B=$A(A.responseMessages);dbug.log("status = "+A.status+"  num messages = "+B.length);this.hide();this.thanks=new Element("div",{"class":"userReviewForm"}).inject(this.shell,"before");new Element("span",{text:"Thank you for submitting a reply, "+UserVars.getDisplayName()+"!"}).inject(new Element("h2").inject(this.thanks));new Element("div",{text:"Note that your submission may not appear immediately on our site."}).inject(this.thanks);new Element("div").adopt(new Element("a",{text:"Click here to view your comment.",href:new Link(CURS.getRefreshPath()).mergeQueryString({tag:"viewNewComment"}).set("hash",false).get("href")})).inject(this.thanks);this.fireEvent("onCommentSuccess");}})};var initializeComments=new Class({initialize:function(){this.setCommentCount();if(UserVars.isLoggedIn()){this.insertWelcome();}else{this.insertInvite();CURS.Manager.addEvent("onLogin",function(){this.insertWelcome();}.bind(this));}$("fixedCommentBox").getElement("dl.addcommentform").setStyle("display","block");this.setUpComments();this.initLinks();},insertInvite:function(){new Element("dd",{"class":"status invite reg",html:"<p><a>Log in or create an account</a> to post a comment.</p>"}).inject($("fixedCommentBox").getElement(".addcommentform dt.hed"),"after");},insertWelcome:function(){var A=$("fixedCommentBox").getElement("dd.invite");var B=new Element("dd",{"class":"status welcome",html:'<p>You are logged in as <span class="cnetUserName"></span>. Please leave a comment.'});if(A){B.replaces(A);}else{B.inject($("fixedCommentBox").getElement(".addcommentform dt.hed"),"after");}CURS.Manager.writeUserNames(B);},setUpComments:function(){commentsForms.reply=new commentsForms.ReplyForm("replyArea",{findLocalData:commentsForms.findMessageId,resetOnHide:false,submitElems:".addcomment a",closeElems:".cancel a"});commentsForms.reply.addEvent("onCommentSuccess",function(){new Jlogger({tag:"submitReply"}).ping();});commentsForms.offensive=new CommentForm("offensiveArea",{findLocalData:commentsForms.findMessageId,resetOnHide:false,submitElems:".submit.send a.button",closeElems:".cancel a"});commentsForms.offensive.addEvent("onRelocate",function(){var C=this.form.getElement("input[name=permalink]");C.set("value",C.get("value").replace(/#.*/,"")+"#"+this.form.getElement("input[name=messageId]").get("value"));});commentsForms.emailAFriend=new CommentForm("emailAFriendArea",{findLocalData:commentsForms.findMessageId,resetOnHide:false,submitElems:".submit.send a.button",closeElems:".cancel a"});if($("deleteArea")){commentsForms.adminDelete=new CommentForm("deleteArea",{findLocalData:commentsForms.findMessageId,submitElems:".submit.delete a.button",closeElems:".cancel a"});}if(!UserVars.isLoggedIn()){var A=function(C){if(C){C.stop();}CURS.Manager.checkLogin({registerHed:"Join CNET to comment on this story",loginHed:"Log in to CNET to comment on this story",appId:"36"});};var B=$("fixedCommentBox").getElements(".reg, #new-body, #subComment");B.addEvent("click",A);CURS.Manager.addEvent("onLogin",function(){B.removeEvent("click",A);});}CURS.Manager.addEvent("onLogin",function(){commentsForms.newComment=new commentsForms.ReplyForm("newCommentForm",{submitElems:".submit.addcomment a.button",clone:false});});},initLinks:function(A){A=$(A)||$(document.body).getElement(".commentwrapper");A.getElements("a.reply").addEvent("click",function(B){CURS.Manager.checkLogin({registerHed:"Join CNET to reply to this comment",loginHed:"Log in to CNET to reply to this comment",appId:"36",nextAction:function(){commentsForms.reply.move($(B.target).getParent("dl").getElement(".toolstretch"));}});});A.getElements("a.repo").addEvent("click",function(B){CURS.Manager.checkLogin({registerHed:"Join CNET to report this comment",loginHed:"Log in to CNET to report to this comment",appId:"36",nextAction:function(){commentsForms.offensive.move($(B.target).getParent("dl").getElement(".toolstretch"));}});});A.getElements("a.mail").addEvent("click",function(B){CURS.Manager.checkLogin({registerHed:"Join CNET to e-mail this comment to a friend",loginHed:"Log in to CNET to e-mail this comment to a friend",appId:"36",nextAction:function(){commentsForms.emailAFriend.move($(B.target).getParent("dl").getElement(".toolstretch"));}});});A.getElements("a.delete").addEvent("click",function(B){commentsForms.adminDelete.move($(B.target).getParent("dl").getElement(".toolstretch"));});},setCommentCount:function(){try{var B=$$(".commentwrapper .comcount")[0].get("text").toInt();var A;if(!B){A=new Element("a",{href:"#addcomm",text:"Post a comment"});}else{A=new Element("a",{href:"#comments",text:(B==1)?"1 comment":B+" comments"});}new Element("span",{"class":"commentTease"}).adopt(A).inject($("contentBody").getElement(".post .byline"));}catch(C){dbug.log(C);}}});var Replyer=new Class({options:{repliesId:"",processId:"",hideReplyId:"",nodeId:null,assetId:null,communityId:null,messageId:null,pageNum:null,isModerator:null,showReplyId:null},init:function(A){this.options.repliesId=A.repliesId;this.options.processId=A.processId;this.options.hideReplyId=A.hideReplyId;},showReplies:function(A){this.init(A);$("show_replies_"+A.messageId).set("text","Refresh replies");$(A.processId).setStyle("display","block");$(this.options.repliesId).setStyle("display","none");var B="/"+PageVars.getOid({pageType:"8617",pageNumber:null})+".html";var C="communityId="+A.communityId+"&messageId="+A.messageId+"&pageNum="+A.pageNum+"&isModerator="+A.isModerator+"&nomesh";new Request({url:B,method:"get",onSuccess:this.finish.bind(this)}).send(C);},finish:function(A){$(this.options.repliesId).set("html",A);$(this.options.processId).setStyle("display","none");try{$(this.options.repliesId).reveal();}catch(B){$(this.options.repliesId).setStyles({display:"block",height:"auto"});}$(this.options.hideReplyId).setStyle("display","block");try{commentsForms.initialize.initLinks(this.options.repliesId);}catch(B){dbug.log(B);}},hideReplies:function(A){$(A.hideReplyId).setStyle("display","none");try{$(A.repliesId).dissolve();}catch(B){dbug.log("Failed dissolve: %o",B);$(A.repliesId).setStyle("display","none");}$(A.showReplyId).set("text","Show replies");}});window.addEvent("domready",function(){commentsForms.initialize=new initializeComments();});
 /* end packed code */
 }
       