<html>
<head>
<meta http-equiv=content-language content=zh-cn>
<meta http-equiv=content-type content="text/html; charset=gb2312">
<LINK href="../CSS/Base.css" rel=stylesheet>
<link href="../CSS/Common.css" rel="stylesheet" type="text/css"/>
<style>
  td { padding:2px 5px 2px 5px;}
</style>
<script language=javascript src="../JS/CheckQuestion.js.php"></script>
<script language=javascript src="../JS/HighLight.js.php"></script>
<link rel="stylesheet" type="text/css" href="../CSS/Calendar.css">
<script type="text/javascript" src="../Calendar/Calendar.js.php"></script>
<script type="text/javascript" src="../Calendar/Calendar.lang.js.php"></script>
<script type="text/javascript" src="../Calendar/Calendar.init.js.php"></script>
<script language=javascript>
function Check_Form_Validator()
{
	if (!CheckNotNull(Check_Form.surveyTitle, "评教主题")) {return false;}
	if (!CheckSpecicalChar(Check_Form.surveyTitle, "评教主题")) {return false;}
	if (!CheckNotNull(Check_Form.beginTime, "评教问卷开始时间")) {return false;}
	if (!CheckDate(Check_Form.beginTime, "评教问卷开始时间")) {return false;}	
	if (!CheckNotNull(Check_Form.endTime, "评教问卷结束时间")) {return false;}
	if (!CheckDate(Check_Form.endTime, "评教问卷结束时间")) {return false;}
	if ( document.Check_Form.beginTime.value >= document.Check_Form.endTime.value )
	{
		alert('开始时间止不应在结束时间后');
		document.Check_Form.endTime.focus();
		return false;
    }
	if (!CheckNumber(Check_Form.weightValue,"评教问卷的总权重",1,500)) {return false;}
	var theItemValue = FloatAdd(Number(document.Check_Form.weightSt.value),Number(document.Check_Form.weightTh.value));
	theItemValue = FloatAdd(theItemValue,Number(document.Check_Form.weightLd.value)); 
	theItemValue = FloatAdd(theItemValue,Number(document.Check_Form.weightDr.value));
	if( theItemValue != Number(document.Check_Form.weightValue.value ) )
	{
		alert("所属评教类型的权重不等于评教问卷的总权重");
		document.Check_Form.weightValue.focus();
		return false;
	}
}
function FloatAdd(arg1,arg2){  
   var r1,r2,m;  
   try{r1=arg1.toString().split(".")[1].length}catch(e){r1=0}  
   try{r2=arg2.toString().split(".")[1].length}catch(e){r2=0}  
   m=Math.pow(10,Math.max(r1,r2))  
   return (arg1*m+arg2*m)/m  
}  
function CheckSpecicalChar(objField, strText)
{
	var strErr = "“" + strText + "”不能包含单引号、双引号、反斜线、小于号、大于号、和符号等非法字符！";
	var Re = /[\x22\x27\x5C\x3C\x3E\x26]+/ig;
	if ( Re.test(objField.value))
	{
		alert(strErr);
        objField.focus();
		return false;
	}
	return true;
}
</script>
<meta content="mshtml 6.00.3790.0" name=generator></head>
<body oncontextmenu="return false" style="margin-top:0px">
   <form action="" style="margin:0px;" method="post" name="Check_Form" onsubmit="return Check_Form_Validator()" >
    <table class=datatable style="line-height: 150%;border-collapse:collapse;" cellspacing=0 cellpadding=0 bordercolor=#b5cfd9 border=1 width=100%>
     <div class=position>位置：&nbsp; 我的问卷 &raquo; 新增调查问卷 &raquo; 新建评教主题</div>
      <tr><td bgcolor="#f5f5f5" colspan=2><b>新建评教主题</b></td></tr>
      <tr height=25 bgcolor="#e9e9e9"><td colspan=2><span class=red>&nbsp;需要为即将开始设计的一组评教类问卷指定一个评教主题</span>&nbsp;<img src="../Images/info.gif" border=0></td></tr>
      <tr> 
           <td height="25" width=20%><SPAN class=red>*</SPAN> 评教主题：</td>
           <td><input class="textInput" name="surveyTitle" type="text" id="surveyTitle" size="95" maxlength="200">
		   <br/><span class=red>*</span> 可使用诸如“XX学校2011-2012学年下学期评教问卷”类此的主题</td>
      </tr>
      <tr height=25 bgcolor="#e9e9e9"><td colspan=2><span class=red>&nbsp;需要设定评教问卷的开始和结束时间</span>&nbsp;<img src="../Images/info.gif" border=0></td></tr>
	  <tr><td align=left><SPAN  class=red>*</SPAN> 问卷开始时间：</td>
		   <td align=left><input class="text" name="beginTime" size='14' maxlength='10' id='beginTime' value='{beginTime}'> 00:00:00 <img src="../Images/calendar.gif" alt="开始时间"  id="date_start_trigger" align="absmiddle"></td>
	   </tr>
	  <tr><td align=left><SPAN class=red>*</SPAN> 问卷结束时间：</td>
		   <td align=left><input class="text" name="endTime" size='14' maxlength='10' id='endTime' value='{endTime}'> 00:00:00 <img src="../Images/calendar.gif" alt="结束时间"  id="date_end_trigger" align="absmiddle"> </td>
	   </tr>
	   <script type="text/javascript">
		  Calendar.setup({
		  inputField : "beginTime",
		  ifFormat : "%Y-%m-%d", 
		  range:[2007,2080],
		  showsTime : false, 
		  weekNumbers: false,
		  button : "date_start_trigger", 
		  singleClick : true,
		  step : 1
		 });
		  Calendar.setup({
		  inputField : "endTime",
		  ifFormat : "%Y-%m-%d", 
		  range:[2007,2080],
		  showsTime : false, 
		  weekNumbers: false,
		  button : "date_end_trigger", 
		  singleClick : true,
		  step : 1
		 });
	  </script>
      <tr height=25 bgcolor="#e9e9e9"><td colspan=2><span class=red>&nbsp;需要指定评教问卷的可分配的总权重</span>&nbsp;<img src="../Images/info.gif" border=0></td></tr>
	  <tr><td height="25"><SPAN class=red>*</SPAN> 评教问卷的总权重：</td>
	      <td><input class="textInput" name="weightValue" type="text" id="weightValue" size="10" value=100>
		      <br/><span class=red>*</span> 指评教问卷中所有评价指标权重的总和，如果使用百分制，则为100</td>
	   </tr>
 	  <tr><td height="25"><SPAN class=red>*</SPAN> 其中，学生评教占：</td>
	      <td><input class="textInput" name="weightSt" type="text" id="weightSt" size="10"></td></tr>
	  <tr><td height="25"><SPAN class=red>*</SPAN> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;教师评教占：</td>
	      <td><input class="textInput" name="weightTh" type="text" id="weightTh" size="10"></td></tr>
	  <tr><td height="25"><SPAN class=red>*</SPAN> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;领导评教占：</td>
	      <td><input class="textInput" name="weightLd" type="text" id="weightLd" size="10"></td></tr>
	  <tr><td height="25"><SPAN class=red>*</SPAN> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;督导评教占：</td>
	      <td><input class="textInput" name="weightDr" type="text" id="weightDr" size="10"></td></tr>
  </table>
   <table width=100%>
      <tr><td width=20%></td>
	      <td height="23" align="left">
 		  <input name="Action" type="hidden" id="Action" value="AddSurveySubmit"> 
	      <input type=submit class=inputsubmit value="下一步>>">&nbsp;<input class=inputsubmit type="button" name="close" value="取消" onClick="javascript:parent.hidePopWin();">
           </td>
       </tr>
    </table>       
    </form>       
 <script type="text/javascript">initInputHighlightScript();</script> 
</body></html>
