<!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
<link rel="stylesheet" type="text/css" href="skin/default/jooyea/css/row_menus.css">
<link rel="stylesheet" type="text/css" href="skin/default/jooyea/css/iframe.css">
</head>
<script language="JavaScript">
{sta:if(!get_argg("2id"))[exc]}
	parent.guide("scrip");
{end:if/}
      function unitinfocheck()
      {
           if(document.form1.msToId.value=="")
           {
             parent.Dialog.alert("{echo:lp{m_no_one};/}");
             return (false);
           }
           var msTitle=trim(document.getElementById("msTitle").value);
			if(msTitle==''){
				parent.Dialog.alert("{echo:lp{m_no_tit};/}");
                return (false);
			}
			var msContent=trim(document.getElementById("msContent").value);
			if(msContent==''){
				parent.Dialog.alert("{echo:lp{m_no_cont};/}");
                return (false);
			}
      }
	 function trim(str){  //删除左右两端的空格
	     return str.replace(/(^\s*)|(\s*$)|(　*)/g , "");
	 }
</script>
<SCRIPT type=text/javascript>
  <!--
    function topen(){
		document.getElementById("sc_nav").focus();
    	document.getElementById("sc_nav").className="displayblock";
    }
    function tclose(){
    	document.getElementById("sc_nav").className="displaynone";
    }
  function navArray(num,id_val) {
    var navArray=document.getElementById("sc_nav").getElementsByTagName("li");
    var objChecked = document.getElementsByName ("checked");
    for(var i=0;i<navArray.length;i++){
        if(num == i ){
            navArray[num].className = "checked";
			document.getElementById("msToId").value = id_val;
            document.getElementById("newsType").innerHTML=navArray[num].innerHTML; //将选择值赋值给隐藏表单
            document.getElementById("sc_nav").className="displaynone";
        }else{
            navArray[i].className = "";
        }
    }
  }
  function isMaxLen(o){  
	  var nMaxLen=o.getAttribute? parseInt(o.getAttribute("maxlength")):"";  
	  if(o.getAttribute && o.value.length>nMaxLen){  
	  	o.value=o.value.substring(0,nMaxLen)  
	  }  
  }  
  //-->
</SCRIPT>
<body>
  <div class="main_right_title">
     <span class="main_title_dot4"></span>
     <span class="main_title_txt">{echo:lp{m_title};/}</span>
  </div>
	<div id="tabsB">
		<ul>
			<li><a href="#" class="nowbutl"><span class="nowbutr">{echo:lp{m_creat};/}</span></a></li>
		</ul>
	</div>
	 <div class="msg_creat">
    <form name="form1" onSubmit="return unitinfocheck();" method="post" action="do.php?act=msg_crt">
	 <table class='rs_list tleft bnone' id="table4" width="350px" style="margin:0 auto;">
		  {echo:$to_id;/}
          <tr>
			<td align="right">{echo:lp{m_to_user};/}：</td>
			<td class="{echo:$id_confirm;/}"><input class="text" type="text" name="{echo:$have_2id;/}" autocomplete='off' value='{echo:$to_user_name;/}'  disabled="disabled" /></td>
			<td class="{echo:$id_noconfirm;/}">
				<input name="msToId" id="{echo:$no_2id;/}" onclick="topen();" onblur="tclose()" type="hidden" value="" />
				<div id="sc_nav" onblur="setTimeout('tclose()',200)">
					<div id="newsType" onclick="topen();">{echo:lp{m_cho};/}</div>
					<ul class="tt" style="height:120px;overflow-y:auto;overflow-x:hidden;">
						<!--<p class="sort_sel">选择分组：<select name=""><option>全部</option></select></p> -->
						{sta:foreach($user_rs as $val)[loop]}
						<li class=checked onClick="navArray('{echo:$i;/}','{echo:$val['pals_id'];/}')"><a href="javascript:void(0)">{echo:$val['pals_name'];/}</a></li>
						{sta:$i++;/}
						{end:foreach/}
					</ul>
				</div>
			</td>
			</tr>
			<tr>
				<td align="right">{echo:lp{m_tit};/}：</td>
				<td><input class="text" type="text" name="msTitle" id="msTitle" autocomplete='off' value='{echo:$reTitle;/}' maxlength="30" /></td>
			</tr>
			<tr>
				<td valign="top" align="right">{echo:lp{m_cont};/}：</td>
				 <td><textarea maxlength="160" name="msContent" id="msContent" onKeyUp="return isMaxLen(this)"></textarea></td>
			</tr>
			<tr>
				<td>&nbsp;</td>
           		 <td class="{echo:$b_can;/}">
           		    <input class="anniu" type="submit" value="{echo:lp{m_b_con};/}" />&nbsp;&nbsp;&nbsp;&nbsp;
                    <input type=hidden name="nw" value='{echo:get_argg("nw");/}' />
		   		    <input class="anniu" type="button" value="{echo:lp{m_b_can};/}" onClick="window.close();" />
				 </td>
				 <td class="{echo:$b_bak;/}">
				 	<input class="anniu" type="submit" value="{echo:lp{m_b_con};/}" />&nbsp;&nbsp;&nbsp;&nbsp;
				 	<input class="anniu" type="button" value="{echo:lp{m_b_bak};/}" onClick="location.href='?app=msg_minbox'" />
				 </td>
		    </tr>
		</table>
       </form>
    </div>
	<div id="clickLayer" onclick="setTimeout('tclose()',200)"></div>
</body>
</html>