/**
     * Implements QCubed specific dialog functions. Makes sure dialog is put at the end of the form
     * to fix an overlay problem with jQuery UI.
     *
     * @return string
     */
    protected function MakeJqOptions()
    {
        $jqOptions = parent::MakeJqOptions();
        $controlId = $this->ControlId;
        $strFormId = $this->Form->FormId;
        if (!$this->blnHasCloseButton) {
            $strHideCloseButtonScript = '$j(this).prev().find(".ui-dialog-titlebar-close").hide();';
        } else {
            $strHideCloseButtonScript = '';
        }
        $jqOptions['open'] = new QJsClosure(sprintf('qcubed.recordControlModification("%s", "_IsOpen", true);
				%s', $controlId, $strHideCloseButtonScript), ['event', 'ui']);
        $jqOptions['close'] = new QJsClosure(sprintf('qcubed.recordControlModification("%s", "_IsOpen", false);
			    ', $controlId), ['event', 'ui']);
        $jqOptions['appendTo'] = "#{$strFormId}";
        // By doing the styling at creation time, we ensure that it gets done only once.
        if ($strCreateJs = $this->StylingJs()) {
            $jqOptions['create'] = new QJsClosure($strCreateJs);
        }
        return $jqOptions;
    }