var RandomValueCookieMaker=new Class({options:{cookieName:false,limit:10,days:999,domain:false},initialize:function(A){this.setOptions(A);if(this.options.cookieName){this.verify();}else{dbug.log("you must specify a cookie name.");return ;}},verify:function(){this.val=Cookie.get(this.options.cookieName);if(!$chk(parseInt(this.val))){this.val=this.makeRand();this.saveVal();}},saveVal:function(A){this.val=$pick(A,this.val);if(this.options.domain){Cookie.set(this.options.cookieName,this.val,{duration:this.options.days,domain:this.options.domain});}else{Cookie.set(this.options.cookieName,this.val,this.options.days);}},makeSeed:function(){return((new Date().getTime()*9301+49297)%233280)/(233280);},makeRand:function(){return Math.ceil(this.makeSeed()*this.options.limit);}});RandomValueCookieMaker.implement(new Options);var randomValueCookieMaker=RandomValueCookieMaker;var simpleTemplateParser={STP:{},parseTemplate:function(B,A,C,D){var E=this.STP;E.template=B;E.object=A;E.regexOptions=$pick(C,"ig");E.wrappers=$pick(D,{before:"%",after:"%"});return E.result=this.runParser(E.object,E.template,E.regexOptions);},runParser:function(B,A,C){for(value in B){switch($type(B[value])){case"string":A=this.tmplSubst(value,B[value],A,C);break;case"number":A=this.tmplSubst(value,B[value],A,C);break;case"object":A=this.runParser(B[value]);break;case"array":A=this.tmplSubst(value,B[value].toString(),A,C);break;}}return A;},tmplSubst:function(B,D,A,C){return A.replace(new RegExp(this.STP.wrappers.before+B+this.STP.wrappers.after,"gi"),D);}};function fixPNG(D){try{if(window.ie6){D=$(D);if(!D){return D;}if(D.getTag()=="img"&&D.getProperty("src").test(".png")){var G=D.isVisible();try{dim=D.getSize();}catch(H){}if(!G){var F={};["visibility","display","position"].each(function(I){F[I]=this.style[I]||"";},this);this.setStyles({visibility:"hidden",display:"block",position:"absolute"});dim=D.getSize();this.setStyles(F);D.hide();}var C=new Element("span",{id:(D.id)?D.id:"","class":(D.className)?D.className:"",title:(D.title)?D.title:(D.alt)?D.alt:"",styles:{display:G?"inline-block":"none",width:dim.size.x+"px",height:dim.size.y+"px",filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader (src='"+D.src+"', sizingMethod='scale');"},src:D.src});if(D.style.cssText){try{var E={};var B=D.style.cssText.split(";");B.each(function(I){var J=I.split(":");E[J[0]]=J[1];});C.setStyle(E);}catch(H){dbug.log("fixPNG1: ",H);}}if(C.cloneEvents){C.cloneEvents(D);}D.replaceWith(C);}else{if(D.getTag()!="img"){var A=D.getStyle("background-image");if(A.test(/\((.+)\)/)){D.setStyles({background:"",filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled='true', sizingMethod='crop', src='"+A.match(/\((.+)\)/)[1]+"')"});}}}}}catch(H){dbug.log("fixPNG2: ",H);}}if(window.ie6){window.addEvent("domready",function(){$$("img.fixPNG").each(fixPNG);});}var IframeShim=new Class({options:{element:false,name:"",className:"iframeShim",display:false,name:"",zindex:false,margin:0,offset:{x:0,y:0},browsers:(window.ie6||(window.gecko&&navigator.userAgent.test("mac","i")))},initialize:function(A){this.setOptions(A);if(this.options.offset&&this.options.offset.top){this.options.offset.y=this.options.offset.top;}if(this.options.offset&&this.options.offset.left){this.options.offset.x=this.options.offset.left;}this.element=$(this.options.element);if(!this.element){return ;}else{this.makeShim();}return ;},makeShim:function(){this.shim=new Element("iframe");this.id=(this.options.name||new Date().getTime())+"_shim";if(this.element.getStyle("z-Index").toInt()<1||isNaN(this.element.getStyle("z-Index").toInt())){this.element.setStyle("z-Index",5);}var B=this.element.getStyle("z-Index")-1;if($chk(this.options.zindex)&&this.element.getStyle("z-Index").toInt()>this.options.zindex){B=this.options.zindex;}this.shim.setStyles({position:"absolute",zIndex:B,border:"none",filter:"progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)"}).setProperties({src:"javascript:void(0);",frameborder:"0",scrolling:"no",id:this.id}).addClass(this.options.className);var A=function(){this.shim.injectInside(document.body);if(this.options.display){this.show();}else{this.hide();}this.fireEvent("onInject");};if(this.options.browsers){if(window.ie&&!IframeShim.ready){window.addEvent("load",A.bind(this));}else{A.bind(this)();}}},position:function(D){if(!this.options.browsers||!IframeShim.ready){return ;}var A=this.element.getStyle("display")!="none";if(!A){this.element.setStyle("display","block");}var B=this.element.getSize().size;var C=this.element.getPosition();if(!A){this.element.setStyle("display","none");}if($type(this.options.margin)){B.x=B.x-(this.options.margin*2);B.y=B.y-(this.options.margin*2);this.options.offset.x+=this.options.margin;this.options.offset.y+=this.options.margin;}this.shim.setStyles({width:B.x+"px",height:B.y+"px"}).setPosition({relativeTo:this.element,offset:this.options.offset});},hide:function(){if(!this.options.browsers){return ;}this.shim.setStyle("display","none");},show:function(){if(!this.options.browsers){return ;}this.shim.setStyle("display","block");this.position();},remove:function(){if(!this.options.browsers){return ;}this.shim.remove();}});IframeShim.implement(new Options);IframeShim.implement(new Events);var iframeShim=IframeShim;window.addEvent("load",function(){IframeShim.ready=true;});var InputValidator=new Class({initialize:function(B,A){this.setOptions({errorMsg:"Validation failed.",test:function(C){return true;}},A);this.className=B;},test:function(A){if($(A)){return this.options.test($(A),this.getProps(A));}else{return false;}},getError:function(B){var A=this.options.errorMsg;if($type(A)=="function"){A=A($(B),this.getProps(B));}return A;},getProps:function(B){if($(B)&&$(B).getProperty("validatorProps")){try{return Json.evaluate($(B).getProperty("validatorProps"));}catch(A){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(B,A){},onElementValidate:function(B,A){}},initialize:function(B,A){this.setOptions(A);try{this.form=$(B);if(this.options.evaluateOnSubmit){this.form.addEvent("submit",this.onSubmit.bind(this));}if(this.options.evaluateFieldsOnBlur){this.watchFields();}}catch(C){}},getFields:function(){return this.fields=this.form.getElementsBySelector(this.options.fieldSelectors);},watchFields:function(){try{this.getFields().each(function(B){B.addEvent("blur",this.validateField.pass([B,false],this));if(this.options.evaluateFieldsOnChange){B.addEvent("change",this.validateField.pass([B,true],this));}},this);}catch(A){}},onSubmit:function(A){if(!this.validate(A)){new Event(A).stop();}else{this.stop();this.reset();}},reset:function(){this.getFields().each(this.resetField,this);},validate:function(B){var A=this.getFields().map(function(C){return this.validateField(C,true);},this);A=A.every(function(C){return C;});this.fireEvent("onFormValidate",[A,this.form,B]);return A;},validateField:function(H,G){if(this.paused){return true;}H=$(H);var B=true;var D=this.form.getElement(".validation-failed");var F=this.form.getElement(".warning");if(H&&(!D||G||H==D||(D&&!this.options.serial))){var C=H.className.split(" ").some(function(I){return this.getValidator(I);},this);B=H.className.split(" ").map(function(I){return this.test(I,H);},this);B=B.every(function(I){return I;});if(C&&!H.hasClass("warnOnly")){if(B){H.addClass("validation-passed").removeClass("validation-failed");}else{H.addClass("validation-failed").removeClass("validation-passed");}}if(!F||G||(F&&!this.options.serial)){var E=H.className.split(" ").some(function(I){if(I.test("^warn-")||H.hasClass("warnOnly")){return this.getValidator(I.replace(/^warn-/,""));}return null;},this);H.removeClass("warning");var A=H.className.split(" ").map(function(I){if(I.test("^warn-")||H.hasClass("warnOnly")){return this.test(I.replace(/^warn-/,""),H,true);}return null;},this);}}return B;},getPropName:function(A){return"__advice"+A;},test:function(C,E,F){if(E.hasClass("ignoreValidation")){return true;}F=$pick(F,false);if(E.hasClass("warnOnly")){F=true;}E=$(E);var D=true;if(E){var B=this.getValidator(C);if(B&&this.isVisible(E)){D=B.test(E);if(!D&&B.getError(E)){if(F){E.addClass("warning");}var A=this.makeAdvice(C,E,B.getError(E),F);this.insertAdvice(A,E);this.showAdvice(C,E);}else{this.hideAdvice(C,E);}this.fireEvent("onElementValidate",[D,E]);}}if(F){return true;}return D;},showAdvice:function(B,C){var A=this.getAdvice(B,C);if(A&&!C[this.getPropName(B)]&&(A.getStyle("display")=="none"||A.getStyle("visiblity")=="hidden"||A.getStyle("opacity")==0)){C[this.getPropName(B)]=true;if(A.smoothShow){A.smoothShow();}else{A.setStyle("display","block");}}},hideAdvice:function(B,C){var A=this.getAdvice(B,C);if(A&&C[this.getPropName(B)]){C[this.getPropName(B)]=false;if(A.smoothHide){A.smoothHide();}else{A.setStyle("display","none");}}},isVisible:function(A){while(A.tagName!="BODY"){if($(A).getStyle("display")=="none"){return false;}A=A.getParent();}return true;},getAdvice:function(A,B){return $("advice-"+A+"-"+this.getFieldId(B));},makeAdvice:function(D,F,C,G){var E=(G)?this.options.warningPrefix:this.options.errorPrefix;E+=(this.options.useTitles)?$pick(F.title,C):C;var B=this.getAdvice(D,F);if(!B){var A=(G)?"warning-advice":"validation-advice";B=new Element("div").addClass(A).setProperty("id","advice-"+D+"-"+this.getFieldId(F)).setStyle("display","none").appendText(E);}else{B.setHTML(E);}return B;},insertAdvice:function(A,C){switch(C.type.toLowerCase()){case"radio":var B=$(C.parentNode);if(B){B.adopt(A);break;}default:A.injectAfter($(C));}},getFieldId:function(A){return A.id?A.id:A.id="input_"+A.name;},resetField:function(A){A=$(A);if(A){var B=A.className.split(" ");B.each(function(C){if(C.test("^warn-")){C=C.replace(/^warn-/,"");}var D=this.getPropName(C);if(A[D]){this.hideAdvice(C,A);}A.removeClass("validation-failed");A.removeClass("warning");A.removeClass("validation-passed");},this);}},stop:function(){this.paused=true;},start:function(){this.paused=false;},ignoreField:function(A,B){A=$(A);if(A){this.enforceField(A);if(B){A.addClass("warnOnly");}else{A.addClass("ignoreValidation");}}},enforceField:function(A){A=$(A);if(A){A.removeClass("warnOnly");A.removeClass("ignoreValidation");}}});FormValidator.implement(new Options);FormValidator.implement(new Events);FormValidator.adders={validators:{},add:function(B,A){this.validators[B]=new InputValidator(B,A);if(!this.initialize){this.implement({validators:this.validators});}},addAllThese:function(A){$A(A).each(function(B){this.add(B[0],B[1]);},this);},getValidator:function(A){return this.validators[A];}};Object.extend(FormValidator,FormValidator.adders);FormValidator.implement(FormValidator.adders);FormValidator.add("IsEmpty",{errorMsg:false,test:function(A){if(A.type=="select-one"||A.type=="select"){return !(A.selectedIndex>=0&&A.options[A.selectedIndex].value!="");}else{return((A.getValue()==null)||(A.getValue().length==0));}}});FormValidator.addAllThese([["required",{errorMsg:function(A){return"This field is required.";},test:function(A){return !FormValidator.getValidator("IsEmpty").test(A);}}],["minLength",{errorMsg:function(A,B){if($type(B.minLength)){return"Please enter at least "+B.minLength+" characters (you entered "+A.getValue().length+" characters).";}else{return"";}},test:function(A,B){if($type(B.minLength)){return(A.getValue().length>=$pick(B.minLength,0));}else{return true;}}}],["maxLength",{errorMsg:function(A,B){if($type(B.maxLength)){return"Please enter no more than "+B.maxLength+" characters (you entered "+A.getValue().length+" characters).";}else{return"";}},test:function(A,B){return(A.getValue().length<=$pick(B.maxLength,10000));}}],["validate-number",{errorMsg:"Please enter a valid number in this field.",test:function(A){return FormValidator.getValidator("IsEmpty").test(A)||!/[^\d+$]/.test(A.getValue());}}],["validate-digits",{errorMsg:"Please use numbers only in this field. Please avoid spaces or other characters such as dots or commas.",test:function(A){return FormValidator.getValidator("IsEmpty").test(A)||(/[^a-zA-Z]/.test(A.getValue())&&/[\d]/.test(A.getValue()));}}],["validate-alpha",{errorMsg:"Please use letters only (a-z) in this field.",test:function(A){return FormValidator.getValidator("IsEmpty").test(A)||/^[a-zA-Z]+$/.test(A.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(A){return FormValidator.getValidator("IsEmpty").test(A)||!/\W/.test(A.getValue());}}],["validate-date",{errorMsg:function(A,B){if(Date.parse){var C=B.dateFormat||"%x";return"Please enter a valid date such as "+new Date().format(C);}else{return'Please enter a valid date such as MM/DD/YYYY (i.e. "12/31/1999")';}},test:function(A,B){if(FormValidator.getValidator("IsEmpty").test(A)){return true;}if(Date.parse){var E=B.dateFormat||"%x";var F=Date.parse(A.getValue());var D=F.format(E);if(D!="invalid date"){A.setProperty("value",D);}return !isNaN(F);}else{var C=/^(\d{2})\/(\d{2})\/(\d{4})$/;if(!C.test(A.getValue())){return false;}var F=new Date(A.getValue().replace(C,"$1/$2/$3"));return(parseInt(RegExp.$1,10)==(1+F.getMonth()))&&(parseInt(RegExp.$2,10)==F.getDate())&&(parseInt(RegExp.$3,10)==F.getFullYear());}}}],["validate-email",{errorMsg:"Please enter a valid email address. For example fred@domain.com .",test:function(A){return FormValidator.getValidator("IsEmpty").test(A)||/\w{1,}[@][\w\-]{1,}([.]([\w\-]{1,})){1,3}$/.test(A.getValue());}}],["validate-url",{errorMsg:"Please enter a valid URL.",test:function(A){return FormValidator.getValidator("IsEmpty").test(A)||/^(http|https|ftp|rmtp|mms|rtmp):\/\/(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+)(:(\d+))?\/?/i.test(A.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(A){if(FormValidator.getValidator("IsEmpty").test(A)){return true;}var B=/^(\d{2})\/(\d{2})\/(\d{4})$/;if(!B.test(A.getValue())){return false;}var C=new Date(A.getValue().replace(B,"$2/$1/$3"));return(parseInt(RegExp.$2,10)==(1+C.getMonth()))&&(parseInt(RegExp.$1,10)==C.getDate())&&(parseInt(RegExp.$3,10)==C.getFullYear());}}],["validate-currency-dollar",{errorMsg:"Please enter a valid $ amount. For example $100.00 .",test:function(A){return FormValidator.getValidator("IsEmpty").test(A)||/^\$?\-?([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(A.getValue());}}],["validate-one-required",{errorMsg:"Please enter something for at least one of the above options.",test:function(B){var C=B.parentNode;var A=C.getElements("input");return $A(A).some(function(D){return D.getValue();});}}]]);var IconMenu=new Class({options:{container:document,images:".iconImgs",captions:".iconCaptions",removeLinks:false,clearLinks:false,useAxis:"x",onFocus:Class.empty,onFocusDelay:0,initialFocusDelay:250,onBlur:Class.empty,onEmpty:Class.empty,onBlurDelay:0,onRemoveItem:Class.empty,onRemoveItems:Class.empty,length:"auto",iconPadding:1,scrollFxOptions:{duration:1800,transition:Fx.Transitions.Cubic.easeInOut},onScroll:Class.empty,onPageForward:Class.empty,onPageBack:Class.empty,backScrollButtons:"#scrollLeft",forwardScrollButtons:"#scrollRight",onSelect:function(B,A){if(!this.borderFx[A.getProperty("id")]){this.borderFx[A.getProperty("id")]=A.effects({duration:800});}this.borderFx[A.getProperty("id")].start({"border-top-color":"#00A0C6","border-left-color":"#00A0C6","border-right-color":"#00A0C6","border-bottom-color":"#00A0C6"});},onDeSelect:function(B,A){if(!this.borderFx[A.getProperty("id")]){this.borderFx[A.getProperty("id")]=A.effects({duration:800});}this.borderFx[A.getProperty("id")].start({"border-top-color":"#555","border-left-color":"#555","border-right-color":"#555","border-bottom-color":"#555"});}},initialize:function(B){this.setOptions(B);this.container=$(this.options.container);this.imgs=[];this.captions=[];this.selected=[];var A=($type(this.options.captions)=="string")?this.container.getElements(this.options.captions):this.options.captions;var C=($type(this.options.images)=="string")?this.container.getElements(this.options.images):this.options.images;C.each(function(D,E){this.addItem(D,A[E],null);},this);this.fireEvent("onItemsAdded",this.imgs,50);this.side=(this.options.useAxis=="x")?"left":"top";this.container.setStyle(this.side,this.container.getStyle(this.side).toInt()||0);this.onFocusDelay=this.options.initialFocusDelay;this.setupEvents();},bound:{mouseover:{},mouseout:{}},scrollTo:function(C,D){D=$pick(D,true);var A=this.calculateRange();if(C==A.start){return ;}var B=this.calculateRange(C);if(!B.elements.length){return ;}if(this.container.getStyle("position")=="static"){this.container.setStyle("position","relative");}if(!this.scrollerFx){this.scrollerFx=this.container.effect(this.side,$merge(this.options.scrollFxOptions,{wait:false}));}if(D){this.scrollerFx.start(-B.elements[0].offset).chain(function(){this.fireEvent("onScroll",[C,B]);}.bind(this));}else{this.scrollerFx.set(-B.elements[0].offset);this.fireEvent("onScroll",[C,B]);}this.currentOffset=C;},pageForward:function(B){var A=this.calculateRange();this.scrollTo(($type(B)=="number")?A.start+B:A.end);},pageBack:function(A){this.scrollTo(($type(A)=="number")?this.currentOffset-A:this.calculateRange(this.currentOffset,true).start);},addItem:function(C,B,D){D=($defined(D))?D:this.imgs.length;if(this.imgs.contains(C)){this.removeItems([C],true);}this.imgs.splice(D,0,$(C));this.captions.splice(D,0,$(B));var E=C.getProperty("src")||new Date().getTime().toString();var A=E.contains("/")?E.substring(E.lastIndexOf("/")+1,E.lastIndexOf(".")):E;if(!C.getProperty("id")){C.setProperty("id",A);}if(E.test("$png")&&window.ie&&!C.hasClass("fixPNG")){fixPNG(C);}this.setupIconEvents(C,B);this.fireEvent("onAdd",[C,B]);},removeItems:function(D,A){var E=this.calculateRange();if(!D.length){return ;}D=D.copy();A=$pick(A,true);var C=[];var J=[];var L={width:0,"border-width":0};var K={};var B={before:[],beforeImgs:[],after:[],afterImgs:[]};var F=[];D.each(function(N){var M=this.imgs.indexOf(N);if(M>=E.end){B.after.push(N.getParent());}else{if(M<E.start){B.before.push(N.getParent());}else{C.push(N.getParent());J.push(N);K[C.length-1]=$merge(L);}}this.selected.remove(N);F.push(M);},this);this.captions=this.captions.filter(function(M,N){return !F.contains(N);});this.imgs=this.imgs.filter(function(M,N){return !F.contains(N);});var H=[];if(B.before.length){var G=this.imgs.indexOf(E.elements[0].image);B.before.each(function(O,N){this.fireEvent("onRemoveItem",[O]);var M=B.beforeImgs[N];H.push(M.id);try{O.remove();}catch(P){dbug.log("before: error removing element %o, %o",O,P);}},this);this.scrollTo(G,false);}B.after.each(function(N,M){this.fireEvent("onRemoveItem",[N]);H.push(B.afterImgs[M].id);try{N.remove();}catch(O){dbug.log("after: error removing element %o, %o",N,O);}});function I(N,O){var M=[];C.each(function(Q,P){this.fireEvent("onRemoveItem",[Q]);M.push(J[P].id);try{Q.remove();}catch(R){dbug.log("fade: error removing element %o, %o",Q,R);}},this);M.merge(O);this.fireEvent("onRemoveItems",[M]);N=this.calculateRange();if(N.elements==0&&N.start>0){this.pageBack();}if(!this.imgs.length){this.fireEvent("onEmpty");}}if(A){new Fx.Elements(C).start(K).chain(I.bind(this,[E,H]));}else{I.apply(this,[E,H]);}},removeSelected:function(A){this.removeItems(this.selected,A);},empty:function(B){var C={};var A=[];this.imgs.each(function(D,E){A.push(D.getParent());C[E]={opacity:0};});new Fx.Elements(A).start(C).chain(function(){this.removeItems(this.imgs,false);if(!B){this.fireEvent("onEmpty");}}.bind(this));},selectItem:function(D,A){if(!this.borderFx){this.borderFx={};}var C=this.imgs[D];var B=C.getProperty("id");if($defined(A)){if(A){C.addClass("selected");}else{C.removeClass("selected");}}else{C.toggleClass("selected");}if(C.hasClass("selected")){this.selected.push(C);this.fireEvent("onSelect",[D,C]);}else{this.selected.remove(C);this.fireEvent("onDeSelect",[D,C]);}},getDefaultWidth:function(){if($type(this.options.length)=="number"){return this.options.length;}var A=$(this.options.length);if(!A){A=this.container.getParent();}return A.getSize().size[this.options.useAxis];},getIconPositions:function(){var C=[];var A=0;var B;this.imgs.each(function(D,E){var F=D.getParent();A+=(B)?D.offsetLeft-B.offsetLeft:0;B=D;C.push({image:D,size:F.getSize().size[this.options.useAxis],offset:A,container:F});},this);return C;},calculateRange:function(D,G){if(!this.imgs.length){return{start:0,end:0,elements:[]};}D=$pick(D,this.currentOffset||0);if(D<0){D=0;}var F=this.getDefaultWidth();var B=this.getIconPositions();var A;if(B[D]){A=B[D].offset;}else{var E=this.imgs.getLast().getParent();var H=E.getCoordinates();A=H.width+H.left-E.getParent().getPosition().x;}var C=B.filter(function(I,J){if(G){return J<D&&I.offset<A&&I.offset>=A-F;}else{return J>=D&&I.offset+I.size<F+B[D].offset;}});return(G)?{start:D-C.length,end:D,elements:C}:{start:D,end:C.length+D,elements:C};},inRange:function(B){var A=this.calculateRange();return B<A.end&&B>=A.start;},setupEvents:function(){$(this.options.container).addEvents({mouseleave:function(){if(this.inFocus){this.inFocus=null;}this.imgOut(null,true);}.bind(this)});$$(this.options.backScrollButtons).each(function(A){A.addEvent("click",this.pageBack.bind(this));A.addEvent("mouseover",function(){this.addClass("hover");});A.addEvent("mouseout",function(){this.removeClass("hover");});},this);$$(this.options.forwardScrollButtons).each(function(A){A.addEvent("click",this.pageForward.bind(this));A.addEvent("mouseover",function(){this.addClass("hover");});A.addEvent("mouseout",function(){this.removeClass("hover");});},this);$$(this.options.clearLinks).each(function(A){A.addEvent("click",this.empty.bind(this));},this);$$(this.options.removeLinks).each(function(A){A.addEvent("click",this.removeSelected.bind(this));},this);},imgOver:function(A){this.inFocus=A;$clear(this.overTimeout);this.overTimeout=(function(){this.onFocusDelay=this.options.onFocusDelay;if(this.inFocus==A){this.fireEvent("onFocus",[A,this.imgs.indexOf(A)]);}}).delay(this.onFocusDelay,this);},imgOut:function(A,B){if(!$defined(A)&&B){A=this.prevFocus||this.imgs[0];}if(this.inFocus==A&&A){this.inFocus=null;$clear(this.outTimeout);this.outTimeout=(function(){this.prevFocus=A;if(this.inFocus!=A||(A==null&&B)){this.fireEvent("onBlur",[A,this.imgs.indexOf(A)]);}if(!this.inFocus){this.onFocusDelay=this.options.initialFocusDelay;}}).delay(this.options.onBlurDelay,this);}},eventsIdTotal:0,setupIconEvents:function(B,A){B.addEvents({click:function(C){C=new Event(C);if(C.control){this.selectItem(this.imgs.indexOf(B));C.stop();}}.bind(this)});B.getParent().addEvents({mouseover:this.imgOver.bind(this,B),mouseout:this.imgOut.bind(this,B)});}});IconMenu.implement(new Events);IconMenu.implement(new Options);var Modalizer=new Class({defaultModalStyle:{display:"block",position:"fixed",top:"0px",left:"0px","z-index":5000,"background-color":"#333",opacity:0.8},setModalOptions:function(A){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,A||{});},resize:function(){if($("modalOverlay")){$("modalOverlay").setStyles({width:(window.getScrollWidth()+300)+"px",height:(window.getScrollHeight()+300)+"px"});}},setModalStyle:function(A){this.modalOptions.modalStyle=A;this.modalStyle=$merge(this.defaultModalStyle,{width:this.modalOptions.width,height:this.modalOptions.height},A);if($("modalOverlay")){$("modalOverlay").setStyles(this.modalStyle);}return(this.modalStyle);},modalShow:function(B){this.setModalOptions(B||{});var A=null;if($("modalOverlay")){A=$("modalOverlay");}if(!A){A=new Element("div").setProperty("id","modalOverlay").injectInside(document.body);}A.setStyles(this.setModalStyle(this.modalOptions.modalStyle));if(window.ie6){A.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);A.setStyle("display","block");return this;},modalHide:function(A){if(A===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(A){if((window.ie6||(window.gecko&&navigator.userAgent.test("mac","i")))){$$(this.modalOptions.elementsToHide).each(function(B){B.setStyle("opacity",A);});}}});var modalizer=Modalizer;var ObjectBrowser=new Class({options:{onLeafClick:Class.empty,onBranchClick:function(A){this.showLevel(A.path?A.path+"."+A.key:A.key,A.nodePath);},initPath:"",buildOnInit:true,data:{},excludeKeys:[],includeKeys:[]},initialize:function(A,B){this.container=$(A);this.setOptions(B);this.data=$H(this.options.data);this.levels={};this.elements={};if(this.options.buildOnInit){this.showLevel(this.options.initPath,this.container);}},getMemberByPath:function(C,B){if(C===""||C=="top"){return this.data.obj;}var D=this.data.obj;var A=C.split(".");if(B){A.pop();}A.each(function(E){if(E===""){return ;}if(D[E]){D=D[E];}else{if($chk(Number(E))&&D[Number(E)]){D=D[Number(E)];}else{D=this.data.obj;}}},this);return(D==this.data)?false:D;},replaceMemberByPath:function(C,B){if(C===""||C=="top"){return this.data=$H(B);}var A=this.getMemberByPath(C,true);A[C.split(".").pop()]=B;return this.data;},getPathByNode:function(A){var B=$H(this.elements);return B.keys()[B.values.indexOf(A)];},validLevel:function(A){return(!this.options.excludeKeys.contains(A)&&(!this.options.includeKeys.length||this.options.includeKeys.contains(A)));},buildLevel:function(B){if(B.test(".$")){B=B.substring(0,B.length);}var C=this.getMemberByPath(B);if(this.levels[B]){return this.levels[B];}var A=new Element("ul");switch($type(C)){case"function":this.buildNode(C,"function()",A,B,true);break;case"string":case"number":this.buildNode(C,null,A,B,true);break;case"array":C.each(function(E,D){this.buildNode(E,D,A,B,["string","function"].contains($type(E)));}.bind(this));break;default:$H(C).each(function(G,F){var E=false;if(F=="element_dimensions"){E=true;}if(E){dbug.log(F);}if(this.validLevel(F)){if(E){dbug.log("is valid level");}var D;if($type(G)=="object"){D=false;$each(G,function(I,H){if(this.validLevel(H)){if(E){dbug.log("not a leaf!");}D=false;}else{D=true;}},this);if(D){G=false;}}if(E){dbug.log(G,F,A,B,$chk(D)?D:null);}this.buildNode(G,F,A,B,$chk(D)?D:null);}},this);}this.levels[B]=A;return A;},getParentFromPath:function(A){return this.elements[(A||"top")+"NODE"];},showLevel:function(B,A,C){A=A||B;if(!this.elements[B]){this.elements[B]=this.buildLevel(B)[C||"injectInside"](this.elements[A]||this.container);}else{this.elements[B].toggle();}this.elements[B].getParent().toggleClass("collapsed");},buildNode:function(E,D,G,F,B){if(D===""||E===""){B=true;}if(!this.validLevel(D)){return null;}var C=(F?F+"."+D:D)+"NODE";var H=this.buildLink((B)?E||D:$chk(D)?D:E,B);var A=new Element("li").addClass((B)?"leaf":"branch collapsed").adopt(H).injectInside(G);H.addEvent("click",function(I){new Event(I).stopPropagation();if(B){this.fireEvent("onLeafClick",{li:A,key:D,value:E,path:F,nodePath:C,event:I});}else{this.fireEvent("onBranchClick",{li:A,key:D,value:E,path:F,nodePath:C,event:I});}}.bind(this));this.elements[C]=A;return A;},buildLink:function(A){if($type(A)=="function"){A=A.toString();A=A.substring(0,A.indexOf("{")+1)+"...";}return new Element("a",{href:"javascript: void(0);"}).setHTML(A);}});ObjectBrowser.implement(new Options,new Events);var OverText=new Class({options:{positionOptions:{position:"upperLeft",edge:"upperLeft",offset:{x:4,y:2}},onTextHide:Class.empty,onTextShow:Class.empty},initialize:function(A,B){this.setOptions(B);this.overTxts=[];this.overTxtEls=[];this.elements=$$(A);this.elements.each(function(D){if(this.overTxtEls.contains(D)||D.hasClass("overTxtSetup")){return ;}D.addClass("overTxtSetup");var E=D.getProperty("alt")||D.getProperty("title");D.setProperty("alt","").setProperty("title","");if(!E){return ;}this.overTxtEls.push(D);var C=new Element("div",{"class":"overTxtDiv"}).setHTML(E).injectAfter(D);D.addEvents({focus:this.hideTxt.pass(D,this),blur:this.testOverTxt.pass(D,this),change:this.testOverTxt.pass(D,this)});window.addEvent("resize",this.repositionAll.bind(this));C.addEvent("click",this.hideTxt.pass(D,this));this.overTxts.push(C);this.testOverTxt(D);},this);this.repositionAll();},getTxtForEl:function(A){try{return this.overTxts[this.overTxtEls.indexOf(A)];}catch(B){return null;}},hideTxt:function(B){var A=this.getTxtForEl(B);if(A&&A.isVisible()){A.hide();try{B.fireEvent("focus").focus();}catch(C){}this.fireEvent("onTextHide",[A,B]);}},showTxt:function(B){var A=this.getTxtForEl(B);if(A&&!A.isVisible()){A.show();this.fireEvent("onTextShow",[A,B]);}},testOverTxt:function(A){if(A.getValue()){this.hideTxt(A);}else{this.showTxt(A);}},repositionAll:function(){this.overTxtEls.each(this.repositionOverTxt.bind(this));},repositionOverTxt:function(B){try{var A=this.getTxtForEl(B);if(!A&&!B.getParent()){return ;}A.setPosition($merge(this.options.positionOptions,{relativeTo:B}));if(B.offsetHeight){this.testOverTxt(B);}else{this.hideTxt(B);}}catch(C){dbug.log("overTxt error: ",C);}}});OverText.implement(new Options,new Events);var Waiter=new Class({options:{baseHref:"http://www.cnet.com/html/rb/assets/global/waiter/",containerProps:{styles:{position:"absolute",display:"none",opacity:0,zIndex:999}},msg:false,msgProps:{styles:{textAlign:"center",fontWeight:"bold"}},img:{src:"waiter.gif",styles:{width:24,height:24}},imgPosition:{},layer:{styles:{width:0,height:0,position:"absolute",zIndex:998,display:"none",opacity:0.9,background:"#fff"},"class":"waitingDiv"},fxOptions:{}},initialize:function(B,A){this.target=$(B||document.body);this.setOptions(A);this.waiterMsg=new Element("div",this.options.containerProps).injectInside(document.body).addClass("waiterDiv");if(this.options.msg){this.waiterMsg.adopt(new Element("div",this.options.msgProps).appendText(this.options.msg));}this.waiterImg=$(this.options.img.id)||new Element("img",$merge(this.options.img,{src:this.options.baseHref+this.options.img.src})).injectInside(this.waiterMsg).addClass("waiterImg");this.waiterDiv=$(this.options.layer.id)||new Element("div",this.options.layer).injectInside(document.body);this.waiterFx=this.waiterFx||new Fx.Elements($$(this.waiterMsg,this.waiterDiv),this.options.fxOptions);},toggle:function(B,A){B=$(B)||$(this.active)||$(this.target);if(!$(B)){return this;}if(this.active&&B!=this.active){return this.stop(this.start.bind(this,B));}if((!this.active||A)&&A!==false){this.start(B);}else{if(this.active&&!A){this.stop();}}return this;},reset:function(){this.waiterFx.stop().set({0:{opacity:[0]},1:{opacity:[0]}});},start:function(A){this.reset();A=$(A)||$(this.target);var B=function(){var C=A.getComputedSize();this.active=A;this.waiterMsg.setPosition($merge(this.options.imgPosition,{relativeTo:A})).show();this.waiterDiv.setStyles({width:C.totalWidth,height:C.totalHeight,display:"block"}).setPosition({relativeTo:A,position:"upperLeft"});this.waiterFx.start({0:{opacity:[1]},1:{opacity:[this.options.layer.styles.opacity]}}).chain(function(){if(this.acive==A){this.fireEvent("onShow",A);}this.callChain();}.bind(this));}.bind(this);if(this.active&&this.active!=A){this.stop(B);}else{B();}return this;},stop:function(A){if(!this.active){if($type(A)=="function"){A.attempt();}return this;}this.waiterFx.stop();this.waiterFx.clearChain();this.waiterFx.start({0:{opacity:[0]},1:{opacity:[0]}}).chain(function(){this.active=null;this.waiterDiv.hide();this.waiterMsg.hide();this.fireEvent("onHide",this.active);this.callChain();this.clearChain();if($type(A)=="function"){A.attempt();}}.bind(this));return this;}});Waiter.implement(new Options,new Events,new Chain);if(typeof Ajax!="undefined"){var Ajax=Ajax.extend({options:{useWaiter:false,waiterOptions:{},waiterTarget:false},initialize:function(B,A){this.parent(B,A);if(this.options.useWaiter&&($(this.options.update)||$(this.options.waiterTarget))){this.waiter=new Waiter(this.options.waiterTarget||this.options.update,this.options.waiterOptions);this.addEvent("onComplete",this.waiter.stop.bind(this.waiter));this.addEvent("onFailure",this.waiter.stop.bind(this.waiter));}},request:function(A){if(this.waiter){this.waiter.start().chain(this.parent.bind(this,A));}else{this.parent(A);}return this;}});}function stickyWinHTML(C,A,D){D=$merge({width:"300px",css:"div.DefaultStickyWin div.body{font-family:verdana; font-size:11px; line-height: 13px;}div.DefaultStickyWin div.top_ul{background:url(%baseHref%full.png) top left no-repeat; height:30px; width:15px; float:left}div.DefaultStickyWin div.top_ur{position:relative; left:0px !important; left:-4px; background:url(%baseHref%full.png) top right !important; height:30px; margin:0px 0px 0px 15px !important; margin-right:-4px; padding:0px}div.DefaultStickyWin h1.caption{margin:0px 5px 0px 0px; overflow: hidden; padding:0; font-weight:bold; color:#555; font-size:14px; position:relative; top:8px; left:5px; float: left; height: 22px;}div.DefaultStickyWin div.middle, div.DefaultStickyWin div.closeBody {background:url(%baseHref%body.png) top left repeat-y; margin:0px 20px 0px 0px !important;	margin-bottom: -3px; position: relative;	top: 0px !important; top: -3px;}div.DefaultStickyWin div.body{background:url(%baseHref%body.png) top right repeat-y; padding:8px 30px 8px 0px; margin-left:5px; position:relative; right:-20px}div.DefaultStickyWin div.bottom{clear:both}div.DefaultStickyWin div.bottom_ll{background:url(%baseHref%full.png) bottom left no-repeat; width:15px; height:15px; float:left}div.DefaultStickyWin div.bottom_lr{background:url(%baseHref%full.png) bottom right; position:relative; left:0px !important; left:-4px; margin:0px 0px 0px 15px !important; margin-right:-4px; height:15px}div.DefaultStickyWin div.closeButtons{text-align: center; background:url(%baseHref%body.png) top right repeat-y; padding: 0px 30px 8px 0px; margin-left:5px; position:relative; right:-20px}div.DefaultStickyWin a.button:hover{background:url(%baseHref%big_button_over.gif) repeat-x}div.DefaultStickyWin a.button {background:url(%baseHref%big_button.gif) repeat-x; margin: 2px 8px 2px 8px; padding: 2px 12px; cursor:pointer; border: 1px solid #999 !important; text-decoration:none; color: #000 !important;}div.DefaultStickyWin div.closeButton{width:13px; height:13px; background:url(%baseHref%closebtn.gif) no-repeat; position: absolute; right: 0px; margin:10px 15px 0px 0px !important; cursor:pointer}div.DefaultStickyWin div.dragHandle {	width: 11px;	height: 25px;	position: relative;	top: 5px;	left: -3px;	cursor: move;	background: url(%baseHref%drag_corner.gif); float: left;}",cornerHandle:false,cssClass:"",baseHref:"http://www.cnet.com/html/rb/assets/global/stickyWinHTML/",buttons:[]},D);if(D.confirmTxt){D.buttons.push({text:D.confirmTxt,onClick:D.onConfirm||Class.empty});}if(D.closeTxt){D.buttons.push({text:D.closeTxt,onClick:D.onClose||Class.empty});}window.addEvent("domready",function(){try{if(!$("defaultStickyWinStyle")){var I=simpleTemplateParser.parseTemplate(D.css,D);if(window.ie){I=I.replace(new RegExp("png","gi"),"gif");}var J=new Element("style").setProperty("id","defaultStickyWinStyle").injectInside($$("head")[0]);if(!J.setText.attempt(I,J)){J.appendText(I);}}}catch(K){dbug.log("error: %s",K);}}.bind(this));C=$pick(C,"%caption%");A=$pick(A,"%body%");var B=new Element("div").setStyle("width",D.width).addClass("DefaultStickyWin");if(D.cssClass){B.addClass(D.cssClass);}var G=new Element("h1").addClass("caption").setStyle("width",(D.width.toInt()-(D.cornerHandle?70:60))+"px");if($(C)){G.adopt(C);}else{G.setHTML(C);}var E=new Element("div").addClass("body");if($(A)){E.adopt(A);}else{E.setHTML(A);}var H=new Element("div").addClass("top_ur").adopt(new Element("div").addClass("closeButton").addClass("closeSticky")).adopt(G);if(D.cornerHandle){new Element("div").addClass("dragHandle").injectTop(H);}else{G.addClass("dragHandle");}B.adopt(new Element("div").addClass("top").adopt(new Element("div").addClass("top_ul")).adopt(H));B.adopt(new Element("div").addClass("middle").adopt(E));if(D.buttons.length>0){var F=new Element("div").addClass("closeButtons");D.buttons.each(function(J){if(J.properties&&J.properties.className){J.properties["class"]=J.properties.className;delete J.properties.className;}var I=$merge({"class":"closeSticky"},J.properties);new Element("a").addEvent("click",J.onClick||Class.empty).appendText(J.text).injectInside(F).setProperties(I).addClass("button");});B.adopt(new Element("div").addClass("closeBody").adopt(F));}B.adopt(new Element("div").addClass("bottom").adopt(new Element("div").addClass("bottom_ll")).adopt(new Element("div").addClass("bottom_lr")));return B;}var StickyWin=new Class({options:{onDisplay:Class.empty,onClose:Class.empty,closeClassName:"closeSticky",pinClassName:"pinSticky",content:"",zIndex:10000,className:"",edge:false,position:"center",offset:{x:0,y:0},relativeTo:document.body,width:false,height:false,timeout:-1,allowMultipleByClass:false,allowMultiple:true,showNow:true,useIframeShim:true,iframeShimSelector:""},css:'.SWclearfix:after {content: "."; display: block; height: 0; clear: both; visibility: hidden;}.SWclearfix {display: inline-table;}* html .SWclearfix {height: 1%;}.SWclearfix {display: block;}',initialize:function(A){this.setOptions(A);this.id=this.options.id||"StickyWin_"+new Date().getTime();this.makeWindow();if(this.options.content){this.setContent(this.options.content);}if(this.options.showNow){this.show();}window.addEvent("domready",function(){try{if(!$("StickyWinClearfix")){var B=new Element("style").setProperty("id","StickyWinClearfix").injectInside($$("head")[0]);if(!B.setText.attempt(this.css,B)){B.appendText(this.css);}}}catch(C){dbug.log("error: %s",C);}}.bind(this));},makeWindow:function(){this.destroyOthers();if(!$(this.id)){this.win=new Element("div").setProperty("id",this.id).addClass(this.options.className).addClass("StickyWinInstance").addClass("SWclearfix").setStyles({display:"none",position:"absolute",zIndex:this.options.zIndex}).injectInside(document.body);}else{this.win=$(this.id);}if(this.options.width&&$type(this.options.width.toInt())=="number"){this.win.setStyle("width",this.options.width.toInt()+"px");}if(this.options.height&&$type(this.options.height.toInt())=="number"){this.win.setStyle("height",this.options.height.toInt()+"px");}return this;},show:function(){this.fireEvent("onDisplay");if(!this.positioned){this.position();}this.showWin();if(this.options.useIframeShim){this.showIframeShim();}this.visible=true;return this;},showWin:function(){this.win.setStyle("display","block");},hide:function(){this.fireEvent("onClose");this.hideWin();if(this.options.useIframeShim){this.hideIframeShim();}this.visible=false;return this;},hideWin:function(){this.win.setStyle("display","none");},destroyOthers:function(){if(!this.options.allowMultipleByClass||!this.options.allowMultiple){$$("div.StickyWinInstance").each(function(A){if(!this.options.allowMultiple||(!this.options.allowMultipleByClass&&A.hasClass(this.options.className))){A.remove();}},this);}},setContent:function(A){if(this.win.getChildren().length>0){this.win.empty();}if($type(A)=="string"){this.win.setHTML(A);}else{if($(A)){this.win.adopt(A);}}this.win.getElements("."+this.options.closeClassName).each(function(B){B.addEvent("click",this.hide.bind(this));},this);this.win.getElements("."+this.options.pinClassName).each(function(B){B.addEvent("click",this.togglepin.bind(this));},this);return this;},position:function(){this.positioned=true;this.win.setPosition({relativeTo:this.options.relativeTo,position:this.options.position,offset:this.options.offset,edge:this.options.edge});if(this.shim){this.shim.position();}return this;},pin:function(A){if(!this.win.pin){dbug.log("you must include element.pin.js!");return false;}this.pinned=$pick(A,true);return this.win.pin(A);},unpin:function(){this.pin(false);},togglepin:function(){this.pin(!this.pinned);},makeIframeShim:function(){if(!this.shim){this.shim=new IframeShim({element:(this.options.iframeShimSelector)?this.win.getElement(this.options.iframeShimSelector):$("modalOverlay")||this.win,display:false,name:"StickyWinShim"});}},showIframeShim:function(){if(this.options.useIframeShim){this.makeIframeShim();this.shim.show();}},hideIframeShim:function(){if(this.options.useIframeShim){this.shim.hide();}},destroy:function(){if(this.win&&this.win.getParent()){this.win.remove();}if(this.options.useIframeShim){this.shim.remove();}if($("modalOverlay")){$("modalOverlay").remove();}}});StickyWin.implement(new Options);StickyWin.implement(new Events);var stickyWin=StickyWin;var StickyWinFx=StickyWin.extend({options:{fade:true,fadeDuration:150,fadeTransition:Fx.Transitions.sineInOut,draggable:false,dragOptions:{},dragHandleSelector:".dragHandle",resizable:false,resizeOptions:{},resizeHandleSelector:""},setContent:function(A){this.parent(A);if(this.options.draggable){this.makeDraggable();}if(this.options.resizable){this.makeResizable();}return this;},hideWin:function(){if(this.options.fade){this.fade(0);}else{this.win.hide();}},showWin:function(){if(this.options.fade){this.fade(1);}else{this.win.show();}},fade:function(A){if(!this.fadeFx){this.win.setStyles({opacity:0,display:"block"});this.fadeFx=this.win.effect("opacity",{duration:this.options.fadeDuration,transition:this.options.fadeTransition});}if(A>0){this.win.setStyle("display","block");}this.fadeFx.clearChain();this.fadeFx.start(A).chain(function(){if(A==0){this.win.setStyle("display","none");}}.bind(this));return this;},makeDraggable:function(){dbug.log("you must include Drag.js, cannot make draggable");},makeResizable:function(){dbug.log("you must include Drag.js, cannot make resizable");}});if(typeof Drag!="undefined"){StickyWinFx.implement({makeDraggable:function(){var C=this.toggleVisible(true);if(this.options.useIframeShim){this.makeIframeShim();var B=this.options.dragOptions.onComplete||Class.empty;this.options.dragOptions.onComplete=function(){B();this.shim.position();}.bind(this);}if(this.options.dragHandleSelector){var A=this.win.getElement(this.options.dragHandleSelector);if(A){A.setStyle("cursor","move");this.options.dragOptions.handle=A;}}this.win.makeDraggable(this.options.dragOptions);if(C){this.toggleVisible(false);}},makeResizable:function(){var C=this.toggleVisible(true);if(this.options.useIframeShim){this.makeIframeShim();var B=this.options.resizeOptions.onComplete||Class.empty;this.options.resizeOptions.onComplete=function(){B();this.shim.position();}.bind(this);}if(this.options.resizeHandleSelector){var A=this.win.getElement(this.options.resizeHandleSelector);if(A){this.options.resizeOptions.handle=this.win.getElement(this.options.resizeHandleSelector);}}this.win.makeResizable(this.options.resizeOptions);if(C){this.toggleVisible(false);}},toggleVisible:function(A){if(!this.visible&&window.khtml&&$pick(A,true)){this.win.setStyles({display:"block",opacity:0});return true;}else{if(!$pick(A,false)){this.win.setStyles({display:"none",opacity:1});return false;}}return false;}});}var modalWinBase={initialize:function(A){A=A||{};this.setModalOptions($merge(A.modalOptions||{},{onModalHide:function(){this.hide(false);}.bind(this)}));this.parent(A);},show:function(A){if($pick(A,true)){this.modalShow();}this.parent();},hide:function(A){if($pick(A,true)){this.modalHide();}this.parent();}};var StickyWinModal=StickyWin.extend(modalWinBase);StickyWinModal.implement(new Modalizer);var StickyWinFxModal=(typeof StickyWinFx!="undefined")?StickyWinFx.extend(modalWinBase):Class.empty;try{StickyWinFxModal.implement(new Modalizer());}catch(e){}var SWA={options:{url:"",showNow:false,XHRoptions:{method:"get"},wrapWithStickyWinDefaultHTML:false,caption:"",stickyWinHTMLOptions:{},handleResponse:function(A){if(this.options.wrapWithStickyWinDefaultHTML){A=stickyWinHTML(this.options.caption,A,this.options.stickyWinHTMLOptions);}this.setContent(A);this.show();}},initialize:function(A){this.parent(A);this.createXHR();},createXHR:function(){var A=$merge(this.options.XHRoptions,{onSuccess:this.options.handleResponse.bind(this)});this.XHR=new XHR(A);},update:function(A){this.XHR.send(A||this.options.url);return this;}};try{StickyWin.Ajax=StickyWin.extend(SWA);}catch(e){}try{StickyWinFx.Ajax=StickyWinFx.extend(SWA);}catch(e){}try{StickyWinModal.Ajax=StickyWinModal.extend(SWA);}catch(e){}try{StickyWinFxModal.Ajax=StickyWinFxModal.extend(SWA);}catch(e){}var simpleErrorPopup=function(D,C,B){B=B||"http://www.cnet.com/html/rb/assets/global/simple.error.popup";C='<p class="errorMsg SWclearfix"><img src="'+B+'/simple.error.popup/icon_problems_sm.gif" class="bang clearfix" style="float: left; width: 30px; height: 30px; margin: 3px 5px 5px 0px;">'+C+"</p>";var A=stickyWinHTML(D,C,{width:"250px"});return new StickyWinModal({modalOptions:{modalStyle:{zIndex:11000}},zIndex:110001,content:A,position:"center"});};var DatePicker=new Class({options:{format:"%x",defaultCss:'div.calendarHolder {height:177px;position: absolute;top: -21px !important;top: -27px;left: -3px;}div.calendarHolder table.cal {margin-right: 15px !important;margin-right: 8px;width: 205px;}div.calendarHolder td {text-align:center;}div.calendarHolder tr.dayRow td {padding: 2px;width: 22px;cursor: pointer;}div.calendarHolder table.datePicker * {font-size:11px;line-height:16px;}div.calendarHolder table.datePicker {margin: 0;padding:0 5px;float: left;}div.calendarHolder table.datePicker table.cal td {cursor:pointer;}div.calendarHolder tr.dateNav {font-weight: bold;height:22px;margin-top:8px;}div.calendarHolder tr.dayNames {height: 23px;}div.calendarHolder tr.dayNames td {color:#666;font-weight:700;border-bottom:1px solid #ddd;}div.calendarHolder table.datePicker tr.dayRow td:hover {background:#ccc;}div.calendarHolder table.datePicker tr.dayRow td {margin: 1px;}div.calendarHolder td.today {color:#bb0904;}div.calendarHolder td.otherMonthDate {border:1px solid #fff;color:#ccc;background:#f3f3f3 !important;margin: 0px !important;}div.calendarHolder td.selectedDate {border: 1px solid #20397b;background:#dcddef;margin: 0px !important;}div.calendarHolder a.leftScroll, div.calendarHolder a.rightScroll {cursor: pointer;}div.datePickerSW div.body {height: 139px !important;height: 149px;}div.datePickerSW .clearfix:after {content: ".";display: block;height: 0;clear: both;visibility: hidden;}div.datePickerSW .clearfix {display: inline-table;}* html div.datePickerSW .clearfix {height: 1%;}div.datePickerSW .clearfix {display: block;}',calendarId:false,stickyWinOptions:{draggable:true,dragOptions:{},position:"bottomLeft",offset:{x:10,y:10},fadeDuration:400},showOnInputFocus:true,useDefaultCss:true,hideCalendarOnPick:true,onPick:Class.empty,onShow:Class.empty,onHide:Class.empty},initialize:function(A,B){this.options.additionalShowLinks=[];if($(A)){this.inputs=$H({start:$(A)});}this.today=new Date();var C=(typeof StickyWinFx=="undefined")?StickyWin:StickyWinFx;this.setOptions({stickyWinToUse:C},B);this.whens=this.whens||["start"];if(!this.calendarId){this.calendarId="popupCalendar"+new Date().getTime();}if(this.options.useDefaultCss){this.writeCss();}this.setUpObservers();this.getCalendar();this.formValidatorInterface();},formValidatorInterface:function(){this.inputs.each(function(A){var B;if(A.getProperty("validatorProps")){try{B=Json.evaluate(A.getProperty("validatorProps"));}catch(C){}}if(B&&B.dateFormat){dbug.log("using date format specified in validatorProps property of element to play nice with FormValidator");this.setOptions({format:B.dateFormat});}else{if(!B){B={};}B.dateFormat=this.options.format;A.setProperty("validatorProps",Json.toString(B));}},this);},calWidth:260,inputDates:{},selectedDates:{},setUpObservers:function(){this.inputs.each(function(A){if(this.options.showOnInputFocus){A.addEvent("focus",this.show.bind(this));}A.addEvent("blur",function(B){if(B){this.selectedDates=this.getDates(null,true);this.fillCalendar(this.selectedDates.start);this.updateInput();}}.bind(this));},this);this.options.additionalShowLinks.each(function(A){$(A).addEvent("click",this.show.bind(this));},this);},writeCss:function(A,B){if(!this.options.useDefaultCss){return ;}B=$pick(B,"datePickerStyle");A=$pick(A,this.options.defaultCss);window.addEvent("domready",function(){try{if(!$(B)){var C=new Element("style").setProperty("id",B).injectInside($$("head")[0]);if(!C.setText.attempt(A,C)){C.appendText(A);}}}catch(D){dbug.log("error: %s",D);}});},getDates:function(C,B){var D={};if(!B){C=C||this.selectedDates;}var A=function(E){var F=this.inputs.get(E);if(F){D[E]=this.validDate(F.getValue());}}.bind(this);this.whens.each(function(E){switch($type(C)){case"object":if(C){D[E]=C[E]?C[E]:C;}if(!D[E]&&!D[E].format){A(E);}break;default:A(E);break;}if(!D[E]){D[E]=this.selectedDates[E]||new Date();}},this);return D;},updateInput:function(){var A={};$each(this.getDates(),function(D,C){var B=this.inputs.get(C);if(!B){return ;}B.value=(D)?this.formatDate(D)||"":"";},this);},validDate:function(B){if(!$chk(B)){return null;}var A=Date.parse(B.trim());return isNaN(A)?null:A;},formatDate:function(A){return A.format(this.options.format);},getCalendar:function(){if(!this.calendar){var E=new Element("table").setProperties({id:this.options.calendarId,border:"0",cellpadding:"0",cellspacing:"0"}).addClass("datePicker");var A=new Element("tbody").injectInside(E);var F=new Element("tr").injectInside(A);var G=new Element("td").injectInside(F).setHTML("&nbsp;");(6).times(function(){F.adopt(G.clone());});(7).times(function(){A.adopt(F.clone());});var D=$(E).getElements("tr");D[0].addClass("dateNav");D[1].addClass("dayNames");(6).times(function(H){D[H+1].addClass("dayRow");});this.rows=D;var B=D[1].getElements("td");(7).times(function(H){B[H].firstChild.data=Date.$days[H].substring(0,3);}.bind(this));[6,5,4,3].each(function(H){D[0].getElements("td")[H].remove();});this.prevLnk=D[0].getElement("td").setStyle("text-align","right");if(!window.ie6){this.prevLnk.adopt(new Element("a").setHTML(String.fromCharCode(9668)).addClass("rightScroll"));}else{this.prevLnk.adopt(new Element("a").setHTML("&lt;").addClass("rightScroll"));}this.month=D[0].getElements("td")[1];this.month.setProperty("colspan",5);this.nextLnk=D[0].getElements("td")[2].setStyle("text-align","left");if(!window.ie6){this.nextLnk.adopt(new Element("a").setHTML(String.fromCharCode(9658)).addClass("leftScroll"));}else{this.nextLnk.adopt(new Element("a").setHTML("&gt;").addClass("leftScroll"));}E.addEvent("click",this.clickCalendar.bind(this));this.calendar=E;this.container=new Element("div").adopt(E).addClass("calendarHolder");this.content=stickyWinHTML("",this.container,{cornerHandle:true,width:this.calWidth});var C=$merge(this.options.stickyWinOptions,{content:this.content,className:"datePickerSW",allowMultipleByClass:true,showNow:false,relativeTo:this.inputs.get("start")});this.stickyWin=new this.options.stickyWinToUse(C);this.content.getElement("div.closeButton").setStyle("z-index",this.stickyWin.win.getStyle("z-index").toInt()+2);}return this.calendar;},hide:function(){this.stickyWin.hide();this.fireEvent("onHide");},show:function(){this.selectedDates={};var A=this.getDates(null,true);this.whens.each(function(B){this.inputDates[B]=A[B]?A[B].clone():A.start?A.start.clone():this.today;this.selectedDates[B]=!this.inputDates[B]||isNaN(this.inputDates[B])?this.today:this.inputDates[B].clone();this.getCalendar(B);},this);this.fillCalendar(this.selectedDates.start);this.stickyWin.show();this.fireEvent("onShow");},handleScroll:function(B){if(B.target.hasClass("rightScroll")||B.target.hasClass("leftScroll")){var A=B.target.hasClass("rightScroll")?this.rows[2].getElement("td").refDate-Date.$units.day():this.rows[7].getElements("td")[6].refDate+Date.$units.day();this.fillCalendar(new Date(A));return true;}return false;},setSelectedDates:function(B,A){this.selectedDates.start=A;},onPick:function(){this.updateSelectors();this.inputs.each(function(A){A.fireEvent("change");A.fireEvent("blur");});this.fireEvent("onPick");if(this.options.hideCalendarOnPick){this.hide();}},clickCalendar:function(B){B=new Event(B);if(this.handleScroll(B)){return ;}if(!B.target.firstChild||!B.target.firstChild.data){return ;}var C=B.target.firstChild.data;if(B.target.refDate){var A=new Date(B.target.refDate);this.setSelectedDates(B,A);this.updateInput();this.onPick();}},fillCalendar:function(B){if($type(B)=="string"){B=new Date(B);}var A=(B)?new Date(B.getTime()):new Date();A.setDate(1);A.setTime(A.getTime()-(Date.$units.day()*A.getDay()));this.rows[0].getElements("td")[1].firstChild.data=Date.$months[B.getMonth()]+" "+B.getFullYear();var C=A.clone();this.rows.each(function(E,D){if(D<2){return ;}E.getElements("td").each(function(F){F.firstChild.data=C.getDate();F.refDate=C.getTime();C.setTime(C.getTime()+Date.$units.day());},this);},this);this.updateSelectors();},updateSelectors:function(){var A;var B=new Date(this.rows[5].getElement("td").refDate).getMonth();this.rows.each(function(D,C){if(C<2){return ;}D.getElements("td").each(function(E){E.className="";A=new Date(E.refDate);if(A.format("%x")==this.today.format("%x")){E.addClass("today");}this.whens.each(function(F){var G=this.selectedDates[F];if(G&&A.format("%x")==G.format("%x")){E.addClass("selectedDate");this.fireEvent("selectedDateMatch",[E,F]);}},this);this.fireEvent("rowDateEvaluated",[A,E]);if(A.getMonth()!=B){E.addClass("otherMonthDate");}A.setTime(A.getTime()+Date.$units.day());},this);},this);}});DatePicker.implement(new Options);DatePicker.implement(new Events);DatePicker=DatePicker.extend({options:{format:"%x %X",extraCSS:"a.finish {position: relative;height: 13px !important;top: -31px !important;left: 85px !important;top: -34px;left: 77px;height: 16px;display:block;float: left;padding: 1px 12px 3px !important;}div.calendarHolder div.time {border: #999 1px solid;width: 55px;position: relative;left: 3px;height: 17px;}div.calendarHolder td.timeTD {width: 140px;} div.calendarHolder td.label{width:35px; text-align:right}div.calendarHolder div.time select {font-size: 10px !important; font-size: 15px;padding: 0px;left:60px;position:absolute;top:-1px !important;}div.calendarHolder div.time input {width: 16px !important;width: 12px;padding: 2px;height: 13px;border: none !important;border: 1px solid #fff;}div.calendarHolder div.timeSub {clear:both;position: relative;width: 65px;}div.calendarHolder div.timeSub span {text-align: center;color: #999;margin: 5px;}div.calendarHolder span.seperator {position:relative;top:-3px;}div.calendarHolder table.stamp {position:relative;top: 35px !important;top: 50px;left: 0px;}div.calendarHolder table.stamp a {left:123px;position:relative;top:9px;}div.calendarHolder td.selected_end {border-width: 1px 1px 1px 0px !important;margin: 0px 0px 0px 1px !important;}div.calendarHolder td.selected_start {border-width: 1px 0px 1px 1px !important;margin: 0px 1px 0px 0px !important;}div.calendarHolder table.datePicker td.range {background: #dcddef;border: solid #20397b;border-width: 1px 0px;margin: 0px 1px !important;}",range:false,time:false},initialize:function(A,B){if(B&&(B.range||B.time)){B=$merge({hideCalendarOnPick:false},B);}this.setOptions(B);this.whens=(this.options.range)?["start","end"]:["start"];if($type(A)=="object"){this.inputs=$H(A);}else{if($type($(A))=="element"){this.inputs=$H({start:$(A)});}else{if($type(A)=="array"){A=$$(A);this.inputs=$H({});this.whens.each(function(C,D){this.inputs.set(C,A[D]);},this);}}}if(this.options.time){this.calWidth=460;}this.parent(A,this.options);this.writeCss(this.options.extraCSS,"datePickerPlusStyle");this.addEvent("rowDateEvaluated",function(C,D){if(this.options.range&&this.selectedDates.start.diff(C,"minute")>0&&this.selectedDates.end.diff(C,"minute")<0){D.addClass("range");}}.bind(this));this.addEvent("selectedDateMatch",function(D,C){if(this.options.range){D.addClass("selected_"+C);}}.bind(this));},updateInput:function(){this.parent();if(this.options.time){this.updateView();}},updateView:function(){this.whens.each(function(A){var C=this.stamps[A];var B=this.getDates()[A];C.date.setHTML(B?B.format("%b. %d, %Y"):"");if(C.hr){C.hr.setProperty("value",B?B.format("%I"):"");C.min.setProperty("value",B?B.format("%M"):"");}},this);},stamps:{},setupWideView:function(){var A={hr:"%I",min:"%M"};timeSetMap={hr:"setHours",min:"setMinutes"};var B=this.getDates();if(!this.options.range&&!this.options.time){return ;}this.stamps.table=new Element("table",{"class":"stamp"}).injectInside(this.container);this.stamps.tbody=new Element("tbody").injectInside(this.stamps.table);this.whens.each(function(C){this.stamps[C]={};var D=this.stamps[C];D.container=new Element("tr").addClass(C+"_stamp").injectInside(this.stamps.tbody);D.label=new Element("td").injectInside(D.container).addClass("label");if(this.whens.length==1){D.label.setHTML("date:");}else{D.label.setHTML(C=="start"?"from:":"to:");}D.date=new Element("td").injectInside(D.container);if(this.options.time){currentWhen=B[C]||new Date();D.time=new Element("tr").injectInside(this.stamps.tbody);new Element("td").injectInside(D.time);D.timeTD=new Element("td").injectInside(D.time);D.timeInputs=new Element("div").addClass("time clearfix").injectInside(D.timeTD);D.timeSub=new Element("div",{"class":"timeSub"}).injectInside(D.timeTD);["hr","min"].each(function(F,E){D[F]=new Element("input",{type:"text","class":F,name:F,events:{focus:function(){this.select();},change:function(){this.selectedDates[C][timeSetMap[F]](D[F].getValue());this.selectedDates[C].setAMPM(D.ampm.getValue());this.updateInput();}.bind(this)}}).injectInside(D.timeInputs);D[F].setProperty("value",currentWhen.format(A[F]));if(E<1){D.timeInputs.adopt(new Element("span",{"class":"seperator"}).setHTML(":"));}new Element("span",{"class":F}).setHTML(F).injectInside(D.timeSub);},this);D.ampm=new Element("select").injectInside(D.timeInputs);["AM","PM"].each(function(E){var F=new Element("option",{value:E,text:E.toLowerCase()}).setHTML(E).injectInside(D.ampm);if(E==currentWhen.format("%p")){F.selected=true;}});D.ampm.addEvent("change",function(){var F=this.getDates()[C];var E=D.ampm.getValue();if(E!=F.format("%p")){F.setAMPM(E);this.updateInput();}}.bind(this));}},this);new Element("tr").injectInside(this.stamps.tbody).adopt(new Element("td",{colspan:2}).adopt(new Element("a",{"class":"closeSticky button",events:{click:function(){this.hide();}.bind(this)}}).setHTML("Ok")));},show:function(){this.parent();if(this.options.time){if(!this.stamps.table){this.setupWideView();}this.updateView();}},startSet:false,onPick:function(){if((this.options.range&&this.selectedDates.start&&this.selectedDates.end)||!this.options.range){this.parent();}},setSelectedDates:function(B,A){if(this.options.range){if(this.selectedDates.start&&this.startSet){if(this.selectedDates.start.getTime()>A.getTime()){this.selectedDates.end=new Date(this.selectedDates.start);this.selectedDates.start=A;}else{this.selectedDates.end=A;}this.startSet=false;}else{this.selectedDates.start=A;if(this.selectedDates.end&&this.selectedDates.start.getTime()>this.selectedDates.end.getTime()){this.selectedDates.end=new Date(A);}this.startSet=true;}}else{this.parent(B,A);}if(this.options.time){this.whens.each(function(C){var D=this.stamps[C].hr.getValue().toInt();if(this.stamps[C].ampm.getValue()=="PM"&&D<12){D+=12;}this.selectedDates[C].setHours(D);this.selectedDates[C].setMinutes(this.stamps[C]["min"].getValue()||"0");this.selectedDates[C].setAMPM(this.stamps[C].ampm.getValue()||"AM");},this);}}});var TagMaker=new Class({options:{name:"Tag Builder",output:"",picklets:{},help:{},example:{},"class":{},selectLists:{},width:400,maxHeight:500,showResult:true,clearOnPrompt:true,baseHref:"http://www.cnet.com/html/rb/assets/global/tips/",css:"table.trinket {	width: 98%;	margin: 0px auto;	font-size: 10px; }table.trinket td {	vertical-align: top;	padding: 4px;}table.trinket td a.button {	position: relative;	top: -2px;}table.trinket td.example {	font-size: 9px;	color: #666;	text-align: right;	border-bottom: 1px solid #ddd;padding-bottom: 6px;}table.trinket div.validation-advice {	background-color: #a36565;	font-weight: bold;	color: #fff;	padding: 4px;margin-top: 3px;}table.trinket input.text {width: 100%;}.tagMakerTipElement { 	cursor: help; }.tagMaker-tip {	color: #fff;	width: 172px;	z-index: 13000; }.tagMaker-title {	font-weight: bold;	font-size: 11px;	margin: 0;	padding: 8px 8px 4px;background: url(%baseHref%/bubble.png) top left;}.tagMaker-text { font-size: 11px; 	padding: 4px 8px 8px; background: url(%baseHref%/bubble.png) bottom right; }",onPrompt:Class.empty,onChoose:Class.empty},initialize:function(A){this.setOptions(A);this.buttons=[{text:"Copy",onClick:this.copyToClipboard.bind(this),properties:{"class":"closeSticky tip",title:"Copy::Copy the html to your OS clipboard (like hitting Ctrl+C)"}},{text:"Paste",onClick:function(){if(this.validator.validate()){this.insert();}}.bind(this),properties:{"class":"tip",title:"Paste::Insert the html into the field you are editing"}},{text:"Close",properties:{"class":"closeSticky tip",title:"Close::Close this popup"}}];this.writeCss();},writeCss:function(){window.addEvent("domready",function(){try{if(!$("defaultTagBuilderStyle")){var A=this.options.css.replace("%baseHref%",this.options.baseHref,"g");var B=new Element("style").setProperty("id","defaultTagBuilderStyle").injectInside($$("head")[0]);if(!B.setText.attempt(A,B)){B.appendText(A);}}}catch(C){dbug.log("error: %s",C);}}.bind(this));},prompt:function(D){this.target=$(D);var B=this.getContent();if(this.options.clearOnPrompt){this.clear();}if(B){var A=(document.compatMode=="BackCompat"&&this.target)?this.target:document.body;if(!this.win){this.win=new StickyWinFx({content:B,draggable:true,relativeTo:A,onClose:function(){$$(".tagMaker-tip").hide();}});}if(!this.win.visible){this.win.show();}}var C=this.getInnerTextInput();this.range=D.getSelectedRange();if(C){C.value=D.getTextInRange(this.range.start,this.range.end)||"";}this.fireEvent("onPrompt");},clear:function(){this.body.getElements("input").each(function(A){A.value="";});},getKeys:function(A){return A.split("%").filter(function(C,B){return B%2;});},getInnerTextInput:function(){return this.body.getElement("input[name=Inner-Text]");},getContent:function(){var A=this.options;if(!this.form){this.form=new Element("form");var B=new HtmlTable({properties:{"class":"trinket"}});this.getKeys(A.output).each(function(G){if(this.options.selectLists[G]){var E=new Element("select").setProperties({name:G.replaceAll(" ","-")}).addEvent("change",this.createOutput.bind(this));this.options.selectLists[G].each(function(H){var I=new Element("option").injectInside(E);if(H.selected){I.selected=true;}I.value=H.value;I.text=H.key;},this);B.push([G,E]);}else{var E=new Element("input").setProperties({type:"text",name:G.replaceAll(" ","-"),title:G+"::"+A.help[G],"class":"text tip "+((A["class"])?A["class"][G]||"":"")}).addEvent("keyup",this.createOutput.bind(this)).addEvent("focus",function(){this.select();});if(A.picklets[G]){var D=new Element("a").addClass("button").setHTML("choose");var F=new Element("div").adopt(E.setStyle("width","160px")).adopt(D);var C=($type(A.picklets[G])=="array")?A.picklets[G]:[A.picklets[G]];new ProductPicker(E,C,{showOnFocus:false,additionalShowLinks:[D],onPick:function(I,K,J){try{var H=this.getInnerTextInput();if(H&&!H.value){try{H.value=J.currentPicklet.options.listItemName(K);}catch(L){dbug.log("set value error: ",L);}}var M=I.value;if(G=="Full Path"&&M.indexOf("http://")==0){I.value=M.substring(M.indexOf("/",7),M.length);}this.createOutput();}catch(L){dbug.log(L);}}.bind(this)});B.push([G,F]);}else{B.push([G,E]);}}if(this.options.example[G]){B.push([{content:"eg. "+this.options.example[G],properties:{colspan:2,"class":"example"}}]);}},this);this.resultInput=new Element("input").setProperties({type:"text",title:"HTML::This is the resulting tag html.","class":"text result tip"}).addEvent("focus",function(){this.select();});B.push(["HTML",this.resultInput]).tr.setStyle("display",this.options.showResult?"":"none");this.form=B.table;this.body=new Element("div").adopt(this.form).setStyles({overflow:"auto",maxHeight:this.options.maxHeight});this.validator=new FormValidator(this.form);this.validator.insertAdvice=function(C,E){var D=$(E.parentNode);if(D){D.adopt(C);}};}if(!this.content){this.content=stickyWinHTML(this.options.name,this.body,{buttons:this.buttons,width:this.options.width.toInt()+"px"});new Tips(this.content.getElements(".tip"),{showDelay:700,maxTitleChars:50,maxOpacity:0.9,className:"tagMaker"});}return this.content;},createOutput:function(){var A=this.form.getElementsBySelector("input, select");var B=this.options.output;A.each(function(C){if(!C.hasClass("result")){B=B.replaceAll("%"+C.getProperty("name").replaceAll("-"," ").toLowerCase()+"%",C.getValue(),"i");}});return this.resultInput.value=B;},copyToClipboard:function(){var B=this.form.getElements("input");var A=B[B.length-1];A.select();Clipboard.copy(A);$$(".tagMaker-tip").hide();this.win.hide();this.fireEvent("onChoose");},insert:function(){if(!this.target){simpleErrorPopup("Cannot Paste","This tag builder was not launched with a target input specified; you'll have to copy the tag yourself. Sorry!");return ;}var B=(this.target)?this.target.value:this.target;var A=this.body.getElement("input.result");var C;if(this.target.scrollTop||this.target.scrollLeft){C={scrollTop:this.target.scrollTop,scrollLeft:this.target.scrollLeft};}this.target.value=B.substring(0,this.range.start)+A.value+B.substring((this.range.end-this.range.start)+this.range.start,B.length);if(C){this.target.scrollTop=C.scrollTop;this.target.scrollLeft=C.scrollLeft;}this.target.selectRange(this.range.start,A.value.length+this.range.start);this.fireEvent("onChoose");$$(".tagMaker-tip").hide();this.win.hide();return ;}});TagMaker.implement(new Options,new Events);TagMaker.image=TagMaker.extend({options:{name:"Image Builder",output:'<img src="%Full Url%" width="%Width%" height="%Height%" alt="%Alt Text%" style="%Alignment%"/>',help:{"Full Url":"Enter the external URL (http://...) to the image",Width:"Enter the width in pixels.",Height:"Enter the height in pixels.","Alt Text":"Enter the alternate text for the image.",Alignment:"Choose how to float the image."},example:{"Full Url":"http://i.i.com.com/cnwk.1d/i/hdft/redball.gif"},"class":{"Full Url":"validate-url required",Width:"validate-digits required",Height:"validate-digits required","Alt Text":"required"},selectLists:{Alignment:[{key:"left",value:"float: left"},{key:"right",value:"float: right"},{key:"none",value:"float: none",selected:true},{key:"center",value:"margin-left: auto; margin-right: auto;"}]},showResult:false}});var TMPicklets=[];if(typeof CNETProductPicker_ReviewPath!="undefined"){TMPicklets.push(CNETProductPicker_ReviewPath);}if(typeof CNETProductPicker_PricePath!="undefined"){TMPicklets.push(CNETProductPicker_PricePath);}if(typeof NewsStoryPicker_Path!="undefined"){TMPicklets.push(NewsStoryPicker_Path);}TagMaker.anchor=TagMaker.extend({options:{name:"Anchor Builder",output:'<a href="%Full Url%">%Inner Text%</a>',picklets:{"Full Url":(TMPicklets.length)?TMPicklets:false},help:{"Full Url":"Enter the external URL (http://...)","Inner Text":"Enter the text for the link body"},example:{"Full Url":"http://www.microsoft.com","Inner Text":"Microsoft"},"class":{"Full Url":"validate-url"}}});TagMaker.cnetVideo=TagMaker.extend({options:{name:"CNET Video Embed Tag",output:'<cnet:video ssaVideoId="%Video Id%" float="%Alignment%"/>',help:{"Video Id":"The id of the video to embed"},"class":{"Video Id":"validate-digits required"},selectLists:{Alignment:[{key:"left",value:"left"},{key:"right",value:"right"},{key:"none",value:"",selected:true}]}}});var PopupDetail=new Class({visible:false,observed:false,hasData:false,options:{observer:false,observerAction:"mouseenter",closeOnMouseOut:true,linkPopup:false,data:{},templateOptions:{},useAjax:false,ajaxOptions:{method:"get"},ajaxLink:false,ajaxCache:{},delayOn:100,delayOff:100,stickyWinOptions:{},stickyWinToUse:StickyWinFx,showNow:false,htmlResponse:false},initialize:function(B,A){this.setOptions(A);this.html=($(B))?$(B).innerHTML:B||"";if(this.options.showNow){this.show.delay(this.options.delayOn,this);}this.setUpObservers();},setUpObservers:function(){var A=this.options;if($(A.observer)&&A.observerAction){$(A.observer).addEvent(A.observerAction,function(){this.observed=true;this.show.delay(A.delayOn,this);}.bind(this));if((A.observerAction=="mouseenter"||A.observerAction=="mouseover")&&this.options.closeOnMouseOut){$(A.observer).addEvent("mouseleave",function(){this.observed=false;this.hide.delay(A.delayOff,this);}.bind(this));}}return this;},makePopup:function(){if(!this.stickyWin){var A=this.options;if(A.htmlResponse){this.content=this.data;}else{this.content=this.parseTemplate(this.html,A.data);}this.stickyWin=new A.stickyWinToUse($merge(A.stickyWinOptions,{relativeTo:A.observer||document.body,showNow:false,content:this.content,allowMultipleByClass:true}));if($(A.linkPopup)||$type(A.linkPopup)=="string"){this.stickyWin.win.setStyle("cursor","pointer").addEvent("click",function(){window.location.href=($type(url)=="string")?url:url.src;});}this.stickyWin.win.addEvent("mouseenter",function(){this.observed=true;}.bind(this));this.stickyWin.win.addEvent("mouseleave",function(){this.observed=false;if(A.closeOnMouseOut){this.hide.delay(A.delayOff,this);}}.bind(this));}return this;},getContent:function(){try{new Ajax((this.options.ajaxLink||this.options.observer.href),$merge(this.options.ajaxOptions,{onComplete:this.show.bind(this)})).request();}catch(A){dbug.log("ajax error on PopupDetail: %s",A);}},show:function(B){var A=this.options;if(B){this.data=B;}if(this.observed&&!this.visible){if(A.useAjax&&!this.data){var C=A.ajaxCache[this.options.ajaxLink]||A.ajaxCache[this.options.observer.href];if(C){return this.show(C);}this.cursorStyle=$(A.observer).getStyle("cursor");$(A.observer).setStyle("cursor","wait");this.getContent();return false;}else{if(this.cursorStyle){$(A.observer).setStyle("cursor",this.cursorStyle);}if(A.useAjax&&!A.htmlResponse){A.data=Json.evaluate(this.data);}this.makePopup();this.stickyWin.show();this.visible=true;return this;}}return this;},hide:function(){if(!this.observed){if(this.stickyWin){this.stickyWin.hide();}this.visible=false;}return this;}});PopupDetail.implement(simpleTemplateParser);PopupDetail.implement(new Options);var popupDetail=PopupDetail;var PopupDetailCollection=new Class({options:{details:[],observers:[],links:[],ajaxLinks:[],useCache:true,template:"",popupDetailOptions:{}},initialize:function(A){this.popupDetailObjs=[];this.cache={};this.setOptions(A);var B=this.options.ajaxLinks.length;if(B<=0){B=this.options.details.length;}if(this.options.observers.length!=B){dbug.log("warning: observers and details are out of sync.");}this.makePopupDetails();},makePopupDetails:function(){this.popupDetailObjs=this.options.observers.map(function(B,C){var D=this.options.popupDetailOptions;var A=new PopupDetail(this.options.template,$merge(D,{data:$pick(this.options.details[C],{}),observer:this.options.observers[C],linkItem:$pick(this.options.links[C],$pick(D.linkItem,false)),ajaxLink:$pick(this.options.ajaxLinks[C],false),ajaxCache:(this.options.useCache)?this.cache:{}}));return A;},this);}});PopupDetailCollection.implement(new Options);var popupDetails=new Class({initialize:function(A){var C=Object.extend(A,{popupDetailOptions:{stickyWinOptions:{position:$pick(A.observeCorner,"upperLeft"),offset:{x:A.offsetx||0,y:A.offsety||0},useIframeShim:(A.iframeShimSelector)?true:false}},delayOn:$pick(A.effectDelayOn,0),delayOff:$pick(A.effectDelayOff,0)});var B=new popupDetailCollection(C);return B;}});var popDetailsList=popupDetails;var CNETcarousel=new Class({options:{onRotate:Class.empty,onStop:Class.empty,onAutoPlay:Class.empty,onShowSlide:Class.empty,slidesSelector:".slide",buttonsSelector:".button",slideInterval:4000,transitionDuration:700,startIndex:0,buttonOnClass:"selected",buttonOffClass:"off",rotateAction:"none",rotateActionDuration:100,autoplay:true},initialize:function(A,B){this.container=$(A);if(!this.container.hasClass("hasCarousel")){this.container.addClass("hasCarousel");this.slides=[];this.buttons=[];this.setOptions(B);this.slides=$(A).getElements(this.options.slidesSelector);this.buttons=$(A).getElements(this.options.buttonsSelector);this.createFx();this.showSlide(this.options.startIndex);if(this.options.rotateAction!="none"){this.setupAction(this.options.rotateAction);}if(this.options.autoplay){this.autoplay();}return this;}else{return false;}},setupAction:function(A){this.buttons.each(function(C,B){$(C).addEvent(A,function(){this.slideFx.setOptions(this.slideFx.options,{duration:this.options.rotateActionDuration});if(this.currentSlide!=B){this.showSlide(B);}this.stop();}.bind(this));},this);},createFx:function(){if(!this.slideFx){this.slideFx=new Fx.Elements(this.slides,{duration:this.options.transitionDuration});}this.slides.each(function(A){A.setStyle("opacity",0);});},showSlide:function(B){var A={};this.slides.each(function(C,D){if(D==B&&D!=this.currentSlide){$(this.buttons[D]).removeClass(this.options.buttonOffClass).addClass(this.options.buttonOnClass);A[D.toString()]={opacity:[1]};}else{$(this.buttons[D]).removeClass(this.options.buttonOnClass).addClass(this.options.buttonOffClass);A[D.toString()]={opacity:[0]};}},this);this.fireEvent("onShowSlide",B);this.currentSlide=B;this.slideFx.start(A);},autoplay:function(){this.slideshowInt=this.rotate.periodical(this.options.slideInterval,this);this.fireEvent("onAutoPlay");},stop:function(){clearInterval(this.slideshowInt);this.fireEvent("onStop");},rotate:function(){var B=this.currentSlide;var A=(B+1>=this.slides.length)?0:B+1;this.showSlide(A);this.fireEvent("onRotate");},show:function(){this.container.setStyle("visibility","visible");if(!this.container.isVisible()){this.container.setStyle("display","block");}},hide:function(){this.container.setStyle("visibility","hidden");}});CNETcarousel.implement(new Options);CNETcarousel.implement(new Events);var CNETcarouselWithButtons=CNETcarousel.extend({initialize:function(B,A){this.parent(B,$merge({bubbleButtonBGImgSelector:".bbg",buttonOnGifSrc:"http://i.i.com.com/cnwk.1d/i/fd/c/green_button.gif",buttonOffGifSrc:"http://i.i.com.com/cnwk.1d/i/fd/c/gray_button.gif"},A));},showSlide:function(A){this.buttons.each(function(C,B){$(C).getElement(this.options.bubbleButtonBGImgSelector).src=(B==A)?this.options.buttonOnGifSrc:this.options.buttonOffGifSrc;},this);this.parent(A);}});var carousel=null;window.addEvent("domready",function(){if($("Carousel")){carousel=new CNETcarouselWithButtons($("Carousel"),{buttonsSelector:".bubble",rotateAction:"mouseover"});}});var MultipleOpenAccordion=Fx.Elements.extend({options:{openAll:true,allowMultipleOpen:true,firstElementsOpen:[0],start:"open-first",fixedHeight:false,fixedWidth:false,alwaysHide:true,wait:false,onActive:Class.empty,onBackground:Class.empty,height:true,opacity:true,width:false},initialize:function(B,C,A){this.parent(C,A);this.setOptions(A);this.previousClick=null;this.elementsVisible=[];B.each(function(E,D){$(E).addEvent("click",function(){this.toggleSection(D);}.bind(this));},this);this.togglers=B;this.h={};this.w={};this.o={};this.now=[];this.elements.each(function(E,D){E=$(E);this.now[D]={};E.setStyle("overflow","hidden");if(!(this.options.openAll&&this.options.allowMultipleOpen)){E.setStyle("height",0);}},this);if(!this.options.openAll||!this.options.allowMultipleOpen){switch(this.options.start){case"first-open":this.showSection(this.options.firstElementsOpen[0]);break;case"open-first":this.toggleSection(this.options.firstElementsOpen[0]);break;}}if(this.options.openAll&&this.options.allowMultipleOpen){this.showAll();}else{if(this.options.allowMultipleOpen){this.openSections(this.options.firstElementsOpen);}}},hideThis:function(A){this.elementsVisible[A]=false;if(this.options.height){this.h={height:[this.elements[A].offsetHeight,0]};}if(this.options.width){this.w={width:[this.elements[A].offsetWidth,0]};}if(this.options.opacity){this.o={opacity:[this.now[A]["opacity"]||1,0]};}this.fireEvent("onBackground",[this.togglers[A],this.elements[A]]);},showThis:function(A){this.elementsVisible[A]=true;if(this.options.height){this.h={height:[this.elements[A].offsetHeight,this.options.fixedHeight||this.elements[A].scrollHeight]};}if(this.options.width){this.w={width:[this.elements[A].offsetWidth,this.options.fixedWidth||this.elements[A].scrollWidth]};}if(this.options.opacity){this.o={opacity:[this.now[A]["opacity"]||0,1]};}this.fireEvent("onActive",[this.togglers[A],this.elements[A]]);},toggleSection:function(C){if(C!=this.previousClick||this.options.alwaysHide||this.options.allowMultipleOpen){this.previousClick=C;var A={};var B=false;this.elements.each(function(E,D){var F=false;this.now[D]=this.now[D]||{};if(D==C){if(this.elementsVisible[D]&&(this.options.allowMultipleOpen||this.options.alwaysHide)){if(!(this.options.wait&&this.timer)){F=true;this.hideThis(D);}else{this.previousClick=null;B=true;}}else{if(!this.elementsVisible[D]){if(!(this.options.wait&&this.timer)){F=true;this.showThis(D);}else{this.previousClick=null;B=true;}}}}else{if(this.elementsVisible[D]&&!this.options.allowMultipleOpen){if(!(this.options.wait&&this.timer)){F=true;this.hideThis(D);}else{this.previousClick=null;B=true;}}}if(F){A[D]=$merge(this.h,$merge(this.o,this.w));}},this);if(B){return false;}return this.custom(A);}return false;},showSection:function(A,B){if($pick(B,false)){if(!this.elementsVisible[A]){this.toggleSection(A);}}else{this.setSectionStyle(A,$(this.elements[A]).scrollWidth,$(this.elements[A]).scrollHeight,1);this.elementsVisible[A]=true;this.fireEvent("onActive",[this.togglers[A],this.elements[A]]);}},hideSection:function(A,B){if($pick(B,false)){if(this.elementsVisible[A]){this.toggleSection(A);}}else{this.setSectionStyle(A,0,0,0);this.elementsVisible[A]=false;this.fireEvent("onBackground",[this.togglers[A],this.elements[A]]);}},setSectionStyle:function(B,A,C,D){if(this.options.opacity){$(this.elements[B]).setOpacity(D);}if(this.options.height){$(this.elements[B]).setStyle("height",C+"px");}if(this.options.width){$(this.elements[B]).setStyle("width",A+"px");}},showAll:function(){if(this.options.allowMultipleOpen){this.elements.each(function(B,A){this.showSection(A,false);},this);}},hideAll:function(){if(this.options.allowMultipleOpen){this.elements.each(function(B,A){this.hideSection(A,false);},this);}},openSections:function(A){if(this.options.allowMultipleOpen){this.elements.each(function(C,B){if(A.test(B)){this.showSection(B,false);}else{this.hideSection(B,false);}},this);}}});MultipleOpenAccordion.implement(new Options);MultipleOpenAccordion.implement(new Events);var MooScroller=new Class({options:{maxThumbSize:10,mode:"vertical",width:0,scrollSteps:10,wheel:true,scrollLinks:{forward:"scrollForward",back:"scrollBack"},onScroll:Class.empty,onPage:Class.empty},initialize:function(D,A,B){this.setOptions(B);this.horz=(this.options.mode=="horizontal");this.content=$(D).setStyle("overflow","hidden");this.knob=$(A);this.track=this.knob.getParent();this.setPositions();if(this.horz&&this.options.width){this.wrapper=new Element("div");this.content.getChildren().each(function(E){this.wrapper.adopt(E);});this.wrapper.injectInside(this.content).setStyle("width",this.options.width);}this.bound={start:this.start.bind(this),end:this.end.bind(this),drag:this.drag.bind(this),wheel:this.wheel.bind(this),page:this.page.bind(this)};this.position={};this.mouse={};this.update();this.attach();var C=function(){$clear(this.scrolling);}.bind(this);["forward","back"].each(function(E){var F=$(this.options.scrollLinks[E]);if(F){F.addEvents({mousedown:function(){this.scrolling=this[E].periodical(50,this);}.bind(this),mouseup:C.bind(this),click:C.bind(this)});}},this);this.knob.addEvent("click",C.bind(this));window.addEvent("domready",function(){try{$(document.body).addEvent("mouseup",C.bind(this));}catch(E){}}.bind(this));},setPositions:function(){[this.track,this.knob].each(function(A){if(A.getStyle("position")=="static"){A.setStyle("position","relative");}});},update:function(){var A=this.horz?"Width":"Height";this.contentSize=this.content["offset"+A];this.contentScrollSize=this.content["scroll"+A];this.trackSize=this.track["offset"+A];this.contentRatio=this.contentSize/this.contentScrollSize;this.knobSize=(this.trackSize*this.contentRatio).limit(this.options.maxThumbSize,this.trackSize);this.scrollRatio=this.contentScrollSize/this.trackSize;this.knob.setStyle(A.toLowerCase(),this.knobSize+"px");this.updateThumbFromContentScroll();this.updateContentFromThumbPosition();},updateContentFromThumbPosition:function(){this.content[this.horz?"scrollLeft":"scrollTop"]=this.position.now*this.scrollRatio;},updateThumbFromContentScroll:function(){this.position.now=(this.content[this.horz?"scrollLeft":"scrollTop"]/this.scrollRatio).limit(0,(this.trackSize-this.knobSize));this.knob.setStyle(this.horz?"left":"top",this.position.now+"px");},attach:function(){this.knob.addEvent("mousedown",this.bound.start);if(this.options.scrollSteps){this.content.addEvent("mousewheel",this.bound.wheel);}this.track.addEvent("mouseup",this.bound.page);},wheel:function(A){A=new Event(A);this.scroll(-(A.wheel*this.options.scrollSteps));this.updateThumbFromContentScroll();A.stop();},scroll:function(A){A=A||this.options.scrollSteps;this.content[this.horz?"scrollLeft":"scrollTop"]+=A;this.updateThumbFromContentScroll();},forward:function(A){this.scroll(A);},back:function(A){A=A||this.options.scrollSteps;this.scroll(-A);},page:function(C){var B=this.horz?"x":"y";C=new Event(C);var A=(C.page[B]>this.knob.getPosition()[B]);this.scroll((A?1:-1)*this.content["offset"+(this.horz?"Width":"Height")]);this.updateThumbFromContentScroll();this.fireEvent("onPage",A);C.stop();},start:function(B){B=new Event(B);var A=this.horz?"x":"y";this.mouse.start=B.page[A];this.position.start=this.knob.getStyle(this.horz?"left":"top").toInt();document.addEvent("mousemove",this.bound.drag);document.addEvent("mouseup",this.bound.end);this.knob.addEvent("mouseup",this.bound.end);B.stop();},end:function(A){A=new Event(A);document.removeEvent("mousemove",this.bound.drag);document.removeEvent("mouseup",this.bound.end);this.knob.removeEvent("mouseup",this.bound.end);A.stop();},drag:function(B){B=new Event(B);var A=this.horz?"x":"y";this.mouse.now=B.page[A];this.position.now=(this.position.start+(this.mouse.now-this.mouse.start)).limit(0,(this.trackSize-this.knobSize));this.updateContentFromThumbPosition();this.updateThumbFromContentScroll();B.stop();}});MooScroller.implement(new Events);MooScroller.implement(new Options);function imgMouseOverEvents(B,C,A){$$(A).each(function(D){D=$(D);if($type(D.src)){if(D.src.indexOf(B)>0){D.addEvent("mouseover",function(){D.src=D.src.replace(B,C);}).addEvent("mouseout",function(){D.src=D.src.replace(C,B);});}}});}window.addEvent("domready",function(){imgMouseOverEvents("_off","_over","img.autoMouseOverOff, input.autoMouseOverOff");});window.addEvent("domready",function(){imgMouseOverEvents("_off","_on","img.autoMouseOver, input.autoMouseOver");});function tabMouseOvers(C,B,A,E,D){$$(A).each(function(F){F.applyToBoth=$pick(D,false);if(D&&E){F.getElementsBySelector(E).each(function(G){G.addClass(B).removeClass(C);});}F.addClass(B).removeClass(C);F.addEvent("mouseover",function(){this.addClass(C).removeClass(B);if(D&&E){this.getElementsBySelector(E).each(function(G){G.addClass(C).removeClass(B);});}});F.addEvent("mouseout",function(){this.addClass(B).removeClass(C);if(D&&E){$A(this.getElementsBySelector(E)).each(function(G){G.addClass(B).removeClass(C);});}});});}var TabSwapper=new Class({options:{selectedClass:"tabSelected",mouseoverClass:"tabOver",deselectedClass:"",rearrangeDOM:true,initPanel:0,smooth:false,smoothSize:false,maxSize:null,effectOptions:{duration:500},cookieName:null,cookieDays:999,onActive:Class.empty,onActiveAfterFx:Class.empty,onBackground:Class.empty},initialize:function(A){this.tabs=[];this.sections=[];this.clickers=[];this.sectionFx=[];A=this.compatability(A);this.setOptions(A);this.setup();if(this.options.cookieName&&this.recall()){this.swap(this.recall().toInt());}else{this.swap(this.options.initPanel);}},compatability:function(A){if(A.tabSelector){A.tabs=$$(A.tabSelector);A.sections=$$(A.sectionSelector);A.clickers=$$(A.clickSelector);}return A;},setup:function(){var A=this.options;sections=$$(A.sections);tabs=$$(A.tabs);clickers=$$(A.clickers);tabs.each(function(C,B){this.addTab(C,sections[B],clickers[B],B);},this);},addTab:function(C,D,A,B){C=$(C);A=$(A);D=$(D);if(this.tabs.indexOf(C)>=0&&C.getProperty("tabbered")&&this.tabs.indexOf(C)!=B&&this.options.rearrangeDOM){this.moveTab(this.tabs.indexOf(C),B);return ;}if(!$defined(B)){B=this.tabs.length;}if(B>0&&this.tabs[B-1]&&this.options.rearrangeDOM){C.injectAfter(this.tabs[B-1]);D.injectAfter(this.sections[B-1]);}this.tabs.splice(B,0,C);this.sections.splice(B,0,D);A=A||C;this.clickers.splice(B,0,A);C.addEvent("mouseout",function(){C.removeClass(this.options.mouseoverClass);}.bind(this)).addEvent("mouseover",function(){C.addClass(this.options.mouseoverClass);}.bind(this));A.addEvent("click",function(){this.swap(this.clickers.indexOf(A));}.bind(this));C.setProperty("tabbered",true);this.hideSection(B);return ;},removeTab:function(B){var A=this.tabs[this.now];if(this.now==B){if(B>0){this.swap(B-1);}else{if(B<this.tabs.length){this.swap(B+1);}}}this.sections.splice(B,1);this.tabs.splice(B,1);this.clickers.splice(B,1);this.sectionFx.splice(B,1);this.now=this.tabs.indexOf(A);},moveTab:function(H,G){var C=this.tabs[H];var B=this.clickers[H];var E=this.sections[H];var A=this.tabs[G];var F=this.clickers[G];var D=this.sections[G];this.tabs.remove(C).splice(G,0,C);this.clickers.remove(B).splice(G,0,B);this.sections.remove(E).splice(G,0,E);C.injectBefore(A);B.injectBefore(F);E.injectBefore(D);},swap:function(A){if(!$chk(this.now)){this.sections.each(function(C,B){if(A!=B){this.hideSection(B);}},this);}this.showSection(A);this.save(A);},save:function(A){if(this.options.cookieName){Cookie.set(this.options.cookieName,A,{duration:this.options.cookieDays});}},recall:function(){return(this.options.cookieName)?$pick(Cookie.get(this.options.cookieName),false):false;},hideSection:function(A){if(this.sections[A].getStyle("display")!="none"){this.lastHeight=this.sections[A].getSize().size.y;this.sections[A].setStyle("display","none");this.tabs[A].removeClass(this.options.selectedClass).addClass(this.options.deselectedClass);this.fireEvent("onBackground",[A,this.sections[A],this.tabs[A]]);}},showSection:function(A){var B=this.sections[A];if(!B){return this;}var E=this.options.smooth&&(!window.ie6||(window.ie6&&B.fxOpacityOk()));if(this.now!=A){if(!this.sectionFx[A]){this.sectionFx[A]=this.sections[A].effects(this.options.effectOptions);}var F={display:"block",overflow:"hidden"};if(E){F.opacity=0;}var D=false;if(E){D={opacity:1};}else{if(B.getStyle("opacity")<1){this.sectionFx[A].set({opacity:1});if(!this.options.smoothSize){this.fireEvent("onActiveAfterFx",[A,this.sections[A],this.tabs[A]]);}}}if(this.options.smoothSize){var C=B.getDimensions().height;if($chk(this.options.maxSize)&&this.options.maxSize<C){C=this.options.maxSize;}if(!D){D={};}D.height=C;}if($chk(this.now)){this.hideSection(this.now);}if(this.options.smoothSize&&this.lastHeight){F.height=this.lastHeight;}B.setStyles(F);if(D){this.sectionFx[A].start(D).chain(function(){this.fireEvent("onActiveAfterFx",[A,this.sections[A],this.tabs[A]]);B.setStyle("height","auto");}.bind(this));}this.now=A;this.fireEvent("onActive",[A,this.sections[A],this.tabs[A]]);}this.tabs[A].addClass(this.options.selectedClass).removeClass(this.options.deselectedClass);return this;}});TabSwapper.implement(new Options);TabSwapper.implement(new Events);var tabSwapper=TabSwapper;var SimpleSlideShow=new Class({options:{startIndex:0,slides:[],currentSlideClass:"currentSlide",currentIndexContainer:false,maxContainer:false,nextLink:false,prevLink:false,wrap:true,disabledLinkClass:"disabled",onNext:Class.empty,onPrev:Class.empty,onSlideClick:Class.empty,crossFadeOptions:{}},initialize:function(A){this.setOptions(A);this.slides=this.options.slides;this.makeSlides();this.setCounters();this.setUpNav();this.now=this.options.startIndex;if(this.slides.length>0){this.showSlide(this.now);}},setCounters:function(){if($(this.options.currentIndexContainer)){$(this.options.currentIndexContainer).setHTML(this.now+1);}if($(this.options.maxContainer)){$(this.options.maxContainer).setHTML(this.slides.length);}},makeSlides:function(){this.slides.each(function(A,B){if(B!=this.now){A.setStyle("display","none");}else{A.setStyle("display","block");}this.makeSlide(A);},this);},makeSlide:function(A){A.addEvent("click",function(){this.fireEvent("onSlideClick");}.bind(this));},setUpNav:function(){if($(this.options.nextLink)){$(this.options.nextLink).addEvent("click",function(){this.cycleForward();}.bind(this));}if($(this.options.prevLink)){$(this.options.prevLink).addEvent("click",function(){this.cycleBack();}.bind(this));}},cycleForward:function(){if($type(this.now)&&this.now<this.slides.length-1){this.showSlide(this.now+1);}else{if($type(this.now)&&this.options.wrap){this.showSlide(0);}else{this.showSlide(this.options.startIndex);}}this.fireEvent("onNext");if(this.now==this.slides.length&&!this.options.wrap&&$(this.options.nextLink)){$(this.options.nextLink).addClass(this.options.disabledLinkClass);}else{if($(this.options.nextLink)){$(this.options.nextLink).removeClass(this.options.disabledLinkClass);}}},cycleBack:function(){if(this.now>0){this.showSlide(this.now-1);this.fireEvent("onPrev");}else{if(this.options.wrap&&this.slides.length>1){this.showSlide(this.slides.length-1);this.fireEvent("onPrev");}}if(this.now==0&&!this.options.wrap&&$(this.options.prevSlide)){$(this.options.prevSlide).addClass(this.options.disabledLinkClass);}else{if($(this.options.prevSlide)){$(this.options.prevSlide).removeClass(this.options.disabledLinkClass);}}},showSlide:function(D){var B=this.now;var C=this.slides[D];function A(E,F){E.setStyle("display","block");if(E.fxOpacityOk()){if(F){E.setStyle("opacity",0);}E.effect("opacity",this.options.crossFadeOptions).start(1);}}if(C){if($type(this.now)&&this.now!=D){if(C.fxOpacityOk()){this.slides[this.now].effect("opacity",this.options.crossFadeOptions).start(0).chain(function(){this.slides[B].setStyle("display","none");C.addClass(this.options.currentSlideClass);A.bind(this,[C,true])();}.bind(this));}else{this.slides[this.now].setStyle("display","none");A.bind(this,C)();}}else{A.bind(this,C)();}this.now=D;this.setCounters();}},slideClick:function(){this.fireEvent("onSlideClick",[this.slides[this.now],this.now]);}});SimpleSlideShow.implement(new Events);SimpleSlideShow.implement(new Options);var SimpleImageSlideShow=SimpleSlideShow.extend({options:{imgUrls:[],imgClass:"screenshot",container:false},initialize:function(A){this.parent(A);this.options.imgUrls.each(function(B){this.addImg(B);},this);this.showSlide(this.options.startIndex);},addImg:function(B){if($(this.options.container)){var A=new Element("img").setProperties({src:B,id:this.options.imgClass+this.slides.length}).addClass(this.options.imgClass).setStyle("display","none").injectInside($(this.options.container)).addEvent("click",this.slideClick.bind(this));this.slides.push(A);this.makeSlide(A);this.setCounters();}}});var JsonP=new Class({options:{onComplete:Class.empty,callBackKey:"callback",queryString:"",data:{},timeout:5000,retries:0},initialize:function(B,A){this.setOptions(A);this.url=this.makeUrl(B).url;this.fired=false;this.scripts=[];this.requests=0;this.triesRemaining=[];},request:function(C,E){var B=this.makeUrl(C);if(!$chk(E)){E=this.requests;this.requests++;}if(!$chk(this.triesRemaining[E])){this.triesRemaining[E]=this.options.retries;}var D=this.triesRemaining[E];dbug.log("retrieving by json script method: %s",B.url);var A=(window.ie)?50:0;(function(){var F=new Asset.javascript(B.url,{id:"jsonp_"+B.index+"_"+E});this.fired=true;this.addEvent("onComplete",function(){try{F.remove();}catch(G){}}.bind(this));if(D){(function(){this.triesRemaining[E]=D-1;if(F.getParent()&&D){dbug.log("removing script (%o) and retrying: try: %s, remaining: %s",E,D);F.remove();this.request(C,E);}}).delay(this.options.timeout,this);}}.bind(this)).delay(A);return this;},makeUrl:function(B){var A=(JsonP.requestors.contains(this))?JsonP.requestors.indexOf(this):JsonP.requestors.push(this)-1;if(B){var D=(B.test("\\?"))?"&":"?";var C=B+D+this.options.callBackKey+"=JsonP.requestors["+A+"].handleResults";if(this.options.queryString){C+="&"+this.options.queryString;}C+="&"+Object.toQueryString(this.options.data);}else{var C=this.url;}return{url:C,index:A};},handleResults:function(A){dbug.log("jsonp received: ",A);this.fireEvent("onComplete",[A,this]);}});JsonP.requestors=[];JsonP.implement(new Options);JsonP.implement(new Events);var Picklet=new Class({options:{onShow:Class.empty},inputElements:{},initialize:function(B,A){this.setOptions(A);this.className=B;this.getQuery=this.options.getQuery;}});Picklet.implement(new Options);Picklet.implement(new Events);var ProductPicker=new Class({options:{onShow:Class.empty,onPick:Class.empty,title:"Product picker",showOnFocus:true,additionalShowLinks:[],stickyWinToUse:StickyWinFx,stickyWinOptions:{fadeDuration:200,draggable:true},moveIntoView:true,baseHref:"http://www.cnet.com/html/rb/assets/global/Picker"},initialize:function(B,A,C){this.setOptions(C);this.input=$(B);this.picklets=A;this.setUpObservers();this.writeCss();},writeCss:function(){var E=this.options.baseHref;var C=E.replace("Picker","tips");var A="div.productPickerProductDiv div.results { overflow: 'auto'; width: 100%; margin-top: 4px }div.productPickerProductDiv select { margin: 4px 0px 4px 0px}div.pickerPreview div.sliderContent img {border: 1px solid #000}div.pickerPreview div.sliderContent a {color: #0d63a0}div.productPickerProductDiv * {color: #000}.tool-tip { color: #fff; width: 172px; z-index: 13000; }.tool-title { font: Verdana, Arial, Helvetica, sans-serif; font-weight: bold; font-size: 11px; margin: 0; padding: 8px 8px 4px; background: url("+C+"/bubble.png) top left !important; background: url("+C+"/bubble.gif) top left; }.tool-text {font-size: 11px; margin: 0px; padding: 4px 8px 8px; background: url("+C+"/bubble.png) bottom right !important; background: url("+C+"/bubble.gif) bottom right; }";try{if(!$("pickerStyles")){var B=new Element("style").setProperty("id","pickerStyles").injectInside($$("head")[0]);if(!B.setText.attempt(A,B)){B.appendText(A);}}}catch(D){dbug.log("error: %s",D);}},getPickletList:function(){if(this.picklets.length>1){var A=new Element("select").setStyle("width","399px");this.picklets.each(function(D,B){var C=new Element("option").setProperty("value",B);C.text=D.options.descriptiveName;A.adopt(C);},this);A.addEvent("change",function(){this.showForm(this.picklets[A.getValue()]);this.focusInput(true);}.bind(this));return A;}else{return false;}},buildPicker:function(C){var B=new Element("div");this.formBody=new Element("div");this.pickletList=this.getPickletList();if(this.pickletList){B.adopt(this.pickletList);}B.adopt(this.formBody);var A=stickyWinHTML(this.options.title,B,{width:"450px",closeTxt:"close"}).addClass("productPickerProductDiv");this.showForm();return A;},showForm:function(A){this.form=this.makeSearchForm(A||this.picklets[0]);this.formBody.empty().adopt(this.form);(A||this.picklets[0]).fireEvent("onShow");this.results=new Element("div").addClass("results");this.formBody.adopt(this.results);this.sliderFx=null;this.fireEvent("onShow");},makeSlider:function(){var A=(window.ie)?"gif":"png";this.slider=new Element("div").addClass("pickerPreview").setStyles({background:"url("+this.options.baseHref+"/slider."+A+") top right no-repeat",display:"none",height:"250px",left:"439px",position:"absolute",top:"25px",width:"0px",overflow:"hidden"}).injectInside(this.swin.win).addEvent("mouseover",function(){this.previewHover=true;}.bind(this)).addEvent("mouseout",function(){this.previewHover=false;(function(){if(!this.previewHover){this.hidePreview();}}).delay(400,this);}.bind(this));this.sliderContent=new Element("div").injectInside(this.slider).setStyles({width:"130px",height:"200px",padding:"10px",margin:"10px 10px 0px 0px",overflow:"auto",cssFloat:"right"}).addClass("sliderContent");},makeSearchForm:function(D){this.currentPicklet=D;var B=new Element("table").setStyle("width","100%").setProperties({cellpadding:"0",cellspacing:"0"});var A=new Element("tbody").injectInside(B);var C=new Element("form").addEvent("submit",function(E){this.getResults(new Event(E).target,D);}.bind(this)).adopt(B).setProperty("action","javascript:void(0);");$each(D.options.inputs,function(G,F){var E=this.getSearchInputTr(G,F);A.adopt(E.holder);D.inputElements[F]=E.input;},this);return C;},getSearchInputTr:function(G,C){try{var E=($type(G.style))?G.style:{};var B=(window.ie)?new Element("<"+G.tagName+' name="'+C+'" />'):new Element(G.tagName).setProperty("name",C);B.setStyles(E);if(G.type){B.setProperty("type",G.type);}if(G.tip&&Tips){B.setProperty("title",G.tip);new Tips([B],{onShow:function(I){this.shown=true;(function(){if(this.shown){$(I).setStyles({display:"block",opacity:0}).effect("opacity",{duration:300}).start(0,0.9);}}).delay(500,this);},onHide:function(I){I.setStyle("visibility","hidden");this.shown=false;}});}if(G.tagName=="select"){G.value.each(function(K,I){var J=new Element("option").setProperty("value",K);J.text=(G.optionNames&&G.optionNames[I])?$pick(G.optionNames[I],K):K;B.adopt(J);});}else{B.value=$pick(G.value,"");}var D=new Element("tr");var H=0;if(G.instructions){D.adopt(new Element("td").setHTML(G.instructions));}else{H=2;}var A=new Element("td").adopt(B);if(H){A.setProperty("colspan",H);}D.adopt(A);return{holder:D,input:B};}catch(F){dbug.log(F);return false;}},getResults:function(A,C){if(A.getTag()!="form"){A=$$("form").filter(function(D){return D.hasChild(A);})[0];}if(!A){dbug.log("error computing form");return null;}var B=C.getQuery(unescape(A.toQueryString()).parseQuery());B.addEvent("onComplete",this.showResults.bind(this));B.request();return this;},showResults:function(B){var A=false;if(this.results.innerHTML==""){A=true;this.results.setStyles({height:"0px",border:"1px solid #666",padding:"0px",overflow:"auto",opacity:0});}else{this.results.empty();}this.items=this.currentPicklet.options.resultsList(B);if(this.items&&this.items.length>0){this.items.each(function(E,D){var C=this.currentPicklet.options.listItemName(E);var F=this.currentPicklet.options.listItemValue(E);this.results.adopt(this.makeProductListEntry(C,F,D));},this);}else{this.results.setHTML("Sorry, there don't seem to be any items for that search");}this.results.effects().start({height:200,opacity:1});this.listStyles();this.getOnScreen.delay(500,this);},getOnScreen:function(){if(document.compatMode=="BackCompat"){return ;}var A=this.swin.win.getCoordinates();if(A.top<window.getScrollTop()){this.swin.win.effect("top").start(window.getScrollTop()+50);return ;}if(A.top+A.height>window.getScrollTop()+window.getHeight()&&window.getHeight()>A.height){this.swin.win.effect("top").start(window.getScrollTop()+window.getHeight()-A.height-100);return ;}try{this.swin.shim.show.delay(500,this.swin.shim);}catch(B){}return ;},listStyles:function(){var C={cursor:"pointer",borderBottom:"1px solid #ddd",padding:"2px 8px 2px 8px",backgroundColor:"#fff",color:"#000",fontWeight:"normal"};var B={backgroundColor:"#fcfbd1",color:"#d56a00"};var A=$merge(C,{color:"#D00000",fontWeight:"bold",backgroundColor:"#eee"});this.results.getElements("div.productPickerProductDiv").each(function(E){var D=(this.input.value.toInt()==E.getProperty("val").toInt())?A:C;E.setStyles(D);if(!window.ie){E.addEvent("mouseover",function(){E.setStyles(B);}.bind(this));E.addEvent("mouseout",function(){E.setStyles(D);});}},this);},makeProductListEntry:function(C,D,B){var A=new Element("div").addClass("productPickerProductDiv").adopt(new Element("div").setHTML(C)).setProperty("val",D);A.addEvent("mouseenter",function(F){this.preview=true;this.sliderContent.setHTML("");var E=this.getPreview(B);if($type(E)=="string"){this.sliderContent.setHTML(E);}else{if($(E)){this.sliderContent.adopt(E);}}this.showPreview.delay(200,this);}.bind(this));A.addEvent("mouseleave",function(E){this.preview=false;(function(){if(!this.previewHover){this.hidePreview();}}).delay(400,this);}.bind(this));A.addEvent("click",function(){this.currentPicklet.options.updateInput(this.input,this.items[B]);this.fireEvent("onPick",[this.input,this.items[B],this]);this.hide();this.listStyles.delay(200,this);}.bind(this));return A;},makeStickyWin:function(){if(document.compatMode=="BackCompat"){this.options.stickyWinOptions.relativeTo=this.input;}this.swin=new this.options.stickyWinToUse($merge(this.options.stickyWinOptions,{draggable:true,content:this.buildPicker()}));},focusInput:function(A){if((!this.focused||$pick(A,false))&&this.form.getElement("input")){this.focused=true;try{this.form.getElement("input").focus();}catch(B){}}},show:function(){if(!this.swin){this.makeStickyWin();}if(!this.slider){this.makeSlider();}if(!this.swin.visible){this.swin.show();}this.focusInput();},hide:function(){$$(".tool-tip").hide();this.swin.hide();this.focused=false;},setUpObservers:function(){try{if(this.options.showOnFocus){this.input.addEvent("focus",this.show.bind(this));}if(this.options.additionalShowLinks.length>0){this.options.additionalShowLinks.each(function(B){$(B).addEvent("click",this.show.bind(this));},this);}}catch(A){dbug.log(A);}},showPreview:function(A){width=this.currentPicklet.options.previewWidth||150;this.sliderContent.setStyle("width",(width-30)+"px");if(!this.sliderFx){this.sliderFx=new Fx.Elements([this.slider,this.swin.win]);}this.sliderFx.clearChain();$extend(this.sliderFx.options,{duration:1000,transition:Fx.Transitions.elasticOut});if(this.preview&&this.slider.getStyle("width").toInt()<width-5){this.slider.show("block");this.sliderFx.start({"0":{width:width},"1":{width:width+450}});}},hidePreview:function(){if(!this.preview){$extend(this.sliderFx.options,{duration:250,transition:Fx.Transitions.backIn});this.sliderFx.clearChain();this.sliderFx.start({"0":{width:[this.slider.getStyle("width").toInt(),0]},"1":{width:[this.swin.win.getStyle("width").toInt(),450]}}).chain(function(){this.slider.hide();}.bind(this));}},getPreview:function(A){return this.currentPicklet.options.previewHtml(this.items[A]);}});ProductPicker.implement(new Options);ProductPicker.implement(new Events);$extend(ProductPicker,{picklets:[],add:function(A){if(!A.className){dbug.log("error: cannot add Picklet %o; missing className: %s",A,A.className);return ;}this.picklets[A.className]=A;},addAllThese:function(A){A.each(function(B){this.add(B);},this);},getPicklet:function(A){return ProductPicker.picklets[A]||false;}});var FormPickers=new Class({options:{inputs:"input",additionalShowLinkClass:"openPicker",pickletOptions:{}},initialize:function(B,A){this.setOptions(A);this.form=$(B);this.inputs=this.form.getElementsBySelector(this.options.inputs);this.setUpInputs();},setUpInputs:function(A){A=$pick(A,this.inputs);A.each(this.addPickers.bind(this));},addPickers:function(B){var A=[];B.className.split(" ").each(function(C){if(ProductPicker.getPicklet(C)){A.push(ProductPicker.getPicklet(C));}},this);if(B.getNext()&&B.getNext().hasClass(this.options.additionalShowLinkClass)){this.options.pickletOptions.additionalShowLinks=[B.getNext()];}if(A.length>0){new ProductPicker(B,A,this.options.pickletOptions);}}});FormPickers.implement(new Options);var CNETProductPickerBase={previewWidth:150,descriptiveName:"CNET Product Picker",url:"http://api.cnet.com/restApi/v1.0/techProductSearch",callBackKey:"callback",data:{partKey:"19926949750937665684988687810562",iod:"hlPrice",viewType:"json"},getQuery:function(A){$each(A,function(C,B){A[B]=unescape(C);});return new JsonP(this.options.url,{callBackKey:this.options.callBackKey,data:$merge(this.options.data,A)});},inputs:{query:{tagName:"input",type:"text",instructions:"",tip:"cnet product search::input a product name and hit &lt;enter&gt; to get results",value:"",style:{width:"100%"}}},previewHtml:function(C){var B="";var A='<div class="dataId" style="color: #999; font-weight:bold; margin: 0px; padding: 0px;">id: '+C["@id"]+'</div><div class="dataDetails" style="font-size: 10px;"><a href="'+C.ReviewURL.$+'"><img height="45" width="'+C.ImageURL[0]["@width"]+'" style="margin-left: 10px" src="'+C.ImageURL[1].$+'"/></a><br /><b><a href="'+C.ReviewURL.$+'">'+C.Name.$+"</a></b>";if(C.EditorsRating&&C.EditorsRating.$){A+="<br/>editors' rating: "+C.EditorsRating.$;}A+="<div>";if(C.LowPrice&&C.LowPrice.$){A+="<span class='productPickerPrices'>"+C.LowPrice.$+"</span>";}if(C.HighPrice&&C.HighPrice.$&&(C.LowPrice.$!=C.HighPrice.$)){A+=" to <span class='productPickerPrices'>"+C.HighPrice.$+"</span>";}A+="</div></div>";A+="<div>";if(C.Offers&&C.Offers["@numFound"]>0){A+="resellers: "+C.Offers["@numFound"];}A+="</div>";return A;},resultsList:function(A){if(A.CNETResponse.TechProducts&&A.CNETResponse.TechProducts["@numFound"]>0){if(A.CNETResponse.TechProducts["@numFound"]>1){return A.CNETResponse.TechProducts.TechProduct;}else{return[A.CNETResponse.TechProducts.TechProduct];}}return false;},listItemName:function(A){return A.Name.$;},listItemValue:function(A){return A["@id"];},updateInput:function(A,B){A.value=B["@id"];A.fireEvent("change");}};var CNETProductPicker=new Picklet("CNETProductPicker",CNETProductPickerBase);ProductPicker.add(CNETProductPicker);var CNETProductPicker_ReviewPath=new Picklet("CNETProductPicker_ReviewPath",$merge(CNETProductPickerBase,{descriptiveName:"CNET Product Picker: Review URL",updateInput:function(A,C){var B=C.ReviewURL.$;if(B.indexOf("?")>=0){B=B.substring(0,B.indexOf("?"));}A.value=B;A.fireEvent("change");}}));ProductPicker.add(CNETProductPicker_ReviewPath);var CNETProductPicker_PricePath=new Picklet("CNETProductPicker_ReviewPath",$merge(CNETProductPickerBase,{descriptiveName:"CNET Product Picker: Price URL",updateInput:function(A,C){var B=C.PriceURL.$;if(B.indexOf("?")>=0){B=B.substring(0,B.indexOf("?"));}A.value=B;A.fireEvent("change");}}));ProductPicker.add(CNETProductPicker_PricePath);var Confirmer=new Class({options:{reposition:true,positionOptions:{relativeTo:false,position:"upperRight",offset:{x:-225,y:0},zIndex:9999},msg:"your changes have been saved",msgContainerSelector:".body",delay:250,pause:500,effectOptions:{duration:500},prompterStyle:{padding:"2px 6px",border:"1px solid #9f0000",backgroundColor:"#f9d0d0",fontWeight:"bold",color:"#000",width:"210px"},onComplete:Class.empty},initialize:function(A){this.setOptions(A);this.options.positionOptions.relativeTo=this.options.positionOptions.relativeTo||document.body;this.prompter=($(this.options.msg))?$(this.options.msg):this.makePrompter(this.options.msg);if(this.options.reposition){this.prompter.setStyles({position:"absolute",display:"none",zIndex:this.options.positionOptions.zIndex});if(this.prompter.fxOpacityOk()){this.prompter.setStyle("opacity",0);}}else{if(this.prompter.fxOpacityOk()){this.prompter.setStyle("opacity",0);}else{this.prompter.setStyle("visibility","hidden");}}if(!this.prompter.getParent()){window.addEvent("domready",function(){this.prompter.injectInside(document.body);}.bind(this));}try{this.msgHolder=this.prompter.getElement(this.options.msgContainerSelector);if(!this.msgHolder){this.msgHolder=this.prompter;}}catch(B){dbug.log(B);}},makePrompter:function(B){try{return new Element("div").setStyles(this.options.prompterStyle).appendText(B);}catch(A){dbug.log(A);return prompter;}},prompt:function(A){if(!this.paused){this.stop();}var B=(A)?A.msg:false;A=$merge(this.options,{saveAsDefault:false},A||{});if($(A.msg)&&B){this.msgHolder.empty().adopt(A.msg);}else{if(!$(A.msg)&&A.msg){this.msgHolder.empty().appendText(A.msg);}}if(!this.paused){if(A.reposition){this.position(A.positionOptions);}(function(){this.timer=this.fade(A.pause);}).delay(A.delay,this);}if(A.saveAsDefault){this.setOptions(A);}},fade:function(A){this.paused=true;A=$pick(A,this.options.pause);if(!this.fx&&this.prompter.fxOpacityOk()){this.fx=this.prompter.effect("opacity",this.options.effectOptions);this.fx.clearChain();}if(this.options.reposition){this.prompter.setStyle("display","block");}if(this.prompter.fxOpacityOk()){this.prompter.setStyle("visibility","visible");this.fx.start(0,1).chain(function(){this.timer=(function(){this.fx.start(0).chain(function(){if(this.options.reposition){this.prompter.hide();}this.paused=false;}.bind(this));}).delay(A,this);}.bind(this));}else{this.prompter.setStyle("visibility","visible");this.timer=(function(){this.prompter.setStyle("visibility","hidden");this.fireEvent("onComplete");this.paused=false;}).delay(A+this.options.effectOptions.duration,this);}},stop:function(){this.paused=false;$clear($pick(this.timer,false));if(this.fx){this.fx.set(0);}if(this.options.reposition){this.prompter.hide();}},position:function(A){this.prompter.setPosition($merge(this.options.positionOptions,A));}});Confirmer.implement(new Options);Confirmer.implement(new Events);var Clipboard={swfLocation:"http://www.cnet.com/html/rb/assets/global/clipboard/_clipboard.swf",copyFromElement:function(A){A=$(A);if(!A){return null;}if(window.ie){try{window.addEvent("domready",function(){var D=A.createTextRange();if(D){D.execCommand("Copy");}});}catch(B){dbug.log("cannot copy to clipboard: %s",o);}}else{var C=(A.getSelectedText)?A.getSelectedText():A.getValue();if(C){Clipboard.copy(C);}}return A;},copy:function(B){if(window.ie){window.addEvent("domready",function(){var C=new Element("textarea",{styles:{display:"none"}}).injectInside(document.body);C.setProperty("value",B).select();Clipboard.copyFromElement(C);C.remove();});}else{var A=($("flashcopier"))?$("flashcopier"):new Element("div").setProperty("id","flashcopier").injectInside(document.body);A.empty();A.setHTML('<embed src="'+this.swfLocation+'" FlashVars="clipboard='+escape(B)+'" width="0" height="0" type="application/x-shockwave-flash"></embed>');}}};var HtmlTable=new Class({options:{properties:{cellpadding:0,cellspacing:0,border:0},rows:[]},initialize:function(A){this.setOptions(A);if(this.options.properties.className){this.options.properties["class"]=this.options.properties.className;delete this.options.properties.className;}this.table=new Element("table").setProperties(this.options.properties);this.tbody=new Element("tbody").injectInside(this.table);this.options.rows.each(this.push.bind(this));},push:function(C){var B=new Element("tr").injectInside(this.tbody);var A=C.map(function(F){var E=new Element("td").injectInside(B);if(F.properties){if(F.properties.className){F.properties["class"]=F.properties.className;delete F.properties.className;}E.setProperties(F.properties);}function D(G){if($(G)){E.adopt($(G));}else{E.setHTML(G);}}if(F.content){D(F.content);}else{D(F);}return E;},this);return{tr:B,tds:A};}});HtmlTable.implement(new Options);var Autocompleter={};Autocompleter.Base=new Class({options:{minLength:1,useSelection:true,markQuery:true,inheritWidth:true,dropDownWidth:100,maxChoices:10,injectChoice:null,onSelect:Class.empty,onShow:Class.empty,onHide:Class.empty,customTarget:null,className:"autocompleter-choices",zIndex:42,observerOptions:{},fxOptions:{},multi:false,delimeter:", ",autotrim:true,allowDupes:false,baseHref:"http://www.cnet.com/html/rb/assets/global/autocompleter/"},initialize:function(B,A){this.setOptions(A);if(!$("AutocompleterCss")){window.addEvent("domready",function(){new Asset.css(this.options.baseHref+"Autocompleter.css",{id:"AutocompleterCss"});}.bind(this));}this.element=$(B);this.build();this.observer=new Observer(this.element,this.prefetch.bind(this),$merge({delay:400},this.options.observerOptions));this.value=this.observer.value;this.queryValue=null;this.element.addEvent("blur",function(C){this.autoTrim.delay(50,this,C);}.bind(this));this.addEvent("onSelect",function(){this.element.focus();this.userChose=true;(function(){this.userChose=false;}).delay(100,this);}.bind(this));},build:function(){if($(this.options.customTarget)){this.choices=this.options.customTarget;}else{this.choices=new Element("ul",{"class":this.options.className,styles:{zIndex:this.options.zIndex}}).injectInside(document.body);this.fix=new OverlayFix(this.choices);}this.fx=this.choices.effect("opacity",$merge({wait:false,duration:200},this.options.fxOptions)).addEvent("onStart",function(){if(this.fx.now){return ;}this.choices.setStyle("display","");this.fix.show();}.bind(this)).addEvent("onComplete",function(){if(this.fx.now){return ;}this.choices.setStyle("display","none");this.fix.hide();}.bind(this)).set(0);this.element.setProperty("autocomplete","off").addEvent(window.ie?"keydown":"keypress",this.onCommand.bindWithEvent(this)).addEvent("mousedown",this.onCommand.bindWithEvent(this,[true])).addEvent("focus",this.toggleFocus.bind(this,[true])).addEvent("blur",this.toggleFocus.bind(this,[false])).addEvent("trash",this.destroy.bind(this));},autoTrim:function(B){if(this.userChose){return this.userChose=false;}var A=this.options.delimeter;var C=this.element.getValue();if(this.options.autotrim&&C.test(A+"$")){B=new Event(B);this.observer.value=this.element.value=C.substring(0,C.length-A.length);}return this.observer.value;},getQueryValue:function(A){A=$pick(A,this.observer.value);return(this.options.multi)?A.lastElement(this.options.delimeter).toString():A||"";},destroy:function(){this.choices.remove();},toggleFocus:function(A){this.focussed=A;if(!A){this.hideChoices();}},onCommand:function(B,A){var C=this.getQueryValue();if(A&&this.focussed){this.prefetch();}if(B.key){switch(B.key){case"enter":if(this.selected&&this.visible){this.choiceSelect(this.selected);B.stop();}return ;case"up":case"down":if(this.getQueryValue()!=(C||this.queryValue)){this.prefetch();}else{if(this.queryValue===null){break;}else{if(!this.visible){this.showChoices();}else{this.choiceOver((B.key=="up")?this.selected.getPrevious()||this.choices.getLast():this.selected.getNext()||this.choices.getFirst());this.setSelection();}}}B.stop();return ;case"esc":case"tab":this.hideChoices();if(this.options.multi){this.element.value=this.element.getValue().trimLastElement();}return ;}}this.value=false;},setSelection:function(){if(!this.options.useSelection){return ;}var I=this.options.delimeter;var G=this.getQueryValue(this.queryValue);var C=this.getQueryValue(this.element.getValue());var E;if(this.options.multi){var F=this.queryValue.lastIndexOf(I);var A=(F<0)?0:I.length;E=G.length+(F<0?0:F)+A;}else{E=G.length;}if(C.indexOf(G)!=0){return ;}var H=this.selected.inputValue.substr(E);if(window.ie){var B=document.selection.createRange();B.text=H;B.move("character",-H.length);B.findText(H);B.select();}else{var D=(this.options.multi&&this.element.value.test(I))?this.element.getValue().length-C.length+G.length:this.queryValue.length;this.element.value=this.element.value.substring(0,D)+H;this.element.selectionStart=D;this.element.selectionEnd=this.element.value.length;}this.value=this.observer.value=this.element.value;},hideChoices:function(){if(!this.visible){return ;}this.visible=this.value=false;this.observer.clear();this.fx.start(0);this.fireEvent("onHide",[this.element,this.choices]);},showChoices:function(){if(this.visible||!this.choices.getFirst()){return ;}this.visible=true;var A=this.element.getCoordinates(this.options.overflown);this.choices.setStyles({left:A.left,top:A.bottom});this.choices.setStyle("width",(this.options.inheritWidth)?A.width:this.options.dropDownWidth);this.fx.start(1);this.choiceOver(this.choices.getFirst());this.fireEvent("onShow",[this.element,this.choices]);},prefetch:function(){var A=this.getQueryValue(this.element.getValue());if(A.length<this.options.minLength){this.hideChoices();}else{if(A==this.queryValue){this.showChoices();}else{this.query();}}},updateChoices:function(A){this.choices.empty();this.selected=null;if(!A||!A.length){return ;}if(this.options.maxChoices<A.length){A.length=this.options.maxChoices;}A.each(this.options.injectChoice||function(B,C){var D=new Element("li").setHTML(this.markQueryValue(B));D.inputValue=B;this.addChoiceEvents(D).injectInside(this.choices);},this);this.showChoices();},choiceOver:function(A){if(this.selected){this.selected.removeClass("autocompleter-selected");}this.selected=A.addClass("autocompleter-selected");},choiceSelect:function(B){if(this.options.multi){var A=this.options.delimeter;var C=(this.element.value.trimLastElement(A)+B.inputValue).split(A);var D=[];if(!this.options.allowDupes){C.each(function(E){if(D.contains(E)){D.remove(E);}D.include(E);});}else{D=C;}this.observer.value=this.element.value=D.join(A)+A;}else{this.observer.value=this.element.value=B.inputValue;}this.hideChoices();this.fireEvent("onSelect",[this.element,B.inputValue],20);},markQueryValue:function(A){var B=(this.options.multi)?this.lastQueryElementValue:this.queryValue;return(this.options.markQuery&&B)?A.replace(new RegExp("^("+B.escapeRegExp()+")","i"),'<span class="autocompleter-queried">$1</span>'):A;},addChoiceEvents:function(A){return A.addEvents({mouseover:this.choiceOver.bind(this,[A]),mousedown:this.choiceSelect.bind(this,[A])});},query:Class.empty});Autocompleter.Base.implement(new Events);Autocompleter.Base.implement(new Options);var OverlayFix=new Class({initialize:function(A){this.element=$(A);if(window.ie){this.element.addEvent("trash",this.destroy.bind(this));this.fix=new Element("iframe",{properties:{frameborder:"0",scrolling:"no",src:"javascript:false;"},styles:{position:"absolute",border:"none",display:"none",filter:"progid:DXImageTransform.Microsoft.Alpha(opacity=0)"}}).injectAfter(this.element);}},show:function(){if(this.fix){this.fix.setStyles($extend(this.element.getCoordinates(),{display:"",zIndex:(this.element.getStyle("zIndex")||1)-1}));}return this;},hide:function(){if(this.fix){this.fix.setStyle("display","none");}return this;},destroy:function(){this.fix.remove();}});String.extend({lastElement:function(D){D=D||" ";var B=this;var C=B.lastIndexOf(D);var A=(C==-1)?B:B.substr(C+D.length,B.length);return A;},trimLastElement:function(C){C=C||" ";var A=this;var B=this.lastIndexOf(C);return(B==-1)?"":A.substr(0,B+C.length);}});Autocompleter.JsonP=Autocompleter.Base.extend({options:{postVar:"query",jsonpOptions:{},onRequest:Class.empty,onComplete:Class.empty,minLength:1,filterResponse:null},initialize:function(C,B,A){this.url=B;this.parent(C,A);if(this.options.filterResponse){this.filterResponse=this.options.filterResponse.bind(this);}},query:function(){var B=this.options.multi;var A=$extend({},this.options.jsonpOptions.data);if(B){this.lastQueryElementValue=this.element.value.lastElement(this.options.delimeter);}A[this.options.postVar]=(B)?this.lastQueryElementValue:this.element.value;this.jsonp=new JsonP(this.url,$merge({data:A},this.options.jsonpOptions));this.jsonp.addEvent("onComplete",this.queryResponse.bind(this));this.fireEvent("onRequest",[this.element,this.jsonp]);this.jsonp.request();},queryResponse:function(B){try{this.value=this.queryValue=this.element.value;var C=this.filterResponse(B);this.selected=false;this.hideChoices();}catch(A){try{dbug.log("jsonp request error: ",A);}catch(A){}}this.fireEvent(C?"onComplete":"onFailure",[this.element,C],20);if(!C||!C.length){return ;}this.updateChoices(C);},filterResponse:function(B){var A=new RegExp("^"+this.queryValue.escapeRegExp(),"i");return this.tokens.filter(function(C){return A.test(C);});}});Autocompleter.Local=Autocompleter.Base.extend({options:{minLength:0,filterTokens:null},initialize:function(B,C,A){this.parent(B,A);this.tokens=C;if(this.options.filterTokens){this.filterTokens=this.options.filterTokens.bind(this);}},query:function(){this.hideChoices();this.queryValue=(this.options.multi)?this.element.value.lastElement(this.options.delimeter).trim():this.element.value;this.updateChoices(this.filterTokens());},filterTokens:function(A){var B=new RegExp("^"+this.queryValue.escapeRegExp(),"i");return this.tokens.filter(function(C){return B.test(C);});}});Autocompleter.Ajax={};Autocompleter.Ajax.Base=Autocompleter.Base.extend({options:{postVar:"value",postData:{},ajaxOptions:{},onRequest:Class.empty,onComplete:Class.empty},initialize:function(C,B,A){this.parent(C,A);this.ajax=new Ajax(B,$merge({autoCancel:true},this.options.ajaxOptions));this.ajax.addEvent("onComplete",this.queryResponse.bind(this));this.ajax.addEvent("onFailure",this.queryResponse.bind(this,[false]));},query:function(){var B=this.options.multi;var A=$extend({},this.options.postData);if(B){this.lastQueryElementValue=this.element.value.lastElement(this.options.delimeter);}A[this.options.postVar]=(B)?this.lastQueryElementValue:this.element.value;this.fireEvent("onRequest",[this.element,this.ajax]);this.ajax.request(A);},queryResponse:function(A){this.value=this.queryValue=this.element.value;this.selected=false;this.hideChoices();this.fireEvent(A?"onComplete":"onFailure",[this.element,this.ajax],20);}});Autocompleter.Ajax.Json=Autocompleter.Ajax.Base.extend({queryResponse:function(A){this.parent(A);var B=Json.evaluate(A||false);if(!B||!B.length){return ;}this.updateChoices(B);}});Autocompleter.Ajax.Xhtml=Autocompleter.Ajax.Base.extend({options:{parseChoices:null},queryResponse:function(A){this.parent(A);if(!A){return ;}this.choices.setHTML(A).getChildren().each(this.options.parseChoices||this.parseChoices,this);this.showChoices();},parseChoices:function(A){var B=A.innerHTML;A.inputValue=B;A.setHTML(this.markQueryValue(B));}});var Observer=new Class({options:{periodical:false,delay:1000},initialize:function(C,A,B){this.setOptions(B);this.addEvent("onFired",A);this.element=$(C);this.listener=this.fired.bind(this);this.value=this.element.getValue();if(this.options.periodical){this.timer=this.listener.periodical(this.options.periodical);}else{this.element.addEvent("keyup",this.listener);}},fired:function(){var A=this.element.getValue();if(this.value==A){return ;}this.clear();this.value=A;this.timeout=this.fireEvent.delay(this.options.delay,this,["onFired",[A]]);},clear:function(){$clear(this.timeout);return this;}});Observer.implement(new Options);Observer.implement(new Events);var Lightbox=new Class({options:{resizeDuration:400,resizeTransition:false,initialWidth:250,initialHeight:250,zIndex:10,animateCaption:true,showCounter:true,autoScanLinks:true,relString:"lightbox",useDefaultCss:true,assetBaseUrl:"http://www.cnet.com/html/rb/assets/global/slimbox/",onImageShow:Class.empty,onDisplay:Class.empty,onHide:Class.empty,overlayStyles:{}},initialize:function(A,B){this.setOptions(A);this.anchors=B||[];if(this.options.autoScanLinks){$$("a").each(function(C){if(C.getProperty("rel")&&C.getProperty("rel").test("^"+this.options.relString,"i")){if(!C.getProperty("lightboxed")){this.anchors.push(C);}}},this);}if(!$$(this.anchors).length){return ;}if(this.options.useDefaultCss){this.addCss();}$$(this.anchors).each(function(C){if(!C.getProperty("lightboxed")){C.setProperty("lightboxed",true);C.addEvent("click",function(D){new Event(D).stop();this.click(C);}.bind(this));}}.bind(this));this.eventKeyDown=this.keyboardListener.bindAsEventListener(this);this.eventPosition=this.position.bind(this);window.addEvent("domready",this.addHtmlElements.bind(this));},addHtmlElements:function(){this.overlay=new Element("div",{"class":"lbOverlay",styles:{"z-index":this.options.zIndex}}).injectInside(document.body).setStyles(this.options.overlayStyles);this.center=new Element("div",{styles:{width:this.options.initialWidth+"px",height:this.options.initialHeight+"px","margin-left":(-(this.options.initialWidth/2))+"px",display:"none","z-index":this.options.zIndex+1}}).injectInside(document.body).addClass("lbCenter");this.image=new Element("div",{"class":"lbImage"}).injectInside(this.center);this.prevLink=new Element("a",{"class":"lbPrevLink",href:"javascript:void(0);",styles:{display:"none"}}).injectInside(this.image);this.nextLink=this.prevLink.clone().removeClass("lbPrevLink").addClass("lbNextLink").injectInside(this.image);this.prevLink.addEvent("click",this.previous.bind(this));this.nextLink.addEvent("click",this.next.bind(this));this.bottomContainer=new Element("div",{"class":"lbBottomContainer",styles:{display:"none","z-index":this.options.zIndex+1}}).injectInside(document.body);this.bottom=new Element("div",{"class":"lbBottom"}).injectInside(this.bottomContainer);new Element("a",{"class":"lbCloseLink",href:"#"}).injectInside(this.bottom).onclick=this.overlay.onclick=this.close.bind(this);this.caption=new Element("div",{"class":"lbCaption"}).injectInside(this.bottom);this.number=new Element("div",{"class":"lbNumber"}).injectInside(this.bottom);new Element("div",{styles:{clear:"both"}}).injectInside(this.bottom);var A=this.nextEffect.bind(this);this.fx={overlay:this.overlay.effect("opacity",{duration:500}).hide(),resize:this.center.effects($extend({duration:this.options.resizeDuration,onComplete:A},this.options.resizeTransition?{transition:this.options.resizeTransition}:{})),image:this.image.effect("opacity",{duration:500,onComplete:A}),bottom:this.bottom.effect("margin-top",{duration:400,onComplete:A})};this.preloadPrev=new Element("img");this.preloadNext=new Element("img");},addCss:function(){window.addEvent("domready",function(){if(!$("SlimboxCss")){new Asset.css(this.options.assetBaseUrl+"slimbox.css",{id:"SlimboxCss"});}}.bind(this));},click:function(E){E=$(E);var B=E.getProperty("rel")||this.options.relString;if(B==this.options.relString){return this.show(E.href,E.title);}var D,C,A=[];this.anchors.each(function(F){if(F.getProperty("rel")==E.getProperty("rel")){for(D=0;D<A.length;D++){if(A[D][0]==F.href){break;}}if(D==A.length){A.push([F.href,F.title]);if(F.href==E.href){C=D;}}}},this);return this.open(A,C);},show:function(A,B){return this.open([[A,B]],0);},open:function(A,B){this.fireEvent("onDisplay");this.images=A;this.position();this.setup(true);this.top=(window.getScrollTop()+(window.getHeight()/15)).toInt();this.center.setStyles({top:this.top+"px",display:""});this.fx.overlay.start(0.8);return this.changeImage(B);},position:function(){this.overlay.setStyles({top:window.getScrollTop()+"px",height:window.getHeight()+"px"});},setup:function(A){var C=$$("object, iframe");C.extend($$(window.ie?"select":"embed"));C.each(function(D){if(A){D.lbBackupStyle=D.getStyle("visibility");}var E=(A?"hidden":D.lbBackupStyle);D.setStyle("visibility",E);});var B=A?"addEvent":"removeEvent";window[B]("scroll",this.eventPosition)[B]("resize",this.eventPosition);document[B]("keydown",this.eventKeyDown);this.step=0;},keyboardListener:function(A){switch(A.keyCode){case 27:case 88:case 67:this.close();break;case 37:case 80:this.previous();break;case 39:case 78:this.next();}},previous:function(){return this.changeImage(this.activeImage-1);},next:function(){return this.changeImage(this.activeImage+1);},changeImage:function(A){this.fireEvent("onImageShow",A);if(this.step||(A<0)||(A>=this.images.length)){return false;}this.step=1;this.activeImage=A;this.center.setStyle("backgroundColor","");this.bottomContainer.setStyle("display","none");this.prevLink.setStyle("display","none");this.nextLink.setStyle("display","none");this.fx.image.hide();this.center.addClass("lbLoading");this.preload=new Element("img").addEvent("load",this.nextEffect.bind(this)).setProperty("src",this.images[A][0]);return false;},nextEffect:function(){switch(this.step++){case 1:this.image.setStyle("backgroundImage","url("+this.images[this.activeImage][0]+")");this.image.setStyle("width",this.preload.width+"px");this.bottom.setStyle("width",this.preload.width+"px");this.image.setStyle("height",this.preload.height+"px");this.prevLink.setStyle("height",this.preload.height+"px");this.nextLink.setStyle("height",this.preload.height+"px");this.caption.setHTML(this.images[this.activeImage][1]||"");this.number.setHTML((!this.options.showCounter||(this.images.length==1))?"":"Image "+(this.activeImage+1)+" of "+this.images.length);if(this.activeImage){$(this.preloadPrev).setProperty("src",this.images[this.activeImage-1][0]);}if(this.activeImage!=(this.images.length-1)){$(this.preloadNext).setProperty("src",this.images[this.activeImage+1][0]);}if(this.center.clientHeight!=this.image.offsetHeight){this.fx.resize.start({height:this.image.offsetHeight});break;}this.step++;case 2:if(this.center.clientWidth!=this.image.offsetWidth){this.fx.resize.start({width:this.image.offsetWidth,marginLeft:-this.image.offsetWidth/2});break;}this.step++;case 3:this.bottomContainer.setStyles({top:(this.top+this.center.getSize().size.y)+"px",height:"0px",marginLeft:this.center.getStyle("margin-left"),display:""});this.fx.image.start(1);break;case 4:this.center.style.backgroundColor="#000";if(this.options.animateCaption){this.fx.bottom.set(-this.bottom.offsetHeight);this.bottomContainer.setStyle("height","");this.fx.bottom.start(0);break;}this.bottomContainer.style.height="";case 5:if(this.activeImage){this.prevLink.setStyle("display","");}if(this.activeImage!=(this.images.length-1)){this.nextLink.setStyle("display","");}this.step=0;}},close:function(){this.fireEvent("onHide");if(this.step<0){return ;}this.step=-1;if(this.preload){this.preload.onload=Class.empty;this.preload=null;}for(var A in this.fx){this.fx[A].stop();}this.center.setStyle("display","none");this.bottomContainer.setStyle("display","none");this.fx.overlay.chain(this.setup.pass(false,this)).start(0);return ;}});Lightbox.implement(new Options);Lightbox.implement(new Events);window.addEvent("domready",function(){new Lightbox();});var SimpleEditor=new Class({initialize:function(B,C,A){this.commands=new Hash($merge(SimpleEditor.commands,A||{}));this.input=$(B);this.buttons=$$(C);this.buttons.each(function(D){D.addEvent("click",function(){this.exec(D.getProperty("rel"));}.bind(this));}.bind(this));this.input.addEvent("keydown",function(E){E=new Event(E);if(E.control){var D=this.shortCutToKey(E.key);if(D){E.stop();this.exec(D);}}}.bind(this));},shortCutToKey:function(B){var A=false;this.commands.each(function(D,C){if(D.shortcut==B){A=C;}});return A;},addCommand:function(B,C,A){this.commands.set(B,{command:C,shortcut:A});},addCommands:function(A){this.commands.extend(A);},exec:function(A){var B;if(this.input.scrollTop||this.input.scrollLeft){B={scrollTop:this.input.scrollTop,scrollLeft:this.input.scrollLeft};}if(this.commands.hasKey(A)){this.commands.get(A).command(this.input);}if(B){this.input.scrollTop=B.scrollTop;this.input.scrollLeft=B.scrollLeft;}}});$extend(SimpleEditor,{commands:{},addCommand:function(B,C,A){SimpleEditor.commands[B]={command:C,shortcut:A};},addCommands:function(A){$extend(SimpleEditor.commands,A);}});SimpleEditor.addCommands({bold:{shortcut:"b",command:function(A){A.insertAroundCursor({before:"<b>",after:"</b>"});}},underline:{shortcut:"u",command:function(A){A.insertAroundCursor({before:"<u>",after:"</u>"});}},anchor:{shortcut:"l",command:function(A){function D(){if(window.TagMaker){if(!this.linkBuilder){this.linkBuilder=new TagMaker.anchor();}this.linkBuilder.prompt(A);}else{var E=window.prompt("The URL for the link");var F={before:'<a href="'+E+'">',after:"</a>"};if(!A.getSelectedText()){F.defaultMiddle=window.prompt("The link text");}A.insertAroundCursor(F);}}try{if(Trinket){if(!this.linkBulder){var B=Trinket.available.filter(function(E){return E.name=="Link Builder";});this.linkBuilder=(B.length)?B[0]:new Trinket.LinkBuilder({context:"default"});this.linkBuilder.clickPrompt(A);}}else{D();}}catch(C){D();}}},copy:{shortcut:false,command:function(A){if(Clipboard){Clipboard.copyFromElement(A);}else{simpleErrorPopup("Woops","Sorry, this function doesn't work here; use ctrl+c.");}A.focus();}},cut:{shortcut:false,command:function(A){if(Clipboard){Clipboard.copyFromElement(A);A.insertAtCursor("");}else{simpleErrorPopup("Woops","Sorry, this function doesn't work here; use ctrl+x.");}}},hr:{shortcut:"-",command:function(A){A.insertAtCursor("\n<hr/>\n");}},img:{shortcut:"g",command:function(A){if(window.TagMaker){if(!this.anchorBuilder){this.anchorBuilder=new TagMaker.image();}this.anchorBuilder.prompt(A);}else{A.insertAtCursor('<img src="'+window.prompt("The url to the image")+'" />');}}},stripTags:{shortcut:"\\",command:function(A){A.insertAtCursor(A.getSelectedText().stripTags());}},sup:{shortcut:false,command:function(A){A.insertAroundCursor({before:"<sup>",after:"</sup>"});}},sub:{shortcut:false,command:function(A){A.insertAroundCursor({before:"<sub>",after:"</sub>"});}},paragraph:{shortcut:"enter",command:function(A){A.insertAroundCursor({before:"\n<p>\n",after:"\n</p>\n"});}},strike:{shortcut:"k",command:function(A){A.insertAroundCursor({before:"<strike>",after:"</strike>"});}},italics:{shortcut:"i",command:function(A){A.insertAroundCursor({before:"<i>",after:"</i>"});}},bullets:{shortcut:"8",command:function(A){A.insertAroundCursor({before:"<ul>\n	<li>",after:"</li>\n</ul>"});}},numberList:{shortcut:"=",command:function(A){A.insertAroundCursor({before:"<ol>\n	<li>",after:"</li>\n</ol>"});}},clean:{shortcut:false,command:function(A){A.tidy();}},preview:{shortcut:false,command:function(A){try{if(!this.container){this.container=new Element("div",{styles:{border:"1px solid black",padding:8,height:300,overflow:"auto"}});this.preview=new StickyWinModal({content:stickyWinHTML("preview",this.container,{width:600,buttons:[{text:"close",onClick:function(){this.container.empty();}.bind(this)}]}),showNow:false});}this.container.setHTML(A.getValue());this.preview.show();}catch(B){dbug.log("you need StickyWinModal and stickyWinHTML");}}}});var CNETAPI={register:function(C,A){CNETAPI.apps[C]=$merge({apiUrl:"http://api.cnet.com/restApi/v1.0"},A);var B=CNETAPI.apps[C].partKey;if(B){CNETAPI.apps[C].partKey=B.toString();}},get:function(A){return CNETAPI.apps[A];}};CNETAPI.apps={};CNETAPI.register("default");CNETAPI.Utils={};CNETAPI.Utils.Base=new Class({options:{applicationName:"default",jsonpOptions:{data:{viewType:"json"}},onComplete:Class.empty,onSuccess:Class.empty,onError:Class.empty,instantiateResults:false,resultClass:null,errorPath:"CNETResponse.Error.ErrorMessage.$"},initialize:function(A){var B={};this.app=(A&&A.applicationName)?CNETAPI.get(A.applicationName):CNETAPI.get(this.options.applicationName);if(this.app.partKey){B.partKey=this.app.partKey;}if(this.app.partTag){B.partTag=this.app.partTag;}this.setOptions($merge({jsonpOptions:{data:B}},A));},getQuery:function(D,C){C.data=C.data||{};$each(C.data,function(F,E){C.data[E]=$type(F)=="string"?unescape(F):F;});if(this.app.requestUrl){var A=Object.toQueryString(C.data);C.data={cnetApiRequest:escape(D+"?"+A)};D=this.app.requestUrl;}var B=new JsonP(D||"",C);return B;},packer:function(A){if($type(A)=="array"){A=A.filter(function(B){return B;});}else{if(A){A=[A];}else{A=[];}}if(this.options.instantiateResults&&this.options.resultClass){return A.map(function(B){return new this.options.resultClass(B);},this);}else{return A;}},getMemberByPath:function(B,A){if(A===""||A=="top"||!A){return B;}var C=B;A.split(".").each(function(D){if(D===""){return ;}if(C[D]){C=C[D];}else{C=B;}},this);return(C==B)?false:C;},handleApiResults:function(C,B){var A=this.getMemberByPath(C,this.options.errorPath);return(A)?A:this.getMemberByPath(C,B);},request:function(C,B,E){var A=$merge(this.options.jsonpOptions,{data:C});var D=this.getQuery(this.app.apiUrl+B,A);D.addEvent("onComplete",function(F){F=this.handleApiResults(F,E);if($type(F)=="string"){dbug.log("CNET API Error: ",F);this.fireEvent("onError",[F,D,this]);}else{this.fireEvent("onSuccess",[this.packer(F),D,this]);}this.fireEvent("onComplete",[this.packer(F),D,this]);}.bind(this));D.request();return this;},throwErr:function(B){function A(C){this.message=C;this.name="CNETAPI.Utils Exception:";}A.prototype.toString=function(){return this.name+': "'+this.message+'"';};throw new A(B);}});CNETAPI.Utils.Base.implement(new Options,new Events);CNETAPI.Object=new Class({options:{applicationName:"default",onSuccess:Class.empty,onError:Class.empty,extraLookupData:{},type:""},ready:false,initialize:function(B,A){this.setOptions(A);this.app=CNETAPI.get(this.options.applicationName);this.type=this.options.type;B=($type(B)=="array"&&B.length==1)?B[0]:B;if(!B){return ;}if($type(B)=="object"){this.parseData(B);}else{if($type(B)=="number"){this.get(B);}}return ;},get:function(C){try{this.makeLookup().get(C);}catch(A){var B="Error: error on GET: ";dbug.log(B,A);this.fireEvent("onError",B+A.message);}},process:function(B){var A={};$H(B).each(function(D,C){C=this.cleanKey(C);switch($type(D)){case"array":A[C]=D.map(function(E){return this.clean(E,C,C);},this);break;default:A[C]=this.clean(D,C,C);}},this);return A;},cleanKey:function(A){return($type(A)=="string"&&A.test("^@"))?A.substring(1):A;},clean:function(D,B,E){switch($type(D)){case"string":if(D=="false"){D=false;}if(D=="true"){D=true;}if($chk(Number(D))){D=Number(D);}return D;case"function":return D;case"array":return D.map(function(F,G){return this.clean(F,G,E+"."+B);},this);break;default:var A=$H(D);if(D.$&&A.length==1){return D.$;}else{var C={};A.each(function(G,F){F=this.cleanKey(F);if($type(G)=="object"&&G.$&&F.test("url","i")&&G.$.test("restApi")){C.walk=C.walk||{};C.walk[F]=this.follow.pass([G.$,F,E],this);}C[F]=this.clean(G,F,E+"."+B);},this);return C;}}return this;},makeLookup:function(){return new CNETAPI.Utils[this.options.type]($merge(this.options.extraLookupData,{instantiateResults:false,onError:this.handleError.bind(this),onSuccess:this.parseData.bind(this),applicationName:this.app.applicationName}));},handleError:function(A){this.fireEvent("onError",A);},parseData:function(A){A=($type(A)=="array"&&A.length==1)?A[0]:A;this.json=A;this.data=this.process(A);this.ready=true;this.callChain();this.fireEvent("onSuccess",[this,this.data,this.json]);},follow:function(B,A,C){dbug.log(A,B,C);}});CNETAPI.Object.implement(new Options,new Events,new Chain);CNETAPI.TechProduct=CNETAPI.Object.extend({options:{type:"TechProduct"}});CNETAPI.SoftwareProduct=CNETAPI.Object.extend({options:{type:"SoftwareProduct"},getSet:function(C){try{this.makeLookup().getSet(C);}catch(A){var B="Error: error on getSet: ";dbug.log(B,A);this.fireEvent("onError",B+A.message);}}});CNETAPI.Category=CNETAPI.Object.extend({options:{type:"Category",siteId:null},initialize:function(B,A){this.children=[];if(A){this.setSiteId(A.siteId);}this.parent(B,A);},setSiteId:function(A){this.setOptions({extraLookupData:{siteId:$chk(A)?A:this.options.siteId}});return this.options.extraLookupData.siteId;},getChildren:function(B,C){var F=function(G){this.children=G.map(function(H){H.options.siteId=D;return H;});this.callChain();}.bind(this);if(this.data.isLeaf){F([]);return this;}B=B||{};var D=this.setSiteId(B.siteId);if(!$chk(D)){var E="Error: you must supply a site id for category lookups.";dbug.log(E);this.fireEvent("onError",E);return null;}else{if(this.data.id){var A=new CNETAPI.Utils[this.options.type]($merge({instantiateResults:true,resultClass:CNETAPI.Category,applicationName:this.app.applicationName},B)).addEvent("onSuccess",F);A.getChildren(this.data.id,$merge(this.options.extraLookupData,C||{}));return this;}else{return null;}}return this;}});CNETAPI.NewsStory=CNETAPI.Object.extend({options:{type:"NewsStory"}});CNETAPI.NewsGallery=CNETAPI.Object.extend({options:{type:"NewsGallery"}});CNETAPI.Utils.SearchPaths={TechProduct:"/techProductSearch",NewsGallery:"/newsGallerySearch",NewsStory:"/newsStorySearch",SoftwareProduct:"/softwareProductSearch"};CNETAPI.Utils.TechProduct=CNETAPI.Utils.Base.extend({options:{resultClass:CNETAPI.TechProduct,instantiateResults:true,searchPath:CNETAPI.Utils.SearchPaths.TechProduct},search:function(B,A){return this.request($merge({query:B},A),this.options.searchPath,"CNETResponse.TechProducts.TechProduct");},get:function(B,A){return this.request($merge({productId:B},A),"/techProduct","CNETResponse.TechProduct");},getMany:function(A,B){return this.request($merge({productIds:A},B),"/techProduct","CNETResponse.TechProducts.TechProduct");}});CNETAPI.Utils.SoftwareProduct=CNETAPI.Utils.Base.extend({options:{resultClass:CNETAPI.SoftwareProduct,instantiateResults:true,searchPath:CNETAPI.Utils.SearchPaths.SoftwareProduct},search:function(B,A){return this.request($merge({query:B},A),this.options.searchPath,"CNETResponse.SoftwareProducts.SoftwareProduct");},getSet:function(B,A){return this.request($merge({productSetId:B},A),"/softwareProduct","CNETResponse.SoftwareProduct");},get:function(B,A){return this.request($merge({productId:B},A),"/softwareProduct","CNETResponse.SoftwareProduct");},getMany:function(A,B){return this.request($merge({productIds:A},B),"/softwareProduct","CNETResponse.SoftwareProducts.SoftwareProduct");},getManySets:function(A,B){return this.request($merge({productSetIds:A},B),"/softwareProduct","CNETResponse.SoftwareProducts.SoftwareProducts");}});CNETAPI.Utils.NewsStory=CNETAPI.Utils.Base.extend({options:{resultClass:CNETAPI.NewsStory,instantiateResults:true,searchPath:CNETAPI.Utils.SearchPaths.NewsStory},search:function(B,A){return this.request($merge({query:B},A),this.options.searchPath,"CNETResponse.NewsStories.NewsStory");},get:function(B,A){return this.request($merge({storyId:B},A),this.options.searchPath,"CNETResponse.NewsStory");},getMany:function(A,B){return this.request($merge({storyIds:A},B),"/newStory","CNETResponse.NewsStories.NewsStory");}});CNETAPI.Utils.NewsGallery=CNETAPI.Utils.Base.extend({options:{resultClass:CNETAPI.NewsGallery,instantiateResults:true,searchPath:CNETAPI.Utils.SearchPaths.NewsGallery},search:function(B,A){return this.request($merge({query:B},A),this.options.searchPath,"CNETResponse.NewsStories.NewsStory");},get:function(B,A){return this.request($merge({galleryId:B},A),this.options.searchPath,"CNETResponse.NewsStory");},getMany:function(A,B){return this.request($merge({galleryIds:A},B),"/newsGallery","CNETResponse.NewsGalleries.NewsGallery");}});CNETAPI.Utils.Category=CNETAPI.Utils.Base.extend({options:{resultClass:CNETAPI.Category,instantiateResults:true,siteId:null,searchPath:CNETAPI.Utils.SearchPaths.TechProduct},packer:function(A){A=this.parent(A);return A.map(function(B){B.options.siteId=this.options.siteId;return B;},this);},get:function(B,A){A=A||{};A.siteId=A.siteId||this.options.siteId;if(!$chk(A.siteId)){dbug.log("You must supply a site id for category lookups");this.throwErr("You must supply a site id for category lookups");}this.options.siteId=A.siteId;return this.request($merge({categoryId:B},A),"/category","CNETResponse.Category");},getMany:function(A,B){return this.request($merge({categoryIds:A},B),"/category","CNETResponse.Categories.Category");},getChildren:function(B,A){A=A||{};A.siteId=A.siteId||this.options.siteId;if(!$chk(A.siteId)){dbug.log("You must supply a site id for category lookups");this.throwErr("You must supply a site id for category lookups");}return this.request($chk(B)?$merge({categoryId:B},A):A,"/childCategories","CNETResponse.ChildCategories.Category");},search:function(C,A,B){B=$merge({results:1,iod:"relatedCats"},B);return this.request($merge({query:C},B),A||this.options.searchPath,"CNETResponse.RelatedCategories");}});function setCNETAssetBaseHref(B){if(typeof stickyWinHTML!="undefined"){var C=stickyWinHTML.bind(window);stickyWinHTML=function(E,D,F){return C(E,D,$merge({baseHref:B+"/stickyWinHTML/"},F));};}if(typeof TagMaker!="undefined"){TagMaker=TagMaker.extend({options:{baseHref:B+"/tips/"}});}if(typeof simpleErrorPopup!="undefined"){var A=simpleErrorPopup.bind(window);simpleErrorPopup=function(F,E,D){return A(F,E,D||D+"/simple.error.popup");};}if(typeof ProductPicker!="undefined"){ProductPicker=ProductPicker.extend({options:{baseHref:B+"/Picker"}});}if(typeof Autocompleter!="undefined"){Autocompleter.Base=Autocompleter.Base.extend({options:{baseHref:B+"/autocompleter/"}});}if(typeof Lightbox!="undefined"){Lightbox=Lightbox.extend({options:{assetBaseUrl:B+"/slimbox/"}});}if(typeof Waiter!="undefined"){Waiter=Waiter.extend({options:{baseHref:B+"/waiter/"}});}}