//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/rbcomments/cat/",["rbcomments.global.framework.js"])){

/* begin packed code */
var Modalizer=new Class({defaultModalStyle:{display:'block',position:'fixed',top:'0px',left:'0px','z-index':5000,'background-color':'#333',opacity:0.8},setModalOptions:function(options){this.modalOptions=$merge({width:(window.getScrollWidth()+300)+'px',height:(window.getScrollHeight()+300)+'px',elementsToHide:'select',onModalHide:Class.empty,onModalShow:Class.empty,hideOnClick:true,modalStyle:{},updateOnResize:true},this.modalOptions,options||{})},resize:function(){if($('modalOverlay')){$('modalOverlay').setStyles({width:(window.getScrollWidth()+300)+'px',height:(window.getScrollHeight()+300)+'px'})}},setModalStyle:function(styleObject){this.modalOptions.modalStyle=styleObject;this.modalStyle=$merge(this.defaultModalStyle,{width:this.modalOptions.width,height:this.modalOptions.height},styleObject);if($('modalOverlay'))$('modalOverlay').setStyles(this.modalStyle);return(this.modalStyle)},modalShow:function(options){this.setModalOptions(options||{});var overlay=null;if($('modalOverlay'))overlay=$('modalOverlay');if(!overlay)overlay=new Element('div').setProperty('id','modalOverlay').injectInside(document.body);overlay.setStyles(this.setModalStyle(this.modalOptions.modalStyle));if(window.ie6)overlay.setStyle('position','absolute');$('modalOverlay').removeEvents('click').addEvent('click',function(){this.modalHide(this.modalOptions.hideOnClick)}.bind(this));this.bound=this.bound||{};if(!this.bound.resize&&this.modalOptions.updateOnResize){this.bound.resize=this.resize.bind(this);window.addEvent('resize',this.bound.resize)}this.modalOptions.onModalShow();this.togglePopThroughElements(0);overlay.setStyle('display','block');return this},modalHide:function(override){if(override===false)return false;this.togglePopThroughElements(1);this.modalOptions.onModalHide();if($('modalOverlay'))$('modalOverlay').setStyle('display','none');if(this.modalOptions.updateOnResize){this.bound=this.bound||{};if(!this.bound.resize)this.bound.resize=this.resize.bind(this);window.removeEvent('resize',this.bound.resize)}return this},togglePopThroughElements:function(opacity){if((window.ie6||(window.gecko&&navigator.userAgent.test('mac','i')))){$$(this.modalOptions.elementsToHide).each(function(sel){sel.setStyle('opacity',opacity)})}}});var modalizer=Modalizer;Fx.SmoothShow=Fx.Styles.extend({options:{styles:['padding','border','margin'],transitionOpacity:true,mode:'vertical',heightOverride:null,widthOverride:null},fixStyle:function(style,name){if(!$type(style)=="number")return style;var fix=['margin','padding','width','height'].some(function(st){return name.test(st,'i')});return(fix)?style+'px':style},hide:function(){try{if(!this.hiding&&!this.showing){if(this.element.getStyle('display')!='none'){this.hiding=true;this.showing=false;this.hidden=true;var startStyles=this.element.getComputedSize({styles:this.options.styles,mode:this.options.mode});if(this.element.fxOpacityOk()&&this.options.transitionOpacity)startStyles.opacity=1;var zero={};$each(startStyles,function(style,name){zero[name]=this.fixStyle(0,name)},this);this.chain(function(){if(this.hidden){this.hiding=false;$each(startStyles,function(style,name){startStyles[name]=this.fixStyle(style,name)},this);this.element.setStyles(startStyles).setStyle('display','none')}this.callChain()}.bind(this));this.start(zero)}else{this.callChain.delay(10,this);this.fireEvent('onComplete',this.element)}}}catch(e){this.element.hide();this.callChain.delay(10,this);this.fireEvent('onComplete',this.element)}return this},show:function(){try{if(!this.showing&&!this.hiding){if(this.element.getStyle('display')=="none"||this.element.getStyle('visiblity')=="hidden"||this.element.getStyle('opacity')==0){this.showing=true;this.hiding=false;this.hidden=false;var before=this.element.getStyles('visibility','display','position');this.element.setStyles({visibility:'hidden',display:'block',position:'absolute'});if(this.element.fxOpacityOk()&&this.options.transitionOpacity)this.element.setStyle('opacity',0);var startStyles=this.element.getComputedSize({styles:this.options.styles,mode:this.options.mode});this.element.setStyles(before);$each(startStyles,function(style,name){startStyles[name]=this.fixStyle(style,name)},this);if($chk(this.options.heightOverride))startStyles['height']=this.options.heightOverride.toInt()+'px';if($chk(this.options.widthOverride))startStyles['width']=this.options.widthOverride.toInt()+'px';if(this.element.fxOpacityOk()&&this.options.transitionOpacity)startStyles.opacity=1;var zero={height:'0px',display:'block'};$each(startStyles,function(style,name){zero[name]=this.fixStyle(0,name)},this);this.element.setStyles(zero);this.start(startStyles);this.chain(function(){if(!this.hidden)this.showing=false;this.callChain()}.bind(this))}else{this.callChain();this.fireEvent('onComplete',this.element)}}}catch(e){this.element.setStyles({display:'block',visiblity:'visible',opacity:1});this.callChain.delay(10,this);this.fireEvent('onComplete',this.element)}return this},toggle:function(){try{if(this.element.getStyle('display')=="none"||this.element.getStyle('visiblity')=="hidden"||this.element.getStyle('opacity')==0){this.show()}else{this.hide()}}catch(e){this.show()}return this}});Fx.SmoothShow.implement(new Options);Fx.SmoothShow.implement(new Events);Element.extend({smoothShow:function(options){if(arguments[1]){options.heightOverride=arguments[1]}return new Fx.SmoothShow(this,options).show()},smoothHide:function(options){if(arguments[1]){options.heightOverride=arguments[1]}return new Fx.SmoothShow(this,options).hide()}});Fx.Scroll=Fx.Base.extend({options:{overflown:[],offset:{'x':0,'y':0},wheelStops:true},initialize:function(element,options){this.now=[];this.element=$(element);this.bound={'stop':this.stop.bind(this,false)};this.parent(options);if(this.options.wheelStops){this.addEvent('onStart',function(){document.addEvent('mousewheel',this.bound.stop)}.bind(this));this.addEvent('onComplete',function(){document.removeEvent('mousewheel',this.bound.stop)}.bind(this))}},setNow:function(){for(var i=0;i<2;i++)this.now[i]=this.compute(this.from[i],this.to[i])},scrollTo:function(x,y){if(this.timer&&this.options.wait)return this;var el=this.element.getSize();var values={'x':x,'y':y};for(var z in el.size){var max=el.scrollSize[z]-el.size[z];if($chk(values[z]))values[z]=($type(values[z])=='number')?values[z].limit(0,max):max;else values[z]=el.scroll[z];values[z]+=this.options.offset[z]}return this.start([el.scroll.x,el.scroll.y],[values.x,values.y])},toTop:function(){return this.scrollTo(false,0)},toBottom:function(){return this.scrollTo(false,'full')},toLeft:function(){return this.scrollTo(0,false)},toRight:function(){return this.scrollTo('full',false)},toElement:function(el){var parent=this.element.getPosition(this.options.overflown);var target=$(el).getPosition(this.options.overflown);return this.scrollTo(target.x-parent.x,target.y-parent.y)},increase:function(){this.element.scrollTo(this.now[0],this.now[1])}});var SmoothScroll=Fx.Scroll.extend({initialize:function(options){this.parent(window,options);this.links=(this.options.links)?$$(this.options.links):$$(document.links);var location=window.location.href.match(/^[^#]*/)[0]+'#';this.links.each(function(link){if(link.href.indexOf(location)!=0)return;var anchor=link.href.substr(location.length);if(anchor&&$(anchor))this.useLink(link,anchor)},this);if(!window.webkit419)this.addEvent('onComplete',function(){window.location.hash=this.anchor})},useLink:function(link,anchor){link.addEvent('click',function(event){this.anchor=anchor;this.toElement(anchor);event.stop()}.bindWithEvent(this))}});var simpleTemplateParser={STP:{},parseTemplate:function(template,object,regexOptions,wrappers){var STP=this.STP;STP.template=template;STP.object=object;STP.regexOptions=$pick(regexOptions,'ig');STP.wrappers=$pick(wrappers,{before:'%',after:'%'});return STP.result=this.runParser(STP.object,STP.template,STP.regexOptions)},runParser:function(object,string,regexOptions){for(value in object){switch($type(object[value])){case'string':string=this.tmplSubst(value,object[value],string,regexOptions);break;case'number':string=this.tmplSubst(value,object[value],string,regexOptions);break;case'object':string=this.runParser(object[value]);break;case'array':string=this.tmplSubst(value,object[value].toString(),string,regexOptions);break}}return string},tmplSubst:function(key,value,string,regexOptions){return string.replace(new RegExp(this.STP.wrappers.before+key+this.STP.wrappers.after,'gi'),value)}};var InputValidator=new Class({initialize:function(className,options){this.setOptions({errorMsg:'Validation failed.',test:function(field){return true}},options);this.className=className},test:function(field){if($(field))return this.options.test($(field),this.getProps(field));else return false},getError:function(field){var err=this.options.errorMsg;if($type(err)=="function")err=err($(field),this.getProps(field));return err},getProps:function(field){if($(field)&&$(field).getProperty('validatorProps')){try{return Json.evaluate($(field).getProperty('validatorProps'))}catch(e){return{}}}else{return{}}}});InputValidator.implement(new Options);var FormValidator=new Class({options:{fieldSelectors:"input, select, textarea",useTitles:false,evaluateOnSubmit:true,evaluateFieldsOnBlur:true,evaluateFieldsOnChange:true,serial:true,warningPrefix:"Warning: ",errorPrefix:"Error: ",onFormValidate:function(isValid,form){},onElementValidate:function(isValid,field){}},initialize:function(form,options){this.setOptions(options);try{this.form=$(form);if(this.options.evaluateOnSubmit)this.form.addEvent('submit',this.onSubmit.bind(this));if(this.options.evaluateFieldsOnBlur)this.watchFields()}catch(e){}},getFields:function(){return this.fields=this.form.getElementsBySelector(this.options.fieldSelectors)},watchFields:function(){try{this.getFields().each(function(el){el.addEvent('blur',this.validateField.pass([el,false],this));if(this.options.evaluateFieldsOnChange)el.addEvent('change',this.validateField.pass([el,true],this))},this)}catch(e){}},onSubmit:function(event){if(!this.validate(event))new Event(event).stop();else{this.stop();this.reset()}},reset:function(){this.getFields().each(this.resetField,this)},validate:function(event){var result=this.getFields().map(function(field){return this.validateField(field,true)},this);result=result.every(function(val){return val});this.fireEvent('onFormValidate',[result,this.form,event]);return result},validateField:function(field,force){if(this.paused)return true;field=$(field);var result=true;var failed=this.form.getElement('.validation-failed');var warned=this.form.getElement('.warning');if(field&&(!failed||force||field==failed||(failed&&!this.options.serial))){var validators=field.className.split(" ").some(function(cn){return this.getValidator(cn)},this);result=field.className.split(" ").map(function(className){return this.test(className,field)},this);result=result.every(function(val){return val});if(validators&&!field.hasClass('warnOnly')){if(result)field.addClass('validation-passed').removeClass('validation-failed');else field.addClass('validation-failed').removeClass('validation-passed')}if(!warned||force||(warned&&!this.options.serial)){var warnings=field.className.split(" ").some(function(cn){if(cn.test('^warn-')||field.hasClass('warnOnly'))return this.getValidator(cn.replace(/^warn-/,""));return null},this);field.removeClass('warning');var warnResult=field.className.split(" ").map(function(cn){if(cn.test('^warn-')||field.hasClass('warnOnly'))return this.test(cn.replace(/^warn-/,""),field,true);return null},this)}}return result},getPropName:function(className){return'__advice'+className},test:function(className,field,warn){if(field.hasClass('ignoreValidation'))return true;warn=$pick(warn,false);if(field.hasClass('warnOnly'))warn=true;field=$(field);var isValid=true;if(field){var validator=this.getValidator(className);if(validator&&this.isVisible(field)){isValid=validator.test(field);if(!isValid&&validator.getError(field)){if(warn)field.addClass('warning');var advice=this.makeAdvice(className,field,validator.getError(field),warn);this.insertAdvice(advice,field);this.showAdvice(className,field)}else this.hideAdvice(className,field);this.fireEvent('onElementValidate',[isValid,field])}}if(warn)return true;return isValid},showAdvice:function(className,field){var advice=this.getAdvice(className,field);if(advice&&!field[this.getPropName(className)]&&(advice.getStyle('display')=="none"||advice.getStyle('visiblity')=="hidden"||advice.getStyle('opacity')==0)){field[this.getPropName(className)]=true;if(advice.smoothShow)advice.smoothShow();else advice.setStyle('display','block')}},hideAdvice:function(className,field){var advice=this.getAdvice(className,field);if(advice&&field[this.getPropName(className)]){field[this.getPropName(className)]=false;if(advice.smoothHide)advice.smoothHide();else advice.setStyle('display','none')}},isVisible:function(field){while(field.tagName!='BODY'){if($(field).getStyle('display')=="none")return false;field=field.parentNode}return true},getAdvice:function(className,field){return $('advice-'+className+'-'+this.getFieldId(field))},makeAdvice:function(className,field,error,warn){var errorMsg=(warn)?this.options.warningPrefix:this.options.errorPrefix;errorMsg+=(this.options.useTitles)?$pick(field.title,error):error;var advice=this.getAdvice(className,field);if(!advice){var cssClass=(warn)?'warning-advice':'validation-advice';advice=new Element('div').addClass(cssClass).setProperty('id','advice-'+className+'-'+this.getFieldId(field)).setStyle('display','none').appendText(errorMsg)}else{advice.setHTML(errorMsg)}return advice},insertAdvice:function(advice,field){switch(field.type.toLowerCase()){case'radio':var p=$(field.parentNode);if(p){p.adopt(advice);break}default:advice.injectAfter($(field))}},getFieldId:function(field){return field.id?field.id:field.id="input_"+field.name},resetField:function(field){field=$(field);if(field){var cn=field.className.split(" ");cn.each(function(className){if(className.test('^warn-'))className=className.replace(/^warn-/,"");var prop=this.getPropName(className);if(field[prop])this.hideAdvice(className,field);field.removeClass('validation-failed');field.removeClass('warning');field.removeClass('validation-passed')},this)}},stop:function(){this.paused=true},start:function(){this.paused=false},ignoreField:function(field,warn){field=$(field);if(field){this.enforceField(field);if(warn)field.addClass('warnOnly');else field.addClass('ignoreValidation')}},enforceField:function(field){field=$(field);if(field){field.removeClass('warnOnly');field.removeClass('ignoreValidation')}}});FormValidator.implement(new Options);FormValidator.implement(new Events);FormValidator.adders={validators:{},add:function(className,options){this.validators[className]=new InputValidator(className,options);if(!this.initialize){this.implement({validators:this.validators})}},addAllThese:function(validators){$A(validators).each(function(validator){this.add(validator[0],validator[1])},this)},getValidator:function(className){return this.validators[className]}};Object.extend(FormValidator,FormValidator.adders);FormValidator.implement(FormValidator.adders);FormValidator.add('IsEmpty',{errorMsg:false,test:function(element){if(element.type=="select-one"||element.type=="select")return!(element.selectedIndex>=0&&element.options[element.selectedIndex].value!="");else return((element.getValue()==null)||(element.getValue().length==0))}});FormValidator.addAllThese([['required',{errorMsg:function(element){return'This field is required.'},test:function(element){return!FormValidator.getValidator('IsEmpty').test(element)}}],['minLength',{errorMsg:function(element,props){if($type(props.minLength))return'Please enter at least '+props.minLength+' characters (you entered '+element.getValue().length+' characters).';else return''},test:function(element,props){if($type(props.minLength))return(element.getValue().length>=$pick(props.minLength,0));else return true}}],['maxLength',{errorMsg:function(element,props){if($type(props.maxLength))return'Please enter no more than '+props.maxLength+' characters (you entered '+element.getValue().length+' characters).';else return''},test:function(element,props){return(element.getValue().length<=$pick(props.maxLength,10000))}}],['validate-number',{errorMsg:'Please enter a valid number in this field.',test:function(element){return FormValidator.getValidator('IsEmpty').test(element)||!/[^\d+$]/.test(element.getValue())}}],['validate-digits',{errorMsg:'Please use numbers only in this field. Please avoid spaces or other characters such as dots or commas.',test:function(element){return FormValidator.getValidator('IsEmpty').test(element)||(/[^a-zA-Z]/.test(element.getValue())&&/[\d]/.test(element.getValue()))}}],['validate-alpha',{errorMsg:'Please use letters only (a-z) in this field.',test:function(element){return FormValidator.getValidator('IsEmpty').test(element)||/^[a-zA-Z]+$/.test(element.getValue())}}],['validate-alphanum',{errorMsg:'Please use only letters (a-z) or numbers (0-9) only in this field. No spaces or other characters are allowed.',test:function(element){return FormValidator.getValidator('IsEmpty').test(element)||!/\W/.test(element.getValue())}}],['validate-date',{errorMsg:'Please use this date format: mm/dd/yyyy. For example 03/17/2006 for the 17th of March, 2006.',test:function(element){if(FormValidator.getValidator('IsEmpty').test(element))return true;var regex=/^(\d{2})\/(\d{2})\/(\d{4})$/;if(!regex.test(element.getValue()))return false;var d=new Date(element.getValue().replace(regex,'$1/$2/$3'));return(parseInt(RegExp.$1,10)==(1+d.getMonth()))&&(parseInt(RegExp.$2,10)==d.getDate())&&(parseInt(RegExp.$3,10)==d.getFullYear())}}],['validate-email',{errorMsg:'Please enter a valid email address. For example fred@domain.com .',test:function(element){return FormValidator.getValidator('IsEmpty').test(element)||/\w{1,}[@][\w\-]{1,}([.]([\w\-]{1,})){1,3}$/.test(element.getValue())}}],['validate-url',{errorMsg:'Please enter a valid URL.',test:function(element){return FormValidator.getValidator('IsEmpty').test(element)||/^(http|https|ftp|rmtp|mms):\/\/(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+)(:(\d+))?\/?/i.test(element.getValue())}}],['validate-date-au',{errorMsg:'Please use this date format: dd/mm/yyyy. For example 17/03/2006 for the 17th of March, 2006.',test:function(element){if(FormValidator.getValidator('IsEmpty').test(element))return true;var regex=/^(\d{2})\/(\d{2})\/(\d{4})$/;if(!regex.test(element.getValue()))return false;var d=new Date(element.getValue().replace(regex,'$2/$1/$3'));return(parseInt(RegExp.$2,10)==(1+d.getMonth()))&&(parseInt(RegExp.$1,10)==d.getDate())&&(parseInt(RegExp.$3,10)==d.getFullYear())}}],['validate-currency-dollar',{errorMsg:'Please enter a valid $ amount. For example $100.00 .',test:function(element){return FormValidator.getValidator('IsEmpty').test(element)||/^\$?\-?([1-9]{1}[0-9]{0,2}(\,[0-9]{3})*(\.[0-9]{0,2})?|[1-9]{1}\d*(\.[0-9]{0,2})?|0(\.[0-9]{0,2})?|(\.[0-9]{1,2})?)$/.test(element.getValue())}}],['validate-one-required',{errorMsg:'Please enter something for at least one of the above options.',test:function(element){var p=element.parentNode;var options=p.getElements('input');return $A(options).some(function(el){return el.getValue()})}}]]);var CommentsLogin={};CommentsLogin.manage=new Class({loggedIn:false,initialize:function(){window.addEvent('domready',function(){this.loggedIn=UserVars.loggedIn||false;if(this.loggedIn){this.enactEvents()}}.bind(this))},onceLoggedIn:function(userStats){UserVars=new LocalVars.UserVars({loggedIn:'1',rememberMe:(userStats['rememberMe']=='false')?'0':'1',ursRegId:userStats['registrationId'],userName:userStats['userName']});new CommentsLogin.updateStatus;this.enactEvents();return this},enactEvents:function(){this.fireEvent('onLogin');this.addEvent=function(type,fn){if(type=="onLogin")fn();else dbug.log("No longer accepting non-onLogin events.\nYou attempted to add a \"%s\" event: %s",type,fn.toString())};return this}});CommentsLogin.manage.implement(new Events);CommentsLogin.manager=new CommentsLogin.manage;CommentsLogin.checkLogin=new Class({options:{regUrl:'/8612-4-0.htm?formtype=register',loginUrl:'/8612-4-0.htm?formtype=login',shell:'fixedCommentBox'},initialize:function(how,options){this.setOptions(options);if(how=='login'){if(!CommentsLogin.login)this.getForm(how);else CommentsLogin.login.show()}else if(how=='register'){if(!CommentsLogin.register)this.getForm(how);else CommentsLogin.register.show()}},getForm:function(how){var url=(how=='login')?this.options.loginUrl:this.options.regUrl;var getCode=new Ajax(url,{evalScripts:(!window.gecko),onComplete:function(response){try{var holding=new Element('div').setHTML(response);holding.getChildren().each(function(aChild){aChild.injectInside((aChild.nodeName!="SCRIPT")?$(this.options.shell):document.body)},this)}catch(e){dbug.log(e)}}.bind(this),method:'get'}).request()}});CommentsLogin.checkLogin.implement(new Options);CommentsLogin.updateStatus=new Class({returnPath:null,loggedIn:false,userNameClass:['.cnetUserName'],options:{addNameSelects:[],getProfileLink:null},initialize:function(options){this.loggedIn=UserVars.loggedIn||false;this.setOptions(options);if($type(this.options.getProfileLink)=='function')this.getProfileLink=this.options.getProfileLink();if(this.options.addUserNameSelectors)this.addNameSelectors(this.options.addNameSelects);try{this.returnPath=escape(window.location.href);this.setLoginMode()}catch(e){dbug.log("Failed to initialize login: %s",e)};return this},addNameSelectors:function(selects){if($type(selects)!='array')selects=[selects];$each(selects,function(sel){if(!this.userNameClass.test(sel))this.userNameClass.push(sel)},this)},setLoginMode:function(){if(this.loggedIn){this.writeUserName();try{$('welcomeString').appendText(", ").adopt(new Element('a',{href:this.getProfileLink()}).appendText(UserVars.userNameDisplay));$('uniloginProfile').setProperty('href',this.getProfileLink())}catch(e){dbug.log(e)}try{$('uloginIn').setStyle('display','block');$('uloginOut').setStyle('display','none')}catch(e){dbug.log("Failed to display correct login window: %s",e)}}else{$('uloginIn').setStyle('display','none');$('uloginOut').setStyle('display','block')}},getProfileLink:function(){return(this.loggedIn)?"http://my.cnet.com/community/"+UserVars.userName.replaceAll(' ','+')+"/":null},writeUserName:function(additionalSelectors){if(additionalSelectors)this.addNameSelectors(additionalSelectors);this.userNameClass.each(function(aClass){$$(aClass).each(function(anElem){anElem.adopt(new Element('a',{href:this.getProfileLink()}).appendText(UserVars.userNameDisplay))},this)},this)}});CommentsLogin.updateStatus.implement(new Options);CommentsLogin.updateStatus.implement(new Events);CommentsLogin.FormHandler=new Class({options:{shell:null,formShell:null,targetForm:null,formSubmitUrl:null,formSuccess:null,testResponse:function(response){return true},handleErrors:null,onSuccess:Class.empty},initialize:function(options){this.setOptions(options);this.targetForm=$E(this.options.targetForm);this.formShell=$E(this.options.formShell);this.testResponse=this.options.testResponse;this.setUpValidation();if(this.options.handleErrors)this.handleErrors=this.options.handleErrors;this.targetForm.setProperty('action',this.options.formSubmitUrl);this.targetForm.addEvent('submit',function(e){e=new Event(e).stop();this.clearWarnings();if(!this.validator.validate())return false;this.targetForm.send({onComplete:function(response){this.handleResponse(response)}.bind(this),onRequest:this.setLoading.bind(this),onFailure:this.setGeneralFailure.bind(this)})}.bind(this));this.show()},setUpValidation:function(){this.validator=new FormValidator(this.targetForm)},handleResponse:function(response){try{this.response=eval('('+response+')')}catch(e){this.response=response;this.setGeneralFailure()}if(this.testResponse(this.response)){this.success()}else{this.failure()}},success:function(){dbug.log("firing success event");this.fireEvent('onSuccess');dbug.log("Trying the removal of the loading, etc");try{this.removeLoading();this.formShell.effect('opacity',{duration:250}).start(0).chain(function(){this.formShell.hide();$(this.options.shell).getElement(this.options.formSuccess).setStyles({'display':'block','opacity':0});if(this.options.formSuccess&&$$(this.options.formSuccess)){$(this.options.shell).getElement(this.options.formSuccess).effect('opacity',{duration:250}).start(1)}}.bind(this))}catch(e){dbug.log(e)}},failure:function(){this.removeLoading();this.handleErrors()},handleErrors:function(){if(this.response.errors){var warn=this.getErrorDiv();if($type(this.response.errors)!='array')this.response.errors=[this.response.errors];$each(this.response.errors,function(anError){warn.adopt(new Element('div').appendText(anError.text));$each(anError.field.split("/"),function(aField){if(this.targetForm[aField]){this.targetForm[aField].addClass('warn')}}.bind(this))}.bind(this))}},setGeneralFailure:function(){this.removeLoading();this.getErrorDiv().appendText("We're having trouble contacting our servers. Please try again.")},setLoading:function(){var formDims=this.formShell.getCoordinates();this.loading=new Element('div',{styles:{position:'absolute',width:formDims.width+'px',height:formDims.height+'px',top:formDims.top+'px',left:formDims.left+'px',lineHeight:formDims.height+'px',textAlign:'center',fontWeight:'bold',backgroundColor:'#FFF',opacity:0}}).appendText('Loading').injectInside(document.body);this.loading.effect('opacity',{duration:100}).start(.9)},removeLoading:function(){try{this.loading.effect('opacity',{duration:100}).start(0).chain(function(){this.loading.remove()}.bind(this))}catch(e){dbug.log(e)}},getErrorDiv:function(){return this.formShell.getElement('dd.warn')||new Element('dd',{'class':'warn'}).injectAfter(this.formShell.getElement('dd.dek'))},clearWarnings:function(){var warnings=$(this.options.shell).getElements('.warn');if(!warnings.length)return;warnings.each(function(aWarning){if(aWarning.nodeName=="DD"){aWarning.remove()}else{aWarning.removeClass('warn')}})},show:function(){$(this.options.shell).getChildren().each(function(aChild){aChild.hide()});this.formShell.setStyle('display','block')}});CommentsLogin.FormHandler.implement(new Options);CommentsLogin.FormHandler.implement(new Events);CommentsLogin.forgotPassword=new Class({options:{formId:'forgotPassword',submitUrl:'/1323-4-103.html'},initialize:function(options){this.setOptions(options);this.formShell=$(this.options.formId);this.formShell.action=this.options.submitUrl;this.formShell.path.value=document.location.href;this.validator=new FormValidator(this.options.formId,{evaluateOnSubmit:false});this.formShell.addEvent('submit',function(e){if(e)e=new Event(e).stop();if(!this.validator.validate())return false;this.formShell.send({onComplete:function(response){this.handleResponse(response)}.bind(this)})}.bind(this));this.formShell.getElement('.lostpass').onclick=function(e){try{this.formShell.fireEvent('submit')}catch(error){dbug.log(error)}}.bind(this)},handleResponse:function(response){this.response=response;if(this.response.test('errorDisplay')){this.getErrorDiv().appendText('We have no record of the e-mail address provided. Double check the address for typos or formatting problems.')}else if(this.response.test('nextSteps')){var next=new Element('div',{id:'nextSteps'}).setHTML('<p>Check your inbox for an e-mail from <b>"CNET Membership" &lt;membership@noreply.cnet.com&gt;</b> with the subject <b>"CNET.com Password Assistance"</b>.</p><p class="note">If you don\'t see this e-mail, it may have been mistakenly flagged as spam and placed in a spam/junk mail folder. Follow the instructions in the e-mail to reset your password. If you cannot find this e-mail from us, please contact our <a href="http://cnet.custhelp.com/cgi-bin/cnet.cfg/php/enduser/std_alp.php">customer support.</a></p>');this.formShell.setHTML("").adopt(next)}},getErrorDiv:function(){try{return this.formShell.getElement('div.warn')||new Element('DIV',{'class':'warn'}).injectInside(this.formShell)}catch(e){dbug.log(e)}},clearErrors:function(){this.formShell.getElements('div.warn').each(function(aWarning){aWarning.remove()})}});CommentsLogin.forgotPassword.implement(new Options);CommentsLogin.initLinks=function(links){if($type(links)!="array")links=[links];links.each(function(aLink){aLink.addEvent('click',function(e){if(UserVars.loggedIn||UserVars.rememberMe){openCommentForm(aLink)}else{var pos=$('fixedCommentBox').getPosition();window.scrollTo(pos.x,pos.y);CommentsLogin.manager.addEvent('onLogin',function(){var pos=aLink.getPosition();window.scrollTo(pos.x,pos.y-100);openCommentForm(aLink)})}})})};var openCommentForm=function(aLink){try{var messId=aLink.getProperty('messageid');if(aLink.hasClass('reply')){replyThinger.transform('replyArea_'+messId,messId)}else if(aLink.hasClass('mail')){emailAFriendThinger.transform('emailAFriendArea_'+messId,messId)}else if(aLink.hasClass('repo')){offensiveThinger.transform('offensiveArea_'+messId,messId)}}catch(e){dbug.log(e)}};window.addEvent('domready',function(){try{new SmoothScroll()}catch(e){dbug.log("SmoothScroll doesn't appear to be present: %s",e)}CommentsLogin.initLinks($$('a.needsReg'))});CommentsLogin.manager.addEvent('onLogin',function(){try{$('topLoginLink').setStyle('display','none')}catch(e){}});Number.extend({limit:function(low,high){return(this<low)?low:((this>high)?high:this)}});var Tips=new Class({options:{onShow:function(tip){tip.setStyle('visibility','visible')},onHide:function(tip){tip.setStyle('visibility','hidden')},maxTitleChars:30,showDelay:100,hideDelay:100,className:'tool',offsets:{'x':16,'y':16},fixed:false},initialize:function(elements,options){this.setOptions(options);this.toolTip=new Element('div',{'class':this.options.className+'-tip','styles':{'position':'absolute','top':'0','left':'0','visibility':'hidden'}}).injectInside(document.body);this.wrapper=new Element('div').injectInside(this.toolTip);$each(elements,function(el){this.build($(el))}.bind(this));if(this.options.initialize)this.options.initialize.call(this)},build:function(el){el.myTitle=el.href?el.href.replace('http://',''):(el.rel||false);if(el.title){var dual=el.title.split('::');if(dual.length>1){el.myTitle=dual[0].trim();el.myText=dual[1].trim()}else{el.myText=el.title}el.removeAttribute('title')}else{el.myText=false}if(el.myTitle&&el.myTitle.length>this.options.maxTitleChars)el.myTitle=el.myTitle.substr(0,this.options.maxTitleChars-1)+"&hellip;";el.addEvent('mouseover',function(event){this.start(el);this.locate(event)}.bindWithEvent(this));if(!this.options.fixed)el.addEvent('mousemove',this.locate.bindWithEvent(this));el.addEvent('mouseout',this.end.bindWithEvent(this))},start:function(el){this.wrapper.setHTML('');if(el.myTitle){new Element('span').injectInside(new Element('div',{'class':this.options.className+'-title'}).injectInside(this.wrapper)).setHTML(el.myTitle)}if(el.myText){new Element('span').injectInside(new Element('div',{'class':this.options.className+'-text'}).injectInside(this.wrapper)).setHTML(el.myText)}$clear(this.timer);this.timer=this.show.delay(this.options.showDelay,this)},end:function(event){$clear(this.timer);this.timer=this.hide.delay(this.options.hideDelay,this);event.stop()},locate:function(event){var win={'x':window.getWidth(),'y':window.getHeight()};var scroll={'x':window.getScrollLeft(),'y':window.getScrollTop()};var tip={'x':this.toolTip.offsetWidth,'y':this.toolTip.offsetHeight};var prop={'x':'left','y':'top'};for(var z in prop){var pos=event.page[z]+this.options.offsets[z];if((pos+tip[z]-scroll[z])>win[z])pos=event.page[z]-this.options.offsets[z]-tip[z];this.toolTip.setStyle(prop[z],pos+'px')}},show:function(){this.fireEvent('onShow',[this.toolTip])},hide:function(){this.fireEvent('onHide',[this.toolTip])}});Tips.initToolTipElement=function(links){try{new Tips(links,{timeOut:700,maxTitleChars:50,maxOpacity:.9,offsets:{'x':-14,'y':24}})}catch(e){dbug.log("No matching tips found: .toolTipElement")}};Tips.initToolTipElement2=function(links){try{new Tips(links,{timeOut:700,maxTitleChars:50,maxOpacity:.9,offsets:{'x':-140,'y':24},className:'tool2'})}catch(e){dbug.log("No matching tips found: .toolTipElement2")}};Tips.implement(new Events);Tips.implement(new Options);window.addEvent('load',function(){Tips.initToolTipElement($$('.toolTipElement'));Tips.initToolTipElement2($$('.toolTipElement2'))});var SingleFormEntry=new Class({validator:null,options:{submitArea:null,submitForm:null,statusElement:null},initialize:function(options){this.setOptions(options);this.submitArea=this.options.submitArea;this.submitForm=this.options.submitForm;this.statusElement=this.options.statusElement;this.validator=new FormValidator($(this.submitForm),{evaluateOnSubmit:false,evaluateFieldsOnBlur:false,evaluateFieldsOnChange:false})},doSubmit:function(){try{if(!this.validator.validate())return false}catch(e){dbug.log(e)}if(this.statusElement){$(this.statusElement).setHTML("<div class='process'>Processing...</div>")}$(this.submitForm).send({onComplete:this.handlePostResponse.bind(this)});this.resetForm();this.hide()},handlePostResponse:function(resp){var results=Json.evaluate(resp);var messages=$A(results.responseMessages);dbug.log("status = "+results.status+"  num messages = "+messages.length);if("nologin"==results.code){dbug.log("not logged in, but needs to be.")}var messagesToShow="";if(0<messages.length){messagesToShow="";messages.each(function(m){messagesToShow+=m+"<br />";dbug.log("message: "+m)})}if(results.feedbackTag){$(results.feedbackTag).setHTML(messagesToShow)}this.doPostComplete()},doPostComplete:function(){},createSubmitForm:function(){},resetForm:function(){},hide:function(){dbug.log("hiding...");$(this.submitArea).smoothHide().chain(function(){this.callChain()}.bind(this));return this},show:function(){dbug.log("showing...");$(this.submitArea).smoothShow().chain(function(){this.callChain()}.bind(this));return this},move:function(newParent,messageId){dbug.log("moving...");$(this.submitArea).injectInside($(newParent));return this},updateData:function(messageId){},transform:function(newParent,messageId){dbug.log("transforming...");if($(this.submitArea).isVisible()){this.hide().chain(function(){this.updateData(messageId);this.move(newParent,messageId);this.show()}.bind(this))}else{this.updateData(messageId);this.move(newParent,messageId);this.show()}}});SingleFormEntry.implement(new Options);SingleFormEntry.implement(new Events);SingleFormEntry.implement(new Chain);var AddSingleFormEntry=SingleFormEntry.extend({resetForm:function(){dbug.log("resetting...");$("addContainer").smoothHide()},doPostComplete:function(){dbug.log("post complete...");$("newCommentNotify").smoothShow()}});var ReplySingleFormEntry=SingleFormEntry.extend({updateData:function(id){$("replyMessageId").value=id;this.statusElement="replyStatus_"+id;$("replyFeedbackId").value=this.statusElement;$("msg-subject").value="";$("msg-body").setHTML("")},resetForm:function(){$("msg-body").empty();$("msg-body").value=""}});var EditSingleFormEntry=SingleFormEntry.extend({updateData:function(id){$("editMessageId").value=id;this.statusElement="editStatus_"+id;$("editFeedbackId").value=this.statusElement;$("edit-body").setHTML($("body_"+id).innerHTML);$("edit-body").value=($("body_"+id).innerHTML)},resetForm:function(){$("edit-body").empty();$("edit-body").value=""}});var DeleteSingleFormEntry=SingleFormEntry.extend({updateData:function(id){$("deleteMessageId").value=id;this.statusElement="deleteStatus_"+id;$("deleteFeedbackId").value=this.statusElement}});var OffensiveSingleFormEntry=SingleFormEntry.extend({updateData:function(id){$("offensiveBody").value="";$("offensiveMessageId").value=id;this.statusElement="offensiveStatus_"+id;$("offensiveFeedbackId").value=this.statusElement}});var EmailAFriendSingleFormEntry=SingleFormEntry.extend({updateData:function(id){$("toEmail").value="";$("emailBody").value="Hi, I found this user's comment on CNET and thought you might be interested in reading it.";$("emailMessageId").value=id;this.statusElement="emailAFriendStatus_"+id;$("emailFeedbackId").value=this.statusElement;$("emailAFriendStatus_"+id).setHTML("")}});var Watcher=new Class({setWatch:function(watchVal,threadId,siteId,nodeId){var url="8607-"+nodeId+"_"+siteId+"-0.html?threadId="+threadId+"&watch="+watchVal;$("watch-yes").smoothHide();$("watch-no").smoothHide();$("watch-process").smoothShow();new Ajax(url,{method:'get',onComplete:this.showWatchResults}).request();return false},showWatchResults:function(resp){$("watch-process").smoothHide();var results=Json.evaluate(resp);if(results.status=="success"){if(results.watch=="true"){$("watch-yes").smoothShow();$("watch-no").smoothHide()}else{$("watch-yes").smoothHide();$("watch-no").smoothShow()}}}});var Replyer=new Class({options:{repliesId:"",processId:"",hideReplyId:"",nodeId:null,assetId:null,communityId:null,messageId:null,pageNum:null,isModerator:null,showReplyId:null},init:function(options){this.options.repliesId=options.repliesId;this.options.processId=options.processId;this.options.hideReplyId=options.hideReplyId},showReplies:function(options){this.init(options);$("show_replies_"+options.messageId).setHTML("Refresh replies");$(options.processId).show();$(this.options.repliesId).hide();var url="/8613-"+options.nodeId+"-"+options.assetId+".html?communityId="+options.communityId+"&messageId="+options.messageId+"&pageNum="+options.pageNum+"&isModerator="+options.isModerator+"&nomesh";var replyAjax=new Ajax(url,{method:'get',onComplete:this.finish.bind(this)}).request()},finish:function(response){dbug.log("got replies");$(this.options.repliesId).setHTML(response);$(this.options.processId).hide();$(this.options.repliesId).smoothShow().chain(function(){$(this.options.repliesId).setStyle("height","auto")}.bind(this));$(this.options.hideReplyId).show();CommentsLogin.initLinks($(this.options.repliesId).getElements('a.needsReg'));Tips.initToolTipElement2($(this.options.repliesId).getElements('a.toolTipElement2'))},hideReplies:function(options){$(options.hideReplyId).hide();$(options.repliesId).smoothHide();$(options.showReplyId).setHTML("Show replies")}});Replyer.implement(new Options);Element.extend({isVisible:function(){return this.visible()}});var Jlogger=new Class({options:{ctype:false,cval:false,tag:false,element:false,event:false,useraction:false,fireOnce:false,executeNow:false,onPing:Class.empty},errors:0,fired:false,active:true,initialize:function(options){var defaults=(typeof PageVars!="undefined")?{ontid:PageVars.nodeId,siteId:PageVars.siteId,asId:PageVars.assetId,ptId:PageVars.pageType,edId:PageVars.editionId}:{};this.setOptions(defaults,options);if(this.options.element=='window')this.options.element=window;this.setup();if(this.options.executeNow)this.ping()},setup:function(){if(!$(this.options.element))return;var opt=this.options;if($type(opt.tag)&&$type(opt.element)&&$type(opt.event)){dbug.log('event observe(element: '+opt.element+', event: '+opt.event+', tag: '+opt.tag+')');if(opt.event=='load'&&opt.element==window)opt.executeNow=true;if(opt.element!=window)$(opt.element).addEvent(opt.event,this.ping.bind(this));else if(opt.event!='load')$(opt.element).addEvent(opt.event,this.ping.bind(this))}},makeURL:function(tag){var url='http://dw.com.com/redir?';var opt=this.options;if($type(opt.ontid))url+='ontid='+opt.ontid+'&';if($type(opt.siteId))url+='siteid='+opt.siteId+'&';if($type(opt.asId))url+='asId='+opt.asId+'&';if($type(opt.ptId))url+='ptId='+opt.ptId+'&';if($type(opt.edId))url+='edId='+opt.edId+'&';if($type(opt.ctype))url+='ctype='+opt.ctype+'&';if($type(opt.cval))url+='cval='+opt.cval+'&';if($type(opt.useraction))url+='useraction='+opt.useraction+'&';url+='tag='+opt.tag+'&destUrl=/i/b.gif';url+='&uniquePingId='+new Date().getTime();return url},ping:function(url,force){if(force||(((!this.fired&&this.options.fireOnce)||!this.options.fireOnce)&&this.active)){url=($type(url)!='string'||url.length==0)?this.makeURL():url;window.addEvent('domready',function(){new Element('img').setProperty('src',url);this.fired=true;dbug.log(this.options.tag+': '+(this.options.event||'')+'\nping: '+url);this.fireEvent('onPing')}.bind(this))}},pingTag:function(tag,force){this.ping(this.makeURL(tag),force)},stopObserving:function(){this.active=false},startObserving:function(){this.active=true}});Jlogger.implement(new Events);Jlogger.implement(new Options);var jlogger=Jlogger;

/* end packed code */

} //end debug scripts

