
 //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/commerce/",["commerce.tron.pricealerts.js"])) {
 /*	commerce.tron.pricealerts.js - packed	*/
       var PriceAlert=new Class({initialize:function(A){this.WAITING_STATUS=1;this.COMPLETE_STATUS=2;this.FAILED_STATUS=3;this.options=A;$A(this.options.alertElements).each(function(D){var C=D.getElement(this.options.subscribeSelector);var B=D.getElement(this.options.unsubscribeSelector);D.getElement(this.options.subscribeLinkSelector).addEvent("click",this.subscribe.pass(C,this));D.getElement(this.options.unsubscribeLinkSelector).addEvent("click",this.unsubscribe.pass(B,this));this.setInitialDisplay(C,B);}.bind(this));},setInitialDisplay:function(C,A){var B=(C)?C.parentNode.id.substr(this.options.productIdPrefix.length):null;loadProductListJSON("/9801-1-0.html?cmd=getChildFolders&viewName=.json-my-products-list");if(B&&mpList.list){mpList.list.each(function(D){if(D.referencedId==B){D.watchEvents.list.each(function(E){if(E.eventType.value==3){C.hide();A.show("block");}}.bind(this));}}.bind(this));}},subscribe:function(C){var B=(C)?C.parentNode.id.substr(this.options.productIdPrefix.length):null;if(B){this.changeStatus(C,this.WAITING_STATUS);var A="/9800-1-0.xml?referencedId="+B+"&listItemType=5&referencedType=2&eventTypes=3&cmd=createListItem&component";this.subscribeReq=new Request({url:A,method:"get",onSuccess:this.changeStatus.pass([C,this.COMPLETE_STATUS],this),onFailure:this.handleFailure.pass(C,this)}).send();}},unsubscribe:function(D){var C=(D)?D.parentNode.id.substr(this.options.productIdPrefix.length):null;var B;mpList.list.each(function(E){if(E.referencedId==C){B=E.id;}}.bind(this));if(B){this.changeStatus(D,this.WAITING_STATUS);var A="/9800-1-0.xml?listItemId="+B+"&eventType=3&cmd=deleteWatchEvent&component";this.unsubscribeReq=new Request({url:A,method:"get",onSuccess:this.changeStatus.pass([D,this.COMPLETE_STATUS],this),onFailure:this.handleFailure.pass(D,this)}).send();}},changeStatus:function(G,F){dbug.log("changeStatus: %o, %s",G,F);var B=G.parentNode.getElement(this.options.waitingSelector);var E=G.parentNode.getElement(this.options.subscribeSelector);var D=G.parentNode.getElement(this.options.unsubscribeSelector);switch(F){case this.WAITING_STATUS:G.hide();B.show();break;case this.COMPLETE_STATUS:loadProductListJSON("http://reviews.cnet.com/9801-1-0.html?cmd=getChildFolders&viewName=.json-my-products-list");B.hide();if(G==E){D.show();}else{if(G==D){E.show();}}var C=new Date();var A="http://dw.com.com/redir?ontid="+PageVars.nodeId+"&siteid="+PageVars.siteId+"&pId="+PageVars.pageType+"&edId="+PageVars.editionId+"&useraction=23&tag=pricealert&uniquePingId="+C.getTime();new Element("img",{src:A,"class":"pingdw"});break;case this.FAILED_STATUS:B.hide();G.show();break;}},handleFailure:function(B){dbug.log("failure: %o",B);var C=(B==B.parentNode.getElement(this.options.subscribeSelector))?this.subscribeReq:this.unsubscribeReq;dbug.log(C);if(C.response&&C.response.text&&C.response.text.indexOf("COMPONENT_RESPONSE_CODE=401")>=0){var A=C.url.replace(/&component(=)?/,"");window.location=A+"&viewName=redirect:"+escape(location.href);}else{alert("There was a problem with the request. Please try again.");this.changeStatus(B,this.FAILED_STATUS);}}});window.addEvent("domready",function(){try{$("paContent").getElement("a.sub").addEvent("click",function(){CURS.Manager.checkLogin({registerHed:"Join CNET to be notified when this product is available",loginHed:"Log in to CNET to be notified when this product is available",appId:37});});}catch(A){dbug.log("Price alerts initialization failed: %o",A);}$$("#similarProds li a, #edStars li a.toolTipElement").each(function(B){B.store("tip:text",B.getParent("li").getElement("ul.data").getParent().get("html"));});$$(".contentTools a.share").each(function(B){B.addEvent("mouseenter",PageTools.openShare.bind(PageTools));});$$(".contentTools a.email").each(function(B){B.addEvent("click",PageTools.email);});$$(".contentTools a.print").each(function(B){B.addEvent("click",PageTools.print);});});CURS.Manager.addEvent("onLogin",function(){try{new PriceAlert({productIdPrefix:"pa-",alertElements:$$("div.price-alert"),subscribeSelector:"div#paSubscribe",unsubscribeSelector:"div#paConfirm",subscribeLinkSelector:"a.sub",unsubscribeLinkSelector:"a.unsub",waitingSelector:"div#waiting"});}catch(A){dbug.log(A);}});
 /* end packed code */
 }
       
