var dbug={logged:[],timers:{},firebug:false,enabled: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(A){if(dbug.firebug){try{dbug.enabled=true;dbug.log=function(){(console.debug||console.log).apply(console,arguments)};dbug.time=function(){console.time.apply(console,arguments)};dbug.timeEnd=function(){console.timeEnd.apply(console,arguments)};if(!A){dbug.log("enabling dbug")}for(var B=0;B<dbug.logged.length;B++){dbug.log.apply(console,dbug.logged[B])}dbug.logged=[]}catch(C){dbug.enable.delay(400)}}},disable:function(){if(dbug.firebug){dbug.enabled=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((!$defined(D)&&B!="true")||($defined(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="jsdebug=false;path=/;"}};(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(){})})();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.enabled){dbug.enable()}}if(window.location.href.indexOf("jsdebugCookie=false")>0){dbug.disableCookie()}}$extend(Browser,{fixPNG:function(D){try{if(Browser.Engine.trident4){D=$(D);if(!D){return D}if(D.get("tag")=="img"&&D.get("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.x,height:dim.y,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)}C.replaces(D)}else{if(D.get("tag")!="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)}},pngTest:/\.png$/,scanForPngs:function(C,B){B=B||"fixPNG";if(document.getElements){C=$(C||document.body);C.getElements("img[src$=.png]").addClass(B)}else{var A=$$("img").each(function(D){if(Browser.pngTest(D.src)){D.addClass(B)}})}}});if(Browser.Engine.trident4){window.addEvent("domready",function(){$$("img.fixPNG").each(Browser.fixPNG)})}var IframeShim=new Class({Implements:[Options,Events],options:{name:"",className:"iframeShim",display:false,zindex:null,margin:0,offset:{x:0,y:0},browsers:(Browser.Engine.trident4||(Browser.Engine.gecko&&!Browser.Engine.gecko19&&Browser.Platform.mac))},initialize:function(B,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=$(B);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);this.element.store("shim",this);var A=function(){this.shim.inject(this.element,"after");if(this.options.display){this.show()}else{this.hide()}this.fireEvent("onInject")};if(this.options.browsers){if(Browser.Engine.trident&&!IframeShim.ready){window.addEvent("load",A.bind(this))}else{A.run(null,this)}}},position:function(C){if(!this.options.browsers||!IframeShim.ready){return this}var B=this.element.getStyles("display","visibility","position");this.element.setStyles({display:"block",position:"absolute",visibility:"hidden"});var A=this.element.getSize();this.element.setStyles(B);if($type(this.options.margin)){A.x=A.x-(this.options.margin*2);A.y=A.y-(this.options.margin*2);this.options.offset.x+=this.options.margin;this.options.offset.y+=this.options.margin}this.shim.setStyles({width:A.x,height:A.y}).setPosition({relativeTo:this.element,offset:this.options.offset});return this},hide:function(){if(this.options.browsers){this.shim.setStyle("display","none")}return this},show:function(){if(!this.options.browsers){return this}this.shim.setStyle("display","block");return this.position()},dispose:function(){if(this.options.browsers){this.shim.dispose()}return this}});window.addEvent("load",function(){IframeShim.ready=true});new Native({name:"Date",initialize:Date,protect:true});["now","parse","UTC"].each(function(A){Native.genericize(Date,A,true)});Date.$Methods=new Hash();["Date","Day","FullYear","Hours","Milliseconds","Minutes","Month","Seconds","Time","TimezoneOffset","Week","Timezone","GMTOffset","DayOfYear","LastMonth","UTCDate","UTCDay","UTCFullYear","AMPM","UTCHours","UTCMilliseconds","UTCMinutes","UTCMonth","UTCSeconds"].each(function(A){Date.$Methods.set(A.toLowerCase(),A)});$each({ms:"Milliseconds",year:"FullYear",min:"Minutes",mo:"Month",sec:"Seconds",hr:"Hours"},function(B,A){Date.$Methods.set(A,B)});Date.implement({set:function(B,C){B=B.toLowerCase();var A=Date.$Methods;if(A.has(B)){this["set"+A.get(B)](C)}return this},get:function(B){B=B.toLowerCase();var A=Date.$Methods;if(A.has(B)){return this["get"+A.get(B)]()}return null},clone:function(){return new Date(this.get("time"))},increment:function(A,B){return this.multiply(A,B)},decrement:function(A,B){return this.multiply(A,B,false)},multiply:function(B,G,A){B=B||"day";G=$pick(G,1);A=$pick(A,true);var H=A?1:-1;var E=this.format("%m").toInt()-1;var C=this.format("%Y").toInt();var D=this.get("time");var F=0;switch(B){case"year":G.times(function(I){if(Date.isLeapYear(C+I)&&E>1&&H>0){I++}if(Date.isLeapYear(C+I)&&E<=1&&H<0){I--}F+=Date.$units.year(C+I)});break;case"month":G.times(function(K){if(H<0){K++}var J=E+(K*H);var I=I;if(J<0){I--;J=12+J}if(J>11||J<0){I+=(J/12).toInt()*H;J=J%12}F+=Date.$units.month(J,I)});break;default:F=Date.$units[B]()*G;break}this.set("time",D+(F*H));return this},isLeapYear:function(){return Date.isLeapYear(this.get("year"))},clearTime:function(){this.set("hr",0);this.set("min",0);this.set("sec",0);this.set("ms",0);return this},diff:function(D,B){B=B||"day";if($type(D)=="string"){D=Date.parse(D)}switch(B){case"year":return D.format("%Y").toInt()-this.format("%Y").toInt();break;case"month":var A=(D.format("%Y").toInt()-this.format("%Y").toInt())*12;return A+D.format("%m").toInt()-this.format("%m").toInt();break;default:var C=D.get("time")-this.get("time");if(C<0&&Date.$units[B]()>(-1*(C))){return 0}else{if(C>=0&&C<Date.$units[B]()){return 0}}return((D.get("time")-this.get("time"))/Date.$units[B]()).round()}},getWeek:function(){var A=(new Date(this.get("year"),0,1)).get("date");return Math.round((this.get("dayofyear")+(A>3?A-4:A+3))/7)},getTimezone:function(){return this.toString().replace(/^.*? ([A-Z]{3}).[0-9]{4}.*$/,"$1").replace(/^.*?\(([A-Z])[a-z]+ ([A-Z])[a-z]+ ([A-Z])[a-z]+\)$/,"$1$2$3")},getGMTOffset:function(){var A=this.get("timezoneOffset");return((A>0)?"-":"+")+Math.floor(Math.abs(A)/60).zeroise(2)+(A%60).zeroise(2)},parse:function(A){this.set("time",Date.parse(A));return this},format:function(A){A=A||"%x %X";if(!this.valueOf()){return"invalid date"}if(Date.$formats[A.toLowerCase()]){A=Date.$formats[A.toLowerCase()]}var B=this;return A.replace(/\%([aAbBcdHIjmMpSUWwxXyYTZ])/g,function(C,E){switch(E){case"a":return Date.$days[B.get("day")].substr(0,3);case"A":return Date.$days[B.get("day")];case"b":return Date.$months[B.get("month")].substr(0,3);case"B":return Date.$months[B.get("month")];case"c":return B.toString();case"d":return B.get("date").zeroise(2);case"H":return B.get("hr").zeroise(2);case"I":return((B.get("hr")%12)||12);case"j":return B.get("dayofyear").zeroise(3);case"m":return(B.get("mo")+1).zeroise(2);case"M":return B.get("min").zeroise(2);case"p":return B.get("hr")<12?"AM":"PM";case"S":return B.get("seconds").zeroise(2);case"U":return B.get("week").zeroise(2);case"W":throw new Error("%W is not supported yet");case"w":return B.get("day");case"x":var D=Date.$cultures[Date.$culture];return B.format("%"+D[0].substr(0,1)+D[3]+"%"+D[1].substr(0,1)+D[3]+"%"+D[2].substr(0,1).toUpperCase());case"X":return B.format("%I:%M%p");case"y":return B.get("year").toString().substr(2);case"Y":return B.get("year");case"T":return B.get("GMTOffset");case"Z":return B.get("Timezone");case"%":return"%"}return E})},setAMPM:function(A){A=A.toUpperCase();if(this.format("%H").toInt()>11&&A=="AM"){return this.decrement("hour",12)}else{if(this.format("%H").toInt()<12&&A=="PM"){return this.increment("hour",12)}}return this}});Date.prototype.compare=Date.prototype.diff;Date.prototype.strftime=Date.prototype.format;Date.$nativeParse=Date.parse;$extend(Date,{$months:["January","February","March","April","May","June","July","August","September","October","November","December"],$days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],$daysInMonth:function(B,A){if(Date.isLeapYear(A.toInt())&&B===1){return 29}return[31,28,31,30,31,30,31,31,30,31,30,31][B]},$epoch:-1,$era:-2,$units:{ms:function(){return 1},second:function(){return 1000},minute:function(){return 60000},hour:function(){return 3600000},day:function(){return 86400000},week:function(){return 608400000},month:function(C,A){var B=new Date();return Date.$daysInMonth($pick(C,B.format("%m").toInt()),$pick(A,B.format("%Y").toInt()))*86400000},year:function(A){A=A||new Date().format("%Y").toInt();return Date.isLeapYear(A.toInt())?31622400000:31536000000}},$formats:{db:"%Y-%m-%d %H:%M:%S",compact:"%Y%m%dT%H%M%S",iso8601:"%Y-%m-%dT%H:%M:%S%T",rfc822:"%a, %d %b %Y %H:%M:%S %Z","short":"%d %b %H:%M","long":"%B %d, %Y %H:%M"},isLeapYear:function(A){return new Date(A,1,29).getDate()==29},parseUTC:function(B){var A=new Date(B);var C=Date.UTC(A.get("year"),A.get("mo"),A.get("date"),A.get("hr"),A.get("min"),A.get("sec"));return new Date(C)},parse:function(F){var C=$type(F);if(C=="number"){return new Date(F)}if(C!="string"){return F}if(!F.length){return null}for(var B=0,A=Date.$parsePatterns.length;B<A;B++){var D=Date.$parsePatterns[B].re.exec(F);if(D){try{return Date.$parsePatterns[B].handler(D)}catch(E){dbug.log("date parse error: ",E);return null}}}return new Date(Date.$nativeParse(F))},parseMonth:function(D,C){var B=-1;switch($type(D)){case"object":B=Date.$months[D.get("mo")];break;case"number":B=Date.$months[D-1]||false;if(!B){throw new Error("Invalid month index value must be between 1 and 12:"+index)}break;case"string":var A=Date.$months.filter(function(E){return this.test(E)},new RegExp("^"+D,"i"));if(!A.length){throw new Error("Invalid month string")}if(A.length>1){throw new Error("Ambiguous month")}B=A[0]}return(C)?Date.$months.indexOf(B):B},parseDay:function(A,D){var C=-1;switch($type(A)){case"number":C=Date.$days[A-1]||false;if(!C){throw new Error("Invalid day index value must be between 1 and 7")}break;case"string":var B=Date.$days.filter(function(E){return this.test(E)},new RegExp("^"+A,"i"));if(!B.length){throw new Error("Invalid day string")}if(B.length>1){throw new Error("Ambiguous day")}C=B[0]}return(D)?Date.$days.indexOf(C):C},fixY2K:function(B){if(!isNaN(B)){var A=new Date(B);if(A.get("year")<2000&&B.toString().indexOf(A.get("year"))<0){A.increment("year",100)}return A}else{return B}},$cultures:{US:["month","date","year","/"],GB:["date","month","year","/"]},$culture:"US",$language:"enUS",$cIndex:function(A){return Date.$cultures[Date.$culture].indexOf(A)+1},$parsePatterns:[{re:/^(\d{1,2})[\.\-\/](\d{1,2})[\.\-\/](\d{2,4})$/,handler:function(B){var C=new Date();var A=Date.$cultures[Date.$culture];C.set("year",B[Date.$cIndex("year")]);C.set("month",B[Date.$cIndex("month")]-1);C.set("date",B[Date.$cIndex("date")]);return Date.fixY2K(C)}},{re:/^(\d{1,2})[\.\-\/](\d{1,2})[\.\-\/](\d{2,4})\s(\d{1,2}):(\d{1,2})(\w{2})$/,handler:function(A){var B=new Date();B.set("year",A[Date.$cIndex("year")]);B.set("month",A[Date.$cIndex("month")]-1);B.set("date",A[Date.$cIndex("date")]);B.set("hr",A[4]);B.set("min",A[5]);B.set("ampm",A[6]);return Date.fixY2K(B)}}]});Number.implement({zeroise:function(A){return String(this).zeroise(A)}});String.implement({repeat:function(C){var A=[];for(var B=0;B<C;B++){A.push(this)}return A.join("")},zeroise:function(A){return"0".repeat(A-this.length)+this}});Hash.implement({getFromPath:function(A){var B=this.getClean();A.replace(/\[([^\]]+)\]|\.([^.[]+)|[^[.]+/g,function(C){if(!B){return }var D=arguments[2]||arguments[1]||arguments[0];B=(D in B)?B[D]:null;return C});return B},cleanValues:function(A){A=A||$defined;this.each(function(C,B){if(!A(C)){this.erase(B)}},this);return this}});String.implement({stripTags:function(){return this.replace(/<\/?[^>]+>/gi,"")},parseQuery:function(C,A){C=$pick(C,true);A=$pick(A,true);var D=this.split(/[&;]/);var B={};if(D.length){D.each(function(F){var E=F.split("=");if(E.length&&E.length==2){B[(C)?encodeURIComponent(E[0]):E[0]]=(A)?encodeURIComponent(E[1]):E[1]}})}return B},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},cleanQueryString:function(A){return this.split("&").filter(A||function(B){return $chk(B.split("=")[1])}).join("&")}});Element.implement({tidy:function(){try{this.set("value",this.get("value").tidy())}catch(A){dbug.log("element.tidy error: %o",A)}},getTextInRange:function(B,A){return this.get("value").substring(B,A)},getSelectedText:function(){if(Browser.Engine.trident){return document.selection.createRange().text}return this.get("value").substring(this.getSelectionStart(),this.getSelectionEnd())},getSelectionStart:function(){if(Browser.Engine.trident){var B=(Browser.Engine.trident4)?3:2;this.focus();var A=document.selection.createRange();if(A.compareEndPoints("StartToEnd",A)!=0){A.collapse(true)}return A.getBookmark().charCodeAt(2)-B}return this.selectionStart},getSelectionEnd:function(){if(Browser.Engine.trident){var B=(Browser.Engine.trident4)?3:2;var A=document.selection.createRange();if(A.compareEndPoints("StartToEnd",A)!=0){A.collapse(false)}return A.getBookmark().charCodeAt(2)-B}return this.selectionEnd},getSelectedRange:function(){return{start:this.getSelectionStart(),end:this.getSelectionEnd()}},setCaretPosition:function(A){if(A=="end"){A=this.get("value").length}this.selectRange(A,A);return this},getCaretPosition:function(){return this.getSelectedRange().start},selectRange:function(C,A){this.focus();if(Browser.Engine.trident){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.set("value",this.get("value").substring(0,D)+C+this.get("value").substring(B,this.get("value").length));if($pick(A,true)){this.selectRange(D,D+C.length)}else{this.setCaretPosition(D+C.length)}return this},insertAroundCursor:function(C,A){C=$extend({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.get("value");this.set("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.get("value").substring(F,B);this.set("value",this.get("value").substring(0,F)+C.before+E+C.after+this.get("value").substring(B,this.get("value").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}});Element.Properties.inputValue={get:function(){switch(this.get("tag")){case"select":vals=this.getSelected().map(function(C){var B=$pick(C.get("value"),C.get("text"));return(B=="")?C.get("text"):B});return this.get("multiple")?vals:vals[0];case"input":switch(this.get("type")){case"checkbox":return this.get("checked")?this.get("value"):false;case"radio":var A;if(this.get("checked")){return this.get("value")}$(this.getParent("form")||document.body).getElements("input").each(function(B){if(B.get("name")==this.get("name")&&B.get("checked")){A=B.get("value")}},this);return A||null}case"input":case"textarea":return this.get("value");default:return this.get("inputValue")}},set:function(A){switch(this.get("tag")){case"select":this.getElements("option").each(function(C){var B=$pick(C.get("value"),C.get("text"));if(B==""){B=C.get("text")}C.set("selected",$splat(A).contains(B))});break;case"input":if(["radio","checkbox"].contains(this.get("type"))){this.set("checked",$type(A)=="boolean"?A:$splat(A).contains(this.get("value")));break}case"textarea":case"input":this.set("value",A);break;default:this.set("inputValue",A)}return this},erase:function(){switch(this.get("tag")){case"select":this.getElements("option").each(function(A){A.erase("selected")});break;case"input":if(["radio","checkbox"].contains(this.get("type"))){this.set("checked",false);break}case"input":case"textarea":this.set("value","");break;default:this.set("inputValue","")}return this}};Element.implement({expose:function(){if(this.getStyle("display")!="none"){return $empty}var B={};var A={visibility:"hidden",display:"block",position:"absolute"};$each(A,function(D,C){B[C]=this.style[C]||""},this);this.setStyles(A);return(function(){this.setStyles(B)}).bind(this)},getDimensions:function(A){A=$merge({computeSize:false},A);var E={};function D(G,F){return(F.computeSize)?G.getComputedSize(F):G.getSize()}if(this.getStyle("display")=="none"){var B=this.expose();E=D(this,A);B()}else{try{E=D(this,A)}catch(C){}}return $chk(E.x)?$extend(E,{width:E.x,height:E.y}):$extend(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.contains(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 $extend(E,C)}});window.addEvent("domready",function(){var B=new Element("div").setStyles({position:"fixed",top:0,right:0}).inject(document.body);var A=(B.offsetTop===0);B.dispose();Browser.supportsPositionFixed=A});Element.implement({pin:function(B){if(this.getStyle("display")=="none"){dbug.log("cannot pin "+this+" because it is hidden");return }if(B!==false){var C=this.getPosition();if(!this.get("pinned")){var E={top:(C.y-window.getScroll().y),left:(C.x-window.getScroll().x)};if(Browser.get("supportsPositionFixed")){this.setStyle("position","fixed").setStyles(E)}else{this.setStyles({position:"absolute",top:C.y,left:C.x});window.addEvent("scroll",function(){if(this.get("pinned")){var F={top:(E.top.toInt()+window.getScroll().y),left:(E.left.toInt()+window.getScroll().x)};this.setStyles(F)}}.bind(this))}this.set("pinned",true)}}else{var D;if(!Browser.Engine.trident){if(this.getParent().getComputedStyle("position")!="static"){D=this.getParent()}else{D=this.getParent().getOffsetParent()}}var C=this.getPosition(D);this.set("pinned",false);var A=(Browser.get("supportsPositionFixed"))?{top:(C.y+window.getScroll().y),left:(C.x+window.getScroll().x)}:{top:(C.y),left:(C.x)};this.setStyles($merge(A,{position:"absolute"}))}return this},unpin:function(){return this.pin(false)},togglepin:function(){this.pin(!this.get("pinned"))}});Element.implement({setPosition:function(N){$each(N||{},function(P,O){if(!$defined(P)){delete N[O]}});N=$merge({relativeTo:document.body,position:{x:"center",y:"center"},edge:false,offset:{x:0,y:0},returnPos:false,relFixedPosition:false,ignoreMargins:false},N);var A={x:0,y:0};var F=false;var G=this.expose();var B=$(this.getOffsetParent());G();if(B&&B!=this.getDocument().body){var G=B.expose();A=B.getPosition();G();F=true;N.offset.x=N.offset.x-A.x;N.offset.y=N.offset.y-A.y}function M(O){if($type(O)!="string"){return O}O=O.toLowerCase();var P={};if(O.test("left")){P.x="left"}else{if(O.test("right")){P.x="right"}else{P.x="center"}}if(O.test("upper")||O.test("top")){P.y="top"}else{if(O.test("bottom")){P.y="bottom"}else{P.y="center"}}return P}N.edge=M(N.edge);N.position=M(N.position);if(!N.edge){if(N.position.x=="center"&&N.position.y=="center"){N.edge={x:"center",y:"center"}}else{N.edge={x:"left",y:"top"}}}this.setStyle("position","absolute");var L=$(N.relativeTo)||document.body;var K=(L==document.body)?window.getScroll().y:L.getPosition().y;var E=(L==document.body)?window.getScroll().x:L.getPosition().x;if(K<0){K=0}if(E<0){E=0}var H=this.getDimensions({computeSize:true,styles:["padding","border","margin"]});if(N.ignoreMargins){N.offset.x=N.offset.x-H["margin-left"];N.offset.y=N.offset.y-H["margin-top"]}var J={};var C=N.offset.y.toInt();var D=N.offset.x.toInt();switch(N.position.x){case"left":J.x=E+D;break;case"right":J.x=E+D+L.offsetWidth;break;default:J.x=E+(((L==document.body)?window.getSize().x:L.offsetWidth)/2)+D;break}switch(N.position.y){case"top":J.y=K+C;break;case"bottom":J.y=K+C+L.offsetHeight;break;default:J.y=K+(((L==document.body)?window.getSize().y:L.offsetHeight)/2)+C;break}if(N.edge){var I={};switch(N.edge.x){case"left":I.x=0;break;case"right":I.x=-H.x-H.computedRight-H.computedLeft;break;default:I.x=-(H.x/2);break}switch(N.edge.y){case"top":I.y=0;break;case"bottom":I.y=-H.y-H.computedTop-H.computedBottom;break;default:I.y=-(H.y/2);break}J.x=J.x+I.x;J.y=J.y+I.y}J={left:((J.x>=0||F)?J.x:0).toInt(),top:((J.y>=0||F)?J.y:0).toInt()};if(L.getStyle("position")=="fixed"||N.relFixedPosition){J.top=J.top.toInt()+window.getScroll().y;J.left=J.left.toInt()+window.getScroll().x}if(N.returnPos){return J}else{this.setStyles(J)}return this}});Element.implement({isVisible:function(){return this.getStyle("display")!="none"},toggle:function(){return this[this.isVisible()?"hide":"show"]()},hide:function(){var B;try{if("none"!=this.getStyle("display")){B=this.getStyle("display")}}catch(A){}this.store("originalDisplay",B||"block");this.setStyle("display","none");return this},show:function(A){original=this.retrieve("originalDisplay")?this.retrieve("originalDisplay"):this.get("originalDisplay");this.setStyle("display",(A||original||"block"));return this},swapClass:function(A,B){return this.removeClass(A).addClass(B)},fxOpacityOk:function(){return !Browser.Engine.trident4}});var Modalizer=new Class({defaultModalStyle:{display:"block",position:"fixed",top:0,left:0,"z-index":5000,"background-color":"#333",opacity:0.8},setModalOptions:function(A){this.modalOptions=$merge({width:(window.getScrollSize().x+300),height:(window.getScrollSize().y+300),elementsToHide:"select",hideOnClick:true,modalStyle:{},updateOnResize:true,layerId:"modalOverlay",onModalHide:$empty,onModalShow:$empty},this.modalOptions,A);return this},toElement:function(){if(!this.modalOptions.layerId){this.setModalOptions()}return $(this.modalOptions.layerId)||new Element("div",{id:this.modalOptions.layerId}).inject(document.body)},resize:function(){if($(this)){$(this).setStyles({width:(window.getScrollSize().x+300),height:(window.getScrollSize().y+300)})}},setModalStyle:function(A){this.modalOptions.modalStyle=A;this.modalStyle=$merge(this.defaultModalStyle,{width:this.modalOptions.width,height:this.modalOptions.height},A);if($(this)){$(this).setStyles(this.modalStyle)}return(this.modalStyle)},modalShow:function(A){this.setModalOptions(A);$(this).setStyles(this.setModalStyle(this.modalOptions.modalStyle));if(Browser.Engine.trident4){$(this).setStyle("position","absolute")}$(this).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)}if($type(this.modalOptions.onModalShow)=="function"){this.modalOptions.onModalShow()}this.togglePopThroughElements(0);$(this).setStyle("display","block");return this},modalHide:function(A,B){if(A===false){return false}this.togglePopThroughElements(1);if($type(this.modalOptions.onModalHide)=="function"){this.modalOptions.onModalHide()}$(this).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(Browser.Engine.trident4||(Browser.Engine.gecko&&Browser.Platform.mac)){$$(this.modalOptions.elementsToHide).each(function(B){B.setStyle("opacity",A)})}}});var StyleWriter=new Class({createStyle:function(A,B){window.addEvent("domready",function(){try{if($(B)&&B){return }var C=new Element("style",{id:B||""}).inject($$("head")[0]);if(Browser.Engine.trident){C.styleSheet.cssText=A}else{C.set("text",A)}}catch(D){dbug.log("error: %s",D)}}.bind(this))}});var StickyWin=new Class({Implements:[Options,Events,StyleWriter],options:{closeClassName:"closeSticky",pinClassName:"pinSticky",content:"",zIndex:10000,className:"",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.options.inject={target:document.body,where:"bottom"};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.timeout>0){this.addEvent("onDisplay",function(){this.hide.delay(this.options.timeout,this)}.bind(this))}if(this.options.showNow){this.show()}this.createStyle(this.css,"StickyWinClearFix")},toElement:function(){return this.win},makeWindow:function(){this.destroyOthers();if(!$(this.id)){this.win=new Element("div",{id:this.id}).addClass(this.options.className).addClass("StickyWinInstance").addClass("SWclearfix").setStyles({display:"none",position:"absolute",zIndex:this.options.zIndex}).inject(this.options.inject.target,this.options.inject.where).store("StickyWin",this)}else{this.win=$(this.id)}if(this.options.width&&$type(this.options.width.toInt())=="number"){this.win.setStyle("width",this.options.width.toInt())}if(this.options.height&&$type(this.options.height.toInt())=="number"){this.win.setStyle("height",this.options.height.toInt())}return this},show:function(){this.fireEvent("onDisplay");this.showWin();if(this.options.useIframeShim){this.showIframeShim()}this.visible=true;return this},showWin:function(){this.win.setStyle("display","block");if(!this.positioned){this.position()}},hide:function(A){if(!A){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.dispose()}},this)}},setContent:function(A){if(this.win.getChildren().length>0){this.win.empty()}if($type(A)=="string"){this.win.set("html",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 this}this.pinned=$pick(A,true);this.win.pin(A);return this},unpin:function(){return this.pin(false)},togglepin:function(){return this.pin(!this.pinned)},makeIframeShim:function(){if(!this.shim){var A=(this.options.iframeShimSelector)?this.win.getElement(this.options.iframeShimSelector):this.win;this.shim=new IframeShim(A,{display:false,name:"StickyWinShim"})}},showIframeShim:function(){if(this.options.useIframeShim){this.makeIframeShim();this.shim.show()}},hideIframeShim:function(){if(this.shim){this.shim.hide()}},destroy:function(){if(this.win){this.win.dispose()}if(this.options.useIframeShim){this.shim.dispose()}if($("modalOverlay")){$("modalOverlay").dispose()}}});(function(){var A=function(C){return{Extends:C,initialize:function(D){D=D||{};this.setModalOptions($merge(D.modalOptions||{},{onModalHide:function(){this.hide(false)}.bind(this)}));this.parent(D)},show:function(D){if($pick(D,true)){this.modalShow();this.win.getElements(this.modalOptions.elementsToHide).setStyle("opacity",1)}this.parent()},hide:function(D){if($pick(D,true)){this.modalHide()}this.parent($pick(D,true))}}};StickyWin.Modal=new Class(A(StickyWin));StickyWin.Modal.implement(new Modalizer);if(StickyWin.Fx){StickyWin.Fx.Modal=new Class(A(StickyWin.Fx))}try{StickyWin.Fx.Modal.implement(new Modalizer())}catch(B){}})();var StickyWinModal=StickyWin.Modal;if(StickyWin.Fx){var StickyWinFxModal=StickyWin.Fx.Modal}StickyWin.alert=function(D,C,B){B=B||"http://keyingredient.cachefly.net/static";C='<p class="errorMsg SWclearfix" style="margin: 0px;"><img src="'+B+'/clientside.icon_problems_sm.gif" class="bang clearfix" style="float: left; width: 30px; height: 30px; margin: 3px 5px 5px 0px;">'+C+"</p>";var A=StickyWin.ui(D,C,{width:250});return new StickyWin.Modal({modalOptions:{modalStyle:{zIndex:11000}},zIndex:110001,content:A,position:"center"})};StickyWin.ui=function(C,A,D){D=$extend({width:300,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{clear: none !important; margin:0px 5px 0px 0px !important; overflow: hidden; padding:0 !important; font-weight:bold; color:#555; font-size:14px !important; position:relative; top:8px !important; left:5px !important; float: left; height: 22px !important;}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 !important; margin-left:5px !important; position:relative; right:-20px !important;}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://keyingredient.cachefly.net/static/clientside.",buttons:[]},D);if(D.confirmTxt){D.buttons.push({text:D.confirmTxt,onClick:D.onConfirm||$empty})}if(D.closeTxt){D.buttons.push({text:D.closeTxt,onClick:D.onClose||$empty})}new StyleWriter().createStyle(D.css.substitute({baseHref:D.baseHref},/\\?\{%([^}]+)%\}/g),"defaultStickyWinStyle");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)));if($(C)){G.adopt(C)}else{G.set("html",C)}var E=new Element("div").addClass("body");if($(A)){E.adopt(A)}else{E.set("html",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").inject(H,"top")}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||$empty).appendText(J.text).inject(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 Waiter=new Class({Implements:[Options,Events,Chain],options:{baseHref:"http://keyingredient.cachefly.net/static/",containerProps:{styles:{position:"absolute","text-align":"center"},"class":"waiterContainer"},containerPosition:{},msg:false,msgProps:{styles:{"text-align":"center",fontWeight:"bold"},"class":"waiterMsg"},img:{src:"clientside.waiter.gif",styles:{width:24,height:24},"class":"waiterImg"},layer:{styles:{width:0,height:0,position:"absolute",zIndex:999,display:"none",opacity:0.9,background:"#fff"},"class":"waitingDiv"},useIframeShim:true,fxOptions:{}},initialize:function(C,A){this.target=$(C)||$(document.body);this.setOptions(A);this.waiterContainer=new Element("div",this.options.containerProps).inject(document.body);if(this.options.msg){this.msgContainer=new Element("div",this.options.msgProps);this.waiterContainer.adopt(this.msgContainer);if(!$(this.options.msg)){this.msg=new Element("p").appendText(this.options.msg)}else{this.msg=$(this.options.msg)}this.msgContainer.adopt(this.msg)}if(this.options.img){this.waiterImg=$(this.options.img.id)||new Element("img").injectInside(this.waiterContainer)}this.waiterOverlay=$(this.options.layer.id)||new Element("div").injectInside(document.body).adopt(this.waiterContainer);this.waiterOverlay.set(this.options.layer);try{if(this.options.useIframeShim){this.shim=new IframeShim(this.waiterOverlay,this.options.iframeShimOptions)}}catch(B){dbug.log("Waiter attempting to use IframeShim but failed; did you include IframeShim? Error: ",B);this.options.useIframeShim=false}this.waiterFx=this.waiterFx||new Fx.Elements($$(this.waiterContainer,this.waiterOverlay),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.cancel().set({0:{opacity:[0]},1:{opacity:[0]}})},start:function(A){this.reset();A=$(A)||$(this.target);if(this.options.img){this.waiterImg.set($merge(this.options.img,{src:this.options.baseHref+this.options.img.src}))}var B=function(){var C=A.getComputedSize();this.active=A;this.waiterOverlay.setStyles({width:this.options.layer.width||C.totalWidth,height:this.options.layer.height||C.totalHeight,display:"block"}).setPosition({relativeTo:A,position:"upperLeft"});this.waiterContainer.setPosition({relativeTo:this.waiterOverlay});if(this.options.useIframeShim){this.shim.show()}this.waiterFx.start({0:{opacity:[1]},1:{opacity:[this.options.layer.styles.opacity]}}).chain(function(){if(this.active==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.cancel();this.waiterFx.clearChain();this.waiterFx.start({0:{opacity:[0]},1:{opacity:[0]}}).chain(function(){this.active=null;this.waiterOverlay.hide();if(this.options.useIframeShim){this.shim.hide()}this.fireEvent("onHide",this.active);this.callChain();this.clearChain();if($type(A)=="function"){A.attempt()}}.bind(this));return this}});if(typeof Request!="undefined"&&Request.HTML){Request.HTML=new Class({Extends:Request.HTML,options:{useWaiter:false,waiterOptions:{},waiterTarget:false},initialize:function(A){this._send=this.send;this.send=function(B){if(this.waiter){this.waiter.start().chain(this._send.bind(this,B))}else{this._send(B)}return this};this.parent(A);if(this.options.useWaiter&&($(this.options.update)||$(this.options.waiterTarget))){this.waiter=new Waiter(this.options.waiterTarget||this.options.update,this.options.waiterOptions);["onComplete","onException","onCancel"].each(function(B){this.addEvent(B,this.waiter.stop.bind(this.waiter))},this)}}})}var SimpleSlideShow=new Class({Implements:[Events,Options,Chain],options:{startIndex:0,slides:[],currentSlideClass:"currentSlide",currentIndexContainer:false,maxContainer:false,nextLink:false,prevLink:false,wrap:true,disabledLinkClass:"disabled",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.show(this.now)}},setCounters:function(){if($(this.options.currentIndexContainer)){$(this.options.currentIndexContainer).set("html",this.now+1)}if($(this.options.maxContainer)){$(this.options.maxContainer).set("html",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.forward()}.bind(this))}if($(this.options.prevLink)){$(this.options.prevLink).addEvent("click",function(){this.back()}.bind(this))}},disableLinks:function(B){if(this.options.wrap){return }B=$pick(B,this.now);var D=$(this.options.prevLink);var C=$(this.options.nextLink);var A=this.options.disabledLinkClass;if(B>0){if(D){D.removeClass(A)}if(B===this.slides.length-1&&C){C.addClass(A)}else{if(C){C.removeClass(A)}}}else{if(this.slides.length>0&&C){C.removeClass(A)}if(D){D.addClass(A)}}},forward:function(){var A=false;if($type(this.now)&&this.now<this.slides.length-1){A=this.show(this.now+1)}else{if($type(this.now)&&this.options.wrap){A=this.show(0)}else{if(!$type(this.now)){A=this.show(this.options.startIndex)}}}if(A){this.fireEvent("onNext")}return this},back:function(){if(this.now>0){this.show(this.now-1);this.fireEvent("onPrev")}else{if(this.options.wrap&&this.slides.length>1){this.show(this.slides.length-1);this.fireEvent("onPrev")}}return this},show:function(C){if(this.showing){return this.chain(this.show.bind(this,C))}var B=this.now;var D=this.slides[C];function A(F,G){F.setStyle("display","block");if(F.fxOpacityOk()){if(G){F.setStyle("opacity",0)}F.set("tween",this.options.crossFadeOptions).get("tween").start("opacity",1).chain(function(){this.showing=false;this.disableLinks();this.callChain()}.bind(this))}}if(D){if($type(this.now)&&this.now!=C){if(D.fxOpacityOk()){var E=this.slides[this.now].get("tween");E.setOptions(this.options.crossFadeOptions);this.showing=true;E.start("opacity",0).chain(function(){this.slides[B].setStyle("display","none");D.addClass(this.options.currentSlideClass);A.run([D,true],this)}.bind(this))}else{this.slides[this.now].setStyle("display","none");A.run(D,this)}}else{A.run(D,this)}this.now=C;this.setCounters()}},slideClick:function(){this.fireEvent("onSlideClick",[this.slides[this.now],this.now])}});var SimpleImageSlideShow=new Class({Extends:SimpleSlideShow,options:{imgUrls:[],imgClass:"screenshot",container:false},initialize:function(A){this.parent(A);this.options.imgUrls.each(function(B){this.addImg(B)},this);this.show(this.options.startIndex)},addImg:function(B){if($(this.options.container)){var A=new Element("img",{src:B,id:this.options.imgClass+this.slides.length}).addClass(this.options.imgClass).setStyle("display","none").inject($(this.options.container)).addEvent("click",this.slideClick.bind(this));this.slides.push(A);this.makeSlide(A);this.setCounters()}return this}});var Clipboard={swfLocation:"http://www.cnet.com/html/rb/assets/global/clipboard/_clipboard.swf",copyFromElement:function(A){A=$(A);if(!A){return null}if(Browser.Engine.trident){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.get("value");if(C){Clipboard.copy(C)}}return A},copy:function(B){if(Browser.Engine.trident){window.addEvent("domready",function(){var C=new Element("textarea",{styles:{display:"none"}}).inject(document.body);C.set("value",B).select();Clipboard.copyFromElement(C);C.dispose()})}else{var A=($("flashcopier"))?$("flashcopier"):new Element("div",{id:"flashcopier"}).inject(document.body);A.empty();A.set("html",'<embed src="'+this.swfLocation+'" FlashVars="clipboard='+escape(B)+'" width="0" height="0" type="application/x-shockwave-flash"></embed>')}}};var InputValidator=new Class({Implements:[Options],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).get("validatorProps")){try{return JSON.decode($(B).get("validatorProps"))}catch(A){return{}}}else{return{}}}});var FormValidator=new Class({Implements:[Options,Events],options:{fieldSelectors:"input, select, textarea",ignoreHidden:true,useTitles:false,evaluateOnSubmit:true,evaluateFieldsOnBlur:true,evaluateFieldsOnChange:true,serial:true,warningPrefix:function(){return FormValidator.resources[FormValidator.language].warningPrefix||"Warning: "},errorPrefix:function(){return FormValidator.resources[FormValidator.language].errorPrefix||"Error: "}},initialize:function(B,A){this.setOptions(A);this.form=$(B);this.form.store("validator",this);this.warningPrefix=$lambda(this.options.warningPrefix)();this.errorPrefix=$lambda(this.options.errorPrefix)();if(this.options.evaluateOnSubmit){this.form.addEvent("submit",this.onSubmit.bind(this))}if(this.options.evaluateFieldsOnBlur){this.watchFields()}},toElement:function(){return this.form},getFields:function(){return this.fields=this.form.getElements(this.options.fieldSelectors)},watchFields:function(){this.getFields().each(function(A){A.addEvent("blur",this.validateField.pass([A,false],this));if(this.options.evaluateFieldsOnChange){A.addEvent("change",this.validateField.pass([A,true],this))}},this)},onSubmit:function(A){if(!this.validate(A)&&A){A.preventDefault()}else{this.reset()}},reset:function(){this.getFields().each(this.resetField,this);return this},validate:function(B){var A=this.getFields().map(function(C){return this.validateField(C,true)},this).every(function(C){return C});this.fireEvent("onFormValidate",[A,this.form,B]);return A},validateField:function(I,A){if(this.paused){return true}I=$(I);var D=!I.hasClass("validation-failed");var F,H;if(this.options.serial&&!A){F=this.form.getElement(".validation-failed");H=this.form.getElement(".warning")}if(I&&(!F||A||I.hasClass("validation-failed")||(F&&!this.options.serial))){var C=I.className.split(" ").some(function(J){return this.getValidator(J)},this);var G=[];I.className.split(" ").each(function(J){if(!this.test(J,I)){G.include(J)}},this);D=G.length===0;if(C&&!I.hasClass("warnOnly")){if(D){I.addClass("validation-passed").removeClass("validation-failed");this.fireEvent("onElementPass",I)}else{I.addClass("validation-failed").removeClass("validation-passed");this.fireEvent("onElementFail",[I,F])}}if(!H){var E=I.className.split(" ").some(function(J){if(J.test("^warn-")||I.hasClass("warnOnly")){return this.getValidator(J.replace(/^warn-/,""))}else{return null}},this);I.removeClass("warning");var B=I.className.split(" ").map(function(J){if(J.test("^warn-")||I.hasClass("warnOnly")){return this.test(J.replace(/^warn-/,""),I,true)}else{return null}},this)}}return D},getPropName:function(A){return"__advice"+A},test:function(C,E,F){E=$(E);if(E.hasClass("ignoreValidation")){return true}F=$pick(F,false);if(E.hasClass("warnOnly")){F=true}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,C])}}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.reveal){A.reveal()}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.dissolve){A.dissolve()}else{A.setStyle("display","none")}}},isVisible:function(A){if(!this.options.ignoreHidden){return true}while(A!=document.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.warningPrefix:this.errorPrefix;E+=(this.options.useTitles)?F.title||C:C;var B=this.getAdvice(D,F);if(!B){var A=(G)?"warning-advice":"validation-advice";B=new Element("div",{text:E,styles:{display:"none"},id:"advice-"+D+"-"+this.getFieldId(F)}).addClass(A)}else{B.set("html",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.inject($(C),"after")}},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)}return this},stop:function(){this.paused=true;return this},start:function(){this.paused=false;return this},ignoreField:function(A,B){A=$(A);if(A){this.enforceField(A);if(B){A.addClass("warnOnly")}else{A.addClass("ignoreValidation")}}return this},enforceField:function(A){A=$(A);if(A){A.removeClass("warnOnly").removeClass("ignoreValidation")}return this}});FormValidator.resources={enUS:{required:"This field is required.",minLength:"Please enter at least {minLength} characters (you entered {length} characters).",maxLength:"Please enter no more than {maxLength} characters (you entered {length} characters).",integer:"Please enter an integer in this field. Numbers with decimals (e.g. 1.25) are not permitted.",numeric:'Please enter only numeric values in this field (i.e. "1" or "1.1" or "-1" or "-1.1").',digits:"Please use numbers and punctuation only in this field (for example, a phone number with dashes or dots is permitted).",alpha:"Please use letters only (a-z) with in this field. No spaces or other characters are allowed.",alphanum:"Please use only letters (a-z) or numbers (0-9) only in this field. No spaces or other characters are allowed.",dateSuchAs:"Please enter a valid date such as {date}",dateInFormatMDY:'Please enter a valid date such as MM/DD/YYYY (i.e. "12/31/1999")',email:'Please enter a valid email address. For example "fred@domain.com".',url:"Please enter a valid URL such as http://www.google.com.",currencyDollar:"Please enter a valid $ amount. For example $100.00 .",oneRequired:"Please enter something for at least one of these inputs.",errorPrefix:"Error: ",warningPrefix:"Warning: "}};FormValidator.language="enUS";FormValidator.getMsg=function(A,B){return FormValidator.resources[B||FormValidator.language][A]};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]}};$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.get("value")==null)||(A.get("value").length==0))}}});FormValidator.addAllThese([["required",{errorMsg:function(){return FormValidator.getMsg("required")},test:function(A){return !FormValidator.getValidator("IsEmpty").test(A)}}],["minLength",{errorMsg:function(A,B){if($type(B.minLength)){return FormValidator.getMsg("minLength").substitute({minLength:B.minLength,length:A.get("value").length})}else{return""}},test:function(A,B){if($type(B.minLength)){return(A.get("value").length>=$pick(B.minLength,0))}else{return true}}}],["maxLength",{errorMsg:function(A,B){if($type(B.maxLength)){return FormValidator.getMsg("maxLength").substitute({maxLength:B.maxLength,length:A.get("value").length})}else{return""}},test:function(A,B){return(A.get("value").length<=$pick(B.maxLength,10000))}}],["validate-integer",{errorMsg:FormValidator.getMsg.pass("integer"),test:function(A){return FormValidator.getValidator("IsEmpty").test(A)||/^-?[1-9]\d*$/.test(A.get("value"))}}],["validate-numeric",{errorMsg:FormValidator.getMsg.pass("numeric"),test:function(A){return FormValidator.getValidator("IsEmpty").test(A)||/^-?(?:0$0(?=\d*\.)|[1-9]|0)\d*(\.\d+)?$/.test(A.get("value"))}}],["validate-digits",{errorMsg:FormValidator.getMsg.pass("digits"),test:function(A){return FormValidator.getValidator("IsEmpty").test(A)||(/^[\d() .:\-\+#]+$/.test(A.get("value")))}}],["validate-alpha",{errorMsg:FormValidator.getMsg.pass("alpha"),test:function(A){return FormValidator.getValidator("IsEmpty").test(A)||/^[a-zA-Z]+$/.test(A.get("value"))}}],["validate-alphanum",{errorMsg:FormValidator.getMsg.pass("alphanum"),test:function(A){return FormValidator.getValidator("IsEmpty").test(A)||!/\W/.test(A.get("value"))}}],["validate-date",{errorMsg:function(A,B){if(Date.parse){var C=B.dateFormat||"%x";return FormValidator.getMsg("dateSuchAs").substitute({date:new Date().format(C)})}else{return FormValidator.getMsg("dateInFormatMDY")}},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.get("value"));var D=F.format(E);if(D!="invalid date"){A.set("value",D)}return !isNaN(F)}else{var C=/^(\d{2})\/(\d{2})\/(\d{4})$/;if(!C.test(A.get("value"))){return false}var F=new Date(A.get("value").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:FormValidator.getMsg.pass("email"),test:function(A){return FormValidator.getValidator("IsEmpty").test(A)||/^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i.test(A.get("value"))}}],["validate-url",{errorMsg:FormValidator.getMsg.pass("url"),test:function(A){return FormValidator.getValidator("IsEmpty").test(A)||/^(https?|ftp|rmtp|mms):\/\/(([A-Z0-9][A-Z0-9_-]*)(\.[A-Z0-9][A-Z0-9_-]*)+)(:(\d+))?\/?/i.test(A.get("value"))}}],["validate-currency-dollar",{errorMsg:FormValidator.getMsg.pass("currencyDollar"),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.get("value"))}}],["validate-one-required",{errorMsg:FormValidator.getMsg.pass("oneRequired"),test:function(A){var B=A.parentNode;return B.getElements("input").some(function(C){if(["checkbox","radio"].contains(C.get("type"))){return C.get("checked")}return C.get("value")})}}]]);var Observer=new Class({Implements:[Options,Events],options:{periodical:false,delay:1000},initialize:function(C,A,B){this.setOptions(B);this.addEvent("onFired",A);this.element=$(C)||$$(C);this.boundChange=this.changed.bind(this);this.resume()},changed:function(){var A=this.element.get("value");if($equals(this.value,A)){return }this.clear();this.value=A;this.timeout=this.onFired.delay(this.options.delay,this)},setValue:function(A){this.value=A;this.element.set("value",A);return this.clear()},onFired:function(){this.fireEvent("onFired",[this.value,this.element])},clear:function(){$clear(this.timeout||null);return this},pause:function(){$clear(this.timeout);$clear(this.timer);this.element.removeEvent("keyup",this.boundChange);return this},resume:function(){this.value=this.element.get("value");if(this.options.periodical){this.timer=this.changed.periodical(this.options.periodical,this)}else{this.element.addEvent("keyup",this.boundChange)}return this}});var $equals=function(B,A){return(B==A||JSON.encode(B)==JSON.encode(A))};