<%@ page language="C#" autoeventwireup="true" inherits="_N25_User_Email_modify, App_Web_tsyy9ur1" validaterequest="false" debug="true" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register Assembly="FredCK.FCKeditorV2" Namespace="FredCK.FCKeditorV2" TagPrefix="FCKeditorV2" %>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>短信添加</title>
     <link href="../css/StyleSheet.css" rel="stylesheet" type="text/css" />
     <link href="../css/main.css" rel="stylesheet" />
<link href="../css/GridView.css" rel="stylesheet" />
     
         <script src="../jquery-1.5.js" type="text/javascript"></script>

 <script src="../js/dell_fujian.js" type="text/javascript"></script>

    <link href="../window/_css/window.css" rel="stylesheet" type="text/css" />

    <script language="javascript" src="../window/message/jquery.message.js" type="text/javascript"></script>

    <script language="javascript" src="../window/jquery/jquery.min.js" type="text/javascript"></script>

    <script language="javascript" src="../window/jquery-ui/jquery-ui.min.js" type="text/javascript"></script>

    <script language="javascript" src="../window/jquery.bgiframe.pack.js" type="text/javascript"></script>

    <link href="../window/_css/jqueryui/blitzer/jquery-ui-1.8.12.custom.css" rel="stylesheet"
        type="text/css" />
    <link href="../alert/jquery.alert.css" rel="stylesheet" type="text/css" />

    <script src="../alert/jquery.easydrag.js" type="text/javascript"></script>

    <script src="../alert/jquery.alert.js" type="text/javascript"></script>
     <script language="javascript" type="text/javascript">
   function select_open1(formname,fieldname,showfieldname) {
  
   
    window.open('N25_Office2_Email_file_add.aspx?formname=' + formname + '&fieldname=' + fieldname + '&showfieldname=' + showfieldname,"windowXml","height=350, width=450,top=250, left=350,alwaysRaised =yes,scrollbars=no");
}


function delChkTitle()
{
var alldiv=document.getElementsByTagName("DIV");
for(var i=0;i<alldiv.length;i++)  
{
allchks= alldiv[i].getElementsByTagName('INPUT');
for(var j=0;j<allchks.length;j++)
{
if(allchks[j].type=='checkbox')
{
allchks[j].title="";
allchks[j].checked=false;
}
}
}
}


function check_all_dep()
{
var dep=document.getElementById ("div_4");

var alldiv=dep.getElementsByTagName("DIV");
for(var i=0;i<alldiv.length;i++)  
{
allchks= alldiv[i].getElementsByTagName('INPUT');
for(var j=0;j<allchks.length;j++)
{
if(allchks[j].type=='checkbox')
{
allchks[j].title="";
allchks[j].checked=true;
}
}
}
}
    </script>

 <script type="text/javascript">
$(window.document).ready(function () {
    $("#Button4").click(function () {
    
    

              
              
           //check();
      
      
            
               
              
               
               
    })
})

function check()
{
  var h1 = $.trim($("#h1").val());
              var TextBox2 = $.trim($("#TextBox2").val());
              var FCKeditor1 = $.trim($("#FCKeditor1").val());
          
              
           //  var date=/^(?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)$/ ;  
   
   
   
    if (h1=="") return Msg("抱歉!请选择收件人!", "h1");
      if (TextBox2=="") return Msg("抱歉!请输入消息标题!", "TextBox2");
       if (FCKeditor1=="") return Msg("抱歉!请输入消息内容!", "FCKeditor1");
}

        function Msg(s, obj) {
    $("#" + obj).css({
        "background-color": "#FFE1E1"
    });
    $("#" + obj).change(function () {
        if ($.trim($(this).val()) != "") {
            $("#" + obj).css({
                "background-color": ""
            });
        } else {
            $("#" + obj).css({
                "background-color": "#FFE1E1"
            });
        }
    });
    window.jAlert(s);
    return false
}     

function show_fujian(s)
{
   document.getElementById ("dd1").innerHTML= unescape(s);
 

}


 </script>
