<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">
<link href="../CSS/Base.css" rel="stylesheet" type="text/css"/>
<link href="../CSS/Common.css" rel="stylesheet" type="text/css"/>
<link href="../CSS/SurveyList.css" rel="stylesheet" type="text/css"/>
<LINK href="../CSS/Window.css" type=text/css rel=stylesheet>
<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/Window.js.php"></script>
<script type="text/javascript" src="../JS/Actions.js.php"></script>
<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 type="text/javascript" src="../JS/CheckQuestion.js.php"></script>
<script language="javascript"> 
function checkall(form) 
{
	if( form.all.checked)
	{
		for(var i = 0;i < form.elements.length-1; i++) 
		{
			var e = form.elements[i];
			e.checked = true;
		}
	}
	else
	{
		for(var i = 0;i < form.elements.length-1; i++) 
		{
			var e = form.elements[i];
			e.checked = false;
		}
    }
}
function refreshParent() {
   //self.location.href = '{listURL}';
   AjaxQtnListRequest("ShowQtnList.php{thisURLStr}"+"&randid="+Math.random());
}
function qtnAddAction()
{ 
	var x =(document.body.clientWidth-700)/2;		
	var y = 180;
	gId('menu-div').style.position = "absolute";
	gId('menu-div').style.left = Math.ceil(x) + 'px';
	var scTop = parseInt(getScrollTop(),10);
	gId('menu-div').style.top = ( scTop + 60 ) + "px";
	gId('menu-div').style.width = '640px';
	//gId('menu-div').style.height = height + 'px';

	gId('menu-div').style.display = "block";
	gId('actionContent').style.padding = '0px';
	gId('actionContent').innerHTML = "<div id=\"preloading\" style=\"background-color:#f0f0f0;width:160px;overflow:hidden;white-space:nowrap;color:black;font-weight:bold;-moz-border-radius-bottomright:5px;-webkit-border-bottom-right-radius:5px;-khtml-border-bottom-right-radius:5px;border-bottom-right-radius:5px;\">&nbsp;<img src=\"..\/Images\/wait.gif\" width=\"16px\" height=\"16px\">&nbsp;正在加载操作向导&nbsp;<\/div>";
	change_style('select', 'hidden');
	var postStr = '';
	ajax_Post_Action("{addURL}"+"&randid="+Math.random(),postStr);
}
function createNewQtn(returnVal)
{
    AjaxQtnListRequest("ShowQtnList.php{thisURLStr}"+"&randid="+Math.random());
    if( returnVal == 1 )  //保存,下一个
    {
       qtnAddAction();
    }
}
function sendAddQtnAction(qtnType)
{
	closeLog('menu-div');
    var thisProg = '{listURL}&Action=View&questionType='+qtnType;
    showPopWin(thisProg, 900, 480,createNewQtn, null,'新增问卷问题');
}
function sendPageBreakAction(qtnType)
{
	closeLog('menu-div');
    var thisProg = '{listURL}&Action=View&questionType='+qtnType;
    self.location.href = thisProg;
}
function Init()
{
	gId('questionlist').innerHTML = "<div id=\"preloading\" style=\"background-color:#f0f0f0;width:160px;overflow:hidden;white-space:nowrap;color:black;font-weight:bold;-moz-border-radius-bottomright:5px;-webkit-border-bottom-right-radius:5px;-khtml-border-bottom-right-radius:5px;border-bottom-right-radius:5px;\">&nbsp;<img src=\"..\/Images\/wait.gif\" width=\"16px\" height=\"16px\">&nbsp;正在加载问卷数据&nbsp;<\/div>";
    AjaxQtnListRequest("ShowQtnList.php{thisURLStr}"+"&randid="+Math.random());
}
var http_request = false;
function AjaxQtnListRequest(url)
{
	http_request = false;
	if(window.ActiveXObject){
		try{ http_request = new ActiveXObject("Msxml2.XMLHTTP");}
		catch (e){ try{ http_request = new ActiveXObject("Microsoft.XMLHTTP");} catch (e) {}
		}
	}
	else if(window.XMLHttpRequest){
		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 = function() {
	  if( http_request.readyState == 4 && http_request.status == 200) {
			 gId('questionlist').innerHTML = http_request.responseText;
			 adjustMenuWarpSize();
			 gId('sideBar').style.right = '0px';
			 newChangeQtn();
		}
	}
	http_request.open('GET', url, true);
	http_request.send(null);
}
function getBaseQtnListRequest(url){
	http_request = false;
	if(window.ActiveXObject){
		try{ http_request = new ActiveXObject("Msxml2.XMLHTTP");}
		catch (e){ try{ http_request = new ActiveXObject("Microsoft.XMLHTTP");} catch (e) {}
		}
	}
	else if(window.XMLHttpRequest){
		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 = function() {
	  if( http_request.readyState == 4 && http_request.status == 200) {
			 gId('baseQtnList').innerHTML = http_request.responseText;
		}
	}
	http_request.open('GET', url, true);
	http_request.send(null);
}
function newChangeQtn()
{
	var theNewQtnType = getRadioCheckBoxValue(gId('newQuestionType'));
	switch(theNewQtnType)
	{
		case '17':
		case '18':
		case '19':
		case '20':
		case '21':
		case '22':
		case '28':
		case '29':
			gId('baseID').disabled = false;
			getBaseQtnListRequest('AjaxShowBaseQtn.php?surveyID={surveyID}&newQuestionType=' +theNewQtnType );
		break;
		default:
			gId('baseID').disabled = true;
		break;
	}
}
function checkSelectQtn()
{
	var strErr = "操作要求必须先选择一个或多个问题！";
	objField = document.form.questionID;
	if( objField.length == null )
	{
		if (objField.checked) return true;
		else
		{
			objField.focus();
			$.notification(strErr);
			return false;
		}
	}
	else
	{
		for (i=0;i<objField.length;i++){
			if (objField[i].checked) return true;
		}
		objField[0].focus();
		$.notification(strErr);
		return false;
	}
}
function checkInsertNewQtnInput()
{
	if ( !checkSelectQtn()) {return false;}
	if (!CheckListNoSelect(form.newQuestionType, "在当前选中问题前插入的问题题型")) {return false;}
	switch(getRadioCheckBoxValue(gId('newQuestionType')))
	{
		case '17':
		case '18':
		case '19':
		case '20':
		case '21':
		case '22':
		case '28':
		case '29':
			if (!CheckListNoSelect(form.baseID, "选择插入问题的来源问题")) {return false;}
		break;
	}
}
function checkInsertNewQtn()
{
	if( checkInsertNewQtnInput() != false )
	{
		gId('formAction').value = 'InsertNewQtnSubmit';
		gId('form').submit();
	}
}
function checkQtnAction( actionValue )
{
	if ( checkSelectQtn()) 
	{
		gId('formAction').value = actionValue;
		gId('form').submit();
	}
}
</script>
<style>
  .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;}
  .classtd { padding:2px 5px 2px 5px;}
</style>

<body oncontextmenu="return false" style="background-color:#244d8f;" onload="javascript:Init();">

<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 class="current"><a href="{questionListURL}">调查问题</a></li>
	  <li><a href="{logicURL}">逻辑关系</a></li>
	  <li><a href="{relationURL}">数值关联</a></li>
	  <li><a href="{quotaURL}">问卷配额</a></li>
	  <li><a href="{weightURL}">选项权重</a></li></ul></span>
</div>
<a name="top" href="javascript:void(0);"></a>
<div class="wrap q_clear" id=wrap>
<div>
<form name="form" id="form" method="post" action="">
<div class=content id="questionlist"></div>
</form>
</div></div>
<div id="menu-div">
	<div id="actionInner">
	  <div id="actionTitleBar">
	      <div id="actionTitle">请选择对应调查问题操作</div>
		  <div id="actionControls"><img src="../Images/closewindow.gif" onclick="closeLog('menu-div');" id="actionCloseBox"/></div>
	  </div>
      <div id="actionContent"></div>
	</div>
</div>

<link href="../CSS/SideBar.css" type="text/css" rel=stylesheet>
<script type="text/javascript" src="../JS/SideBar.js.php"></script>
<div id="sideBar">	
	<a href="javascript:void(0);" id="sideBarTab" onfocus="this.blur();"><img src="../Images/slide-button.gif"/></a>
	<div id="sideBarContents" style="display:none">
		<div id="sideBarContentsInner" style="display:none">
			<h2>操作小提示</h2>			
			<ul>
				<li><b>[设计]</b> 新增调查问卷，需要您继续添加问卷问题与选项，问卷设计工作才算完成；</li>
				<li><b>[预览]</b> 检查问卷的正确与否及最终样式，可对问卷进行预览，并可进行模拟数据提交；</li>
				<li><b>[预览]</b> 问卷的预览界面，提供鼠标右键、问题快捷菜单、页面在地编辑等快速操作；</li>
				<li><b>[执行]</b> 设计好的问卷要供被调查者填写数据，需把问卷转成“执行”状态；</li>
				<li><b>[执行]</b> 执行状态的问卷为保持数据完整性，将关闭问卷部分设计功能。</li>
				<li>更多帮助信息，方便访问<a href="http://doc.itenable.com.cn" target=_blank><b>EnableQ在线文档中心</b></a></li>
			</ul>			
		</div>
	</div>	
</div>
<script>initSideBar();</script>
</body></html>
