//mootools base javascript (moo.base.js), cnet.base.js, cnet.global.utils.js 

//see readme.txt in parent directory for details 

//dbugScripts - will include non-compressed versions of this code if "jsdebug=true" is in the url of this page, 

//otherwise it will execute this code. 

//example: dbugScripts("/the/location/of/my/scripts/",["script1.js","script2.js","etc"]) 

//returns true if scripts are included, otherwise false. 

function dbugScripts(G,E){var D=document.cookie.match("(?:^|;)\\s*jsdebug=([^;]*)");var C=D?unescape(D[1]):false;if(window.location.href.indexOf("basePath=this")>0){var F=G.substring(G.substring(7,G.length).indexOf("/")+8,G.length);var A=window.location.href;G=A.substring(A.substring(7,A.length).indexOf("/")+8,A.length)}if(window.location.href.indexOf("jsdebug=true")>0||window.location.href.indexOf("jsdebugCookie=true")>0||C=="true"){for(var B=0;B<E.length;B++){document.write('<script src="'+G+E[B]+'" type="text/javascript"><\/script>')}return true}return false}if(!dbugScripts("http://clientside.cnet.com/wp-content/themes/clientsidev2/js/",["clientside.moo.v1.1.js", "Debugger.cnet.js"])){ 

/*	clientside.moo.v1.1.packed.js - packed	*/ 

var dbug={logged:[],timers:{},firebug:false,debug:false,log:function(){dbug.logged.push(arguments)},nolog:function(A){dbug.logged.push(arguments)},time:function(A){dbug.timers[A]=new Date().getTime()},timeEnd:function(B){if(dbug.timers[B]){var A=new Date().getTime()-dbug.timers[B];dbug.timers[B]=false;dbug.log("%s: %s",B,A)}else{dbug.log("no such timer: %s",B)}},enable:function(){if(dbug.firebug){try{dbug.debug=true;dbug.log=console.debug||console.log;dbug.time=console.time;dbug.timeEnd=console.timeEnd;dbug.log("enabling dbug");for(var A=0;A<dbug.logged.length;A++){dbug.log.apply(console,dbug.logged[A])}dbug.logged=[]}catch(B){dbug.enable.delay(400)}}},disable:function(){if(dbug.firebug){dbug.debug=false}dbug.log=dbug.nolog;dbug.time=function(){};dbug.timeEnd=function(){}},cookie:function(D){var C=document.cookie.match("(?:^|;)\\s*jsdebug=([^;]*)");var B=C?unescape(C[1]):false;if((B!="true"||D)&&!D){dbug.enable();dbug.log("setting debugging cookie");var A=new Date();A.setTime(A.getTime()+(24*60*60*1000));document.cookie="jsdebug=true;expires="+A.toGMTString()+"path=/"}else{dbug.disableCookie()}},disableCookie:function(){dbug.log("disabling debugging cookie");document.cookie="path=/;jsdebug=false"}};dbug.setMethods=function(){var C=typeof console!="undefined";var B=["debug","info","warn","error","assert","dir","dirxml"];var A=["trace","group","groupEnd","profile","profileEnd","count"];function D(G,E){for(var F=0;F<G.length;F++){dbug[G[F]]=(C&&console[G[F]])?console[G[F]]:E}}D(B,dbug.log);D(A,function(){})};dbug.setMethods();if(typeof console!="undefined"&&console.warn){dbug.firebug=true;var value=document.cookie.match("(?:^|;)\\s*jsdebug=([^;]*)");var debugCookie=value?unescape(value[1]):false;if(window.location.href.indexOf("jsdebug=true")>0||debugCookie=="true"){dbug.enable()}if(debugCookie=="true"){dbug.log("debugging cookie enabled")}if(window.location.href.indexOf("jsdebugCookie=true")>0){dbug.cookie();if(!dbug.debug){dbug.enable()}}if(window.location.href.indexOf("jsdebugCookie=false")>0){dbug.disableCookie()}}var MooTools={version:"1.11"};function $defined(A){return(A!=undefined)}function $type(B){if(!$defined(B)){return false}if(B.htmlElement){return"element"}var A=typeof B;if(A=="object"&&B.nodeName){switch(B.nodeType){case 1:return"element";case 3:return(/\S/).test(B.nodeValue)?"textnode":"whitespace"}}if(A=="object"||A=="function"){switch(B.constructor){case Array:return"array";case RegExp:return"regexp";case Class:return"class"}if(typeof B.length=="number"){if(B.item){return"collection"}if(B.callee){return"arguments"}}}return A}function $merge(){var C={};for(var B=0;B<arguments.length;B++){for(var E in arguments[B]){var A=arguments[B][E];var D=C[E];if(D&&$type(A)=="object"&&$type(D)=="object"){C[E]=$merge(D,A)}else{C[E]=A}}}return C}var $extend=function(){var A=arguments;if(!A[1]){A=[this,A[0]]}for(var B in A[1]){A[0][B]=A[1][B]}return A[0]};var $native=function(){for(var B=0,A=arguments.length;B<A;B++){arguments[B].extend=function(C){for(var D in C){if(!this.prototype[D]){this.prototype[D]=C[D]}if(!this[D]){this[D]=$native.generic(D)}}}}};$native.generic=function(A){return function(B){return this.prototype[A].apply(B,Array.prototype.slice.call(arguments,1))}};$native(Function,Array,String,Number);function $chk(A){return !!(A||A===0)}function $pick(B,A){return $defined(B)?B:A}function $random(B,A){return Math.floor(Math.random()*(A-B+1)+B)}function $time(){return new Date().getTime()}function $clear(A){clearTimeout(A);clearInterval(A);return null}var Abstract=function(A){A=A||{};A.extend=$extend;return A};var Window=new Abstract(window);var Document=new Abstract(document);document.head=document.getElementsByTagName("head")[0];window.xpath=!!(document.evaluate);if(window.ActiveXObject){window.ie=window[window.XMLHttpRequest?"ie7":"ie6"]=true}else{if(document.childNodes&&!document.all&&!navigator.taintEnabled){window.webkit=window[window.xpath?"webkit420":"webkit419"]=true}else{if(document.getBoxObjectFor!=null){window.gecko=true}}}window.khtml=window.webkit;Object.extend=$extend;if(typeof HTMLElement=="undefined"){var HTMLElement=function(){};if(window.webkit){document.createElement("iframe")}HTMLElement.prototype=(window.webkit)?window["[[DOMElement.prototype]]"]:{}}HTMLElement.prototype.htmlElement=function(){};if(window.ie6){try{document.execCommand("BackgroundImageCache",false,true)}catch(e){}}var Class=function(B){var A=function(){return(arguments[0]!==null&&this.initialize&&$type(this.initialize)=="function")?this.initialize.apply(this,arguments):this};$extend(A,this);A.prototype=B;A.constructor=Class;return A};Class.empty=function(){};Class.prototype={extend:function(B){var C=new this(null);for(var D in B){var A=C[D];C[D]=Class.Merge(A,B[D])}return new Class(C)},implement:function(){for(var B=0,A=arguments.length;B<A;B++){$extend(this.prototype,arguments[B])}}};Class.Merge=function(C,D){if(C&&C!=D){var B=$type(D);if(B!=$type(C)){return D}switch(B){case"function":var A=function(){this.parent=arguments.callee.parent;return D.apply(this,arguments)};A.parent=C;return A;case"object":return $merge(C,D)}}return D};var Chain=new Class({chain:function(A){this.chains=this.chains||[];this.chains.push(A);return this},callChain:function(){if(this.chains&&this.chains.length){this.chains.shift().delay(10,this)}},clearChain:function(){this.chains=[]}});var Events=new Class({addEvent:function(B,A){if(A!=Class.empty){this.$events=this.$events||{};this.$events[B]=this.$events[B]||[];this.$events[B].include(A)}return this},fireEvent:function(C,B,A){if(this.$events&&this.$events[C]){this.$events[C].each(function(D){D.create({"bind":this,"delay":A,"arguments":B})()},this)}return this},removeEvent:function(B,A){if(this.$events&&this.$events[B]){this.$events[B].remove(A)}return this}});var Options=new Class({setOptions:function(){this.options=$merge.apply(null,[this.options].extend(arguments));if(this.addEvent){for(var A in this.options){if($type(this.options[A]=="function")&&(/^on[A-Z]/).test(A)){this.addEvent(A,this.options[A])}}}return this}});Array.extend({forEach:function(C,D){for(var B=0,A=this.length;B<A;B++){C.call(D,this[B],B,this)}},filter:function(D,E){var C=[];for(var B=0,A=this.length;B<A;B++){if(D.call(E,this[B],B,this)){C.push(this[B])}}return C},map:function(D,E){var C=[];for(var B=0,A=this.length;B<A;B++){C[B]=D.call(E,this[B],B,this)}return C},every:function(C,D){for(var B=0,A=this.length;B<A;B++){if(!C.call(D,this[B],B,this)){return false}}return true},some:function(C,D){for(var B=0,A=this.length;B<A;B++){if(C.call(D,this[B],B,this)){return true}}return false},indexOf:function(C,D){var A=this.length;for(var B=(D<0)?Math.max(0,A+D):D||0;B<A;B++){if(this[B]===C){return B}}return -1},copy:function(D,C){D=D||0;if(D<0){D=this.length+D}C=C||(this.length-D);var A=[];for(var B=0;B<C;B++){A[B]=this[D++]}return A},remove:function(C){var B=0;var A=this.length;while(B<A){if(this[B]===C){this.splice(B,1);A--}else{B++}}return this},contains:function(A,B){return this.indexOf(A,B)!=-1},associate:function(C){var D={},B=Math.min(this.length,C.length);for(var A=0;A<B;A++){D[C[A]]=this[A]}return D},extend:function(C){for(var B=0,A=C.length;B<A;B++){this.push(C[B])}return this},merge:function(C){for(var B=0,A=C.length;B<A;B++){this.include(C[B])}return this},include:function(A){if(!this.contains(A)){this.push(A)}return this},getRandom:function(){return this[$random(0,this.length-1)]||null},getLast:function(){return this[this.length-1]||null}});Array.prototype.each=Array.prototype.forEach;Array.each=Array.forEach;function $A(A){return Array.copy(A)}function $each(C,B,D){if(C&&typeof C.length=="number"&&$type(C)!="object"){Array.forEach(C,B,D)}else{for(var A in C){B.call(D||C,C[A],A)}}}Array.prototype.test=Array.prototype.contains;String.extend({test:function(A,B){return(($type(A)=="string")?new RegExp(A,B):A).test(this)},toInt:function(){return parseInt(this,10)},toFloat:function(){return parseFloat(this)},camelCase:function(){return this.replace(/-\D/g,function(A){return A.charAt(1).toUpperCase()})},hyphenate:function(){return this.replace(/\w[A-Z]/g,function(A){return(A.charAt(0)+"-"+A.charAt(1).toLowerCase())})},capitalize:function(){return this.replace(/\b[a-z]/g,function(A){return A.toUpperCase()})},trim:function(){return this.replace(/^\s+|\s+$/g,"")},clean:function(){return this.replace(/\s{2,}/g," ").trim()},rgbToHex:function(B){var A=this.match(/\d{1,3}/g);return(A)?A.rgbToHex(B):false},hexToRgb:function(B){var A=this.match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/);return(A)?A.slice(1).hexToRgb(B):false},contains:function(A,B){return(B)?(B+this+B).indexOf(B+A+B)>-1:this.indexOf(A)>-1},escapeRegExp:function(){return this.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")}});Array.extend({rgbToHex:function(D){if(this.length<3){return false}if(this.length==4&&this[3]==0&&!D){return"transparent"}var B=[];for(var A=0;A<3;A++){var C=(this[A]-0).toString(16);B.push((C.length==1)?"0"+C:C)}return D?B:"#"+B.join("")},hexToRgb:function(C){if(this.length!=3){return false}var A=[];for(var B=0;B<3;B++){A.push(parseInt((this[B].length==1)?this[B]+this[B]:this[B],16))}return C?A:"rgb("+A.join(",")+")"}});Function.extend({create:function(A){var B=this;A=$merge({"bind":B,"event":false,"arguments":null,"delay":false,"periodical":false,"attempt":false},A);if($chk(A.arguments)&&$type(A.arguments)!="array"){A.arguments=[A.arguments]}return function(E){var C;if(A.event){E=E||window.event;C=[(A.event===true)?E:new A.event(E)];if(A.arguments){C.extend(A.arguments)}}else{C=A.arguments||arguments}var F=function(){return B.apply($pick(A.bind,B),C)};if(A.delay){return setTimeout(F,A.delay)}if(A.periodical){return setInterval(F,A.periodical)}if(A.attempt){try{return F()}catch(D){return false}}return F()}},pass:function(A,B){return this.create({"arguments":A,"bind":B})},attempt:function(A,B){return this.create({"arguments":A,"bind":B,"attempt":true})()},bind:function(B,A){return this.create({"bind":B,"arguments":A})},bindAsEventListener:function(B,A){return this.create({"bind":B,"event":true,"arguments":A})},delay:function(B,C,A){return this.create({"delay":B,"bind":C,"arguments":A})()},periodical:function(A,C,B){return this.create({"periodical":A,"bind":C,"arguments":B})()}});Number.extend({toInt:function(){return parseInt(this)},toFloat:function(){return parseFloat(this)},limit:function(B,A){return Math.min(A,Math.max(B,this))},round:function(A){A=Math.pow(10,A||0);return Math.round(this*A)/A},times:function(B){for(var A=0;A<this;A++){B(A)}}});var Element=new Class({initialize:function(D,C){if($type(D)=="string"){if(window.ie&&C&&(C.name||C.type)){var A=(C.name)?' name="'+C.name+'"':"";var B=(C.type)?' type="'+C.type+'"':"";delete C.name;delete C.type;D="<"+D+A+B+">"}D=document.createElement(D)}D=$(D);return(!C||!D)?D:D.set(C)}});var Elements=new Class({initialize:function(A){return(A)?$extend(A,this):this}});Elements.extend=function(A){for(var B in A){this.prototype[B]=A[B];this[B]=$native.generic(B)}};function $(B){if(!B){return null}if(B.htmlElement){return Garbage.collect(B)}if([window,document].contains(B)){return B}var A=$type(B);if(A=="string"){B=document.getElementById(B);A=(B)?"element":false}if(A!="element"){return null}if(B.htmlElement){return Garbage.collect(B)}if(["object","embed"].contains(B.tagName.toLowerCase())){return B}$extend(B,Element.prototype);B.htmlElement=function(){};return Garbage.collect(B)}document.getElementsBySelector=document.getElementsByTagName;function $$(){var D=[];for(var C=0,B=arguments.length;C<B;C++){var A=arguments[C];switch($type(A)){case"element":D.push(A);case"boolean":break;case false:break;case"string":A=document.getElementsBySelector(A,true);default:D.extend(A)}}return $$.unique(D)}$$.unique=function(G){var D=[];for(var C=0,A=G.length;C<A;C++){if(G[C].$included){continue}var B=$(G[C]);if(B&&!B.$included){B.$included=true;D.push(B)}}for(var F=0,E=D.length;F<E;F++){D[F].$included=null}return new Elements(D)};Elements.Multi=function(A){return function(){var D=arguments;var B=[];var G=true;for(var E=0,C=this.length,F;E<C;E++){F=this[E][A].apply(this[E],D);if($type(F)!="element"){G=false}B.push(F)}return(G)?$$.unique(B):B}};Element.extend=function(A){for(var B in A){HTMLElement.prototype[B]=A[B];Element.prototype[B]=A[B];Element[B]=$native.generic(B);var C=(Array.prototype[B])?B+"Elements":B;Elements.prototype[C]=Elements.Multi(B)}};Element.extend({set:function(A){for(var C in A){var B=A[C];switch(C){case"styles":this.setStyles(B);break;case"events":if(this.addEvents){this.addEvents(B)}break;case"properties":this.setProperties(B);break;default:this.setProperty(C,B)}}return this},inject:function(C,A){C=$(C);switch(A){case"before":C.parentNode.insertBefore(this,C);break;case"after":var B=C.getNext();if(!B){C.parentNode.appendChild(this)}else{C.parentNode.insertBefore(this,B)}break;case"top":var D=C.firstChild;if(D){C.insertBefore(this,D);break}default:C.appendChild(this)}return this},injectBefore:function(A){return this.inject(A,"before")},injectAfter:function(A){return this.inject(A,"after")},injectInside:function(A){return this.inject(A,"bottom")},injectTop:function(A){return this.inject(A,"top")},adopt:function(){var A=[];$each(arguments,function(B){A=A.concat(B)});$$(A).inject(this);return this},remove:function(){return this.parentNode.removeChild(this)},clone:function(C){var B=$(this.cloneNode(C!==false));if(!B.$events){return B}B.$events={};for(var A in this.$events){B.$events[A]={"keys":$A(this.$events[A].keys),"values":$A(this.$events[A].values)}}return B.removeEvents()},replaceWith:function(A){A=$(A);this.parentNode.replaceChild(A,this);return A},appendText:function(A){this.appendChild(document.createTextNode(A));return this},hasClass:function(A){return this.className.contains(A," ")},addClass:function(A){if(!this.hasClass(A)){this.className=(this.className+" "+A).clean()}return this},removeClass:function(A){this.className=this.className.replace(new RegExp("(^|\\s)"+A+"(?:\\s|$)"),"$1").clean();return this},toggleClass:function(A){return this.hasClass(A)?this.removeClass(A):this.addClass(A)},setStyle:function(B,A){switch(B){case"opacity":return this.setOpacity(parseFloat(A));case"float":B=(window.ie)?"styleFloat":"cssFloat"}B=B.camelCase();switch($type(A)){case"number":if(!["zIndex","zoom"].contains(B)){A+="px"}break;case"array":A="rgb("+A.join(",")+")"}this.style[B]=A;return this},setStyles:function(A){switch($type(A)){case"object":Element.setMany(this,"setStyle",A);break;case"string":this.style.cssText=A}return this},setOpacity:function(A){if(A==0){if(this.style.visibility!="hidden"){this.style.visibility="hidden"}}else{if(this.style.visibility!="visible"){this.style.visibility="visible"}}if(!this.currentStyle||!this.currentStyle.hasLayout){this.style.zoom=1}if(window.ie){this.style.filter=(A==1)?"":"alpha(opacity="+A*100+")"}this.style.opacity=this.$tmp.opacity=A;return this},getStyle:function(C){C=C.camelCase();var A=this.style[C];if(!$chk(A)){if(C=="opacity"){return this.$tmp.opacity}A=[];for(var B in Element.Styles){if(C==B){Element.Styles[B].each(function(F){var E=this.getStyle(F);A.push(parseInt(E)?E:"0px")},this);if(C=="border"){var D=A.every(function(E){return(E==A[0])});return(D)?A[0]:false}return A.join(" ")}}if(C.contains("border")){if(Element.Styles.border.contains(C)){return["Width","Style","Color"].map(function(E){return this.getStyle(C+E)},this).join(" ")}else{if(Element.borderShort.contains(C)){return["Top","Right","Bottom","Left"].map(function(E){return this.getStyle("border"+E+C.replace("border",""))},this).join(" ")}}}if(document.defaultView){A=document.defaultView.getComputedStyle(this,null).getPropertyValue(C.hyphenate())}else{if(this.currentStyle){A=this.currentStyle[C]}}}if(window.ie){A=Element.fixStyle(C,A,this)}if(A&&C.test(/color/i)&&A.contains("rgb")){return A.split("rgb").splice(1,4).map(function(E){return E.rgbToHex()}).join(" ")}return A},getStyles:function(){return Element.getMany(this,"getStyle",arguments)},walk:function(A,C){A+="Sibling";var B=(C)?this[C]:this[A];while(B&&$type(B)!="element"){B=B[A]}return $(B)},getPrevious:function(){return this.walk("previous")},getNext:function(){return this.walk("next")},getFirst:function(){return this.walk("next","firstChild")},getLast:function(){return this.walk("previous","lastChild")},getParent:function(){return $(this.parentNode)},getChildren:function(){return $$(this.childNodes)},hasChild:function(A){return !!$A(this.getElementsByTagName("*")).contains(A)},getProperty:function(D){var B=Element.Properties[D];if(B){return this[B]}var A=Element.PropertiesIFlag[D]||0;if(!window.ie||A){return this.getAttribute(D,A)}var C=this.attributes[D];return(C)?C.nodeValue:null},removeProperty:function(B){var A=Element.Properties[B];if(A){this[A]=""}else{this.removeAttribute(B)}return this},getProperties:function(){return Element.getMany(this,"getProperty",arguments)},setProperty:function(C,B){var A=Element.Properties[C];if(A){this[A]=B}else{this.setAttribute(C,B)}return this},setProperties:function(A){return Element.setMany(this,"setProperty",A)},setHTML:function(){this.innerHTML=$A(arguments).join("");return this},setText:function(B){var A=this.getTag();if(["style","script"].contains(A)){if(window.ie){if(A=="style"){this.styleSheet.cssText=B}else{if(A=="script"){this.setProperty("text",B)}}return this}else{if(this.firstChild){this.removeChild(this.firstChild)}return this.appendText(B)}}this[$defined(this.innerText)?"innerText":"textContent"]=B;return this},getText:function(){var A=this.getTag();if(["style","script"].contains(A)){if(window.ie){if(A=="style"){return this.styleSheet.cssText}else{if(A=="script"){return this.getProperty("text")}}}else{return this.innerHTML}}return($pick(this.innerText,this.textContent))},getTag:function(){return this.tagName.toLowerCase()},empty:function(){Garbage.trash(this.getElementsByTagName("*"));return this.setHTML("")}});Element.fixStyle=function(E,A,D){if($chk(parseInt(A))){return A}if(["height","width"].contains(E)){var B=(E=="width")?["left","right"]:["top","bottom"];var C=0;B.each(function(F){C+=D.getStyle("border-"+F+"-width").toInt()+D.getStyle("padding-"+F).toInt()});return D["offset"+E.capitalize()]-C+"px"}else{if(E.test(/border(.+)Width|margin|padding/)){return"0px"}}return A};Element.Styles={"border":[],"padding":[],"margin":[]};["Top","Right","Bottom","Left"].each(function(B){for(var A in Element.Styles){Element.Styles[A].push(A+B)}});Element.borderShort=["borderWidth","borderStyle","borderColor"];Element.getMany=function(B,D,C){var A={};$each(C,function(E){A[E]=B[D](E)});return A};Element.setMany=function(B,D,C){for(var A in C){B[D](A,C[A])}return B};Element.Properties=new Abstract({"class":"className","for":"htmlFor","colspan":"colSpan","rowspan":"rowSpan","accesskey":"accessKey","tabindex":"tabIndex","maxlength":"maxLength","readonly":"readOnly","frameborder":"frameBorder","value":"value","disabled":"disabled","checked":"checked","multiple":"multiple","selected":"selected"});Element.PropertiesIFlag={"href":2,"src":2};Element.Methods={Listeners:{addListener:function(B,A){if(this.addEventListener){this.addEventListener(B,A,false)}else{this.attachEvent("on"+B,A)}return this},removeListener:function(B,A){if(this.removeEventListener){this.removeEventListener(B,A,false)}else{this.detachEvent("on"+B,A)}return this}}};window.extend(Element.Methods.Listeners);document.extend(Element.Methods.Listeners);Element.extend(Element.Methods.Listeners);var Garbage={elements:[],collect:function(A){if(!A.$tmp){Garbage.elements.push(A);A.$tmp={"opacity":1}}return A},trash:function(D){for(var B=0,A=D.length,C;B<A;B++){if(!(C=D[B])||!C.$tmp){continue}if(C.$events){C.fireEvent("trash").removeEvents()}for(var E in C.$tmp){C.$tmp[E]=null}for(var F in Element.prototype){C[F]=null}Garbage.elements[Garbage.elements.indexOf(C)]=null;C.htmlElement=C.$tmp=C=null}Garbage.elements.remove(null)},empty:function(){Garbage.collect(window);Garbage.collect(document);Garbage.trash(Garbage.elements)}};window.addListener("beforeunload",function(){window.addListener("unload",Garbage.empty);if(window.ie){window.addListener("unload",CollectGarbage)}});var Event=new Class({initialize:function(C){if(C&&C.$extended){return C}this.$extended=true;C=C||window.event;this.event=C;this.type=C.type;this.target=C.target||C.srcElement;if(this.target.nodeType==3){this.target=this.target.parentNode}this.shift=C.shiftKey;this.control=C.ctrlKey;this.alt=C.altKey;this.meta=C.metaKey;if(["DOMMouseScroll","mousewheel"].contains(this.type)){this.wheel=(C.wheelDelta)?C.wheelDelta/120:-(C.detail||0)/3}else{if(this.type.contains("key")){this.code=C.which||C.keyCode;for(var B in Event.keys){if(Event.keys[B]==this.code){this.key=B;break}}if(this.type=="keydown"){var A=this.code-111;if(A>0&&A<13){this.key="f"+A}}this.key=this.key||String.fromCharCode(this.code).toLowerCase()}else{if(this.type.test(/(click|mouse|menu)/)){this.page={"x":C.pageX||C.clientX+document.documentElement.scrollLeft,"y":C.pageY||C.clientY+document.documentElement.scrollTop};this.client={"x":C.pageX?C.pageX-window.pageXOffset:C.clientX,"y":C.pageY?C.pageY-window.pageYOffset:C.clientY};this.rightClick=(C.which==3)||(C.button==2);switch(this.type){case"mouseover":this.relatedTarget=C.relatedTarget||C.fromElement;break;case"mouseout":this.relatedTarget=C.relatedTarget||C.toElement}this.fixRelatedTarget()}}}return this},stop:function(){return this.stopPropagation().preventDefault()},stopPropagation:function(){if(this.event.stopPropagation){this.event.stopPropagation()}else{this.event.cancelBubble=true}return this},preventDefault:function(){if(this.event.preventDefault){this.event.preventDefault()}else{this.event.returnValue=false}return this}});Event.fix={relatedTarget:function(){if(this.relatedTarget&&this.relatedTarget.nodeType==3){this.relatedTarget=this.relatedTarget.parentNode}},relatedTargetGecko:function(){try{Event.fix.relatedTarget.call(this)}catch(A){this.relatedTarget=this.target}}};Event.prototype.fixRelatedTarget=(window.gecko)?Event.fix.relatedTargetGecko:Event.fix.relatedTarget;Event.keys=new Abstract({"enter":13,"up":38,"down":40,"left":37,"right":39,"esc":27,"space":32,"backspace":8,"tab":9,"delete":46});Element.Methods.Events={addEvent:function(C,B){this.$events=this.$events||{};this.$events[C]=this.$events[C]||{"keys":[],"values":[]};if(this.$events[C].keys.contains(B)){return this}this.$events[C].keys.push(B);var A=C;var D=Element.Events[C];if(D){if(D.add){D.add.call(this,B)}if(D.map){B=D.map}if(D.type){A=D.type}}if(!this.addEventListener){B=B.create({"bind":this,"event":true})}this.$events[C].values.push(B);return(Element.NativeEvents.contains(A))?this.addListener(A,B):this},removeEvent:function(C,B){if(!this.$events||!this.$events[C]){return this}var F=this.$events[C].keys.indexOf(B);if(F==-1){return this}var A=this.$events[C].keys.splice(F,1)[0];var E=this.$events[C].values.splice(F,1)[0];var D=Element.Events[C];if(D){if(D.remove){D.remove.call(this,B)}if(D.type){C=D.type}}return(Element.NativeEvents.contains(C))?this.removeListener(C,E):this},addEvents:function(A){return Element.setMany(this,"addEvent",A)},removeEvents:function(A){if(!this.$events){return this}if(!A){for(var B in this.$events){this.removeEvents(B)}this.$events=null}else{if(this.$events[A]){this.$events[A].keys.each(function(C){this.removeEvent(A,C)},this);this.$events[A]=null}}return this},fireEvent:function(C,B,A){if(this.$events&&this.$events[C]){this.$events[C].keys.each(function(D){D.create({"bind":this,"delay":A,"arguments":B})()},this)}return this},cloneEvents:function(C,A){if(!C.$events){return this}if(!A){for(var B in C.$events){this.cloneEvents(C,B)}}else{if(C.$events[A]){C.$events[A].keys.each(function(D){this.addEvent(A,D)},this)}}return this}};window.extend(Element.Methods.Events);document.extend(Element.Methods.Events);Element.extend(Element.Methods.Events);Element.Events=new Abstract({"mouseenter":{type:"mouseover",map:function(A){A=new Event(A);if(A.relatedTarget!=this&&!this.hasChild(A.relatedTarget)){this.fireEvent("mouseenter",A)}}},"mouseleave":{type:"mouseout",map:function(A){A=new Event(A);if(A.relatedTarget!=this&&!this.hasChild(A.relatedTarget)){this.fireEvent("mouseleave",A)}}},"mousewheel":{type:(window.gecko)?"DOMMouseScroll":"mousewheel"}});Element.NativeEvents=["click","dblclick","mouseup","mousedown","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","keydown","keypress","keyup","load","unload","beforeunload","resize","move","focus","blur","change","submit","reset","select","error","abort","contextmenu","scroll"];Function.extend({bindWithEvent:function(B,A){return this.create({"bind":B,"arguments":A,"event":Event})}});Elements.extend({filterByTag:function(A){return new Elements(this.filter(function(B){return(Element.getTag(B)==A)}))},filterByClass:function(A,C){var B=this.filter(function(D){return(D.className&&D.className.contains(A," "))});return(C)?B:new Elements(B)},filterById:function(C,B){var A=this.filter(function(D){return(D.id==C)});return(B)?A:new Elements(A)},filterByAttribute:function(B,A,D,E){var C=this.filter(function(F){var G=Element.getProperty(F,B);if(!G){return false}if(!A){return true}switch(A){case"=":return(G==D);case"*=":return(G.contains(D));case"^=":return(G.substr(0,D.length)==D);case"$=":return(G.substr(G.length-D.length)==D);case"!=":return(G!=D);case"~=":return G.contains(D," ")}return false});return(E)?C:new Elements(C)}});function $E(A,B){return($(B)||document).getElement(A)}function $ES(A,B){return($(B)||document).getElementsBySelector(A)}$$.shared={"regexp":/^(\w*|\*)(?:#([\w-]+)|\.([\w-]+))?(?:\[(\w+)(?:([!*^$]?=)["']?([^"'\]]*)["']?)?])?$/,"xpath":{getParam:function(B,D,E,C){var A=[D.namespaceURI?"xhtml:":"",E[1]];if(E[2]){A.push('[@id="',E[2],'"]')}if(E[3]){A.push('[contains(concat(" ", @class, " "), " ',E[3],' ")]')}if(E[4]){if(E[5]&&E[6]){switch(E[5]){case"*=":A.push("[contains(@",E[4],', "',E[6],'")]');break;case"^=":A.push("[starts-with(@",E[4],', "',E[6],'")]');break;case"$=":A.push("[substring(@",E[4],", string-length(@",E[4],") - ",E[6].length,' + 1) = "',E[6],'"]');break;case"=":A.push("[@",E[4],'="',E[6],'"]');break;case"!=":A.push("[@",E[4],'!="',E[6],'"]')}}else{A.push("[@",E[4],"]")}}B.push(A.join(""));return B},getItems:function(B,E,G){var F=[];var A=document.evaluate(".//"+B.join("//"),E,$$.shared.resolver,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);for(var D=0,C=A.snapshotLength;D<C;D++){F.push(A.snapshotItem(D))}return(G)?F:new Elements(F.map($))}},"normal":{getParam:function(A,C,E,B){if(B==0){if(E[2]){var D=C.getElementById(E[2]);if(!D||((E[1]!="*")&&(Element.getTag(D)!=E[1]))){return false}A=[D]}else{A=$A(C.getElementsByTagName(E[1]))}}else{A=$$.shared.getElementsByTagName(A,E[1]);if(E[2]){A=Elements.filterById(A,E[2],true)}}if(E[3]){A=Elements.filterByClass(A,E[3],true)}if(E[4]){A=Elements.filterByAttribute(A,E[4],E[5],E[6],true)}return A},getItems:function(A,B,C){return(C)?A:$$.unique(A)}},resolver:function(A){return(A=="xhtml")?"http://www.w3.org/1999/xhtml":false},getElementsByTagName:function(D,C){var E=[];for(var B=0,A=D.length;B<A;B++){E.extend(D[B].getElementsByTagName(C))}return E}};$$.shared.method=(window.xpath)?"xpath":"normal";Element.Methods.Dom={getElements:function(A,H){var C=[];A=A.trim().split(" ");for(var E=0,D=A.length;E<D;E++){var F=A[E];var G=F.match($$.shared.regexp);if(!G){break}G[1]=G[1]||"*";var B=$$.shared[$$.shared.method].getParam(C,this,G,E);if(!B){break}C=B}return $$.shared[$$.shared.method].getItems(C,this,H)},getElement:function(A){return $(this.getElements(A,true)[0]||false)},getElementsBySelector:function(A,E){var D=[];A=A.split(",");for(var C=0,B=A.length;C<B;C++){D=D.concat(this.getElements(A[C],true))}return(E)?D:$$.unique(D)}};Element.extend({getElementById:function(C){var B=document.getElementById(C);if(!B){return false}for(var A=B.parentNode;A!=this;A=A.parentNode){if(!A){return false}}return B},getElementsByClassName:function(A){return this.getElements("."+A)}});document.extend(Element.Methods.Dom);Element.extend(Element.Methods.Dom);Element.extend({getValue:function(){switch(this.getTag()){case"select":var A=[];$each(this.options,function(B){if(B.selected){A.push($pick(B.value,B.text))}});return(this.multiple)?A:A[0];case"input":if(!(this.checked&&["checkbox","radio"].contains(this.type))&&!["hidden","text","password"].contains(this.type)){break}case"textarea":return this.value}return false},getFormElements:function(){return $$(this.getElementsByTagName("input"),this.getElementsByTagName("select"),this.getElementsByTagName("textarea"))},toQueryString:function(){var A=[];this.getFormElements().each(function(D){var C=D.name;var E=D.getValue();if(E===false||!C||D.disabled){return }var B=function(F){A.push(C+"="+encodeURIComponent(F))};if($type(E)=="array"){E.each(B)}else{B(E)}});return A.join("&")}});Element.extend({scrollTo:function(A,B){this.scrollLeft=A;this.scrollTop=B},getSize:function(){return{"scroll":{"x":this.scrollLeft,"y":this.scrollTop},"size":{"x":this.offsetWidth,"y":this.offsetHeight},"scrollSize":{"x":this.scrollWidth,"y":this.scrollHeight}}},getPosition:function(A){A=A||[];var B=this,D=0,C=0;do{D+=B.offsetLeft||0;C+=B.offsetTop||0;B=B.offsetParent}while(B);A.each(function(E){D-=E.scrollLeft||0;C-=E.scrollTop||0});return{"x":D,"y":C}},getTop:function(A){return this.getPosition(A).y},getLeft:function(A){return this.getPosition(A).x},getCoordinates:function(B){var A=this.getPosition(B);var C={"width":this.offsetWidth,"height":this.offsetHeight,"left":A.x,"top":A.y};C.right=C.left+C.width;C.bottom=C.top+C.height;return C}});Element.Events.domready={add:function(B){if(window.loaded){B.call(this);return }var A=function(){if(window.loaded){return }window.loaded=true;window.timer=$clear(window.timer);this.fireEvent("domready")}.bind(this);if(document.readyState&&window.webkit){window.timer=function(){if(["loaded","complete"].contains(document.readyState)){A()}}.periodical(50)}else{if(document.readyState&&window.ie){if(!$("ie_ready")){var C=(window.location.protocol=="https:")?"://0":"javascript:void(0)";document.write('<script id="ie_ready" defer src="'+C+'"><\/script>');$("ie_ready").onreadystatechange=function(){if(this.readyState=="complete"){A()}}}}else{window.addListener("load",A);document.addListener("DOMContentLoaded",A)}}}};window.onDomReady=function(A){return this.addEvent("domready",A)};window.extend({getWidth:function(){if(this.webkit419){return this.innerWidth}if(this.opera){return document.body.clientWidth}return document.documentElement.clientWidth},getHeight:function(){if(this.webkit419){return this.innerHeight}if(this.opera){return document.body.clientHeight}return document.documentElement.clientHeight},getScrollWidth:function(){if(this.ie){return Math.max(document.documentElement.offsetWidth,document.documentElement.scrollWidth)}if(this.webkit){return document.body.scrollWidth}return document.documentElement.scrollWidth},getScrollHeight:function(){if(this.ie){return Math.max(document.documentElement.offsetHeight,document.documentElement.scrollHeight)}if(this.webkit){return document.body.scrollHeight}return document.documentElement.scrollHeight},getScrollLeft:function(){return this.pageXOffset||document.documentElement.scrollLeft},getScrollTop:function(){return this.pageYOffset||document.documentElement.scrollTop},getSize:function(){return{"size":{"x":this.getWidth(),"y":this.getHeight()},"scrollSize":{"x":this.getScrollWidth(),"y":this.getScrollHeight()},"scroll":{"x":this.getScrollLeft(),"y":this.getScrollTop()}}},getPosition:function(){return{"x":0,"y":0}}});var Fx={};Fx.Base=new Class({options:{onStart:Class.empty,onComplete:Class.empty,onCancel:Class.empty,transition:function(A){return -(Math.cos(Math.PI*A)-1)/2},duration:500,unit:"px",wait:true,fps:50},initialize:function(A){this.element=this.element||null;this.setOptions(A);if(this.options.initialize){this.options.initialize.call(this)}},step:function(){var A=$time();if(A<this.time+this.options.duration){this.delta=this.options.transition((A-this.time)/this.options.duration);this.setNow();this.increase()}else{this.stop(true);this.set(this.to);this.fireEvent("onComplete",this.element,10);this.callChain()}},set:function(A){this.now=A;this.increase();return this},setNow:function(){this.now=this.compute(this.from,this.to)},compute:function(B,A){return(A-B)*this.delta+B},start:function(B,A){if(!this.options.wait){this.stop()}else{if(this.timer){return this}}this.from=B;this.to=A;this.change=this.to-this.from;this.time=$time();this.timer=this.step.periodical(Math.round(1000/this.options.fps),this);this.fireEvent("onStart",this.element);return this},stop:function(A){if(!this.timer){return this}this.timer=$clear(this.timer);if(!A){this.fireEvent("onCancel",this.element)}return this},custom:function(B,A){return this.start(B,A)},clearTimer:function(A){return this.stop(A)}});Fx.Base.implement(new Chain,new Events,new Options);Fx.CSS={select:function(B,C){if(B.test(/color/i)){return this.Color}var A=$type(C);if((A=="array")||(A=="string"&&C.contains(" "))){return this.Multi}return this.Single},parse:function(C,D,A){if(!A.push){A=[A]}var F=A[0],E=A[1];if(!$chk(E)){E=F;F=C.getStyle(D)}var B=this.select(D,E);return{"from":B.parse(F),"to":B.parse(E),"css":B}}};Fx.CSS.Single={parse:function(A){return parseFloat(A)},getNow:function(C,B,A){return A.compute(C,B)},getValue:function(C,A,B){if(A=="px"&&B!="opacity"){C=Math.round(C)}return C+A}};Fx.CSS.Multi={parse:function(A){return A.push?A:A.split(" ").map(function(B){return parseFloat(B)})},getNow:function(E,D,C){var A=[];for(var B=0;B<E.length;B++){A[B]=C.compute(E[B],D[B])}return A},getValue:function(C,A,B){if(A=="px"&&B!="opacity"){C=C.map(Math.round)}return C.join(A+" ")+A}};Fx.CSS.Color={parse:function(A){return A.push?A:A.hexToRgb(true)},getNow:function(E,D,C){var A=[];for(var B=0;B<E.length;B++){A[B]=Math.round(C.compute(E[B],D[B]))}return A},getValue:function(A){return"rgb("+A.join(",")+")"}};Fx.Style=Fx.Base.extend({initialize:function(B,C,A){this.element=$(B);this.property=C;this.parent(A)},hide:function(){return this.set(0)},setNow:function(){this.now=this.css.getNow(this.from,this.to,this)},set:function(A){this.css=Fx.CSS.select(this.property,A);return this.parent(this.css.parse(A))},start:function(C,B){if(this.timer&&this.options.wait){return this}var A=Fx.CSS.parse(this.element,this.property,[C,B]);this.css=A.css;return this.parent(A.from,A.to)},increase:function(){this.element.setStyle(this.property,this.css.getValue(this.now,this.options.unit,this.property))}});Element.extend({effect:function(B,A){return new Fx.Style(this,B,A)}});Fx.Styles=Fx.Base.extend({initialize:function(B,A){this.element=$(B);this.parent(A)},setNow:function(){for(var A in this.from){this.now[A]=this.css[A].getNow(this.from[A],this.to[A],this)}},set:function(C){var A={};this.css={};for(var B in C){this.css[B]=Fx.CSS.select(B,C[B]);A[B]=this.css[B].parse(C[B])}return this.parent(A)},start:function(C){if(this.timer&&this.options.wait){return this}this.now={};this.css={};var E={},D={};for(var B in C){var A=Fx.CSS.parse(this.element,B,C[B]);E[B]=A.from;D[B]=A.to;this.css[B]=A.css}return this.parent(E,D)},increase:function(){for(var A in this.now){this.element.setStyle(A,this.css[A].getValue(this.now[A],this.options.unit,A))}}});Element.extend({effects:function(A){return new Fx.Styles(this,A)}});Fx.Elements=Fx.Base.extend({initialize:function(B,A){this.elements=$$(B);this.parent(A)},setNow:function(){for(var C in this.from){var F=this.from[C],E=this.to[C],B=this.css[C],A=this.now[C]={};for(var D in F){A[D]=B[D].getNow(F[D],E[D],this)}}},set:function(G){var B={};this.css={};for(var D in G){var F=G[D],C=this.css[D]={},A=B[D]={};for(var E in F){C[E]=Fx.CSS.select(E,F[E]);A[E]=C[E].parse(F[E])}}return this.parent(B)},start:function(D){if(this.timer&&this.options.wait){return this}this.now={};this.css={};var I={},J={};for(var E in D){var G=D[E],A=I[E]={},H=J[E]={},C=this.css[E]={};for(var B in G){var F=Fx.CSS.parse(this.elements[E],B,G[B]);A[B]=F.from;H[B]=F.to;C[B]=F.css}}return this.parent(I,J)},increase:function(){for(var C in this.now){var A=this.now[C],B=this.css[C];for(var D in A){this.elements[C].setStyle(D,B[D].getValue(A[D],this.options.unit,D))}}}});Fx.Scroll=Fx.Base.extend({options:{overflown:[],offset:{"x":0,"y":0},wheelStops:true},initialize:function(B,A){this.now=[];this.element=$(B);this.bound={"stop":this.stop.bind(this,false)};this.parent(A);if(this.options.wheelStops){this.addEvent("onStart",function(){document.addEvent("mousewheel",this.bound.stop)}.bind(this));this.addEvent("onComplete",function(){document.removeEvent("mousewheel",this.bound.stop)}.bind(this))}},setNow:function(){for(var A=0;A<2;A++){this.now[A]=this.compute(this.from[A],this.to[A])}},scrollTo:function(B,F){if(this.timer&&this.options.wait){return this}var D=this.element.getSize();var C={"x":B,"y":F};for(var E in D.size){var A=D.scrollSize[E]-D.size[E];if($chk(C[E])){C[E]=($type(C[E])=="number")?C[E].limit(0,A):A}else{C[E]=D.scroll[E]}C[E]+=this.options.offset[E]}return this.start([D.scroll.x,D.scroll.y],[C.x,C.y])},toTop:function(){return this.scrollTo(false,0)},toBottom:function(){return this.scrollTo(false,"full")},toLeft:function(){return this.scrollTo(0,false)},toRight:function(){return this.scrollTo("full",false)},toElement:function(B){var A=this.element.getPosition(this.options.overflown);var C=$(B).getPosition(this.options.overflown);return this.scrollTo(C.x-A.x,C.y-A.y)},increase:function(){this.element.scrollTo(this.now[0],this.now[1])}});Fx.Slide=Fx.Base.extend({options:{mode:"vertical"},initialize:function(B,A){this.element=$(B);this.wrapper=new Element("div",{"styles":$extend(this.element.getStyles("margin"),{"overflow":"hidden"})}).injectAfter(this.element).adopt(this.element);this.element.setStyle("margin",0);this.setOptions(A);this.now=[];this.parent(this.options);this.open=true;this.addEvent("onComplete",function(){this.open=(this.now[0]===0)});if(window.webkit419){this.addEvent("onComplete",function(){if(this.open){this.element.remove().inject(this.wrapper)}})}},setNow:function(){for(var A=0;A<2;A++){this.now[A]=this.compute(this.from[A],this.to[A])}},vertical:function(){this.margin="margin-top";this.layout="height";this.offset=this.element.offsetHeight},horizontal:function(){this.margin="margin-left";this.layout="width";this.offset=this.element.offsetWidth},slideIn:function(A){this[A||this.options.mode]();return this.start([this.element.getStyle(this.margin).toInt(),this.wrapper.getStyle(this.layout).toInt()],[0,this.offset])},slideOut:function(A){this[A||this.options.mode]();return this.start([this.element.getStyle(this.margin).toInt(),this.wrapper.getStyle(this.layout).toInt()],[-this.offset,0])},hide:function(A){this[A||this.options.mode]();this.open=false;return this.set([-this.offset,0])},show:function(A){this[A||this.options.mode]();this.open=true;return this.set([0,this.offset])},toggle:function(A){if(this.wrapper.offsetHeight==0||this.wrapper.offsetWidth==0){return this.slideIn(A)}return this.slideOut(A)},increase:function(){this.element.setStyle(this.margin,this.now[0]+this.options.unit);this.wrapper.setStyle(this.layout,this.now[1]+this.options.unit)}});Fx.Transition=function(B,A){A=A||[];if($type(A)!="array"){A=[A]}return $extend(B,{easeIn:function(C){return B(C,A)},easeOut:function(C){return 1-B(1-C,A)},easeInOut:function(C){return(C<=0.5)?B(2*C,A)/2:(2-B(2*(1-C),A))/2}})};Fx.Transitions=new Abstract({linear:function(A){return A}});Fx.Transitions.extend=function(A){for(var B in A){Fx.Transitions[B]=new Fx.Transition(A[B]);Fx.Transitions.compat(B)}};Fx.Transitions.compat=function(A){["In","Out","InOut"].each(function(B){Fx.Transitions[A.toLowerCase()+B]=Fx.Transitions[A]["ease"+B]})};Fx.Transitions.extend({Pow:function(B,A){return Math.pow(B,A[0]||6)},Expo:function(A){return Math.pow(2,8*(A-1))},Circ:function(A){return 1-Math.sin(Math.acos(A))},Sine:function(A){return 1-Math.sin((1-A)*Math.PI/2)},Back:function(B,A){A=A[0]||1.618;return Math.pow(B,2)*((A+1)*B-A)},Bounce:function(D){var C;for(var B=0,A=1;1;B+=A,A/=2){if(D>=(7-4*B)/11){C=-Math.pow((11-6*B-11*D)/4,2)+A*A;break}}return C},Elastic:function(B,A){return Math.pow(2,10*--B)*Math.cos(20*B*Math.PI*(A[0]||1)/3)}});["Quad","Cubic","Quart","Quint"].each(function(B,A){Fx.Transitions[B]=new Fx.Transition(function(C){return Math.pow(C,[A+2])});Fx.Transitions.compat(B)});var Drag={};Drag.Base=new Class({options:{handle:false,unit:"px",onStart:Class.empty,onBeforeStart:Class.empty,onComplete:Class.empty,onSnap:Class.empty,onDrag:Class.empty,limit:false,modifiers:{x:"left",y:"top"},grid:false,snap:6},initialize:function(B,A){this.setOptions(A);this.element=$(B);this.handle=$(this.options.handle)||this.element;this.mouse={"now":{},"pos":{}};this.value={"start":{},"now":{}};this.bound={"start":this.start.bindWithEvent(this),"check":this.check.bindWithEvent(this),"drag":this.drag.bindWithEvent(this),"stop":this.stop.bind(this)};this.attach();if(this.options.initialize){this.options.initialize.call(this)}},attach:function(){this.handle.addEvent("mousedown",this.bound.start);return this},detach:function(){this.handle.removeEvent("mousedown",this.bound.start);return this},start:function(C){this.fireEvent("onBeforeStart",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}this.value.now[D]=this.element.getStyle(this.options.modifiers[D]).toInt();this.mouse.pos[D]=C.page[D]-this.value.now[D];if(A&&A[D]){for(var B=0;B<2;B++){if($chk(A[D][B])){this.limit[D][B]=($type(A[D][B])=="function")?A[D][B]():A[D][B]}}}}if($type(this.options.grid)=="number"){this.options.grid={"x":this.options.grid,"y":this.options.grid}}document.addListener("mousemove",this.bound.check);document.addListener("mouseup",this.bound.stop);this.fireEvent("onStart",this.element);C.stop()},check:function(A){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){document.removeListener("mousemove",this.bound.check);document.addListener("mousemove",this.bound.drag);this.drag(A);this.fireEvent("onSnap",this.element)}A.stop()},drag:function(A){this.out=false;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.limit[B]){if($chk(this.limit[B][1])&&(this.value.now[B]>this.limit[B][1])){this.value.now[B]=this.limit[B][1];this.out=true}else{if($chk(this.limit[B][0])&&(this.value.now[B]<this.limit[B][0])){this.value.now[B]=this.limit[B][0];this.out=true}}}if(this.options.grid[B]){this.value.now[B]-=(this.value.now[B]%this.options.grid[B])}this.element.setStyle(this.options.modifiers[B],this.value.now[B]+this.options.unit)}this.fireEvent("onDrag",this.element);A.stop()},stop:function(){document.removeListener("mousemove",this.bound.check);document.removeListener("mousemove",this.bound.drag);document.removeListener("mouseup",this.bound.stop);this.fireEvent("onComplete",this.element)}});Drag.Base.implement(new Events,new Options);Element.extend({makeResizable:function(A){return new Drag.Base(this,$merge({modifiers:{x:"width",y:"height"}},A))}});Drag.Move=Drag.Base.extend({options:{droppables:[],container:false,overflown:[]},initialize:function(B,A){this.setOptions(A);this.element=$(B);this.droppables=$$(this.options.droppables);this.container=$(this.options.container);this.position={"element":this.element.getStyle("position"),"container":false};if(this.container){this.position.container=this.container.getStyle("position")}if(!["relative","absolute","fixed"].contains(this.position.element)){this.position.element="absolute"}var D=this.element.getStyle("top").toInt();var C=this.element.getStyle("left").toInt();if(this.position.element=="absolute"&&!["relative","absolute","fixed"].contains(this.position.container)){D=$chk(D)?D:this.element.getTop(this.options.overflown);C=$chk(C)?C:this.element.getLeft(this.options.overflown)}else{D=$chk(D)?D:0;C=$chk(C)?C:0}this.element.setStyles({"top":D,"left":C,"position":this.position.element});this.parent(this.element)},start:function(C){this.overed=null;if(this.container){var A=this.container.getCoordinates();var B=this.element.getCoordinates();if(this.position.element=="absolute"&&!["relative","absolute","fixed"].contains(this.position.container)){this.options.limit={"x":[A.left,A.right-B.width],"y":[A.top,A.bottom-B.height]}}else{this.options.limit={"y":[0,A.height-B.height],"x":[0,A.width-B.width]}}}this.parent(C)},drag:function(A){this.parent(A);var B=this.out?false:this.droppables.filter(this.checkAgainst,this).getLast();if(this.overed!=B){if(this.overed){this.overed.fireEvent("leave",[this.element,this])}this.overed=B?B.fireEvent("over",[this.element,this]):null}return this},checkAgainst:function(B){B=B.getCoordinates(this.options.overflown);var A=this.mouse.now;return(A.x>B.left&&A.x<B.right&&A.y<B.bottom&&A.y>B.top)},stop:function(){if(this.overed&&!this.out){this.overed.fireEvent("drop",[this.element,this])}else{this.element.fireEvent("emptydrop",this)}this.parent();return this}});Element.extend({makeDraggable:function(A){return new Drag.Move(this,A)}});var XHR=new Class({options:{method:"post",async:true,onRequest:Class.empty,onSuccess:Class.empty,onFailure:Class.empty,urlEncoded:true,encoding:"utf-8",autoCancel:false,headers:{}},setTransport:function(){this.transport=(window.XMLHttpRequest)?new XMLHttpRequest():(window.ie?new ActiveXObject("Microsoft.XMLHTTP"):false);return this},initialize:function(A){this.setTransport().setOptions(A);this.options.isSuccess=this.options.isSuccess||this.isSuccess;this.headers={};if(this.options.urlEncoded&&this.options.method=="post"){var B=(this.options.encoding)?"; charset="+this.options.encoding:"";this.setHeader("Content-type","application/x-www-form-urlencoded"+B)}if(this.options.initialize){this.options.initialize.call(this)}},onStateChange:function(){if(this.transport.readyState!=4||!this.running){return }this.running=false;var A=0;try{A=this.transport.status}catch(B){}if(this.options.isSuccess.call(this,A)){this.onSuccess()}else{this.onFailure()}this.transport.onreadystatechange=Class.empty},isSuccess:function(A){return((A>=200)&&(A<300))},onSuccess:function(){this.response={"text":this.transport.responseText,"xml":this.transport.responseXML};this.fireEvent("onSuccess",[this.response.text,this.response.xml]);this.callChain()},onFailure:function(){this.fireEvent("onFailure",this.transport)},setHeader:function(A,B){this.headers[A]=B;return this},send:function(A,C){if(this.options.autoCancel){this.cancel()}else{if(this.running){return this}}this.running=true;if(C&&this.options.method=="get"){A=A+(A.contains("?")?"&":"?")+C;C=null}this.transport.open(this.options.method.toUpperCase(),A,this.options.async);this.transport.onreadystatechange=this.onStateChange.bind(this);if((this.options.method=="post")&&this.transport.overrideMimeType){this.setHeader("Connection","close")}$extend(this.headers,this.options.headers);for(var B in this.headers){try{this.transport.setRequestHeader(B,this.headers[B])}catch(D){}}this.fireEvent("onRequest");this.transport.send($pick(C,null));return this},cancel:function(){if(!this.running){return this}this.running=false;this.transport.abort();this.transport.onreadystatechange=Class.empty;this.setTransport();this.fireEvent("onCancel");return this}});XHR.implement(new Chain,new Events,new Options);var Ajax=XHR.extend({options:{data:null,update:null,onComplete:Class.empty,evalScripts:false,evalResponse:false},initialize:function(B,A){this.addEvent("onSuccess",this.onComplete);this.setOptions(A);this.options.data=this.options.data||this.options.postBody;if(!["post","get"].contains(this.options.method)){this._method="_method="+this.options.method;this.options.method="post"}this.parent();this.setHeader("X-Requested-With","XMLHttpRequest");this.setHeader("Accept","text/javascript, text/html, application/xml, text/xml, */*");this.url=B},onComplete:function(){if(this.options.update){$(this.options.update).empty().setHTML(this.response.text)}if(this.options.evalScripts||this.options.evalResponse){this.evalScripts()}this.fireEvent("onComplete",[this.response.text,this.response.xml],20)},request:function(A){A=A||this.options.data;switch($type(A)){case"element":A=$(A).toQueryString();break;case"object":A=Object.toQueryString(A)}if(this._method){A=(A)?[this._method,A].join("&"):this._method}return this.send(this.url,A)},evalScripts:function(){var B,A;if(this.options.evalResponse||(/(ecma|java)script/).test(this.getHeader("Content-type"))){A=this.response.text}else{A=[];var C=/<script[^>]*>([\s\S]*?)<\/script>/gi;while((B=C.exec(this.response.text))){A.push(B[1])}A=A.join("\n")}if(A){(window.execScript)?window.execScript(A):window.setTimeout(A,0)}},getHeader:function(A){try{return this.transport.getResponseHeader(A)}catch(B){}return null}});Object.toQueryString=function(B){var C=[];for(var A in B){C.push(encodeURIComponent(A)+"="+encodeURIComponent(B[A]))}return C.join("&")};Element.extend({send:function(A){return new Ajax(this.getProperty("action"),$merge({data:this.toQueryString()},A,{method:"post"})).request()}});var Cookie=new Abstract({options:{domain:false,path:false,duration:false,secure:false},set:function(C,D,B){B=$merge(this.options,B);D=encodeURIComponent(D);if(B.domain){D+="; domain="+B.domain}if(B.path){D+="; path="+B.path}if(B.duration){var A=new Date();A.setTime(A.getTime()+B.duration*24*60*60*1000);D+="; expires="+A.toGMTString()}if(B.secure){D+="; secure"}document.cookie=C+"="+D;return $extend(B,{"key":C,"value":D})},get:function(A){var B=document.cookie.match("(?:^|;)\\s*"+A.escapeRegExp()+"=([^;]*)");return B?decodeURIComponent(B[1]):false},remove:function(B,A){if($type(B)=="object"){this.set(B.key,"",$merge(B,{duration:-1}))}else{this.set(B,"",$merge(A,{duration:-1}))}}});var Json={toString:function(C){switch($type(C)){case"string":return'"'+C.replace(/(["\\])/g,"\\$1")+'"';case"array":return"["+C.map(Json.toString).join(",")+"]";case"object":var A=[];for(var B in C){A.push(Json.toString(B)+":"+Json.toString(C[B]))}return"{"+A.join(",")+"}";case"number":if(isFinite(C)){break}case false:return"null"}return String(C)},evaluate:function(str,secure){return(($type(str)!="string")||(secure&&!str.test(/^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/)))?null:eval("("+str+")")}};Json.Remote=XHR.extend({initialize:function(B,A){this.url=B;this.addEvent("onSuccess",this.onComplete);this.parent(A);this.setHeader("X-Request","JSON")},send:function(A){return this.parent(this.url,"json="+Json.toString(A))},onComplete:function(){this.fireEvent("onComplete",[Json.evaluate(this.response.text,this.options.secure)])}});var Asset=new Abstract({javascript:function(C,B){B=$merge({"onload":Class.empty},B);var A=new Element("script",{"src":C}).addEvents({"load":B.onload,"readystatechange":function(){if(this.readyState=="complete"){this.fireEvent("load")}}});delete B.onload;return A.setProperties(B).inject(document.head)},css:function(B,A){return new Element("link",$merge({"rel":"stylesheet","media":"screen","type":"text/css","href":B},A)).inject(document.head)},image:function(C,B){B=$merge({"onload":Class.empty,"onabort":Class.empty,"onerror":Class.empty},B);var D=new Image();D.src=C;var A=new Element("img",{"src":C});["load","abort","error"].each(function(E){var F=B["on"+E];delete B["on"+E];A.addEvent(E,function(){this.removeEvent(E,arguments.callee);F.call(this)})});if(D.width&&D.height){A.fireEvent("load",A,1)}return A.setProperties(B)},images:function(D,C){C=$merge({onComplete:Class.empty,onProgress:Class.empty},C);if(!D.push){D=[D]}var A=[];var B=0;D.each(function(F){var E=new Asset.image(F,{"onload":function(){C.onProgress.call(this,B);B++;if(B==D.length){C.onComplete()}}});A.push(E)});return new Elements(A)}});var Accordion=Fx.Elements.extend({options:{onActive:Class.empty,onBackground:Class.empty,display:0,show:false,height:true,width:false,opacity:true,fixedHeight:false,fixedWidth:false,wait:false,alwaysHide:false},initialize:function(){var C,E,F,B;$each(arguments,function(I,H){switch($type(I)){case"object":C=I;break;case"element":B=$(I);break;default:var G=$$(I);if(!E){E=G}else{F=G}}});this.togglers=E||[];this.elements=F||[];this.container=$(B);this.setOptions(C);this.previous=-1;if(this.options.alwaysHide){this.options.wait=true}if($chk(this.options.show)){this.options.display=false;this.previous=this.options.show}if(this.options.start){this.options.display=false;this.options.show=false}this.effects={};if(this.options.opacity){this.effects.opacity="fullOpacity"}if(this.options.width){this.effects.width=this.options.fixedWidth?"fullWidth":"offsetWidth"}if(this.options.height){this.effects.height=this.options.fixedHeight?"fullHeight":"scrollHeight"}for(var D=0,A=this.togglers.length;D<A;D++){this.addSection(this.togglers[D],this.elements[D])}this.elements.each(function(H,G){if(this.options.show===G){this.fireEvent("onActive",[this.togglers[G],H])}else{for(var I in this.effects){H.setStyle(I,0)}}},this);this.parent(this.elements);if($chk(this.options.display)){this.display(this.options.display)}},addSection:function(E,C,G){E=$(E);C=$(C);var F=this.togglers.contains(E);var B=this.togglers.length;this.togglers.include(E);this.elements.include(C);if(B&&(!F||G)){G=$pick(G,B-1);E.injectBefore(this.togglers[G]);C.injectAfter(E)}else{if(this.container&&!F){E.inject(this.container);C.inject(this.container)}}var A=this.togglers.indexOf(E);E.addEvent("click",this.display.bind(this,A));if(this.options.height){C.setStyles({"padding-top":0,"border-top":"none","padding-bottom":0,"border-bottom":"none"})}if(this.options.width){C.setStyles({"padding-left":0,"border-left":"none","padding-right":0,"border-right":"none"})}C.fullOpacity=1;if(this.options.fixedWidth){C.fullWidth=this.options.fixedWidth}if(this.options.fixedHeight){C.fullHeight=this.options.fixedHeight}C.setStyle("overflow","hidden");if(!F){for(var D in this.effects){C.setStyle(D,0)}}return this},display:function(A){A=($type(A)=="element")?this.elements.indexOf(A):A;if((this.timer&&this.options.wait)||(A===this.previous&&!this.options.alwaysHide)){return this}this.previous=A;var B={};this.elements.each(function(E,D){B[D]={};var C=(D!=A)||(this.options.alwaysHide&&(E.offsetHeight>0));this.fireEvent(C?"onBackground":"onActive",[this.togglers[D],E]);for(var F in this.effects){B[D][F]=C?0:E[this.effects[F]]}},this);return this.start(B)},showThisHideOpen:function(A){return this.display(A)}});Fx.Accordion=Accordion;var Color=new Class({initialize:function(B,D){D=D||(B.push?"rgb":"hex");var C,A;switch(D){case"rgb":C=B;A=C.rgbToHsb();break;case"hsb":C=B.hsbToRgb();A=B;break;default:C=B.hexToRgb(true);A=C.rgbToHsb()}C.hsb=A;C.hex=C.rgbToHex();return $extend(C,Color.prototype)},mix:function(){var A=$A(arguments);var C=($type(A[A.length-1])=="number")?A.pop():50;var B=this.copy();A.each(function(D){D=new Color(D);for(var E=0;E<3;E++){B[E]=Math.round((B[E]/100*(100-C))+(D[E]/100*C))}});return new Color(B,"rgb")},invert:function(){return new Color(this.map(function(A){return 255-A}))},setHue:function(A){return new Color([A,this.hsb[1],this.hsb[2]],"hsb")},setSaturation:function(A){return new Color([this.hsb[0],A,this.hsb[2]],"hsb")},setBrightness:function(A){return new Color([this.hsb[0],this.hsb[1],A],"hsb")}});function $RGB(C,B,A){return new Color([C,B,A],"rgb")}function $HSB(C,B,A){return new Color([C,B,A],"hsb")}Array.extend({rgbToHsb:function(){var B=this[0],C=this[1],J=this[2];var G,F,H;var I=Math.max(B,C,J),E=Math.min(B,C,J);var K=I-E;H=I/255;F=(I!=0)?K/I:0;if(F==0){G=0}else{var D=(I-B)/K;var A=(I-C)/K;var L=(I-J)/K;if(B==I){G=L-A}else{if(C==I){G=2+D-L}else{G=4+A-D}}G/=6;if(G<0){G++}}return[Math.round(G*360),Math.round(F*100),Math.round(H*100)]},hsbToRgb:function(){var C=Math.round(this[2]/100*255);if(this[1]==0){return[C,C,C]}else{var A=this[0]%360;var E=A%60;var F=Math.round((this[2]*(100-this[1]))/10000*255);var D=Math.round((this[2]*(6000-this[1]*E))/600000*255);var B=Math.round((this[2]*(6000-this[1]*(60-E)))/600000*255);switch(Math.floor(A/60)){case 0:return[C,B,F];case 1:return[D,C,F];case 2:return[F,C,B];case 3:return[F,D,C];case 4:return[B,F,C];case 5:return[C,F,D]}}return false}});var Group=new Class({initialize:function(){this.instances=$A(arguments);this.events={};this.checker={}},addEvent:function(B,A){this.checker[B]=this.checker[B]||{};this.events[B]=this.events[B]||[];if(this.events[B].contains(A)){return false}else{this.events[B].push(A)}this.instances.each(function(C,D){C.addEvent(B,this.check.bind(this,[B,C,D]))},this);return this},check:function(C,A,B){this.checker[C][B]=true;var D=this.instances.every(function(F,E){return this.checker[C][E]||false},this);if(!D){return }this.checker[C]={};this.events[C].each(function(E){E.call(this,this.instances,A)},this)}});var Hash=new Class({length:0,initialize:function(A){this.obj=A||{};this.setLength()},get:function(A){return(this.hasKey(A))?this.obj[A]:null},hasKey:function(A){return(A in this.obj)},set:function(A,B){if(!this.hasKey(A)){this.length++}this.obj[A]=B;return this},setLength:function(){this.length=0;for(var A in this.obj){this.length++}return this},remove:function(A){if(this.hasKey(A)){delete this.obj[A];this.length--}return this},each:function(A,B){$each(this.obj,A,B)},extend:function(A){$extend(this.obj,A);return this.setLength()},merge:function(){this.obj=$merge.apply(null,[this.obj].extend(arguments));return this.setLength()},empty:function(){this.obj={};this.length=0;return this},keys:function(){var A=[];for(var B in this.obj){A.push(B)}return A},values:function(){var A=[];for(var B in this.obj){A.push(this.obj[B])}return A}});function $H(A){return new Hash(A)}Hash.Cookie=Hash.extend({initialize:function(B,A){this.name=B;this.options=$extend({"autoSave":true},A||{});this.load()},save:function(){if(this.length==0){Cookie.remove(this.name,this.options);return true}var A=Json.toString(this.obj);if(A.length>4096){return false}Cookie.set(this.name,A,this.options);return true},load:function(){this.obj=Json.evaluate(Cookie.get(this.name),true)||{};this.setLength()}});Hash.Cookie.Methods={};["extend","set","merge","empty","remove"].each(function(A){Hash.Cookie.Methods[A]=function(){Hash.prototype[A].apply(this,arguments);if(this.options.autoSave){this.save()}return this}});Hash.Cookie.implement(Hash.Cookie.Methods);var Scroller=new Class({options:{area:20,velocity:1,onChange:function(A,B){this.element.scrollTo(A,B)}},initialize:function(B,A){this.setOptions(A);this.element=$(B);this.mousemover=([window,document].contains(B))?$(document.body):this.element},start:function(){this.coord=this.getCoords.bindWithEvent(this);this.mousemover.addListener("mousemove",this.coord)},stop:function(){this.mousemover.removeListener("mousemove",this.coord);this.timer=$clear(this.timer)},getCoords:function(A){this.page=(this.element==window)?A.client:A.page;if(!this.timer){this.timer=this.scroll.periodical(50,this)}},scroll:function(){var A=this.element.getSize();var D=this.element.getPosition();var C={"x":0,"y":0};for(var B in this.page){if(this.page[B]<(this.options.area+D[B])&&A.scroll[B]!=0){C[B]=(this.page[B]-this.options.area-D[B])*this.options.velocity}else{if(this.page[B]+this.options.area>(A.size[B]+D[B])&&A.scroll[B]+A.size[B]!=A.scrollSize[B]){C[B]=(this.page[B]-A.size[B]+this.options.area-D[B])*this.options.velocity}}}if(C.y||C.x){this.fireEvent("onChange",[A.scroll.x+C.x,A.scroll.y+C.y])}}});Scroller.implement(new Events,new Options);var Slider=new Class({options:{onChange:Class.empty,onComplete:Class.empty,onTick:function(A){this.knob.setStyle(this.p,A)},mode:"horizontal",steps:100,offset:0},initialize:function(D,A,B){this.element=$(D);this.knob=$(A);this.setOptions(B);this.previousChange=-1;this.previousEnd=-1;this.step=-1;this.element.addEvent("mousedown",this.clickedElement.bindWithEvent(this));var C,F;switch(this.options.mode){case"horizontal":this.z="x";this.p="left";C={"x":"left","y":false};F="offsetWidth";break;case"vertical":this.z="y";this.p="top";C={"x":false,"y":"top"};F="offsetHeight"}this.max=this.element[F]-this.knob[F]+(this.options.offset*2);this.half=this.knob[F]/2;this.getPos=this.element["get"+this.p.capitalize()].bind(this.element);this.knob.setStyle("position","relative").setStyle(this.p,-this.options.offset);var E={};E[this.z]=[-this.options.offset,this.max-this.options.offset];this.drag=new Drag.Base(this.knob,{limit:E,modifiers:C,snap:0,onStart:function(){this.draggedKnob()}.bind(this),onDrag:function(){this.draggedKnob()}.bind(this),onComplete:function(){this.draggedKnob();this.end()}.bind(this)});if(this.options.initialize){this.options.initialize.call(this)}},set:function(A){this.step=A.limit(0,this.options.steps);this.checkStep();this.end();this.fireEvent("onTick",this.toPosition(this.step));return this},clickedElement:function(B){var A=B.page[this.z]-this.getPos()-this.half;A=A.limit(-this.options.offset,this.max-this.options.offset);this.step=this.toStep(A);this.checkStep();this.end();this.fireEvent("onTick",A)},draggedKnob:function(){this.step=this.toStep(this.drag.value.now[this.z]);this.checkStep()},checkStep:function(){if(this.previousChange!=this.step){this.previousChange=this.step;this.fireEvent("onChange",this.step)}},end:function(){if(this.previousEnd!==this.step){this.previousEnd=this.step;this.fireEvent("onComplete",this.step+"")}},toStep:function(A){return Math.round((A+this.options.offset)/this.max*this.options.steps)},toPosition:function(A){return this.max*A/this.options.steps}});Slider.implement(new Events);Slider.implement(new Options);var SmoothScroll=Fx.Scroll.extend({initialize:function(B){this.parent(window,B);this.links=(this.options.links)?$$(this.options.links):$$(document.links);var A=window.location.href.match(/^[^#]*/)[0]+"#";this.links.each(function(D){if(D.href.indexOf(A)!=0){return }var C=D.href.substr(A.length);if(C&&$(C)){this.useLink(D,C)}},this);if(!window.webkit419){this.addEvent("onComplete",function(){window.location.hash=this.anchor})}},useLink:function(B,A){B.addEvent("click",function(C){this.anchor=A;this.toElement(A);C.stop()}.bindWithEvent(this))}});var Sortables=new Class({options:{handles:false,onStart:Class.empty,onComplete:Class.empty,ghost:true,snap:3,onDragStart:function(A,B){B.setStyle("opacity",0.7);A.setStyle("opacity",0.7)},onDragComplete:function(A,B){A.setStyle("opacity",1);B.remove();this.trash.remove()}},initialize:function(D,B){this.setOptions(B);this.list=$(D);this.elements=this.list.getChildren();this.handles=(this.options.handles)?$$(this.options.handles):this.elements;this.bound={"start":[],"moveGhost":this.moveGhost.bindWithEvent(this)};for(var C=0,A=this.handles.length;C<A;C++){this.bound.start[C]=this.start.bindWithEvent(this,this.elements[C])}this.attach();if(this.options.initialize){this.options.initialize.call(this)}this.bound.move=this.move.bindWithEvent(this);this.bound.end=this.end.bind(this)},attach:function(){this.handles.each(function(B,A){B.addEvent("mousedown",this.bound.start[A])},this)},detach:function(){this.handles.each(function(B,A){B.removeEvent("mousedown",this.bound.start[A])},this)},start:function(C,B){this.active=B;this.coordinates=this.list.getCoordinates();if(this.options.ghost){var A=B.getPosition();this.offset=C.page.y-A.y;this.trash=new Element("div").inject(document.body);this.ghost=B.clone().inject(this.trash).setStyles({"position":"absolute","left":A.x,"top":C.page.y-this.offset});document.addListener("mousemove",this.bound.moveGhost);this.fireEvent("onDragStart",[B,this.ghost])}document.addListener("mousemove",this.bound.move);document.addListener("mouseup",this.bound.end);this.fireEvent("onStart",B);C.stop()},moveGhost:function(A){var B=A.page.y-this.offset;B=B.limit(this.coordinates.top,this.coordinates.bottom-this.ghost.offsetHeight);this.ghost.setStyle("top",B);A.stop()},move:function(E){var B=E.page.y;this.previous=this.previous||B;var A=((this.previous-B)>0);var D=this.active.getPrevious();var C=this.active.getNext();if(D&&A&&B<D.getCoordinates().bottom){this.active.injectBefore(D)}if(C&&!A&&B>C.getCoordinates().top){this.active.injectAfter(C)}this.previous=B},serialize:function(A){return this.list.getChildren().map(A||function(B){return this.elements.indexOf(B)},this)},end:function(){this.previous=null;document.removeListener("mousemove",this.bound.move);document.removeListener("mouseup",this.bound.end);if(this.options.ghost){document.removeListener("mousemove",this.bound.moveGhost);this.fireEvent("onDragComplete",[this.active,this.ghost])}this.fireEvent("onComplete",this.active)}});Sortables.implement(new Events,new Options);var Tips=new Class({options:{onShow:function(A){A.setStyle("visibility","visible")},onHide:function(A){A.setStyle("visibility","hidden")},maxTitleChars:30,showDelay:100,hideDelay:100,className:"tool",offsets:{"x":16,"y":16},fixed:false},initialize:function(B,A){this.setOptions(A);this.toolTip=new Element("div",{"class":this.options.className+"-tip","styles":{"position":"absolute","top":"0","left":"0","visibility":"hidden"}}).inject(document.body);this.wrapper=new Element("div").inject(this.toolTip);$$(B).each(this.build,this);if(this.options.initialize){this.options.initialize.call(this)}},build:function(B){B.$tmp.myTitle=(B.href&&B.getTag()=="a")?B.href.replace("http://",""):(B.rel||false);if(B.title){var C=B.title.split("::");if(C.length>1){B.$tmp.myTitle=C[0].trim();B.$tmp.myText=C[1].trim()}else{B.$tmp.myText=B.title}B.removeAttribute("title")}else{B.$tmp.myText=false}if(B.$tmp.myTitle&&B.$tmp.myTitle.length>this.options.maxTitleChars){B.$tmp.myTitle=B.$tmp.myTitle.substr(0,this.options.maxTitleChars-1)+"&hellip;"}B.addEvent("mouseenter",function(D){this.start(B);if(!this.options.fixed){this.locate(D)}else{this.position(B)}}.bind(this));if(!this.options.fixed){B.addEvent("mousemove",this.locate.bindWithEvent(this))}var A=this.end.bind(this);B.addEvent("mouseleave",A);B.addEvent("trash",A)},start:function(A){this.wrapper.empty();if(A.$tmp.myTitle){this.title=new Element("span").inject(new Element("div",{"class":this.options.className+"-title"}).inject(this.wrapper)).setHTML(A.$tmp.myTitle)}if(A.$tmp.myText){this.text=new Element("span").inject(new Element("div",{"class":this.options.className+"-text"}).inject(this.wrapper)).setHTML(A.$tmp.myText)}$clear(this.timer);this.timer=this.show.delay(this.options.showDelay,this)},end:function(A){$clear(this.timer);this.timer=this.hide.delay(this.options.hideDelay,this)},position:function(A){var B=A.getPosition();this.toolTip.setStyles({"left":B.x+this.options.offsets.x,"top":B.y+this.options.offsets.y})},locate:function(B){var D={"x":window.getWidth(),"y":window.getHeight()};var A={"x":window.getScrollLeft(),"y":window.getScrollTop()};var C={"x":this.toolTip.offsetWidth,"y":this.toolTip.offsetHeight};var G={"x":"left","y":"top"};for(var E in G){var F=B.page[E]+this.options.offsets[E];if((F+C[E]-A[E])>D[E]){F=B.page[E]-this.options.offsets[E]-C[E]}this.toolTip.setStyle(G[E],F)}},show:function(){if(this.options.timeout){this.timer=this.hide.delay(this.options.timeout,this)}this.fireEvent("onShow",[this.toolTip])},hide:function(){this.fireEvent("onHide",[this.toolTip])}});Tips.implement(new Events,new Options);String.extend({stripTags:function(){return this.replace(/<\/?[^>]+>/gi,"")},stripScripts:function(){return this.replace(/<script[^>]*?>.*?<\/script>/img,"")},evalScripts:function(){var scripts=this.match(/<script[^>]*?>.*?<\/script>/g);if(scripts){scripts.each(function(script){eval(script.replace(/^<script[^>]*?>/,"").replace(/<\/script>$/,""))})}},replaceAll:function(C,A,B){return this.replace(new RegExp(C,$pick(B,"gi")),A)},urlEncode:function(){return(this.test("%"))?this:escape(this)},parseQuery:function(){var B=this.split(/[&;]/);var A={};if(B.length){B.each(function(D){var C=D.split("=");if(C.length&&C.length==2){A[encodeURIComponent(C[0])]=encodeURIComponent(C[1])}})}return A},tidy:function(){var A=this.toString();$each({"[\xa0\u2002\u2003\u2009]":" ","\xb7":"*","[\u2018\u2019]":"'","[\u201c\u201d]":'"',"\u2026":"...","\u2013":"-","\u2014":"--","\uFFFD":"&raquo;"},function(C,B){A=A.replace(new RegExp(B,"g"),C)});return A}});$native(Date);Date.extend({clone:function(){return new Date(this.getTime())},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.getTime();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){var J=E+(K*H);var I=C;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.setTime(D+(F*H));return this},isLeapYear:function(){return Date.isLeapYear(this.getYear())},clearTime:function(){this.setHours(0);this.setMinutes(0);this.setSeconds(0);this.setMilliseconds(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.getTime()-this.getTime();if(C<0&&Date.$units[B]()>(-1*(C))){return 0}else{if(C>=0&&C<Date.$units[B]()){return 0}}return((D.getTime()-this.getTime())/Date.$units[B]()).round()}},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.getTimezoneOffset();return((A>0)?"-":"+")+Math.floor(Math.abs(A)/60).zeroise(2)+(A%60).zeroise(2)},parse:function(A){this.setTime(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,D){switch(D){case"a":return Date.$days[B.getDay()].substr(0,3);case"A":return Date.$days[B.getDay()];case"b":return Date.$months[B.getMonth()].substr(0,3);case"B":return Date.$months[B.getMonth()];case"c":return B.toString();case"d":return B.getDate().zeroise(2);case"H":return B.getHours().zeroise(2);case"I":return((B.getHours()%12)||12).zeroise(2);case"j":return B.getDayOfYear().zeroise(3);case"m":return(B.getMonth()+1).zeroise(2);case"M":return B.getMinutes().zeroise(2);case"p":return B.getHours()<12?"AM":"PM";case"S":return B.getSeconds().zeroise(2);case"U":return B.getWeek().zeroise(2);case"W":throw new Error("%W is not supported yet");case"w":return B.getDay();case"x":return B.format("%m/%d/%Y");case"X":return B.format("%I:%M%p");case"y":return B.getFullYear().toString().substr(2);case"Y":return B.getFullYear();case"T":return B.getGMTOffset();case"Z":return B.getTimezone();case"%":return"%"}return D})},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",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(((A%4)===0)&&((A%1000)!==0)||((A%4000)===0))},parseUTC:function(B){var A=new Date(B);var C=Date.UTC(A.getFullYear(),A.getMonth(),A.getDate(),A.getHours(),A.getMinutes(),A.getSeconds());return new Date(C)},parse:function(F){var C=$type(F);if(C=="number"){return new Date(str)}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.getMonth()];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.getFullYear()<2000&&B.toString().indexOf(A.getFullYear())<0){A.increment("year",100)}return A}else{return B}},$parsePatterns:[{re:/^(\d{1,2})[\.\-\/](\d{1,2})[\.\-\/](\d{2,4})$/,handler:function(A){var B=new Date();B.setYear(A[3]);B.setMonth(A[1].toInt()-1,A[2].toInt());return Date.fixY2K(B)}},{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.setYear(A[3]);B.setMonth(A[1]-1);B.setDate(A[2]);B.setHours(A[4]);B.setMinutes(A[5]);B.setAMPM(A[6]);return Date.fixY2K(B)}}]});Number.extend({zeroise:function(A){return String(this).zeroise(A)}});String.extend({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}});Date.extend({timeAgoInWords:function(){var A=(arguments.length>0)?arguments[1]:new Date();return Date.distanceOfTimeInWords(this,A,arguments[2])},getOrdinal:function(){var A=this.toString();var B=A.substr(-(Math.min(A.length,2)));return(B>3&&B<21)?"th":["th","st","nd","rd","th"][Math.min(this%10,4)]},getDayOfYear:function(){return((Date.UTC(this.getFullYear(),this.getMonth(),this.getDate()+1,0,0,0)-Date.UTC(this.getFullYear(),0,1,0,0,0))/Date.$units.day())},getLastDayOfMonth:function(){var A=this.clone();A.setMonth(A.getMonth()+1,0);return A.getDate()},getWeek:function(){var A=(new Date(this.getFullYear(),0,1)).getDate();return Math.round((this.getDayOfYear()+(A>3?A-4:A+3))/7)}});$extend(Date,{distanceOfTimeInWords:function(D,B,C){var F=parseInt((B.getTime()-D.getTime())/1000);if(F<60){return"less than a minute ago"}else{if(F<120){return"about a minute ago"}else{if(F<(45*60)){return(parseInt(F/60)).toString()+" minutes ago"}else{if(F<(90*60)){return"about an hour ago"}else{if(F<(24*60*60)){return"about "+(parseInt(F/3600)).toString()+" hours ago"}else{if(F<(48*60*60)){return"1 day ago"}else{var E=(parseInt(F/86400)).toString();if(E>30){var A="%B %d";if(B.getYear()!=D.getYear()){A+=", %Y"}if(C){A+=" %I:%M %p"}return D.strftime(A)}else{return E+" days ago"}}}}}}}}});Date.$parsePatterns.extend([{re:/^(\d{4})(?:-?(\d{2})(?:-?(\d{2})(?:[T ](\d{2})(?::?(\d{2})(?::?(\d{2})(?:\.(\d+))?)?)?(?:Z|(?:([-+])(\d{2})(?::?(\d{2}))?)?)?)?)?)?$/,handler:function(A){var C=0;var B=new Date(A[1],0,1);if(A[2]){B.setMonth(A[2]-1)}if(A[3]){B.setDate(A[3])}if(A[4]){B.setHours(A[4])}if(A[5]){B.setMinutes(A[5])}if(A[6]){B.setSeconds(A[6])}if(A[7]){B.setMilliseconds(("0."+A[7]).toInt()*1000)}if(A[9]){C=(A[9].toInt()*60)+A[10].toInt();C*=((A[8]=="-")?1:-1)}C-=B.getTimezoneOffset();B.setTime((B*1)+(C*60*1000).toInt());return B}},{re:/^tod/i,handler:function(){return new Date()}},{re:/^tom/i,handler:function(){return new Date().increment()}},{re:/^yes/i,handler:function(){return new Date().decrement()}},{re:/^(\d{1,2})(st|nd|rd|th)?$/i,handler:function(A){var B=new Date();B.setDate(A[1].toInt());return B}},{re:/^(\d{1,2})(?:st|nd|rd|th)? (\w+)$/i,handler:function(A){var B=new Date();B.setMonth(Date.parseMonth(A[2],true),A[1].toInt());return B}},{re:/^(\d{1,2})(?:st|nd|rd|th)? (\w+),? (\d{4})$/i,handler:function(A){var B=new Date();B.setMonth(Date.parseMonth(A[2],true),A[1].toInt());B.setYear(A[3]);return B}},{re:/^(\w+) (\d{1,2})(?:st|nd|rd|th)?,? (\d{4})$/i,handler:function(A){var B=new Date();B.setMonth(Date.parseMonth(A[1],true),A[2].toInt());B.setYear(A[3]);return B}},{re:/^next (\w+)$/i,handler:function(D){var E=new Date();var B=E.getDay();var C=Date.parseDay(D[1],true);var A=C-B;if(C<=B){A+=7}E.setDate(E.getDate()+A);return E}}]);window.extend({isLoaded:window.loaded,getHost:function(A){A=$pick(A,window.location.href);var B=A;if(A.test("http://")){A=A.substring(A.indexOf("http://")+7,A.length);if(A.test(":")){A=A.substring(0,A.indexOf(":"))}if(A.test("/")){return A.substring(0,A.indexOf("/"))}return A}return false},getQueryStringValue:function(B,A){try{return window.getQueryStringValues(A)[B]}catch(C){return null}},getQueryStringValues:function(B){var A=$pick(B,$pick(window.location.search,"")).split("?")[1];if(A){return A.parseQuery()}return{}},getPort:function(C){C=$pick(C,window.location.href);var D=new RegExp(":([0-9]{4})");var A=D.exec(C);if(A==null){return false}else{var B=false;A.each(function(E){if($chk(parseInt(E))){B=E}})}return B},qs:{}});window.qs=window.getQueryStringValues();window.popup=new Class({options:{width:500,height:300,x:50,y:50,toolbar:0,location:0,directories:0,status:0,scrollbars:"auto",resizable:1,name:"popup",onBlock:Class.empty},initialize:function(B,A){this.url=B||false;this.setOptions(A);if(this.url){this.openWin()}return this},openWin:function(B){B=B||this.url;var A="toolbar="+this.options.toolbar+",location="+this.options.location+",directories="+this.options.directories+",status="+this.options.status+",scrollbars="+this.options.scrollbars+",resizable="+this.options.resizable+",width="+this.options.width+",height="+this.options.height+",top="+this.options.y+",left="+this.options.x;this.popupWindow=window.open(B,this.options.name,A);this.focus.delay(100,this);return this.popupWindow},focus:function(){if(this.popupWindow){this.popupWindow.focus()}else{if(this.focusTries<10){this.focus.delay(100,this)}else{this.blocked=true;this.fireEvent("onBlock")}}return this},focusTries:0,blocked:null,close:function(){this.popupWindow.close()}});window.popup.implement(new Options);window.popup.implement(new Events);var legacyPopup=window.popup.extend({setOptions:function(){this.parent();this.options=Object.extend({width:516,height:350},this.options)}});function openPop(A){return new legacyPopup(A)}var GetValue=window.getQueryStringValue;Element.extend({isVisible:function(){return this.getStyle("display")!="none"},toggle:function(){return this[this.isVisible()?"hide":"show"]()},hide:function(){this.originalDisplay=this.getStyle("display");this.setStyle("display","none");return this},show:function(A){this.originalDisplay=(this.originalDisplay=="none")?"block":this.originalDisplay;this.setStyle("display",(A||this.originalDisplay||"block"));return this},tidy:function(){try{if(this.getValue().tidy()){this.value=this.getValue().tidy()}}catch(A){dbug.log("element.tidy error: %o",A)}},findParent:function(A){return $$(A).filter(function(B){return B.hasChild(this)},this)[0]},fxOpacityOk:function(){if(!window.ie6){return true}var A=false;try{if(new Color(this.getStyle("backgroundColor"))){A=true}}catch(B){}return A}});Element.visible=Element.isVisible;if(!Element.empty){Element.extend({empty:function(){return this.setHTML("")}})}var $S=$$;Element.extend({getDimensions:function(A){A=$merge({computeSize:false},A);var E={};function D(G,F){if(F.computeSize){E=G.getComputedSize(F)}else{E.width=G.getSize().size.x;E.height=G.getSize().size.y}return E}try{E=D(this,A)}catch(C){}if(this.getStyle("display")=="none"){var B={};["visibility","display","position"].each(function(F){B[F]=this.style[F]||""},this);this.setStyles({visibility:"hidden",display:"block",position:"absolute"});E=D(this,A);this.setStyles(B)}return $merge(E,{x:E.width,y:E.height})},getComputedSize:function(A){A=$merge({styles:["padding","border"],plains:{height:["top","bottom"],width:["left","right"]},mode:"both"},A);var C={width:0,height:0};switch(A.mode){case"vertical":delete C.width;delete A.plains.width;break;case"horizontal":delete C.height;delete A.plains.height;break}var B=[];$each(A.plains,function(G,F){G.each(function(H){A.styles.each(function(I){B.push((I=="border")?I+"-"+H+"-width":I+"-"+H)})})});var E=this.getStyles.apply(this,B);var D=[];$each(A.plains,function(G,F){C["total"+F.capitalize()]=0;C["computed"+F.capitalize()]=0;G.each(function(H){C["computed"+H.capitalize()]=0;B.each(function(J,I){if(J.test(H)){E[J]=E[J].toInt();if(isNaN(E[J])){E[J]=0}C["total"+F.capitalize()]=C["total"+F.capitalize()]+E[J];C["computed"+H.capitalize()]=C["computed"+H.capitalize()]+E[J]}if(J.test(H)&&F!=J&&(J.test("border")||J.test("padding"))&&!D.test(J)){D.push(J);C["computed"+F.capitalize()]=C["computed"+F.capitalize()]-E[J]}})})});if($chk(C.width)){C.width=C.width+this.offsetWidth+C.computedWidth;C.totalWidth=C.width+C.totalWidth;delete C.computedWidth}if($chk(C.height)){C.height=C.height+this.offsetHeight+C.computedHeight;C.totalHeight=C.height+C.totalHeight;delete C.computedHeight}return $merge(E,C)}});Element.extend({getTextInRange:function(B,A){return this.getValue().substring(B,A)},getSelectedText:function(){if(window.ie){return document.selection.createRange().text}return this.getValue().substring(this.getSelectionStart(),this.getSelectionEnd())},getSelectionStart:function(){if(window.ie){this.focus();var A=document.selection.createRange();if(A.compareEndPoints("StartToEnd",A)!=0){A.collapse(true)}return A.getBookmark().charCodeAt(2)-2}return this.selectionStart},getSelectionEnd:function(){if(window.ie){var A=document.selection.createRange();if(A.compareEndPoints("StartToEnd",A)!=0){A.collapse(false)}return A.getBookmark().charCodeAt(2)-2}return this.selectionEnd},getSelectedRange:function(){return{start:this.getSelectionStart(),end:this.getSelectionEnd()}},setCaretPosition:function(A){if(A=="end"){A=this.getValue().length}this.selectRange(A,A);return this},getCaretPosition:function(){return this.getSelectedRange().start},selectRange:function(C,A){this.focus();if(window.ie){var B=this.createTextRange();B.collapse(true);B.moveStart("character",C);B.moveEnd("character",A-C);B.select();return this}this.setSelectionRange(C,A);return this},insertAtCursor:function(C,A){var D=this.getSelectionStart();var B=this.getSelectionEnd();this.value=this.getValue().substring(0,D)+C+this.getValue().substring(B,this.getValue().length);if($pick(A,true)){this.selectRange(D,D+C.length)}else{this.setCaretPosition(D+C.length)}return this},insertAroundCursor:function(C,A){C=$merge({before:"",defaultMiddle:"SOMETHING HERE",after:""},C);value=this.getSelectedText()||C.defaultMiddle;var F=this.getSelectionStart();var B=this.getSelectionEnd();if(F==B){var E=this.getValue();this.value=E.substring(0,F)+C.before+value+C.after+E.substring(B,E.length);this.selectRange(F+C.before.length,B+C.before.length+value.length);E=null}else{E=this.getValue().substring(F,B);this.value=this.getValue().substring(0,F)+C.before+E+C.after+this.getValue().substring(B,this.getValue().length);var D=F+C.before.length;if($pick(A,true)){this.selectRange(D,D+E.length)}else{this.setCaretPosition(D+E.length)}}return this}});window.extend({supportsPositionFixed:function(){if(!window.loaded){return null}var B=new Element("div").setStyles({position:"fixed",top:"0px",right:"0px"}).injectInside(document.body);var A=(B.offsetTop===0);B.remove();return A}});Element.extend({pin:function(B){var C=this.getPosition();if(B!==false){if(!this.pinned){var D={top:(C.y-window.getScrollTop())+"px",left:(C.x-window.getScrollLeft())+"px"};if(window.supportsPositionFixed()){this.setStyle("position","fixed").setStyles(D)}else{this.setStyles({position:"absolute",top:C.y+"px",left:C.x+"px"});window.addEvent("scroll",function(){if(this.pinned){var E={top:(D.top.toInt()+window.getScrollTop())+"px",left:(D.left.toInt()+window.getScrollLeft())+"px"};this.setStyles(E)}}.bind(this))}this.pinned=true}}else{this.pinned=false;var A=(window.supportsPositionFixed())?{top:(C.y+window.getScrollTop())+"px",left:(C.x+window.getScrollLeft())+"px"}:{top:(C.y)+"px",left:(C.x)+"px"};this.setStyles($merge(A,{position:"absolute"}))}return this},unpin:function(){return this.pin(false)},togglepin:function(){this.pin(!this.pinned)}});Element.extend({setPosition:function(M){M=$merge({relativeTo:document.body,position:{x:"center",y:"center"},edge:false,offset:{x:0,y:0},returnPos:false,relFixedPosition:false,ignoreMargins:false,overflown:[]},M);var A={x:0,y:0};var E=false;if(this.getParent()!=document.body){var J=this.getParent();while(J!=document.body&&J.getStyle("position")=="static"){J=J.getParent()}if(J!=document.body){A=J.getPosition();E=true}M.offset.x=M.offset.x-A.x;M.offset.y=M.offset.y-A.y}function L(N){if($type(N)!="string"){return N}N=N.toLowerCase();var O={};if(N.test("left")){O.x="left"}else{if(N.test("right")){O.x="right"}else{O.x="center"}}if(N.test("upper")||N.test("top")){O.y="top"}else{if(N.test("bottom")){O.y="bottom"}else{O.y="center"}}return O}M.edge=L(M.edge);M.position=L(M.position);if(!M.edge){if(M.position.x=="center"&&M.position.y=="center"){M.edge={x:"center",y:"center"}}else{M.edge={x:"left",y:"top"}}}this.setStyle("position","absolute");var K=$(M.relativeTo)||document.body;if(window.opera){var I=(K==document.body)?window.getScrollTop():K.getTop();var D=(K==document.body)?window.getScrollLeft():K.getLeft()}else{var I=(K==document.body)?window.getScrollTop():K.getTop(M.overflown);var D=(K==document.body)?window.getScrollLeft():K.getLeft(M.overflown)}if(I<0){I=0}if(D<0){D=0}var F=this.getDimensions({computeSize:true,styles:["padding","border","margin"]});if(M.ignoreMargins){M.offset.x+=((M.edge&&M.edge.x=="right")?F["margin-right"]:-F["margin-left"]);M.offset.y+=((M.edge&&M.edge.y=="bottom")?F["margin-bottom"]:-F["margin-top"])}var H={};var B=M.offset.y.toInt();var C=M.offset.x.toInt();switch(M.position.x){case"left":H.x=D+C;break;case"right":H.x=D+C+K.offsetWidth;break;default:H.x=D+(((K==document.body)?window.getWidth():K.offsetWidth)/2)+C;break}switch(M.position.y){case"top":H.y=I+B;break;case"bottom":H.y=I+B+K.offsetHeight;break;default:H.y=I+(((K==document.body)?window.getHeight():K.offsetHeight)/2)+B;break}if(M.edge){var G={};switch(M.edge.x){case"left":G.x=0;break;case"right":G.x=-F.x-F.computedRight-F.computedLeft;break;default:G.x=-(F.x/2);break}switch(M.edge.y){case"top":G.y=0;break;case"bottom":G.y=-F.y-F.computedTop-F.computedBottom;break;default:G.y=-(F.y/2);break}H.x=H.x+G.x;H.y=H.y+G.y}H={left:((H.x>=0||E)?H.x:0).toInt()+"px",top:((H.y>=0||E)?H.y:0).toInt()+"px"};if(K.getStyle("position")=="fixed"||M.relFixedPosition){H.top=H.top.toInt()+window.getScrollTop()+"px";H.left=H.left.toInt()+window.getScrollLeft()+"px"}if(M.returnPos){return H}if(M.smoothMove){new Fx.SmoothMove(this,M).start()}else{this.setStyles(H)}return this}});Fx.Marquee=Fx.Styles.extend({options:{mode:"horizontal",message:"",revert:true,delay:5000,cssClass:"msg",showEffect:{opacity:1},hideEffect:{opacity:0},revertEffect:{opacity:[0,1]},currentMessage:null,onRevert:Class.empty,onMessage:Class.empty},initialize:function(A,B){A=$(A);var C=this.options.currentMessage||(A.getChildren().length==1)?A.getFirst():"";var D=new Element("div",{styles:{position:"relative"},"class":"fxMarqueeWrapper"}).injectInside(A);this.parent(D,B);this.current=this.wrapMessage(C)},wrapMessage:function(A){if($(A)&&$(A).hasClass("fxMarquee")){var B=$(A)}else{var B=new Element("span",{"class":"fxMarquee",styles:{position:"relative"}});if($(A)){B.adopt($(A))}else{if($type(A)=="string"){B.setHTML(A)}}}return B.injectInside(this.element)},announce:function(A){this.setOptions(A).showMessage();return this},showMessage:function(A){(function(){var B=this.chains?this.chains.copy():[];this.clearChain();this.element=$(this.element);this.current=$(this.current);this.message=$(this.message);this.start(this.options.hideEffect).chain(function(){if(A){this.message.hide();if(this.current){this.current.show()}}else{if(this.message){this.message.remove()}this.message=this.wrapMessage(this.options.message);if(this.current){this.current.hide()}}this.start((A)?this.options.revertEffect:this.options.showEffect).chain(function(){this.chains.merge(B);this.fireEvent((A)?"onRevert":"onMessage");if(!A&&this.options.revert){this.showMessage(true)}else{this.callChain.delay(this.options.delay,this)}}.bind(this))}.bind(this))}).delay((A)?this.options.delay:10,this);return this}});Fx.SmoothShow=Fx.Styles.extend({options:{styles:["padding","border","margin"],transitionOpacity:true,mode:"vertical",heightOverride:null,widthOverride:null},fixStyle:function(C,B){if(!$type(C)=="number"){return C}var A=["margin","padding","width","height"].some(function(D){return B.test(D,"i")});return(A)?C+"px":C},hide:function(){try{if(!this.hiding&&!this.showing){if(this.element.getStyle("display")!="none"){this.hiding=true;this.showing=false;this.hidden=true;var C=this.element.getComputedSize({styles:this.options.styles,mode:this.options.mode});if(this.element.fxOpacityOk()&&this.options.transitionOpacity){C.opacity=1}var A={};$each(C,function(E,D){A[D]=this.fixStyle(0,D)},this);this.chain(function(){if(this.hidden){this.hiding=false;$each(C,function(E,D){C[D]=this.fixStyle(E,D)},this);this.element.setStyles(C).setStyle("display","none")}this.callChain()}.bind(this));this.start(A)}else{this.callChain.delay(10,this);this.fireEvent("onComplete",this.element)}}}catch(B){this.element.hide();this.callChain.delay(10,this);this.fireEvent("onComplete",this.element)}return this},show:function(){try{if(!this.showing&&!this.hiding){if(this.element.getStyle("display")=="none"||this.element.getStyle("visiblity")=="hidden"||this.element.getStyle("opacity")==0){this.showing=true;this.hiding=false;this.hidden=false;var B=this.element.getStyles("visibility","display","position");this.element.setStyles({visibility:"hidden",display:"block",position:"absolute"});if(this.element.fxOpacityOk()&&this.options.transitionOpacity){this.element.setStyle("opacity",0)}var D=this.element.getComputedSize({styles:this.options.styles,mode:this.options.mode});this.element.setStyles(B);$each(D,function(F,E){D[E]=this.fixStyle(F,E)},this);if($chk(this.options.heightOverride)){D["height"]=this.options.heightOverride.toInt()+"px"}else{D["height"]}if($chk(this.options.widthOverride)){D["width"]=this.options.widthOverride.toInt()+"px"}if(this.element.fxOpacityOk()&&this.options.transitionOpacity){D.opacity=1}var A={height:"0px",display:"block"};$each(D,function(F,E){A[E]=this.fixStyle(0,E)},this);this.element.setStyles(A);this.start(D);this.chain(function(){if(!this.options.heightOverride){this.element.setStyle("height","auto")}if(!this.hidden){this.showing=false}this.callChain()}.bind(this))}else{this.callChain();this.fireEvent("onComplete",this.element)}}}catch(C){this.element.setStyles({display:"block",visiblity:"visible",opacity:1});this.callChain.delay(10,this);this.fireEvent("onComplete",this.element)}return this},toggle:function(){try{if(this.element.getStyle("display")=="none"||this.element.getStyle("visiblity")=="hidden"||this.element.getStyle("opacity")==0){this.show()}else{this.hide()}}catch(A){this.show()}return this}});Fx.SmoothShow.implement(new Options);Fx.SmoothShow.implement(new Events);Element.extend({smoothShow:function(A){if(arguments[1]){A.heightOverride=arguments[1]}return new Fx.SmoothShow(this,A).show()},smoothHide:function(A){if(arguments[1]){A.heightOverride=arguments[1]}return new Fx.SmoothShow(this,A).hide()}});Fx.SmoothMove=Fx.Styles.extend({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.extend({smoothMove:function(A){return new Fx.SmoothMove(this,A).start()}});Fx.Sort=Fx.Elements.extend({options:{mode:"vertical"},initialize:function(B,A){this.parent(B,A);this.elements.each(function(C){if(C.getStyle("position")=="static"){C.setStyle("position","relative")}});this.setDefaultOrder()},setDefaultOrder:function(){this.currentOrder=this.elements.map(function(B,A){return A})},sort:function(E){if($type(E)!="array"){return false}var I=0;var A=0;var H={};var D=this.options.mode=="vertical";var F=this.elements.map(function(M,J){var L=M.getComputedSize({styles:["border","padding","margin"]});var N;if(D){N={top:I,margin:L["margin-top"],height:L.totalHeight};I+=N.height-L["margin-top"]}else{N={left:A,margin:L["margin-left"],width:L.totalWidth};A+=N.width}var K=D?"top":"left";H[J]={};var O=M.getStyle(K).toInt();H[J][K]=($chk(O))?O:0;return N},this);this.set(H);E=E.map(function(J){return J.toInt()});if(E.length!=this.elements.length){this.currentOrder.each(function(J){if(!E.contains(J)){E.push(J)}});if(E.length>this.elements.length){E.splice(this.elements.length-1,E.length-this.elements.length)}}var I=0;var A=0;var B=0;var C={};E.each(function(L,J){var K={};if(D){K.top=I-F[L].top-B;I+=F[L].height}else{K.left=A-F[L].left;A+=F[L].width}B=B+F[L].margin;C[L]=K},this);var G={};E.copy().sort().each(function(J){G[J]=C[J]});this.start(G);this.currentOrder=E;return this},rearrangeDOM:function(A){A=A||this.currentOrder;var B=this.elements[0].getParent();var C=[];this.elements.setStyle("opacity",0);A.each(function(D){C.push(this.elements[D].injectInside(B).setStyles({top:0,left:0}))},this);this.elements.setStyle("opacity",1);this.elements=$$(C);this.setDefaultOrder();return this},getDefaultOrder:function(){return this.elements.map(function(B,A){return A})},forward:function(){return this.sort(this.getDefaultOrder())},backward:function(){return this.sort(this.getDefaultOrder().reverse())},reverse:function(){return this.sort(this.currentOrder.reverse())},sortByElements:function(A){return this.sort(A.map(function(B){return this.elements.indexOf(B)}))},swap:function(E,D){if($type(E)=="element"){E=this.elements.indexOf(E);D=this.elements.indexOf(D)}var C=this.currentOrder.indexOf(E);var B=this.currentOrder.indexOf(D);var A=this.currentOrder.copy();A[C]=D;A[B]=E;this.sort(A)}});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();B.focus();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){var A=this.getTxtForEl(B);if(!A){return }try{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):$("StickyWinOverlay")||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(){this.win.remove();if(this.options.useIframeShim){this.shim.remove()}if($("StickyWinOverlay")){$("StickyWinOverlay").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({initialize:function(A,B){this.container=$(A);if(!this.container.hasClass("hasCarousel")){this.container.addClass("hasCarousel");this.slides=[];this.buttons=[];this.setOptions({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},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.autoplay){this.autoplay()}if(this.options.rotateAction!="none"){this.setupAction(this.options.rotateAction)}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(){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.createFx();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.options.carouselContainer).setStyle("visibility","visible");if(!$(this.options.carouselContainer).isVisible()){$(this.options.carouselContainer).setStyle("display","block")}},hide:function(){$(this.options.carouselContainer).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":"javascript:void(0);"}).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/"}})}}/* end packed code */ 
}
