<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="KeywordType.ascx.cs"
    Inherits="PowerEasy.Module.General.WebSite.Admin.Controls.FieldControl.KeywordType" %>
<div class="DivWordBreak">

    <script language="JavaScript" type="text/javascript">
            <!--
            function add(obj,clientId)
            {
	            if(obj==""){return false;}
	            if(document.getElementById(clientId.toString()).value=="")
	            {
		            document.getElementById(clientId.toString()).value=obj;
		            return false;
	            }
	            var singleKey=obj.split("|");
	            var ignoreKey="";
	            for(i=0;i<singleKey.length;i++)
	            {
		            if(checkKey(document.getElementById(clientId.toString()).value,singleKey[i]))
		            {
			            ignoreKey=ignoreKey+singleKey[i]+" ";
		            }
		            else
		            {
			            document.getElementById(clientId.toString()).value = document.getElementById(clientId.toString()).value + " " + singleKey[i];
		            }
	            }
	            if(ignoreKey!="")
	            {
	                alert(ignoreKey + "<%= Resources.DynamicPageResources.Controls_FieldControl_KeywordType_JSAlert %>");
	            }
            }

            function checkKey(Keylist,thisKey)
            {
              if (Keylist==thisKey){
		            return true;
              }
              else{
	            var s=Keylist.split(" ");
	            for (j=0;j<s.length;j++){
		            if(s[j]==thisKey)
			            return true;
	            }
               return false;
              }
            }
            //-->
    </script>

    <asp:TextBox ID="TxtKeyWord" runat="server" MaxLength="255"></asp:TextBox><pe:ExtendedLiteral HtmlEncode="false"
        ID="LitArrKeyWords" runat="server"></pe:ExtendedLiteral><pec:FloatingDialog ID="FloatingDialog" runat="server" Width="600" Height="450" Name="<%$ Res: Controls_FieldControl_KeywordType_FloatingDialog_Name , 更多 %>"
        BeginString="【" EndString="】" Skin="floatingDialogFontSkin" Title="<%$ Res: Controls_FieldControl_KeywordType_FloatingDialog_Title , 关键字 %>" LoadUrl="/Accessories/KeyWordList.aspx" />
    <pe:ExtendedLiteral HtmlEncode="false" ID="LitAuotGetKeyword" runat="server"></pe:ExtendedLiteral>
    <pe:RequiredFieldValidator ID="ReqTxtKeyWord" runat="server" SetFocusOnError="true"
        Display="Dynamic" ErrorMessage="<%$ Res: Controls_FieldControl_KeywordType_ReqTxtKeyWord , 关键字不能为空 %>" Visible="false" ControlToValidate="TxtKeyWord"></pe:RequiredFieldValidator>
    <span style="color: Green">
        <%= Description %>
    </span>
</div>
