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