function $(id){ return document.getElementById(id);}
//###################################################
//取得下拉列表中选择项目的值
//###################################################
function getselect(v)
{
   var t;
   for(var i = 0; i < v.options.length; i ++ )
   {
      if (v.options[i].selected)
      {
         t = v.options[i].value;
         break;
      }
   }
   return t;
}
//###################################################
//Div打开和关闭 0 关闭,1或其它打开
//###################################################
function SkyDivOpr(sDiv,state)
{
   if(state == 0)
   {
	$(sDiv).style.display = "none";
   }
   else
   {
	$(sDiv).style.display = "";
   }
   
}
function SkyDivHTML(sDiv,html)
{
	$(sDiv).innerHTML = html;
}
//###################################################
//类型下拉列表更换内容
//	<option value="1">填空题</option>
//	<option value="2">单项选择题</option>
//	<option value="3">多项选择题</option>
//	<option value="4">判断题</option>
//	<option value="5">简答题</option>
//###################################################
function SkyDataInfoChange(v)
{
	var DrpInfo = getselect(v);
	SkyDivHTML("DivTestName","试题选项");
	SkyDivOpr("DivInputAdd",0);
	SkyDivOpr("TrJudge",1);
	if(DrpInfo == 1)
	{
		SkyDivOpr("DivIsChange",1);
		SkyDivOpr("DivCheck",0);
		SkyDivOpr("DivRadio",0);
		SkyDivOpr("DivJudge",0);
		SkyDivHTML("DivTestName","填空答案");
		
		SkyDivOpr("DivInputAdd",1);
	}else if(DrpInfo == 2)
	{
		SkyDivOpr("DivIsChange",0);
		SkyDivOpr("DivCheck",0);
		SkyDivOpr("DivRadio",1);
		SkyDivOpr("DivJudge",0);
	}else if(DrpInfo == 3)
	{
		SkyDivOpr("DivIsChange",0);
		SkyDivOpr("DivCheck",1);
		SkyDivOpr("DivRadio",0);
		SkyDivOpr("DivJudge",0);
	}else if(DrpInfo == 4)
	{
		SkyDivOpr("DivIsChange",0);
		SkyDivOpr("DivCheck",0);
		SkyDivOpr("DivRadio",0);
		SkyDivOpr("DivJudge",1);
		SkyDivOpr("TrJudge",0);
	}else if(DrpInfo == 5)
	{
		SkyDivOpr("DivIsChange",0);
		SkyDivOpr("DivCheck",0);
		SkyDivOpr("DivRadio",0);
		SkyDivOpr("DivJudge",0);
		SkyDivHTML("DivTestName","填空答案");
	}
}
//###################################################
//增加空战位符号{_}
//###################################################
function SkyDivAddDesign(vName)
{
	$(vName).value = $(vName).value + "{_}";
}
//###################################################
//保存数据
//###################################################
function SkyDataSave()
{
	var tName;
	var tID;
	tName = "TxtName"
	tID=$(tName);
	if(tID.value == "")
	{
		SkyAlertInfo("对不起,试题题目必须填写!");
		tID.focus();
		return false;	
	}
	tName = "DrpType"
	tID=$(tName);
	var DrpInfo = getselect(tID);
	if(DrpInfo != "4")
	{
		tName = "TxtValues"
		tID=$(tName);
		if(tID.value == "")
		{
			SkyAlertInfo("对不起,试题选项/填空答案 必须填写!");
			tID.focus();
			return false;	
		}
	}
	
	tName = "DrpExamSort"
	tID=$(tName);
	DrpInfo = getselect(tID);
		if(DrpInfo == "0")
		{
			SkyAlertInfo("对不起,隶属题库必须选择子级题库!");
			tID.focus();
			return false;	
		}
}