</head>
<body>
   <div id="message" class="window_message" style="position: absolute; left: 42%; top: 35%;
        display: none">
        <img alt="正在处理请稍等...." src="../images/loading.gif">正在处理请稍等....
    </div>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
          
         <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional"  ChildrenAsTriggers ="false">
        <ContentTemplate >
           
   <table  border="0" cellpadding="0" cellspacing="0"  width="800">
   <tr>
   
   <td style="height:25px" align="right" >
   收件人
   </td>
   <td  style="height:25px; " align="left"  >
    
        <asp:UpdatePanel ID="UpdatePanel2"  UpdateMode="Conditional"  ChildrenAsTriggers="true" runat="server">
       <ContentTemplate >
       
      
    
       <asp:TextBox ID="TextBox1" CssClass="text1" Width="300" ReadOnly="true"  runat="server" Text=""></asp:TextBox>
       <asp:HiddenField ID="h1" runat="server" Value="" />
       
        <img alt='通讯录' onclick="$('#div_4').dialog('open');$('#div_4').dialog({ title: '通讯录-选择' });$('#div_4').dialog({ draggable: true,resizable:true });"
        src="../images/select.gif" style="cursor: pointer;" />
     </ContentTemplate>
       <Triggers>
        <asp:AsyncPostBackTrigger ControlID="Button7" />
               
       </Triggers>
       </asp:UpdatePanel>
    
       
   </td>
   
   </tr>
   
   <tr>
   <td style="height:25px"  align="right" >
   消息标题
   </td>
   <td style="height:25px" align="left" >
       <asp:TextBox ID="TextBox2" CssClass="text1" Width="300" runat="server"></asp:TextBox>
   </td>
   </tr>
      <tr>
   <td style="height:25px" align="right" >
   消息内容
   </td>
   <td style="height:25px"  align="left" >
     <FCKeditorV2:FCKeditor ID="FCKeditor1" runat="server" Height="280" ToolbarSet="Custom"
                    Width="100%">
                </FCKeditorV2:FCKeditor>
   
   
   </td>
   </tr>
      <tr>
   <td style="height:25px"  align="right" >
   附件
   </td>
   <td style="height:25px"  align="left" >
       <asp:HiddenField ID="hf" runat="server" />
       
       <asp:HiddenField ID="fujian" runat="server" />
<%--       <asp:LinkButton ID="LinkButton2" runat="server" CssClass="btn" BackColor="yellowGreen"   OnClick="LinkButton2_Click1" Text="添加附件"></asp:LinkButton>--%>
       <input type="button"  onclick="select_open1('form1','hf','hf');"   class="btn"  style="background-color:yellowGreen;"   value="添加附件"   />
       
                        <div id="dd1" runat="server">
                        </div>
   </td>
   </tr>
      <tr>
   <td style="height:25px" align="right" >
   设置
   </td>
   <td style="height:25px"  align="left" >
       <asp:CheckBox ID="CheckBox1" runat="server"   Text="是否保存到发件箱" />
   </td>
   </tr>
   
   <tr>
   <td >
   
   </td>
   <td  style="height:25px"  align="left" >
   
   
      <asp:Button ID="Button4" runat="server"   CssClass="button_r_b"  BackColor="yellowGreen"  
                             Text="保存数据" OnClick="Button4_Click"  />
                    <%--<input id="Button4"  name="Button4" type="button" class="button_r_b" value="保存数据"  onclick="check()"/>--%>
                             
                             
                             
       <asp:Button ID="Button2" CssClass="button_g" runat="server" Text="存为草稿" OnClick="Button2_Click"  />
       <asp:Button ID="Button3" CssClass="button_b" runat="server" Text="返回" OnClick="Button3_Click" />

        
   </td>
   
   </tr>
   
   </table>
     </ContentTemplate>
        <Triggers >
       

       
       
 
        </Triggers>
        </asp:UpdatePanel>
    
            <asp:UpdatePanel ID="UpdatePanel3" runat="server" UpdateMode="Conditional"  ChildrenAsTriggers ="false" >
                             
                             <Triggers >
                             <asp:AsyncPostBackTrigger  ControlID="Button4" />
                                <asp:AsyncPostBackTrigger  ControlID="Button2" />
                             </Triggers>
                             </asp:UpdatePanel>
        
      
   
   
       <div id="div_4" style="display: none">
            
        
                <iframe frameborder="0" src="about:blank" style="position: absolute; z-index: -1;
                width: 100%; height: 100%; top: 0; left: 0;"></iframe>
   
            <asp:UpdatePanel ID="UpdatePanel5" runat="server" UpdateMode="Conditional"  ChildrenAsTriggers ="false">
           
           <ContentTemplate >
            <table border="0" cellpadding="0" cellspacing="0" height="100%">
                <tr>
                    <td valign="top" >
                      
                      
                            <asp:TreeView ID="TreeView1"   runat="server" ShowCheckBoxes="Leaf" CollapseImageUrl="~/images/folder.gif" ExpandImageUrl="~/images/folder-closed.gif" NoExpandImageUrl="~/images/file.gif"  >
                        </asp:TreeView>
                    
                    </td>
                </tr>
                <tr>
                <td  valign="bottom" >
                
                
                    <asp:Button ID="Button7" runat="server" CssClass="button_r" Text="确定" OnClick="Button7_Click" />
                    <input class="button_b" onclick="check_all_dep()" type="button" value="全部选择" />
                    <input onclick="delChkTitle()" class="button_b" type="button" value="取消选择" />
                    
                    
                    
                    
                </td>
                
            </tr>
            </table>
           </ContentTemplate>
           <Triggers >
           <asp:AsyncPostBackTrigger ControlID="TreeView1"/>
                   <asp:AsyncPostBackTrigger  ControlID="Button7" />
           </Triggers>
            </asp:UpdatePanel>
    
        </div>
   
    </form>

 <asp:Label ID="l2" runat="server" ></asp:Label> 
</body>
</html>
