<%@ Page Language="C#" AutoEventWireup="true" Inherits="Sys_Template_AddReview, QianboCMS" EnableEventValidation="false" %>
<%@ Import Namespace="Qianbo.Common" %>
<%@ Import Namespace="Qianbo.Model" %>
<%@ Import Namespace="Qianbo.BLL" %>
<script language="javascript" type="text/javascript" src="<%=Param.ApplicationRootPath %>/Js/Common.js"></script>
<script type="text/javascript" language="javascript">
    function validate() {
        $("isValidate").value = "login";
    }
    function FunLoginEnabled() {
        if ($("chkNoName").checked == false) {
            $("UserName").disabled = false;
            $("userPwd").disabled = false;
            $("btnSubmit").disabled = false;
        }
        else {
            $("UserName").disabled = true;
            $("userPwd").disabled = true;
            $("btnSubmit").disabled = true;
        }
        $("isValidate").value = "nologin";
    }
    function CheckLogin() {
        try {
            if ($("isValidate").value == "login") {
                if ($("UserName").value == "") {
                    alert("用户名不能为空！");
                    $("UserName").focus();
                    $("isValidate").value = "nologin";
                    return false;
                }
            }
            if ($("isValidate").value == "login") {
                if ($("userPwd").value == "") {
                    alert("密码不能为空！");
                    $("userPwd").focus();
                    $("isValidate").value = "nologin";
                    return false;
                }
            }
        }
        catch (e) { }
        var inputValue = $('txtContent').value.trim();
        if (inputValue.length == 0) {
            try {
                if ($("isValidate").value == "login") {
                    return true;
                }
            }
            catch (e) { }
            alert('评论内容不能为空！');
            return false;
        }
        if ($("txtValidatec").value.trim().length == 0) {
            try {
                if ($("isValidate").value == "login") {
                    return true;
                }
            }
            catch (e) { }
            alert('验证码不能为空！');
            $("txtValidatec").focus();
            return false;
        }
        return true;
    }
    function myfun() {
        document.write($("txtContent2").value);
    }
    function setico(values) {
        $('txtContent').focus();
        if (document.selection) {
            var range = document.selection.createRange();
            range.text = "[" + values + "]";
        }
    }
    var clickCount = 0;
    function clearCommentContent(oObject) {
        clickCount++;
        if (clickCount == 1) {
            oObject.value = "";
        }
    }
