<%@ page language="C#" autoeventwireup="true" inherits="V5Shop.Admin.Template_Lable_Operate, V5Shop.Shop.Template" enableviewstatemac="false" enableEventValidation="false" viewStateEncryptionMode="Never" %>
<%@ Register Src="control/PageBottom.ascx" TagName="PageBottom" TagPrefix="uc1" %>
<%@ Register Assembly="V5Shop.Control" Namespace="V5Shop.Control" TagPrefix="cc1" %>
<!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 runat="server">
    <title>标签详细</title>
<link href="css/css.css" rel="stylesheet" type="text/css" />
<link href="css/css_list.css" rel="stylesheet" type="text/css" />
<link href="css/control.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" language="javascript" src="js/Common.js"></script>
<script type="text/javascript" src="editor/fckeditor.js"></script>
</head>
<body>
    <form id="form1" runat="server">
    <div id="Review" onmousedown="init(this)" onmousemove="moveit(this)" onmouseup="stopdrag(this)" style="display:none;z-index:10000; border:solid 1px black; position:absolute; top:50px; left:150px; background-color:White;">
        <div class="OperateTitle">
            <span>【 效果预览 】</span>
        </div>
        <div id="Review_Content"></div>
        <div align="center">
            <input type="button" value="隐藏" class="button" onclick="Resume()" />
        </div>
    </div>
    <div id="AlphaField" style="background-color:#EEE;filter:alpha(opacity=50); position:absolute; left:0px; height:0px; width:100%; height:600px; z-index:9999; display:none;"></div>
    <div class="OperateTitle">
        <div>
            <asp:Label ID="lblTitleAdd" runat="server" Text="【 标签添加 】"></asp:Label> 
            <asp:Label ID="lblTitleEdit" runat="server" Text="【 标签编辑 】" Visible="false"></asp:Label> 
            <a href="Template_Lable_Manage.aspx" title="返回标签列表">返回列表</a>
        </div>
    </div>
    <div>
        <table id="OperateTable" width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
                <td width="20%" height="30" align="right">
                    <asp:Label ID="Label1" runat="server" Text="模板名称："></asp:Label> 
                </td>
                <td align="left">
                    默认第一套模板
                </td>
            </tr>
            <tr>
                <td width="20%" height="30" align="right">
                    <asp:Label ID="lblcategory" runat="server" Text="标签分类："></asp:Label> 
                </td>
                <td align="left">
                    <asp:DropDownList ID="ddlXMLCategory" runat="server" Width="150px"></asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td width="20%" height="30" align="right">
                    <asp:Label ID="lblTitle" runat="server" Text="标签名称："></asp:Label> 
                </td>
                <td align=left>
                    <asp:TextBox ID="txtTitle" runat="server" Width="300px" MaxLength="100"></asp:TextBox>  
                    <span class="NeedMsg">*</span>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="txtTitle" runat="server" ErrorMessage="不能为空"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td width="20%" height="30" align="right">
                <a href="javascript:void(0);" onclick="HiddenOrShowSearch()">
                                    <img id="searchimg" src="images/more.gif" align="absmiddle" />
                                    <span id="searchwd">更多</span></a> 
                                    |
                    <asp:Label ID="lblInsert" runat="server" Text="插入标签："></asp:Label> 
                </td>
                <td align=left>
                    <table width="100%">
                        <tr>
                            <td width="90%">
                    <div>
                        <input value="商品" type="button" class="button" onClick="OpenDialogLable('Template_Lable_Malls_Dialog.aspx',550,660);" />
                        <input value="商品常规" type="button" class="button" onClick="OpenDialogLable('Template_Lable_Malls_Link_Dialog.aspx',550,513);" />
                        <input value="商品分类" type="button" class="button" onClick="OpenDialogLable('Template_Lable_Category_Dialog.aspx',550,560);" />
                        <input value="商品分类常规" type="button" class="button" onClick="OpenDialogLable('Template_Lable_Category_Link_Dialog.aspx',550,560);" />
                        <input value="品牌" type="button" class="button" onClick="OpenDialogLable('Template_Lable_Brand_Dialog.aspx',550,660);" />
                        <input value="品牌常规" type="button" class="button" onClick="OpenDialogLable('Template_Lable_Brand_Link_Dialog.aspx',550,513);" />
                        <input value="文章" type="button" class="button" onClick="OpenDialogLable('Template_Lable_Article_Dialog.aspx',550,560);" />
                        <input value="文章常规" type="button" class="button" onClick="OpenDialogLable('Template_Lable_Article_Link_Dialog.aspx',550,560);" />
                    <input value="全局" type="button" class="button" onClick="OpenDialogLable('Template_Style_Public_Dialog.aspx',550,560);" />
                    </div>
                    <div id="searchmore" style="display: none;">
                        <div style="padding-top:4px;">
                        <input value="导购" type="button" class="button" onClick="OpenDialogLable('Template_Lable_Guide_Dialog.aspx',550,560);" />
                        <input value="导购常规" type="button" class="button" onClick="OpenDialogLable('Template_Lable_Guide_Link_Dialog.aspx',550,560);" />
                        <input value="文章分类" type="button" class="button" onClick="OpenDialogLable('Template_Lable_ArticleCategory_Dialog.aspx',550,560);" />
                        <input value="文章分类常规" type="button" class="button" onClick="OpenDialogLable('Template_Lable_ArticleCategory_Link_Dialog.aspx',550,560);" />
                        <input value="夺宝奇兵" type="button" class="button" onClick="OpenDialogLable('Template_Lable_Snatch_Dialog.aspx',550,560);" />
                        <input value="夺宝奇兵常规" type="button" class="button" onClick="OpenDialogLable('Template_Lable_Snatch_Link_Dialog.aspx',550,560);" />
                        <input value="FORM表单" type="button" class="button" onClick="OpenDialogLable('Template_Style_FormInfo_Dialog.aspx',550,560);" />
                    </div>
                    <div style="padding-top:4px;">
                        <input value="团购" type="button" class="button" onClick="OpenDialogLable('Template_Lable_Group_Dialog.aspx',550,560);" />
                        <input value="团购常规" type="button" class="button" onClick="OpenDialogLable('Template_Lable_Group_Link_Dialog.aspx',550,560);" />
                        <input value="优惠卷" type="button" class="button" onClick="OpenDialogLable('Template_Lable_Coupon_Dialog.aspx',550,660);" />
                        <input value="优惠卷常规" type="hidden" class="button" onClick="OpenDialogLable('Template_Lable_Coupon_Link_Dialog.aspx',550,513);" />
                        <input value="活动" type="button" class="button" onClick="OpenDialogLable('Template_Lable_Activity_Dialog.aspx',550,560);" />
                        <input value="活动常规" type="button" class="button" onClick="OpenDialogLable('Template_Lable_Activity_Link_Dialog.aspx',550,560);" />
                        <input value="公告" type="button" class="button" onClick="OpenDialogLable('Template_Lable_Notice_Dialog.aspx',550,560);" />
                        <input value="公告常规" type="button" class="button" onClick="OpenDialogLable('Template_Lable_Notice_Link_Dialog.aspx',550,560);" />
                        <input value="通用标签" type="button" class="button" onClick="OpenDialogLable('Template_Lable_Public_Dialog.aspx',550,560);" />
                        <input value="广告标签" type="button" class="button" onClick="OpenDialogLable('Template_Lable_Ads.aspx',550,560);" />
                    </div>
                    </div>
                        </td>
                        <td width="10%">
                             
                        </td>
                    </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td height="30" align="right">
                    <asp:Label ID="Label2" runat="server" Text="标签列表："></asp:Label> 
                </td>
                <td align=left>
                    <%=ButtonStr %>
                    <input value="编辑选中标签" type="button" class="button" onClick="EditLabel();" />
                    <input value="编辑选中标签样式" type="button" class="button" onClick="EditLabelStyle();" />
                    |
                    <asp:Label ID="lblList" runat="server" Text="插入图片："></asp:Label> 
                    <input value="选择图片" type="button" class="button" onClick="OpenDialogPage();" />
                </td>
            </tr>
            <tr>
                <td height="30" align="right">
                    <asp:Label ID="lblcontent" runat="server" Text="标签内容："></asp:Label> 
                </td>
                <td align=left>
                    <noscript>由于您的浏览器禁止了脚本，所以无法调用该编辑器</noscript>
                    <cc1:FCKeditor ID="fckcontent" runat="server" width="600px"></cc1:FCKeditor>
                </td>
            </tr>
            <tr>
                <td height="30" align="right"></td>
                <td align=left>
                    <asp:Button ID="btnAdd" runat="server" Text="确定" OnClick="btnAdd_Click" class="button"/>
                    <asp:Button ID="btnEdit" runat="server" Text="更新" OnClick="btnEdit_Click" Visible="False" class="button"/>
                    <input id="iptReset" runat="server" type="reset" value="重置" class="button"/>    
                    <input id="Button1" runat="server" type="button" value="返回列表" onclick="window.location.href='Template_Lable_Manage.aspx'" class="button"/>    
                    <input id="Button2" runat="server" type="button" value="预览效果" onclick="ViewEffect()" class="button"/>     
                </td>
            </tr>
        </table>  
        <script type="text/javascript">
            //加TABLE样式
            InitTrClass();
