function InitializeGUI()
 {
     global $root_path, $lang, $cfg;
     if (empty($root_path)) {
         $root_path = $this->root_path;
     }
     if (empty($lang)) {
         $lang = $this->lang;
     }
     # HEAD META definition
     $this->assign('setCharSet', setCharSet());
     # collect JavaScript for Smarty. By default collect the help javascript and css stylesheets
     if ($this->bLoadJS) {
         ob_start();
         include $this->root_path . 'include/inc_js_gethelp.php';
         include $this->root_path . 'include/inc_css_a_hilitebu.php';
         $sTemp = ob_get_contents();
         ob_end_clean();
     }
     $this->assign('JavaScript', $sTemp);
     # Added for the html tag direction
     $this->assign('HTMLtag', html_ret_rtl($this->lang));
     # Set colors
     $this->assign('top_txtcolor', $this->cfg['top_txtcolor']);
     $this->assign('top_bgcolor', $this->cfg['top_bgcolor']);
     $this->assign('body_bgcolor', $this->cfg['body_bgcolor']);
     $this->assign('body_txtcolor', $this->cfg['body_txtcolor']);
     $this->assign('bot_bgcolor', $this->cfg['bot_bgcolor']);
     # Set title bar buttons
     $this->assign('gifBack2', createLDImgSrc($this->root_path, 'back2.gif', '0'));
     $this->assign('gifHilfeR', createLDImgSrc($this->root_path, 'hilfe-r.gif', '0'));
     $this->assign('gifClose2', createLDImgSrc($this->root_path, 'close2.gif', '0'));
     $this->assign('LDCloseAlt', $this->LDCloseAlt);
     # Set default href of the title bar buttons
     # By default, the back button uses the javascript
     $this->assign('pbBack', 'javascript:window.history.back()');
     # By default the help button points to the main help window
     $this->assign('pbHelp', "javascript:gethelp()");
     # By default the break/close button points to the main startframe
     $this->assign('breakfile', $this->root_path . 'main/startframe.php' . URL_APPEND);
     # By default the toolbar title is empty
     //$this->assign('sToolbarTitle','');
     # By default the window title is Care2x
     $this->assign('title', 'Care2x');
     # For the dhtml effects
     if ($this->cfg['dhtml']) {
         # Overload css  document body attributes
         $this->assign('bgcolor', 'bgcolor=' . $this->cfg['body_bgcolor']);
         $this->assign('dhtml', 'style="filter:alpha(opacity=70)" onMouseover="hilite(this,1)" onMouseOut="hilite(this,0)"');
         $this->assign('sLinkColors', 'link=' . $this->cfg['idx_txtcolor'] . ' alink=' . $this->cfg['body_alink'] . ' vlink=' . $this->cfg['idx_txtcolor']);
     }
     # Show Copyright
     if ($this->bShowCopyright) {
         $this->assign('sCopyright', $this->Copyright());
         $this->assign('sPageTime', $this->Pagetime());
     }
 }
}
# Start the smarty templating
/**
 * HEAD META definition
 */
$smarty->assign('setCharSet', setCharSet());
/**
 * Toolbar
 */
if (!isset($edit) || empty($edit)) {
    $smarty->assign('edit', FALSE);
}
# Set it to be purely printout
$smarty->assign('printmode', TRUE);
# Added for the html tag direction
$smarty->assign('HTMLtag', html_ret_rtl($lang));
# Set colors
$smarty->assign('top_txtcolor', $cfg['top_txtcolor']);
$smarty->assign('top_bgcolor', $cfg['top_bgcolor']);
$smarty->assign('body_bgcolor', $cfg['body_bgcolor']);
$smarty->assign('body_txtcolor', $cfg['body_txtcolor']);
$smarty->assign('bgc1', $bgc1);
$smarty->assign('gifHilfeR', createLDImgSrc($root_path, 'hilfe-r.gif', '0'));
$smarty->assign('LDCloseAlt', $LDCloseAlt);
$smarty->assign('gifClose2', createLDImgSrc($root_path, 'close2.gif', '0'));
# Added for the common header top block
$smarty->assign('sToolbarTitle', "{$LDTestRequest} ::  {$formtitle}");
$smarty->assign('pbBack', 'javascript:window.history.back()');
$smarty->assign('gifBack2', createLDImgSrc($root_path, 'back2.gif', '0'));
# Added for the common header top block
$smarty->assign('pbHelp', 'javascript:gethelp(\'request_aftersave.php\')');
function html_rtl($lang)
{
    echo html_ret_rtl($lang);
}