<html>
<head>
<meta http-equiv=content-language content=zh-cn>
<meta http-equiv=content-type content="text/html; charset=gb2312">
<style>
  td { padding:2px 5px 2px 5px;}
  .actionsTitle {color:#0099cc;font-size:14px;font-weight:bold;margin-bottom:5px;}
  .actionsInner {font-size:12px;padding-left:10px;margin-bottom:8px;border-bottom:#e5e5e5 1px solid;}
  #the_tips_iframe {
		margin: 0px;
		padding:0px;
		width: 100%;
		height: 100%;
		position: relative;
		z-index: 20002;
  }
</style>
<link href="../CSS/Base.css" rel=stylesheet>
<link href="../CSS/Common.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../JS/CheckQuestion.js.php"></script>
<script language=javascript src="../JS/HighLight.js.php"></script>
<LINK href="../CSS/Actions.css" type=text/css rel=stylesheet>
<script type="text/javascript" src="../JS/Common.js.php"></script>
<script type="text/javascript" src="../JS/Actions.js.php"></script>
<script language="javascript"> 
function CheckNoFloat(objField, strText) {
    var objValue = objField.value;
    if ( Trim(objValue) == "" ) return true;
	var strErr = "“" + strText + "”不是正确的权重数据格式！";
	var reg=/^(\d+)(.{0,1})(\d{0,2})$/;
	if (!reg.test(objValue)) {
		alert(strErr);
        objField.focus();
		return false;
	}
	return true;
}
function Check_Form_Validator()
{
	{check_form_list}
	var theIdString = "{theIdString}";
	//"25###90***91***92***93$$$26###94***95***96***97"
	var theIdStringList = theIdString.split('$$$');
	var theIndValue = 0;
	for( i=0;i<theIdStringList.length;i++)
	{
		var theIdStringArray = theIdStringList[i].split('###');
		//指标对象
		var theIndObj = eval( 'document.Check_Form.weight_' + theIdStringArray[0]);
		var theItemValue = 0;
		var theIndexsStringArray = theIdStringArray[1].split('***');
		for( j=0;j<theIndexsStringArray.length;j++)
		{
			var obj = eval( 'document.Check_Form.indexWeight_' + theIndexsStringArray[j]);
			if( obj != null )
			{
				theItemValue = FloatAdd(Number(obj.value),theItemValue);
			}
		}
		if( theItemValue != Number(theIndObj.value ) )
		{
			alert("所属评价问题的权重不等于对应指标的权重");
			theIndObj.focus();
			return false;
		}
		theIndValue = FloatAdd(Number(theIndObj.value ),theIndValue);
	}
	if( document.Check_Form.totalWeight.value != theIndValue )
	{
		alert("所有指标的权重不等于评教问卷的总权重");
		document.Check_Form.totalWeight.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 Submit_Weight_Form()
{
	if( Check_Form_Validator() != false )
	{
		$('UpdateWeightSubmit').disabled = true;
		$('closebutton').disabled = true;
		parent.$('popupControls').style.display = 'none';
		$('menu-div').style.display = "block";
		var x = 50;		
		var y = 180;
		$('menu-div').style.position = "absolute";
		$('menu-div').style.left = Math.ceil(x) + 'px';
		var scTop = parseInt(getScrollTop(),10);
		$('menu-div').style.top = ( scTop + 50 ) + "px";
		$('menu-div').style.width = '600px';
		$('menu-div').style.height = '240px';
		change_style('select', 'hidden');
		document.Check_Form.Action.value = 'UpdateWeightSubmit';
		document.Check_Form.submit();
	}
}
function _showCloseWindowButton()
{
	$('actionControls').innerHTML = "<img src=\"../Images/closewindow.gif\" onclick=\"closeLog('menu-div');\" id=\"actionCloseBox\"/>";
	parent.$('popupControls').style.display = 'block';
	$('UpdateWeightSubmit').disabled = false;
	$('closebutton').disabled = false;
}
</script>
<meta content="mshtml 6.00.3790.0" name=generator></head>
<body oncontextmenu="return false" style="margin-top:0px">

<table class=datatable style="line-height: 150%;border-collapse:collapse;" cellspacing=0 cellpadding=0 bordercolor=#b5cfd9 border=1 width=100%>
     <form action="" method="post" name="Check_Form" target="the_tips_iframe">
     <div class=position>位置：&nbsp; 我的问卷 &raquo; 调配问卷指标与问题权重</div>
     <tr class=coltitle>
      <td width=88% noWrap>&nbsp;<B>指标名称</B></td>
	  <td width=10% nowrap align=center>&nbsp;<B>指标权重</B></td>
    </tr>
	 <!-- BEGIN GROUP -->
	   <tr height=25 onmouseover="this.style.backgroundColor='#deefff'" onmouseout="this.style.backgroundColor='#ffffff'">
		  <td>&nbsp;<b>{indicatorsName}</b>&nbsp;[ <span class=red>{recNumSub}</span> 问题 ]</td>
		  <td align=center bgcolor="#efefef">&nbsp;<input name="weight[{indicatorsID}]" id="weight_{indicatorsID}" size=6 value="{weight}"></td>
	   </tr>
      <!-- BEGIN LIST -->
	   <tr>
		  <td align=left bgcolor="#f5fafe" height=25 style="padding-left:25px">{indexsName}</td>
		  <td align=center bgcolor="#f5fafe">&nbsp;<input name="indexWeight[{indexsID}]" id="indexWeight_{indexsID}" size=6 value="{indexWeight}"></td>
	   </tr>
	   <!-- END LIST -->   
       <!-- END GROUP -->
	   <tr>
	     <td align=right><b>总权重：</b></td>
		 <td align=center bgcolor="#f5f5f5">&nbsp;<input name="totalWeight" id="totalWeight" size=6 value="{totalWeight}"></td>
	   </tr>
  </table>
   <table width=100%>
	 <tr><td align=center>
	      <input name="actionTitle" id="actionTitle" type="hidden" value="{assessTitle}">
	      <input name="surveyID" id="surveyID" type="hidden" value="{surveyID}">
	      <input name="assessID" id="assessID" type="hidden" value="{assessID}">
		  <input name="Action" id="Action" type="hidden">
	      <input class=inputsubmit name="UpdateWeightSubmit" type="button" id="UpdateWeightSubmit" value="确定" onclick="javascript:Submit_Weight_Form();">&nbsp;<input class=inputsubmit type="button" name="closebutton" id="closebutton" value="关闭" onClick="javascript:parent.hidePopWin();"></td>          
      </tr>
   </table>
   </form>
 <script type="text/javascript">initInputHighlightScript();</script> 
<div id="menu-div">
	<div id="actionInner">
	  <div id="actionTitleBar">
	      <div id="actionTitle">调配问卷指标与问题权重提示信息</div>
		  <div id="actionControls"><img src="../Images/closewindow.gif"></div>
	  </div>
	  <div style="padding:0px;margin:0px;"><iframe src="" style="width:592px;height:100%;" scrolling="auto" frameborder="0" id="the_tips_iframe" name="the_tips_iframe"></iframe></div>
   </div>
</div>
</body></html>
