public function elementsToJs($blnRawJs = false)
    {
        $strReturn = "";

        $strJs = "";

        // *** Loop through all form elements and get their javascript code.
        foreach ($this->__elements as $element) {
            $strJs .= $element->toJS();
        }

        // Indent javascript
        $strJs = str_replace("\n", "\n\t", $strJs);

        if (! $blnRawJs) {
            $strReturn .= "<script type=\"text/javascript\">\n";
            $strReturn .= "// <![CDATA[\n";
        }

        $strReturn .= "\tvar objForm = $(\"#{$this->__name}\").data(\"vf__formElement\");\n\t";
        $strReturn .= $strJs;
        $strReturn .= "objForm.initialize();\n";

        if (! $blnRawJs) {
            $strReturn .= "// ]]>\n";
            $strReturn .= "</script>\n";
        }

        return $strReturn;
    }