</script>
<form name="form1" action="<%=Param.ApplicationRootPath %>/Common/AddReView.aspx" method="post" onsubmit="return CheckLogin()">
    <table align="center" width="90%" cellspacing="0" cellpadding="0">
        <tr>
            <td>
                <table width="100%" cellpadding="0" cellspacing="0">
                    <%
                    if (!isLogin)
                    {%>
                    <tr id="loginRow">
                        <td>
							用 户 名：<input type="text" maxlength="20" name="UserName" id="UserName" size="10" disabled="disabled" />
                            密 码：<input type="password" maxlength="20" name="userPwd" id="userPwd" size="10" disabled="disabled" />
                            <input type="submit" name="btnSubmit" id="btnSubmit" value="登录" disabled="disabled" onclick="validate()" />
                            匿名发表：<input type="checkbox" value="chkNoName" name="chkNoName" checked="checked" onclick="FunLoginEnabled()" />
                            <input type="hidden" name="txtIsLogin" value="<%=isLogin%>" />
                            <input type="hidden" value="nologin" id="isValidate" />
						</td>
                    </tr>
                    <%}%>
                    <tr>
                        <td>
                            <%
                            if (!IsAddCommentEditor)
                            {%>
                            <textarea id="Content" name="txtContent" style="width: 98%;" rows="8" onclick="clearCommentContent(this)"></textarea>
                            <%}
                            else
                            {%>
                            <textarea id="txtContent" name="txtContent" style="width: 98%;" rows="8" onclick="clearCommentContent(this)"></textarea>
                            <table cellpadding="0" cellspacing="0" border="0">
                                <tr style="cursor: hand;">
                                    <td>
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em01.gif" onclick="setico('em01')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em02.gif" onclick="setico('em02')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em03.gif" onclick="setico('em03')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em04.gif" onclick="setico('em04')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em05.gif" onclick="setico('em05')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em06.gif" onclick="setico('em06')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em07.gif" onclick="setico('em07')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em08.gif" onclick="setico('em08')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em09.gif" onclick="setico('em09')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em10.gif" onclick="setico('em10')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em11.gif" onclick="setico('em11')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em12.gif" onclick="setico('em12')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em13.gif" onclick="setico('em13')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em14.gif" onclick="setico('em14')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em15.gif" onclick="setico('em15')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em16.gif" onclick="setico('em16')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em17.gif" onclick="setico('em17')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em18.gif" onclick="setico('em18')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em19.gif" onclick="setico('em19')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em20.gif" onclick="setico('em20')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em21.gif" onclick="setico('em21')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em22.gif" onclick="setico('em22')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em23.gif" onclick="setico('em23')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em24.gif" onclick="setico('em24')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em25.gif" onclick="setico('em25')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em26.gif" onclick="setico('em26')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em27.gif" onclick="setico('em27')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em28.gif" onclick="setico('em28')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em29.gif" onclick="setico('em29')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em30.gif" onclick="setico('em30')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em31.gif" onclick="setico('em31')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em32.gif" onclick="setico('em32')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em33.gif" onclick="setico('em33')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em34.gif" onclick="setico('em34')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em35.gif" onclick="setico('em35')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em36.gif" onclick="setico('em36')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em37.gif" onclick="setico('em37')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em38.gif" onclick="setico('em38')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em39.gif" onclick="setico('em39')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em40.gif" onclick="setico('em40')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em41.gif" onclick="setico('em41')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em42.gif" onclick="setico('em42')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em43.gif" onclick="setico('em43')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em44.gif" onclick="setico('em44')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em45.gif" onclick="setico('em45')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em46.gif" onclick="setico('em46')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em47.gif" onclick="setico('em47')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em48.gif" onclick="setico('em48')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em49.gif" onclick="setico('em49')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em50.gif" onclick="setico('em50')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em51.gif" onclick="setico('em51')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em52.gif" onclick="setico('em52')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em53.gif" onclick="setico('em53')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em54.gif" onclick="setico('em54')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em55.gif" onclick="setico('em55')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em56.gif" onclick="setico('em56')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em57.gif" onclick="setico('em57')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em58.gif" onclick="setico('em58')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em59.gif" onclick="setico('em59')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em60.gif" onclick="setico('em60')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em61.gif" onclick="setico('em61')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em62.gif" onclick="setico('em62')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em63.gif" onclick="setico('em63')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em64.gif" onclick="setico('em64')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em65.gif" onclick="setico('em65')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em66.gif" onclick="setico('em66')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em67.gif" onclick="setico('em67')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em68.gif" onclick="setico('em68')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em69.gif" onclick="setico('em69')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em70.gif" onclick="setico('em70')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em71.gif" onclick="setico('em71')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em72.gif" onclick="setico('em72')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em73.gif" onclick="setico('em73')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em74.gif" onclick="setico('em74')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em75.gif" onclick="setico('em75')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em76.gif" onclick="setico('em76')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em77.gif" onclick="setico('em77')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em78.gif" onclick="setico('em78')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em79.gif" onclick="setico('em79')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em80.gif" onclick="setico('em80')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em81.gif" onclick="setico('em81')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em82.gif" onclick="setico('em82')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em83.gif" onclick="setico('em83')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em84.gif" onclick="setico('em84')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em85.gif" onclick="setico('em85')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em86.gif" onclick="setico('em86')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em87.gif" onclick="setico('em87')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em88.gif" onclick="setico('em88')">
                                        <img src="<%=Param.ApplicationRootPath %>/Images/Post/em89.gif" onclick="setico('em89')"></td>
                                </tr>
                            </table>
                            <%}%>
						</td>
                    </tr>
                    <tr>
                        <td>
                            <%
                            if (IsCommentValidate)
                            {
                                validate = true;
                            %>
							验证码：<input id="txtValidatec" type="text" name="txtValidate" size="10" maxlength="6" />
                            <img src="<%=Param.ApplicationRootPath %>/Common/Code.aspx" id="img1" onclick="this.src=this.src+'?'+Math.random();" alt="换个验证码" align="absmiddle" />
                            <input type="hidden" value="nologin" id="Hidden1" />
                            <%}%>
                            <input id="Submit1" type="submit" value="发表评论" />
						</td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <input id="Button1" type="hidden" name="hidModeType" value="<%=modelId%>" />
    <input id="Button2" type="hidden" name="hidNewsId" value="<%=id%>" />
    <input id="Hidden2" type="hidden" name="hidValidate" value="<%=validate%>" />
    <input id="Hidden3" type="hidden" name="hidNoName" value="<%=IsAllowCommentNoName%>" />
    <input id="Hidden4" type="hidden" name="hidColCommentSet" value="<%=isColCheckComment%>" />
</form>