<?php

    include_once 'data_connect.php'

?>

    <!-- text editor controls -->
    <div id="editControls">
        <div class="controls-container">
            <div id="disable" class="hide"></div>
            <span id="toggle-code" title="Show html code" class="" tabindex="0" onclick="togCode()">‹/› HTML</span>
            <span id="update" class="hide" title="Show text" tabindex="0" onclick="updateCode()">›\‹ HTML</span>
            <a data-insert="bold" href="javascript:void(0)" class="ed-control" title="bold"><span class="ed ed-bold">B</span></a>
            <a data-insert="italic" href="javascript:void(0)" class="ed-control" title="italic"><span class="ed ed-italic"><i>I</i></span></a>
            <a data-insert="underline" href="javascript:void(0)" class="ed-control" title="underline"><span class="ed ed-underline"><u>U</u></span></a>
            <span href="javascript:void(0)" class="ed-control" title="Heading size" tabindex="0" id="edH"><b>H</b>
                <span class="hcon" id="headcon">
                    <a data-insert="h1" id="edh0" href="javascript:void(0)" class="ed-control" title="heading 1"><span>h1</span></a>
                    <a data-insert="h2" id="edh1" href="javascript:void(0)" class="ed-control" title="heading 2"><span>h2</span></a>
                    <a data-insert="h3" id="edh2" href="javascript:void(0)" class="ed-control" title="heading 3"><span>h3</span></a>
                    <a data-insert="h4" id="edh3" href="javascript:void(0)" class="ed-control" title="heading 4"><span>h4</span></a>
                </span>
            </span>
            <a data-insert="insertUnorderedList" href="javascript:void(0)" class="ed-control" title="Unordered list"><span class="ed ed-list-ul">ul</span></a>
            <a data-insert="insertOrderedList" href="javascript:void(0)" class="ed-control" title="Ordered list"><span class="ed ed-list-ul">ol</span></a>
            <a data-insert="createLink" href="javascript:void(0)" class="ed-control" title="Link"><img class="ed-img" src="images/link.png"></a>
            <a data-insert="unlink" href="javascript:void(0)" class="ed-control" title="Unlink"><img class="ed-img" src="images/unlink.png"></a>
            <a data-insert="insertImage" href="javascript:void(0)" class="ed-control" title="Insert image"><img class="ed-img" src="images/img.png"></a>
            <a data-insert="foreColor" href="javascript:void(0)" class="ed-control" title="Font color"><span class="ed ed-color">A</span></a>
            <span href="javascript:void(0)" class="ed-control" id="edT" title="Text" tabindex="0"><b>Text</b>
                <span class="hcon" id="textcon">
                    <a data-insert="justifyLeft" id="edt0" href="javascript:void(0)" class="ed-control" title="Align left"><img src="images/left.png"></a>
                    <a data-insert="JustifyRight" id="edt1" href="javascript:void(0)" class="ed-control" title="Align right"><img src="images/right.png"></a>
                    <a data-insert="justifyFull" id="edt2" href="javascript:void(0)" class="ed-control" title="Justify"><img src="images/justify.png"></a>
                    <a data-insert="justifyCenter" id="edt3" href="javascript:void(0)" class="ed-control" title="Centered"><img src="images/center.png"></a>
                    <div style="clear:both;height:1px;margin:4px auto;width:160px"></div>
                    <a data-insert="indent" id="edt4" href="javascript:void(0)" class="ed-control" title="Text indent"><img src="images/indent.png"></a>
                    <a data-insert="outdent" id="edt5" href="javascript:void(0)" class="ed-control" title="Text outdent"><img src="images/outdent.png"></a>                    </span>
            </span>
            <a data-insert="removeFormat" href="javascript:void(0)" class="ed-control" title="Remove format"><span class="ed">T<sub style="font-size:11px">x</sub></span></a>
                <?php if (isset($pval['html_content'])) : ?>
            <a data-insert="div" href="javascript:void(0)" class="ed-control" title="Read more"><img class="ed-img" src="images/limit.png" style="width:auto"></a>
                <?php endif ?>
        </div>
    </div>
    
    <script>    
        function loadc() {
            var _code = document.getElementById('output').value;
            document.getElementById('editor').innerHTML = _code;
        }
    </script>
    <script>addEventListener('load',loadc);</script>