
/*** default.js - 10.0 kb ***/
function out(B,A){var C;if(C=$("out")){C.innerHTML=(A?B:$("out").innerHTML+B)}}function findPosX(A){var B=0;if(A.offsetParent){while(A.offsetParent){B+=A.offsetLeft;A=A.offsetParent}}else{if(A.x){B+=A.x}}return B}function findPosY(B){var A=0;if(B.offsetParent){while(B.offsetParent){A+=B.offsetTop;B=B.offsetParent}}else{if(B.y){A+=B.y}}return A}function hideAuthorTools(){var A=document.getElementsByTagName("div");for(i=0;i<A.length;i++){var B=A[i];if(B.lang=="aa"){B.style.display=B.style.display=="none"?"block":"none"}}}function qs(D){D=D.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var B="[\\?&]"+D+"=([^&#]*)";var C=new RegExp(B);var A=C.exec(window.location.href);if(A==null){return""}else{return A[1]}}Ajax.Responders.register({onCreate:function(A){},onLoading:function(A){Global.Cursor.Show()},onComplete:function(A){switch(A.transport.status){case 500:case 404:console.log(A.transport.responseText);break}Global.Cursor.Hide()},onRequestStart:function(A){A.options.parameters=Object.extend(A.options.parameters,{userstatus:_STATUS}||null)}});var Util={outerHTML:function(B){var C=Builder.node("div",[B.cloneNode(true)]);var A=C.innerHTML;C=null;return A}};Element.addMethods(Util);function getPageScroll(){var A;if(self.pageYOffset){A=self.pageYOffset}else{if(document.documentElement&&document.documentElement.scrollTop){A=document.documentElement.scrollTop}else{if(document.body){A=document.body.scrollTop}}}arrayPageScroll=new Array("",A);return arrayPageScroll}function getPageSize(){var C,A;if(window.innerHeight&&window.scrollMaxY){C=document.body.scrollWidth;A=window.innerHeight+window.scrollMaxY}else{if(document.body.scrollHeight>document.body.offsetHeight){C=document.body.scrollWidth;A=document.body.scrollHeight}else{C=document.body.offsetWidth;A=document.body.offsetHeight}}var B,D;if(self.innerHeight){B=self.innerWidth;D=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){B=document.documentElement.clientWidth;D=document.documentElement.clientHeight}else{if(document.body){B=document.body.clientWidth;D=document.body.clientHeight}}}if(A<D){pageHeight=D}else{pageHeight=A}if(C<B){pageWidth=B}else{pageWidth=C}arrayPageSize=new Array(pageWidth,pageHeight,B,D);return arrayPageSize}function getXml(B){var A;if(window.ActiveXObject){A=new ActiveXObject("Microsoft.XMLDOM");A.async="false";A.loadXML(B)}else{var C=new DOMParser();A=C.parseFromString(B,"text/xml")}return A}function currency(A){A=A.toString().replace(/\$|\,/g,"");if(isNaN(A)){A="0"}sign=(A==(A=Math.abs(A)));A=Math.floor(A*100+0.50000000001);cents=A%100;A=Math.floor(A/100).toString();if(cents<10){cents="0"+cents}for(var B=0;B<Math.floor((A.length-(1+B))/3);B++){A=A.substring(0,A.length-(4*B+3))+","+A.substring(A.length-(4*B+3))}return(((sign)?"":"-")+"$"+A+"."+cents)}Object.extend(String.prototype,{rep:function(A,B){return new Template(this,B).evaluate(A)}});var ddOpen=false;var thisBox=null;function barSearch(B,F){var A=$(F);var E="/s/?s=";if(A.value==""||A.value.toLowerCase().indexOf("search")==0){alert("You must enter a value to search.");return }var D=false;if(B){var G=$(B);if(G.value!=null){switch(G.value){case"sbrforum":E="http://forum.sbrforum.com/search.php?do=process&query=";D=true;break;case"sbr":E="http://www.sportsbookreview.com/sr.aspx?s=";D=true;break;default:E="http://www."+_DOMAIN+"/s/?s=";break}}}else{E="http://www."+_DOMAIN+"/s/?s="}var C=A.value.replace(/([^\d\w\s]+|\s(a|an|and|are|as|at|be|by|for|from|in|is|it|of|on|or|that|the|this|to|was|which|with)\s)/g," ");C=C.replace(/\s+/g,"+");C=C.indexOf("+")==C.length-1?C.substr(0,C.length-1):C;if(D){window.open(E+C);return false}else{window.location.href=E+C}return false}function getSettings(E){var A=E;var D={};A.select('input:not([type="checkbox"])').each(function(F){if(F.name||F.id){if(F.getAttribute("type")=="radio"&&F.checked){D[F.id?F.id:F.name]=F.value}else{if(F.getAttribute("type")!="radio"){D[F.name?F.name:F.id]=escape(F.value)}}}});A.select("select").each(function(F){if(F.name||F.id){D[F.name?F.name:F.id]=escape(F.options[F.selectedIndex].value)}});A.select("textarea").each(function(F){if(F.name||F.id){D[F.name?F.name:F.id]=escape(F.value)}});A.select('input[type="checkbox"]').each(function(F){if(F.name||F.id){D[F.name?F.name:F.id]=F.checked}});var C="";for(k in D){C+=k+"="+D[k]+"&"}var B={};B.vars=C;return B}function calcTime(A){d=new Date();utc=d.getTime()+(d.getTimezoneOffset()*60000);nd=new Date(utc+(3600000*A));return nd}document.observe("dom:loaded",function(){var A=[];$$(".tabs a").each(function(C){A.push(C.readAttribute("tab"));$(C).observe("click",function(){if($(C.readAttribute("tab"))){$$(".tabs a.selected").each(function(D){D.removeClassName("selected")});$$(".tabbox .page").invoke("hide");$(C.readAttribute("tab")).show();C.addClassName("selected")}})});if(document.URL.indexOf("#",0)>0){var B=document.URL.split("#").last();if(A.indexOf(B)>=0){$$(".tabs a.selected").each(function(C){C.removeClassName("selected")});$$(".tabbox .page").invoke("hide");$(B).show();$$(".tabs a").each(function(C){if(C.readAttribute("tab")==B){C.addClassName("selected")}})}}});(function(){var G=document,K=window;function B(O){if(typeof O=="string"){O=G.getElementById(O)}return O}function D(Q,P,O){if(K.addEventListener){Q.addEventListener(P,O,false)}else{if(K.attachEvent){var R=function(){O.call(Q,K.event)};Q.attachEvent("on"+P,R)}}}var C=function(){var O=G.createElement("div");return function(P){O.innerHTML=P;var Q=O.childNodes[0];O.removeChild(Q);return Q}}();function E(P,O){return P.className.match(new RegExp("(\\s|^)"+O+"(\\s|$)"))}function F(P,O){if(!E(P,O)){P.className+=" "+O}}function L(Q,O){var P=new RegExp("(\\s|^)"+O+"(\\s|$)");Q.className=Q.className.replace(P," ")}if(document.documentElement.getBoundingClientRect){var M=function(O){var T=O.getBoundingClientRect(),X=O.ownerDocument,U=X.body,P=X.documentElement,S=P.clientTop||U.clientTop||0,V=P.clientLeft||U.clientLeft||0,Y=1;if(U.getBoundingClientRect){var R=U.getBoundingClientRect();Y=(R.right-R.left)/U.clientWidth}if(Y>1){S=0;V=0}var W=T.top/Y+(window.pageYOffset||P&&P.scrollTop/Y||U.scrollTop/Y)-S,Q=T.left/Y+(window.pageXOffset||P&&P.scrollLeft/Y||U.scrollLeft/Y)-V;return{top:W,left:Q}}}else{var M=function(O){if(K.jQuery){return jQuery(O).offset()}var Q=0,P=0;do{Q+=O.offsetTop||0;P+=O.offsetLeft||0}while(O=O.offsetParent);return{left:P,top:Q}}}function A(Q){var S,P,R,O;var T=M(Q);S=T.left;R=T.top;P=S+Q.offsetWidth;O=R+Q.offsetHeight;return{left:S,right:P,top:R,bottom:O}}function I(R){if(!R.pageX&&R.clientX){var Q=1;var O=document.body;if(O.getBoundingClientRect){var P=O.getBoundingClientRect();Q=(P.right-P.left)/O.clientWidth}return{x:R.clientX/Q+G.body.scrollLeft+G.documentElement.scrollLeft,y:R.clientY/Q+G.body.scrollTop+G.documentElement.scrollTop}}return{x:R.pageX,y:R.pageY}}var H=function(){var O=0;return function(){return"ValumsAjaxUpload"+O++}}();function N(O){return O.replace(/.*(\/|\\)/,"")}function J(O){return(/[.]/.exec(O))?/[^.]+$/.exec(O.toLowerCase()):""}Ajax_upload=AjaxUpload=function(Q,O){if(Q.jquery){Q=Q[0]}else{if(typeof Q=="string"&&/^#.*/.test(Q)){Q=Q.slice(1)}}Q=B(Q);this._input=null;this._button=Q;this._disabled=false;this._submitting=false;this._justClicked=false;this._parentDialog=G.body;if(window.jQuery&&jQuery.ui&&jQuery.ui.dialog){var R=jQuery(self._button).parents(".ui-dialog-content");if(R.length){this._parentDialog=R[0]}}this._settings={action:"upload.php",name:"userfile",data:{},autoSubmit:true,responseType:false,onChange:function(S,T){},onSubmit:function(S,T){},onComplete:function(T,S){}};for(var P in O){this._settings[P]=O[P]}this._createInput();this._rerouteClicks()};AjaxUpload.prototype={setData:function(O){this._settings.data=O},disable:function(){this._disabled=true},enable:function(){this._disabled=false},destroy:function(){if(this._input){if(this._input.parentNode){this._input.parentNode.removeChild(this._input)}this._input=null}},_createInput:function(){var P=this;var O=G.createElement("input");O.setAttribute("type","file");O.setAttribute("name",this._settings.name);var R={position:"absolute",margin:"-5px 0 0 -175px",padding:0,width:"220px",height:"30px",opacity:0,cursor:"pointer",display:"none",zIndex:2147483583};for(var Q in R){O.style[Q]=R[Q]}if(!(O.style.opacity==="0")){O.style.filter="alpha(opacity=0)"}this._parentDialog.appendChild(O);D(O,"change",function(){var S=N(this.value);if(P._settings.onChange.call(P,S,J(S))==false){return }if(P._settings.autoSubmit){P.submit()}});D(O,"click",function(){P.justClicked=true;setTimeout(function(){P.justClicked=false},3000)});this._input=O},_rerouteClicks:function(){var P=this;var Q,O={top:0,left:0},R=false;D(P._button,"mouseover",function(S){if(!P._input||R){return }R=true;Q=A(P._button);if(P._parentDialog!=G.body){O=M(P._parentDialog)}});D(document,"mousemove",function(T){var S=P._input;if(!S||!R){return }if(P._disabled){L(P._button,"hover");S.style.display="none";return }var U=I(T);if((U.x>=Q.left)&&(U.x<=Q.right)&&(U.y>=Q.top)&&(U.y<=Q.bottom)){S.style.top=U.y-O.top+"px";S.style.left=U.x-O.left+"px";S.style.display="block";F(P._button,"hover")}else{R=false;if(!P.justClicked){S.style.display="none"}L(P._button,"hover")}})},_createIframe:function(){var P=H();var O=C('<iframe src="javascript:false;" name="'+P+'" />');O.id=P;O.style.display="none";G.body.appendChild(O);return O},submit:function(){var O=this,R=this._settings;if(this._input.value===""){return }var P=N(this._input.value);if(!(R.onSubmit.call(this,P,J(P))==false)){var Q=this._createIframe();var T=this._createForm(Q);T.appendChild(this._input);T.submit();G.body.removeChild(T);T=null;this._input=null;this._createInput();var S=false;D(Q,"load",function(W){if(Q.src=="about:blank"){if(S){setTimeout(function(){G.body.removeChild(Q)},0)}return }var V=Q.contentDocument?Q.contentDocument:frames[Q.id].document;if(V.readyState&&V.readyState!="complete"){return }if(V.body&&V.body.innerHTML=="false"){return }var U;if(V.XMLDocument){U=V.XMLDocument}else{if(V.body){U=V.body.innerHTML;if(R.responseType=="json"){U=window["eval"]("("+U+")")}}else{var U=V}}R.onComplete.call(O,P,U);S=true;Q.src="about:blank"})}else{this._input.value=""}},_createForm:function(Q){var P=this._settings;var R=C('<form method="post" enctype="multipart/form-data"></form>');R.style.display="none";R.action=P.action;R.target=Q.name;G.body.appendChild(R);for(var S in P.data){var O=G.createElement("input");O.type="hidden";O.name=S;O.value=P.data[S];R.appendChild(O)}return R}}})();

/*** CustomControls.js - 4.0 kb ***/
if(typeof (console)=="undefined"){console={log:function(A){}}}var dateFormat=function(){var A=/d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloZ]|"[^"]*"|'[^']*'/g,B=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,D=/[^-+\dA-Z]/g,C=function(F,E){F=String(F);E=parseInt(E)||2;while(F.length<E){F="0"+F}return F};return function(J,T){if(arguments.length==1&&(typeof J=="string"||J instanceof String)&&!/\d/.test(J)){T=J;J=undefined}J=J?new Date(J):new Date();if(isNaN(J)){throw"invalid date"}var G=dateFormat;T=String(G.masks[T]||T||G.masks["default"]);var O=J.getDate(),E=J.getDay(),K=J.getMonth(),Q=J.getFullYear(),R=J.getHours(),N=J.getMinutes(),S=J.getSeconds(),P=J.getMilliseconds(),F=J.getTimezoneOffset(),I={d:O,dd:C(O),ddd:G.i18n.dayNames[E],dddd:G.i18n.dayNames[E+7],m:K+1,mm:C(K+1),mmm:G.i18n.monthNames[K],mmmm:G.i18n.monthNames[K+12],yy:String(Q).slice(2),yyyy:Q,h:R%12||12,hh:C(R%12||12),H:R,HH:C(R),M:N,MM:C(N),s:S,ss:C(S),l:C(P,3),L:C(P>99?Math.round(P/10):P),t:R<12?"a":"p",tt:R<12?"am":"pm",T:R<12?"A":"P",TT:R<12?"AM":"PM",Z:(String(J).match(B)||[""]).pop().replace(D,""),o:(F>0?"-":"+")+C(Math.floor(Math.abs(F)/60)*100+Math.abs(F)%60,4)};return T.replace(A,function(H){return(H in I)?I[H]:H.slice(1,H.length-1)})}}();dateFormat.masks={"default":"ddd mmm d yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoFullDateTime:"yyyy-mm-dd'T'HH:MM:ss.lo"};dateFormat.i18n={dayNames:["Sun","Mon","Tue","Wed","Thr","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"]};Date.prototype.format=function(A){return dateFormat(this,A)};var StringBuilder=Class.create({initialize:function(){this.array=new Array()},Append:function(A){this.array.push(A)},AppendStrings:function(A){this.array.push(A.join(""))},AppendFormat:function(B,A){this.array.push(B.interpolate(A))},AppendLine:function(){this.array.push("\n")},Length:function(){return this.array.join("").length},ToString:function(A){return this.array.join(A==null?"":A)}});var SSMath=function(){var A=function(){this.UPrice=function(D,C){return(C>=D)?(C/D)*100:(D/C)*-100};this.URisk=function(C,D){return(C>0)?(D/C)*100:(-C*D)/100};this.UToWin=function(C,D){return(C>0)?(C*D)/100:(D/-C)*100}};this.USAOdds=new A();var B=function(){this.UPrice=function(D,C){return(C/D)+1};this.URisk=function(C,D){return D/(C-1)};this.UToWin=function(C,D){return(C*D)-D}};this.Decimal=new B();this.ToCurrency=function(C){C=C.toString().replace(/\$|\,/g,"");if(isNaN(C)){C="0"}sign=(C==(C=Math.abs(C)));C=Math.floor(C*100+0.50000000001);cents=C%100;C=Math.floor(C/100).toString();if(cents<10){cents="0"+cents}for(var D=0;D<Math.floor((C.length-(1+D))/3);D++){C=C.substring(0,C.length-(4*D+3))+","+C.substring(C.length-(4*D+3))}return(((sign)?"":"-")+C+"."+cents)}};var ModuleBox={Toggle:function(B,C){var A=$(C);new Effect.toggle(A,"blind",{duration:0.3,afterFinish:function(){var D=A.getStyle("display").toLowerCase()=="block";B.className=D?"moduleBox_arrowDown":"moduleBox_arrowRight"}})}};var Forms={CreateEnterActions:function(){Event.observe(window,"load",function(){$(document.body).select('input[type="text"]','input[type="password"]').each(function(A){if(A.getAttribute("buttonRel")!=null){var B=A.getAttribute("buttonRel");Event.observe(A,"keydown",function(C){if(C.which||C.keyCode){if((C.which==13)||(C.keyCode==13)){$(B).click();return false}}else{return true}}.bind(this))}})})},CreateAjaxEnterActions:function(){$(document.body).select('input[type="text"]','input[type="password"]').each(function(A){if(A.getAttribute("ajaxButtonRel")!=null){var B=A.getAttribute("buttonRel");$addHandler(A,"keydown",Forms.HandleEnterKey)}})},HandleEnterKey:function(A){if(A.keyCode==Sys.UI.Key.enter){A.preventDefault();var B=$(this);if(B.getAttribute("ajaxButtonRel")!=null){var C=$(B.getAttribute("ajaxButtonRel"));__doPostBack(C.name,"");setTimeout(function(){$(B.id).focus()},500);A.returnValue=false;return false}}}};Forms.CreateEnterActions();Event.observe(window,"load",Forms.CreateAjaxEnterActions);

/*** date-en.js - 23.0 kb ***/
Date.CultureInfo={name:"en-US",englishName:"English (United States)",nativeName:"English (United States)",dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],abbreviatedDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],shortestDayNames:["Su","Mo","Tu","We","Th","Fr","Sa"],firstLetterDayNames:["S","M","T","W","T","F","S"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],abbreviatedMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],amDesignator:"AM",pmDesignator:"PM",firstDayOfWeek:0,twoDigitYearMax:2029,dateElementOrder:"mdy",formatPatterns:{shortDate:"M/d/yyyy",longDate:"dddd, MMMM dd, yyyy",shortTime:"h:mm tt",longTime:"h:mm:ss tt",fullDateTime:"dddd, MMMM dd, yyyy h:mm:ss tt",sortableDateTime:"yyyy-MM-ddTHH:mm:ss",universalSortableDateTime:"yyyy-MM-dd HH:mm:ssZ",rfc1123:"ddd, dd MMM yyyy HH:mm:ss GMT",monthDay:"MMMM dd",yearMonth:"MMMM, yyyy"},regexPatterns:{jan:/^jan(uary)?/i,feb:/^feb(ruary)?/i,mar:/^mar(ch)?/i,apr:/^apr(il)?/i,may:/^may/i,jun:/^jun(e)?/i,jul:/^jul(y)?/i,aug:/^aug(ust)?/i,sep:/^sep(t(ember)?)?/i,oct:/^oct(ober)?/i,nov:/^nov(ember)?/i,dec:/^dec(ember)?/i,sun:/^su(n(day)?)?/i,mon:/^mo(n(day)?)?/i,tue:/^tu(e(s(day)?)?)?/i,wed:/^we(d(nesday)?)?/i,thu:/^th(u(r(s(day)?)?)?)?/i,fri:/^fr(i(day)?)?/i,sat:/^sa(t(urday)?)?/i,future:/^next/i,past:/^last|past|prev(ious)?/i,add:/^(\+|after|from)/i,subtract:/^(\-|before|ago)/i,yesterday:/^yesterday/i,today:/^t(oday)?/i,tomorrow:/^tomorrow/i,now:/^n(ow)?/i,millisecond:/^ms|milli(second)?s?/i,second:/^sec(ond)?s?/i,minute:/^min(ute)?s?/i,hour:/^h(ou)?rs?/i,week:/^w(ee)?k/i,month:/^m(o(nth)?s?)?/i,day:/^d(ays?)?/i,year:/^y((ea)?rs?)?/i,shortMeridian:/^(a|p)/i,longMeridian:/^(a\.?m?\.?|p\.?m?\.?)/i,timezone:/^((e(s|d)t|c(s|d)t|m(s|d)t|p(s|d)t)|((gmt)?\s*(\+|\-)\s*\d\d\d\d?)|gmt)/i,ordinalSuffix:/^\s*(st|nd|rd|th)/i,timeContext:/^\s*(\:|a|p)/i},abbreviatedTimeZoneStandard:{GMT:"-000",EST:"-0400",CST:"-0500",MST:"-0600",PST:"-0700"},abbreviatedTimeZoneDST:{GMT:"-000",EDT:"-0500",CDT:"-0600",MDT:"-0700",PDT:"-0800"}};Date.getMonthNumberFromName=function(B){var E=Date.CultureInfo.monthNames,A=Date.CultureInfo.abbreviatedMonthNames,D=B.toLowerCase();for(var C=0;C<E.length;C++){if(E[C].toLowerCase()==D||A[C].toLowerCase()==D){return C}}return -1};Date.getDayNumberFromName=function(B){var F=Date.CultureInfo.dayNames,A=Date.CultureInfo.abbreviatedDayNames,E=Date.CultureInfo.shortestDayNames,D=B.toLowerCase();for(var C=0;C<F.length;C++){if(F[C].toLowerCase()==D||A[C].toLowerCase()==D){return C}}return -1};Date.isLeapYear=function(A){return(((A%4===0)&&(A%100!==0))||(A%400===0))};Date.getDaysInMonth=function(A,B){return[31,(Date.isLeapYear(A)?29:28),31,30,31,30,31,31,30,31,30,31][B]};Date.getTimezoneOffset=function(A,B){return(B||false)?Date.CultureInfo.abbreviatedTimeZoneDST[A.toUpperCase()]:Date.CultureInfo.abbreviatedTimeZoneStandard[A.toUpperCase()]};Date.getTimezoneAbbreviation=function(B,D){var C=(D||false)?Date.CultureInfo.abbreviatedTimeZoneDST:Date.CultureInfo.abbreviatedTimeZoneStandard,A;for(A in C){if(C[A]===B){return A}}return null};Date.prototype.clone=function(){return new Date(this.getTime())};Date.prototype.compareTo=function(A){if(isNaN(this)){throw new Error(this)}if(A instanceof Date&&!isNaN(A)){return(this>A)?1:(this<A)?-1:0}else{throw new TypeError(A)}};Date.prototype.equals=function(A){return(this.compareTo(A)===0)};Date.prototype.between=function(C,A){var B=this.getTime();return B>=C.getTime()&&B<=A.getTime()};Date.prototype.addMilliseconds=function(A){this.setMilliseconds(this.getMilliseconds()+A);return this};Date.prototype.addSeconds=function(A){return this.addMilliseconds(A*1000)};Date.prototype.addMinutes=function(A){return this.addMilliseconds(A*60000)};Date.prototype.addHours=function(A){return this.addMilliseconds(A*3600000)};Date.prototype.addDays=function(A){return this.addMilliseconds(A*86400000)};Date.prototype.addWeeks=function(A){return this.addMilliseconds(A*604800000)};Date.prototype.addMonths=function(A){var B=this.getDate();this.setDate(1);this.setMonth(this.getMonth()+A);this.setDate(Math.min(B,this.getDaysInMonth()));return this};Date.prototype.addYears=function(A){return this.addMonths(A*12)};Date.prototype.add=function(B){if(typeof B=="number"){this._orient=B;return this}var A=B;if(A.millisecond||A.milliseconds){this.addMilliseconds(A.millisecond||A.milliseconds)}if(A.second||A.seconds){this.addSeconds(A.second||A.seconds)}if(A.minute||A.minutes){this.addMinutes(A.minute||A.minutes)}if(A.hour||A.hours){this.addHours(A.hour||A.hours)}if(A.month||A.months){this.addMonths(A.month||A.months)}if(A.year||A.years){this.addYears(A.year||A.years)}if(A.day||A.days){this.addDays(A.day||A.days)}return this};Date._validate=function(D,C,A,B){if(typeof D!="number"){throw new TypeError(D+" is not a Number.")}else{if(D<C||D>A){throw new RangeError(D+" is not a valid value for "+B+".")}}return true};Date.validateMillisecond=function(A){return Date._validate(A,0,999,"milliseconds")};Date.validateSecond=function(A){return Date._validate(A,0,59,"seconds")};Date.validateMinute=function(A){return Date._validate(A,0,59,"minutes")};Date.validateHour=function(A){return Date._validate(A,0,23,"hours")};Date.validateDay=function(C,A,B){return Date._validate(C,1,Date.getDaysInMonth(A,B),"days")};Date.validateMonth=function(A){return Date._validate(A,0,11,"months")};Date.validateYear=function(A){return Date._validate(A,1,9999,"seconds")};Date.prototype.set=function(B){var A=B;if(!A.millisecond&&A.millisecond!==0){A.millisecond=-1}if(!A.second&&A.second!==0){A.second=-1}if(!A.minute&&A.minute!==0){A.minute=-1}if(!A.hour&&A.hour!==0){A.hour=-1}if(!A.day&&A.day!==0){A.day=-1}if(!A.month&&A.month!==0){A.month=-1}if(!A.year&&A.year!==0){A.year=-1}if(A.millisecond!=-1&&Date.validateMillisecond(A.millisecond)){this.addMilliseconds(A.millisecond-this.getMilliseconds())}if(A.second!=-1&&Date.validateSecond(A.second)){this.addSeconds(A.second-this.getSeconds())}if(A.minute!=-1&&Date.validateMinute(A.minute)){this.addMinutes(A.minute-this.getMinutes())}if(A.hour!=-1&&Date.validateHour(A.hour)){this.addHours(A.hour-this.getHours())}if(A.month!==-1&&Date.validateMonth(A.month)){this.addMonths(A.month-this.getMonth())}if(A.year!=-1&&Date.validateYear(A.year)){this.addYears(A.year-this.getFullYear())}if(A.day!=-1&&Date.validateDay(A.day,this.getFullYear(),this.getMonth())){this.addDays(A.day-this.getDate())}if(A.timezone){this.setTimezone(A.timezone)}if(A.timezoneOffset){this.setTimezoneOffset(A.timezoneOffset)}return this};Date.prototype.clearTime=function(){this.setHours(0);this.setMinutes(0);this.setSeconds(0);this.setMilliseconds(0);return this};Date.prototype.isLeapYear=function(){var A=this.getFullYear();return(((A%4===0)&&(A%100!==0))||(A%400===0))};Date.prototype.isWeekday=function(){return !(this.is().sat()||this.is().sun())};Date.prototype.getDaysInMonth=function(){return Date.getDaysInMonth(this.getFullYear(),this.getMonth())};Date.prototype.moveToFirstDayOfMonth=function(){return this.set({day:1})};Date.prototype.moveToLastDayOfMonth=function(){return this.set({day:this.getDaysInMonth()})};Date.prototype.moveToDayOfWeek=function(A,B){var C=(A-this.getDay()+7*(B||+1))%7;return this.addDays((C===0)?C+=7*(B||+1):C)};Date.prototype.moveToMonth=function(C,A){var B=(C-this.getMonth()+12*(A||+1))%12;return this.addMonths((B===0)?B+=12*(A||+1):B)};Date.prototype.getDayOfYear=function(){return Math.floor((this-new Date(this.getFullYear(),0,1))/86400000)};Date.prototype.getWeekOfYear=function(A){var G=this.getFullYear(),C=this.getMonth(),E=this.getDate();var I=A||Date.CultureInfo.firstDayOfWeek;var D=7+1-new Date(G,0,1).getDay();if(D==8){D=1}var B=((Date.UTC(G,C,E,0,0,0)-Date.UTC(G,0,1,0,0,0))/86400000)+1;var H=Math.floor((B-D+7)/7);if(H===I){G--;var F=7+1-new Date(G,0,1).getDay();if(F==2||F==8){H=53}else{H=52}}return H};Date.prototype.isDST=function(){console.log("isDST");return this.toString().match(/(E|C|M|P)(S|D)T/)[2]=="D"};Date.prototype.getTimezone=function(){return Date.getTimezoneAbbreviation(this.getUTCOffset,this.isDST())};Date.prototype.setTimezoneOffset=function(B){var A=this.getTimezoneOffset(),C=Number(B)*-6/10;this.addMinutes(C-A);return this};Date.prototype.setTimezone=function(A){return this.setTimezoneOffset(Date.getTimezoneOffset(A))};Date.prototype.getUTCOffset=function(){var B=this.getTimezoneOffset()*-10/6,A;if(B<0){A=(B-10000).toString();return A[0]+A.substr(2)}else{A=(B+10000).toString();return"+"+A.substr(1)}};Date.prototype.getDayName=function(A){return A?Date.CultureInfo.abbreviatedDayNames[this.getDay()]:Date.CultureInfo.dayNames[this.getDay()]};Date.prototype.getMonthName=function(A){return A?Date.CultureInfo.abbreviatedMonthNames[this.getMonth()]:Date.CultureInfo.monthNames[this.getMonth()]};Date.prototype._toString=Date.prototype.toString;Date.prototype.toString=function(C){var A=this;var B=function B(D){return(D.toString().length==1)?"0"+D:D};return C?C.replace(/dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|zz?z?/g,function(D){switch(D){case"hh":return B(A.getHours()<13?A.getHours():(A.getHours()-12));case"h":return A.getHours()<13?A.getHours():(A.getHours()-12);case"HH":return B(A.getHours());case"H":return A.getHours();case"mm":return B(A.getMinutes());case"m":return A.getMinutes();case"ss":return B(A.getSeconds());case"s":return A.getSeconds();case"yyyy":return A.getFullYear();case"yy":return A.getFullYear().toString().substring(2,4);case"dddd":return A.getDayName();case"ddd":return A.getDayName(true);case"dd":return B(A.getDate());case"d":return A.getDate().toString();case"MMMM":return A.getMonthName();case"MMM":return A.getMonthName(true);case"MM":return B((A.getMonth()+1));case"M":return A.getMonth()+1;case"t":return A.getHours()<12?Date.CultureInfo.amDesignator.substring(0,1):Date.CultureInfo.pmDesignator.substring(0,1);case"tt":return A.getHours()<12?Date.CultureInfo.amDesignator:Date.CultureInfo.pmDesignator;case"zzz":case"zz":case"z":return""}}):this._toString()};Date.now=function(){return new Date()};Date.today=function(){return Date.now().clearTime()};Date.prototype._orient=+1;Date.prototype.next=function(){this._orient=+1;return this};Date.prototype.last=Date.prototype.prev=Date.prototype.previous=function(){this._orient=-1;return this};Date.prototype._is=false;Date.prototype.is=function(){this._is=true;return this};Number.prototype._dateElement="day";Number.prototype.fromNow=function(){var A={};A[this._dateElement]=this;return Date.now().add(A)};Number.prototype.ago=function(){var A={};A[this._dateElement]=this*-1;return Date.now().add(A)};(function(){var G=Date.prototype,A=Number.prototype;var M=("sunday monday tuesday wednesday thursday friday saturday").split(/\s/),L=("january february march april may june july august september october november december").split(/\s/),K=("Millisecond Second Minute Hour Day Week Month Year").split(/\s/),J;var I=function(N){return function(){if(this._is){this._is=false;return this.getDay()==N}return this.moveToDayOfWeek(N,this._orient)}};for(var F=0;F<M.length;F++){G[M[F]]=G[M[F].substring(0,3)]=I(F)}var H=function(N){return function(){if(this._is){this._is=false;return this.getMonth()===N}return this.moveToMonth(N,this._orient)}};for(var D=0;D<L.length;D++){G[L[D]]=G[L[D].substring(0,3)]=H(D)}var E=function(N){return function(){if(N.substring(N.length-1)!="s"){N+="s"}return this["add"+N](this._orient)}};var B=function(N){return function(){this._dateElement=N;return this}};for(var C=0;C<K.length;C++){J=K[C].toLowerCase();G[J]=G[J+"s"]=E(K[C]);A[J]=A[J+"s"]=B(J)}}());Date.prototype.toJSONString=function(){return this.toString("yyyy-MM-ddThh:mm:ssZ")};Date.prototype.toShortDateString=function(){return this.toString(Date.CultureInfo.formatPatterns.shortDatePattern)};Date.prototype.toLongDateString=function(){return this.toString(Date.CultureInfo.formatPatterns.longDatePattern)};Date.prototype.toShortTimeString=function(){return this.toString(Date.CultureInfo.formatPatterns.shortTimePattern)};Date.prototype.toLongTimeString=function(){return this.toString(Date.CultureInfo.formatPatterns.longTimePattern)};Date.prototype.getOrdinal=function(){switch(this.getDate()){case 1:case 21:case 31:return"st";case 2:case 22:return"nd";case 3:case 23:return"rd";default:return"th"}};(function(){Date.Parsing={Exception:function(I){this.message="Parse error at '"+I.substring(0,10)+" ...'"}};var A=Date.Parsing;var C=A.Operators={rtoken:function(I){return function(J){var K=J.match(I);if(K){return([K[0],J.substring(K[0].length)])}else{throw new A.Exception(J)}}},token:function(I){return function(J){return C.rtoken(new RegExp("^s*"+J+"s*"))(J)}},stoken:function(I){return C.rtoken(new RegExp("^"+I))},until:function(I){return function(J){var K=[],M=null;while(J.length){try{M=I.call(this,J)}catch(L){K.push(M[0]);J=M[1];continue}break}return[K,J]}},many:function(I){return function(J){var M=[],K=null;while(J.length){try{K=I.call(this,J)}catch(L){return[M,J]}M.push(K[0]);J=K[1]}return[M,J]}},optional:function(I){return function(J){var K=null;try{K=I.call(this,J)}catch(L){return[null,J]}return[K[0],K[1]]}},not:function(I){return function(J){try{I.call(this,J)}catch(K){return[null,J]}throw new A.Exception(J)}},ignore:function(I){return I?function(J){var K=null;K=I.call(this,J);return[null,K[1]]}:null},product:function(){var J=arguments[0],K=Array.prototype.slice.call(arguments,1),L=[];for(var I=0;I<J.length;I++){L.push(C.each(J[I],K))}return L},cache:function(K){var I={},J=null;return function(L){try{J=I[L]=(I[L]||K.call(this,L))}catch(M){J=I[L]=M}if(J instanceof A.Exception){throw J}else{return J}}},any:function(){var I=arguments;return function(K){var L=null;for(var J=0;J<I.length;J++){if(I[J]==null){continue}try{L=(I[J].call(this,K))}catch(M){L=null}if(L){return L}}throw new A.Exception(K)}},each:function(){var I=arguments;return function(K){var N=[],L=null;for(var J=0;J<I.length;J++){if(I[J]==null){continue}try{L=(I[J].call(this,K))}catch(M){throw new A.Exception(K)}N.push(L[0]);K=L[1]}return[N,K]}},all:function(){var J=arguments,I=I;return I.each(I.optional(J))},sequence:function(I,J,K){J=J||C.rtoken(/^\s*/);K=K||null;if(I.length==1){return I[0]}return function(O){var P=null,Q=null;var S=[];for(var N=0;N<I.length;N++){try{P=I[N].call(this,O)}catch(R){break}S.push(P[0]);try{Q=J.call(this,P[1])}catch(M){Q=null;break}O=Q[1]}if(!P){throw new A.Exception(O)}if(Q){throw new A.Exception(Q[1])}if(K){try{P=K.call(this,P[1])}catch(L){throw new A.Exception(P[1])}}return[S,(P?P[1]:O)]}},between:function(J,K,I){I=I||J;var L=C.each(C.ignore(J),K,C.ignore(I));return function(M){var N=L.call(this,M);return[[N[0][0],r[0][2]],N[1]]}},list:function(I,J,K){J=J||C.rtoken(/^\s*/);K=K||null;return(I instanceof Array?C.each(C.product(I.slice(0,-1),C.ignore(J)),I.slice(-1),C.ignore(K)):C.each(C.many(C.each(I,C.ignore(J))),px,C.ignore(K)))},set:function(I,J,K){J=J||C.rtoken(/^\s*/);K=K||null;return function(X){var L=null,N=null,M=null,O=null,P=[[],X],W=false;for(var R=0;R<I.length;R++){M=null;N=null;L=null;W=(I.length==1);try{L=I[R].call(this,X)}catch(U){continue}O=[[L[0]],L[1]];if(L[1].length>0&&!W){try{M=J.call(this,L[1])}catch(V){W=true}}else{W=true}if(!W&&M[1].length===0){W=true}if(!W){var S=[];for(var Q=0;Q<I.length;Q++){if(R!=Q){S.push(I[Q])}}N=C.set(S,J).call(this,M[1]);if(N[0].length>0){O[0]=O[0].concat(N[0]);O[1]=N[1]}}if(O[1].length<P[1].length){P=O}if(P[1].length===0){break}}if(P[0].length===0){return P}if(K){try{M=K.call(this,P[1])}catch(T){throw new A.Exception(P[1])}P[1]=M[1]}return P}},forward:function(I,J){return function(K){return I[J].call(this,K)}},replace:function(J,I){return function(K){var L=J.call(this,K);return[I,L[1]]}},process:function(J,I){return function(K){var L=J.call(this,K);return[I.call(this,L[0]),L[1]]}},min:function(I,J){return function(K){var L=J.call(this,K);if(L[0].length<I){throw new A.Exception(K)}return L}}};var H=function(I){return function(){var J=null,M=[];if(arguments.length>1){J=Array.prototype.slice.call(arguments)}else{if(arguments[0] instanceof Array){J=arguments[0]}}if(J){for(var L=0,K=J.shift();L<K.length;L++){J.unshift(K[L]);M.push(I.apply(null,J));J.shift();return M}}else{return I.apply(null,arguments)}}};var G="optional not ignore cache".split(/\s/);for(var D=0;D<G.length;D++){C[G[D]]=H(C[G[D]])}var F=function(I){return function(){if(arguments[0] instanceof Array){return I.apply(null,arguments[0])}else{return I.apply(null,arguments)}}};var E="each any all".split(/\s/);for(var B=0;B<E.length;B++){C[E[B]]=F(C[E[B]])}}());(function(){var F=function(J){var K=[];for(var I=0;I<J.length;I++){if(J[I] instanceof Array){K=K.concat(F(J[I]))}else{if(J[I]){K.push(J[I])}}}return K};Date.Grammar={};Date.Translator={hour:function(I){return function(){this.hour=Number(I)}},minute:function(I){return function(){this.minute=Number(I)}},second:function(I){return function(){this.second=Number(I)}},meridian:function(I){return function(){this.meridian=I.slice(0,1).toLowerCase()}},timezone:function(I){return function(){var J=I.replace(/[^\d\+\-]/g,"");if(J.length){this.timezoneOffset=Number(J)}else{this.timezone=I.toLowerCase()}}},day:function(I){var J=I[0];return function(){this.day=Number(J.match(/\d+/)[0])}},month:function(I){return function(){this.month=((I.length==3)?Date.getMonthNumberFromName(I):(Number(I)-1))}},year:function(I){return function(){var J=Number(I);this.year=((I.length>2)?J:(J+(((J+2000)<Date.CultureInfo.twoDigitYearMax)?2000:1900)))}},rday:function(I){return function(){switch(I){case"yesterday":this.days=-1;break;case"tomorrow":this.days=1;break;case"today":this.days=0;break;case"now":this.days=0;this.now=true;break}}},finishExact:function(I){I=(I instanceof Array)?I:[I];var J=new Date();this.year=J.getFullYear();this.month=J.getMonth();this.day=1;this.hour=0;this.minute=0;this.second=0;for(var K=0;K<I.length;K++){if(I[K]){I[K].call(this)}}this.hour=(this.meridian=="p"&&this.hour<13)?this.hour+12:this.hour;if(this.day>Date.getDaysInMonth(this.year,this.month)){throw new RangeError(this.day+" is not a valid value for days.")}var L=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second);if(this.timezone){L.set({timezone:this.timezone})}else{if(this.timezoneOffset){L.set({timezoneOffset:this.timezoneOffset})}}return L},finish:function(I){I=(I instanceof Array)?F(I):[I];if(I.length===0){return null}for(var M=0;M<I.length;M++){if(typeof I[M]=="function"){I[M].call(this)}}if(this.now){return new Date()}var J=Date.today();var P=null;var N=!!(this.days!=null||this.orient||this.operator);if(N){var O,L,K;K=((this.orient=="past"||this.operator=="subtract")?-1:1);if(this.weekday){this.unit="day";O=(Date.getDayNumberFromName(this.weekday)-J.getDay());L=7;this.days=O?((O+(K*L))%L):(K*L)}if(this.month){this.unit="month";O=(this.month-J.getMonth());L=12;this.months=O?((O+(K*L))%L):(K*L);this.month=null}if(!this.unit){this.unit="day"}if(this[this.unit+"s"]==null||this.operator!=null){if(!this.value){this.value=1}if(this.unit=="week"){this.unit="day";this.value=this.value*7}this[this.unit+"s"]=this.value*K}return J.add(this)}else{if(this.meridian&&this.hour){this.hour=(this.hour<13&&this.meridian=="p")?this.hour+12:this.hour}if(this.weekday&&!this.day){this.day=(J.addDays((Date.getDayNumberFromName(this.weekday)-J.getDay()))).getDate()}if(this.month&&!this.day){this.day=1}return J.set(this)}}};var B=Date.Parsing.Operators,E=Date.Grammar,D=Date.Translator,H;E.datePartDelimiter=B.rtoken(/^([\s\-\.\,\/\x27]+)/);E.timePartDelimiter=B.stoken(":");E.whiteSpace=B.rtoken(/^\s*/);E.generalDelimiter=B.rtoken(/^(([\s\,]|at|on)+)/);var A={};E.ctoken=function(M){var L=A[M];if(!L){var N=Date.CultureInfo.regexPatterns;var K=M.split(/\s+/),J=[];for(var I=0;I<K.length;I++){J.push(B.replace(B.rtoken(N[K[I]]),K[I]))}L=A[M]=B.any.apply(null,J)}return L};E.ctoken2=function(I){return B.rtoken(Date.CultureInfo.regexPatterns[I])};E.h=B.cache(B.process(B.rtoken(/^(0[0-9]|1[0-2]|[1-9])/),D.hour));E.hh=B.cache(B.process(B.rtoken(/^(0[0-9]|1[0-2])/),D.hour));E.H=B.cache(B.process(B.rtoken(/^([0-1][0-9]|2[0-3]|[0-9])/),D.hour));E.HH=B.cache(B.process(B.rtoken(/^([0-1][0-9]|2[0-3])/),D.hour));E.m=B.cache(B.process(B.rtoken(/^([0-5][0-9]|[0-9])/),D.minute));E.mm=B.cache(B.process(B.rtoken(/^[0-5][0-9]/),D.minute));E.s=B.cache(B.process(B.rtoken(/^([0-5][0-9]|[0-9])/),D.second));E.ss=B.cache(B.process(B.rtoken(/^[0-5][0-9]/),D.second));E.hms=B.cache(B.sequence([E.H,E.mm,E.ss],E.timePartDelimiter));E.t=B.cache(B.process(E.ctoken2("shortMeridian"),D.meridian));E.tt=B.cache(B.process(E.ctoken2("longMeridian"),D.meridian));E.z=B.cache(B.process(B.rtoken(/^(\+|\-)?\s*\d\d\d\d?/),D.timezone));E.zz=B.cache(B.process(B.rtoken(/^(\+|\-)\s*\d\d\d\d/),D.timezone));E.zzz=B.cache(B.process(E.ctoken2("timezone"),D.timezone));E.timeSuffix=B.each(B.ignore(E.whiteSpace),B.set([E.tt,E.zzz]));E.time=B.each(B.optional(B.ignore(B.stoken("T"))),E.hms,E.timeSuffix);E.d=B.cache(B.process(B.each(B.rtoken(/^([0-2]\d|3[0-1]|\d)/),B.optional(E.ctoken2("ordinalSuffix"))),D.day));E.dd=B.cache(B.process(B.each(B.rtoken(/^([0-2]\d|3[0-1])/),B.optional(E.ctoken2("ordinalSuffix"))),D.day));E.ddd=E.dddd=B.cache(B.process(E.ctoken("sun mon tue wed thu fri sat"),function(I){return function(){this.weekday=I}}));E.M=B.cache(B.process(B.rtoken(/^(1[0-2]|0\d|\d)/),D.month));E.MM=B.cache(B.process(B.rtoken(/^(1[0-2]|0\d)/),D.month));E.MMM=E.MMMM=B.cache(B.process(E.ctoken("jan feb mar apr may jun jul aug sep oct nov dec"),D.month));E.y=B.cache(B.process(B.rtoken(/^(\d\d?)/),D.year));E.yy=B.cache(B.process(B.rtoken(/^(\d\d)/),D.year));E.yyy=B.cache(B.process(B.rtoken(/^(\d\d?\d?\d?)/),D.year));E.yyyy=B.cache(B.process(B.rtoken(/^(\d\d\d\d)/),D.year));H=function(){return B.each(B.any.apply(null,arguments),B.not(E.ctoken2("timeContext")))};E.day=H(E.d,E.dd);E.month=H(E.M,E.MMM);E.year=H(E.yyyy,E.yy);E.orientation=B.process(E.ctoken("past future"),function(I){return function(){this.orient=I}});E.operator=B.process(E.ctoken("add subtract"),function(I){return function(){this.operator=I}});E.rday=B.process(E.ctoken("yesterday tomorrow today now"),D.rday);E.unit=B.process(E.ctoken("minute hour day week month year"),function(I){return function(){this.unit=I}});E.value=B.process(B.rtoken(/^\d\d?(st|nd|rd|th)?/),function(I){return function(){this.value=I.replace(/\D/g,"")}});E.expression=B.set([E.rday,E.operator,E.value,E.unit,E.orientation,E.ddd,E.MMM]);H=function(){return B.set(arguments,E.datePartDelimiter)};E.mdy=H(E.ddd,E.month,E.day,E.year);E.ymd=H(E.ddd,E.year,E.month,E.day);E.dmy=H(E.ddd,E.day,E.month,E.year);E.date=function(I){return((E[Date.CultureInfo.dateElementOrder]||E.mdy).call(this,I))};E.format=B.process(B.many(B.any(B.process(B.rtoken(/^(dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|zz?z?)/),function(I){if(E[I]){return E[I]}else{throw Date.Parsing.Exception(I)}}),B.process(B.rtoken(/^[^dMyhHmstz]+/),function(I){return B.ignore(B.stoken(I))}))),function(I){return B.process(B.each.apply(null,I),D.finishExact)});var G={};var C=function(I){return G[I]=(G[I]||E.format(I)[0])};E.formats=function(J){if(J instanceof Array){var K=[];for(var I=0;I<J.length;I++){K.push(C(J[I]))}return B.any.apply(null,K)}else{return C(J)}};E._formats=E.formats(["yyyy-MM-ddTHH:mm:ss","ddd, MMM dd, yyyy H:mm:ss tt","ddd MMM d yyyy HH:mm:ss zzz","d"]);E._start=B.process(B.set([E.date,E.time,E.expression],E.generalDelimiter,E.whiteSpace),D.finish);E.start=function(I){try{var J=E._formats.call({},I);if(J[1].length===0){return J}}catch(K){}return E._start.call({},I)}}());Date._parse=Date.parse;Date.parse=function(A){var B=null;if(!A){return null}try{B=Date.Grammar.start.call({},A)}catch(C){return null}return((B[1].length===0)?B[0]:null)};Date.getParseFunction=function(B){var A=Date.Grammar.formats(B);return function(C){var D=null;try{D=A.call({},C)}catch(E){return null}return((D[1].length===0)?D[0]:null)}};Date.parseExact=function(A,B){return Date.getParseFunction(B)(A)};

