<html>
<head>
<meta http-equiv=content-language content=zh-cn>
<meta http-equiv=content-type content="text/html; charset=gb2312">
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7">
<style>
 td { padding:2px 5px 2px 5px;}
</style>
<LINK href="../CSS/Base.css" type=text/css rel=stylesheet>
<link href="../CSS/Common.css" rel="stylesheet" type="text/css"/>
<link href="../CSS/SurveyList.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../JS/Browser.js.php"></script>
<script type="text/javascript" src="../JS/Jquery.min.js.php"></script>
<script type="text/javascript" src="../JS/Jquery.notification.js.php"></script>
<link type="text/css" rel="stylesheet" href="../CSS/Notification.css" />
<script>
function gId(_sId){
	return document.getElementById(_sId);
}
function move(fbox, tbox) {
	var arrFbox = new Array();
	var arrTbox = new Array();
	var arrLookup = new Array();
	var i;
	for (i = 0; i < tbox.options.length; i++) {
		arrLookup[tbox.options[i].text] = tbox.options[i].value;
		arrTbox[i] = tbox.options[i].text;
	}
	var fLength = 0;
	var tLength = arrTbox.length;
	for(i = 0; i < fbox.options.length; i++) {
		arrLookup[fbox.options[i].text] = fbox.options[i].value;
		if (fbox.options[i].selected && fbox.options[i].value != "") {
			arrTbox[tLength] = fbox.options[i].text;
			tLength++;
		}
		else {
			arrFbox[fLength] = fbox.options[i].text;
			fLength++;
		}
	}
	//arrFbox.sort();
	//arrTbox.sort();
	fbox.length = 0;
	tbox.length = 0;
	var c;
	for(c = 0; c < arrFbox.length; c++) {
		var no = new Option();
		no.value = arrLookup[arrFbox[c]];
		no.text = arrFbox[c];
		fbox[c] = no;
	}
	for(c = 0; c < arrTbox.length; c++) {
		var no = new Option();
		no.value = arrLookup[arrTbox[c]];
		no.text = arrTbox[c];
		tbox[c] = no;
	}
}
function Check_Form_Validator()
{
  /* if(document.MatchForm.questionName.options.length != 0 )
   {
	   document.MatchForm.questionName.focus();
       $.notification('尚有问题未与问卷指标建立匹配关系');
	   return false;
   }*/
   var theValue = document.getElementById("indexIDList").value;
   var indexIDList = theValue.substr(0,theValue.length-1).split("|");
   for( i=0;i<indexIDList.length;i++)
   {
      var theObj = eval("document.getElementById(\"indexID_" + indexIDList[i] + "\")");
	  for(c = 0; c < theObj.options.length; c++) {
	      theObj.options[c].selected = true;
	  }
   }
}
</script>
<meta content="mshtml 6.00.3790.0" name=generator></head>
<body oncontextmenu="return false" style="background-color:#244d8f;">

<div style="line-height:10px">&nbsp;</div>
<div id="menu">
  <span style="float:left;padding-left:26px;"><div class="navmenu">我的问卷 &raquo; {surveyTitle}</div></span>
  <span style="float:right">
  <ul><li><a href="ShowMain.php">我的问卷</a>
      <li><a href="{indexListURL}">问卷指标体系</a></li>
	  <li class="current"><a href="{qtnURL}">指标匹配问题</a></li>
	  <li style="display:{isDesignMode}"><a href="../Analytics/SurveyIndexResult.php?surveyID={surveyID}&surveyTitle={survey_URLTitle}">问卷指标分析</a></li></ul></span>
</div>

<div class="wrap q_clear" id=wrap>
<div>
<div class=content>
<div class=q_clear id=mysurvey><h1>建立问卷内问题与指标之间的匹配关系</h1><br/></div>
<div style="line-height:10px">&nbsp;</div>

 <table width=100% cellspacing=0 cellpadding=0 style="margin-bottom:10px"><tr><td bgcolor="#b5cfd9" height=1></td></tr></table>

 <form name="MatchForm" method="post" action="" onsubmit="return Check_Form_Validator()">
 <table class=datatable id="datatable" cellspacing=0 cellpadding=0 width=100%>
   <tr><td valign=top style="width:390px;*width:400px;margin:0px;padding:0px">
      <table cellspacing=0 cellpadding=0>
	     <tr><td><b>可分配问题列表</b></td></tr>
		 <tr><td><select name="questionName" id="questionName" multiple size="{qtnSize}" style="width:390px;*width:400px">
	      {qtnList}
		  </select>
	  </td></tr></table></td>
	  <td valign=top align=left width=* style="margin:0px;padding:0px">
      <table cellspacing=0 cellpadding=0>
		<!-- BEGIN INDEX -->
		<tr><td></td><td><b>{indexName}</b></tr>
		<tr><td align=center valign=middle width="14px">
			<input type="button" class=inputsubmit onClick="move(this.form.questionName,this.form.indexID_{indexID})" value=">"><br/>
			<input type="button" class=inputsubmit onClick="move(this.form.indexID_{indexID},this.form.questionName)" value="<">
		</td>
	    <td align=left valign=top><select name="indexID_{indexID}[]" id="indexID_{indexID}" multiple size="5" style="width:395px;*width:405px">
			  {indexList}
			  </select>
		  </td>
	   </tr>
	   <!-- END INDEX -->
	 </table></td>
   </tr></table>
 
   <table width=100% cellspacing=0 cellpadding=0 style="margin-top:10px"><tr><td bgcolor="#b5cfd9" height=1></td></tr></table>

   <table class=datatable id="datatable" cellspacing=0 cellpadding=0 width=100% style="margin-top:10px">
   <tr><td style="width:350px;*width:360px">&nbsp;</td>
      <td align=left>
      <input type="hidden" name="surveyID" id="surveyID" value="{surveyID}">
	  <input type="hidden" name="surveyTitle" id="surveyTitle" value="{surveyTitle}">
	  <input type="hidden" name="indexIDList" id="indexIDList" value="{indexIDList}">
	  <input type="hidden" name="Action" id="Action" value="SurveyIndexMatchSubmit">
      <input class=inputsubmit name="submit" type="submit" id="submit" value="确定" {noSubmit}> 
      <input class=inputsubmit type="button" name="cancel" value="取消" onClick="javascript:window.location.href='{indexListURL}'">	  
   </td></tr>
  </table>	
</form>
</div></div></div>
<script>adjustMenuWarpSize();</script>
</body></html>