<form action="" id="form_module_vote" name="form_module_vote" method="post"  class="zhezhao_style"  style=" background-color:#FBFDFC" onsubmit="return vote_submit_module();">
    <table width="603" border="0" cellpadding="0" cellspacing="0" class="from_table2" style="width:500px">
		<tr>
		  <th width="208" height="30" align="center" valign="middle" class="td1"><tpl> $langChannelModuleId </tpl>
	      :	</th>
			<td height="30" colspan="2" align="left" class="td1">vote_module_
			  <input type="text" name="vote_temp_name" id="vote_temp_name"  class="txtinput" value="<tpl> $modi_array.temp_name </tpl>" style=" width:130px" />

		  <p  style="color:#FF0000"> <tpl> $langChannelNoteModuleIdIs100EnglistOrNum </tpl>	</p></td>
		</tr>
		<tr>
			<td height="30" class="td1"><select style="width:200px" name="vote_left_select" class="tarea" id="vote_left_select" size="6" multiple="multiple">
              <tpl> section name=loop loop=$vote_array </tpl>
              <option value="<tpl> $vote_array[loop].vote_id </tpl>">
                <tpl> $vote_array[loop].vote_title </tpl>
              </option>
              <tpl> /section </tpl>
            </select></td>
			<td width="81" height="30" align="center" valign="middle" class="td1">
				<input type="button" value="===>>" id="vote_left_to_right" />
				<br />
				<input type="button" value="<<===" id="vote_right_to_left" />		  </td>
			<td width="311" height="30" align="left" valign="middle" class="td1">
				<select style="width:200px" name="vote_right_select" id="vote_right_select" class="tarea" size="6" multiple="multiple">
					<tpl> if $right_select[0].vote_id neq "" </tpl>
						<tpl> section name=loop loop=$right_select </tpl>
						<option value="<tpl> $right_select[loop].vote_id </tpl>"><tpl> $right_select[loop].vote_title </tpl></option>
						<tpl> /section </tpl>
					<tpl> /if </tpl>
		  </select></td>
		</tr>
		<tr>
		  <td height="30" align="center" valign="middle" class="td1" style="text-align:center">		  	  	</td>
          <td height="30" colspan="2" align="left" valign="middle" class="td1" >  <span class="btn_left">
		  <input type="submit" value="<tpl> $langCEnsure </tpl>" class="btn_submit" />
		  </span>	</td>
      </tr>
  </table>
</form>
<script>
$(document).ready(function() {
	//遮罩中 左右栏目的选择效果
	/* 左向右 */$('#vote_left_to_right').click(function(){
		 var Option="";
		 $("select[@name='vote_left_select']").find("option").each(function()
		 {
			if(this.selected == true){
				$("<option value="+this.value+">"+this.text+"</option>").appendTo("#vote_right_select");
			}
		 });
		 //从左边移除
		 $("select[@name='vote_left_select'] option[@selected]").remove();
	});
	/* 右向左 */$('#vote_right_to_left').click(function(){
		 var Option="";
		 $("select[@name='vote_right_select']").find("option").each(function()
		 {
			if(this.selected == true){
				$("<option value="+this.value+">"+this.text+"</option>").appendTo("#vote_left_select");
			}
		 });
		 //从左边移除
		 $("select[@name='vote_right_select'] option[@selected]").remove();
	});
});

//添加模块，以模块标识符号
function vote_submit_module(){

	var temp_name = "";//模块标识符
	var patrn=/^[a-zA-Z0-9]{1,100}$/; //正则匹配
	var str = "";
	var param_array = new Array();

	//右侧下拉菜单中的值拼成字符串
	$("#vote_right_select").find("option").each(function(){
		str += "select_id:"+this.value+'|||';
	});
	//验证右侧是否有值
	if(str == ""){
		alert("<tpl> $langChannelAddVoteInfoNotNull </tpl>");
		return false;
	}
	//验证模块标识符是否存在，不存在则返回错误
	temp_name = $("#vote_temp_name").val();
	if (!patrn.exec(temp_name)){
		alert("<tpl> $langChannelModuleIdIs100EnglistOrNum </tpl>");
		return false;
	}
	
	//取表单的参数信息，以后如果继续添加参数，则以"|||"分割，参数标识：参数值 的形式衔接
	param_array[0] = "temp_name:"+temp_name;
	param_array[1] = str;
	
	
	//循环 param_array 拼成字符串存入隐藏域中
	var str = "";
	for(i=0;i<param_array.length;i++){
		if(i==param_array.length-1){
			str += param_array[i];
		}else{
			str += param_array[i]+'|||';
		}
	}
	
	temp_name = "vote_module_"+temp_name//给模块标识符添加前缀
	
	if(checkRepeatModuleName(temp_name) == false){return false;}//验证是否与已有名称或者表单名重复 

	
	//添加模块标签
	$("#add_module_sign").append("<tr><td><span class='btn_left'><input type='button' class='btn_submit' value='"+temp_name+"' onclick='modi_module(\""+temp_name+"\");deleteRow(this);set_module_style(\"disabled\");'/></span><input type='hidden' name='"+temp_name+"' id='"+temp_name+"' value='"+str+"'/><a href=\"javascript:;\" onclick=\"javascript: copyToClipboard('"+temp_name+"')\" title='<tpl> $langChannelCopyModuleName </tpl>' class='copy_a_pic'></a><a href='javascript:;' onclick='if($(\"#add_module\")[0].disabled != true){deleteProhibitionElements(\""+temp_name+"\");deleteRow(this);}else{alert(\"<tpl> $langModuleDelWrong </tpl>\");}' title='<tpl> $langChannelDelThisModule </tpl>' class='del_a_pic'></a></td></tr>");
	
	$("#body_module").html("");//替换为模块标识符，隐藏域为拼的字符串
	
  	$("#add_module").attr("disabled","");//开放增加按钮
	
	set_module_style('no_disabled');//将模块区域中的按钮还原成no_disabled
	
	$.unblockUI();//去除遮罩
	
	$("#module_block").html('');//去除遮罩中的内容
	
	return false;
}
</script>