/*** AjaxPager.js - 0.0 kb ***/
var AjaxPager=function(B){var A=this;A.boxId=B.boxId;A.className=B.className;A.repeaterId=B.repeaterId;A.page=B.page;A.pageSize=B.pageSize;A.locked=false;A.onComplete=B.onComplete;A.paramKey=AjaxPagerParams.key;A.cache={};if(window.PagersCache==null){window.PagersCache={}}if(!window.PagersCache[B.repeaterId]){window.PagersCache[B.repeaterId]={}}this.ChangePage=function(C){if(window.PagersCache[B.repeaterId]["Page"+C+AjaxPagerParams.key()]!=null){$(A.repeaterId).update(window.PagersCache[B.repeaterId]["Page"+C+AjaxPagerParams.key()]);return }if(!A.locked){A.locked=true;var D={page:C,pageSize:A.pageSize,boxId:A.boxId,className:A.className,repeaterId:A.repeaterId};Object.extend(D,window.AjaxPagerParams||{});new Ajax.Request("/ajax/?a=Pager_NewPage",{method:"post",parameters:D,onSuccess:function(E){window.PagersCache[B.repeaterId]["Page"+C+AjaxPagerParams.key()]=E.responseText;A.page++;$(A.repeaterId).update(E.responseText)},onComplete:function(E){A.locked=false;if(A.onComplete){A.onComplete(A)}}})}}};

