function showFlash($row, $realfolder, $use_js_include, $jfu_config, $plugin = false)
    {
        global $prefix_path, $tfu_enable_resize, $tfu_insert_resize;
        $language =& JFactory::getLanguage();
        $Cfg_lang = $language->getTag();
        $sess_id = session_id();
        $base_dir = $prefix_path . 'components/com_jfuploader/tfu';
        $relative_dir = parse_url(JURI::base());
        $relative_dir = $relative_dir['path'];
        $relative_dir = rtrim($relative_dir, "\\/.") . '/';
        // we replace to get a consistent output with different php versions!
        $width = $row->display_width;
        $height = floor($width * (340 / 650));
        if ($height > 390) {
            $height = floor($height * 0.95);
        }
        // $height=375;
        $extra_settings = '';
        $extra_settings_js = '';
        if ($row->description_mode == "true") {
            $extra_settings .= '&tfu_description_mode=true';
            $extra_settings_js .= 'flashvars.tfu_description_mode="true";';
        }
        if ($row->big_server_view == "true") {
            $extra_settings .= '&big_server_view=true';
            $extra_settings_js .= 'flashvars.big_server_view="true";';
        }
        if ($row->switch_sides == "true") {
            $extra_settings .= '&switch_sides=true';
            $extra_settings_js .= 'flashvars.switch_sides="true";';
        }
        if ($row->hide_remote_view == "true") {
            $extra_settings .= '&hide_remote_view=true';
            $extra_settings_js .= 'flashvars.hide_remote_view="true";';
        }
        if ($prefix_path == '') {
            // we tell the flash that tfu is in the frontend directory!
            $extra_settings .= '&loc=FE';
            $extra_settings_js .= 'flashvars.loc="FE";';
        }
        if ($jfu_config['idn_url'] != '') {
            $extra_settings .= '&enable_absolut_path=true';
            $extra_settings_js .= 'flashvars.enable_absolut_path = "true";';
        }
        $swf_text_settings_js = '';
        if ($row->swf_text) {
            // we bring the parameters into the right js format.
            $elements = split("&", $row->swf_text);
            foreach ($elements as $element) {
                $extra_settings_js .= "flashvars." . str_replace("=", "=\"", $element) . "\";";
            }
        }
        $output = '';
        if ($row->enable_setting == "false") {
            // no flash only text!
            if ($plugin) {
                return JFULanguage::getLanguage($row->text_top_lang, $row->text_top, "TEXT_TOP", $row->id);
            } else {
                echo JFULanguage::getLanguage($row->text_top_lang, $row->text_top, "TEXT_TOP", $row->id);
                return;
            }
        }
        $jConfig = new JConfig();
        // we can only have a keepalive if Joomla and JFU use the same session!
        if ($jConfig->session_handler != 'database') {
            echo JHTML::_('behavior.keepalive');
        }
        // now I overwrite the existing function.
        echo '
    <script type="text/javascript">
    function debugError(errorString) { }
       
    function getIDN() {
       return "' . $jfu_config['idn_url'] . '/";
    }
    
    function uploadRunning(val) {
       acivateKeep = (val == "true");
       if (oldKeepAlive != null) { 
         oldKeepAlive(); 
       }
    }
    var oldKeepAlive = window.keepAlive;
    var acivateKeep = false;
    window.keepAlive = function() {
      if (acivateKeep && (oldKeepAlive != null)) { 
        oldKeepAlive();   
      }
    }
    </script>';
        if (!file_exists($realfolder) && $realfolder != "") {
            $output .= "Configuration Error! The destination folder does not exist.";
            $output .= $realfolder;
        }
        if (!$plugin) {
            $output .= "<h2>";
            $output .= JFULanguage::getLanguage($row->text_title_lang, $row->text_title, "TEXT_TITLE", $row->id);
            $output .= "</h2>";
            $output .= JFULanguage::getLanguage($row->text_top_lang, $row->text_top, "TEXT_TOP", $row->id);
            $output .= "<p>";
        }
        $lang = JFULanguage::mapLangJoomlatoTFU($Cfg_lang);
        // object tag is used for noscript and if JS include is disabled in the config.
        $objecttag = '
          <object name="mymovie" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' . $width . '" height="' . $height . '"  align="middle">
            <param name="allowScriptAccess" value="sameDomain" />
            <param name="movie" value="' . $relative_dir . $prefix_path . 'components/com_jfuploader/tfu/tfu_215.swf?joomla=frontend&amp;session_id=' . $sess_id . '&amp;lang=' . $lang . '&amp;base=' . $base_dir . '&amp;relative_dir=' . $relative_dir . $extra_settings . '&amp;' . $row->swf_text . '" />
            <param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />';
        if ($width == '650') {
            $objecttag .= '<param name="scale" value="noScale" />';
        }
        $objecttag .= '<param name="allowFullScreen" value="true" />
            <embed src="' . $relative_dir . $prefix_path . 'components/com_jfuploader/tfu/tfu_215.swf?joomla=frontend&amp;session_id=' . $sess_id . '&amp;lang=' . $lang . '&amp;base=' . $base_dir . '&amp;relative_dir=' . $relative_dir . $extra_settings . '&amp;' . $row->swf_text . '" name="mymovie" quality="high" bgcolor="#ffffff" width="' . $width . '" height="' . $height . '" align="middle" ' . ($width == '650' ? 'scale="noScale" ' : '') . ' allowfullscreen="true" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
            </object> ';
        if ($use_js_include) {
            // include with Javascript
            $output .= '
			<div style="height:' . $height . 'px;"> 
               <!-- include with javascript - best solution because otherwise you get the "klick to activate border in IE" -->
			<script type="text/javascript" src="' . $relative_dir . $prefix_path . 'components/com_jfuploader/tfu/swfobject.js"></script>
			<script type="text/javascript">
			   document.write(\'<div style="height:' . $height . 'px;" id="flashcontent"><div class="noflash">TWG Flash Uploader requires at least Flash 8.<br>Please update your browser.<\\/div><\\/div>\');
                var flashvars = {};
                var params = {};    
                var attributes = { id: "flash_tfu", name: "flash_tfu" };	
                flashvars.joomla="frontend";
                flashvars.session_id="' . $sess_id . '";	
                flashvars.lang="' . $lang . '";
                flashvars.base="' . $base_dir . '";
                flashvars.relative_dir="' . $relative_dir . '";
                params.allowfullscreen = "true";		   
                ';
            $output .= $extra_settings_js;
            $output .= $swf_text_settings_js;
            if ($row->fix_overlay == "true") {
                $output .= 'params.wmode ="transparent";
                  ';
            }
            if ($width == '650') {
                $output .= 'params.scale = "noScale";
                  ';
            }
            $output .= '  swfobject.embedSWF("' . $relative_dir . $prefix_path . 'components/com_jfuploader/tfu/tfu_215.swf", "flashcontent", "' . $width . '", "' . $height . '", "8.0.0", "", flashvars, params, attributes);
                ';
            $output .= '
			</script>
			<!-- end include with Javascript -->
			<!-- static html include -->
			<noscript>
			Please enable Javascript.
			</noscript>
			</div>
        ';
        } else {
            // include with object tag
            $output .= $objecttag;
        }
        if (!$plugin) {
            $output .= "</p>";
            $output .= "<br>" . JFULanguage::getLanguage($row->text_bottom_lang, $row->text_bottom, "TEXT_BOTTOM", $row->id);
        }
        if ($plugin) {
            return $output;
        } else {
            echo $output;
        }
    }
    function showUpload($row, $realfolder, $folder, $jfu_config)
    {
        global $mybasedir;
        $pathfix = strlen($mybasedir) > 0 ? '../' : '';
        $language = JFactory::getLanguage();
        $Cfg_lang = $language->getTag();
        $relative_dir = dirname($_SERVER['PHP_SELF']);
        $relative_dir = rtrim($relative_dir, "\\/.") . '/';
        // we replace to get a consistent output with different php versions!
        $width = $row->display_width;
        $height = floor($width * (340 / 650));
        if ($height > 390) {
            $height = floor($height * 0.95);
        }
        // $height=375;
        echo JHTML::_('behavior.keepalive');
        // now I overwrite the existing function.
        echo '
<script type="text/javascript">
function debugError(errorString) { }

function getIDN() {
  return "' . $jfu_config['idn_url'] . '/administrator/";
}

function uploadRunning(val) {
   acivateKeep = (val == "true");
   if (oldKeepAlive != null) { 
     oldKeepAlive(); 
   }
}
var oldKeepAlive = window.keepAlive;
var acivateKeep = false;
window.keepAlive = function() {
  if (acivateKeep && (oldKeepAlive != null)) { 
    oldKeepAlive();   
  }
}
</script>';
        echo '<center><form action="index.php" method="post" name="adminForm" id="adminForm">
<input type="hidden" name="option" value="com_jfuploader"/>
<input type="hidden" name="task" value="config"/>
</form>';
        if ($row->enable_setting == "false") {
            // no flash only text!
            echo JFULanguage::getLanguage($row->text_top_lang, $row->text_top, "TEXT_TOP", $row->id);
            return;
        }
        if (!file_exists($folder) && $realfolder != "") {
            echo JText::_('ERR_FOLDER') . " : " . $realfolder;
            return;
        }
        echo "<h3>";
        echo JFULanguage::getLanguage($row->text_title_lang, $row->text_title, "TEXT_TITLE", $row->id);
        echo "</h3>";
        echo JFULanguage::getLanguage($row->text_top_lang, $row->text_top, "TEXT_TOP", $row->id);
        echo "<p>";
        $lang = JFULanguage::mapLangJoomlatoTFU($Cfg_lang);
        $base_dir = $pathfix . "components/com_jfuploader/tfu";
        $extra_settings = '';
        if ($row->description_mode == "true") {
            $extra_settings .= '&tfu_description_mode=true';
        }
        if ($row->hide_remote_view == "true") {
            $extra_settings .= '&hide_remote_view=true';
        }
        if ($pathfix == '../') {
            // we tell the flash that tfu is in the frontend directory!
            $extra_settings .= '&loc=FE';
        }
        echo '
  <div style="z-index:1">
    <div id="flashcontent"><div class="noflash">' . sprintf(JText::_('MES_NO_FLASH'), '<a href="http://www.tinywebgallery.com/en/tfu/web_jfu.php">', '</a>') . '</p></div></div>
	<script type="text/javascript" src="' . $pathfix . 'components/com_jfuploader/tfu/swfobject.js"></script>
	<script type="text/javascript">
var flashvars = {};
var params = {};
var attributes = {};
params.allowfullscreen = "true";
';
        if ($row->fix_overlay == "true") {
            echo 'params.wmode ="transparent";';
        }
        if ($width == '650') {
            echo 'params.scale = "noScale";';
        }
        if ($jfu_config['idn_url'] != '') {
            echo 'flashvars.enable_absolut_path = "true";';
            $extra_settings .= "&enable_absolut_path=true";
        }
        if ($row->big_server_view == "true") {
            echo 'flashvars.big_server_view = "true";';
            $extra_settings .= '&big_server_view=true';
        }
        if ($row->switch_sides == "true") {
            echo 'flashvars.switch_sides = "true";';
            $extra_settings .= '&switch_sides=true';
        }
        echo '
   swfobject.embedSWF("' . $pathfix . 'components/com_jfuploader/tfu/tfu_215.swf?joomla=true&lang=' . $lang . '&session_id=' . session_id() . '&base=' . $base_dir . '&relative_dir=' . $relative_dir . $extra_settings . '&' . $row->swf_text . '", "flashcontent", "' . $width . '", "' . $height . '", "8.0.0", "", flashvars, params, attributes);
';
        echo <<<HTML
\t</script>
\t<!-- end include with Javascript -->
\t<!-- static html include -->
\t<noscript>
\tPlease enable Javascript
\t</noscript> 
</div>
HTML;
        echo "</p>";
        echo "<br/>";
        echo JFULanguage::getLanguage($row->text_bottom_lang, $row->text_bottom, "TEXT_BOTTOM", $row->id);
        echo "<br/>";
        if (!file_exists(dirname(__FILE__) . "/" . $mybasedir . "tfu/.htaccess")) {
            printf(JText::_('C_HTACCESS_CREATE'), '<a href="#createhtaccess" onclick="return submitform(\'createhtaccess\')"><b>', '</b></a>');
        } else {
            printf(JText::_('C_HTACCESS_DELETE'), '<a href="#deletehtaccess" onclick="return submitform(\'deletehtaccess\')"><b>', '</b></a>');
        }
        echo "</center>";
    }
    function showUpload($row, $realfolder, $folder)
    {
        $language =& JFactory::getLanguage();
        $Cfg_lang = $language->getTag();
        $relative_dir = dirname($_SERVER['PHP_SELF']);
        $relative_dir = rtrim($relative_dir, "\\/.") . '/';
        // we replace to get a consistent output with different php versions!
        $width = $row->display_width;
        $height = floor($width * (340 / 650));
        echo '<center><form action="index2.php" method="post" name="adminForm">
<input type="hidden" name="option" value="com_joomla_flash_uploader"/>
<input type="hidden" name="task" value="config"/>
</form>';
        if ($row->enable_setting == "false") {
            // no flash only text!
            echo JFULanguage::getLanguage($row->text_top_lang, $row->text_top, "TEXT_TOP", $row->id);
            return;
        }
        if (!file_exists($folder) && $realfolder != "") {
            echo JText::_('ERR_FOLDER') . " : " . $realfolder;
            return;
        }
        echo "<h3>";
        echo JFULanguage::getLanguage($row->text_title_lang, $row->text_title, "TEXT_TITLE", $row->id);
        echo "</h3>";
        echo JFULanguage::getLanguage($row->text_top_lang, $row->text_top, "TEXT_TOP", $row->id);
        echo "<p>";
        $lang = JFULanguage::mapLangJoomlatoTFU($Cfg_lang);
        $base_dir = "components/com_joomla_flash_uploader/tfu";
        $extra_settings = '';
        if ($row->description_mode == "true") {
            $extra_settings .= '&tfu_description_mode=true';
        }
        if ($row->hide_remote_view == "true") {
            $extra_settings .= '&hide_remote_view=true';
        }
        echo '
  <div style="z-index:1">
    <div id="flashcontent"><div class="noflash">' . sprintf(JText::_('MES_NO_FLASH'), '<a href="http://www.tinywebgallery.com/en/tfu/web_jfu.php">', '</a>') . '</p></div></div>
	<script type="text/javascript" src="components/com_joomla_flash_uploader/tfu/swfobject.js"></script>
	<script type="text/javascript">
var flashvars = {};
var params = {};
var attributes = {};
params.allowfullscreen = "true";
';
        if ($row->fix_overlay == "true") {
            echo 'params.wmode ="transparent";';
        }
        if ($width == '650') {
            echo 'params.scale = "noScale"';
        }
        echo '
   swfobject.embedSWF("components/com_joomla_flash_uploader/tfu/tfu_291.swf?joomla=true&lang=' . $lang . '&session_id=' . session_id() . '&base=' . $base_dir . '&relative_dir=' . $relative_dir . $extra_settings . '&' . $row->swf_text . '", "flashcontent", "' . $width . '", "' . $height . '", "8.0.0", "", flashvars, params, attributes);
';
        echo <<<HTML
\t</script>
\t<!-- end include with Javascript -->
\t<!-- static html include -->
\t<noscript>
\tPlease enable Javascript
\t</noscript> 
</div>
HTML;
        echo "</p>";
        echo "<br/>";
        echo JFULanguage::getLanguage($row->text_bottom_lang, $row->text_bottom, "TEXT_BOTTOM", $row->id);
        echo "<br/>";
        if (!file_exists(dirname(__FILE__) . "/tfu/.htaccess")) {
            printf(JText::_('C_HTACCESS_CREATE'), '<a href="#createhtaccess" onclick="return submitform(\'createhtaccess\')"><b>', '</b></a>');
        } else {
            printf(JText::_('C_HTACCESS_DELETE'), '<a href="#deletehtaccess" onclick="return submitform(\'deletehtaccess\')"><b>', '</b></a>');
        }
        echo "</center>";
    }
    function showFlash($row, $realfolder, $use_js_include, $plugin = false)
    {
        $language =& JFactory::getLanguage();
        $Cfg_lang = $language->getTag();
        $sess_id = session_id();
        $base_dir = 'administrator/components/com_joomla_flash_uploader/tfu';
        $relative_dir = parse_url(JURI::base());
        $relative_dir = $relative_dir['path'];
        $relative_dir = rtrim($relative_dir, "\\/.") . '/';
        // we replace to get a consistent output with different php versions!
        $width = $row->display_width;
        $height = floor($width * (340 / 650));
        $extra_settings = '';
        $extra_settings_js = '';
        if ($row->description_mode == "true") {
            $extra_settings .= '&amp;tfu_description_mode=true';
            $extra_settings_js .= 'flashvars.tfu_description_mode="true";';
        }
        if ($row->hide_remote_view == "true") {
            $extra_settings .= '&amp;hide_remote_view=true';
            $extra_settings_js .= 'flashvars.hide_remote_view="true";';
        }
        $swf_text_settings_js = '';
        if ($row->swf_text) {
            // we bring the parameters into the right js format.
            $elements = split("&", $row->swf_text);
            foreach ($elements as $element) {
                $extra_settings_js .= "flashvars." . str_replace("=", "=\"", $element) . "\";";
            }
        }
        $output = '';
        // <form action="index2.php" method="post" name="adminForm"><input type="hidden" name="option" value="com_joomla_flash_uploader"/><input type="hidden" name="task" value="config"/></form>';
        if ($row->enable_setting == "false") {
            // no flash only text!
            if ($plugin) {
                return JFULanguage::getLanguage($row->text_top_lang, $row->text_top, "TEXT_TOP", $row->id);
            } else {
                echo JFULanguage::getLanguage($row->text_top_lang, $row->text_top, "TEXT_TOP", $row->id);
                return;
            }
        }
        if (!file_exists($realfolder) && $realfolder != "") {
            $output .= "Configuration Error! The destination folder does not exist.";
            $output .= $realfolder;
        }
        if (!$plugin) {
            $output .= "<h3>";
            $output .= JFULanguage::getLanguage($row->text_title_lang, $row->text_title, "TEXT_TITLE", $row->id);
            $output .= "</h3>";
            $output .= JFULanguage::getLanguage($row->text_top_lang, $row->text_top, "TEXT_TOP", $row->id);
            $output .= "<p>";
        }
        $lang = JFULanguage::mapLangJoomlatoTFU($Cfg_lang);
        // object tag is used for noscript and if JS include is disabled in the config.
        $objecttag = '
          <object name="mymovie" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="' . $width . '" height="' . $height . '"  align="middle">
            <param name="allowScriptAccess" value="sameDomain" />
            <param name="movie" value="' . $relative_dir . 'administrator/components/com_joomla_flash_uploader/tfu/tfu_291.swf?joomla=frontend&amp;session_id=' . $sess_id . '&amp;lang=' . $lang . '&amp;base=' . $base_dir . '&amp;relative_dir=' . $relative_dir . $extra_settings . '&amp;' . $row->swf_text . '" />
            <param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />';
        if ($width == '650') {
            $objecttag .= '<param name="scale" value="noScale" />';
        }
        $objecttag .= '<param name="allowFullScreen" value="true" />
            <embed src="' . $relative_dir . 'administrator/components/com_joomla_flash_uploader/tfu/tfu_291.swf?joomla=frontend&amp;session_id=' . $sess_id . '&amp;lang=' . $lang . '&amp;base=' . $base_dir . '&amp;relative_dir=' . $relative_dir . $extra_settings . '&amp;' . $row->swf_text . '" name="mymovie" quality="high" bgcolor="#ffffff" width="' . $width . '" height="' . $height . '" align="middle" ' . ($width == '650' ? 'scale="noScale" ' : '') . ' allowfullscreen="true" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
            </object> ';
        if ($use_js_include) {
            // include with Javascript
            $output .= '
			<!-- include with javascript - best solution because otherwise you get the "klick to activate border in IE" -->
			<script type="text/javascript" src="' . $relative_dir . 'administrator/components/com_joomla_flash_uploader/tfu/swfobject.js"></script>
			<script type="text/javascript">
			   document.write(\'<div id="flashcontent"><div class="noflash">TWG Flash Uploader requires at least Flash 8.<br>Please update your browser.<\\/div><\\/div>\');
                var flashvars = {};
                var params = {};
                var attributes = {};	
                flashvars.joomla="frontend";
                flashvars.session_id="' . $sess_id . '";	
                flashvars.lang="' . $lang . '";
                flashvars.base="' . $base_dir . '";
                flashvars.relative_dir="' . $relative_dir . '";
                params.allowfullscreen = "true";		   
                ';
            $output .= $extra_settings_js;
            $output .= $swf_text_settings_js;
            if ($row->fix_overlay == "true") {
                $output .= 'params.wmode ="transparent";
                  ';
            }
            if ($width == '650') {
                $output .= 'params.scale = "noScale";
                  ';
            }
            $output .= '  swfobject.embedSWF("' . $relative_dir . 'administrator/components/com_joomla_flash_uploader/tfu/tfu_291.swf", "flashcontent", "' . $width . '", "' . $height . '", "8.0.0", "", flashvars, params, attributes);
                ';
            $output .= '
			</script>
			<!-- end include with Javascript -->
			<!-- static html include -->
			<noscript>
			Please enable Javascript.
			</noscript>
        ';
        } else {
            // include with object tag
            $output .= $objecttag;
        }
        if (!$plugin) {
            $output .= "</p>";
            $output .= "<br>" . JFULanguage::getLanguage($row->text_bottom_lang, $row->text_bottom, "TEXT_BOTTOM", $row->id);
        }
        if ($plugin) {
            return $output;
        } else {
            echo $output;
        }
    }