var DB_mode=!1;function DumpError(a){try{throw a;}catch(b){DumpException(b)}}
function DumpException(a,b){var c="Javascript exception: "+(b?b:"")+" "+a;BR_IsIE()&&(c+=" "+a.name+": "+a.message+" ("+a.number+")");var d="";if("string"==typeof a)d=a+"\n";else for(var e in a)try{d+=e+": "+a[e]+"\n"}catch(f){}d+=DB_GetStackTrace(DumpException.caller);c=c+"\n"+d;if(DB_mode){try{var j=(new Date).getTime()-DB_starttime,g="["+j+"] "+HtmlEscape(c).replace(/\n/g,"<br>")+"<br>",g="<font color=#ff0000><b>Error: "+g+"</b></font>";DB_win.focus()}catch(i){}DB_WriteDebugHtml(g)}else"undefined"!=
typeof log&&log(HtmlEscape(c))}var function_name_re_=/function (\w+)/;function DB_GetStackTrace(a){try{if(!BR_IsIE()&&!BR_IsSafari()&&BR_AgentContains_("mozilla"))return Error().stack;if(!a)return"";var b,c=function_name_re_.exec(""+a);b=c?c[1]:"";b="- "+b+"(";for(c=0;c<a.arguments.length;c++){0<c&&(b+=", ");var d=""+a.arguments[c];40<d.length&&(d=d.substr(0,40)+"...");b+=d}b+=")\n";return b+=DB_GetStackTrace(a.caller)}catch(e){return"[Cannot get stack trace]: "+e+"\n"}}
var DB_starttime,DB_win=null,DB_winopening=!1;
function DB_WriteDebugHtml(a){if(DB_mode)try{if((null==DB_win||DB_win.closed)&&!DB_winopening)try{DB_winopening=!0;DB_win=window.open("","debug","width=700,height=500,toolbar=no,resizable=yes,scrollbars=yes,left=16,top=16,screenx=16,screeny=16");DB_win.blur();DB_win.document.open();DB_winopening=!1;var b="<font color=#ff0000><b>To turn off this debugging window,hit 'D' inside the main caribou window, then close this window.</b></font><br>";DB_WriteDebugHtml(b)}catch(c){}DB_win.document.write(a);DB_win.scrollTo(0,
1E6)}catch(d){}};function BR_AgentContains_(a){return a in BR_AgentContains_cache_?BR_AgentContains_cache_[a]:BR_AgentContains_cache_[a]=-1!=navigator.userAgent.toLowerCase().indexOf(a)}var BR_AgentContains_cache_={};function BR_IsIE(){return BR_AgentContains_("msie")&&!window.opera}function BR_IsSafari(){return BR_AgentContains_("safari")||BR_AgentContains_("konqueror")}function raise(a){if("undefined"!=typeof Error)throw Error(a||"Assertion Failed");throw a;}
function Fail(a){a=a||"Assertion failed";"undefined"!=typeof DumpError&&DumpError(a+"\n");raise(a)}function AssertTrue(a,b){a||(b=b||"Assertion failed",Fail(b))}function AssertEquals(a,b,c){a!=b&&(c=c||"AssertEquals failed: <"+a+"> != <"+b+">",Fail(c))}
function AssertType(a,b,c){if(typeof a!=b){if(a||""==a)try{if(b==AssertTypeMap[typeof a]||a instanceof b)return}catch(d){}var e=void 0===c;e&&("function"==typeof b&&(c=b.toString().match(/^\s*function\s+([^\s\{]+)/))&&(b=c[1]),c="AssertType failed: <"+a+"> not typeof "+b);Fail(c)}}var AssertTypeMap={string:String,number:Number,"boolean":Boolean};
function CreateIFRAME(a,b,c){var d=a.document.getElementById(b);if(!d){var d=a.document.body,e=a.document.createElement("div");d.appendChild(e);d=e;d.innerHTML="<iframe id="+b+" name="+b+" src="+c+"></iframe>";(a=a.document.getElementById(b))||DumpError("Element "+b+" not found.");d=a}return d}
var getScrollTopGetters_={ieQuirks_:function(a){return a.document.body.scrollTop},ieStandards_:function(a){return a.document.documentElement.scrollTop},dom_:function(a){return a.pageYOffset}},getScrollLeftGetters_={ieQuirks_:function(a){return a.document.body.scrollLeft},ieStandards_:function(a){return a.document.documentElement.scrollLeft},dom_:function(a){return a.pageXOffset}};
function GetWindowPropertyByBrowser_(a,b){try{if(BR_IsSafari())return b.dom_(a);if(!window.opera&&"compatMode"in a.document&&"CSS1Compat"==a.document.compatMode)return b.ieStandards_(a);if(BR_IsIE())return b.ieQuirks_(a)}catch(c){}return b.dom_(a)}var amp_re_=/&/g,lt_re_=/</g,gt_re_=/>/g;function HtmlEscape(a){return!a?"":a.replace(amp_re_,"&amp;").replace(lt_re_,"&lt;").replace(gt_re_,"&gt;").replace(quote_re_,"&quot;")}var quote_re_=/\"/g,JS_SPECIAL_RE_=/[\'\\\r\n\b\"<>&\u0085\u2028\u2029]/g;
function JSEscOne_(a){return JSEscOne_.js_escs_[a]}function ToJSString(a){if(!JSEscOne_.js_escs_){var b={"\\":"\\\\","'":"\\047","\u0008":"\\b",'"':"\\042","<":"\\074",">":"\\076","&":"\\046","\n":"\\n","\r":"\\r","\u0085":"\\205","\u2028":"\\u2028","\u2029":"\\u2029"};JSEscOne_.js_escs_=b}return"'"+a.toString().replace(JS_SPECIAL_RE_,JSEscOne_)+"'"}
function CloneEvent(a){var b={};b.clientX=a.clientX;b.clientY=a.clientY;b.pageX=a.pageX;b.pageY=a.pageY;b.type=a.type;b.srcElement=a.srcElement;b.target=a.target;b.cancelBubble=a.cancelBubble;b.explicitOriginalTarget=a.explicitOriginalTarget;b.button=a.button;b.shiftKey=a.shiftKey;b.ctrlKey=a.ctrlKey;return b}function forid_1(a){return document.getElementById(a)}function forid_2(a){return document.all[a]}var forid=document.getElementById?forid_1:forid_2;
function GetFnName(a){AssertTrue(a,"func passed to GetFnName() is undefined");var b;if("name"in a)b=a.name;else{b=/\W*function\s+([\w\$]+)\(/.exec(a);if(!b)throw Error("Cannot extract name from function: "+a);b=b[1];a.name=b}if(!b||"anonymous"==b)throw Error("Anonymous function has no name: "+a);return a.name}
function log(a){try{if(window.parent!=window&&window.parent.log){window.parent.log(window.name+"::"+a);return}}catch(b){}var c=forid("log");c?(a="<p class=logentry><span class=logdate>"+new Date+"</span><span class=logmsg>"+a+"</span></p>",c.innerHTML=a+c.innerHTML):window.status=a};function AS_Assert(){}AS_Assert.raise=function(a){if("undefined"!=typeof Error)throw Error(a||"Assertion Failed");throw a;};AS_Assert.fail=function(a){a=a||"Assertion failed";"undefined"!=typeof DumpError&&DumpError(a+"\n");AS_Assert.raise(a)};AS_Assert.isTrue=function(a,b){a||(void 0===b&&(b="Assertion failed"),AS_Assert.fail(b))};AS_Assert.equals=function(a,b,c){a!=b&&(void 0===c&&(c="AS_Assert.equals failed: <"+a+"> != <"+b+">"),AS_Assert.fail(c))};
AS_Assert.typeOf=function(a,b,c){if(typeof a!=b){if(a||""==a)try{if(b==AS_Assert.TYPE_MAP[typeof a]||a instanceof b)return}catch(d){}void 0===c&&("function"==typeof b&&(c=b.toString().match(/^\s*function\s+([^\s\{]+)/))&&(b=c[1]),c="AS_Assert.typeOf failed: <"+a+"> not typeof "+b);AS_Assert.fail(c)}};AS_Assert.TYPE_MAP={string:String,number:Number,"boolean":Boolean};
AS_Assert.numArgs=function(a,b){var c=AS_Assert.numArgs.caller;c&&c.arguments.length!=a&&(void 0===b&&(b=c.name+" expected "+a+" arguments  but received "+c.arguments.length),AS_Assert.fail(b))};function ICAL_fmtInt(a,b){for(var c=a.toString();c.length<b;)c="0"+c;return c}var ICAL_daysInMonthCache_=[void 0,31,void 0,31,30,31,30,31,31,30,31,30,31];function ICAL_daysInMonth(a,b){if(2!==b)return ICAL_daysInMonthCache_[b];var c=a<<4,d=ICAL_daysInMonthCache_[c];d||(d=Math.round((Date.UTC(a,2,1)-Date.UTC(a,1,1))/864E5),ICAL_daysInMonthCache_[c]=d);return d}var ICAL_firstDayOfWeekInMonthCache_={};
function ICAL_getDayOfWeek(a){var b=a.date-1,c;c=a.year;var a=a.month,d=c<<4|a,e=ICAL_firstDayOfWeekInMonthCache_[d];e||(e=(new Date(c,a-1,1,0,0,0,0)).getDay(),ICAL_firstDayOfWeekInMonthCache_[d]=e);c=e;return(b+c)%7}function ICAL_daysBetween(a,b,c,d,e,f){var j;if(a===d){if(0===(j=b-e))return c-f;if(0>j){j=c-f;do j-=ICAL_daysInMonth(a,b++);while(b<e)}else{j=c-f;do j+=ICAL_daysInMonth(d,e++);while(e<b)}return j}return Math.round((Date.UTC(a,b-1,c)-Date.UTC(d,e-1,f))/864E5)}
function ICAL_Temporal(a,b,c,d,e,f){if(!isNaN(a))this.year=a;if(!isNaN(b))this.month=b;if(!isNaN(c))this.date=c;if(!isNaN(d))this.hour=d;if(!isNaN(e))this.minute=e;if(!isNaN(f))this.second=f}ICAL_Temporal.prototype.year=NaN;ICAL_Temporal.prototype.month=NaN;ICAL_Temporal.prototype.date=NaN;ICAL_Temporal.prototype.hour=NaN;ICAL_Temporal.prototype.minute=NaN;ICAL_Temporal.prototype.second=NaN;ICAL_Temporal.prototype.getDayOfWeek=function(){return ICAL_getDayOfWeek(this)};
ICAL_Temporal.prototype.toString=function(){return void 0!==this.str_?this.str_:this.str_=this.toStringRepresentation_()};function ICAL_DateValue(){}ICAL_DateValue.prototype=new ICAL_Temporal;ICAL_DateValue.prototype.constructor=ICAL_DateValue;function ICAL_Date(a,b,c){AssertTrue(b&&c,"invalid date params: "+b+" "+c);ICAL_Temporal.call(this,a,b,c,NaN,NaN,NaN)}ICAL_Date.prototype=new ICAL_DateValue;ICAL_Date.prototype.constructor=ICAL_Date;
ICAL_Date.now=function(){var a=new Date;return ICAL_Date.create(a.getFullYear(),a.getMonth()+1,a.getDate())};ICAL_Date.prototype.type="Date";ICAL_Date.prototype.toDate=function(){return this};ICAL_Date.prototype.toDateTime=function(){return new ICAL_DateTime(this.year,this.month,this.date,0,0,0)};ICAL_Date.prototype.getComparable=function(){if(void 0===this.cmp_)this.cmp_=86400*((12*(this.year-1970)+this.month<<5)+this.date);return this.cmp_};
ICAL_Date.prototype.toStringRepresentation_=function(){return ICAL_fmtInt(this.year,4)+ICAL_fmtInt(this.month,2)+ICAL_fmtInt(this.date,2)};ICAL_Date.prototype.equals=function(a){return this.constructor===a.constructor&&this.date===a.date&&this.month===a.month&&this.year===a.year};ICAL_Date.cache_={};ICAL_Date.cacheSize_=0;ICAL_Date.MAX_CACHE_SIZE_=200;
ICAL_Date.create=function(a,b,c){var d=86400*((12*(a-1970)+b<<5)+c);if(d in ICAL_Date.cache_)return ICAL_Date.cache_[d];a=new ICAL_Date(a,b,c);a.cmp_=d;ICAL_Date.cacheSize_<ICAL_Date.MAX_CACHE_SIZE_&&(ICAL_Date.cache_[d]=a);return a};function ICAL_DateTime(a,b,c,d,e,f){ICAL_Temporal.call(this,a,b,c,d,e,f)}ICAL_DateTime.prototype=new ICAL_DateValue;ICAL_DateTime.prototype.constructor=ICAL_DateTime;
ICAL_DateTime.now=function(){var a=new Date;return new ICAL_DateTime(a.getFullYear(),a.getMonth()+1,a.getDate(),a.getHours(),a.getMinutes(),a.getSeconds())};ICAL_DateTime.prototype.type="DateTime";ICAL_DateTime.prototype.toDate=function(){return ICAL_Date.create(this.year,this.month,this.date)};ICAL_DateTime.prototype.toDateTime=function(){return this};
ICAL_DateTime.prototype.getComparable=function(){if(void 0===this.cmp_)this.cmp_=60*(60*(24*((12*(this.year-1970)+this.month<<5)+this.date)+this.hour)+this.minute)+this.second;return this.cmp_};ICAL_DateTime.prototype.toStringRepresentation_=function(){return ICAL_fmtInt(this.year,4)+ICAL_fmtInt(this.month,2)+ICAL_fmtInt(this.date,2)+"T"+ICAL_fmtInt(this.hour,2)+ICAL_fmtInt(this.minute,2)+ICAL_fmtInt(this.second,2)};
ICAL_DateTime.prototype.equals=function(a){return this.constructor===a.constructor&&this.date===a.date&&this.month===a.month&&this.year===a.year&&this.hour===a.hour&&this.minute===a.minute&&this.second===a.second};ICAL_DateTime.prototype.clone=function(){var a=new ICAL_DateTime(this.year,this.month,this.date,this.hour,this.minute,this.second);if(void 0!==this.str_)a.str_=this.str_;return a};function ICAL_Time(a,b,c){ICAL_Temporal.call(this,NaN,NaN,NaN,a,b,c)}ICAL_Time.prototype=new ICAL_Temporal;
ICAL_Time.prototype.constructor=ICAL_Time;ICAL_Time.prototype.type="Time";ICAL_Time.prototype.toStringRepresentation_=function(){return"T"+ICAL_fmtInt(this.hour,2)+ICAL_fmtInt(this.minute,2)+ICAL_fmtInt(this.second,2)};ICAL_Time.prototype.equals=function(a){return this.constructor===a.constructor&&this.hour===a.hour&&this.minute===a.minute&&this.second===a.second};ICAL_Time.prototype.getComparable=function(){return 60*(60*this.hour+this.minute)+this.second};
function ICAL_Duration(a,b,c,d){d+=60*(c+60*(b+24*a));a=d/86400|0;d-=86400*a;b=d/3600|0;d-=3600*b;c=d/60|0;d-=60*c;d|=0;ICAL_Temporal.call(this,NaN,NaN,a,b,c,d)}ICAL_Duration.prototype=new ICAL_Temporal;ICAL_Duration.prototype.constructor=ICAL_Duration;ICAL_Duration.prototype.type="Duration";ICAL_Duration.prototype.getComparable=function(){if(void 0===this.cmp_)this.cmp_=60*(60*(24*this.date+this.hour)+this.minute)+this.second;return this.cmp_};
ICAL_Duration.prototype.toStringRepresentation_=function(){var a=this.year?0>this.year?-1:1:this.month?0>this.month?-1:1:this.date?0>this.date?-1:1:this.hour?0>this.hour?-1:1:this.minute?0>this.minute?-1:1:this.second?0>this.second?-1:1:0,b=0>a?"-P":"P";this.year&&(b+=a*this.year+"Y");this.month&&(b+=a*this.month+"N");this.date&&(b+=this.date%7?a*this.date+"D":a*this.date/7+"W");if(this.hour||this.minute||this.second)b+="T";this.hour&&(b+=a*this.hour+"H");this.minute&&(b+=a*this.minute+"M");this.second&&
(b+=a*this.second+"S");a||(b+="0D");return b};ICAL_Duration.prototype.equals=function(a){return this.constructor===a.constructor&&this.date===a.date&&this.hour===a.hour&&this.minute===a.minute&&this.second===a.second};function ical_builderCopy(a){AssertType(a,ICAL_Temporal);var b=new ICAL_DTBuilder;b.year=a.year||0;b.month=a.month||0;b.date=a.date||0;b.hour=a.hour||0;b.minute=a.minute||0;b.second=a.second||0;return b}
function ical_dateBuilder(a,b,c){AssertTrue(!(isNaN(a)|isNaN(b)|isNaN(c)));var d=new ICAL_DTBuilder;d.year=a||0;d.month=b||0;d.date=c||0;return d}function ICAL_DTBuilder(){}ICAL_DTBuilder.prototype=new ICAL_Temporal;ICAL_DTBuilder.prototype.constructor=ICAL_DTBuilder;ICAL_DTBuilder.prototype.type="DTBuilder";ICAL_DTBuilder.prototype.year=ICAL_DTBuilder.prototype.month=ICAL_DTBuilder.prototype.date=ICAL_DTBuilder.prototype.hour=ICAL_DTBuilder.prototype.minute=ICAL_DTBuilder.prototype.second=0;
ICAL_DTBuilder.prototype.getComparable=function(){this.normalize();var a;return a=isNaN(this.hour)?86400*((12*(this.year-1970)+this.month<<5)+this.date):60*(60*(24*((12*(this.year-1970)+this.month<<5)+this.date)+this.hour)+this.minute)+this.second};ICAL_DTBuilder.prototype.advance=function(a){a.date&&(this.date+=a.date);a.hour&&(this.hour+=a.hour);a.minute&&(this.minute+=a.minute);a.second&&(this.second+=a.second)};
ICAL_DTBuilder.prototype.normalize=function(){this.normalizeHMS_();this.normalizeMonth_();for(var a=ICAL_daysInMonth(this.year,this.month);1>this.date;)this.month-=1,this.normalizeMonth_(),a=ICAL_daysInMonth(this.year,this.month),this.date+=a;for(;this.date>a;)this.date-=a,this.month+=1,this.normalizeMonth_(),a=ICAL_daysInMonth(this.year,this.month)};
ICAL_DTBuilder.prototype.normalizeHMS_=function(){var a;0>this.second?(a=Math.ceil(this.second/-60),this.second+=60*a,this.minute-=a):60<=this.second&&(a=Math.floor(this.second/60),this.second-=60*a,this.minute+=a);0>this.minute?(a=Math.ceil(this.minute/-60),this.minute+=60*a,this.hour-=a):60<=this.minute&&(a=Math.floor(this.minute/60),this.minute-=60*a,this.hour+=a);0>this.hour?(a=Math.ceil(this.hour/-24),this.hour+=24*a,this.date-=a):24<=this.hour&&(a=Math.floor(this.hour/24),this.hour-=24*a,this.date+=
a)};ICAL_DTBuilder.prototype.normalizeMonth_=function(){var a;1>this.month?(a=Math.ceil((this.month-1)/-12),this.month+=12*a,this.year-=a):12<this.month&&(a=Math.floor((this.month-1)/12),this.month-=12*a,this.year+=a)};ICAL_DTBuilder.prototype.toDate=function(){this.normalize();return ICAL_Date.create(this.year,this.month,this.date)};ICAL_DTBuilder.prototype.toDateTime=function(){this.normalize();return new ICAL_DateTime(this.year,this.month,this.date,this.hour,this.minute,this.second)};
ICAL_DTBuilder.prototype.toDuration=function(){if(this.year||this.month){var a="Can't convert months or years to ICAL_Duration";DumpError(a);throw a;}return new ICAL_Duration(this.date,this.hour,this.minute,this.second)};
ICAL_DTBuilder.prototype.toString=function(){return"["+(NaN!==this.year?ICAL_fmtInt(this.year,4):"????")+"/"+(NaN!==this.month?ICAL_fmtInt(this.month,2):"??")+"/"+(NaN!==this.date?ICAL_fmtInt(this.date,2):"??")+" "+(NaN!==this.hour?ICAL_fmtInt(this.hour,2):"??")+" "+(NaN!==this.minute?ICAL_fmtInt(this.minute,2):"??")+" "+(NaN!==this.second?ICAL_fmtInt(this.second,2):"??")+"]"};
ICAL_DTBuilder.prototype.equals=function(a){return this.constructor===a.constructor&&this.date===a.date&&this.month===a.month&&this.year===a.year&&this.hour===a.hour&&this.minute===a.minute&&this.second===a.second};
function ICAL_PeriodOfTime(a,b){AssertTrue(a instanceof ICAL_DateTime||a instanceof ICAL_Date);this.start=a;if(b.constructor==ICAL_Duration){var c=ical_builderCopy(a);c.advance(b);this.end=this.start instanceof ICAL_DateTime?c.toDateTime():c.toDate()}else AssertEquals(b.constructor,a.constructor),this.end=b;this.duration=ICAL_DurationBetween(this.end,this.start)}ICAL_PeriodOfTime.prototype.type="PeriodOfTime";
ICAL_PeriodOfTime.prototype.toString=function(){return void 0!==this.str_?this.str_:this.str_=this.start+"/"+this.end};ICAL_PeriodOfTime.prototype.equals=function(a){return this.constructor===a.constructor&&this.start.equals(a.start)&&this.end.equals(a.end)};ICAL_PeriodOfTime.prototype.contains=function(a){return this.start.getComparable()<=a.start.getComparable()&&this.end.getComparable()>=a.end.getComparable()};
function ICAL_PartialPeriodOfTime(a,b){AssertTrue(a instanceof ICAL_PartialDateTime||a instanceof ICAL_PartialDate);this.start=a;AssertEquals(b.constructor,a.constructor);this.end=b;try{this.duration=ICAL_DurationBetween(this.end,this.start)}catch(c){this.duration=null}}ICAL_PartialPeriodOfTime.prototype.type="PartialPeriodOfTime";ICAL_PartialPeriodOfTime.prototype.toStringRepresentation_=function(){return this.start+"/"+this.end};
ICAL_PartialPeriodOfTime.prototype.equals=function(a){return this.constructor===a.constructor&&this.start.equals(a.start)&&this.end.equals(a.end)};
function ICAL_DurationBetween(a,b){if(isNaN(a.year)!=isNaN(b.year)||isNaN(a.hour)!=isNaN(b.hour)){var c="diff("+a+", "+b+")";DumpError(c);throw c;}c=ical_builderCopy(a);isNaN(a.year)?(c.hour-=b.hour,c.minute-=b.minute,c.second-=b.second):(c.year=NaN,c.month=NaN,c.date=ICAL_daysBetween(a.year,a.month,a.date,b.year,b.month,b.date),isNaN(a.hour)||(c.hour-=b.hour,c.minute-=b.minute,c.second-=b.second));return c.toDuration()}function ICAL_PartialDate(a,b,c){this.year=a;this.month=b;this.date=c}
ICAL_PartialDate.prototype=new ICAL_DateValue;ICAL_PartialDate.prototype.constructor=ICAL_PartialDate;ICAL_PartialDate.prototype.type="PartialDate";ICAL_PartialDate.prototype.toDate=function(){return ICAL_Date.create(this.year||0,this.month||1,this.date||1)};ICAL_PartialDate.prototype.toDateTime=function(){return new ICAL_DateTime(this.year||0,this.month||1,this.date||1,0,0,0)};
ICAL_PartialDate.prototype.getComparable=function(){if(void 0===this.cmp_)this.cmp_=86400*((12*(this.year-1970)+this.month<<5)+this.date);return this.cmp_};ICAL_PartialDate.prototype.equals=function(a){return this.constructor===a.constructor&&(this.date===a.date||isNaN(this.date)&&isNaN(a.date))&&(this.month===a.month||isNaN(this.month)&&isNaN(a.month))&&(this.year===a.year||isNaN(this.year)&&isNaN(a.year))};
ICAL_PartialDate.prototype.toStringRepresentation_=function(){return(void 0!==this.year?ICAL_fmtInt(this.year,4):"????")+(void 0!==this.month?ICAL_fmtInt(this.month,2):"??")+(void 0!==this.date?ICAL_fmtInt(this.date,2):"??")};function ICAL_PartialDateTime(a,b,c,d,e,f){this.year=a;this.month=b;this.date=c;this.hour=d;this.minute=e;this.second=f}ICAL_PartialDateTime.prototype=new ICAL_DateValue;ICAL_PartialDateTime.prototype.constructor=ICAL_PartialDateTime;ICAL_PartialDateTime.prototype.type="PartialDateTime";
ICAL_PartialDateTime.prototype.toDate=function(){return ICAL_Date.create(this.year||0,this.month||1,this.date||1)};ICAL_PartialDateTime.prototype.toDateTime=function(){return new ICAL_DateTime(this.year||0,this.month||1,this.date||1,this.hour||0,this.minute||0,this.second||0)};ICAL_PartialDateTime.prototype.getComparable=function(){if(void 0===this.cmp_)this.cmp_=60*(60*(24*((12*(this.year-1970)+this.month<<5)+this.date)+this.hour)+this.minute)+this.second;return this.cmp_};
ICAL_PartialDateTime.prototype.equals=function(a){return this.constructor===a.constructor&&(this.date===a.date||isNaN(this.date)&&isNaN(a.date))&&(this.month===a.month||isNaN(this.month)&&isNaN(a.month))&&(this.year===a.year||isNaN(this.year)&&isNaN(a.year))&&(this.hour===a.hour||isNaN(this.hour)&&isNaN(a.hour))&&(this.minute===a.minute||isNaN(this.minute)&&isNaN(a.minute))&&(this.second===a.second||isNaN(this.second)&&isNaN(a.second))};
ICAL_PartialDateTime.prototype.toStringRepresentation_=function(){return(void 0!==this.year?ICAL_fmtInt(this.year,4):"????")+(void 0!==this.month?ICAL_fmtInt(this.month,2):"??")+(void 0!==this.date?ICAL_fmtInt(this.date,2):"??")+"T"+(void 0!==this.hour?ICAL_fmtInt(this.hour,2):"??")+(void 0!==this.minute?ICAL_fmtInt(this.minute,2):"??")+(void 0!==this.second?ICAL_fmtInt(this.second,2):"??")};var ICAL_todaysDate=void 0,ICAL_todayUpdateListeners=[];
function ICAL_dayOfYear(a,b,c){a=2<b&&29===ICAL_daysInMonth(a,2);return ICAL_dayOfYear.MONTH_START_TO_DOY_[b]+a+c-1}ICAL_dayOfYear.MONTH_START_TO_DOY_=[void 0,0,31,59,90,120,151,181,212,243,273,304,334];
function updateTodaysDate_(){var a=new Date,b=ICAL_todaysDate;ICAL_todaysDate=ICAL_Date.create(a.getFullYear(),a.getMonth()+1,a.getDate());if(b&&!b.equals(ICAL_todaysDate))for(b=0;b<ICAL_todayUpdateListeners.length;++b){var c=ICAL_todayUpdateListeners[b];try{c(ICAL_todaysDate)}catch(d){}}b=new Date(a.getFullYear(),a.getMonth(),a.getDate(),0,0,0,0);b.setDate(b.getDate()+1);a=b.getTime()-a.getTime();if(0>a||18E5<=a)a=18E5;window.setTimeout(updateTodaysDate_,a)}updateTodaysDate_();function LDP_ParsedDate(a,b,c){this.date=a;this.confidence=b;this.specified=c}LDP_ParsedDate.prototype.toString=function(){return this.date.toString()};function LDP_CommonPrefixLength_(a,b){var a=a.toLowerCase(),b=b.toLowerCase(),c=Math.min(a.length,b.length),d;for(d=0;d<c&&!(a.charAt(d)!=b.charAt(d));++d);return d};var CG_DAYS_OF_THE_WEEK="Su,M,Tu,W,Th,F,Sa".split(","),MONTHS=[,"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],FULL_MONTHS=[,"January","February","March","April","May","June","July","August","September","October","November","December"];Function.prototype.bind=function(a,b){if("function"!=typeof this)throw Error("Bind must be called as a method of a function object.");var c=this,d=Array.prototype.splice.call(arguments,1,arguments.length);return function(){for(var b=d.concat(),f=0;f<arguments.length;f++)b.push(arguments[f]);return c.apply(a,b)}};var listen,unlisten,unlistenByKey;
(function(){function a(a){if(null==a.listen_hc_)a.listen_hc_=++e;return a.listen_hc_}function b(b,c,d,e){b=a(b);d=a(d);e=!!e;return c=b+"_"+c+"_"+d+"_"+e}function c(a){var b=Array.prototype.splice.call(arguments,1,arguments.length);return d[a].listener.apply(null,b)}var d={},e=0;listen=function(a,e,g,i){var h=b(a,e,g,i);if(h in d)return h;var k=c.bind(null,h);d[h]={listener:g,proxy:k,event:e,node:a,useCapture:i};if(a.addEventListener)a.addEventListener(e,k,i);else if(a.attachEvent)a.attachEvent("on"+e,
k);else throw Error("Node {"+a+"} does not support event listeners.");return h};unlisten=function(a,c,d,e){a=b(a,c,d,e);return unlistenByKey(a)};unlistenByKey=function(a){if(!(a in d))return!1;var b=d[a],c=b.proxy,e=b.event,h=b.node,b=b.useCapture;h.removeEventListener?h.removeEventListener(e,c,b):h.detachEvent&&h.detachEvent("on"+e,c);delete d[a];return!0}})();function Point(a,b,c){this.x=a;this.y=b;this.coordinateFrame=c||null}Point.prototype.toString=function(){return"[P "+this.x+","+this.y+"]"};Point.prototype.clone=function(){return new Point(this.x,this.y,this.coordinateFrame)};function Delta(a,b){this.dx=a;this.dy=b}Delta.prototype.toString=function(){return"[D "+this.dx+","+this.dy+"]"};function Rect(a,b,c,d,e){this.x=a;this.y=b;this.w=c;this.h=d;this.coordinateFrame=e||null}
Rect.prototype.contains=function(a){return this.x<=a.x&&a.x<this.x+this.w&&this.y<=a.y&&a.y<this.y+this.h};Rect.prototype.toString=function(){return"[R "+this.w+"x"+this.h+"+"+this.x+"+"+this.y+"]"};Rect.prototype.clone=function(){return new Rect(this.x,this.y,this.w,this.h,this.coordinateFrame)};function nodeBounds(a){function b(b){for(var c=a.offsetParent;c&&c.offsetParent;c=c.offsetParent)c.scrollLeft&&(b.x-=c.scrollLeft),c.scrollTop&&(b.y-=c.scrollTop)}if(!a)return null;var c;c=a.ownerDocument&&a.ownerDocument.parentWindow?a.ownerDocument.parentWindow:a.ownerDocument&&a.ownerDocument.defaultView?a.ownerDocument.defaultView:window;if(a.getBoundingClientRect){var d=a.getBoundingClientRect();return new Rect(d.left+GetWindowPropertyByBrowser_(c,getScrollLeftGetters_),d.top+GetWindowPropertyByBrowser_(c,
getScrollTopGetters_),d.right-d.left,d.bottom-d.top,c)}if(a.ownerDocument&&a.ownerDocument.getBoxObjectFor)return d=a.ownerDocument.getBoxObjectFor(a),c=new Rect(d.x,d.y,d.width,d.height,c),b(c),c;for(var e=d=0,f=a;f.offsetParent;f=f.offsetParent)d+=f.offsetLeft,e+=f.offsetTop;c=new Rect(d,e,a.offsetWidth,a.offsetHeight,c);b(c);return c}function nodeLoc(a){if(!a)return null;a=nodeBounds(a);return new Point(a.x,a.y,a.coordinateFrame)}
function GetMousePosition(a){var b=0,c=0;if(a.pageX||a.pageY)b=a.pageX,c=a.pageY;else if(a.clientX||a.clientY)b=a.target?a.target:a.srcElement,c=b.ownerDocument&&b.ownerDocument.parentWindow?b.ownerDocument.parentWindow:window,b=a.clientX+GetWindowPropertyByBrowser_(c,getScrollLeftGetters_),c=a.clientY+GetWindowPropertyByBrowser_(c,getScrollTopGetters_);return new Point(b,c,window)};function DD_CreateSnapToGridConstraint(a){return function(b,c,d,e){var b=nodeBounds(c),f=nodeLoc(c.offsetParent);switch(d){case 1:void 0!==e&&(dd_axisMask&1&&(b.x+=e.dx),dd_axisMask&2&&(b.y+=e.dy));d=a(b);if(!d)return!1;if(dd_axisMask&1)void 0!==e?e.dx+=d.x-b.x+f.x:c.style.left=d.x+"px";if(dd_axisMask&2)void 0!==e?e.dy+=d.y-b.y+f.y:c.style.top=d.y+"px";break;case 2:void 0!==e&&(dd_axisMask&1&&(b.w+=e.dx),dd_axisMask&2&&(b.h+=e.dy));if(void 0===e){e=new Point(b.x+b.w,b.y+b.h,window);d=a(e);if(!d)return!1;
if(dd_axisMask&1){e=d.x-c.offsetLeft;if(0>=e)return!1;c.style.width=e+"px"}if(dd_axisMask&2){e=d.y-c.offsetTop;if(0>=e)return!1;c.style.height=e+"px"}}break;case 5:if(e){d=a(dd_mousePos);if(!d)return!1;if(dd_axisMask&1)e.dx=dd_mousePos.x-d.x<d.w/2?e.dx-(d.x-dd_mousePos.x):e.dx-(d.x+d.w-dd_mousePos.x);if(dd_axisMask&2)e.dy=dd_mousePos.y-d.y<d.h/2?e.dy-(d.y-dd_mousePos.y):e.dy-(d.y+d.h-dd_mousePos.y)}}return!0}}
var DD_GESTURE_THRESHOLD_RADIANS=2*Math.PI/16,dd_dragElement=null,dd_dragType=0,dd_handler=void 0,dd_mousePos=void 0,dd_origMousePos=void 0,dd_startRect=void 0,dd_gesture=void 0,dd_axisMask=void 0,dd_accumulatedDelta=void 0,dd_dragDistance=void 0,dd_originalZIndex=void 0,dd_document=void 0;function _DD_Install(a){a||(a=document);dd_document=a;listen(dd_document.body,"mousedown",DD_Omd)}var dd_handlers=[];function DD_RegisterHandler(a){dd_handlers.push(a)}
function DD_GetHandler(a,b){for(var c=dd_handlers.length-1;0<=c;--c){var d=dd_handlers[c](a,b);if(d)return d}}var dd_mouseDownEvent;function DD_Omd(a){dd_mouseDownEvent=CloneEvent(a||window.event);listen(dd_document.body,"mousemove",DD_Omm);listen(dd_document.body,"mouseup",DD_Omu);return!1}
function DD_Omu(a){if(dd_mouseDownEvent){dd_mouseDownEvent=null;unlisten(dd_document.body,"mousemove",DD_Omm);unlisten(dd_document.body,"mouseup",DD_Omu);for(var b=void 0,c=a.srcElement||a.target;c;c=c.parentNode)if((b=DD_GetHandler(c,a))&&b.handleClick)return b.handleClick(c,a),!1}else a=a||dd_document.parentWindow.event,dd_handler.finishDrag(a,dd_dragElement,dd_dragType)?DD_EndDrag():DD_CancelDrag()}
function DD_Omm(a){if(dd_mouseDownEvent){var b;a:{b=dd_mouseDownEvent;for(var c=void 0,d=b.srcElement||b.target;d;d=d.parentNode)if(c=DD_GetHandler(d,b)){dd_mousePos=GetMousePosition(b);if(c.startDrag(b,d)){if(!dd_dragElement||!(0<=dd_dragType&&6>dd_dragType&&1===1+dd_dragType%1&&dd_axisMask&&0===(dd_axisMask&-4)))d="Bogus drag: el="+dd_dragElement+", type="+dd_dragType+", axis mask="+dd_axisMask,DD_EndDrag(),raise(d);b.cancelBubble=!0;dd_handler=c;dd_origMousePos=dd_mousePos;dd_startRect={x:dd_dragElement.offsetLeft,
y:dd_dragElement.offsetTop,w:dd_dragElement.offsetWidth,h:dd_dragElement.offsetHeight};4===dd_dragType&&(dd_gesture=[dd_mousePos]);dd_accumulatedDelta=new Delta(0,0);dd_dragDistance=new Delta(0,0);if(1===dd_dragType||2===dd_dragType||5===dd_dragType)2!==dd_dragType&&dd_handler.useUserDefinedAlpha&&!dd_handler.useUserDefinedAlpha()&&DD_Alpha(dd_dragElement,!0),dd_originalZIndex=dd_dragElement.style.zIndex,dd_dragElement.style.zIndex=2E3;BR_IsIE()?listen(dd_document.body,"mouseleave",DD_Omo):listen(dd_document.body,
"mouseout",DD_Omo)}else DD_EndDrag();b=!1;break a}b=!0}dd_mouseDownEvent=null;if(b)return DD_CancelDrag(),!0}if(!dd_dragElement)return!0;if(!dd_handler)return!0;c=a||dd_document.parentWindow.event;c.cancelBubble=!0;d=GetMousePosition(c);b=new Delta(d.x-dd_mousePos.x+dd_accumulatedDelta.dx,d.y-dd_mousePos.y+dd_accumulatedDelta.dy);if(!(b.dx|b.dy))return!1;a=new Delta(b.dx,b.dy);dd_mousePos=d;d=nodeLoc(dd_dragElement);dd_axisMask&1&&(dd_dragDistance.dx+=a.dx);dd_axisMask&2&&(dd_dragDistance.dy+=a.dy);
if(dd_handler.handleDragSegment(c,dd_dragElement,dd_dragType,a,dd_dragDistance)){c=nodeLoc(dd_dragElement);dd_dragDistance.dx-=c.x-d.x;dd_dragDistance.dy-=c.y-d.y;switch(dd_dragType){case 1:case 2:case 5:dd_accumulatedDelta.dx=b.dx-a.dx,dd_accumulatedDelta.dy=b.dy-a.dy}switch(dd_dragType){case 1:if(!(dd_axisMask&1))a.dx=0;if(!(dd_axisMask&2))a.dy=0;if((b=dd_dragElement.currentStyle?dd_dragElement.currentStyle:dd_dragElement.ownerDocument.defaultView.getComputedStyle(dd_dragElement,""))&&"relative"==
b.position)dd_dragElement.style.left=dd_dragDistance.dx+"px",dd_dragElement.style.top=dd_dragDistance.dy+"px";else{b=dd_dragElement.offsetLeft+a.dx;c=dd_dragElement.offsetTop+a.dy;if(a.dx)dd_dragElement.style.left=b+"px";if(a.dy)dd_dragElement.style.top=c+"px";if(a.dx&&b!==dd_dragElement.offsetLeft)dd_dragElement.style.left=b+b-dd_dragElement.offsetLeft+"px";if(a.dy&&c!==dd_dragElement.offsetTop)dd_dragElement.style.top=c+c-dd_dragElement.offsetTop+"px"}break;case 5:a=nodeBounds(dd_dragElement);if(dd_axisMask&
1){c=dd_mousePos.x+dd_accumulatedDelta.dx;b=Math.min(c,dd_origMousePos.x);c=Math.abs(c-dd_origMousePos.x);if(b!==a.x&&(dd_dragElement.style.left=b+"px",b!==dd_dragElement.offsetLeft))dd_dragElement.style.left=b+b-dd_dragElement.offsetLeft+"px";if(c!==a.w&&(dd_dragElement.style.width=c+"px",c!=dd_dragElement.offsetWidth))c=Math.max(0,c+c-dd_dragElement.offsetWidth),dd_dragElement.style.width=c+"px"}if(dd_axisMask&2){c=dd_mousePos.y+dd_accumulatedDelta.dy;b=Math.min(c,dd_origMousePos.y);d=Math.abs(c-
dd_origMousePos.y);if(b!==a.y&&(c=b,dd_dragElement.style.top=c+"px",c!==dd_dragElement.offsetTop))dd_dragElement.style.top=c+c-dd_dragElement.offsetTop+"px";if(d!==a.h&&(dd_dragElement.style.height=d+"px",d!=dd_dragElement.offsetHeight))d=Math.max(0,d+d-dd_dragElement.offsetHeight),dd_dragElement.style.height=d+"px"}break;case 2:if(a.dx&&dd_axisMask&1&&(b=dd_dragElement.offsetWidth,c=b+a.dx,0>c&&(dd_accumulatedDelta.dx+=c,c=0),1>c&&(dd_accumulatedDelta.dx+=c-1,c=1),dd_dragElement.style.width=c+"px",
c!=dd_dragElement.offsetWidth))c+=c-dd_dragElement.offsetWidth,1>c&&(c=1),dd_dragElement.style.width=c+"px";if(a.dy&&dd_axisMask&2&&(b=dd_dragElement.offsetHeight,d=b+a.dy,0>d&&(dd_accumulatedDelta.dy+=d,d=0),1>d&&(dd_accumulatedDelta.dy+=d-1,d=1),dd_dragElement.style.height=d+"px",d!=dd_dragElement.offsetHeight))d+=d-dd_dragElement.offsetHeight,1>d&&(d=1),dd_dragElement.style.height=d+"px";break;case 3:if(!(dd_axisMask&1))a.dx=0;if(!(dd_axisMask&2))a.dy=0;if(dd_dragElement.scrollBy)dd_dragElement.scrollBy(a.dx,
a.dy);else{a.dx*=-1;a.dy*=-1;b=dd_dragElement.scrollLeft;var c=dd_dragElement.scrollLeft+dd_dragElement.scrollWidth-dd_dragElement.offsetWidth,d=dd_dragElement.scrollTop,e=dd_dragElement.scrollTop+dd_dragElement.scrollHeight-dd_dragElement.offsetHeight;a.dx=Math.max(Math.min(a.dx,c),-b);a.dy=Math.max(Math.min(a.dy,e),-d);a.dx&&(dd_dragElement.scrollLeft+=a.dx);a.dy&&(dd_dragElement.scrollTop+=a.dy)}break;case 4:if(a.dx|a.dy)1<=dd_gesture.length?(d=a,b=dd_gesture[dd_gesture.length-1],c=new Delta(d.dx+
b.dx,d.dy+b.dy),e=!1,25>=c.dx*c.dx+c.dy*c.dy?e=!0:(d=Math.atan2(d.dx,d.dy),e=Math.atan2(b.dx,b.dy),d=Math.abs((d-e+2*Math.PI)%(2*Math.PI)),e=d<DD_GESTURE_THRESHOLD_RADIANS),e?(b.dx=c.dx,b.dy=c.dy):dd_gesture.push(a)):dd_gesture.push(a),DD_RenderGesture(dd_gesture)}}else DD_CancelDrag();return!1}function DD_Omo(a){a=a||window.event;(a=a.relatedTarget||a.toElement)||DD_CancelDrag()}
function DD_EndDrag(){if(0!==dd_dragType&&(dd_dragElement&&(4===dd_dragType&&DD_RenderGesture([]),dd_handler.dragDone(dd_dragElement,dd_dragType)),1===dd_dragType||2===dd_dragType||5===dd_dragType))2!==dd_dragType&&dd_handler.useUserDefinedAlpha&&!dd_handler.useUserDefinedAlpha()&&DD_Alpha(dd_dragElement,!1),void 0!==dd_originalZIndex?(dd_dragElement.style.zIndex=dd_originalZIndex,dd_originalZIndex=void 0):delete dd_dragElement.style.zIndex;dd_dragElement=null;dd_dragType=0;dd_startRect=dd_mousePos=
void 0;dd_axisMask=0;dd_accumulatedDelta=void 0;dd_handler&&(BR_IsIE()?unlisten(dd_document.body,"mouseleave",DD_Omo):unlisten(dd_document.body,"mouseout",DD_Omo));dd_handler=void 0;unlisten(dd_document.body,"mousemove",DD_Omm);unlisten(dd_document.body,"mouseup",DD_Omu)}
function DD_CancelDrag(){switch(dd_dragType){case 1:var a=dd_dragElement.currentStyle?dd_dragElement.currentStyle:window.getComputedStyle(dd_dragElement,"");a&&"relative"==a.position?(dd_dragElement.style.left="0px",dd_dragElement.style.top="0px"):(dd_dragElement.style.left=dd_startRect.x+"px",dd_dragElement.style.top=dd_startRect.y+"px");break;case 2:dd_dragElement.style.width=dd_startRect.w+"px";dd_dragElement.style.height=dd_startRect.h+"px";break;case 3:break;case 4:dd_gesture=[];break;case 0:break;
case 5:break;default:raise("failed to cancel drag with dd_dragType="+dd_dragType)}DD_EndDrag()}function DD_Alpha(a,b){BR_IsIE()?a.style.filter=b?"alpha(opacity=50)":"alpha(opacity=100)":a.style.MozOpacity=b?0.5:1}var dd_redrawScheduled=!1,dd_toDraw=void 0;function DD_RenderGesture(a){dd_toDraw=a;dd_redrawScheduled||(dd_redrawScheduled=!0,window.setTimeout(DD_DoRender,100))}
function DD_DoRender(){var a=dd_toDraw;dd_toDraw=void 0;dd_redrawScheduled=!1;if(a){var b="";if(a.length)for(var c=a[0].x,d=a[0].y,e=0,f=0,j=1;j<a.length;j++){var g=a[j];if(g.dx|g.dy){0!=j&&(b+="<img class=gestimg src=images/joiner.png width=5 height=5 style=left:"+(c-2)+"px;top:"+(d-2)+"px>");var i=Math.atan2(g.dx,g.dy),h,i=Math.floor(i/(Math.PI/6));switch(i){case 0:case 6:case -6:h="vert.png";break;case 1:case -4:h="negslope.png";break;case 2:case -2:case 3:case -3:h="horz.png";break;case 4:case -1:h=
"posslope.png";break;case 5:case -5:h="vert.png"}var i=Math.max(1,Math.abs(g.dx)),k=Math.max(1,Math.abs(g.dy)),b=b+("<img class=gestimg src=images/"+h+" width="+i+" height="+k+" style=left:"+(c+Math.min(g.dx,0))+"px;top:"+(d+Math.min(g.dy,0))+"px>"),c=c+g.dx,d=d+g.dy,e=Math.max(c,e),f=Math.max(d,f)}}a=forid("gesture");a.style.display="none";a.innerHTML=b;a.style.display="inline"}}function StubDragHandler_(){}StubDragHandler_.prototype.handleDragSegment=function(){throw Error("Unimplemented");};function DD_BaseSelectionHandler(a){this.selection_=(this.selectionContainer_=a)?DD_BaseSelectionHandler.getSelection(a):void 0;this.finished_=!1;this.lasso_=null;this.axisMask_=3}DD_BaseSelectionHandler.getSelection=function(a,b){b=b||[];if(a.className&&a.className.match(/\bddSelected\b/))b.push(a);else for(var c=a.firstChild;c;c=c.nextSibling)DD_BaseSelectionHandler.getSelection(c,b);return b};
DD_BaseSelectionHandler.clearSelection=function(a){for(var a=DD_BaseSelectionHandler.getSelection(a),b=a.length;0<=--b;){var c=a[b];c.className=c.className.replace(/\s*\bddSelected\b/g,"")}return a};DD_BaseSelectionHandler.prototype.initLassoPosition=function(a,b){a.style.left=b.x+"px";a.style.top=b.y+"px";if(this.axisMask_&1)a.style.width="0px";if(this.axisMask_&2)a.style.height="0px"};DD_BaseSelectionHandler.prototype.initLassoStyle=function(a){a.style.display="block"};
DD_BaseSelectionHandler.prototype.startDrag=function(a){var b=forid("ddLasso");if(!b)b=document.createElement("div"),b.id="ddLasso",b.style.position="absolute",b.style.display="none",document.body.appendChild(b);a=GetMousePosition(a);this.initLassoPosition(b,a);this.initLassoStyle(b);dd_dragType=5;dd_axisMask=this.axisMask_;this.lasso_=dd_dragElement=b;var c=this;window.setTimeout(function(){c.finished||c.computeSelection(b)},200);return!0};DD_BaseSelectionHandler.prototype.finishDrag=function(){return!0};
DD_BaseSelectionHandler.prototype.isSelectable=function(a){return a.className&&a.className.match(/\bddSelectable\b/)};DD_BaseSelectionHandler.prototype.computeSelectionHelper=function(a,b,c){if(this.isSelectable(a)){var d=nodeBounds(a);b.x+b.w<d.x||d.x+d.w<b.x||b.y+b.h<d.y||d.y+d.h<b.y||c.push(a)}else for(a=a.firstChild;a;a=a.nextSibling)this.computeSelectionHelper(a,b,c)};
DD_BaseSelectionHandler.prototype.computeSelection=function(a){if(this.selectionContainer_){var b=[];this.computeSelectionHelper(this.selectionContainer_,nodeBounds(a),b);this.setSelection(b);if(!this.finished_){var c=this;window.setTimeout(function(){c.finished||c.computeSelection(a)},200)}}};
DD_BaseSelectionHandler.prototype.setSelection=function(a){for(var b=this.selection_,c=a.length;0<=--c;)a[c].dd_newSelection=!0;for(c=b.length;0<=--c;){var d=b[c];d.dd_oldSelection=!0;if(!d.dd_newSelection)d.className=d.className.replace(/\s*\bddSelected\b/g,"")}for(c=a.length;0<=--c;){d=a[c];if(!d.dd_oldSelection)d.className=(d.className||" ")+" ddSelected";d.dd_newSelection=!1}for(c=b.length;0<=--c;)b[c].dd_oldSelection=!1;this.selection_=a};DD_BaseSelectionHandler.prototype.handleDragSegment=function(){return!0};
DD_BaseSelectionHandler.prototype.dragDone=function(a){this.finished_=!0;this.computeSelection(a);a.style.display="none"};function DD_SnapSelectionHandler(a,b){DD_BaseSelectionHandler.call(this,a);this.snapConstraints_=DD_CreateSnapToGridConstraint(b);this.gridFn=b}DD_SnapSelectionHandler.prototype=new DD_BaseSelectionHandler(void 0);DD_SnapSelectionHandler.prototype.constructor=DD_SnapSelectionHandler;
DD_SnapSelectionHandler.prototype.handleDragSegment=function(a,b,c,d){return DD_BaseSelectionHandler.prototype.handleDragSegment(a,b,c,d)&&this.snapConstraints_(a,b,c,d)};DD_SnapSelectionHandler.prototype.startDrag=function(a,b){if(DD_BaseSelectionHandler.prototype.startDrag.call(this,a,b)){var c=this.gridFn(dd_mousePos,!0);if(dd_axisMask&1)dd_mousePos.x=dd_mousePos.x-c.x<c.w>>1?c.x:c.x+c.w;if(dd_axisMask&2)dd_mousePos.y=dd_mousePos.y-c.y<c.h>>1?c.y:c.y+c.h;return!0}return!1};function PopupController(){this.activePopups_=[]}function _PC_Install(a){if(gPopupControllerInstalled)return!1;gPopupControllerInstalled=!0;a=a?a:document;listen(a.body,"mousedown",PC_notifyPopups);return!0}function PC_notifyPopups(a){if(0==gPopupController.activePopups_.length)return!1;for(var a=a||window.event,b=gPopupController.activePopups_.length-1;0<=b;--b){var c=gPopupController.activePopups_[b];PC_assertIsPopup(c);c.deactivate(a)&&gPopupController.activePopups_.splice(b,1)}return!0}
function PC_assertIsPopup(a){AssertType(a.deactivate,Function,"popup missing deactivate function")}var gPopupController=new PopupController,gPopupControllerInstalled=!1;function DP_DatePicker(a,b,c,d,e){AssertTrue(a,"element passed to DP_DatePicker constructor is null");this.div_=a;this.id_=c?c:this.div_.id+"_";this.class_=d?d:"DP_";DP_DatePicker.dp_cache_[this.id_]=this;e?(AssertType(e,ICAL_Date,"opt_today is not an ICAL_Date"),this.today_=e):this.today_=ICAL_Date.now();this.dispDate_=ICAL_Date.create(this.today_.year,this.today_.month,1);this.firstDay_=0;this.evenMonthHeading_=!!b;this.useDayHeaders_=!1;this.nextMonth_=this.prevMonth_=null;this.dateToCellMap_=
{};this.id2NextMap_={};this.id2PrevMap_={};this.id2DateMap_={};this.lastCell_=this.firstCell_=null;this.selectionListeners_=new ListenerList(this);this.monthChangeListeners_=new ListenerList(this);this.isVisible_=this.showSelection_=!1;this.selectedDates_=new DateSet;this.numWeeks_=0;this.decorator_=null;this.allowMonthChange_=this.showFullWeeks_=!0;this.populateHtml();this.snapToWeek_=!1;this.setSelectionMode(0);this.setClickMode(0);this.setWeekdayString(CG_DAYS_OF_THE_WEEK);this.setFullMonths(FULL_MONTHS);
this.setMonths(MONTHS);this.ignoringDrags_=!1;this.lastDragEvent_=this.rangeEndDate_=this.rangeStartDate_=this.dragEndCell_=this.dragStartCell_=this.fudgeFactor_=null;this.inDrag_=!1;this.viewableEndDate_=this.viewableStartDate_=null;var f=this,a=function(a){var b=a.startDate,a=a.endDate,b=b?!a||b.equals(a)?"Selected: "+f.formatDate(b,!0):"Selected: "+f.formatDate(b)+" - "+f.formatDate(a):DP_DatePicker.DATE_SELECTION[this.selectionMode_];f.printStatus(b)};this.showSelection_&&this.addSelectionListener(a);
this.loggers_=new ListenerList(this)}DP_DatePicker.DATE_SELECTION={};DP_DatePicker.DATE_SELECTION[0]="Select a date";DP_DatePicker.DATE_SELECTION[1]="Select a range of dates";DP_DatePicker.DATE_SELECTION[2]="Select dates";DP_DatePicker.DATE_SELECTION[3]="&nbsp;";DP_DatePicker.prototype.setClickMode=function(a,b){if(0!=a&&1!=a&&7!=a&&30!=a&&-1!=a&&!(b instanceof Function))throw Error("Invalid click mode: "+a);this.clickMode_=a;this.clickFunc_=b};
DP_DatePicker.prototype.setUseDayHeaders=function(a){if(a!=this.useDayHeaders_)this.useDayHeaders_=a,this.populateHtml()};DP_DatePicker.prototype.setWeekdayString=function(a){this.weekdayString_=a;this.populateHtml()};DP_DatePicker.prototype.getClickMode=function(){return this.clickMode_};DP_DatePicker.prototype.setSelectionMode=function(a){0<=a&&3>=a||Fail("Invalid selection mode: "+a);if(this.selectionMode_!=a)this.selectionMode_=a,this.clearSelections()};
DP_DatePicker.prototype.getSelectionMode=function(){return this.selectionMode_};DP_DatePicker.prototype.show=function(){this.isVisible_=!0;this.populateHtml()};DP_DatePicker.prototype.hide=function(){this.div_.innerHTML="";this.isVisible_=!1};DP_DatePicker.prototype.isVisible=function(){return this.isVisible_};DP_DatePicker.prototype.getTableNode=function(){return forid(this.id_+"tbl")};
DP_DatePicker.prototype.setFirstDayOfWeek=function(a){AssertTrue(0<=a&&6>=a,a+" not a valid first day of week");this.firstDay_=a;this.populateHtml()};DP_DatePicker.prototype.getFirstDayOfWeek=function(){return this.firstDay_};DP_DatePicker.prototype.setDecoratorInline=function(a){a&&AssertType(a,Function);this.decoratorInline_=a};DP_DatePicker.prototype.getAllowMonthChange=function(){return this.allowMonthChange_};
DP_DatePicker.prototype.setPrevMonthHtmlFn=function(a){AssertType(a,Function);this.prevMonthHtmlFn_=a};DP_DatePicker.prototype.setCurMonthHtmlFn=function(a){AssertType(a,Function);this.curMonthHtmlFn_=a};DP_DatePicker.prototype.setNextMonthHtmlFn=function(a){AssertType(a,Function);this.nextMonthHtmlFn_=a};DP_DatePicker.prototype.setMonths=function(a){this.months_=a;this.populateHtml()};DP_DatePicker.prototype.getMonths=function(){return this.months_};
DP_DatePicker.prototype.setFullMonths=function(a){this.fullMonths_=a;this.populateHtml()};
DP_DatePicker.prototype.populateHtml=function(){if(this.isVisible_){var a=this.id_,b,c=this.dispDate_.month;b=this.dispDate_.year;var d=[1==c?12:c-1,c,12==c?1:c+1],e=ICAL_Date.create(this.today_.year,this.today_.month,1),f=ical_dateBuilder(b,c-1,1).toDate(),j=ical_dateBuilder(b,c+1,1).toDate();if(this.prevMonthHtmlFn_)d[0]=this.prevMonthHtmlFn_(f);else{var g=f.getComparable()>=e.getComparable()?"&laquo;":"&lsaquo;&nbsp;";d[0]=g+this.months_[d[0]]}d[1]=this.curMonthHtmlFn_?this.curMonthHtmlFn_(this.dispDate_):
this.fullMonths_[d[1]]+" "+b;this.nextMonthHtmlFn_?d[2]=this.nextMonthHtmlFn_(j):(e=0>=j.getComparable()-e.getComparable()?"&raquo;":"&nbsp;&rsaquo;",d[2]=this.months_[d[2]]+e);var i=ICAL_daysInMonth(b,c),g=ICAL_daysInMonth(f.year,f.month),e=Array(49),h=this.dispDate_.getDayOfWeek()-this.firstDay_;0>h&&(h+=7);if(30>i||5>h)h+=7;for(var k=0;k<h;++k)e[k]=ICAL_Date.create(f.year,f.month,g-h+k+1);k=h;for(g=0;g<i;++k)e[k]=ICAL_Date.create(b,c,++g);k=h+i;for(g=0;k<e.length;++k)e[k]=ICAL_Date.create(j.year,
j.month,++g);this.viewableStartDate_=e[0];this.viewableEndDate_=e[e.length-1];var l=[],g=this.evenMonthHeading_?[2,3,2]:[1,5,1];l.push('<table cols=7 cellspacing="0" cellpadding="3" id="',a,'tbl"',' class="',this.class_,'monthtable" ',' style="-moz-user-select:none; cursor:pointer;">','<tr class="',this.class_,'heading" id="',a,'header">',"<td colspan=",g[0]," unselectable=on",' onmousedown="'+GetFnName(_DP_staticPrevMonth)+"(",ToJSString(this.id_),')"',' id="',a,'mhl" class="',this.class_,'prev">',
d[0],"</td>","<td colspan=",g[1],' unselectable="on"',' id="',a,'mhc" class="',this.class_,'cur">',d[1],"</td>","<td colspan=",g[2],' unselectable="on"',' onmousedown="'+GetFnName(_DP_staticNextMonth)+"(",ToJSString(this.id_),')"',' id="',a,'mhr" class="',this.class_,'next">',d[2],"</td>","</tr>");if(this.useDayHeaders_){l.push('<tr class="',this.class_,'days" id="',a,'dow">');for(k=0;k<this.weekdayString_.length;++k)l.push('<td unselectable="on"',' class="',this.class_,'dayh" id="',a,"day_",k,'">',
this.weekdayString_[(k+this.firstDay_)%7],"</td>");l.push("</tr>")}var d=(7-this.firstDay_)%7,o=(d+6)%7;this.dateToCellMap_={};for(var m=null,p=GetFnName(_DP_staticCellClicked),k=0,g=-1;7>k;++k){l.push('<tr id="',a,"week_",k,'">');for(var n=0;n<this.weekdayString_.length;++n){++g;var q=this.selectedDates_.contains(e[g]),m=[];0==k&&m.push(this.class_+"day_top");0==n?m.push(this.class_+"day_left"):6==n&&m.push(this.class_+"day_right");m.push(this.class_+"week"+(n==d||n==o?"end":"day")+(q?"_selected":
""));g<h||g>=h+i?(m.push(this.class_+"offmonth"),7>=e[g].date&&(m.push(this.class_+"month_top"),1==e[g].date&&0!=n&&m.push(this.class_+"month_left"))):(m.push(this.class_+"onmonth"),7>=e[g].date&&(m.push(this.class_+"month_top"),1==e[g].date&&0!=n&&m.push(this.class_+"month_left")),e[g].date==this.today_.date&&c==this.today_.month&&b==this.today_.year&&m.push(this.class_+"today"+(q?"_selected":"")));q="";if(this.decoratorInline_){var r=this.decoratorInline_(e[g]);r&&(q=' style="'+r+'"')}l.push('<td id="',
a,"day_",k,"_",n,'"',' class="',m.join(" "),'"',q,' onclick="',p,'(this)"',' unselectable="on">',e[g].date,"</td>")}l.push("</tr>")}this.showSelection_&&l.push('<tr class="',this.class_,'months">','<td colspan="7" id="',a,'sel"></td></tr>');l.push("</table>");this.div_.innerHTML=l.join("");this.firstCell_=forid(a+"day_0_0");this.lastCell_=forid(a+"day_6_6");b=this.firstCell_;i=b.parentNode;k=h=null;for(l=g=-1;null!=i;){++l;if(7==l)break;for(d=-1;null!=b;)++g,++d,o=a+"day_"+l+"_"+d,this.id2DateMap_[o]=
e[g],this.dateToCellMap_[e[g].toString()]=b,(this.id2PrevMap_[o]=h)&&(this.id2NextMap_[k]=b),h=b,k=o,b=b.nextSibling;i=i.nextSibling;if(null!=i)b=i.firstChild}this.numWeeks_=7;if(!this.showFullWeeks_)if(e=forid(a+"week_4"),g=forid(a+"week_5"),b=forid(a+"week_6"),this.id2DateMap_[a+"day_4_0"].month!=c)e.style.display="none",g.style.display="none",b.style.display="none",this.numWeeks_=4;else if(this.id2DateMap_[a+"day_5_0"].month!=c)g.style.display="none",b.style.display="none",this.numWeeks_=5;else if(this.id2DateMap_[a+
"day_6_0"].month!=c)b.style.display="none",this.numWeeks_=6;this.prevMonth_=f;this.nextMonth_=j;this.decorator_&&this.decorator_.call(null,this);this.addListeners_()}};DP_DatePicker.prototype.refresh=function(){this.decorator_&&this.decorator_.call(null,this)};DP_DatePicker.prototype.addSelectionListener=function(a){return this.selectionListeners_.add(a)};
DP_DatePicker.prototype.clearSelections=function(a){for(var a=0===arguments.length||a,b=this.selectedDates_.asArray(),c=0;c<b.length;++c){var d=this.dateToCellMap_[b[c].toString()];this.setDotSelection_(d,!1)}this.selectedDates_.clear();this.inDrag_||(this.setDragStartCell(null),this.setDragEndCell(null));a&&this.fireSelectionEvent()};
DP_DatePicker.prototype.cellClicked_=function(a){if(this.clickFunc_)this.clickFunc_.call(null,a);else{var b=forid(a),c=this.selectedDates_;switch(this.selectionMode_){case 1:var d=this.getClickMode();if(0==d)break;if(1!=d&&(-1!=d||!c.contains(this.id2DateMap_[a]))){var a=this.id2DateMap_[b.id],e=NaN;switch(d){case -1:7<c.getSize()&&this.isSnapToWeek()&&(b=b.id.substr(b.id.length-3,1),a=this.id2DateMap_[this.id_+"day_"+b+"_0"]);e=c.getSize()-1;break;case 7:b=b.id.substr(b.id.length-3,1);a=this.id2DateMap_[this.id_+
"day_"+b+"_0"];e=6;break;case 30:a=this.id2DateMap_[b.id];a=ICAL_Date.create(a.year,a.month,1);c=ical_builderCopy(a);e=ICAL_daysInMonth(a.year,a.month)-1;break;default:Fail("Invalid click mode: "+d)}AssertTrue(NaN!==e,"duration should have been defined");c=ical_builderCopy(a);c.date+=e;c=c.toDate();this.setSelection(a,c);break}AssertTrue(1==d||-1==d&&c.contains(this.id2DateMap_[a]),"not a case for single date selection");this.clearSelections(!1);case 0:0<c.getSize()&&(a=c.asArray()[0],c.remove(a),
(a=this.dateToCellMap_[a.toString()])&&this.setDotSelection_(a,!1)),c.add(this.id2DateMap_[b.id]),this.setDotSelection_(b),this.fireSelectionEvent(this.id2DateMap_[b.id])}}};DP_DatePicker.prototype.setDragStartCell=function(a){this.rangeStartDate_=(this.dragStartCell_=a)?this.id2DateMap_[a.id]:null};DP_DatePicker.prototype.setDragEndCell=function(a){this.rangeEndDate_=(this.dragEndCell_=a)?this.id2DateMap_[a.id]:null};DP_DatePicker.prototype.inDrag=function(){return this.inDrag_};
DP_DatePicker.prototype.startDrag=function(a){this.clearSelections(!1);this.inDrag_=!0;this.setDragStartCell(this.eventToCell(a));a=this.id2DateMap_[this.dragStartCell_.id];this.selectedDates_.add(a);this.setDotSelection_(this.dragStartCell_);this.setSelection(a);this.setDragEndCell(this.dragStartCell_)};
DP_DatePicker.prototype.finishDrag=function(a){this.inDrag_=!1;this.dragEndCell_=this.eventToCell(a);if(this.isSnapToWeek())this.fireSelectionEvent(this.rangeStartDate_,this.rangeEndDate_,!1);else{var b;this.id2DateMap_[this.dragEndCell_.id].getComparable()<this.id2DateMap_[this.dragStartCell_.id].getComparable()?(a=this.id2DateMap_[this.dragEndCell_.id],b=this.id2DateMap_[this.dragStartCell_.id]):(a=this.id2DateMap_[this.dragStartCell_.id],b=this.id2DateMap_[this.dragEndCell_.id]);this.fireSelectionEvent(a,
b,!1)}};DP_DatePicker.prototype.handleDragSegment=function(a,b,c,d){this.lastDragEvent_=CloneEvent(a);if(!(1!=this.selectionMode_||this.ignoringDrags_)){this.ignoringDrags_=!0;var e=this;window.setTimeout(function(){try{e.inDrag_&&e.finishDragAnonymous.call(e,b,c,d)}finally{e.ignoringDrags_=!1}},50)}};DP_DatePicker.prototype.isSnapToWeek=function(){return this.snapToWeek_};
DP_DatePicker.prototype.finishDragAnonymous=function(){var a=this.lastDragEvent_,b=this.eventToCell(a);if(b!==this.dragEndCell_){var c=this.dragEndCell_;this.setDragEndCell(b);AssertTrue(c!=b);var a=this.id2DateMap_,d=a[c.id].getComparable()<a[b.id].getComparable(),e=a[c.id].getComparable()<a[this.dragStartCell_.id].getComparable(),f=a[b.id].getComparable()<a[this.dragStartCell_.id].getComparable(),j=a[this.dragStartCell_.id].getComparable()<a[b.id].getComparable(),g=a[this.dragStartCell_.id].getComparable()<
a[c.id].getComparable(),i;i=f?this.dragEndCell_:this.dragStartCell_;var h=f?this.dragStartCell_:this.dragEndCell_;this.isSnapToWeek()?(b=ICAL_daysBetween(a[h.id].year,a[h.id].month,a[h.id].date,a[i.id].year,a[i.id].month,a[i.id].date),7<=b&&(i=parseInt(i.id.charAt(i.id.length-3),10),h=parseInt(h.id.charAt(h.id.length-3),10),i=forid(this.id_+"day_"+i+"_0"),h=forid(this.id_+"day_"+h+"_6")),this.setDotRange(this.firstCell_,i,!1),this.setDotRange(h,this.lastCell_,!1),this.setDotRange(i,h,!0),this.rangeStartDate_=
a[i.id],this.rangeEndDate_=a[h.id]):d?(e&&(f=f?this.id2PrevMap_[b.id]:this.id2PrevMap_[this.dragStartCell_.id],this.setDotRange(c,f,!1)),j&&(j=g?this.id2NextMap_[c.id]:this.id2NextMap_[this.dragStartCell_.id],this.setDotRange(j,b,!0))):(g&&(j=j?this.id2NextMap_[b.id]:this.id2NextMap_[this.dragStartCell_.id],this.setDotRange(j,c,!1)),f&&(f=f?this.id2PrevMap_[this.dragStartCell_.id]:this.id2PrevMap_[c.id],this.setDotRange(b,f,!0)));i=a[i.id];a=a[h.id];this.fireSelectionEvent(i,a,!0)}};
DP_DatePicker.prototype.setDotRange=function(a,b,c){AssertTrue(a);AssertTrue(b);AssertType(c,Boolean);for(var d=!1;a;){(d=c?this.selectedDates_.add(this.id2DateMap_[a.id]):this.selectedDates_.remove(this.id2DateMap_[a.id]))&&this.setDotSelection_(a,c);if(a.id===b.id)break;a=this.id2NextMap_[a.id];AssertTrue(a,"did not find endCell: "+b.id)}};DP_DatePicker.LAST_DAY_OF_WEEK={4:"day_3_6",5:"day_4_6",6:"day_5_6",7:"day_6_6"};
DP_DatePicker.prototype.applyFudgeFactor_=function(a,b){this.fudgeFactor_&&(b?(a.x-=this.fudgeFactor_.x,a.y-=this.fudgeFactor_.y):(a.x+=this.fudgeFactor_.x,a.y+=this.fudgeFactor_.y))};DP_DatePicker.prototype.eventToCell=function(a){var b=nodeBounds(this.firstCell_),c=this.getTableRect_(),a=GetMousePosition(a);this.applyFudgeFactor_(a);var d=7,d=this.findBin(c.x,b.w,d,a.x),b=this.findBin(c.y,b.h,this.numWeeks_,a.y);return forid(this.id_+"day_"+b+"_"+d)};
DP_DatePicker.prototype.findBin=function(a,b,c,d){if(d<a)return 0;a=Math.floor((d-a)/b);return a>=c?c-1:a};DP_DatePicker.prototype.getTableRect_=function(){var a=this.id_,b=this.numWeeks_,c=nodeBounds(this.firstCell_),a=nodeBounds(forid(a+DP_DatePicker.LAST_DAY_OF_WEEK[b]));return new Rect(c.x,c.y,a.x+a.w-c.x,a.y+a.h-c.y,c.coordinateFrame)};DP_DatePicker.prototype.formatDate=function(a,b){var c=b?this.fullMonths_:this.months_;return c[a.month]+" "+a.date};
DP_DatePicker.prototype.fireSelectionEvent=function(a,b,c){var d={};d.startDate=a;d.endDate=b||a;d.inDrag=!!c;d.mode=this.getSelectionMode();this.selectionListeners_.fireEvent(d)};DP_DatePicker.prototype.asICAL_Date=function(a){if(a instanceof ICAL_Date)return a;if(a instanceof ICAL_DateTime)return ICAL_Date.create(a.year,a.month,a.date);AssertTrue(!1,"Invalid arg: "+a)};
DP_DatePicker.prototype.setSelection=function(a,b,c){var d=this.getSelectionMode(),c=!1!==c;a&&(a=this.asICAL_Date(a));b&&(b=this.asICAL_Date(b));a&&this.showDate(a);if(!a||3==d)this.clearSelections(c);else if(0==d)this.clearSelections(!1),d=this.dateToCellMap_[a.toString()],this.selectedDates_.add(a),this.setDotSelection_(d),c&&this.fireSelectionEvent(a);else if(1==d){b||(b=a);var d=ICAL_daysBetween(b.year,b.month,b.date,a.year,a.month,a.date),e=!1;this.isSnapToWeek()&&7<=d&&(e=ICAL_getDayOfWeek(a)+
7,d=ICAL_getDayOfWeek(b)+7,e=(e-this.getFirstDayOfWeek())%7,d=(d-this.getFirstDayOfWeek())%7,e=ical_dateBuilder(a.year,a.month,a.date-e),a=e.toDate(),e=ical_dateBuilder(b.year,b.month,b.date+(6-d)),b=e.toDate(),e=this.showDate(a));e&&this.clearSelections(!1);d=this.firstCell_;this.rangeStartDate_=a;this.rangeEndDate_=b;for(var e=this.lastCell_,f=a.getComparable(),j=b.getComparable();d;d=this.id2NextMap_[d.id]){var g=this.id2DateMap_[d.id],i=this.selectedDates_.contains(g),h=g.getComparable()>=f&&
g.getComparable()<=j;i!=h&&(h?(this.selectedDates_.add(g),this.setDotSelection_(d)):(this.selectedDates_.remove(g),this.setDotSelection_(d,!1)));if(d===e)break}if(!d){e=ical_builderCopy(this.id2DateMap_[this.lastCell_.id]);d=null;do e.date+=1,d=e.toDate(),this.selectedDates_.add(d);while(!d.equals(b))}c&&this.fireSelectionEvent(a,b)}};
DP_DatePicker.prototype.showMonth=function(a,b){if(this.dispDate_.month==a.month&&this.dispDate_.year==a.year)return!1;b=1==arguments.length||b;this.dispDate_=ICAL_Date.create(a.year,a.month,1);this.populateHtml();b&&this.monthChangeListeners_.fireEvent();return!0};DP_DatePicker.prototype.showDate=function(a,b){return a.getComparable()>=this.viewableStartDate_.getComparable()&&a.getComparable()<=this.viewableEndDate_.getComparable()?!1:this.showMonth(a,b)};
DP_DatePicker.prototype.getSelection=function(){switch(this.getSelectionMode()){case 0:return this.selectedDates_.getSize()?this.selectedDates_.asArray()[0]:null;case 1:var a=this.rangeStartDate_?this.rangeStartDate_:null,b=this.rangeEndDate_?this.rangeEndDate_:null;return!a||!b?null:[a,b];case 2:return null;default:return null}};DP_DatePicker.prototype.printStatus=function(a){if(this.showSelection_)forid(this.id_+"sel").innerHTML=a};
DP_DatePicker.prototype.setDotSelection_=function(a,b){if(a){"undefined"!=typeof b||(b=!0);var c=[],d=[],e=" "+a.className+" ",f=" "+this.class_;b?(-1!=e.indexOf(f+"today ")&&(c.push(f+"today "),d.push(f+"today_selected ")),-1!=e.indexOf(f+"weekday ")?(c.push(f+"weekday "),d.push(f+"weekday_selected ")):-1!=e.indexOf(f+"weekend ")&&(c.push(f+"weekend "),d.push(f+"weekend_selected "))):(-1!=e.indexOf(f+"today_selected ")&&(d.push(f+"today "),c.push(f+"today_selected ")),-1!=e.indexOf(f+"weekday_selected ")?
(d.push(f+"weekday "),c.push(f+"weekday_selected ")):-1!=e.indexOf(f+"weekend_selected ")&&(d.push(f+"weekend "),c.push(f+"weekend_selected ")));for(f=0;f<c.length;++f)e=e.replace(c[f],d[f]);if(0!=c.length)a.className=e}};DP_DatePicker.dp_cache_={};DP_DatePicker.staticGetPickerById=function(a){return DP_DatePicker.dp_cache_[a]};function _DP_staticPrevMonth(a){a=DP_DatePicker.dp_cache_[a];return a.getAllowMonthChange()&&a.showMonth(a.prevMonth_)}
function _DP_staticNextMonth(a){a=DP_DatePicker.dp_cache_[a];return a.getAllowMonthChange()&&a.showMonth(a.nextMonth_)}function _DP_staticCellClicked(a){var a=a.id,b=a.match(/(.*)day_\d+_\d+/),b=DP_DatePicker.dp_cache_[b[1]];return b.cellClicked_(a)}
DP_DatePicker.prototype.addListeners_=function(){if(!0!==this.listenerAdded_){this.listenerAdded_=!0;var a=this.id_,b=this,c=this.div_;DD_RegisterHandler(function(d){if(1==b.selectionMode_&&d===c)return d=new DD_BaseSelectionHandler(d),d.escapedStartPoint=!1,d.startDrag=function(c){var d=GetMousePosition(c),j=nodeBounds(b.firstCell_),g=nodeBounds(forid(a+DP_DatePicker.LAST_DAY_OF_WEEK[b.numWeeks_]));if(d.x<j.x||d.x>=g.x+g.w||d.y<j.y||d.y>=g.y+g.h)return!1;this.startPoint=d.clone();this.startEvent=
c;c=forid(a+"lasso");if(!c)c=document.createElement("div"),c.id=a+"lasso",c.style.position="absolute",c.style.display="none",document.body.appendChild(c);dd_dragType=5;dd_axisMask=3;dd_dragElement=c;return!0},d.handleDragSegment=function(a,c,d,g){if(!this.escapedStartPoint){var i,h=this.startPoint,k=GetMousePosition(a);AssertTrue(h,"p1 passed to Distance is undefined");AssertTrue(k,"p2 passed to Distance is undefined");AssertTrue(h.coordinateFrame==k.coordinateFrame);i=h.x-k.x;h=h.y-k.y;i=Math.sqrt(i*
i+h*h);if(5<i)this.escapedStartPoint=!0,b.startDrag.call(b,this.startEvent,c);else return!0}b.handleDragSegment.apply(b,arguments);return!0},d.finishDrag=function(a,c,d){if(this.escapedStartPoint)b.finishDrag.apply(b,arguments);else if(this.startPoint){var g=b.eventToCell(this.startEvent).id;b.cellClicked_.call(b,g)}return!0},d})}};DP_DatePicker.prototype.log=function(){this.loggers_.fireEvent(arguments)};function DateSet(){this.dates_={};this.size_=0}DateSet.prototype.getSize=function(){return this.size_};
DateSet.prototype.add=function(a){var b=this.validateInput_(a);if(b in this.dates_)return!1;this.dates_[b]=a.toDate();++this.size_;return!0};DateSet.prototype.remove=function(a){a=this.validateInput_(a);if(!(a in this.dates_))return!1;delete this.dates_[a];--this.size_;return!0};DateSet.prototype.clear=function(){this.dates_={};this.size_=0};DateSet.prototype.contains=function(a){a=this.validateInput_(a);return a in this.dates_};
DateSet.prototype.asArray=function(){var a=Array(this.getSize()),b=-1,c;for(c in this.dates_)a[++b]=this.dates_[c];return a};DateSet.prototype.validateInput_=function(a){AssertTrue(a instanceof ICAL_Date||a instanceof ICAL_DateTime,"expected a date or datetime: "+a);return a.toString().substr(0,9)};function ListenerList(a){this.receiver_=a;this.listeners_=[]}
ListenerList.prototype.add=function(a){AssertType(a,Function);if(!a)return!1;for(var b=0;b<this.listeners_.length;++b)if(a===this.listeners_[b])return!1;this.listeners_.push(a);return!0};ListenerList.prototype.remove=function(a){if(!a)return!1;for(var b=0;b<this.listeners_.length;++b)if(a===this.listeners_[b])return this.listeners_.splice(b,1),!0;return!1};ListenerList.prototype.fireEvent=function(){for(var a=0;a<this.listeners_.length;++a)this.listeners_[a].apply(this.receiver_,arguments)};
ListenerList.prototype.getSize=function(){return this.listeners_.length};function ListenerList_Iterator(a){this.list_=a;this.index_=0;this.current_=null}ListenerList_Iterator.prototype.remove=function(){if(!this.current_)throw Error("no current element!");this.list_.remove(this.current_);this.current_=null;--this.index_};var datepickerIframe=null;function DP_prevMonthHtmlFn(){return function(){return"&laquo;"}}function DP_curMonthNarrowHtmlFn(a){return function(b){return a.getMonths()[b.month]+" "+b.year}}function DP_nextMonthHtmlFn(){return function(){return"&raquo;"}}
function inputBlurListener(a){return function(b){if(!a.isVisible())return!0;b=b||window.event;if(BR_IsIE())var c=nodeBounds(a.getTableNode()),b=c.contains(GetMousePosition(b));else if(BR_IsSafari())b=a.isDownInDiv;else{c=b.explicitOriginalTarget;a:{b=a.getTableNode();do{if(b===c){b=!0;break a}try{c=c.parentNode}catch(d){}}while(c&&c!==document.body);b=!1}}if(!b&&(a.hide(),datepickerIframe))datepickerIframe.parentNode.style.display="none";return!0}};var Z2_datepickerIframe=null,Z2_baseUrl="",Z2_startDate=null,Z2_endDate=null,Z2_legalDateRange=null,Z2_selectedDate=null;
function Z2_loadDate(a){return function(){var b=a.getSelection();if(!b||!Z2_startDate||!Z2_endDate)Z2_selectedDate&&a.setSelection(Z2_selectedDate,Z2_selectedDate,!1);else{var c=new ICAL_PeriodOfTime(b,b);if(Z2_legalDateRange.contains(c)){var c=window.location,d=Z2_baseUrl,d="entirelist"==document.getElementById("graph_type").value?d+"/trends/hottrends?sa=X":d+"/trends/hottrends?q=*&sa=X",b=d=d+"&date="+b.year+"-"+b.month+"-"+b.date;c.href=b}else Z2_selectedDate&&a.setSelection(Z2_selectedDate,Z2_selectedDate,
!1)}}}
function Z2_parseValidDate(a){var b;a:{for(var a=a.replace(/^\s+/,"").replace(/\s+$/,"").replace(/([0-9]+)([a-zA-Z]+)/g,"$1 $2").replace(/([a-zA-Z])([0-9])/g,"$1 $2"),a=a.split(/\b|_/),c=[],d=[],e=0;e<a.length;++e)if(a[e]=a[e].replace(/^\s+|\s+$/,""),c[e]=a[e].length,d[e]=0,a[e].match(/^[0-9]+/)){var f=parseInt(a[e],10);a[e]=f;if(0===f)2==c[e]&&(d[e]|=1);else if(12<f&&31>=f)d[e]|=4;else if(12>=f)d[e]|=6;else if(100>f||1900<=f)d[e]|=1}else{for(var f=a[e],j=-1,g=-1,i=0;i<FULL_MONTHS.length;++i){var h=FULL_MONTHS[i];
if(h){var k=MONTHS[i];if((h=Math.max(LDP_CommonPrefixLength_(h,f),LDP_CommonPrefixLength_(k,f)))&&h>g)j=i,g=h}}if(f=g>=f.length+1>>1?[j,g]:null)a[e]=f[0],d[e]|=10}for(e=h=i=g=j=f=0;e<d.length;++e)!d[e]&&/\w/.test(a[e])&&++h,6===(d[e]&6)?++g:(d[e]&4&&++f,d[e]&2&&++j),d[e]&1&&++i;if(g){var l=k=!1;if(!f||!j)if(f)k=!0;else if(j)l=!0;else if(1===g)k=!0;else for(e=0;e<d.length;++e)if(6==(d[e]&6)){d[e]&=-5;++j;--g;l=!0;break}if(k)for(e=0;e<d.length;++e)6==(d[e]&6)&&(d[e]&=-5,++j,--g);else if(l)for(e=0;e<
d.length;++e)6==(d[e]&6)&&(d[e]&=-3,++f,--g)}var o,m,k=0,l=7;if(f){for(e=0;e<d.length;++e)if(d[e]&4){b=a[e];d[e]=0;--f;break}AssertTrue(b)}else b=null,l&=-5;if(j){for(var p=!1,e=0;e<d.length;++e)if(d[e]&2){o=a[e];d[e]&=-3;--j;p=0!==(d[e]&8);break}if(p)for(var p=c[e],n=e+1;n<d.length;++n)d[n]&8&&c[n]>p&&(d[e]|=2,d[n]&=-3,o=a[n],p=c[n],e=n)}else o=null,l&=-3;if(c=!!i)for(e=0;e<d.length;++e){if(d[e]&1){m=a[e];d[e]=0;--i;break}}else{m=null;if(f|j|g){p=-1;for(e=n=0;e<d.length;++e)d[e]&&!(d[e]&8)&&a[e]>
n&&(p=e,n=a[e]);if(0<=p){m=n;switch(d[p]){case 4:--f;break;case 2:--j;break;case 6:--g}d[p]=0}}null==m&&(k-=1,m=ICAL_todaysDate.year+(o&&o<ICAL_todaysDate.month?1:0),l&=-2)}null==b&&(b=1,k-=0.5);if(null==o)if(c)o=1;else{b=null;break a}100>m&&(m+=50>m?2E3:1900);k-=f+j+i+g+(h>>2);b=new LDP_ParsedDate(ICAL_Date.create(m,o,b),k,l)}return!b?null:!(-2<b.confidence)?null:b.date}
function Z2_dateStyler(a){if(!a||!Z2_startDate||!Z2_endDate)return null;a=new ICAL_PeriodOfTime(a,a);return!Z2_legalDateRange.contains(a)?"color: #CCCCCC;":null}
function Z2_addDatePickerToLink(a,b,c,d,e){Z2_baseUrl=b;Z2_startDate=Z2_parseValidDate(c);Z2_endDate=Z2_parseValidDate(d);Z2_selectedDate=Z2_parseValidDate(e);Z2_legalDateRange=new ICAL_PeriodOfTime(Z2_startDate,Z2_endDate);if(BR_IsIE()&&null==Z2_datepickerIframe)Z2_datepickerIframe=CreateIFRAME(window,"DP_Iframe","javascript:false"),Z2_datepickerIframe.parentNode.style.display="none",Z2_datepickerIframe.style.position="absolute";b=document.createElement("div");b.id=a+"dp_div";b.style.position="absolute";
b.style.display="none";b.style.width="10em";document.body.appendChild(b);var f=new DP_DatePicker(b,!1,void 0,"DP_popup_");f.setSelectionMode(0);f.setPrevMonthHtmlFn(DP_prevMonthHtmlFn(f));f.setCurMonthHtmlFn(DP_curMonthNarrowHtmlFn(f));f.setNextMonthHtmlFn(DP_nextMonthHtmlFn(f));f.setUseDayHeaders(!0);f.setFirstDayOfWeek(0);f.setDecoratorInline(Z2_dateStyler);f.addSelectionListener(Z2_loadDate(f));f.deactivate=function(a){if(!f.isVisible())return!0;var b=nodeBounds(f.getTableNode()),a=GetMousePosition(a);
if(!b.contains(a)){f.hide();if(Z2_datepickerIframe)Z2_datepickerIframe.parentNode.style.display="none";return!0}return!1};b=Z2_inputFocusListener(b.id,a,f);a=forid(a);listen(a,"focus",b,!1);listen(a,"click",b,!1);listen(a,"blur",inputBlurListener(f),!1);return f}
function Z2_inputFocusListener(a,b,c){return function(){var d=forid(b),e=nodeBounds(d),f=forid(a);f.style.left=e.x+"px";f.style.top=e.y+e.h+"px";f.className="DP_popup_div";f.style.display="";d=d.currentStyle?d.currentStyle:d.ownerDocument.defaultView.getComputedStyle(d,"");f.style.zIndex=(d.zIndex||0)+1;c.show();if(Z2_datepickerIframe)d=nodeBounds(c.getTableNode()),Z2_datepickerIframe.parentNode.style.display="",Z2_datepickerIframe.style.left=d.x+"px",Z2_datepickerIframe.style.top=d.y+"px",Z2_datepickerIframe.style.width=
d.w+"px",Z2_datepickerIframe.style.height=d.h+"px",Z2_datepickerIframe.style.zIndex=f.style.zIndex-1,Z2_datepickerIframe.style.display="";Z2_selectedDate&&c.setSelection(Z2_selectedDate,Z2_selectedDate,!1);a:{f=c;PC_assertIsPopup(f);for(d=0;d<gPopupController.activePopups_.length;++d)if(f===gPopupController.activePopups_[d])break a;gPopupController.activePopups_.push(f)}return!0}}var _addDatePickerToLink=Z2_addDatePickerToLink;function Z2_ListRenderer(a,b,c,d,e,f){AS_Assert.isTrue(d,"Div is null.");this.listDiv_=forid(d);AS_Assert.isTrue(this.listDiv_);AS_Assert.isTrue(e.length==f.length,"Number of terms and urls does not match.");this.terms_=[];this.termUrls_=[];for(d=0;d<e.length;d++)this.terms_[d]=e[d],this.termUrls_[d]=f[d];this.truncateLength_=b;this.setItemsPerPage(a);this.numPages_=Math.ceil(this.terms_.length/this.itemsPerPage_);this.selectedItem_=-1;this.setSelectedItem(c);this.currentPage_=Math.floor(Math.max(this.selectedItem_,
0)/this.itemsPerPage_);this.renderList()}Z2_ListRenderer.prototype.setSelectedItem=function(a){AS_Assert.isTrue(a<this.terms_.length,"Selected item is beyond the length of the array.");AS_Assert.isTrue(-1<=a,"Selected item is less than -1.");this.selectedItem_=a};Z2_ListRenderer.prototype.setItemsPerPage=function(a){AS_Assert.isTrue(0<a,"itemsPerPage <= 0.");this.itemsPerPage_=a};
Z2_ListRenderer.prototype.truncateTerm=function(a){var b=a;0<this.truncateLength_&&a.length>this.truncateLength_&&(b=a.substring(0,this.truncateLength_)+"...");return b};Z2_ListRenderer.prototype.nextPage=function(){this.currentPage_+1>=this.numPages_||(this.currentPage_++,this.renderList())};Z2_ListRenderer.prototype.prevPage=function(){0>=this.currentPage_||(this.currentPage_--,this.renderList())};Z2_ListRenderer.prototype.clearListDivNode=function(){for(;this.listDiv_.firstChild;)this.listDiv_.removeChild(this.listDiv_.firstChild)};
Z2_ListRenderer.prototype.renderList=function(){this.clearListDivNode();var a=document.createElement("table");this.listDiv_.appendChild(a);a.className="Z2_list";a.setAttribute("id","Z2_list");var b=document.createElement("tbody");a.appendChild(b);for(var a=this.currentPage_*this.itemsPerPage_,c=Math.min(this.terms_.length,a+this.itemsPerPage_),d=a;d<c;d++)this.renderItem(d,b);d=document.createElement("tr");b.appendChild(d);var d=document.createElement("tr"),e=document.createElement("td");e.colSpan=
2;a="Showing %1 - %2".replace(/%1/,a+1).replace(/%2/,c);e.appendChild(document.createTextNode(a));d.appendChild(e);b.appendChild(d);this.renderNavigationLinks(b)};
Z2_ListRenderer.prototype.renderNavigationLinks=function(a){var b=document.createElement("tr");a.appendChild(b);a=document.createElement("td");a.colSpan=2;b.appendChild(a);0<this.currentPage_&&(b=this.buildNavigationLink("Z2_prev","&laquo; Previous"),a.appendChild(b),a.appendChild(document.createTextNode("   ")),listen(forid("Z2_prev"),"click",this.prevPage.bind(this),!1));this.currentPage_+1<this.numPages_&&(b=this.buildNavigationLink("Z2_next","Next &raquo;"),a.appendChild(b),listen(forid("Z2_next"),
"click",this.nextPage.bind(this),!1))};Z2_ListRenderer.prototype.buildNavigationLink=function(a,b){var c=document.createElement("a");c.setAttribute("href","#");c.setAttribute("id",a);c.setAttribute("name",a);c.className="u";c.innerHTML=b;return c};
Z2_ListRenderer.prototype.renderItem=function(a,b){if(!(0>a||a>=this.terms_.length)){var c=this.truncateTerm(this.terms_[a]),d=document.createElement("tr"),e=document.createElement("td");e.className="num";e.appendChild(document.createTextNode(a+1+"."));var f=document.createElement("td");if(a==this.selectedItem_)f.className="selected",f.appendChild(document.createTextNode(c));else{var j=document.createElement("a");j.setAttribute("href",this.termUrls_[a]);j.appendChild(document.createTextNode(c));f.appendChild(j)}d.appendChild(e);
d.appendChild(f);b.appendChild(d)}};function _Z2_addListRenderer(a,b,c,d,e,f){new Z2_ListRenderer(a,b,c,d,e,f)};

