public function onLoad($param)
    {
        $cssFile = $this->publishAsset(self::CSS_FILE);
        $jsFile = $this->publishAsset(self::JS_FILE);
        $closeImg = $this->publishAsset(self::CLOSE_IMG);
        $csm = $this->getPage()->getClientScript();
        $this->startTime = new TTextBox();
        $this->startTime->setID('startTime');
        $this->addedControl($this->startTime);
        $this->endTime = new TTextBox();
        $this->endTime->setID('endTime');
        $this->addedControl($this->endTime);
        $plannerType = "";
        if ($this->getPlannerType() == 'Access') {
            $this->pinCode = new TCheckBox();
            $this->pinCode->setID('pinCode');
            $this->addedControl($this->pinCode);
            $this->exitingOnly = new TCheckBox();
            $this->exitingOnly->setID('exitingOnly');
            $this->addedControl($this->exitingOnly);
            $plannerType .= 'pinCode           : $(\'' . $this->pinCode->getClientID() . '\'),';
            $plannerType .= 'exitingOnly           : $(\'' . $this->exitingOnly->getClientID() . '\'),';
        } else {
            $this->unlocking = new TCheckBox();
            $this->unlocking->setID('unlocking');
            $this->addedControl($this->unlocking);
            $this->supOpenTooLongAlarm = new TCheckBox();
            $this->supOpenTooLongAlarm->setID('supOpenTooLongAlarm');
            $this->addedControl($this->supOpenTooLongAlarm);
            $this->supWithoutPermAlarm = new TCheckBox();
            $this->supWithoutPermAlarm->setID('supWithoutPermAlarm');
            $this->addedControl($this->supWithoutPermAlarm);
            $this->checkOnlyCompanyID = new TCheckBox();
            $this->checkOnlyCompanyID->setID('checkOnlyCompanyID');
            $this->addedControl($this->checkOnlyCompanyID);
            $plannerType .= 'unlocking           : $(\'' . $this->unlocking->getClientID() . '\'),';
            $plannerType .= 'supOpenTooLongAlarm           : $(\'' . $this->supOpenTooLongAlarm->getClientID() . '\'),';
            $plannerType .= 'supWithoutPermAlarm           : $(\'' . $this->supWithoutPermAlarm->getClientID() . '\'),';
            $plannerType .= 'checkOnlyCompanyID           : $(\'' . $this->checkOnlyCompanyID->getClientID() . '\'),';
        }
        $this->specialRelayPlan = new TCheckBox();
        $this->specialRelayPlan->setID('specialRelayPlan');
        $this->addedControl($this->specialRelayPlan);
        $plannerType .= 'specialRelayPlan           : $(\'' . $this->specialRelayPlan->getClientID() . '\'),';
        $script = 'var wp = new XWeekPlanner("' . $this->getClientID() . '",
		{startDate				 : "' . $this->getStartDate() . '",
         allowItemEdit     		 : "' . $this->getAllowInlineEdit() . '",
         allowItemDelete		 : 1,
         allowItemSelect		 : 1,
         allowItemMove			 : 1,
         allowItemResize 		 : 1,
         deleteConfirmMessage: \'' . Prado::localize('Are you sure you want to delete this item?') . '\',
         headerDateFormat	 : \'d.m\',
         startHour			 : 0,
         endHour			 : 23,
         onitemclick		 : \'\',
         readOnly			 : 0,
         startTime           : $(\'' . $this->startTime->getClientID() . '\'),
         endTime           :$(\'' . $this->endTime->getClientID() . '\'),
         ' . $plannerType . '
         levelId : 0
		});';
        if (!$this->getPage()->getIsCallback()) {
            if (!$csm->isEndScriptRegistered('xweekplanner/config')) {
                $csm->registerEndScript('xweekplanner/config', $script);
            }
        }
        $csm->registerPradoScript('ajax');
        if (!$csm->isStyleSheetFileRegistered('xweekplanner')) {
            $csm->registerStyleSheetFile('xweekplanner', $cssFile);
        }
        if (!$csm->isScriptFileRegistered('xweekplanner')) {
            $csm->registerScriptFile('xweekplanner', $jsFile);
        }
        $t1 = new TCallback();
        $t1->setID('callbackweekSchedulerLoadAppointments');
        $t1->attachEventHandler("OnCallBack", array($this, "OnLoadAppointments"));
        $this->Page->getControls()->add($t1);
        $t1 = new TCallback();
        $t1->setID('callbackweekSchedulerSaveAppointment');
        $t1->attachEventHandler("OnCallBack", array($this, "OnSaveAppointment"));
        $this->Page->getControls()->add($t1);
        $t1 = new TCallback();
        $t1->setID('callbackweekSchedulerDeleteAppointment');
        $t1->attachEventHandler("OnCallBack", array($this, "OnDeleteAppointment"));
        $this->Page->getControls()->add($t1);
        $t1 = new TCallback();
        $t1->setID('callbackweekSchedulerSelectAppointment');
        $t1->attachEventHandler("OnCallBack", array($this, "OnSelectAppointment"));
        $this->Page->getControls()->add($t1);
    }