/*** Calendar.js - 9.0 kb ***/
var Calendar=function(B){var A=this;this.vars=B;this.holder=null;this.startDate=A.vars.startDate?A.vars.startDate:new Date();this.calendarClass=A.vars.calendarClass?A.vars.calendarClass:"";this.currentDate=A.startDate;this.cells=Array();this.onNext=A.vars.onNext?A.vars.onNext:null;this.onPrevious=A.vars.onPrevious?A.vars.onPrevious:null;this.monthHeader=null;this.month=null;this.init=function(){A.holder=$(A.vars.holderId);A.makeCalendar(A.holder,A.startDate);if(A.vars.onInit){A.vars.onInit(A)}};this.reInit=function(){A.holder=$(A.vars.holderId);A.makeCalendar(A.holder,A.currentDate)};this.clear=function(){A.holder.update("");A.cells=null;A.cells=new Array()};this.Next=function(D){A.clear();var C=new Date();C.setFullYear(A.currentDate.getFullYear(),A.currentDate.getMonth()+1,1);A.currentDate=C;A.makeCalendar(A.holder,C);if(A.onNext){A.onNext(A.cells,new A.Month(A.currentDate.getMonth(),A.currentDate.getFullYear()))}};this.Previous=function(){A.clear();var C=new Date();C.setFullYear(A.currentDate.getFullYear(),A.currentDate.getMonth()-1,1);A.currentDate=C;A.makeCalendar(A.holder,C);if(A.onPrevious){A.onPrevious(A.cells,new A.Month(A.currentDate.getMonth(),A.currentDate.getFullYear()))}};this.Create=function(){A.holder.innerHTML="";A.makeCalendar(A.holder,A.currentDate)};this.makeCalendar=function(F,H){var I=this;this.d=H;this.obj=F;I.month=new A.Month(H.getMonth(),H.getFullYear());A.month=I.month;var K=Builder.node("table",{cellspacing:0,cellpadding:0,"class":A.calendarClass});K.className=A.calendarClass;if(Prototype.Browser.IE){var G=Builder.node("tbody")}var J=Builder.node("tr");J.className=A.calendarClass+"_header";var D=Builder.node("td");if(A.vars.showPrevious){D.innerHTML=(A.vars.nextText?A.vars.prevText:"&lt;&lt;");D.className=A.calendarClass+"_prev";Event.observe(D,"click",function(){A.Previous(H)})}else{D.innerHTML="&nbsp;"}J.appendChild(D);var E=Builder.node("td",{colSpan:5,"class":A.calendarClass+"_month"});E.className=A.calendarClass+"_month";E.innerHTML=I.month.Name+"&nbsp;"+I.month.year;if(A.vars.onClickMonth){Event.observe(E,"click",function(){A.vars.onClickMonth(E,I.month)})}A.monthHeader=E;J.appendChild(E);D=Builder.node("td");if(A.vars.showNext){Event.observe(D,"click",function(){A.Next(H)});D.innerHTML=(A.vars.nextText?A.vars.nextText:"&gt;&gt;");D.className=A.calendarClass+"_next"}else{D.innerHTML="&nbsp;"}J.appendChild(D);if(Prototype.Browser.IE){G.appendChild(J)}else{K.appendChild(J)}J=Builder.node("tr");for(i=0;i<A.WeekDays.length;i++){D=Builder.node("td",{"class":A.calendarClass+"_days"});D.className=A.calendarClass+"_days";D.innerHTML=A.WeekDays[i];J.appendChild(D)}if(Prototype.Browser.IE){G.appendChild(J)}else{K.appendChild(J)}var C=I.month.Weeks();for(i=0;i<C.length;i++){J=Builder.node("tr");for(k=0;k<C[i].length;k++){A.cells.push(C[i][k]);J.appendChild(C[i][k])}if(Prototype.Browser.IE){G.appendChild(J)}else{K.appendChild(J)}}if(Prototype.Browser.IE){K.appendChild(G)}F.appendChild(K);if(A.vars.onCreate){A.vars.onCreate(A)}K=null;J=null;D=null};this.Month=function(E,D){var C=this;this.id=E;this.year=D;this.Days=E!=1?A.MonthDays[C.id]:C.year%4==0?A.MonthDays[C.id]+1:A.MonthDays[C.id];this.date=new Date();this.date.setFullYear(C.year,C.id,1);this.lastDate=new Date();this.lastDate.setFullYear(C.year,C.id,C.Days);this.Name=A.MonthNames[C.id];this.ShortName=A.MonthNames[C.id].substr(0,3);this.StartDay=C.date.getDay();this.firstFullWeek=C.StartDay==0;this.lastFullWeek=(C.StartDay+C.Days)%7-1==-1;this.WeekCount=Math.ceil((C.Days+C.StartDay)/7);this.firstCell=null,this.lastCell=null;this.Weeks=function(){var G=Array();if(C.firstFullWeek){G.push(C.Previous().LastWeek("last"));G.push(C.FirstWeek("this"))}else{G.push(C.Previous().LastWeek("last").concat(C.FirstWeek("this")))}for(j=1;j<C.WeekCount-1;j++){G.push(C.GetWeek(j))}if(C.lastFullWeek){G.push(C.LastWeek("this"));G.push(C.Next().FirstWeek("next"))}else{G.push(C.LastWeek("this").concat(C.Next().FirstWeek("next")))}var F=C.WeekCount+(C.lastFullWeek?1:0)+(C.firstFullWeek?1:0);if(A.vars.onDateSelect){for(j=0;j<F;j++){for(k=0;k<G[j].length;k++){Event.observe(G[j][k],"click",function(){var H={id:this.id,date:new Date(this.getAttribute("value")),cell:this,otherMonth:(this.className.indexOf("last")>=0||this.className.indexOf("next")>=0)};if(A.vars.onDateSelect){A.vars.onDateSelect(H)}})}}}return G};this.GetWeek=function(F){var K=this;var M=Array();K.dated=C.id+1+"/{0}/"+C.year;if(F==0){return C.FirstWeek("this")}if(F==C.WeekCount){return C.LastWeek("this")}var L=7-C.StartDay+1;var H="";for(i=0;i<7;i++){var J=(7*(F-1)+L+i);var G=dateFormat(new Date(K.dated.replace("{0}",J)),"mm/dd/yyyy");var I=Builder.node("td",{id:"cal_"+G.replace(/\//g,""),"class":A.calendarClass+"_thisMonth",value:G,month:"this"});I.appendChild(new Element("span").update(J));M.push(I)}return M};this.LastWeek=function(L){var I=this;var K=Array();I.dated=C.id+1+"/{0}/"+C.year;var F=(C.StartDay+C.Days)%7-1;F=F==-1?6:F;var H="";for(i=C.Days-F;i<=C.Days;i++){var G=dateFormat(new Date(I.dated.replace("{0}",i)),"mm/dd/yyyy");var J=Builder.node("td",{id:"cal_"+G.replace(/\//g,""),"class":A.calendarClass+"_"+L+"Month",value:G,month:L});J.className=A.calendarClass+"_"+L+"Month";J.appendChild(new Element("span").update(i));K.push(J);if(i==C.Days){C.lastCell=J}}return K};this.FirstWeek=function(L){var I=this;var K=Array();I.dated=C.id+1+"/{0}/"+C.year;var F=7-C.StartDay;var H="";for(i=1;i<=F;i++){var G=dateFormat(new Date(I.dated.replace("{0}",i)),"mm/dd/yyyy");var J=Builder.node("td",{id:"cal_"+G.replace(/\//g,""),"class":A.calendarClass+"_"+L+"Month",value:G,month:L});J.className=A.calendarClass+"_"+L+"Month";J.appendChild(new Element("span").update(i));K.push(J);if(i==1){C.firstCell=J}}return K};this.Previous=function(){var F=C.id-1<0?11:C.id-1;var G=F==11?C.year-1:C.year;return new A.Month(F,G)};this.Next=function(){var F=C.id+1>11?0:C.id+1;var G=F==0?C.year+1:C.year;return new A.Month(F,G)}};this.WeekDays=A.vars.WeekDays?A.vars.WeekDays:new Array("S","M","T","W","T","F","S");this.MonthDays=new Array(31,28,31,30,31,30,31,31,30,31,30,31);this.MonthNames=new Array("January","February","March","April","May","June","July","August","September","October","November","December");if(A.vars.autostart||A.vars.autostart==null){A.init()}};var PopupCalendar=function(vars){var g=this;this.vars=vars;this.textBox=$(g.vars.textId);this.trigger=$(g.vars.triggerId);this.holder=$(g.vars.holderId);this.onSelect=vars.onSelect;this.disablePrevious=g.vars.disablePrevious?true:g.vars.disablePrevious;this.calendar=null;this.to=0;this.DisableDate=new Date().setDate(new Date().getDate()-1);this.Show=function(){var pos=g.textBox.cumulativeOffset();g.holder.setStyle({position:"absolute",left:pos.left+"px",top:pos.top+g.textBox.getHeight()+"px"});clearTimeout(g.to);if(!g.holder.visible()){if(Prototype.Browser.IE){g.holder.setStyle({display:"block"})}else{new Effect.toggle(g.holder,"blind",{duration:0.3})}}};this.Hide=function(){g.to=setTimeout(function(){if(g.holder.visible()){new Effect.toggle(g.holder,"blind",{duration:0.2})}},200)};this.init=function(){Event.observe(g.textBox,"focus",function(){g.Show()});Event.observe(g.textBox,"blur",function(){g.Hide()});Event.observe(g.holder,"mouseover",function(){clearTimeout(g.to)});Event.observe(g.holder,"click",function(){clearTimeout(g.to)});Event.observe(g.trigger,"click",function(){if(g.holder.visible()){g.Hide()}else{g.textBox.focus()}});Event.observe(window,"load",function(){document.body.appendChild(g.holder)});g.CreateCalendar();g.PaintCalendar()};this.CreateCalendar=function(){g.calendar=null;g.holder.update("");g.calendar=new Calendar({holderId:g.holder.id,startDate:new Date(g.vars.startDate),calendarClass:"popup_calendar",showPrevious:true,showNext:true,nextText:"►",prevText:"◄",onDateSelect:function(date){g.updateText(date);g.holder.setStyle({display:"none"});if(g.onSelect!=null&&g.onSelect){g.onSelect(date)}},onCreate:function(){if(g.calendar){g.PaintCalendar()}var button=new Element("span",{"class":"popup_today"}).update("Today");button.className="popup_today";Event.observe(button,"click",function(){g.textBox.setValue(dateFormat(new Date(),"mm/dd/yyyy"))});var todayHolder=new Element("div",{"class":"popup_todayHolder"});todayHolder.className="popup_todayHolder";todayHolder.appendChild(button);button=new Element("span",{"class":"popup_today",style:"padding:2px 17px 2px 18px;margin-left:1px;"}).update("Close");button.className="popup_today";Event.observe(button,"click",function(){g.textBox.blur();g.Hide()});todayHolder.appendChild(button);g.holder.appendChild(todayHolder)},onNext:function(){g.textBox.focus()},onPrev:function(){g.textBox.focus()}})};this.PaintCalendar=function(){if(g.DisableDate==null){return }$(g.calendar.cells).each(function(cell){var d=new Date(cell.getAttribute("value"));if(d<=g.DisableDate&&g.disablePrevious){cell.addClassName("popup_cellDisabled")}else{cell.removeClassName("popup_cellDisabled")}})};this.updateText=function(date){if(g.DisableDate&&g.disablePrevious){if(date.date<=g.DisableDate){return }}g.textBox.setValue(dateFormat(date.date,"mm/dd/yyyy"));if(g.vars.endDateId!=""){eval("#{0}.DisableDate = new Date(#{1});#{0}.PaintCalendar();".interpolate({0:g.vars.endDateId,1:date.date.getTime()}))}};this.init()};

/*** Chart.js - 2.0 kb ***/
var ChartClass=Class.create({initialize:function(A){this.originalOptions={showLabels:true,width:685,height:200,cht:"lxy",invalidNumberReplacement:-1,chartDataTag:"chd=e:__,",chartColor:"224499",usePercentMethod:false,title:"",useNegative:false,yRange:false,LabelModulusSkip:1};this.options={};Object.extend(this.options,this.originalOptions);Object.extend(this.options,A||{})},DrawChart:function(E,H,I,B,K){Object.extend(this.options,K||{});var J=new Array();H.each(function(L){if(isNaN(parseInt($(L).down(B).innerHTML))){return }if(J.find(function(M){return M[0]==$(L).down(I).innerHTML})!=undefined){day=J.find(function(M){return M[0]==$(L).down(I).innerHTML});day[1]=parseInt($(L).down(B).innerHTML.sub(",",""))+parseInt(day[1])}else{J.push(new Array($(L).down(I).innerHTML,parseInt($(L).down(B).innerHTML.sub(",",""))))}});var F=0;var D=0;var G=0;var A="http://chart.apis.google.com/chart?";if(this.options.title!=""){A=A+"chtt="+this.options.title}A=A+"&cht="+this.options.cht+"&chco="+this.options.chartColor+"&chm=B,76A4FB,0,0,0&chs="+this.options.width+"x"+this.options.height+"&"+this.options.chartDataTag;J.each(function(L){if(L[1]>D){D=L[1]}if(L[1]<G){G=L[1]}F=F+L[1]});console.log(G);if(this.options.useNegative&&G>=0){this.options.useNegative=false;console.log("turning off negative, there is not any negative numbers in datarange")}if(this.options.useNegative){for(i=0;i<J.length;i++){J[i][1]=J[i][1]+Math.abs(G)}}if(this.options.usePercentMethod){console.log(F+" - Max:"+D);ratio=4095/D;J.each(function(L){L[1]=L[1]*ratio})}J.each(function(L){A=A+Chart.encodeNumber(Math.abs(L[1]))});if(this.options.showLabels){A=A+"&chxt=x";if(this.options.useNegative){A+=",y"}A+="&chxl=0:|";for(i=0;i<J.length;i++){if(i%this.options.LabelModulusSkip==0){A=A+J[i][0].sub(",","%2c")+"|"}else{A+=" |"}}J.each(function(L){});if(this.options.useNegative){A+="|1:|"+G+"|0|"+D;A+="&chg=0,50,1,0"}}console.log(A);var C=new Image();C.src=A;C.onload=function(){$(E).update(C)};Object.extend(this.options,this.originalOptions);return A},encodeNumber:function(B){var E="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-.";var D=new Number(B);if(isNaN(D)){console.log("Value not permitted:"+B);return"-1"}else{if(D<0||D>E.length*E.length-1){return"-1"}}var A=Math.floor(D/E.length);var C=D-E.length*A;return E.charAt(A)+E.charAt(C)}});var Chart=new ChartClass();

/*** Dropdown.js - 5.0 kb ***/
var DropDown=Class.create({initialize:function(A){this.Options=A;this.showing=false;this.Timeout=0;this.Effect=A.effects;this.AlignLeft=A.align==null||A.align=="left"?true:false;this.Padding=A.padding||{top:0,left:0,right:0};this.Shadow=null||A.shadow;this.MaxHeight=A.max||300;this.CloseOnClick=A.closeOnClick!=null&&A.closeOnClick;this.CloseOnMouseout=A.closeOnMouseout!=null&&A.closeOnMouseout;this.ShowOnMouseover=A.showOnMouseover!=null&&A.showOnMouseover;this.Trigger=$(A.trigger);this.BaseElement=A.baseElement=="parent"?this.Trigger.parentNode:A.baseElement=="self"?this.Trigger:$(A.baseElement);this.DisplayElement=$(A.displayElement);this.hideListener=this.Hide.bindAsEventListener(this);this.showFinishListener=this.ShowFinish.bindAsEventListener(this);this.hideFinishListener=this.HideFinish.bindAsEventListener(this);this.HideDropDown=function(){clearTimeout(this.Timeout);this.DisplayElement.setStyle({display:"none"});if(this.Shadow&&this.Shadow.obj){this.Shadow.obj.setStyle({display:"none"})}}.bind(this);this.MakeTrigger()},MakeTrigger:function(){if(this.Trigger==null){return }Event.observe(this.Trigger,"click",this.TriggerClick.bind(this));if(this.ShowOnMouseover){Event.observe(this.Trigger,"mouseover",this.Show.bind(this));this.CloseOnMouseout=true}var A=this;if(this.CloseOnMouseout){Event.observe(this.DisplayElement,"mouseout",function(){A.Timeout=setTimeout(A.Hide.bind(A),300)});Event.observe(this.BaseElement,"mouseout",function(){A.Timeout=setTimeout(A.Hide.bind(A),300)});Event.observe(this.DisplayElement,"mouseover",function(){clearTimeout(A.Timeout)});Event.observe(this.BaseElement,"mouseover",function(){clearTimeout(A.Timeout)});if(this.ShowOnMouseover){Event.observe(this.Trigger,"mouseout",function(){A.Timeout=setTimeout(A.Hide.bind(A),300)});Event.observe(this.Trigger,"mouseover",function(){clearTimeout(A.Timeout)})}}if(!this.CloseOnClick){Event.observe(this.DisplayElement,"click",this.Show.bind(this))}Event.observe(this.BaseElement,"click",function(){this.showing=true});Event.observe(window,"load",this.MoveDisplayElement.bind(this))},TriggerClick:function(){if(this.DisplayElement.getStyle("display")=="block"){this.Hide()}else{this.Show()}},MoveDisplayElement:function(){$(document.body).appendChild(this.DisplayElement);if(this.Shadow!=null){var A=new Element("div").update("&nbsp;");A.setStyle({position:"absolute",opacity:this.Shadow.opacity,background:"#000000",display:"none"});this.Shadow.obj=A;$(document.body).appendChild(A)}},Show:function(){Event.observe(document.body,"click",this.hideListener);this.ShowBegin();var C=this.BaseElement.cumulativeOffset();var A=this.Effect!=null&&this.Effect.show!="none"&&this.Effect.show!=null&&this.DisplayElement.getStyle("display")=="none";var B=C.left+this.DisplayElement.getWidth()>document.viewport.getWidth()||!this.AlignLeft;if(this.DisplayElement.getHeight()>this.MaxHeight){this.DisplayElement.setStyle({height:this.MaxHeight+"px",overflow:"auto"})}this.DisplayElement.setStyle({position:"absolute",top:C.top+this.BaseElement.getHeight()+this.Padding.top+"px",display:"none",zIndex:1000});if(this.AlignLeft){this.DisplayElement.setStyle({left:B?C.left+this.BaseElement.getWidth()-this.DisplayElement.getWidth()+this.Padding.left+"px":C.left+this.Padding.left+"px"})}else{this.DisplayElement.setStyle({right:B?document.viewport.getWidth()-(C.left+this.BaseElement.getWidth())+this.Padding.right+"px":document.viewport.getWidth()-(C.left+this.DisplayElement.getWidth())+this.Padding.right+"px"})}this.showing=true;if(A){Effect.toggle(this.DisplayElement,this.Effect.show,{duration:this.Effect.duration,afterFinish:this.showFinishListener})}else{this.DisplayElement.setStyle({display:"block"});this.ShowFinish()}},ResizeShadow:function(){this.ShowShadow()},ShowShadow:function(){var A=this.DisplayElement.cumulativeOffset();if(A.top==0&&A.left==0){return }this.Shadow.obj.setStyle({top:A.top+this.Shadow.offset+"px",left:A.left+this.Shadow.offset+"px",width:this.DisplayElement.getWidth()+"px",height:this.DisplayElement.getHeight()+"px",display:"block"})},ShowBegin:function(){if(this.Options.onShowBegin){this.Options.onShowBegin(this)}},ShowFinish:function(){if(this.Shadow!=null){this.ShowShadow()}if(this.Options.onShowFinish){this.Options.onShowFinish(this)}},Close:function(){this.Hide()},Hide:function(){if(this.showing){this.showing=false;return }if(this.Shadow!=null&&this.Shadow.obj!=null){this.Shadow.obj.setStyle({display:"none"})}var A=this.Effect!=null&&this.Effect.hide!="none"&&this.Effect.hide!=null&&this.DisplayElement.getStyle("display")=="block";if(A){Effect.toggle(this.DisplayElement,this.Effect.hide,{duration:this.Effect.duration,afterFinish:this.hideFinishListener})}else{this.DisplayElement.setStyle({display:!A?"none":"block"});this.HideFinish()}Event.stopObserving(document.body,"click",this.hideListener)},HideFinish:function(){if(this.Options.onHideFinish){this.Options.onHideFinish(this)}}});var UserDropDown=Class.create(DropDown,{initialize:function($super,A){$super({trigger:"userDropDown_Trigger_"+A,baseElement:"parent",displayElement:"userDropDown_"+A,closeOnClick:false,align:"right",padding:{top:1,left:0,right:0},shadow:{opacity:0.2,offset:2},effects:{show:"blind",hide:"none",duration:0.2},onShowBegin:function(B){B.Trigger.addClassName("userDropDown_Over")},onShowFinish:function(B){},onHideFinish:function(B){B.Trigger.removeClassName("userDropDown_Over")}})}});var PickDeleter=Class.create(DropDown,{initialize:function($super,A){$super({trigger:"pick_games_deletePick"+A,baseElement:"parent",displayElement:"pick_games_deletePick"+A+"_dd",closeOnClick:false,align:"right",padding:{top:1,left:0,right:0},shadow:{opacity:0.2,offset:0.2},effects:{show:"blind",hide:"none",duration:0.2},onShowBegin:function(B){$(B.Trigger).addClassName("deleteOn")},onShowFinish:function(B){$(this.displayElement).select("input.reasonBox")[0].focus()},onHideFinish:function(B){$(B.Trigger).removeClassName("deleteOn")}})}});

/*** DynamicTextBox.js - 1.0 kb ***/
var DynamicBox=Class.create({initialize:function(A){this.div=A;this.HTML=this.div.innerHTML;this.Showing=false;this.hideListener=this.Hide.bindAsEventListener(this);this.showFinishListener=this.ShowFinish.bindAsEventListener(this);this.hideFinishListener=this.HideFinish.bindAsEventListener(this);this.MakeTrigger()},MakeTrigger:function(){Event.observe(this.div,"click",this.Show.bind(this))},Show:function(){if(this.Showing){return }this.Showing=true;var A=this.div.getHeight();this.div.update("");this.div.addClassName("adminClassEditing");this.div.update('<textarea class="dynamicBoxTextArea" style="width:#{1}px;height:#{2}px;">#{0}</textarea>'.interpolate({0:this.HTML,1:this.div.getWidth()-27,2:A}));console.log(this.div.getHeight());var B=this.div.select("textarea")[0];B.focus();var D=new Element("div",{"class":"alignCenter"});this.div.appendChild(D);var C=new Element("input",{type:"button",value:"Save"});Event.observe(C,"click",function(){this.HTML=B.value;new Ajax.Request("/ajax/?a=DynamicTextBox_EditBox",{method:"post",parameters:{boxid:this.div.getAttribute("key"),value:this.HTML},onComplete:function(F){},onSuccess:function(F){this.Hide()}});this.Hide()}.bind(this));var E=new Element("input",{type:"button",value:"Cancel"});Event.observe(E,"click",function(){this.Hide()}.bind(this));D.appendChild(C);D.appendChild(E)},Hide:function(){setTimeout(function(){this.Showing=false}.bind(this),100);this.div.update(this.HTML);this.div.removeClassName("adminClassEditing")},HideFinish:function(){},ShowFinish:function(){}});DynamicBox.LoadDynamicBoxes=function(){Event.observe(window,"load",function(){$(document.body).select('div[rel="dynamic"]').each(function(B){B.addClassName("adminClass");var A=new DynamicBox(B)})})};

/*** Global.js - 5.0 kb ***/
var Global={Initialize:function(){Global.Search.initiate($$("input.search_query").first());Global.Cursor.C=$("loadCursor");document.body.appendChild(Global.Cursor.C)},InitializeAfterLoad:function(){Global.TextboxPretext();Global.Errors.Box=$("errorHolder").select("div")[0];Global.Cursor.Follow();Global.Cursor.Hide()},Cursor:{Follow:function(){this.FX=this.MoveIt.bindAsEventListener(this);Event.observe(window.document,"mousemove",this.FX);if(Global.Cursor.C){Global.Cursor.C.show()}},Stop:function(){Event.stopObserving(window.document,"mousemove",this.FX);setTimeout(function(){if(Global.Cursor.C){Global.Cursor.C.hide()}},10000)},MoveIt:function(C){var B=Event.pointerX(C)+10;var A=Event.pointerY(C)+10;if(Global.Cursor.C){Global.Cursor.C.setStyle({top:A+"px",left:B+"px"})}},Show:function(){if(Global.Cursor.C){Global.Cursor.C.show()}},Hide:function(){setTimeout(function(){if(Global.Cursor.C){Global.Cursor.C.hide()}},100)},FX:null,C:null},TextboxPretext:function(){$(document.body).select('input[type="text"]',"textarea").each(function(C){if(C.getAttribute("preText")!=null){var B=C.getAttribute("preText");C.preTextValue=B;if(B=="___DONE___"){return }C.setAttribute("preText","___DONE___");var A=C.getStyle("color");if(C.value==""||C.value==B){C.value=B;C.setStyle({color:"#999999"})}Event.observe(C,"focus",function(D){if(C.value==B){C.value="";C.setStyle({color:A})}});Event.observe(C,"blur",function(D){if(C.value==""){C.value=B;C.setStyle({color:"#999999"})}})}})},VerifyNumeric:function(F,C,A){var B;if(!C){var C=window.event}if(C.keyCode){B=C.keyCode}else{if(C.which){B=C.which}}var D=String.fromCharCode(B);if(D.blank()){return true}if(!D.match(/^\d+$/)==null){Event.stop(C);return false}var E=$(A);if($F(F).match(/^\d+$/)==null){E.update("Must be numeric");E.show()}else{E.update("");E.hide()}},Errors:{Items:new Array(),Box:null,Add:function(A){Global.Errors.Items.push(A)},Show:function(){console.log("show");Global.Errors.Box.update("");var A=new Element("ul");A.addClassName("errorList");A.update("<h3>The following errors occurred</h3>");$(Global.Errors.Items).each(function(C){var B=new Element("li");B.update(C);A.appendChild(B)});Global.Errors.Items=new Array();Message.Alert(A.innerHTML)},Hide:function(){Global.Errors.Box.hide()}},FixPageForm:function(A){Event.observe(window,"load",function(){if($("aspnetForm")){$("aspnetForm").action=window.location}});if(A===true){if($("aspnetForm")){$("aspnetForm").action=window.location}}},CountCharsDown:function(D,C,A){if(!D){var D=window.event}code=D.keyCode?D.keyCode:D.charCode;var B=C.value.length;switch(code){case 8:case 46:case 27:case 13:case 37:case 38:case 39:case 40:case 9:return true;default:if(B>=A){return false}break}},CountCharsUp:function(D,C,A){var B=A-C.value.length;$(C.id+"_counter").update("(#{length} characters left)".interpolate({length:B}))},FormValues:function(C){var B={};C.select('input:not([type="checkbox"])').each(function(D){if(D.name||D.id){if(D.getAttribute("type")=="radio"&&D.checked){B[D.name?D.name:D.id]=D.value}else{if(D.getAttribute("type")!="radio"){B[D.name?D.name:D.id]=escape(D.value)}}}});C.select("select").each(function(D){if(D.name||D.id){B[D.name?D.name:D.id]=escape(D.options[D.selectedIndex].value)}});C.select("textarea").each(function(D){if(D.name||D.id){B[D.name?D.name:D.id]=escape(D.value)}});C.select('input[type="checkbox"]').each(function(D){if(D.name||D.id){B[D.name?D.name:D.id]=D.checked}});var A="";for(k in B){A+=k.replace(/.+\$.+\$/,"")+"="+B[k]+"&"}return{vars:B,serialize:A}},ShowTooltip:function(D,C,A){C=$(C);var F=C.positionedOffset();var E;if($("toolbox")==null){E=new Element("div",{id:"toolbox"});C.ancestors()[0].insertBefore(E,C)}else{E=$("toolbox")}E.classNames().each(function(G){E.removeClassName(G)});E.addClassName(A);E.update(D);var B=F.left+C.getWidth()+2;if(B+E.getWidth()>window.innerWidth){B=F.left-E.getWidth()-2}E.setStyle({top:F.top+"px",left:B+"px"});$(E).show({duration:800});Event.observe(C,"mouseout",function(G){Global.HideTooltip(E)})},HideTooltip:function(A){$(A).hide({duration:800})},Initalize:function(){alert("deprecated")},Resize:function(E,A){var C={width:0,height:0};var D=parseFloat(E.width)/parseFloat(E.height);var B=E.width>=E.height;if(B){C=E.width>A?{width:A,height:parseInt(A*D)}:{width:E.width,height:E.height}}else{C=E.height>A?{width:parseInt(A*D),height:A}:{width:E.width,height:E.height}}return C},SetUniqueRadioButton:function(A,B){re=new RegExp(A);for(i=0;i<document.forms[0].elements.length;i++){elm=document.forms[0].elements[i];if(elm.type=="radio"){if(re.test(elm.name)){elm.checked=false}}}B.checked=true},Search:{_initiated:false,_defaultWords:"search",initiate:function(A){if(this._initiated||!A){return }this._defaultWords=A.value;Event.observe(A,"click",function(){if(A.value==Global.Search._defaultWords){A.value=""}});Event.observe(A,"keydown",Global.Search.TrapReturn);_initiated=true},Query:function(A){searchString="/search/";searchString+=escape(A);if($$(".searchProductDescription:checked ").length>0){searchString+="/?description=1"}window.location=searchString},TrapReturn:function(B,C){var A=(B.which)?B.which:event.keyCode;if(A==13){Global.Search.Query(this.value);return false}}}};document.observe("dom:loaded",Global.Initialize);Event.observe(window,"load",Global.InitializeAfterLoad);

/*** Lightbox.js - 3.0 kb ***/
var Lightbox={lightboxType:null,lightboxCurrentContentID:null,isOn:false,showBoxString:function(C,B,D){this.setLightboxDimensions(B,D);this.lightboxType="string";var A=$("boxContents");A.innerHTML=C;this.showBox();return false},showBoxImage:function(A){this.lightboxType="image";var C=$("boxContents");var B=document.createElement("img");$(B).identify();C.update("");C.appendChild(B);imgPreload=new Image();imgPreload.src=A;$(imgPreload).identify();if(imgPreload.complete){Lightbox.center("box");B.onload=function(){Lightbox.center("box");Lightbox.showBox()};B.src=A}else{B.onload=function(){Lightbox.center("box");Lightbox.showBox()};B.src=A}return true},showBoxByID:function(E,C,D){this.lightboxType="id";this.lightboxCurrentContentID=E;this.setLightboxDimensions(C,D);var A=$(E);var B=$("boxContents");B.appendChild(A);Element.show(E);this.showBox();return false},showBoxByAJAX:function(A,C,E){this.lightboxType="ajax";this.setLightboxDimensions(C,E);var B=$("boxContents");var D=new Ajax.Updater(B,A,{method:"get"});this.showBox();return false},setLightboxDimensions:function(C,A){var B=this.getPageDimensions();if(C){if(C<B[0]){$("box").style.width=C+"px"}else{$("box").style.width=(B[0]-50)+"px"}}if(A){if(A<B[1]){$("box").style.height=A+"px"}else{$("box").style.height=(B[1]-50)+"px"}}},showBox:function(){Element.show("overlay");Element.show("box");this.isOn=true;this.center("box");Lightbox.recenterer=Event.observe(window,"scroll",function(){Lightbox.center("box")});return false},hideBox:function(){var B=$("boxContents");if(this.lightboxType=="id"){var A=document.getElementsByTagName("body").item(0);Element.hide(this.lightboxCurrentContentID);A.appendChild($(this.lightboxCurrentContentID))}B.innerHTML="";Element.hide("box");Element.hide("overlay");this.isOn=false;return false},getPageDimensions:function(){var C,A;if(window.innerHeight&&window.scrollMaxY){C=document.body.scrollWidth;A=window.innerHeight+window.scrollMaxY}else{if(document.body.scrollHeight>document.body.offsetHeight){C=document.body.scrollWidth;A=document.body.scrollHeight}else{C=document.body.offsetWidth;A=document.body.offsetHeight}}var B,D;if(self.innerHeight){B=self.innerWidth;D=self.innerHeight}else{if(document.documentElement&&document.documentElement.clientHeight){B=document.documentElement.clientWidth;D=document.documentElement.clientHeight}else{if(document.body){B=document.body.clientWidth;D=document.body.clientHeight}}}if(A<D){pageHeight=D}else{pageHeight=A}if(C<B){pageWidth=B}else{pageWidth=C}arrayPageSize=new Array(B,D,pageWidth,pageHeight);return arrayPageSize},center:function(B){if(!this.isOn){return }try{B=document.getElementById(B)}catch(C){return }var F=this.getPageDimensions();var A=F[0];var I=F[1];$("overlay").style.height=F[3]+"px";B.style.position="absolute";B.style.zIndex=99;var G=0;if(document.documentElement&&document.documentElement.scrollTop){G=document.documentElement.scrollTop}else{if(document.body&&document.body.scrollTop){G=document.body.scrollTop}else{if(window.pageYOffset){G=window.pageYOffset}else{if(window.scrollY){G=window.scrollY}}}}var H=Element.getDimensions(B);var E=(A-H.width)/2;var D=(I-H.height)/2+G;E=(E<0)?0:E;D=(D<0)?0:D;B.style.left=E+"px";B.style.top=D+"px";Element.show(B)},init:function(){var B='<div id="overlay" onclick="Lightbox.hideBox()" style="display:none"></div>';B+='<div id="box" style="display:none">';B+='<img id="close" src="/store/images/icons/close.gif" onClick="Lightbox.hideBox()" alt="Close" title="Close this window" />';B+='<div id="boxContents"></div>';B+="</div>";var A=document.getElementsByTagName("body").item(0);new Insertion.Bottom(A,B)}};document.observe("dom:loaded",function(){Lightbox.init();$$("img.lightBox").each(function(A){A.observe("click",function(){Lightbox.showBoxImage(A.src)})})});

/*** Menu.js - 1.0 kb ***/
var Menu=Class.create({initialize:function(A){this.Options=A;this.Holder=$(A.holder);this.DropDowns=new Array();this.Options.tag=this.Options.tag==null?"a":this.Options.tag;this.Options.align=this.Options.align==null?"right":this.Options.align;this.BindLinks(this)},ShowItem:function(B){var A=this.DropDowns.find(function(C){return C.Id=="dd_"+B});console.log(A);A.Show()},BindLinks:function(B){var A=0;this.Holder.select("ul")[0].select(B.Options.tag).each(function(D){if(D.select("span").length==0){return }var E=new StringBuilder();E.Append("menu_");E.Append(D.getAttribute("rel"));var C=new DropDown({trigger:D.select("span")[0],baseElement:"parent",displayElement:E.ToString(),closeOnClick:false,align:B.Options.align,shadow:{opacity:0.2,offset:4},effects:B.Options.effects,closeOnMouseout:true,padding:B.Options.padding,showOnMouseover:B.Options.showOnMouseover,onShowBegin:function(){$(this.DropDowns).each(function(F){if(C.Id!=F.Id){F.HideDropDown();F.BaseElement.removeClassName("menuBarSelected")}});C.BaseElement.addClassName("menuBarSelected")}.bind(this),onHideFinish:function(){C.BaseElement.removeClassName("menuBarSelected")}});C.Id="dd_"+A;A++;this.DropDowns.push(C)}.bind(this))}});

/*** Message.js - 4.0 kb ***/
var Message=Class.create({initialize:function(A){this.options={OverlayColor:"#000000",OverlayOpacity:0.5,OverlayHideOnClick:false,Draggable:false,InnerHTML:"&nbsp;",InnerDom:null,IsMessage:true,onButtonInit:null,Width:"100%"};this.ClickedMessage=false;this.MainButton=null;this.Buttons=new Array();Object.extend(this.options,A||{});this.MakeElements()},MakeElements:function(){if(this.Holder==null){this.Holder=this.MakeHolder()}if(this.Overlay==null){this.Overlay=this.MakeOverlay()}if(this.MessageHolder==null){this.MessageHolder=this.MakeMessageHolder()}if(this.MessageElement==null){this.MessageElement=this.MakeMessageElement()}if(this.options.Draggable){new Draggable(this.MessageElement,{handle:"message_messageTitle"})}},MakeHolder:function(){var B=new Element("div",{"class":"message_holder"});var A=$(document.body).getHeight()>document.viewport.getHeight()?$(document.body).getHeight():document.viewport.getHeight();B.setStyle({width:"100%",height:A+"px",position:"absolute",top:"0px",left:"0px",zIndex:"50",display:"none"});$(document.body).appendChild(B);return B},MakeOverlay:function(){var B=new Element("div",{"class":"message_overlay"});var A=$(document.body).getHeight()>document.viewport.getHeight()?$(document.body).getHeight():document.viewport.getHeight();B.setStyle({background:this.options.OverlayColor,width:"100%",height:A+"px",position:"absolute",top:"0px",left:"0px",zIndex:"51",display:"block",opacity:this.options.OverlayOpacity});if(this.options.OverlayHideOnClick){Event.observe(B,"click",function(){this.Hide()}.bind(this))}this.Holder.appendChild(B);return B},MakeMessageHolder:function(){var B=new Element("div",{"class":"message_messageHolder"});B.setStyle({marginTop:"100px",width:this.options.Width,position:"fixed",zIndex:"52"});if((""+this.options.Width+"").endsWith("px")){var A=(document.viewport.getWidth()-parseInt(this.options.Width))/2;A+="px";B.setStyle({marginLeft:A})}if(this.options.OverlayHideOnClick){Event.observe(B,"click",function(){this.Hide()}.bind(this))}this.Holder.appendChild(B);return B},MakeMessageElement:function(){var B=new Element("div",{"class":"message_messageElement"});if(this.options.IsMessage){B.setStyle({margin:"0px auto",fontSize:"14px",fontWeight:"bold",width:"300px",background:"#FFFFFF",border:"2px solid #D0D0D0"})}else{if(this.options.InnerDom.Css){B.setStyle(this.options.InnerDom.Css)}}Event.observe(B,"click",function(){this.ClickedMessage=true}.bind(this));var E=new Element("div",{"class":"message_messageTitle",rel:"title"}).setStyle({padding:"5px",background:"url(#{0}/images/map03.png) 0px 0px repeat-x".interpolate({0:_HERE}),fontSize:"15px",fontWeight:"bold",color:"#FFFFFF"}).update("Message Box");B.appendChild(E);var A=new Element("div",{"class":"message_messageBody",rel:"body"}).setStyle({padding:"5px",background:"#FFFFFF",fontSize:"12px"}).update("Message");B.appendChild(A);var D=new Element("div",{"class":"message_messageButtons",rel:"buttons"}).setStyle({padding:"5px",background:"#FFFFFF",fontSize:"12px",textAlign:"center"});var C=new Element("a",{"class":"blueButton",rel:"ok_button",href:"javascript:void(0);"}).setStyle({fontWeight:"bold",cursor:"pointer",margin:"0px auto",display:"inline-block"}).update("Ok");Event.observe(C,"click",function(){this.ClickedMessage=false;this.Hide()}.bind(this));this.Buttons.push(C);if(this.options.onButtonInit){this.options.onButtonInit(this.Buttons)}this.MainButton=C;if(this.options.InnerDom&&this.options.InnerDom.Buttons){this.options.InnerDom.Buttons.each(function(F){this.Buttons.push(F)}.bind(this))}this.Buttons.each(function(G,F){G.addClassName("blueButton");D.appendChild(G)}.bind(this));B.appendChild(D);this.MessageHolder.appendChild(B);return B},UpdateTitle:function(A){this.MessageElement.select('div[rel="title"]')[0].update(A)},UpdateMessage:function(B){var A=this.MessageElement.select('div[rel="body"]')[0];if(typeof (B)=="string"){A.update(B)}else{A.update("");A.appendChild(B)}},Show:function(){this.Holder.show();if(this.MainButton){this.MainButton.focus()}},Hide:function(){if(this.ClickedMessage){this.ClickedMessage=false;return }new Effect.Fade(this.Holder,{duration:0.3})}});Message.LightBox=function(D,B){var A={IsMessage:false,Draggable:true,InnerDom:D,OverlayHideOnClick:true,onButtonInit:D.onButtonInit};Object.extend(A,B||{});var C=new Message(A);C.UpdateTitle(D.Title==null?"Box":D.Title);C.UpdateMessage(D.Body);C.Show();return C};Message.Alert=function(C,B){var A=new Message({InnerHTML:C,Draggable:true,OverlayHideOnClick:true});A.UpdateTitle(B==null?"Alert":B);A.UpdateMessage(C);A.Show()};

/*** Product.js - 1.0 kb ***/
var ProductClass=Class.create({initialize:function(A){this.Options=A;this.Adding=false},AddToCart:function(B,D,A,C){if(this.Adding){return }this.Adding=true;if(D<1){alert("Please enter a quantity");Product.Adding=false;return }q=Object.toQueryString({id:B,quantity:D});q2="";requiredOk=true;C.each(function(E){if(E.value==""){new Effect.Shake(E);$(E).focus();requiredOk=false}q2+="&"+E.name+"="+E.value});if(!requiredOk){alert("Please complete all required fields");Product.Adding=false;return false}new Ajax.Request("/ajax/?a=Product_AddToCart",{method:"post",postBody:A+"&"+q+q2,onComplete:function(){Product.Adding=false}})},UpdateSettings:function(A,B){settings=Settings.GetSettings($("configureSettings"));$(A).update("<span>Saving...</span>");new Ajax.Request("/ajax/?a=Product_Update",{method:"post",parameters:{id:B,settings:settings.vars},onSuccess:function(C){if(C.responseJSON.status=="success"){$(A).update("<span>Success</span>");history.back()}},onFailure:function(){$(A).update("<span>Try Again</span>");alert("Sorry, an error occurred.")}})}});var Product=new ProductClass();

/*** Settings.js - 2.0 kb ***/
var Settings={Buttons:{Prev:null,Next:null},CurrentPage:1,MaxPage:6,ShowButtons:true,BuildPreview:true,EditView:false,ChangePage:function(A){if(A>0&&A<=this.MaxPage){if(this.ShowButtons){this.Buttons.Prev.show();this.Buttons.Next.show();this.Buttons.Submit.hide();if(A==1){this.Buttons.Prev.hide()}if(A==this.MaxPage){this.Buttons.Submit.show();this.Buttons.Next.hide()}}$("page"+this.CurrentPage).hide();$("tab"+this.CurrentPage).removeClassName("tabSelected");$("page"+A).show();$("tab"+A).addClassName("tabSelected");this.CurrentPage=A;if(this.BuildPreview){this.BuildPreview()}if(this.EditView){$(this.Items).each(function(B){Settings.ShowDisplay(B)})}}},ChangePageByName:function(A){var B=1;switch(A.toLowerCase()){case"general":valid=true;B=1;break;case"settings":B=2;break;case"sports":B=3;break;case"sportsbooks":B=4;break;default:B=1;break}Settings.ChangePage(B)},ShowEdit:function(C){var A=$$("#"+C+" .right .editBox")[0];var B=$$("#"+C+" .right .displayBox")[0];B.hide();A.show()},ShowDisplay:function(C){var A=$$("#"+C+" .right .editBox")[0];var B=$$("#"+C+" .right .displayBox")[0];B.select("span")[0].innerHTML=this.ItemData[C].GetHtml();B.show();A.hide()},BuildPreview:function(){var B=$("page5");B.update("");B.appendChild(Builder.node("h2",{},"Preview Contest Settings"));var A=new Element("div");A.addClassName("settingsBody");$(this.Items).each(function(D){var C=new Element("div");C.addClassName("previewContainer");var H=new Element("div");H.addClassName("previewHeader");H.update($$("#"+D+" .left h4")[0].innerHTML);var G=new Element("div");G.addClassName("previewDescription");G.update($$("#"+D+" .left span")[0].innerHTML);var E=new Element("div");E.addClassName("previewData");if(Settings.ItemData[D]){var F=Settings.ItemData[D].GetHtml()}F=F==""?'<span style="color: red">#{0}</span>'.interpolate({0:Settings.ItemData[D].Empty.innerHTML}):F;E.update(F);C.appendChild(H);C.appendChild(G);C.appendChild(E);A.appendChild(C)});B.appendChild(A)},PrintValue:function(A){return $(A.obj).value},PrintRadio:function(B){for(var A=0;A<B.obj.length;A++){if(B.obj[A].checked){return B.obj[A].value;break}}return""},PrintCombo:function(A){return A.obj.options[A.obj.selectedIndex].innerHTML},AddSetting:function(A,C,B){this.Items.push(A);this.ItemData[A]={Data:B,GetHtml:function(){return C(B)},Empty:new Element("span",{style:"color: red"}).update(B.empty)}},GetSettings:function(E){var A=E;var D={};A.select('input:not([type="checkbox"])').each(function(F){if(F.name||F.id){if(F.getAttribute("type")=="radio"&&F.checked){D[F.id?F.id:F.name]=F.value}else{if(F.getAttribute("type")!="radio"){D[F.name?F.name:F.id]=escape(F.value)}}}});A.select("select").each(function(F){if(F.name||F.id){D[F.name?F.name:F.id]=escape(F.options[F.selectedIndex].value)}});A.select("textarea").each(function(F){if(F.name||F.id){D[F.name?F.name:F.id]=escape(F.value)}});A.select('input[type="checkbox"]').each(function(F){if(F.name||F.id){D[F.name?F.name:F.id]=F.checked}});var C="";for(k in D){C+=k+"="+D[k]+"&"}var B={};B.vars=C;return B},Items:new Array(),ItemData:{}};

/*** Tooltip.js - 1.0 kb ***/
var Tooltip=Class.create({initialize:function(A){this.options={only:"tooltip",attribute:"title",tooltipId:"tooltipPopup"};this.Tips=new Array();this.Holder=$(this.options.tooltipId);Object.extend(this.options,A||{})}});Tooltip.prototype.BuildTooltipBox=function(){this.Holder=new Element("div",{id:this.options.tooltipId});this.Holder.setStyle({position:"absolute",top:"0px",left:"0px",background:"#FFFFCC",border:"1px solid #FFCC00",padding:"5px",display:"none",maxWidth:"200px",zIndex:100});document.body.appendChild(this.Holder)};Tooltip.prototype.Load=function(){if(this.Holder==null){this.BuildTooltipBox()}$(document.body).select(".#{0}".interpolate({0:this.options.only})).each(function(B,A){var C=B.getAttribute(this.options.attribute);if(C.blank()){return }B[this.options.attribute]="";Event.observe(B,"mouseover",function(){pos=B.cumulativeOffset();this.Holder.setStyle({top:(pos.top+B.getHeight())+"px",left:pos.left+"px"});this.Holder.update(C);this.Holder.show()}.bind(this));Event.observe(B,"mouseout",function(){this.Holder.hide()}.bind(this));this.Tips.push({obj:B,index:A})}.bind(this))};Event.observe(window,"load",function(){var A=new Tooltip();A.Load()});

/*** Transaction.js - 5.0 kb ***/
window.AjaxPagerParams={sort:1,filter:"",cacheKey:1,key:function(){return"#{0}----#{1}----#{2}".interpolate({0:this.sort,1:this.filter,2:this.cacheKey})}};var TransactionLog=Class.create({initialize:function(A){this.options={location:window.location.pathname.endsWith("/")?window.location.pathname:window.location.pathname+"/"};Object.extend(this.options,A||{});this.Filters=new Array();this.Filter=null;this.Points=this.GetPointValue();this.SendingAjax=false},GetPointValue:function(){var A=$("balancebox");if(A==null){return 0}var B=parseInt(A.getAttribute("balance"));return B},AddFilter:function(C,A,F,B,E){var D={obj:$(C),allowMultiple:A,type:F,key:B,value:null,valueFunction:E==undefined?false:E};D.value=this._getFilterValue(D);this.Filters.push(D)},_getFilterValue:function(filter){var ret=null;if(filter.valueFunction){ret=eval(filter.valueFunction)}else{ret=filter.obj.value.blank()?null:filter.obj.value}console.log(ret);if(filter.type==2){ret=filter.obj.value.match(/^0?%%0?$/)?null:filter.obj.value}if(ret!=null){ret=ret.replace(/,{2,}/,",").replace(/(^,+|,$)/,"")}return ret},UpdateValues:function(){this.Filters.each(function(A){A.value=this._getFilterValue(A)}.bind(this))},BuildFilter:function(){var A=new StringBuilder();this.Filters.each(function(B){if(B.value==null||B.value=="Search keyword"){return }A.AppendFormat("#{0}:#{1}",{0:B.key,1:B.value})});return A.ToString("|")},ProcessData:function(A,B){window.location.href="#{0}#/filter/#{1}".interpolate({0:this.options.location,1:A})},DoSort:function(A){AjaxPagerParams.sort=$(A).value;this.Search(null)},Search:function(A){this.UpdateValues();this.Filter=this.BuildFilter();AjaxPagerParams.filter=this.Filter;console.log(this.Filter);var B={};for(k in AjaxPagerParams){if(typeof (AjaxPagerParams[k])=="function"){continue}B[k]=AjaxPagerParams[k]}if(this.AjaxPager!=null){this.AjaxPager.ChangePage(1)}},DisplayGroupedRow:function(B,A){if(A.hasClassName("open")){A.removeClassName("open");new Effect.toggle(B,"Slide",{duration:0.3})}else{A.addClassName("open");new Effect.toggle(B,"Slide",{duration:0.3})}return ;$(A).up("td").select("a").each(function(C){C.removeClassName("open")});if(B.visible()){if(B.hasClassName(cssClass)){new Effect.SlideUp(B,{duration:0.3});A.removeClassName("open");B.removeClassName(cssClass);return }else{new Effect.toggle(B,"Slide",{duration:0.3,limit:1,afterFinish:function(){B.update(data);new Effect.SlideDown(B,{duration:0.3,queue:"end"});A.addClassName("open")}})}}else{B.update(data);new Effect.toggle(B,"Slide",{duration:0.3,queue:"end"});A.addClassName("open")}$w(B.className).each(function(C){B.removeClassName(C)});B.addClassName(cssClass)}});TransactionLog.prototype.HasPoints=function(){return true;this.Points=this.GetPointValue();return this.Points>0};TransactionLog.prototype.ShowTransferBox=function(C,A){if(!this.HasPoints()){Message.Alert("You do not have enough points.","Alert");return }C=$(C);if($("tooltipPopup")){$("tooltipPopup").hide()}if($(A).visible()){return }var D=C.cumulativeOffset();var B=$(A);B.setStyle({top:(D.top+C.getHeight())+"px",left:(D.left-(B.getWidth()-C.getWidth())+10)+"px"});new Effect.Appear(A,{duration:0.2,afterFinish:function(){B.down("div").down("div").down("div").down("input").focus()}})};TransactionLog.prototype.VerifyAmount=function(C,B){var A=parseInt($F(C));if(this.Points<A){$(C).value=0;Message.Alert("You do not have enough points.","Alert");return false}};TransactionLog.prototype.DoTransfer=function(B){B=$(B);if(B.hasClassName("grayButton")){return }if($F(this.TransferUserSearch.options.textbox).blank()){Message.Alert("You must specify a user account.");return }var C={};var A=B.up("table");A.select("input","textarea").each(function(D){C[D.id]=$F(D)});C.transferUser=this.TransferUserSearch.options.textbox.value.split(";").first().strip();if(parseInt(C.transferAmount)==0){Message.Alert("You must specify an amount.");return }B.addClassName("grayButton");if(this.SendingAjax){return }this.SendingAjax=true;new Ajax.Request("/ajax/?a=User_Transfer",{method:"post",parameters:C,onSuccess:function(D){this.ProcessTransfer(D.responseText.evalJSON(false),B)}.bind(this),onComplete:function(D){this.SendingAjax=false}.bind(this),onFailure:function(D){Message.Alert(D.responseText,"Alert");B.removeClassName("grayButton")}.bind(this)})};TransactionLog.prototype.ProcessTransfer=function(B,D){var C="";var A=false;switch(B.status){case 1:C="Transfer is complete.";A=true;break;case 3:C="You have insufficient funds to make this transfer.";break;case 4:C="Invalid Deposit Account";break;case 5:C="Invalid Withdrawl Account";break;default:break}Message.Alert(C,B.status==1?"Complete":"Alert");if(A){new Effect.toggle("transferConsoleHolder","appear",{duration:0.1,afterFinish:function(){D.removeClassName("grayButton");window.location.reload()}})}else{D.removeClassName("grayButton")}};TransactionLog.prototype.Toggle=function(A){A=$(A);new Effect.toggle($(A.parentNode.parentNode).down("div.pointsFilterContent"),"blind",{duration:0.2,afterFinish:function(){if(A.hasClassName("pointsFilterTogglerMin")){A.removeClassName("pointsFilterTogglerMin")}else{A.addClassName("pointsFilterTogglerMin")}}})};TransactionLog.prototype.GetFilterRange=function(C){var A=$(C.parentNode).select('input[type="text"]');var B=$(C.parentNode.parentNode).select('input[type="hidden"]')[0];B.value=A.collect(function(D){return D.value}).join("%%")};TransactionLog.prototype.UpdateCheckboxList=function(D,C){var B=$(C);var A=$(D.parentNode.parentNode);B.value=A.select('input[type="checkbox"]').collect(function(E){if(E.checked){return E.value}}).join(",");B.value=B.value.endsWith(",")?B.value.substring(0,B.value.length-1):B.value};TransactionLog.prototype.ListenToTR=function(){$$("tr.transactionListEntry").each(function(A){$(A).observe("click",function(){})})};var tlog=new TransactionLog();

/*** UserSearch.js - 6.0 kb ***/
var UserSearch=Class.create({initialize:function(A){this.options={textbox:$(A.textboxId),optionsHolder:$(A.holderId),optionsStatus:$(A.holderId).select("div.us_holder_status")[0],holder:$(A.holderId).select("div.us_options")[0],sending:false,lastSearch:"",currentSearch:"",currentSelection:-1,options:new Array(),maxResults:5,maxSelections:1,typeTo:0,to:0,onSelect:null,preText:$(A.textboxId).getAttribute("preText"),mode:A.mode==null?UserSearch.MODE.SINGLE:A.mode};this.SelectedUser=null;this.users={};this.InitEvents()},InitEvents:function(){Event.observe(window,"load",function(){document.body.appendChild(this.options.optionsHolder)}.bind(this));Event.observe(this.options.textbox,"keyup",this.GetKeyUp.bind(this));Event.observe(this.options.textbox,"keydown",this.GetKeyDown.bind(this));Event.observe(document,"click",this.Hide.bind(this));Element.clonePosition(this.options.optionsHolder,this.options.textbox,{setHeight:false,offsetTop:23});setInterval(function(){if(this.Value()!=this.options.preText){this.GetUsers(this.Value().strip())}}.bind(this),300)},Value:function(){var A=$F(this.options.textbox).split(";");return A.length==0?$F(this.options.textbox):A[A.length-1]},Clear:function(){this.options.textbox.value=""},GetKeyDown:function(B){var C=true;var A=B.keyCode?B.keyCode:B.charCode;switch(A){case 9:if(this.options.options.length>1){B.shiftKey?this.SelectPrev():this.SelectNext();C=false;Event.stop(B)}else{this.Hide()}break;case 8:this.options.lastSearch="";this.SelectedUser=null;break;case 13:if(this.options.currentSelection>=0){this.Select();Event.stop(B);return false}Event.stop(B);break;case 37:case 39:case 46:break;default:if(this.options.mode==UserSearch.MODE.SINGLE&&$F(this.options.textbox).indexOf(";")>1){Event.stop(B);return false}break}return true},GetKeyUp:function(C){var B=C.keyCode?C.keyCode:C.charCode;switch(B){case 40:Event.stop(C);if(this.options.options.length>0&&this.options.currentSelection<=this.options.options.length){this.SelectNext()}return false;case 38:Event.stop(C);if(this.options.options.length>0&&this.options.currentSelection>0){this.SelectPrev()}return false;case 27:case 13:if(this.options.currentSelection>=0){this.Select();Event.stop(C);return false}Event.stop(C);break;case 44:case 32:break;case 59:this.Hide();return true;break;case 37:case 39:case 33:case 34:case 36:case 35:case 9:break;case 16:case 17:case 18:case 20:case 46:default:break}var A=this.Value().strip();this.options.currentSearch=A;this.GetUsers(A);this.options.lastSearch=A;return true},HideStatus:function(){this.options.optionsStatus.hide()},UpdateStatus:function(A){this.options.optionsStatus.show();if(!A&&A>0){this.options.optionsStatus.update('<img src="'+_HERE+'/images/spacer.gif" width="1" height="22" /> #{0} User#{1}'.interpolate({0:this.options.options.length==0?"No":this.options.options.length,1:this.options.options.length==1?"":"s"}))}else{this.options.optionsStatus.update(A)}},UpdateHeight:function(B){var A=(B>=8?8*30:B*30)+"px";this.options.holder.setStyle({height:A})},SelectPrev:function(){this.options.currentSelection--;if(this.options.currentSelection<0){this.options.currentSelection=0}var A=this.options.holder.select("div.us_option");this.RemoveSelection();A[this.options.currentSelection].addClassName("us_option_selected");this.options.textbox.focus()},SelectNext:function(){this.options.currentSelection++;if(this.options.currentSelection>this.options.options.length-1){this.options.currentSelection=this.options.options.length-1}var A=this.options.holder.select("div.us_option");this.RemoveSelection();if(A.length>0){A[this.options.currentSelection].addClassName("us_option_selected")}this.options.textbox.focus()},Select:function(A){if(this.options.onSelect){this.options.onSelect(this.options.currentSelection)}this.options.options[this.options.currentSelection].onClick()},Hide:function(){if(this.options.optionsHolder.visible()){new Effect.Fade(this.options.optionsHolder,{duration:0.2,queue:{position:"end",scope:"autocomplete",limit:1}})}this.options.currentSelection=-1},Show:function(){var A=this.options.textbox.cumulativeOffset();this.options.optionsHolder.setStyle({top:(A.top+this.options.textbox.getHeight())+"px",left:A.left+"px",width:this.options.textbox.getWidth()-2+"px",display:"block",position:"absolute",zIndex:"1000"})},MakeOption:function(A){var B=new Element("div",{"class":"us_option"});B.className="us_option";B.update(A.username);return B},BindData:function(A){this.options.holder.update("");this.options.options=new Array();this.options.currentSelection=-1;tmp_counter=0;$(this.users).each(function(B){if(tmp_counter>this.options.maxResults){return }var D=this.MakeOption(B);var C={obj:D,value:B.username,userInfo:B,onClick:function(){this.options.textbox.value="#{0}; #{1} ; ".interpolate({0:this.options.textbox.value.substring(0,this.options.textbox.value.lastIndexOf(";")),1:C.userInfo.username}).replace(new RegExp("^(; |\n)","i"),"");this.options.textbox.focus();this.options.currentSelection=-1;this.options.options=new Array();this.SelectedUser=C.userInfo;this.Hide()}.bind(this)};this.options.options.push(C);Event.observe(D,"click",C.onClick.bind(this));Event.observe(D,"mouseout",function(){this.RemoveSelection();this.options.currentSelection=-1}.bind(this));$(this.options.holder).appendChild(D);tmp_counter++}.bind(this));if(this.options.options.length>0){this.options.currentSelection=-1;this.SelectNext();this.Show()}else{this.options.optionsHolder.hide()}},RemoveSelection:function(){this.options.holder.select("div.us_option_selected").each(function(A){A.removeClassName("us_option_selected")}.bind(this))},GetUsers:function(A){if(this.options.sending||A.length<3||this.options.lastSearch==A){return }if(/^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/.test(A)){this.Hide();return }this.options.sending=true;this.users=null;this.options.lastSearch=A;new Ajax.Request("/ajax/?a=User_SearchUsers",{method:"post",parameters:{key:A},requestHeaders:{Accept:"application/json"},onSuccess:function(B){try{this.users=B.responseText.evalJSON(false).root;var C=this.users;if(this.users!=null){this.BindData(A)}}catch(D){this.Hide()}}.bind(this),onComplete:function(B){this.options.sending=false;this.HideStatus()}.bind(this)})}});UserSearch.MODE={SINGLE:0,MULTI:1};