
   if(!dbugScripts("commerce",["commerce.tron.search.js"])) {
   /*	commerce.tron.search.js - packed	*/
       var CompareSearchedProducts=new Class({Implements:Options,options:{alterLinks:null,submitLinks:null,mainForm:null},initialize:function(A){this.setOptions(A);this.pids=this.getPassedIds(window.location.href)||[];this.setUpForm();},setUpForm:function(){this.initForm();this.initPageLinks();this.initCheckboxes();},initForm:function(){this.options.mainForm.addEvent("submit",function(A){this.fauxSubmit(A);}.bind(this));if(this.options.submitLinks){this.options.submitLinks.each(function(A){A.addEvent("click",function(B){this.fauxSubmit(B);}.bind(this));}.bind(this));}},fauxSubmit:function(B){if(B){B.stop();}if(this.pids.length<2){alert("Please select two or more products to compare.");return ;}var C=this.options.mainForm.action;C+=(C.contains("?"))?"&":"?";C+=this.getPidString();try{var A=new DWTrack(B.target||this.options.mainForm,{autoAppend:false}).getTag();if(A!=""){C+="&"+A;}}catch(B){}window.location=C;},initPageLinks:function(){this.options.alterLinks.each(function(A){if(A.getProperty("href")&&A.getProperty("href").contains("/1770-")){A.addEvent("click",function(C){var B=A.getProperty("href");if(B.match(/\?/)){B=B.replace(/\&*id=[0-9]+/g,"");B=B.replace("?&","?");}if(this.pids.length){B+=(B.match(/\?/))?"&":"?";B+=this.getPidString();}A.setProperty("href",B);}.bind(this));}},this);},initCheckboxes:function(){var A=this.options.mainForm.getElements("input");A=A.filter(function(B){return(B.type=="checkbox");});A.each(function(B){B.addEvent("click",function(){if(B.checked){this.togglePids(B.value,"add");}else{this.togglePids(B.value,"remove");}}.bind(this));if(B.checked){this.pids.include(B.value);}if(this.pids.contains(B.value)){B.checked="checked";}}.bind(this));},togglePids:function(A,B){B=B||null;if(!B){B=(this.pids.contains(A))?"remove":"add";}if(B=="add"){this.pids.include(A);}else{this.pids.erase(A);}},getPidString:function(){if(!this.pids.length){return null;}var B="";for(var A=0;A<this.pids.length;A++){B+="id="+this.pids[A];if(A<this.pids.length-1){B+="&";}}return B;},getPassedIds:function(A){var B=A.match(/id=([0-9]+)/g);if(B){B=B.map(function(C){return C.replace("id=","");});return B;}return null;}});String.implement({cleanQueryString:function(A){return this.split("&").filter(A||function(B){return $chk(B.split("=")[1]);}).join("&");}});var cleanSubmit=function(C){C=$(C);var A=C.get("action");var B=C.toQueryString().cleanQueryString();window.location=A+((A.contains("?"))?"&":"?")+B;};function setSearchType(A){if(A){var B=A.form.getElement("input[name=searchtype]");if(B){B.setProperty("value",$(A[A.selectedIndex]).get("searchType")||"");}}}function setFilter(A){if(A){var C=A.form.getElement("input[name=filter]");var B=A.form.getElement("input[name=filterName]");if(C){C.setProperty("value",$(A[A.selectedIndex]).get("filter")||"");}if(B){B.setProperty("value",$(A[A.selectedIndex]).get("filter")||"");}}}if(!UserLists){var UserLists={};UserLists.Manager={listForms:new Hash({}),getUserListModal:function(B,A){dbug.log("getUserListModal");CURS.Manager.checkLogin({loginHed:"Log in to CNET to add this product to a list",registerHed:"Join CNET to add this product to a list",appId:222,cval:"userlist",nextAction:function(){if(B=="AddToList"||B=="CreateList"){UserLists.Manager.initListAssetData(A);}UserLists.Manager.getUserListFiles(B);}.bind(UserLists)});},getUserListFiles:function(A){var B;if(dbug.enabled||Browser.qs.jsdebug){if(CBSi.jsdebug){if(CBSi.jsdebug=="true"){B="http://publish.cnet.com:8100/html/rb/js/tron/techtracker/techtracker.tron.userlists.process.js";}else{B="http://publish.cnet.com:8100/html/rb/js/~dev/"+CBSi.jsdebug+"/techtracker/techtracker.tron.userlists.process.js";}}else{B="http://i.i.com.com/cnwk.1d/html/rb/js/tron/techtracker/techtracker.tron.userlists.process.compressed.js";}}else{B="http://i.i.com.com/cnwk.1d/html/rb/js/tron/techtracker/techtracker.tron.userlists.process.compressed.js";}if(!UserLists.Process){new Asset.javascript(B,{id:"userListsProcess",onload:(!A)?function(){}:this.getUserListModalHtml.bind(this,A)});}else{if(A){this.getUserListModalHtml(A);}}},startProcess:function(A){dbug.log("start user list process");if(UserLists.Process&&$("userListShell")){UserLists.Process.showUserListForm(A);}},getUserListModalHtml:function(B){dbug.log("getUserListModalHtml");var A=new Hash();UserLists.UserListData.listItemsToAdd.each(function(C){if(C.assetTypeId==2){A.extend({techProductId:true});}else{if(C.assetTypeId==24){A.extend({softwareProductId:true});}}});if(!document.body.getElement(".globalModal.userList")){new Element("div",{id:"userListShell",styles:{display:"none"}}).inject(document.body);new Request({url:"/8690-4_"+PageVars.get("siteId")+"-0.html?nomesh&"+$time(),data:A,method:"get",onSuccess:function(C){$("userListShell").set("html",C);if($("userHasLists")){UserLists.Manager.userHasLists=true;}UserLists.Process.showUserListForm(B);}.bind(UserLists)}).send();}else{UserLists.Process.showUserListForm(B);}},initFormValidator:function(A){UserLists.Manager.listForms[A].validator=new UserListFormValidator($(A).getElement("form"),{evaluateFieldsOnBlur:false,evaluateFieldsOnChange:false,evaluateOnSubmit:false,errorPrefix:""});},initListAssetData:function(A){dbug.log("init data");UserLists.UserListData.listItemsToAdd.empty();UserLists.Manager.cvalTarget=(!A.getParent(".contentTools"))?"button":"link";if(!A.length){A=[A];}A.each(function(C){var B={assetId:C.getProperty("productId").toInt(),assetTypeId:C.getProperty("productType").toInt(),name:C.getProperty("productName"),image:C.getProperty("productImage")};if(C.getProperty("productSetId")){B.productSetId=C.getProperty("productSetId").toInt();}UserLists.UserListData.listItemsToAdd.push(B);});},pingDW:function(A,B,C){new Jlogger({tag:A,element:false,ctype:B,cval:C}).ping();}};UserLists.ListItem={getItemAssetId:function(A){if(UserLists.ListItem.assetId){return UserLists.ListItem.assetId;}else{if(A){return A;}}},getItemAssetTypeId:function(A){if(UserLists.ListItem.assetTypeId){return UserLists.ListItem.assetTypeId;}else{if(A){return A;}}},getItemName:function(A){if(UserLists.ListItem.assetName){return UserLists.ListItem.assetName;}else{if(A){return A;}}},getDownloadProductSetId:function(A){if(UserLists.ListItem.productSetId){return UserLists.ListItem.productSetId;}else{if(A){return A;}}},getItemImage:function(A){if(UserLists.ListItem.assetImage){return UserLists.ListItem.assetImage;}else{if(A){return A;}}}};UserLists.UserListData={userListDataObj:new Hash(),addToListLaunchTarget:new Hash(),listItemsToAdd:[],listsAddedTo:[],addToDataObj:function(B,A){UserLists.UserListData.userListDataObj.extend({field:decodeURIComponent(A)});},getListId:function(){if(PageVars.get("pageType")==3460){if(PageVars.get("assetId")!=0){return PageVars.get("assetId");}else{return $("editList").getElement("input[name=listId]").get("value");}}}};}window.addEvent("domready",function(){var B=new Element("div",{id:"emailSearchForm"}).set("html",'<h2>Please tell us what information you were looking for. Your comments will help us improve your search experience.<a class="closeModal"></a></h2><form action="/8731-1_1-0.xml?nomesh&viewType=json" method="post"><p>Your e-mail address: <input type="text" name="userEmail" size="30" class="validate-email minLength" validatorProps="{minLength:1}" /></p><p>Submit your question or comment here: <textarea rows="4" cols="30" name="bodyBox" id="bodyBox" class="minLength maxLength" validatorProps="{minLength:10, maxLength:1500}"></textarea><span class="bodyCount">0</span> <span>of 1500 characters</span></p><input type="hidden" name="aboutUs" value="false"/><input type="hidden" name="subject" value=""/><input type="hidden" name="body" value=""/><input type="hidden" name="ursRegId" value=""/><span id="captcha"></span><b class="flexButton"><input type="submit" class="submit" value="Send E-mail"/></b></form>');var A=new ModalForm("span.feedback .emailLink",{reauthenticate:false,counterFields:{field:["textarea[name=bodyBox]"],counter:[".bodyCount"]},popupContents:B,modalId:"emailSearch",resetOnClose:true,clearOnReset:true,useCaptcha:true,onFormSubmitSuccess:function(D){if(D){var F=JSON.decode(D).response;if(F.result["$"]=="failure"){if($$(".emailFail").length>0){var E=$$(".emailFail")[0];}else{var E=new Element("div",{"class":"validation-advice emailFail"});}E.set("html","<b>Error: </b>"+F.message["$"]);if(F.message["$"]=="You did not successfully enter the characters in the verification box."){E.inject($("captcha"),"before");}else{E.inject($("emailSearch").getElement("form"),"before");}this.getCaptcha();}else{if(F.result["$"]=="success"){var C=new Element("div",{"class":"emailSuccess"}).set("html","Thank you. "+F.message["$"]);C.inject($("emailSearch").getElement("form"),"before");if($$(".emailFail").length>0){$$(".emailFail").dispose();}$("emailSearch").getElements("form, p").setStyle("display","none");this.modalForm.hide.delay(4000,this.modalForm);}}}},onFormSubmitFail:function(){dbug.log("form not sent");}});$$("span.feedback").each(function(C){if(C.getElement(".emailLink")){C.getElement(".emailLink").addEvent("click",function(){var D=this.getProperty("name");$("emailSearchForm").getElement("input[name=ursRegId]").set("value",this.getProperty("regId"));$("emailSearchForm").getElement("input[name=subject]").set("value","Search Feedback ["+this.getProperty("searchType")+"] "+D);$("bodyBox").addEvent("change",function(){var E=$("bodyBox");$("emailSearchForm").getElement("input[name=body]").set("value","Full page URL: "+location.href+"\nProduct found? (Yes/No):"+D+"\nComments provided:"+E.value);});});}});});var ModalForm=new Class({Implements:Options,options:{modalId:"",popupContents:"default",counterFields:null,resetOnClose:false,clearOnReset:false,useCaptcha:false,onFormSubmitSuccess:"",onFormSubmitFail:"",requireLogin:false},initialize:function(B,A){this.setOptions(A);this.element=$$(B);this.initModalForm();},initModalForm:function(){dbug.log("init modal");this.modalForm=new GlobalModal({id:this.options.modalId,content:$(this.options.popupContents).toggleClass("globalModal"),onClose:function(){if(this.options.resetOnClose){this.resetForm();}}.bind(this)});this.form=$(this.options.modalId).getElement("form");this.modalFormValidator=new ModalFormValidator(this.form,{evaluateFieldsOnBlur:false,evaluateFieldsOnChange:false,evaluateOnSubmit:false});this.form.addEvent("submit",function(A){A.stop();if(!this.modalFormValidator.validate()){return ;}new ModalFormRequest({url:this.form.get("action"),data:this.form.toQueryString(),onSuccess:this.options.onFormSubmitSuccess.bind(this),onFailure:this.options.onFormSubmitFail.bind(this)}).send();}.bind(this));if(this.options.counterFields!=null){this.options.counterFields.field.each(function(B,A){this.fieldCounter(this.form.getElement(B),this.form.getElement(this.options.counterFields.counter[A]));}.bind(this));}$$(this.element).addEvent("click",function(){dbug.log("click");if(this.options.requireLogin){if(!UserVars.isLoggedIn()){CURS.Manager.checkLogin({loginHed:"Log in to CNET to report this profile",registerHed:"Join CNET to report this profile",appId:103,nextAction:function(){new Jlogger({tag:"ropProfile",element:false,ctype:"overlay;source",cval:"login;rop"}).ping();this.showModalForm.bind(this);}.bind(this)});}else{this.showModalForm();}}else{this.showModalForm();}}.bind(this));},showModalForm:function(){if(this.options.useCaptcha){this.getCaptcha();}this.modalForm.show();},resetForm:function(){this.modalFormValidator.reset();this.modalFormValidator.paused=false;this.form.setStyle("display","block");this.form.getParent().getElements(".emailSuccess, .emailFail").dispose();if(this.form.getElement("p span")){this.form.getElement("p span").set("text","0");this.form.getElement("p span").removeClass("validation-advice");}if(this.options.clearOnReset){this.form.reset();}},getCaptcha:function(){new Request({method:"get",url:"/8708-5_1-0.html?CAPTCHA=id&nomesh&refresh="+new Date().getTime(),onComplete:function(A){if(A){var B=A.trim();$exec(B);var C=new Element("a",{href:"javascript:void(0);","class":"refreshCaptcha",id:"getCaptchaCode"}).set("text","Try a new code");C.addEvent("click",function(){this.getCaptcha();}.bind(this));C.inject($$("#captcha input")[0],"after");$("captcha").getElement("input[name=CAPTCHA_RESPONSE]").addClass("required");}}.bind(this)}).send();},fieldCounter:function(A,C){var B=A.get("validatorProps");if(!B){return ;}B=JSON.decode(B);if(!B&&!B.maxLength){return ;}this.updateCounter(A,B,C);A.addEvent("keyup",function(){this.updateCounter(A,B,C);}.bind(this));},updateCounter:function(B,C,D){var A=B.value.trim().length;D.set("text",A);if((A<(C.minLength||0))||(A>C.maxLength)){D.addClass("validation-advice");}else{D.removeClass("validation-advice");}}});var ModalFormRequest=new Class({Extends:Request,processScripts:function(A){if(this.options.evalResponse){return $exec(A);}return A.stripScripts(this.options.evalScripts);}});var ModalFormValidator=new Class({Extends:FormValidator,makeAdvice:function(D,F,C,G){var E=(G)?this.options.warningPrefix:this.options.errorPrefix;E+=(this.options.useTitles)?F.title||C:C;var B=this.getAdvice(D,F);if(!B){var A=(G)?"warning-advice":"validation-advice";B=new Element("div",{text:E,styles:{display:"none"},id:"advice-"+D+"-"+this.getFieldId(F)}).addClass(A);}else{B.set("text",E);}return B;}});window.addEvent("domready",function(){$$(".edRate a.toolTipElement").each(function(A){var B=A.getParent("li").getElement("ul.data");if(B){A.store("tip:text",B.getParent().get("html"));}else{A.store("tip:text","Product summary not available");}});$$(".addToList").each(function(A){A.addEvent("click",function(){UserLists.Manager.getUserListModal("AddToList",A);});});});
   }
       