
var _calEvents=[];var _prevMonth;var _prevYear;var _nextMonth;var _nextYear;var _duration={duration:0.5};function hilite(div,on)
{if(on)
{div.style.color='#aaa';div.style.borderColor='#aaa';}
else
{div.style.color='';div.style.borderColor='';}}
function CalEvent(eid,host,rsvp,sharing,type)
{this.eid=eid;this.host=host;this.rsvp=rsvp;this.sharing=sharing;this.type=type;}
CalEvent.prototype.isMatch=function(host,rsvp,sharing,type)
{var h,r,s,t;if('0'==host||-1<this.host.indexOf(host))
{h=true;}
else
{h=false;}
if('0'==rsvp||this.rsvp==rsvp)
{r=true;}
else
{r=false;}
if('0'==sharing||this.sharing==sharing)
{s=true;}
else
{s=false;}
if('-1'==type||this.type==type)
{t=true;}
else
{t=false;}
return(h&&r&&s&&t);};function addCalEvent(eid,host,rsvp,sharing,type)
{_calEvents.push(new CalEvent(eid,host,rsvp,sharing,type));}
function filter()
{var host,rsvp,sharing,type,i;if(__isSignedIn)
{host=getListValue('selHost');rsvp=getListValue('selRSVP');sharing=getListValue('selSharing');}
else
{host='0';rsvp='0';sharing='0';}
type=getListValue('selType');for(i=0;i<_calEvents.length;i++)
{var o=$(_calEvents[i].eid);if(_calEvents[i].isMatch(host,rsvp,sharing,type))
{if('none'==o.style.display)
{Effect.Appear(o,_duration);}}
else
{if('block'==o.style.display||''==o.style.display)
{Effect.Fade(o,_duration);}}}}
function toggleDetails(slide)
{var visible,i;var ary=$$('div');visible=$('chkDetails').checked;if(0==arguments.length)
{slide=true;}
for(i=0;i<ary.length;i++)
{if('eventDetails'==ary[i].className)
{if(visible)
{if(slide)
{Effect.BlindDown(ary[i],_duration);}
else
{Element.show(ary[i]);}}
else
{if(slide)
{Effect.BlindUp(ary[i],_duration);}
else
{Element.hide(ary[i]);}}}}}
function toggleHelp()
{var mnu=$('menu_help');if('show help'==mnu.innerHTML)
{Effect.Appear('help',_duration);mnu.innerHTML='hide help';}
else
{Effect.Fade('help',_duration);mnu.innerHTML='show help';}}
function initPage()
{if(__isSignedIn)
{setList('selHost',readCookie('pyd_cal_host'));setList('selRSVP',readCookie('pyd_cal_rsvp'));setList('selSharing',readCookie('pyd_cal_sharing'));}
if(!setList('selType',readCookie('pyd_cal_type')))
{setList('selType',1);}
if(1==readCookie('pyd_cal_details'))
{$('chkDetails').checked=true;}
toggleDetails(false);filter();}
function unloadPage()
{var days=90;if(__isSignedIn)
{createCookie('pyd_cal_host',getListValue('selHost'),days);createCookie('pyd_cal_rsvp',getListValue('selRSVP'),days);createCookie('pyd_cal_sharing',getListValue('selSharing'),days);}
createCookie('pyd_cal_type',getListValue('selType'),days);createCookie('pyd_cal_details',$('chkDetails').checked?1:0,days);}
Event.observe(window,'load',initPage);Event.observe(window,'unload',unloadPage);