<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="HtmlBox.ascx.cs" Inherits="MTCUN.HtmlBox.HtmlBox" %>
<div id="div_editParent" style="position: relative; height: auto; margin: 0px; padding: 0px;
    background-color: #ECE9D8; width: 100%; height: 50%" runat="server">
    <div id="div_border" style="border: solid 1px #ACA899; margin: 0px; padding: 0px;
        height: 100%" runat="server">
        <div id="div_header" style="height: auto; margin: 0px; padding: 0px;" runat="server">
            <div style="border-bottom: solid 1px #ffffff; margin: 0px; padding: 3px">
                <div class="tools_select" style="width: 106px" unselectable="on">
                    <select onchange="FontName(<%=this.ClientID %>_HtmlEdit,this.value)">
                        <option value="" selected="selected">字体</option>
                        <option value="Arial">Arial</option>
                        <option value="Courier New">Courier New</option>
                        <option value="Garamond">Garamond</option>
                        <option value="Georgia">Georgia</option>
                        <option value="Tahoma">Tahoma</option>
                        <option value="Times New Roman">Times</option>
                        <option value="Verdana">Verdana</option>
                    </select>
                </div>
                <div class="tools_select" style="width: 80px" unselectable="on">
                    <select onchange="FontSize(<%=this.ClientID %>_HtmlEdit,this.value)">
                        <option value="0" selected="selected">选择字号</option>
                        <option value="1">1号字</option>
                        <option value="2">2号字</option>
                        <option value="3">3号字</option>
                        <option value="4">4号字</option>
                        <option value="5">5号字</option>
                        <option value="6">6号字</option>
                        <option value="7">7号字</option>
                    </select>
                </div>
                <div class="tools_select" style="width: 104px" unselectable="on">
                    <select onchange="ForeColor(<%=this.ClientID %>_HtmlEdit,this.value)">
                        <option value="" selected="selected">颜色</option>
                        <option style="background-color: #000000" value="#000000">Black</option>
                        <option style="background-color: #808080" value="#808080">Gray</option>
                        <option style="background-color: #A9A9A9" value="#A9A9A9">DarkGray</option>
                        <option style="background-color: #D3D3D3" value="#D3D3D3">LightGray</option>
                        <option style="background-color: #FFFFFF" value="#FFFFFF">White</option>
                        <option style="background-color: #7FFFD4" value="#7FFFD4">Aquamarine</option>
                        <option style="background-color: #0000FF" value="#0000FF">Blue</option>
                        <option style="background-color: #000080" value="#000080">Navy</option>
                        <option style="background-color: #800080" value="#800080">Purple</option>
                        <option style="background-color: #FF1493" value="#FF1493">DeepPink</option>
                        <option style="background-color: #EE82EE" value="#EE82EE">Violet</option>
                        <option style="background-color: #FFC0CB" value="#FFC0CB">Pink</option>
                        <option style="background-color: #006400" value="#006400">DarkGreen</option>
                        <option style="background-color: #008000" value="#008000">Green</option>
                        <option style="background-color: #9ACD32" value="#9ACD32">YellowGreen</option>
                        <option style="background-color: #FFFF00" value="#FFFF00">Yellow</option>
                        <option style="background-color: #FFA500" value="#FFA500">Orange</option>
                        <option style="background-color: #FF0000" value="#FF0000">Red</option>
                        <option style="background-color: #A52A2A" value="#A52A2A">Brown</option>
                        <option style="background-color: #DEB887" value="#DEB887">BurlyWood</option>
                        <option style="background-color: #F5F5DC" value="#F5F5DC">Beige</option>
                    </select>
                </div>
                <script type="text/javascript">
                function <%=this.ClientID %>_showTools()
                {
                    var tools= new Array
                    ("Bold",
                    "Italic",
                    "Underline",
                    "StrikeThrough",

                    "RemoveFormat",
                    "JustifyLeft",
                    "JustifyCenter",
                    "JustifyRight",
                    "InsertUnorderedList",
                    "InsertOrderedList",
                    "Indent",
                    "Outdent",
                    "InsertImage",
                    "OpenImageBox",
                    "CreateLink");

                    var html = "";
                    for(i = 0;i<tools.length;i++)
                    {
                    html += "<div class='tools_btn' onmousemove='OnMouseMove(this)' onclick='"+tools[i]+"(<%=this.ClientID %>_HtmlEdit,this)' style='background-image:url(<%=GetTemplateSourceDirectory() %>images/"+tools[i]+".gif);' unselectable='on'></div>";
                    }
                    document.write(html); 
                    }

                    <%=this.ClientID %>_showTools();
                </script>
                <div style="clear: both; height: 0px; font-size: 0; line-height: 0px">
                </div>
            </div>
        </div>
        <div id="div_edit" style="position: absolute; top: 0px; left: 1px; right: 1px; bottom: 0px;
            height: 100%; background-color: #ffffff" runat="server">
            <iframe runat="server" id="HtmlEdit" style="width: 100%; height: 100%;" frameborder="0">
            </iframe>
        </div>
        <div id="div_footer" style="position: absolute; height: 25px; top: auto; left: 1px;
            right: 1px; bottom: 1px; z-index: 999" runat="server">
            <div style="border-top: solid 1px #ffffff">
                <div id="BtnDesign" runat="server" class="div_editbtn">
                    设计
                </div>
                <div id="BtnSource" runat="server" class="div_editbtn">
                    源码</div>
                <div style="clear: both; height: 0px; font-size: 0; line-height: 0px">
                </div>
            </div>
        </div>
    </div>
</div>
<div id="divPopup" style="position: absolute; width: auto; height: auto; visibility: hidden;
    visibility: hidden; padding: 0px; margin: 0px; border-width: 1px; z-index: 100000;
    border-color: #c0c0c0; background-color: #ffffff">
</div>
<div id="div_InsertImage" style="margin: 0px; visibility: hidden; display: none">
    <div style="padding: 10px">
        网络图片地址：{0}
        <br>
        <input type="button" value="确定" onclick="closedivPopup();InsertImage2(<%=this.ClientID %>_HtmlEdit,picUrl.value)"
            unselectable="on" />
        <input type="button" value="取消" onclick="closedivPopup()" unselectable="on" />
    </div>
</div>
<div id="div_CreateLink" style="margin: 0px; visibility: hidden; display: none">
    <div style="padding: 10px">
        网络地址：{0}
        <br>
        <input type="button" value="确定" onclick="closedivPopup();CreateLink2(<%=this.ClientID %>_HtmlEdit,linkUrl.value)"
            unselectable="on" />
        <input type="button" value="取消" onclick="closedivPopup()" unselectable="on" />
    </div>
</div>
<input id="hidContent" type="hidden" runat="server" />
<input id="hidMode" type="hidden" runat="server" />