//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.
//example: dbugScripts("/the/location/of/my/scripts/",["script1.js","script2.js","etc"])
//returns true if scripts are included, otherwise false.
if(!dbugScripts("http://c18-x-publish1.cnet.com:8100/html/rb/js/tiburon/cat/",["dfll.js"])){
/* begin packed code */
var CompareProducts=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(e){this.fauxSubmit(e)}.bind(this));if(this.options.submitLinks){this.options.submitLinks.each(function(a){a.addEvent('click',function(e){this.fauxSubmit(e)}.bind(this))}.bind(this))}},fauxSubmit:function(e){e=(e)?new Event(e).stop():null;if(this.pids.length<2){alert('Please select two or more products to compare.');return}var a=this.options.mainForm.action;a+=(a.contains('?'))?"&":"?";a+=this.getPidString();try{var b=new DWTrack(e.target||this.options.mainForm,{autoAppend:false}).getTag();if(b!='')a+="&"+b}catch(e){}window.location=a},initPageLinks:function(){this.options.alterLinks.each(function(b){if(b.getProperty('href')&&b.getProperty('href').contains('/4566-')){b.addEvent('click',function(e){var a=b.getProperty('href');if(a.match(/\?/)){a=a.replace(/\&*id=[0-9]+/g,'');a=a.replace('?&','?')}if(this.pids.length){a+=(a.match(/\?/))?'&':'?';a+=this.getPidString()}b.setProperty('href',a)}.bind(this))}},this)},initCheckboxes:function(){var b=this.options.mainForm.getElements('input');b=b.filter(function(a){return(a.type=='checkbox')});b.each(function(a){a.addEvent('click',function(){if(a.checked){this.togglePids(a.value,'add')}else{this.togglePids(a.value,'remove')}}.bind(this));if(a.checked)this.pids.include(a.value);if(this.pids.contains(a.value))a.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.remove(a)},getPidString:function(){if(!this.pids.length)return null;var a='';for(var i=0;i<this.pids.length;i++){a+="id="+this.pids[i];if(i<this.pids.length-1)a+="&"}return a},getPassedIds:function(b){var c=b.match(/id=([0-9]+)/g);if(c){c=c.map(function(a){return a.replace('id=','')});return c}return null}});

/* end packed code */
} //end debug scripts
