<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="label_top.aspx.cs" Inherits="YXShop.Web.admin.templates.label.label_top" %>

<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>无标题页</title>
    <link href="../../style/admin.css" rel="stylesheet" type="text/css" />
 <script language="JavaScript" type="text/javascript" src="../../../configuration/js/Prototype.js"></script>
<script language="JavaScript" type="text/javascript" src="../../../configuration/js/Public.js"></script>
<script src="../../../editor/fckeditor.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">

function ReturnValue()
{
    //自定义内容
    var mystyle = document.getElementById("txtLabelContent").value;
	var cnm ="[YX:Loop,YX:LableType=HeadOrBottomInfo,YX:Class=Head]"+mystyle+"[/YX:Loop]";
    parent.getValue(cnm);
	CloseDiv();

}


function CloseDiv()
{
    parent.document.getElementById("LabelDivid").style.display="none";
}
    function getValue(value)
    {
        var textObj=document.getElementById("txtLabelContent");
        var textFeildValue=value;
        if(value!="") 
        {
            if(document.all)
            {     
                if(textObj.createTextRange && textObj.caretPos)
                {   
                    var caretPos=textObj.caretPos;   
                    caretPos.text=caretPos.text.charAt(caretPos.text.length-1)==''?textFeildValue+'':textFeildValue;   
                }
                else
                {   
                    textObj.value=textFeildValue;   
                }   
            }
            else
            {   
                if(textObj.setSelectionRange)
                {   
                    var rangeStart =textObj.selectionStart;   
                    var rangeEnd=textObj.selectionEnd;   
                    var tempStr1=textObj.value.substring(0,rangeStart);   
                    var tempStr2 =textObj.value.substring(rangeEnd);   
                    textObj.value=tempStr1+textFeildValue+tempStr2;   
                }
                else
                {   
                    alert("This version of Mozilla based browser does not support setSelectionRange");   
                }   
            }
        }
    }
    function setCaret(textObj)
    {   
        if(textObj.createTextRange)
        {   
            textObj.caretPos=document.selection.createRange().duplicate();   
        }   
    } 

</script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table class="table_label_parameter" cellpadding="1" cellspacing="1" style="width: 99%; margin-top:5px">
            <tr>
                <td>
                  选择显示信息：
                  <asp:DropDownList ID="dd_Condtion" runat="server" Height="25px" Width="151px" 
                        onchange="javascript:getValue(this.value);">
                        <asp:ListItem Value="">--请选择--</asp:ListItem>
                        <asp:ListItem Value="[#Logo]">网站LOGO</asp:ListItem>
                        <asp:ListItem Value="[#Banner]">网站Banner</asp:ListItem>
                        <asp:ListItem Value="[#SetAsDefault]">设为首页</asp:ListItem>
                        <asp:ListItem Value="[#AddToMyFavorite]">加入收藏</asp:ListItem>
                        <asp:ListItem Value="[#LoginAndReg]">登陆与注册</asp:ListItem>
                        <asp:ListItem Value="[#ShopCatchline]">商城标语</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            
            <tr>
                
                <td colspan="4">
                    <asp:TextBox runat="server" ID="txtLabelContent" height="200" onselect="setCaret(this);"  onclick="setCaret(this);"  onkeyup="setCaret(this);" Width="600" TextMode="MultiLine"></asp:TextBox>
                     </td>
            </tr>
            
            <tr>
                <td colspan="4" align="center" style="text-align:center">
                   <input id="bt_Exc" type="button" value="提交" onclick="ReturnValue()" />
                    &nbsp;<input class="form" type="button" value=" 关 闭 "  onclick="javascript:CloseDiv();" /></td>
            </tr>
            </table>
    </div>
    </form>
</body>
</html>