<%@ page language="C#" autoeventwireup="true" inherits="WebAdmin_Email_Send, LebiMall" %>
<%@ 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 runat="server">
    <title>邮件群发</title>
    <link href="css/css.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="js/checked.js"></script>
         <link href="css/tipswindown.css" type="text/css" rel="stylesheet" />
    <script src="js/jquery.js" type="text/javascript"></script>
    <script src="js/tipswindown.js" type="text/javascript"></script>
    <script src="js/topHead.js" type="text/javascript"></script>
    <script type="text/javascript">
        function resizeEditor(name,size) {   
	        var newheight = parseInt(document.getElementById(name +"___Frame").style.height, 10) + size;   
	        if(newheight >= 150) {   
		        document.getElementById(name +"___Frame").style.height = newheight + 'px';   
	        }   
	    }
	    function ckd(){
	        var flag = true;
	       if(!cktitle()){
	           flag = false;
	       }
	       if(flag){
	           document.getElementById("msg_shibai").innerHTML="邮件发送中...";
               document.getElementById("msg_shibai").style.visibility="visible";
	       }
	       return flag; 
	    }
	    
	    function cktitle(){
	      if(document.getElementById("txt_title").value==""){
	            document.getElementById("msg_title").innerHTML="<span class='msg_submit'>标题不能留空！</span>";
	           return  false;
	       }else{
	           document.getElementById("msg_title").innerHTML="";
	           return true;
	       }  
	    }
	
	function shu(){
	    ckd();
	    document.getElementById("btn_sub").click();
	}
    </script>
</head>
<body>
    <form id="form1" runat="server">
         <script>header(5,2,"images/");</script>
   
    <!--面包屑-->
    <div class="blank clearfix"></div>
    
    <!--功能区-->
   <div class="tabmenus mainwidth">
            <ul>
                <li><a href="Admin_mail_tpl.aspx"><span>邮件模版</span></a></li>
                <li class="current"><a href="Email_Send.aspx"><span>群发邮件</span></a></li>
            </ul>
        </div>
    <div class="tab-mainbody">
        <div class="tab-mainbody2">
        <div class="functionHandleArea clearfix">
            <input type="image" border="0" title=" 发 送 "  runat="server" onclick="return ckd();" onserverclick="Image1_ServerClick"
                                src="images/bt_fa.gif" align="absmiddle" id="Image2">
        </div>
        <div id="datalist">
                <table cellspacing="0" cellpadding="0" id="list">
                    <tr>
                        <th >
                            邮件群发</th><th><span style="color:Red;" id="msg_shibai"></span><div id="serverResponse"></div>
                            <script type="text/javascript">
                                var i = 2;
                                var f="<%=returnValue %>";
                                if(f=="true"){
                                    document.getElementById("msg_shibai").innerHTML="邮件发送成功！";
                                    document.getElementById("msg_shibai").style.visibility="visible";
                                    setInterval("fun()", 1000);
                                }
                                if(f=="false"){
                                    document.getElementById("msg_shibai").innerHTML="<%=numUser %>"+"封发送失败，是否继续发送！<input type='image' onclick='shu();'  src='images/bt_jxfs2.gif' align='absmiddle' id='Image3'  />";
                                    document.getElementById("msg_shibai").style.visibility="visible";
                                }
                                function fun() {
                                    if (i == 1) {
                                         document.getElementById("msg_shibai").innerHTML="";
                                         document.getElementById("msg_shibai").style.visibility="hidden";
                                    }
                                    i--;
                                }
                            </script>
                            </th>
                    </tr>
                    <tr>
                        <td  style="width: 20%">
                            邮件标题：</td>
                        <td >
                            <input type="text" id="txt_title" runat="server" class="input" size="60" onblur="cktitle();"/><span id="msg_title" class="red"></span>
                        </td>
                    </tr>
                    <tr>
                        <td >
                            邮件内容：</td>
                        <td >
                            <div style="float: left;">
                                <fckeditorv2:fckeditor id="fck" runat="server" basepath="~/images/js/fckeditor/"
                                    height="280px" width="590px">
                                </fckeditorv2:fckeditor>
                                <a href="javascript:resizeEditor('fck',-100)">
                                    <img src="images/bt_close.gif" border='0'></a>&nbsp;<a href="javascript:resizeEditor('fck',150)"><img
                                        src="images/bt_open.gif" border='0'></a>
                            </div>
                            <div class="both">
                            </div>
                            <span id="inc_msg" class="red"></span>
                        </td>
                    </tr>
                    <tr><td class="list-foot" colspan="2"><input type="image" onclick="return ckd();" src="images/bt_fa.gif" id="Image1" runat="server" onserverclick="Image1_ServerClick" /></td></tr>
                </table>
                <script type="text/javascript">tdshowm("list");</script>
            </div>
            <input type=button id="btn_sub" runat="server" style="display:none;" onserverclick="btn_sub_ServerClick"/>
        </div>
    </form>
</body>
</html>
