
   if(!dbugScripts("techtracker",["techtracker.tron.userlist.manage.js"])) {
   /*	techtracker.tron.userlist.manage.js - packed	*/
       var ModalForm=new Class({Implements:Options,options:{modalId:"",popupContents:"default",counterFields:null,resetOnClose:false,clearOnReset:false,useCaptcha:false,onFormSubmitSuccess:"",onFormSubmitFail:"",requireLogin:false},initialize:function(B,A){this.setOptions(A);this.element=$$(B);this.initModalForm();},initModalForm:function(){dbug.log("init modal");this.modalForm=new GlobalModal({id:this.options.modalId,content:$(this.options.popupContents).toggleClass("globalModal"),onClose:function(){if(this.options.resetOnClose){this.resetForm();}}.bind(this)});this.form=$(this.options.modalId).getElement("form");this.modalFormValidator=new ModalFormValidator(this.form,{evaluateFieldsOnBlur:false,evaluateFieldsOnChange:false,evaluateOnSubmit:false});this.form.addEvent("submit",function(A){A.stop();if(!this.modalFormValidator.validate()){return ;}new ModalFormRequest({url:this.form.get("action"),data:this.form.toQueryString(),onSuccess:this.options.onFormSubmitSuccess.bind(this),onFailure:this.options.onFormSubmitFail.bind(this)}).send();}.bind(this));if(this.options.counterFields!=null){this.options.counterFields.field.each(function(B,A){this.fieldCounter(this.form.getElement(B),this.form.getElement(this.options.counterFields.counter[A]));}.bind(this));}$$(this.element).addEvent("click",function(){dbug.log("click");if(this.options.requireLogin){if(!UserVars.isLoggedIn()){CURS.Manager.checkLogin({loginHed:"Log in to CNET to report this profile",registerHed:"Join CNET to report this profile",appId:103,nextAction:function(){new Jlogger({tag:"ropProfile",element:false,ctype:"overlay;source",cval:"login;rop"}).ping();this.showModalForm.bind(this);}.bind(this)});}else{this.showModalForm();}}else{this.showModalForm();}}.bind(this));},showModalForm:function(){if(this.options.useCaptcha){this.getCaptcha();}this.modalForm.show();},resetForm:function(){this.modalFormValidator.reset();this.modalFormValidator.paused=false;this.form.setStyle("display","block");this.form.getParent().getElements(".emailSuccess, .emailFail").dispose();if(this.form.getElement("p span")){this.form.getElement("p span").set("text","0");this.form.getElement("p span").removeClass("validation-advice");}if(this.options.clearOnReset){this.form.reset();}},getCaptcha:function(){new Request({method:"get",url:"/8708-5_1-0.html?CAPTCHA=id&nomesh&refresh="+new Date().getTime(),onComplete:function(A){if(A){var B=A.trim();$exec(B);var C=new Element("a",{href:"javascript:void(0);","class":"refreshCaptcha",id:"getCaptchaCode"}).set("text","Try a new code");C.addEvent("click",function(){this.getCaptcha();}.bind(this));C.inject($$("#captcha input")[0],"after");$("captcha").getElement("input[name=CAPTCHA_RESPONSE]").addClass("required");}}.bind(this)}).send();},fieldCounter:function(A,C){var B=A.get("validatorProps");if(!B){return ;}B=JSON.decode(B);if(!B&&!B.maxLength){return ;}this.updateCounter(A,B,C);A.addEvent("keyup",function(){this.updateCounter(A,B,C);}.bind(this));},updateCounter:function(B,C,D){var A=B.value.trim().length;D.set("text",A);if((A<(C.minLength||0))||(A>C.maxLength)){D.addClass("validation-advice");}else{D.removeClass("validation-advice");}}});var ModalFormRequest=new Class({Extends:Request,processScripts:function(A){if(this.options.evalResponse){return $exec(A);}return A.stripScripts(this.options.evalScripts);}});var ModalFormValidator=new Class({Extends:FormValidator,makeAdvice:function(D,F,C,G){var E=(G)?this.options.warningPrefix:this.options.errorPrefix;E+=(this.options.useTitles)?F.title||C:C;var B=this.getAdvice(D,F);if(!B){var A=(G)?"warning-advice":"validation-advice";B=new Element("div",{text:E,styles:{display:"none"},id:"advice-"+D+"-"+this.getFieldId(F)}).addClass(A);}else{B.set("text",E);}return B;}});if(WatchList==undefined){var WatchList={};}WatchList.Prefs=new Class({Implements:Options,options:{},initialize:function(B,A){this.shell=$(B);this.getPreferences();this.ping=new Request({url:"/8689-4_"+PageVars.get("siteId")+"-0.html"});},getPreferences:function(){this.prefs={"DLWatchlistAutoAdd-SW_PS":Cookie.read("DLWatchlistAutoAdd-SW_PS")||"true","DLWatchlistAutoAdd-SW_PS-TTAlert":Cookie.read("DLWatchlistAutoAdd-SW_PS-TTAlert")||"true","DLWatchlistAutoAdd-SW_PS-SYRAlert":Cookie.read("DLWatchlistAutoAdd-SW_PS-SYRAlert")||"true",DLWatchlistEmailFreq:Cookie.read("DLWatchlistEmailFreq")||"1"};this.initPrefs();},initPrefs:function(){this.shell.getElements("input[type=checkbox]").each(function(B){var A=B.get("name");B.set("checked",(this.prefs[A]!="false")?"checked":"");B.addEvent("click",this.updateCheck.pass(B,this));}.bind(this));this.shell.getElements("select").each(function(B){var A=B.get("name");B.getElements("option").each(function(C){if(C.get("value")==this.prefs[A]){C.setProperty("selected","selected");}else{C.removeProperty("selected");}}.bind(this));B.addEvent("change",this.updateSelect.pass(B,this));}.bind(this));},updateCheck:function(B){var A=B.get("name");this.prefs[A]=(B.get("checked"))?"true":"false";if(B.hasClass("ping")){this.pingPref({watchListEmailFrequencyDays:(this.prefs[A])=="true"?1:-1,eventTypeIds:B.get("eventType"),isEmailFrequencyDaysUpdate:false});}dbug.log(A);this.setPrefCookie(A);this.notifyUpdate(B);},updateSelect:function(B){var A=B.get("name");this.prefs[A]=B.get("value");if(B.hasClass("ping")){this.pingPref({watchListEmailFrequencyDays:this.prefs[A],eventTypeIds:1,isEmailFrequencyDaysUpdate:false});}this.setPrefCookie(A);this.notifyUpdate(B);},setPrefCookie:function(A){var B=document.location.hostname.split(".");B=B[B.length-2]+"."+B[B.length-1];this.deleteOldCookies(A,B);Cookie.write(A,this.prefs[A],{duration:9999,domain:B,path:"/"});return this;},deleteOldCookies:function(B,C){var A=new Cookie(B);if(A.read()!=null){A.dispose();}A=new Cookie(B,{domain:C});if(A.read()!=null){A.dispose();}},notifyUpdate:function(C){var B=new Element("span",{text:"preference saved",styles:{opacity:0,color:"#C00","font-weight":"bold"}}).inject(C.getParent("label"));var A=function(){if(B.getStyle("opacity")>0.1){(function(){B.morph({opacity:0});}).delay(1500);}else{B.dispose();}};B.set("morph",{duration:250,onComplete:A}).morph({opacity:1});},pingPref:function(A){A=A||{};this.ping.send({data:A});}});WatchList.deleteMultiple=function(A){var C={};$(A).getElements("input[type=checkbox]").each(function(D){if(D.checked){if($chk(C[D.get("name")])){if($type(C[D.get("name")])!="array"){C[D.get("name")]=[C[D.get("name")]];}C[D.get("name")].push(D.get("value"));}else{C[D.get("name")]=D.get("value");}}});if(new Hash(C).getKeys().length){var B=new Link("/9800-4_"+PageVars.get("siteId")+"-0.html");B.setQueryString($merge({component:null,cmd:"deleteListItems",viewName:".empty"},C));new Request({url:B.get("href"),method:"get",onComplete:function(){try{var D=new Link(location.href);D.set("pathname","/"+PageVars.getOid({pageNumber:null})+".html");D.mergeQueryString({refresh:new Date().getTime()});location.href=D.get("href");}catch(E){dbug.log("Page refresh error: %o",E);}}}).send();}};var Drag=new Class({Implements:[Events,Options],options:{snap:6,unit:"px",grid:false,style:true,limit:false,handle:false,invert:false,preventDefault:false,modifiers:{x:"left",y:"top"}},initialize:function(){var B=Array.link(arguments,{options:Object.type,element:$defined});this.element=$(B.element);this.document=this.element.getDocument();this.setOptions(B.options||{});var A=$type(this.options.handle);this.handles=(A=="array"||A=="collection")?$$(this.options.handle):$(this.options.handle)||this.element;this.mouse={now:{},pos:{}};this.value={start:{},now:{}};this.selection=(Browser.Engine.trident)?"selectstart":"mousedown";this.bound={start:this.start.bind(this),check:this.check.bind(this),drag:this.drag.bind(this),stop:this.stop.bind(this),cancel:this.cancel.bind(this),eventStop:$lambda(false)};this.attach();},attach:function(){this.handles.addEvent("mousedown",this.bound.start);return this;},detach:function(){this.handles.removeEvent("mousedown",this.bound.start);return this;},start:function(C){if(this.options.preventDefault){C.preventDefault();}this.fireEvent("beforeStart",this.element);this.mouse.start=C.page;var A=this.options.limit;this.limit={x:[],y:[]};for(var D in this.options.modifiers){if(!this.options.modifiers[D]){continue;}if(this.options.style){this.value.now[D]=this.element.getStyle(this.options.modifiers[D]).toInt();}else{this.value.now[D]=this.element[this.options.modifiers[D]];}if(this.options.invert){this.value.now[D]*=-1;}this.mouse.pos[D]=C.page[D]-this.value.now[D];if(A&&A[D]){for(var B=2;B--;B){if($chk(A[D][B])){this.limit[D][B]=$lambda(A[D][B])();}}}}if($type(this.options.grid)=="number"){this.options.grid={x:this.options.grid,y:this.options.grid};}this.document.addEvents({mousemove:this.bound.check,mouseup:this.bound.cancel});this.document.addEvent(this.selection,this.bound.eventStop);},check:function(A){if(this.options.preventDefault){A.preventDefault();}var B=Math.round(Math.sqrt(Math.pow(A.page.x-this.mouse.start.x,2)+Math.pow(A.page.y-this.mouse.start.y,2)));if(B>this.options.snap){this.cancel();this.document.addEvents({mousemove:this.bound.drag,mouseup:this.bound.stop});this.fireEvent("start",this.element).fireEvent("snap",this.element);}},drag:function(A){if(this.options.preventDefault){A.preventDefault();}this.mouse.now=A.page;for(var B in this.options.modifiers){if(!this.options.modifiers[B]){continue;}this.value.now[B]=this.mouse.now[B]-this.mouse.pos[B];if(this.options.invert){this.value.now[B]*=-1;}if(this.options.limit&&this.limit[B]){if($chk(this.limit[B][1])&&(this.value.now[B]>this.limit[B][1])){this.value.now[B]=this.limit[B][1];}else{if($chk(this.limit[B][0])&&(this.value.now[B]<this.limit[B][0])){this.value.now[B]=this.limit[B][0];}}}if(this.options.grid[B]){this.value.now[B]-=(this.value.now[B]%this.options.grid[B]);}if(this.options.style){this.element.setStyle(this.options.modifiers[B],this.value.now[B]+this.options.unit);}else{this.element[this.options.modifiers[B]]=this.value.now[B];}}this.fireEvent("drag",this.element);},cancel:function(A){this.document.removeEvent("mousemove",this.bound.check);this.document.removeEvent("mouseup",this.bound.cancel);if(A){this.document.removeEvent(this.selection,this.bound.eventStop);this.fireEvent("cancel",this.element);}},stop:function(A){this.document.removeEvent(this.selection,this.bound.eventStop);this.document.removeEvent("mousemove",this.bound.drag);this.document.removeEvent("mouseup",this.bound.stop);if(A){this.fireEvent("complete",this.element);}}});Element.implement({makeResizable:function(A){return new Drag(this,$merge({modifiers:{x:"width",y:"height"}},A));}});Drag.Move=new Class({Extends:Drag,options:{droppables:[],container:false},initialize:function(C,B){this.parent(C,B);this.droppables=$$(this.options.droppables);this.container=$(this.options.container);if(this.container&&$type(this.container)!="element"){this.container=$(this.container.getDocument().body);}C=this.element;var D=C.getStyle("position");var A=(D!="static")?D:"absolute";if(C.getStyle("left")=="auto"||C.getStyle("top")=="auto"){C.position(C.getPosition(C.offsetParent));}C.setStyle("position",A);this.addEvent("start",function(){this.checkDroppables();},true);},start:function(B){if(this.container){var D=this.element,J=this.container,E=J.getCoordinates(D.offsetParent),F={},A={};["top","right","bottom","left"].each(function(K){F[K]=J.getStyle("padding-"+K).toInt();A[K]=D.getStyle("margin-"+K).toInt();},this);var C=D.offsetWidth+A.left+A.right,I=D.offsetHeight+A.top+A.bottom;var H=[E.left+F.left,E.right-F.right-C];var G=[E.top+F.top,E.bottom-F.bottom-I];this.options.limit={x:H,y:G};}this.parent(B);},checkAgainst:function(B){B=B.getCoordinates();var A=this.mouse.now;return(A.x>B.left&&A.x<B.right&&A.y<B.bottom&&A.y>B.top);},checkDroppables:function(){var A=this.droppables.filter(this.checkAgainst,this).getLast();if(this.overed!=A){if(this.overed){this.fireEvent("leave",[this.element,this.overed]);}if(A){this.overed=A;this.fireEvent("enter",[this.element,A]);}else{this.overed=null;}}},drag:function(A){this.parent(A);if(this.droppables.length){this.checkDroppables();}},stop:function(A){this.checkDroppables();this.fireEvent("drop",[this.element,this.overed]);this.overed=null;return this.parent(A);}});Element.implement({makeDraggable:function(A){return new Drag.Move(this,A);}});var Sortables=new Class({Implements:[Events,Options],options:{snap:4,opacity:1,clone:false,revert:false,handle:false,constrain:false},initialize:function(A,B){this.setOptions(B);this.elements=[];this.lists=[];this.idle=true;this.addLists($$($(A)||A));if(!this.options.clone){this.options.revert=false;}if(this.options.revert){this.effect=new Fx.Morph(null,$merge({duration:250,link:"cancel"},this.options.revert));}},attach:function(){this.addLists(this.lists);return this;},detach:function(){this.lists=this.removeLists(this.lists);return this;},addItems:function(){Array.flatten(arguments).each(function(A){this.elements.push(A);var B=A.retrieve("sortables:start",this.start.bindWithEvent(this,A));(this.options.handle?A.getElement(this.options.handle)||A:A).addEvent("mousedown",B);},this);return this;},addLists:function(){Array.flatten(arguments).each(function(A){this.lists.push(A);this.addItems(A.getChildren());},this);return this;},removeItems:function(){var A=[];Array.flatten(arguments).each(function(B){A.push(B);this.elements.erase(B);var C=B.retrieve("sortables:start");(this.options.handle?B.getElement(this.options.handle)||B:B).removeEvent("mousedown",C);},this);return $$(A);},removeLists:function(){var A=[];Array.flatten(arguments).each(function(B){A.push(B);this.lists.erase(B);this.removeItems(B.getChildren());},this);return $$(A);},getClone:function(B,A){if(!this.options.clone){return new Element("div").inject(document.body);}if($type(this.options.clone)=="function"){return this.options.clone.call(this,B,A,this.list);}return A.clone(true).setStyles({margin:"0px",position:"absolute",visibility:"hidden",width:A.getStyle("width")}).inject(this.list).position(A.getPosition(A.getOffsetParent()));},getDroppables:function(){var A=this.list.getChildren();if(!this.options.constrain){A=this.lists.concat(A).erase(this.list);}return A.erase(this.clone).erase(this.element);},insert:function(C,B){var A="inside";if(this.lists.contains(B)){this.list=B;this.drag.droppables=this.getDroppables();}else{A=this.element.getAllPrevious().contains(B)?"before":"after";}this.element.inject(B,A);this.fireEvent("sort",[this.element,this.clone]);},start:function(B,A){if(!this.idle){return ;}this.idle=false;this.element=A;this.opacity=A.get("opacity");this.list=A.getParent();this.clone=this.getClone(B,A);this.drag=new Drag.Move(this.clone,{snap:this.options.snap,container:this.options.constrain&&this.element.getParent(),droppables:this.getDroppables(),onSnap:function(){B.stop();this.clone.setStyle("visibility","visible");this.element.set("opacity",this.options.opacity||0);this.fireEvent("start",[this.element,this.clone]);}.bind(this),onEnter:this.insert.bind(this),onCancel:this.reset.bind(this),onComplete:this.end.bind(this)});this.clone.inject(this.element,"before");this.drag.start(B);},end:function(){this.drag.detach();this.element.set("opacity",this.opacity);if(this.effect){var A=this.element.getStyles("width","height");var B=this.clone.computePosition(this.element.getPosition(this.clone.offsetParent));this.effect.element=this.clone;this.effect.start({top:B.top,left:B.left,width:A.width,height:A.height,opacity:0.25}).chain(this.reset.bind(this));}else{this.reset();}},reset:function(){this.idle=true;this.clone.destroy();this.fireEvent("complete",this.element);},serialize:function(){var C=Array.link(arguments,{modifier:Function.type,index:$defined});var B=this.lists.map(function(D){return D.getChildren().map(C.modifier||function(E){return E.get("id");},this);},this);var A=C.index;if(this.lists.length==1){A=0;}return $chk(A)&&A>=0&&A<this.lists.length?B[A]:B;}});var StickyWinFx=new Class({Extends:StickyWin,options:{fade:true,fadeDuration:150,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.parent();}},showWin:function(){if(this.options.fade){this.fade(1);}else{this.parent();}},fade:function(B){if(!this.fadeFx){this.win.setStyles({opacity:0,display:"block"});var A={property:"opacity",duration:this.options.fadeDuration};if(this.options.fadeTransition){A.transition=this.options.fadeTransition;}this.fadeFx=new Fx.Tween(this.win,A);}if(B>0){this.win.setStyle("display","block");this.position();}this.fadeFx.clearChain();this.fadeFx.start(B).chain(function(){if(B==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");}});new Native({name:"Date",initialize:Date,protect:true});["now","parse","UTC"].each(function(A){Native.genericize(Date,A,true);});Date.$Methods=new Hash();["Date","Day","FullYear","Hours","Milliseconds","Minutes","Month","Seconds","Time","TimezoneOffset","Week","Timezone","GMTOffset","DayOfYear","LastMonth","UTCDate","UTCDay","UTCFullYear","AMPM","UTCHours","UTCMilliseconds","UTCMinutes","UTCMonth","UTCSeconds"].each(function(A){Date.$Methods.set(A.toLowerCase(),A);});$each({ms:"Milliseconds",year:"FullYear",min:"Minutes",mo:"Month",sec:"Seconds",hr:"Hours"},function(B,A){Date.$Methods.set(A,B);});Date.implement({set:function(B,C){B=B.toLowerCase();var A=Date.$Methods;if(A.has(B)){this["set"+A.get(B)](C);}return this;},get:function(B){B=B.toLowerCase();var A=Date.$Methods;if(A.has(B)){return this["get"+A.get(B)]();}return null;},clone:function(){return new Date(this.get("time"));},increment:function(A,B){return this.multiply(A,B);},decrement:function(A,B){return this.multiply(A,B,false);},multiply:function(B,G,A){B=B||"day";G=$pick(G,1);A=$pick(A,true);var H=A?1:-1;var E=this.format("%m").toInt()-1;var C=this.format("%Y").toInt();var D=this.get("time");var F=0;switch(B){case"year":G.times(function(I){if(Date.isLeapYear(C+I)&&E>1&&H>0){I++;}if(Date.isLeapYear(C+I)&&E<=1&&H<0){I--;}F+=Date.$units.year(C+I);});break;case"month":G.times(function(K){if(H<0){K++;}var J=E+(K*H);var I=I;if(J<0){I--;J=12+J;}if(J>11||J<0){I+=(J/12).toInt()*H;J=J%12;}F+=Date.$units.month(J,I);});break;default:F=Date.$units[B]()*G;break;}this.set("time",D+(F*H));return this;},isLeapYear:function(){return Date.isLeapYear(this.get("year"));},clearTime:function(){this.set("hr",0);this.set("min",0);this.set("sec",0);this.set("ms",0);return this;},diff:function(D,B){B=B||"day";if($type(D)=="string"){D=Date.parse(D);}switch(B){case"year":return D.format("%Y").toInt()-this.format("%Y").toInt();break;case"month":var A=(D.format("%Y").toInt()-this.format("%Y").toInt())*12;return A+D.format("%m").toInt()-this.format("%m").toInt();break;default:var C=D.get("time")-this.get("time");if(C<0&&Date.$units[B]()>(-1*(C))){return 0;}else{if(C>=0&&C<Date.$units[B]()){return 0;}}return((D.get("time")-this.get("time"))/Date.$units[B]()).round();}},getWeek:function(){var A=(new Date(this.get("year"),0,1)).get("date");return Math.round((this.get("dayofyear")+(A>3?A-4:A+3))/7);},getTimezone:function(){return this.toString().replace(/^.*? ([A-Z]{3}).[0-9]{4}.*$/,"$1").replace(/^.*?\(([A-Z])[a-z]+ ([A-Z])[a-z]+ ([A-Z])[a-z]+\)$/,"$1$2$3");},getGMTOffset:function(){var A=this.get("timezoneOffset");return((A>0)?"-":"+")+Math.floor(Math.abs(A)/60).zeroise(2)+(A%60).zeroise(2);},parse:function(A){this.set("time",Date.parse(A));return this;},format:function(A){A=A||"%x %X";if(!this.valueOf()){return"invalid date";}if(Date.$formats[A.toLowerCase()]){A=Date.$formats[A.toLowerCase()];}var B=this;return A.replace(/\%([aAbBcdHIjmMpSUWwxXyYTZ])/g,function(C,E){switch(E){case"a":return Date.$days[B.get("day")].substr(0,3);case"A":return Date.$days[B.get("day")];case"b":return Date.$months[B.get("month")].substr(0,3);case"B":return Date.$months[B.get("month")];case"c":return B.toString();case"d":return B.get("date").zeroise(2);case"H":return B.get("hr").zeroise(2);case"I":return((B.get("hr")%12)||12);case"j":return B.get("dayofyear").zeroise(3);case"m":return(B.get("mo")+1).zeroise(2);case"M":return B.get("min").zeroise(2);case"p":return B.get("hr")<12?"AM":"PM";case"S":return B.get("seconds").zeroise(2);case"U":return B.get("week").zeroise(2);case"W":throw new Error("%W is not supported yet");case"w":return B.get("day");case"x":var D=Date.$cultures[Date.$culture];return B.format("%"+D[0].substr(0,1)+D[3]+"%"+D[1].substr(0,1)+D[3]+"%"+D[2].substr(0,1).toUpperCase());case"X":return B.format("%I:%M%p");case"y":return B.get("year").toString().substr(2);case"Y":return B.get("year");case"T":return B.get("GMTOffset");case"Z":return B.get("Timezone");case"%":return"%";}return E;});},setAMPM:function(A){A=A.toUpperCase();if(this.format("%H").toInt()>11&&A=="AM"){return this.decrement("hour",12);}else{if(this.format("%H").toInt()<12&&A=="PM"){return this.increment("hour",12);}}return this;}});Date.prototype.compare=Date.prototype.diff;Date.prototype.strftime=Date.prototype.format;Date.$nativeParse=Date.parse;$extend(Date,{$months:["January","February","March","April","May","June","July","August","September","October","November","December"],$days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],$daysInMonth:function(B,A){if(Date.isLeapYear(A.toInt())&&B===1){return 29;}return[31,28,31,30,31,30,31,31,30,31,30,31][B];},$epoch:-1,$era:-2,$units:{ms:function(){return 1;},second:function(){return 1000;},minute:function(){return 60000;},hour:function(){return 3600000;},day:function(){return 86400000;},week:function(){return 608400000;},month:function(C,A){var B=new Date();return Date.$daysInMonth($pick(C,B.format("%m").toInt()),$pick(A,B.format("%Y").toInt()))*86400000;},year:function(A){A=A||new Date().format("%Y").toInt();return Date.isLeapYear(A.toInt())?31622400000:31536000000;}},$formats:{db:"%Y-%m-%d %H:%M:%S",compact:"%Y%m%dT%H%M%S",iso8601:"%Y-%m-%dT%H:%M:%S%T",rfc822:"%a, %d %b %Y %H:%M:%S %Z","short":"%d %b %H:%M","long":"%B %d, %Y %H:%M"},isLeapYear:function(A){return new Date(A,1,29).getDate()==29;},parseUTC:function(B){var A=new Date(B);var C=Date.UTC(A.get("year"),A.get("mo"),A.get("date"),A.get("hr"),A.get("min"),A.get("sec"));return new Date(C);},parse:function(F){var C=$type(F);if(C=="number"){return new Date(F);}if(C!="string"){return F;}if(!F.length){return null;}for(var B=0,A=Date.$parsePatterns.length;B<A;B++){var D=Date.$parsePatterns[B].re.exec(F);if(D){try{return Date.$parsePatterns[B].handler(D);}catch(E){dbug.log("date parse error: ",E);return null;}}}return new Date(Date.$nativeParse(F));},parseMonth:function(D,C){var B=-1;switch($type(D)){case"object":B=Date.$months[D.get("mo")];break;case"number":B=Date.$months[D-1]||false;if(!B){throw new Error("Invalid month index value must be between 1 and 12:"+index);}break;case"string":var A=Date.$months.filter(function(E){return this.test(E);},new RegExp("^"+D,"i"));if(!A.length){throw new Error("Invalid month string");}if(A.length>1){throw new Error("Ambiguous month");}B=A[0];}return(C)?Date.$months.indexOf(B):B;},parseDay:function(A,D){var C=-1;switch($type(A)){case"number":C=Date.$days[A-1]||false;if(!C){throw new Error("Invalid day index value must be between 1 and 7");}break;case"string":var B=Date.$days.filter(function(E){return this.test(E);},new RegExp("^"+A,"i"));if(!B.length){throw new Error("Invalid day string");}if(B.length>1){throw new Error("Ambiguous day");}C=B[0];}return(D)?Date.$days.indexOf(C):C;},fixY2K:function(B){if(!isNaN(B)){var A=new Date(B);if(A.get("year")<2000&&B.toString().indexOf(A.get("year"))<0){A.increment("year",100);}return A;}else{return B;}},$cultures:{US:["month","date","year","/"],GB:["date","month","year","/"]},$culture:"US",$cIndex:function(A){return Date.$cultures[Date.$culture].indexOf(A)+1;},$parsePatterns:[{re:/^(\d{1,2})[\.\-\/](\d{1,2})[\.\-\/](\d{2,4})$/,handler:function(B){var C=new Date();var A=Date.$cultures[Date.$culture];C.set("year",B[Date.$cIndex("year")]);C.set("month",B[Date.$cIndex("month")]-1);C.set("date",B[Date.$cIndex("date")]);return Date.fixY2K(C);}},{re:/^(\d{1,2})[\.\-\/](\d{1,2})[\.\-\/](\d{2,4})\s(\d{1,2}):(\d{1,2})(\w{2})$/,handler:function(A){var B=new Date();B.set("year",A[Date.$cIndex("year")]);B.set("month",A[Date.$cIndex("month")]-1);B.set("date",A[Date.$cIndex("date")]);B.set("hr",A[4]);B.set("min",A[5]);B.set("ampm",A[6]);return Date.fixY2K(B);}}]});Number.implement({zeroise:function(A){return String(this).zeroise(A);}});String.implement({repeat:function(C){var A=[];for(var B=0;B<C;B++){A.push(this);}return A.join("");},zeroise:function(A){return"0".repeat(A-this.length)+this;}});Fx.Move=new Class({Extends:Fx.Morph,options:{relativeTo:document.body,position:"center",edge:false,offset:{x:0,y:0}},start:function(A){return this.parent(this.element.setPosition($merge(this.options,A,{returnPos:true})));}});Element.Properties.move={set:function(A){var B=this.retrieve("move");if(B){B.cancel();}return this.eliminate("move").store("move:options",$extend({link:"cancel"},A));},get:function(A){if(A||!this.retrieve("move")){if(A||!this.retrieve("move:options")){this.set("move",A);}this.store("move",new Fx.Move(this,this.retrieve("move:options")));}return this.retrieve("move");}};Element.implement({move:function(A){this.get("move").start(A);return this;}});var Slider=new Class({Implements:[Events,Options],options:{onTick:function(A){if(this.options.snap){A=this.toPosition(this.step);}this.knob.setStyle(this.property,A);},snap:false,offset:0,range:false,wheel:false,steps:100,mode:"horizontal"},initialize:function(E,A,D){this.setOptions(D);this.element=$(E);this.knob=$(A);this.previousChange=this.previousEnd=this.step=-1;this.element.addEvent("mousedown",this.clickedElement.bind(this));if(this.options.wheel){this.element.addEvent("mousewheel",this.scrolledElement.bindWithEvent(this));}var F,B={},C={x:false,y:false};switch(this.options.mode){case"vertical":this.axis="y";this.property="top";F="offsetHeight";break;case"horizontal":this.axis="x";this.property="left";F="offsetWidth";}this.half=this.knob[F]/2;this.full=this.element[F]-this.knob[F]+(this.options.offset*2);this.min=$chk(this.options.range[0])?this.options.range[0]:0;this.max=$chk(this.options.range[1])?this.options.range[1]:this.options.steps;this.range=this.max-this.min;this.steps=this.options.steps||this.full;this.stepSize=Math.abs(this.range)/this.steps;this.stepWidth=this.stepSize*this.full/Math.abs(this.range);this.knob.setStyle("position","relative").setStyle(this.property,-this.options.offset);C[this.axis]=this.property;B[this.axis]=[-this.options.offset,this.full-this.options.offset];this.drag=new Drag(this.knob,{snap:0,limit:B,modifiers:C,onDrag:this.draggedKnob.bind(this),onStart:this.draggedKnob.bind(this),onComplete:function(){this.draggedKnob();this.end();}.bind(this)});if(this.options.snap){this.drag.options.grid=Math.ceil(this.stepWidth);this.drag.options.limit[this.axis][1]=this.full;}},set:function(A){if(!((this.range>0)^(A<this.min))){A=this.min;}if(!((this.range>0)^(A>this.max))){A=this.max;}this.step=Math.round(A);this.checkStep();this.end();this.fireEvent("tick",this.toPosition(this.step));return this;},clickedElement:function(C){var B=this.range<0?-1:1;var A=C.page[this.axis]-this.element.getPosition()[this.axis]-this.half;A=A.limit(-this.options.offset,this.full-this.options.offset);this.step=Math.round(this.min+B*this.toStep(A));this.checkStep();this.end();this.fireEvent("tick",A);},scrolledElement:function(A){var B=(this.options.mode=="horizontal")?(A.wheel<0):(A.wheel>0);this.set(B?this.step-this.stepSize:this.step+this.stepSize);A.stop();},draggedKnob:function(){var B=this.range<0?-1:1;var A=this.drag.value.now[this.axis];A=A.limit(-this.options.offset,this.full-this.options.offset);this.step=Math.round(this.min+B*this.toStep(A));this.checkStep();},checkStep:function(){if(this.previousChange!=this.step){this.previousChange=this.step;this.fireEvent("change",this.step);}},end:function(){if(this.previousEnd!==this.step){this.previousEnd=this.step;this.fireEvent("complete",this.step+"");}},toStep:function(A){var B=(A+this.options.offset)*this.stepSize/this.full*this.steps;return this.options.steps?Math.round(B-=B%this.stepSize):B;},toPosition:function(A){return(this.full*Math.abs(this.min-A))/(this.steps*this.stepSize)-this.options.offset;}});var Scrollbar=new Class({Extends:Slider,options:{mode:"vertical",scrollHandle:null,scrolledContent:null,scrollbar:null,scrollArrows$$:{toStart:".arrow.up",toEnd:".arrow.down"},scrollSpeed:2},initialize:function(B){this.setOptions($merge(this.options,B));if(!this.isScrollBarNeeded()){this.hideScrollBar();}else{this.options.scrollbar.setStyle("display","block");this.setHandleSize();var A=this.options.scrollHandle;var C=this.options.scrollHandle.getParent();this.parent(C,A,B);this.limit=this.drag.options.limit;this.steps=(this.options.mode=="vertical")?this.scrollSizeY-this.options.scrolledContent.getSize().y:this.scrollSizeX-this.options.scrolledContent.getSize().x;if(this.options.scrollArrows$$){this.initScrollArrows();}}},isScrollBarNeeded:function(){this.getElementScrollSize();if(this.options.mode=="vertical"){return(this.options.scrolledContent.getSize().y-this.scrollSizeY<0);}else{if(this.options.mode=="horizontal"){return(this.options.scrolledContent.getSize().x-this.scrollSizeX<0);}}},hideScrollBar:function(){this.options.scrollbar.setStyle("display","none");},getElementScrollSize:function(){if(this.options.mode=="vertical"){var A=0;this.options.scrolledContent.getChildren().each(function(C){A+=C.getComputedSize().totalHeight;A+=C.getStyle("margin-top").toInt();A+=C.getStyle("margin-bottom").toInt();});this.scrollSizeY=A;}else{if(this.options.mode=="horizontal"){var B=0;this.options.scrolledContent.getChildren().each(function(C){B+=C.getComputedSize().totalWidth;B+=C.getStyle("margin-left").toInt();B+=C.getStyle("margin-right").toInt();});this.scrollSizeX=B;}}},setHandleSize:function(){if(this.options.mode=="vertical"){var A=(this.options.scrolledContent.getSize().y/this.scrollSizeY*100);this.options.scrollHandle.setStyle("height",A.round()+"%");}else{if(this.options.mode=="horizontal"){var A=(this.options.scrolledContent.getSize().x/this.scrollSizeX*100);this.options.scrollHandle.setStyle("width",A.round()+"%");}}},checkStep:function(){if(this.previousChange!=this.step){this.previousChange=this.step;this.scrollContent(this.step);this.fireEvent("change",this.step);}},scrollContent:function(A){var C=(this.options.mode=="horizontal")?A:0;var B=(this.options.mode=="horizontal")?0:A;this.options.scrolledContent.scrollTo(C,B);},initScrollArrows:function(){var A=(this.options.mode=="horizontal")?"x":"y";this.options.scrollbar.getElement(this.options.scrollArrows$$.toStart).addEvents({mousedown:function(){var B=this.knob.getPosition(this.element)[A].toInt();this.interval=function(){B-=1;if(B>=this.limit[A][0]){this.knob.setStyle((A=="y")?"top":"left",B);this.step=Math.round(this.min-1*-this.toStep(this.knob.getPosition(this.element)[A].toInt()));this.checkStep();}else{$clear(this.interval);}}.bind(this).periodical(this.options.scrollSpeed);}.bind(this),mouseup:function(){$clear(this.interval);}.bind(this)});this.options.scrollbar.getElement(this.options.scrollArrows$$.toEnd).addEvents({mousedown:function(){var B=this.knob.getPosition(this.element)[A].toInt();this.interval=function(){B+=1;if(B<=this.limit[A][1]){this.knob.setStyle((A=="y")?"top":"left",B);this.step=Math.round(this.min+1*this.toStep(this.knob.getPosition(this.element)[A].toInt()));this.checkStep();}else{$clear(this.interval);}}.bind(this).periodical(this.options.scrollSpeed);}.bind(this),mouseup:function(){$clear(this.interval);}.bind(this)});},clearArrowEvents:function(){$$(this.options.scrollbar.getElement(this.options.scrollArrows$$.toStart),this.options.scrollbar.getElement(this.options.scrollArrows$$.toEnd)).removeEvents("mousedown","mouseup");}});var ExpandableTextArea=new Class({Implements:Options,options:{aniTime:300,maxHeight:0,defaultMaxHeight:1000,parentDepth:6,growClass:"growme",enterStoppedClass:"stopenter",enterSubmitsClass:"entersubmits",replaceGhostTextClass:"replaceghosttext",growParentsClass:"growparents",ghostTextAttr:"ghosttext",ghostClassAttr:"ghostclass"},initialize:function(B,A){this.setOptions(A);this.el=B;this.autoGrow=B.hasClass(this.options.growClass);this.stopEnter=B.hasClass(this.options.enterStoppedClass);this.enterSubmits=B.hasClass(this.options.enterSubmitsClass);this.useGhostText=B.hasClass(this.options.replaceGhostTextClass);this.growParents=B.hasClass(this.options.growParentsClass);if(this.autoGrow){this.resizer=new Fx.Tween(this.el,{duration:this.options.aniTime});this.getMaxSize();this.reachedMax=false;this.startSize=this.origSize=this.el.getSize().y;this.vertPadding=this.el.getStyle("padding-top").toInt()+this.el.getStyle("padding-bottom").toInt()+this.el.getStyle("border-top").toInt()+this.el.getStyle("border-bottom").toInt();this.el.setStyle("overflow","hidden");this.el.addEvents({keyup:function(C){this.checkSize(C);}.bind(this),change:function(C){this.checkSize(C);}.bind(this),click:function(C){this.checkSize(C);}.bind(this)});this.checkSize();}if(this.stopEnter){this.el.addEvent("keydown",function(C){if(C.key=="enter"){C.stop();if(this.enterSubmits){this.submitForm();}}}.bind(this));}if(this.useGhostText){this.ghostText=this.el.get(this.options.ghostTextAttr);this.ghostClass=this.el.get(this.options.ghostClassAttr);if(this.ghostText){if(this.el.value!=this.ghostText){this.el.removeClass(this.ghostClass);}this.el.addEvents({focus:function(C){if(this.el.value==this.ghostText){this.el.set("value","");if(this.ghostClass){this.el.removeClass(this.ghostClass);}}}.bind(this),blur:function(C){if(this.el.value==""){this.el.set("value",this.ghostText);if(this.ghostClass){this.el.addClass(this.ghostClass);}}}.bind(this)});}}},getMaxSize:function(){this.maxSize=this.options.maxHeight;if(this.maxSize==0){var A=this.el.className.match(/maxheight-(\d*)/);if(A){this.maxSize=A[1];}else{this.maxSize=this.options.defaultMaxHeight;}}},checkSize:function(D){var C=this.el.getSize();var B=this.el.getScrollSize();if(navigator.userAgent.toLowerCase().indexOf("chrome")>-1){var A=(B.y);}else{var A=(B.y+this.vertPadding);}if(A>C.y){this.resizeIt(C,B);}},resizeIt:function(D,C){var A=C.y;if((C.y+this.vertPadding)>this.maxSize&&!this.reachedMax){A=this.maxSize;this.el.setStyle("overflow","");this.resizer.start("height",A);if(this.growParents){var B=A-this.startSize;this.resizeParents(this.el,0,B);}this.reachedMax=true;}if(!this.reachedMax){var B=A-this.startSize;if(B<0){B=0;}this.startSize=A;this.resizer.start("height",A);if(this.growParents){this.resizeParents(this.el,0,B);}}},resizeParents:function(D,C,B){if(C<this.options.parentDepth){var E=D.getParent();if(E){if(E.style.height&&E.style.height!=""){if(E.retrieve("flextAdjusted")){var A=(E.getStyle("height").toInt()+B);}else{E.store("flextAdjusted",true);var A=(E.getStyle("height").toInt()+B+this.vertPadding);}E.setStyle("height",A);}return this.resizeParents(E,(C+1),B);}return true;}else{return true;}},submitForm:function(){var B=this.el.getParent("form");if(B){var A=B.get("name");document[A].submit();}}});var ListManageUI=new Class({Implements:Options,options:{listItemProdInfo:null,listItems$$:null,sortTypesValues:null,removeBtn:".removeFromList",compareBtn:".compare",moveBtn:".moveToSubmit"},initialize:function(A){this.setOptions(A);UserLists.Manager.getUserListFiles();this.listItems=$$(this.options.listItems$$);this.listItemForm=$("userList");this.listInfoForm=$("editList")||null;this.listItemForm.addEvent("submit",function(B){B.stop();});if(this.listInfoForm){this.fieldCounter(this.listInfoForm.getElement("textarea[name=description]"),this.listInfoForm.getElement(".notesCount b"));this.listInfoForm.addEvent("submit",function(B){B.stop();this.saveListInfo(this.listInfoForm);}.bind(this));}if(this.options.listItemProdInfo!=null){this.listItems.each(function(B){this.initListItemProdInfo(B.getElement(this.options.listItemProdInfo.prodInfoWrap$$),B.getElements(this.options.listItemProdInfo.prodInfoTabs$$));}.bind(this));}this.initExpandables();if(this.options.sortTypesValues){this.initListSorting();}this.toopTips=new Tips(".toolTipElement");$$(this.options.removeBtn).addEvent("click",function(){this.removeListItems(this.getCheckedItems());}.bind(this));$$(this.options.compareBtn).addEvent("click",function(){this.compareListItems(this.getCheckedItems());}.bind(this));$$(this.options.moveBtn).each(function(B){B.addEvent("click",function(){var C=B.getParent(".moveItem").getElement("select[name=moveToList]").getSelected()[0].get("value");var D=B.getParent(".moveItem").getElement("select[name=moveToList]").getSelected()[0].get("text");this.moveListItems(this.getCheckedItems(),C,D);}.bind(this));}.bind(this));$$(".contentTools .private, .contentTools .public").addEvent("click",function(B){this.updateListPrivacy(B.target);}.bind(this));$$(".contentTools .delete").addEvent("click",function(){UserLists.Process.deleteListRedirect=$("otherLists").getElement("li").getFirst("a").get("href");UserLists.Manager.getUserListModal("DeleteList");});if(PageVars.get("assetId")=="1"){new WatchList.Prefs("alertPrefs");}if($("userListEmailForm")){this.initEmailForm();}},initEmailForm:function(){new ModalForm(".email",{reauthenticate:false,counterFields:{field:["textarea[name=message]"],counter:[".bodyCount"]},popupContents:$("userListEmailForm"),modalId:"emailUserList",resetOnClose:true,clearOnReset:true,useCaptcha:false,onFormSubmitSuccess:function(B){if(B){var D=JSON.decode(B).response;if(D.result["$"]=="failure"){if($$(".emailFail").length>0){var C=$$(".emailFail")[0];}else{var C=new Element("div",{"class":"validation-advice emailFail"});}C.set("html","<b>Error: </b>"+D.message["$"]);if(D.message["$"]=="You did not successfully enter the characters in the verification box."){C.inject($("captcha"),"before");}else{C.inject($("emailUserList").getElement("form"),"before");}}else{if(D.result["$"]=="success"){this.pingDW("listMail");var A=new Element("div",{"class":"emailSuccess"}).set("html","Thank you. "+D.message["$"]);A.inject($("emailUserList").getElement("form"),"before");if($$(".emailFail").length>0){$$(".emailFail").dispose();}$("emailUserList").getElement("form").setStyle("display","none");this.modalForm.hide.delay(4000,this.modalForm);}}}}.bind(this),onFormSubmitFail:function(){dbug.log("form not sent");}});},initExpandables:function(){$("expandSubmit").addEvent("click",function(){var B=$("expandSubmit");var A=B.getParent().getElement("select[name=expand]").getSelected().get("value")[0];this.listItems.each(function(D){var C=D.getElement(this.options.listItemProdInfo.prodInfoTabs$$).getParent().getElement("."+A);var E=new Fx.Reveal(D.getElement(this.options.listItemProdInfo.prodInfoWrap$$),{duration:500,mode:"vertical"});this.expandProdInfo(C,D.getElement(this.options.listItemProdInfo.prodInfoWrap$$),E);}.bind(this));this.pingDW("listExpand");}.bind(this));},initListItemProdInfo:function(B,A){var C=new Fx.Reveal(B,{duration:500,mode:"vertical"});A.each(function(D){D.addEvent("click",this.expandProdInfo.bind(this,[D,B,C]));}.bind(this));B.getElement(this.options.listItemProdInfo.prodInfoCloseBtn$$).addEvent("click",function(D){this.hideProdInfo(D.target,B,C);}.bind(this));if(B.getElement(".userNotes")){B.getElement(".userNotes .readMore").addEvent("click",function(){var D=B.getElement(".userNotes");D.getElement(".notes").setStyle("display","none");D.getElement(".notesForm").setStyle("display","block");});B.getElement(".userNotes .notesSubmit").addEvent("click",function(D){this.saveListItemsNotes(B.getElement(".userNotes textarea[name=editNotes]").get("value"),D.target.getParent(".listItem"));}.bind(this));}},expandProdInfo:function(D,A,C){var B=D.getParent(".listItem");if(!B.hasClass(this.options.listItemProdInfo.prodInfoExpandedClass)){D.getParent(".listItem").addClass(this.options.listItemProdInfo.prodInfoExpandedClass);}D.getParent("ul").getChildren().removeClass(this.options.listItemProdInfo.prodInfoTabActiveClass);A.getChildren().setStyle("display","none");A.getElement(this.options.listItemProdInfo.prodInfoCloseBtn$$).setStyle("display","block");if(!Browser.Engine.trident){A.getElement("."+D.getProperty("class")).setStyle("display","block");}else{A.getElement("."+D.getProperty("class")).setStyle("display","inline-block");}D.addClass(this.options.listItemProdInfo.prodInfoTabActiveClass);if(Browser.Engine.trident4){A.setStyle("display","inline-block");$$(this.listItems,".premiereBrand").setStyle("position","static");$$(this.listItems,".premiereBrand").setStyle("position","relative");}else{C.reveal();}},hideProdInfo:function(D,A,C){var B=D.getParent(".listItem");B.removeClass(this.options.listItemProdInfo.prodInfoExpandedClass);D.removeClass(this.options.listItemProdInfo.prodInfoTabActiveClass);if(!Browser.Engine.trident4){C.dissolve();}else{A.setStyle("display","none");}this.listItems.setStyle("position","static");this.listItems.setStyle("position","relative");},initListSorting:function(){if(PageVars.get("assetId")!="1"){this.initDraggableSort();}this.sortArray=[];this.options.sortTypesValues.each(function(A){this.getSortables(A.sortTarget,A.sortField);}.bind(this));},getSortables:function(A,B){$$(A).addEvent("click",function(D){var C=$(D.target);var E=(C.hasClass("ascending"))?"descending":"ascending";C.getParent("ul").getElements("a").removeClass("ascending");C.getParent("ul").getElements("a").removeClass("descending");switch(C.getProperty("sortType")){case"userOrder":this.pingDW("listSortReset");this.sortByNum(C,B,E);this.draggableSort.attach();break;case"date":this.pingDW("listSortDate");this.sortByDate(C,B,E);this.draggableSort.detach();break;case"price":this.pingDW("listSortPrice");this.sortByNum(C,B,E);this.draggableSort.detach();break;default:this.standardSort(C,B,E);this.draggableSort.detach();break;}switch(C.getProperty("sortType")){case"edRate":this.pingDW("listSortEd");break;case"userRate":this.pingDW("listSortUo");break;case"edRate":this.pingDW("listSortEd");break;case"title":this.pingDW("listSortTitle");break;}}.bind(this));},sortByDate:function(B,C,D){var A=$$(this.options.listItems$$).sort(function(G,F){var E=(D=="ascending")?new Date(G.getElement(C).get("text")):new Date(G.getElement(C).get("text"));var H=(D=="ascending")?new Date(F.getElement(C).get("text")):new Date(G.getElement(C).get("text"));return((E.diff(H)<0)?-1:((E.diff(H)>0)?1:0));});if(D=="ascending"){B.addClass("ascending");B.removeClass("descending");}else{B.removeClass("ascending");B.addClass("descending");}this.displayNewSort(A);},sortByDate:function(B,C,D){var A=$$(this.options.listItems$$).sort(function(G,F){var E=new Date(G.getElement(C).get("text")).getTime();var H=new Date(F.getElement(C).get("text")).getTime();return((D=="ascending")?(E-H):(H-E));});if(D=="ascending"){B.addClass("ascending");B.removeClass("descending");}else{B.removeClass("ascending");B.addClass("descending");}this.displayNewSort(A);},sortByNum:function(B,C,D){if(B.getProperty("sortType")=="userOrder"){var A=$$(this.options.listItems$$,".noProdInfo").sort(function(G,F){var E=G.getElement(C).get("text").toInt();var H=F.getElement(C).get("text").toInt();return(D=="ascending")?(E-H):(H-E);});}else{var A=$$(this.options.listItems$$).sort(function(G,F){var E=G.getElement(C).get("text").toInt();var H=F.getElement(C).get("text").toInt();return(D=="ascending")?(E-H):(H-E);});}if(D=="ascending"){B.addClass("ascending");B.removeClass("descending");}else{B.removeClass("ascending");B.addClass("descending");}if(B.getProperty("sortType")=="userOrder"){this.displayNewSort(A,false);}else{this.displayNewSort(A);}},standardSort:function(B,C,D){var A=$$(this.options.listItems$$).sort(function(G,F){var E=(D=="ascending")?G.getElement(C).get("text"):F.getElement(C).get("text");var H=(D=="ascending")?F.getElement(C).get("text"):G.getElement(C).get("text");return((E<H)?-1:((E>H)?1:0));});if(D=="ascending"){B.addClass("ascending");B.removeClass("descending");}else{B.removeClass("ascending");B.addClass("descending");}this.displayNewSort(A);},displayNewSort:function(B,D){D=(D!=undefined)?D:true;var A;var C=this.listItems[0].getParent();while(A=B.shift()){A.inject(C);}if(D){var E=C.getElements("li.noProdInfo");while(A=E.shift()){A.inject(C);}}},initDraggableSort:function(){var A=this;if(this.listItems.length>1){this.listItems.each(function(D){D.addEvents({mouseenter:function(){if(Browser.Engine.trident){D.getElement(".listItemHandle").setStyle("display","inline-block");}else{D.getElement(".listItemHandle").setStyle("display","block");}},mouseleave:function(){D.getElement(".listItemHandle").setStyle("display","none");}});});var C=function(D){A.pingDW("listItemDrag");};var B=function(D){};this.draggableSort=new userListSortables("#productList",{clone:true,revert:true,snap:10,limit:{x:[0,0]},handle:".listItemHandle",onComplete:function(D){D.getParent().getChildren(".listItem").each(function(F,E){var G=E+1;F.getElement(".listItemNum").set("text",G+".");});A.editListItems(C,B);}});}else{}},getCheckedItems:function(){var A=[];this.listItemForm.getElements("input.compareProd").each(function(B){if(B.checked){A.push(B);}});return A;},removeListItems:function(A){var B=this;var C=[];A.each(function(E){var D={listItemId:E.get("value")};C.push(D);});UserLists.Request.userListRequestSuccess=function(D){D=D.response;UserLists.Request.responseStatus=D.status["$"];if(D){if(UserLists.Request.responseStatus=="success"||UserLists.Request.responseStatus=="pending"){B.pingDW("listItemDel");A.each(function(E){this.hideRemovedItem(E.getParent(".listItem"),"remove");}.bind(B));}else{}}};if(C.length>0){if(PageVars.get("assetId")!=1){UserLists.UserListData.userListDataObj.extend({listId:UserLists.UserListData.getListId(),listItemsJson:JSON.encode(C)});UserLists.Request.BuildUserListRequestProps("DeleteItems");}else{UserLists.UserListData.userListDataObj.extend({listItemsJson:JSON.encode(C)});UserLists.Request.BuildUserListRequestProps("RemoveWatchlistItems");}}},compareListItems:function(A){var E=[];var G=[];var D=this.listItemForm.get("action")+"?";var C=[];A.each(function(I){if(I.getParent(".listItem").hasClass("dlProd")){G.push(I.getProperty("productId"));}else{E.push(I.getProperty("productId"));}});if(C.length>0){var F="Cannot Compare Selected Products";var B=new Element("div").adopt(new Element("p").set("text","Software titles from CNET Download.com cannot be compared at this time. This feature will be available soon. Please uncheck the following software items and click Compare to continue:"));var H=new Element("ul");C.each(function(I){H.adopt(new Element("li").set("text",I));});B.adopt(H);this.errorHandler("compareError",F,B);}else{if(E.length>1||G.length>1||((E.length+G.length)>1)){this.pingDW("listcoco");if(E.length>=1){D=D+"techProdId="+E.join("&techProdId=");}if(G.length>=1){D=D+"&dlProdId="+G.join("&dlProdId=");}window.location=D;}else{alert("Please select two or more items to compare");}}},moveListItems:function(A,C,E){var B=this;var D=[];A.each(function(G){var F={listItemId:G.get("value").toInt(),name:G.getParent(".listItem").getElement(".prodName").get("text"),note:(G.getParent(".listItem").getElement(".prodExpandedInfo p.notes span"))?G.getParent(".listItem").getElement(".prodExpandedInfo p.notes span").get("text"):""};D.push(F);});UserLists.Request.userListRequestSuccess=function(F){F=F.response;UserLists.Request.responseStatus=F.status["$"];if(UserLists.Request.responseStatus=="success"||UserLists.Request.responseStatus=="pending"){B.pingDW("listItemMove");A.each(function(G){this.hideRemovedItem(G.getParent(".listItem"),"move");}.bind(B));}else{if(UserLists.Request.responseStatus=="failure"){if(F.errors.error[1]){switch(F.errors.error[1]["@name"]){case"PRODUCT_ALREADY_EXISTS":B.errorHandler("moveError","Items Were Not Successfully Moved","One or more items from this list are already on "+E+". Please uncheck these items and try again.");break;case"LIST_SIZE_MAX_EXCEEDED_EXCEPTION":B.errorHandler("moveError","Items Were Not Successfully Moved",E+" has reached its maximum of products allowed on it. Please select another list and try again.");break;default:B.errorHandler("moveError","Items Were Not Successfully Moved","We were unable to move the checked items to "+E+". Please try again.");break;}}else{B.errorHandler("moveError","Problem Moving Items","We were unable to move the checked items to "+E+". Please try again.");}}}};if(D.length>0){UserLists.UserListData.userListDataObj.extend({fromListId:UserLists.UserListData.getListId(),listId:C,listItemsJson:JSON.encode(D)});UserLists.Request.BuildUserListRequestProps("MoveItems");}},saveListInfo:function(B){var A=this;var C=new FormValidator(B,{evaluateFieldsOnBlur:false,evaluateFieldsOnChange:false,evaluateOnSubmit:false});if(C.validate()){UserLists.UserListData.userListDataObj=new Hash(decodeURIComponent($(B).toQueryString()).parseQuery());if(!UserLists.UserListData.userListDataObj.description){UserLists.UserListData.userListDataObj.description="";}UserLists.Request.requestWaiter=new Waiter(B);UserLists.Request.requestWaiter.start();UserLists.Request.userListRequestSuccess=function(D){D=D.response;UserLists.Request.requestWaiter.stop();UserLists.Request.responseStatus=D.status["$"];if(D){if(UserLists.Request.responseStatus=="success"||UserLists.Request.responseStatus=="pending"){A.pingDW("listUpdate");new StickyWinFx({content:(UserLists.Request.responseStatus=="pending")?"Thank you, your changes will be submitted shortly":"Changes successfully saved",fadeDuration:500,className:"listInfoSaveSuccess",relativeTo:$("editList").getElement(".flexButton"),position:"lowerright",edge:"upperright",offset:{x:(Browser.Engine.trident)?45:40,y:14},onDisplay:function(){this.hide.delay(3000,this);this.destroy.delay(4000,this);}}).show();}else{A.errorHandler("saveError","Problem Saving List Info","There was a problem saving your changes. Please try again.");}}else{}};UserLists.Request.userListRequestFailure=function(D){UserLists.Request.requestWaiter.stop();A.errorHandler("saveError","Problem Saving List Info","There was a problem saving your changes. Please try again.");};UserLists.Request.BuildUserListRequestProps("EditList");}},updateListPrivacy:function(B){var A=this;UserLists.Request.requestWaiter=new Waiter(B);UserLists.Request.requestWaiter.start();UserLists.Request.userListRequestSuccess=function(C){C=C.response;UserLists.Request.responseStatus=C.status["$"];if(C){if(UserLists.Request.responseStatus=="success"||UserLists.Request.responseStatus=="pending"){if(B.hasClass("private")){A.pingDW("listPriv");B.setStyle("display","none");if(Browser.Engine.trident4){B.getParent().getElement(".public").setStyle("display","inline-block");}else{B.getParent().getElement(".public").setStyle("display","block");}}else{if(B.hasClass("public")){A.pingDW("listPub");B.setStyle("display","none");if(Browser.Engine.trident4){B.getParent().getElement(".private").setStyle("display","inline-block");}else{B.getParent().getElement(".private").setStyle("display","block");}}}}else{}}else{}UserLists.Request.requestWaiter.stop();};if(B.hasClass("private")){this.listInfoForm.getElement("input[name=isPrivate]").value=true;}else{this.listInfoForm.getElement("input[name=isPrivate]").value=false;}UserLists.UserListData.userListDataObj=new Hash(decodeURIComponent($(this.listInfoForm).toQueryString()).parseQuery());if(!UserLists.UserListData.userListDataObj.description){UserLists.UserListData.userListDataObj.description="";}UserLists.Request.BuildUserListRequestProps("EditList");},updateListSequence:function(){this.listItems.each(function(B,A){B.getElement(".listItemNum").set("text",A+1+".");});},hideRemovedItem:function(B,A){var E;if(A=="remove"){if(UserLists.Request.responseStatus=="pending"){E=new Element("li",{"class":"removedItem"}).set("text","This product will be removed from your list shortly.");}else{E=new Element("li",{"class":"removedItem"}).set("text","This product has been removed from your list.");}}else{var D=$$(".listTools").getElement(".moveItem select[name=moveToList]").getSelected()[0].get("text");var C=$$(".listTools").getElement(".moveItem select[name=moveToList]").getSelected()[0].get("value");if(UserLists.Request.responseStatus=="pending"){E=new Element("li",{"class":"removedItem"}).set("html",'This product will be moved to <a href="/3460-4_1-'+C+'.html"><b>'+D+"</b></a> shortly.");}else{E=new Element("li",{"class":"removedItem"}).set("html",'This product has been moved to <a href="/3460-4_1-'+C+'.html"><b>'+D+"</b></a>.");}}new Fx.Tween(B,{property:"opacity",onComplete:function(){E.inject(B,"after");B.dispose();this.listItems=$$(this.options.listItems$$);this.updateListSequence();}.bind(this)}).start(0);},saveListItemsNotes:function(D,F){var A=this;var C=F.getElement(".userNotes p.notes span")||new Element("span").inject(F.getElement(".userNotes p.notes"),"top");C.set("text",D);UserLists.Request.requestWaiter=new Waiter(F.getElement(".prodExpandedInfo"));UserLists.Request.requestWaiter.start();var E=function(G){G=G.response;UserLists.Request.requestWaiter.stop();UserLists.Request.responseStatus=G.status["$"];if(G){if(UserLists.Request.responseStatus=="success"||UserLists.Request.responseStatus=="pending"){A.pingDW("listItemNote");if(!Browser.Engine.trident){F.getElement(".userNotes p.notes").setStyle("display","block");}else{F.getElement(".userNotes p.notes").setStyle("display","inline-block");}F.getElement(".userNotes p.notesForm").setStyle("display","none");if(UserLists.Request.responseStatus=="pending"){new StickyWinFx({content:"Your notes will be posted to this item shortly.",fadeDuration:500,className:"itemNotesSaveFail",relativeTo:F.getElement(".prodExpandedInfo"),position:"bottomLeft",edge:"bottomLeft",offset:{x:5,y:-5},onDisplay:function(){this.hide.delay(3000,this);this.destroy.delay(4000,this);}}).show();}}else{new StickyWinFx({content:"There was a problem saving your notes. Please try again.",fadeDuration:500,className:"itemNotesSaveFail",relativeTo:F.getElement(".flexButton"),position:"upperLeft",edge:"upperRight",offset:{x:-10},onDisplay:function(){this.hide.delay(3000,this);this.destroy.delay(4000,this);}}).show();}}else{new StickyWinFx({content:"There was a problem saving your notes. Please try again.",fadeDuration:500,className:"itemNotesSaveFail",relativeTo:F.getElement(".flexButton"),position:"upperLeft",edge:"upperRight",offset:{x:-10},onDisplay:function(){this.hide.delay(3000,this);this.destroy.delay(4000,this);}}).show();}};var B=function(G){UserLists.Request.requestWaiter.stop();new StickyWinFx({content:"There was a problem saving your notes. Please try again.",fadeDuration:500,className:"itemNotesSaveFail",relativeTo:F.getElement(".flexButton"),position:"upperLeft",edge:"upperRight",offset:{x:-10},onDisplay:function(){this.hide.delay(3000,this);this.destroy.delay(4000,this);}}).show();};this.editListItems(E,B);},editListItems:function(C,B){UserLists.UserListData.userListDataObj.extend({listId:UserLists.UserListData.getListId()});var A=[];UserLists.Request.userListRequestSuccess=C;UserLists.Request.userListRequestFailure=B;this.listItems.each(function(F,D){var E={listItemId:F.getProperty("listItemId").toInt(),name:F.getElement(".prodName").get("text"),sequence:F.getElement(".listItemNum").get("text").toInt()-1,note:(F.getElement(".prodExpandedInfo p.notes span"))?F.getElement(".prodExpandedInfo p.notes span").get("text"):""};A.push(E);});UserLists.UserListData.userListDataObj.extend({listItemsJson:JSON.encode(A)});UserLists.Request.BuildUserListRequestProps("EditItems");},deleteList:function(){},fieldCounter:function(A,C){var B=A.get("validatorProps");if(!B){return ;}B=JSON.decode(B);if(!B&&!B.maxLength){return ;}this.updateCounter(A,B,C);A.addEvent("keyup",function(){this.updateCounter(A,B,C);}.bind(this));},updateCounter:function(B,C,D){var A=B.value.trim().length;D.set("text",A);if((A<(C.minLength||0))||(A>C.maxLength)){D.addClass("validation-advice");}else{D.removeClass("validation-advice");}},errorHandler:function(A,C,D){var B=new Element("div",{"class":"globalModal error",id:A});B.adopt(new Element("h2").set("text",C).adopt(new Element("a",{"class":"closeModal"})));if(typeof (D)!="object"){B.adopt(new Element("p").set("text",D));}else{B.adopt(D);}new GlobalModal({content:B,noInit:false,onClose:function(){this.win.destroy();}}).show();},pingDW:function(A){new Jlogger({tag:A,element:false,ctype:"source",cval:"managementpage"}).ping();}});Element.extend({getProperty:function(E){var C=Element.Properties[E];if(C){return this[C];}var A=Element.PropertiesIFlag[E]||0;var B=navigator.userAgent.toLowerCase().match(/msie\s+(\d)/);if(!window.ie||A||B&&B[1]>=8){return this.getAttribute(E,A);}var D=this.attributes[E];return(D)?D.nodeValue:null;}});var userListSortables=new Class({Extends:Sortables,getClone:function(B,A){if(!this.options.clone){return new Element("div").inject(document.body);}if($type(this.options.clone)=="function"){return this.options.clone.call(this,B,A,this.list);}return A.clone(true).addClass("listItem").addClass("listItemClone").setStyles({margin:"0px",position:"absolute",visibility:"hidden",width:A.getStyle("width").toInt()+20}).inject(this.list).position(A.getPosition(A.getOffsetParent()));}});if(!UserLists){var UserLists={};UserLists.Manager={listForms:new Hash({}),getUserListModal:function(B,A){dbug.log("getUserListModal");CURS.Manager.checkLogin({loginHed:"Log in to CNET to add this product to a list",registerHed:"Join CNET to add this product to a list",appId:222,cval:"userlist",nextAction:function(){if(B=="AddToList"||B=="CreateList"){UserLists.Manager.initListAssetData(A);}UserLists.Manager.getUserListFiles(B);}.bind(UserLists)});},getUserListFiles:function(A){var B;if(dbug.enabled||Browser.qs.jsdebug){if(CBSi.jsdebug){if(CBSi.jsdebug=="true"){B="http://publish.cnet.com:8100/html/rb/js/tron/techtracker/techtracker.tron.userlists.process.js";}else{B="http://publish.cnet.com:8100/html/rb/js/~dev/"+CBSi.jsdebug+"/techtracker/techtracker.tron.userlists.process.js";}}else{B="http://i.i.com.com/cnwk.1d/html/rb/js/tron/techtracker/techtracker.tron.userlists.process.compressed.js";}}else{B="http://i.i.com.com/cnwk.1d/html/rb/js/tron/techtracker/techtracker.tron.userlists.process.compressed.js";}if(!UserLists.Process){new Asset.javascript(B,{id:"userListsProcess",onload:(!A)?function(){}:this.getUserListModalHtml.bind(this,A)});}else{if(A){this.getUserListModalHtml(A);}}},startProcess:function(A){dbug.log("start user list process");if(UserLists.Process&&$("userListShell")){UserLists.Process.showUserListForm(A);}},getUserListModalHtml:function(B){dbug.log("getUserListModalHtml");var A=new Hash();UserLists.UserListData.listItemsToAdd.each(function(C){if(C.assetTypeId==2){A.extend({techProductId:true});}else{if(C.assetTypeId==24){A.extend({softwareProductId:true});}}});if(!document.body.getElement(".globalModal.userList")){new Element("div",{id:"userListShell",styles:{display:"none"}}).inject(document.body);new Request({url:"/8690-4_"+PageVars.get("siteId")+"-0.html?nomesh&"+$time(),data:A,method:"get",onSuccess:function(C){$("userListShell").set("html",C);if($("userHasLists")){UserLists.Manager.userHasLists=true;}UserLists.Process.showUserListForm(B);}.bind(UserLists)}).send();}else{UserLists.Process.showUserListForm(B);}},initFormValidator:function(A){UserLists.Manager.listForms[A].validator=new UserListFormValidator($(A).getElement("form"),{evaluateFieldsOnBlur:false,evaluateFieldsOnChange:false,evaluateOnSubmit:false,errorPrefix:""});},initListAssetData:function(A){dbug.log("init data");UserLists.UserListData.listItemsToAdd.empty();UserLists.Manager.cvalTarget=(!A.getParent(".contentTools"))?"button":"link";if(!A.length){A=[A];}A.each(function(C){var B={assetId:C.getProperty("productId").toInt(),assetTypeId:C.getProperty("productType").toInt(),name:C.getProperty("productName"),image:C.getProperty("productImage")};if(C.getProperty("productSetId")){B.productSetId=C.getProperty("productSetId").toInt();}UserLists.UserListData.listItemsToAdd.push(B);});},pingDW:function(A,B,C){new Jlogger({tag:A,element:false,ctype:B,cval:C}).ping();}};UserLists.ListItem={getItemAssetId:function(A){if(UserLists.ListItem.assetId){return UserLists.ListItem.assetId;}else{if(A){return A;}}},getItemAssetTypeId:function(A){if(UserLists.ListItem.assetTypeId){return UserLists.ListItem.assetTypeId;}else{if(A){return A;}}},getItemName:function(A){if(UserLists.ListItem.assetName){return UserLists.ListItem.assetName;}else{if(A){return A;}}},getDownloadProductSetId:function(A){if(UserLists.ListItem.productSetId){return UserLists.ListItem.productSetId;}else{if(A){return A;}}},getItemImage:function(A){if(UserLists.ListItem.assetImage){return UserLists.ListItem.assetImage;}else{if(A){return A;}}}};UserLists.UserListData={userListDataObj:new Hash(),addToListLaunchTarget:new Hash(),listItemsToAdd:[],listsAddedTo:[],addToDataObj:function(B,A){UserLists.UserListData.userListDataObj.extend({field:decodeURIComponent(A)});},getListId:function(){if(PageVars.get("pageType")==3460){if(PageVars.get("assetId")!=0){return PageVars.get("assetId");}else{return $("editList").getElement("input[name=listId]").get("value");}}}};}window.addEvent("domready",function(){$$(".userListLogin").addEvent("click",function(){dbug.log("login");CURS.Manager.checkLogin({loginHed:"Log in to CNET to Manage Your Lists",registerHed:"Join CNET to Manage Your Lists",appId:222,cval:"userlist"});});if(!UserVars.isLoggedIn()&&UserVars.get("rememberMe")!="1"){var A=function(){window.location=CURS.getRefreshPath();};CURS.Manager.addEvent("onLogin",function(){A.delay(50);});}if($("contentBody").getElement(".marketingPromo")){new Jlogger({tag:"3460info"}).ping();}else{new Jlogger({tag:"3460mgmt"}).ping();}if(UserVars.isLoggedIn()||UserVars.get("rememberMe")=="1"){new ListManageUI({listItemProdInfo:{prodInfoWrap$$:".prodExpandedInfo",prodInfoTabs$$:".prodExpandedInfoTabs li",prodInfoTabActiveClass:"active",prodInfoExpandedClass:"expanded",prodInfoCloseBtn$$:".closeInfo"},listItems$$:"#productList .listItem",sortTypesValues:[{sortTarget:".userListSort .listOrder a",sortField:".prodInfo .listItemNum"},{sortTarget:".userListSort .productTitle a",sortField:".prodDetails .prodName a"},{sortTarget:".userListSort .date a",sortField:".prodDate p"},{sortTarget:".userListSort .editorRating a",sortField:".prodEdRating a span"},{sortTarget:".userListSort .userRating a",sortField:".prodUserRating a span"},{sortTarget:".userListSort .price a",sortField:".prodPrice span.sortPrice"}],removeBtn:".removeFromList",compareBtn:".compare",moveBtn:".moveToSubmit"});$("userList").getElement(".userListSort .selectAll input").addEvent("click",function(B){if(!B.target.getProperty("checked")){$("userList").getElements(".compareProd").removeProperty("checked");}else{$("userList").getElements(".compareProd").setProperty("checked");}});new Scrollbar({mode:"vertical",scrollbar:$("listsScroll"),scrolledContent:$("otherLists"),scrollHandle:$("listsScroll").getElement("#scrollBar .handle"),scrollArrows$$:{toStart:".arrow.up",toEnd:".arrow.down"}});$$(".contentTools a.share").each(function(B){B.addEvent("mouseenter",PageTools.openShare.bind(PageTools));});$$(".contentTools a.print").each(function(B){B.addEvent("click",function(F){F.stop();if(!Browser.Engine.trident){var D;if(!$("printIframe")){D=new Element("iframe",{src:"/3463-1_1-"+PageVars.get("assetId")+".html?nomesh",style:"margin-left:-3000px;visibility:hidden;",id:"printIframe",name:"printIframe"}).inject(document.body);}var C=function E(){if($("printIframe").contentWindow.document.body&&$("printIframe").contentWindow.document.body.innerHTML!=""){dbug.log("print!");window.frames.printIframe.focus();if(!Browser.Engine.webkit){window.frames.printIframe.print();}}else{setTimeout(C,100);}};C();}else{window.open("/3463-1_1-"+PageVars.get("assetId")+".html?nomesh");}new Jlogger({tag:"listPrint",element:false,ctype:"source",cval:"managementpage"}).ping();});});$$("textarea.listNotes").each(function(B){new ExpandableTextArea(B,{growClass:"listNotes"});});}});
   }
       