<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;}
 table {margin-bottom:4px;}
</style>
<link href="../CSS/Base.css" rel=stylesheet>
<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 language=javascript src="../JS/CheckQuestion.js.php"></script>
<script language=javascript src="../JS/HighLight.js.php"></script>
<script language=javascript>
function CheckSpecicalChar(objField, strText)
{
	var strErr = "“" + strText + "”不能包含单引、双引、反斜线等非法字符！";
	var Re = /[\x22\x27\x5C]+/ig;
	if ( Re.test(objField.value))
	{
        objField.focus();
		$.notification(strErr);
		return false;
	}
	return true;
}
function checkValid()
{
	if (event.keyCode<48 || event.keyCode>126)
	{
		  event.keyCode=0;
	}
}
function Check_Form_Validator()
{
	if (!CheckNotNull(Check_Form.cateTag, "分类标识名")) {return false;}
	if (!CheckNoChinese(Check_Form.cateTag, "分类标识名")) {return false;}
	if (!CheckSpecicalChar(Check_Form.cateTag, "分类标识名")) {return false;}
	if (!CheckNotNull(Check_Form.cateName, "分类名称")) {return false;}
	if (!CheckSpecicalChar(Check_Form.cateName, "分类名称")) {return false;}
}
var http_request = false;
function AjaxRequest(url)
{
	http_request = false;
	if(window.ActiveXObject)
	{
		try  // IE
		{
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			try
			{
				http_request = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e) {}
		}
	}
	else if(window.XMLHttpRequest)
	{
		// Mozilla, Safari,...
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType)
		{
			http_request.overrideMimeType('text/xml');
		}
	}
	
	if (!http_request)
	{
		$.notification("Cannot create an XMLHTTP instance");
		return false;
	}
	http_request.onreadystatechange = AjaxContents;
	http_request.open('GET', url, true);
	http_request.send(null);
}

function AjaxContents()
{
	if (http_request.readyState == 4)
	{
		if(http_request.status == 200)
		{
			if(http_request.responseText == "false")
			   document.getElementById("surveyCateInfo").innerHTML="<img src=../Images/check_no.gif border=0> <span class=red>输入的分类标识名已存在&nbsp;</span>";
			else if(http_request.responseText == "true")
			   document.getElementById("surveyCateInfo").innerHTML="<img src=../Images/check_yes.gif border=0> <span class=green>输入的分类标识名可使用&nbsp;</span>";
			else if(http_request.responseText == "null") 
			   document.getElementById("surveyCateInfo").innerHTML="<img src=../Images/check_no.gif border=0> <span class=red>输入的分类标识名为空&nbsp;</span>";
		}
		else
		{
			$.notification('网络传输问题');
		}
	}
}
</script>
<meta content="mshtml 6.00.3790.0" name=generator></head>
<body oncontextmenu="return false">
  <form action="" 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; 调查问卷分类</div>
     <tr><td colspan="4" bgcolor="#f5f5f5" height="25"><b>调查问卷分类</b>&nbsp;&nbsp;[ <span class=red>{recNum}</span> 分类 ]</td></tr>
     <tr>
          <td width=10%><b>分类标识名</b></td>
          <td width=*% align=center><strong>分类名称</strong></td>
          <td width=55% align=center><strong>该分类问卷列表调用地址</strong></td>
          <td width=10% nowrap align=center><strong>操作</strong></td>
        </tr>
        <!-- BEGIN CATE -->
        <tr onmouseover="this.style.backgroundColor='#DEEFFF'"  onmouseout="this.style.backgroundColor='#FFFFFF'">
          <td>{cateTag}</td>
          <td align=center>{cateName}</td>
          <td align=center><a href="{cateURL}" target=_blank>{cateURL}</a></td>
          <td nowrap align=center>
		   <a href="{editURL}">编辑</a>&nbsp;<a href="{deleteURL}" onclick="return window.confirm('您真的想删除本调查问卷分类吗？该分类的所有数据将被清空，并且不可恢复！?')">删除</a> 
		  </td>
        </tr>
        <!-- END CATE -->
    </table>
  <table class=datatable style="line-height: 150%;border-collapse:collapse;" cellspacing=0 cellpadding=0 bordercolor=#b5cfd9 border=1 width=100%>
   <tr><td colspan="2" height="25" bgcolor="#f5f5f5"><b>创建新的调查问卷分类</b>&nbsp;<img src="../Images/info.gif" border=0></td></tr>
    <tr>
        <td align=right colspan=2><SPAN style="PADDING-RIGHT: 16px">注：以下带“<SPAN  class=red>*</SPAN>”的为必填项</SPAN></td></tr>
	<tr> 
        <td width="12%" height="25"><span class=red>*</span> 分类标识名：</td>
        <td width="88%">
	  	 <span style="float:left"><input class="textInput" name="cateTag" type="text" id="cateTag" size="20" onkeypress="checkValid()" style="ime-mode:disabled" onPaste="return false;" onKeyUp="AjaxRequest('AjaxCheckSurveyCate.php?cateTag='+this.value);">&nbsp;* 使用汉语拼音或者英文名称</span>
		 <span id="surveyCateInfo" style="float:right;padding-right:230px;"></span>
　　　</td>
   </tr>
   <tr> 
       <td height="25"><SPAN class=red>*</SPAN> 分类名称：</td>
       <td><input class="textInput" name="cateName" type="text" id="cateName" size="50" maxlength="200"></td>
   </tr></table>
   <table width=100%>
   <tr><td width=12%> 
  	 <td>
		 <input name="Action" type="hidden" value="SurveyCateAddSubmit">
         <input type=submit class=inputsubmit value="确定">&nbsp;<input type=reset class=inputsubmit value="重置">&nbsp;<input class=inputsubmit type="button" name="close" value="关闭" onClick="javascript:parent.hidePopWin();">
      </td>
    </tr>
  </form>
 </table>
 <script type="text/javascript">initInputHighlightScript();</script> 
</body></html>