//
// Create HTML for Epoz-Editor
//
// Comment out the parts you don't want to be shown.
//

function CreateEpoz() {

    var widget = '';
    var spacer = '<img src="'+form_path+'epoz_button_space.gif" width="2" height="1">';

    widget += '<div id="EpozToolbar">';

/*
    The select-box for formats
*/

    widget += '<select id="formatblock" onchange="SelectFormat(this);" style="margin-bottom: 2px;">';
    widget += '<option value="">'+EpozLang["Normal"]+'</option>';
    widget += '<option value="<p>">'+EpozLang["Paragraph"]+'</option>';
    widget += '<option value="<h1>">'+EpozLang["Heading1"]+'</option>';
    widget += '<option value="<h2>">'+EpozLang["Heading2"]+'</option>';
    widget += '<option value="<h3>">'+EpozLang["Heading3"]+'</option>';
    widget += '<option value="<h4>">'+EpozLang["Heading4"]+'</option>';
    widget += '<option value="<h5>">'+EpozLang["Heading5"]+'</option>';
    widget += '<option value="<h6>">'+EpozLang["Heading6"]+'</option>';
    widget += '<option value="<pre>">'+EpozLang["Formatted"]+'</option>';
    widget += '</select>';
    widget += '<br />';

/*
    The font-face-buttons (bold, italic, underline)
*/

    widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_bold.gif" width="23" height="22" alt="'+EpozLang["Bold"]+'" title="'+EpozLang["Bold"]+'" onClick="FormatText(\'bold\', \'\');" />';
    widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_italic.gif" width="23" height="22" alt="'+EpozLang["Italic"]+'" title="'+EpozLang["Italic"]+'" onClick="FormatText(\'italic\', \'\');" />';
    widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_underline.gif" width="23" height="22" alt="'+EpozLang["Underline"]+'" title="'+EpozLang["Underline"]+'" onClick="FormatText(\'underline\', \'\');" />';
    widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_strikethrough.gif" width="23" height="22" alt="'+EpozLang["Strikethrough"]+'" title="'+EpozLang["Strikethrough"]+'" onClick="FormatText(\'strikethrough\', \'\');" />';
    widget += spacer;

/*
    The sub-/superscript-buttons
*/

    widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_subscript.gif" width="23" height="22" alt="'+EpozLang["Subscript"]+'" title="'+EpozLang["Subscript"]+'" onClick="FormatText(\'subscript\', \'\');" />';
    widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_superscript.gif" width="23" height="22" alt="'+EpozLang["Superscript"]+'" title="'+EpozLang["Superscript"]+'" onClick="FormatText(\'superscript\', \'\');" />';
    widget += spacer;

/*
    The remove-format-button
*/

    widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_unformat.gif" width="23" height="22" alt="'+EpozLang["RemoveFormat"]+'" title="'+EpozLang["RemoveFormat"]+'" onClick="FormatText(\'removeformat\', \'\');" />';
    widget += spacer;

/*
    The color-selections (foreground, background)
*/
    widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_textcolor.gif" width="23" height="22" alt="'+EpozLang["TextColor"]+'" title="'+EpozLang["TextColor"]+'" onClick="SetTextColor();" />';
    widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_bgcolor.gif" width="23" height="22" alt="'+EpozLang["BackColor"]+'" title="'+EpozLang["BackColor"]+'" onClick="SetBackColor();" />';
    widget += spacer;

/*
    Alignment-controls
*/
    widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_left_just.gif" width="23" height="22" alt="'+EpozLang["AlignLeft"]+'" title="'+EpozLang["AlignLeft"]+'" onClick="FormatText(\'justifyleft\', \'\');" />';
    widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_centre.gif" width="23" height="22" alt="'+EpozLang["Center"]+'" title="'+EpozLang["Center"]+'" onClick="FormatText(\'justifycenter\', \'\');" />';
    widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_right_just.gif" width="23" height="22" alt="'+EpozLang["AlignRight"]+'" title="'+EpozLang["AlignRight"]+'" onClick="FormatText(\'justifyright\', \'\');" />';
    widget += spacer;

/*
    Lists and In/Outdent
*/
    widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_numbered_list.gif" width="23" height="22" alt="'+EpozLang["OrderedList"]+'" title="'+EpozLang["OrderedList"]+'" onClick="FormatText(\'insertorderedlist\', \'\');" />';
    widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_list.gif" width="23" height="22" alt="'+EpozLang["UnorderedList"]+'" title="'+EpozLang["UnorderedList"]+'" onClick="FormatText(\'insertunorderedlist\', \'\');" />';
    widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_outdent.gif" width="23" height="22" alt="'+EpozLang["Outdent"]+'" title="'+EpozLang["Outdent"]+'" onClick="FormatText(\'outdent\', \'\');" />';
    widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_indent.gif" width="23" height="22" alt="'+EpozLang["Indent"]+'" title="'+EpozLang["Indent"]+'" onClick="FormatText(\'indent\', \'\');" />';
    widget += spacer;

/*
    Insert Link, Image, Rule, Table
*/
    widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_hyperlink.gif" width="23" height="22" alt="'+EpozLang["InsertLink"]+'" title="'+EpozLang["InsertLink"]+'" onClick="CreateLink();" />';
    widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_anchor.gif" width="23" height="22" alt="'+EpozLang["InsertAnchor"]+'" title="'+EpozLang["InsertAnchor"]+'" onClick="CreateAnchor();" />';
    widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_image.gif" width="23" height="22" alt="'+EpozLang["InsertImage"]+'" title="'+EpozLang["InsertImage"]+'" onClick="CreateImage();" />';
    widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_hr.gif" width="23" height="22" alt="'+EpozLang["InsertRule"]+'" title="'+EpozLang["InsertRule"]+'" onClick="FormatText(\'inserthorizontalrule\', \'\');" />';
    widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_table.gif" width="23" height="22" alt="'+EpozLang["InsertTable"]+'" title="'+EpozLang["InsertTable"]+'" onClick="window.open(\''+form_path+'epoz_script_table.html\',\'EpozTable\',\'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=220,height=220\');" />';

/*
    The optional toolbox
*/
    if ((form_toolbox != null) && (form_toolbox != "")) {
        widget += spacer;
        widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_tools.gif" width="23" height="22" alt="'+EpozLang["Toolbox"]+'" title="'+EpozLang["Toolbox"]+'"" onClick="window.open(\''+form_toolbox+'\',\'EpozToolbox\',\'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=400,height=400\');" />';
    }

    widget += spacer;

/*
    Undo & Redo
*/

    widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_undo.gif" width="23" height="22" alt="'+EpozLang["Undo"]+'" title="'+EpozLang["Undo"]+'" onClick="FormatText(\'undo\', \'\');" />';
    widget += '<img style="'+form_button_style+'" src="'+form_path+'epoz_button_redo.gif" width="23" height="22" alt="'+EpozLang["Redo"]+'" title="'+EpozLang["Redo"]+'" onClick="FormatText(\'redo\', \'\');" />';

/*
     Don't remove!!! And better not touch...;)
*/

    widget += '\n<br />\n';
    widget += '<iframe src="'+form_pageurl+'/epoz_blank_iframe.html?charset='+form_charset+'&css='+form_css+'&customcss='+form_customcss+'&pageurl='+form_pageurl+'" frameborder="0" id="' + Epoz + '" style="' + form_area_style + '" onload="InitDocument(this);"></iframe>';
    widget += '</div>';

    widget += '<textarea style="display: none; ' + form_area_style + '"  id="' + form_name + '" name="' + form_name + '" value=""></textarea>';
    widget += '<div style="margin: 0px;"><input id="EpozViewMode" style="margin: 0px; width: 10px; height: 10px;" type="checkbox" onclick="redirectAndSwitchViewMode(this);" />&nbsp;<span style="font-size: 10px;">' + EpozLang["HTML"] + '</span></div>';

    document.writeln(widget);
}


// Create a default-textbox for browsers without Rich-Text-Features

function CreateTextarea() {
    document.writeln('<textarea name="' + form_name + '" id="' + Epoz + '" style="' + form_area_style + '">'+form_data+'</textarea>');
}