//            function submitForm(Formobj)
//            {
//	            Formobj.elements.labcontent.value = web_Editor.getHTMLBody();
//	            /*Formobj.submit()*/
//            }
//            function Insertlabel_News(URL,widthe,heighte,obj)
//            {
//                var obj = window.showModalDialog("web_inc/convert.htm?"+URL,widthe,heighte,'window',obj)
//                if (obj==undefined)return false;
//                if (obj!='')InsertEditor(obj);
//            }
//            function InsertEditor(InsertValue)
//            {
//	            web_Editor.insertHTML(InsertValue);
//            }
//            function opencat(cat)
//            {
//              if(cat.style.display=="none"){
//                 cat.style.display="";
//              } else {
//                 cat.style.display="none"; 
//              }
//            }
//            function CheckForm(FormObj)
//            {
//	            FormObj.TxtFileds.value = web08_lable.getXHTMLBody();
//	            return true;
//            }
            //打开标签选择对话框
            function OpenDialogLable(url, w, h, editTxt){
                if(typeof(editTxt) == "undefined"){
                    editTxt = "";
                }
                if (navigator.appVersion.indexOf("MSIE") == -1){
                    this.returnAction=function(strResult){
                        if(strResult!=null){
                            if(strResult!=""){
                                var oEditor = FCKeditorAPI.GetInstance('fckcontent'); 
                                oEditor.InsertHtml(strResult);
                            }
                        }
                    }
                    window.open(url + '?d=' + Date()+"&t=" + escape(editTxt),'newWin','modal=yes,width='+w+',height='+h+',top=200,left=300,resizable=no,scrollbars=no');
                    return;
                }else{
                    var GetValue = showModalDialog(url + '?d=' + Date() + "&t=" + escape(editTxt), null, 'dialogWidth:'+w+'px; dialogHeight:'+h+'px;')
                    if (GetValue != null) {
                        if(GetValue!=""){
                            var oEditor = FCKeditorAPI.GetInstance('fckcontent'); 
                            oEditor.InsertHtml(GetValue);
                        }
                    } 
                }
            }
            
            //打开模式对话框（图片选择）
            function OpenDialogPage(){
                if (navigator.appVersion.indexOf("MSIE") == -1){
                    this.returnAction=function(strResult){
                        if(strResult!=null){
                            var oEditor = FCKeditorAPI.GetInstance('fckcontent'); 
                            oEditor.InsertHtml("<img src='/v5shop/" + strResult + "'>");
                        }
                    }
                    window.open('Template_Picture_Manage_Dialog.aspx?d=' + Date(),'newWin','modal=yes,width=550,height=550,top=200,left=300,resizable=no,scrollbars=no');
                    return;
                }else{
                    var GetValue = showModalDialog('Template_Picture_Manage_Dialog.aspx?d=' + Date(),'','dialogWidth:550px;dialogHeight:550px;')
                    if (GetValue != null) {
                        var oEditor = FCKeditorAPI.GetInstance('fckcontent'); 
                            oEditor.InsertHtml("<img src='/v5shop/" + GetValue + "'>");
                    } 
                }
            }
            
            function SelectLabel(label){
                var oEditor = FCKeditorAPI.GetInstance('fckcontent'); 
                if(oEditor.EditMode == 1){
                    alert('源代码编辑模式下无法使用此功能');
                    return;
                }
                var EditHtml = oEditor.EditorDocument;
                
                var inptxt = label;
                if(oEditor.GetXHTML(true).indexOf(inptxt) != -1){
                    if (navigator.appVersion.indexOf("MSIE") != -1){ 
                        var rng = oEditor.EditorDocument.body.createTextRange();
                        rng.findText(inptxt,1,0);   
                        rng.scrollIntoView();   
                        rng.select();
                        rng.collapse(false);  
                        //EditLabel(); 
                    }else{
                        var sel = oEditor.EditorWindow.getSelection();
                        var rng = oEditor.EditorDocument.createRange();    
                        var M = oEditor.EditorDocument.createTextNode(inptxt);
                        rng.setStart(M, 0);
                        rng.setEnd(M, M.length);
                        sel.removeAllRanges();
                        sel.addRange(rng);
                    }
                }else{
                    alert("该标签不存在或者已经被删除");
                }
            }
            
            function EditLabel(){
                var oEditor = FCKeditorAPI.GetInstance('fckcontent'); 
                if(oEditor.EditMode == 1){
                    alert('必须在设计模式下使用此功能');
                    return;
                }
                if (navigator.appVersion.indexOf("MSIE") != -1){
                    var EditHtml = oEditor.EditorDocument.selection.createRange().text;
                    if(EditHtml.indexOf("{Web:") != -1 || EditHtml.indexOf("{web:") != -1){
                        if(EditHtml.indexOf("ClassMalls") != -1 || EditHtml.indexOf("ClassList") != -1){
                            OpenDialogLable('Template_Lable_Malls_Dialog.aspx',550,460,EditHtml);
                        }else if(EditHtml.indexOf("GroupBuy") != -1 || EditHtml.indexOf("GroupList") != -1){
                            OpenDialogLable('Template_Lable_Group_Dialog.aspx',550,460,EditHtml);
                        }else if(EditHtml.indexOf("readclass") != -1 ){
                            OpenDialogLable('Template_Lable_Category_Link_Dialog.aspx',550,460,EditHtml);   
                        }else if(EditHtml.indexOf("MallGuide") != -1 || EditHtml.indexOf("GuideList") != -1){
                            OpenDialogLable('Template_Lable_Guide_Dialog.aspx',550,460,EditHtml);
                        }else if(EditHtml.indexOf("articleclasscode") != -1){
                            OpenDialogLable('Template_Lable_ArticleCategory_Dialog.aspx',550,460,EditHtml);
                        }else if(EditHtml.indexOf("ClassCode") != -1 || EditHtml.indexOf("classcode") != -1){
                            OpenDialogLable('Template_Lable_Category_Dialog.aspx',550,460,EditHtml);
                        }else if(EditHtml.indexOf("readarticlecate") != -1 ){
                            OpenDialogLable('Template_Lable_ArticleCategory_Link_Dialog.aspx',550,360,EditHtml);
                        }else if(EditHtml.indexOf("Activity") != -1){
                            OpenDialogLable('Template_Lable_Activity_Dialog.aspx',550,460,EditHtml);
                        }else if(EditHtml.indexOf("Snatch") != -1){
                            OpenDialogLable('Template_Lable_Snatch_Dialog.aspx',550,460,EditHtml);
                        }else if(EditHtml.indexOf("readmalls") != -1 || EditHtml.indexOf("mallself") != -1 || EditHtml.indexOf("mallact") != -1 || EditHtml.indexOf("mallpro") != -1 || EditHtml.indexOf("mallproperty") != -1 || EditHtml.indexOf("mallfit") != -1 || EditHtml.indexOf("mallreview") != -1 || EditHtml.indexOf("mallimg") != -1 || EditHtml.indexOf("mallviewnext") != -1 || EditHtml.indexOf("mallcollect") != -1 || EditHtml.indexOf("mallview") != -1  || EditHtml.indexOf("mallarticle") != -1){
                            OpenDialogLable('Template_Lable_Malls_Link_Dialog.aspx',550,460,EditHtml);    
                        }else if(EditHtml.indexOf("readarticle") != -1 || EditHtml.indexOf("articleself") != -1 || EditHtml.indexOf("articlemall") != -1 || EditHtml.indexOf("articlereview") != -1){
                            OpenDialogLable('Template_Lable_Article_Link_Dialog.aspx',550,360,EditHtml);
                        }else if(EditHtml.indexOf("mallbrand") != -1 || EditHtml.indexOf("brandlist") != -1){
                            OpenDialogLable('Template_Lable_Brand_Dialog.aspx',550,460,EditHtml);
                        }else if(EditHtml.indexOf("brandpro") != -1 || EditHtml.indexOf("readbrand") != -1){
                            OpenDialogLable('Template_Lable_Brand_Link_Dialog.aspx',550,460,EditHtml);
                        }else if(EditHtml.indexOf("shippingadvice") != -1 || EditHtml.indexOf("imglink") != -1 || EditHtml.indexOf("wordlink") != -1 || EditHtml.indexOf("poll") != -1 || EditHtml.indexOf("gbook") != -1 || EditHtml.indexOf("productkey") != -1 || EditHtml.indexOf("articlekey") != -1 || EditHtml.indexOf("infosearch") != -1 || EditHtml.indexOf("infodetail") != -1 || EditHtml.indexOf("helpcate") != -1 || EditHtml.indexOf("readhelpcate") != -1 || EditHtml.indexOf("helplist") != -1 || EditHtml.indexOf("readhelp") != -1 || EditHtml.indexOf("onlinetool") != -1 || EditHtml.indexOf("kft") != -1 || EditHtml.indexOf("kftbutton") != -1 || EditHtml.indexOf("userlogin") != -1 || EditHtml.indexOf("onlinetoolfloat") != -1){
                            OpenDialogLable('Template_Lable_Public_Dialog.aspx',550,360,EditHtml);
                        }else if(EditHtml.indexOf("article") != -1 || EditHtml.indexOf("articlelist") != -1 ){
                            OpenDialogLable('Template_Lable_Article_Dialog.aspx',550,360,EditHtml);
                        }else if(EditHtml.indexOf("readguide") != -1 || EditHtml.indexOf("guidepro") != -1){
                            OpenDialogLable('Template_Lable_Guide_Link_Dialog.aspx',550,360,EditHtml);
                        }else if(EditHtml.indexOf("readsnatch") != -1 || EditHtml.indexOf("snatchlink") != -1 || EditHtml.indexOf("snatchprice") != -1){
                            OpenDialogLable('Template_Lable_Snatch_Link_Dialog.aspx',550,360,EditHtml);
                        }else if(EditHtml.indexOf("readgroup") != -1 || EditHtml.indexOf("grouppro") != -1){
                            OpenDialogLable('Template_Lable_Group_Link_Dialog.aspx',550,360,EditHtml);
                        }else if(EditHtml.indexOf("MallCoupon") != -1 || EditHtml.indexOf("CouponList") != -1){
                            OpenDialogLable('Template_Lable_Coupon_Dialog.aspx',550,360,EditHtml);
                        }else if(EditHtml.indexOf("readactivity") != -1){
                            OpenDialogLable('Template_Lable_Activity_Link_Dialog.aspx',550,360,EditHtml);
                        }else if(EditHtml.indexOf("classnotice") != -1 || EditHtml.indexOf("noticelist") != -1){
                            OpenDialogLable('Template_Lable_Notice_Dialog.aspx',550,360,EditHtml);
                        }else if(EditHtml.indexOf("readnotice") != -1 ){
                            OpenDialogLable('Template_Lable_Notice_Link_Dialog.aspx',550,360,EditHtml);
                        }else if(EditHtml.indexOf("readads") != -1 ){
                            OpenDialogLable('Template_Lable_Ads.aspx',550,360,EditHtml);
                        }
                        
                        }else{
                        alert("请选择一个有效的标签 " + EditHtml);
                    }
                }else{                        
                    var EditHtml = oEditor.EditorDocument.getSelection();
                    if(EditHtml.indexOf("{Web:") != -1 || EditHtml.indexOf("{web:") != -1){
                        if(EditHtml.indexOf("ClassMalls") != -1 || EditHtml.indexOf("ClassList") != -1){
                            OpenDialogLable('Template_Lable_Malls_Dialog.aspx',550,460,EditHtml);
                        }else if(EditHtml.indexOf("GroupBuy") != -1 || EditHtml.indexOf("GroupList") != -1){
                            OpenDialogLable('Template_Lable_Group_Dialog.aspx',550,460,EditHtml);
                        }else if(EditHtml.indexOf("MallGuide") != -1 || EditHtml.indexOf("GuideList") != -1){
                            OpenDialogLable('Template_Lable_Guide_Dialog.aspx',550,460,EditHtml);
                        }else if(EditHtml.indexOf("articleclasscode") != -1){
                            OpenDialogLable('Template_Lable_ArticleCategory_Dialog.aspx',550,460,EditHtml);    
                        }else if(EditHtml.indexOf("ClassCode") != -1){
                            OpenDialogLable('Template_Lable_Category_Dialog.aspx',550,460,EditHtml);
                        }else if(EditHtml.indexOf("Activity") != -1){
                            OpenDialogLable('Template_Lable_Activity_Dialog.aspx',550,460,EditHtml);
                        }else if(EditHtml.indexOf("readarticlecate") != -1 ){
                            OpenDialogLable('Template_Lable_ArticleCategory_Link_Dialog.aspx',550,360,EditHtml);
                        }else if(EditHtml.indexOf("Snatch") != -1){
                            OpenDialogLable('Template_Lable_Snatch_Dialog.aspx',550,460,EditHtml);
                        }else if(EditHtml.indexOf("readmalls") != -1 || EditHtml.indexOf("mallself") != -1 || EditHtml.indexOf("mallact") != -1 || EditHtml.indexOf("mallpro") != -1 || EditHtml.indexOf("mallproperty") != -1 || EditHtml.indexOf("mallfit") != -1 || EditHtml.indexOf("mallreview") != -1 || EditHtml.indexOf("mallimg") != -1 || EditHtml.indexOf("mallviewnext") != -1 || EditHtml.indexOf("mallcollect") != -1 || EditHtml.indexOf("mallview") != -1  || EditHtml.indexOf("mallarticle") != -1){
                            OpenDialogLable('Template_Lable_Malls_Link_Dialog.aspx',550,460,EditHtml);    
                        }else if(EditHtml.indexOf("readarticle") != -1 || EditHtml.indexOf("articleself") != -1 || EditHtml.indexOf("articlemall") != -1 || EditHtml.indexOf("articlereview") != -1){
                            OpenDialogLable('Template_Lable_Article_Link_Dialog.aspx',550,360,EditHtml);
                        }else if(EditHtml.indexOf("mallbrand") != -1 || EditHtml.indexOf("brandlist") != -1){
                            OpenDialogLable('Template_Lable_Brand_Dialog.aspx',550,460,EditHtml);
                        }else if(EditHtml.indexOf("shippingadvice") != -1 || EditHtml.indexOf("imglink") != -1 || EditHtml.indexOf("wordlink") != -1 || EditHtml.indexOf("poll") != -1 || EditHtml.indexOf("gbook") != -1 || EditHtml.indexOf("productkey") != -1 || EditHtml.indexOf("articlekey") != -1 || EditHtml.indexOf("infosearch") != -1 || EditHtml.indexOf("infodetail") != -1 || EditHtml.indexOf("helpcate") != -1 || EditHtml.indexOf("readhelpcate") != -1 || EditHtml.indexOf("helplist") != -1 || EditHtml.indexOf("readhelp") != -1 || EditHtml.indexOf("onlinetool") != -1 || EditHtml.indexOf("kft") != -1 || EditHtml.indexOf("kftbutton") != -1 || EditHtml.indexOf("userlogin") != -1 || EditHtml.indexOf("onlinetoolfloat") != -1){
                            OpenDialogLable('Template_Lable_Public_Dialog.aspx',550,360,EditHtml);
                        }else if(EditHtml.indexOf("article") != -1 || EditHtml.indexOf("articlelist") != -1 ){
                            OpenDialogLable('Template_Lable_Article_Dialog.aspx',550,360,EditHtml);
                        }else if(EditHtml.indexOf("readguide") != -1 || EditHtml.indexOf("guidepro") != -1){
                            OpenDialogLable('Template_Lable_Guide_Link_Dialog.aspx',550,360,EditHtml);
                        }else if(EditHtml.indexOf("readsnatch") != -1 || EditHtml.indexOf("snatchlink") != -1 || EditHtml.indexOf("snatchprice") != -1){
                            OpenDialogLable('Template_Lable_Snatch_Link_Dialog.aspx',550,360,EditHtml);
                        }else if(EditHtml.indexOf("readgroup") != -1 || EditHtml.indexOf("grouppro") != -1){
                            OpenDialogLable('Template_Lable_Group_Link_Dialog.aspx',550,360,EditHtml);
                        }else if(EditHtml.indexOf("MallCoupon") != -1 || EditHtml.indexOf("CouponList") != -1){
                            OpenDialogLable('Template_Lable_Coupon_Dialog.aspx',550,360,EditHtml);
                        }else if(EditHtml.indexOf("readactivity") != -1){
                            OpenDialogLable('Template_Lable_Activity_Link_Dialog.aspx',550,360,EditHtml);
                        }else if(EditHtml.indexOf("classnotice") != -1 || EditHtml.indexOf("noticelist") != -1){
                            OpenDialogLable('Template_Lable_Notice_Dialog.aspx',550,360,EditHtml);
                        }else if(EditHtml.indexOf("readnotice") != -1 ){
                            OpenDialogLable('Template_Lable_Notice_Link_Dialog.aspx',550,360,EditHtml);
                        }else if(EditHtml.indexOf("readads") != -1 ){
                            OpenDialogLable('Template_Lable_Ads.aspx',550,360,EditHtml);
                        }
                         
                    }else{
                        alert("请选择一个有效的标签 " + EditHtml);
                    }
                }
            }
            
            //编辑选中标签的样式
            function EditLabelStyle(){
                var oEditor = FCKeditorAPI.GetInstance('fckcontent'); 
                if(oEditor.EditMode == 1){
                    alert('必须在设计模式下使用此功能');
                    return;
                }
                
                if (navigator.appVersion.indexOf("MSIE") != -1){
                    var EditHtml = oEditor.EditorDocument.selection.createRange().text;
                   
                    
                    var reg = new RegExp("(\{Web\:([^\=]*)\=[^\}]*样式[$]([^\}┆]*)[^\}]*\})","gi");
                    var module = EditHtml.replace(reg, "$2");
                    var stylename = EditHtml.replace(reg, "$3");
                    //alert(EditHtml);
                    window.location.href = 'Template_Style_Operate.aspx?folder='+module+'&path=<%=path%>&name=%e9%bb%98%e8%ae%a4%e9%a3%8e%e6%a0%bc&id=' + escape(stylename);
                    return;
                    
                    
                    
                    if(EditHtml.indexOf("{Web:") != -1){
                        if(EditHtml.indexOf("ClassMalls") != -1 || EditHtml.indexOf("ClassList") != -1){
                            OpenDialogLable('Template_Lable_Malls_Dialog.aspx',550,660,EditHtml);
                        }else if(EditHtml.indexOf("GroupBuy") != -1 || EditHtml.indexOf("GroupList") != -1){
                            OpenDialogLable('Template_Lable_Group_Dialog.aspx',550,660,EditHtml);
                        }else if(EditHtml.indexOf("MallGuide") != -1 || EditHtml.indexOf("GuideList") != -1){
                            OpenDialogLable('Template_Lable_Guide_Dialog.aspx',550,660,EditHtml);
                        }
                    }else{
                        alert("请选择一个有效的标签 " + EditHtml);
                    }
                }else{                        
                    var EditHtml = oEditor.EditorDocument.getSelection();
                    
                    
                    if(EditHtml.indexOf("{Web:") != -1){
                        if(EditHtml.indexOf("ClassMalls") != -1 || EditHtml.indexOf("ClassList") != -1){
                            OpenDialogLable('Template_Lable_Malls_Dialog.aspx',550,660,EditHtml);
                        }else if(EditHtml.indexOf("GroupBuy") != -1 || EditHtml.indexOf("GroupList") != -1){
                            OpenDialogLable('Template_Lable_Group_Dialog.aspx',550,660,EditHtml);
                        }else if(EditHtml.indexOf("MallGuide") != -1 || EditHtml.indexOf("GuideList") != -1){
                            OpenDialogLable('Template_Lable_Guide_Dialog.aspx',550,660,EditHtml);
                        }
                    }else{
                        alert("请选择一个有效的标签 " + EditHtml);
                    }
                }
            }
            
            //定义即时获取全局变量
            var isnow = 0;
            //预览样式
            function ViewEffect(){
                var obj = document.getElementById("Review");
                obj.style.display = "block";
                //document.getElementById("AlphaField").style.display = "";
                isnow = 1;
                GetHtmlNow();
            }
            
            //显示预览
            function ShowView(){
                var obj = document.getElementById("Review_Content");
                var oEditor = FCKeditorAPI.GetInstance('fckcontent'); 
                var EditorHtml = ConvertTag(oEditor.GetXHTML(true));
                obj.innerHTML = EditorHtml + "<div align=\"center\"><input type=\"button\" value=\"隐藏\" class=\"button\" onclick=\"Resume()\" /></div>";
            }
            
            //即时浏览效果
            function GetHtmlNow(){
                ShowView();
                if(isnow == 1){
                    setTimeout('GetHtmlNow()', 1000);
                }
            }
            
            //预览样式返回
            function Resume(){
                var obj = document.getElementById("Review");
                obj.style.display = "none";
                document.getElementById("AlphaField").style.display = "none";
                isnow = 0;
            }
            
            //替换图片中的标签
            function ConvertTag(str){
                str = str;
                return str;
            }
        </script>
    </div>
    <uc1:PageBottom ID="PageBottom1" runat="server" />
    </form>
</body>
</html>
