<!--

var intclsid = 0;
var str4 = "";
var str7 = "";
var str6 = "";
var str11 = "";
var str14 = "";
var str12 = "";
function getzygxlist(intclass)
{
   var isupdated = 0;
   intclsid = intclass;
   if (intclass == 4)
   {
      if (str4 != "")
      {
         isupdated = 1;
         $("ziyuan_listmap_right").innerHTML = str4;
      }
   }
   else if (intclass == 7)
   {
      if (str7 != "")
      {
         isupdated = 1;
         $("ziyuan_listmap_right").innerHTML = str7;
      }
   }
   else if (intclass == 6)
   {
      if (str6 != "")
      {
         isupdated = 1;
         $("ziyuan_listmap_right").innerHTML = str6;
      }
   }
   else if (intclass == 11)
   {
      if (str11 != "")
      {
         isupdated = 1;
         $("ziyuan_listmap_right").innerHTML = str11;
      }
   }
   else if (intclass == 14)
   {
      if (str14 != "")
      {
         isupdated = 1;
         $("ziyuan_listmap_right").innerHTML = str14;
      }
   }
   else if (intclass == 12)
   {
      if (str12 != "")
      {
         isupdated = 1;
         $("ziyuan_listmap_right").innerHTML = str12;
      }
   }
   if (isupdated == 0)
   {
      var mytest = new Ajax.Request("/ajax_getzygxlist.asp",
      {
         method : 'get', parameters : "classid=" + intclass, onComplete : showzygxlist
      }
      );
   }
}
function showzygxlist(req)
{
   if (intclsid == 4)
   {
      str4 = req.responseText;
   }
   else if (intclsid == 7)
   {
      str7 = req.responseText;
   }
   else if (intclsid == 6)
   {
      str6 = req.responseText;
   }
   else if (intclsid == 11)
   {
      str11 = req.responseText;
   }
   else if (intclsid == 14)
   {
      str14 = req.responseText;
   }
   else if (intclsid == 12)
   {
      str12 = req.responseText;
   }
   $("ziyuan_listmap_right").innerHTML = req.responseText;
}



var intclsid1 = 0, intclsid2 = 0;

var stri4 = "";

var stri7 = "";

var stri6 = "";

var stri11 = "";

var stri14 = "";

var stri12 = "";

function getspktlist(intclass1, intclass2)

{

   var isupdated = 0;

   intclsid1 = intclass1;

   intclsid2 = intclass2;

   var pars = 'gradeid1=' + intclass1 + '&gradeid2=' + intclass2;

   if (intclass1 == 1 && intclass2 == 1)

   {

      if (stri4 != "")

      {

         isupdated = 1;

         $("shipin_listmap_right").innerHTML = stri4;

      }

   }

   else if (intclass1 == 2 && intclass2 == 8)

   {

      if (stri7 != "")

      {

         isupdated = 1;

         $("shipin_listmap_right").innerHTML = stri7;

      }

   }

   else if (intclass1 == 9 && intclass2 == 12)

   {

      if (stri6 != "")

      {

         isupdated = 1;

         $("shipin_listmap_right").innerHTML = stri6;

      }

   }

   else if (intclass1 == 13 && intclass2 == 16)

   {

      if (stri11 != "")

      {

         isupdated = 1;

         $("shipin_listmap_right").innerHTML = stri11;

      }

   }

   else if (intclass1 == 17 && intclass2 == 17)

   {

      if (stri14 != "")

      {

         isupdated = 1;

         $("shipin_listmap_right").innerHTML = stri14;

      }

   }

   else if (intclass1 == 18 && intclass2 == 18)

   {

      if (stri12 != "")

      {

         isupdated = 1;

         $("shipin_listmap_right").innerHTML = stri12;

      }

   }

   if (isupdated == 0)

   {

      var mytest = new Ajax.Request("ajax_getspktlist.asp",

      {

         method : 'get', parameters : pars, onComplete : showspktlist

      }

      );

   }

}

function showspktlist(req)

{

   if (intclsid1 == 1 && intclsid2 == 1)

   {

      stri4 = req.responseText;

   }

   else if (intclsid1 == 2 && intclsid2 == 8)

   {

      stri7 = req.responseText;

   }

   else if (intclsid1 == 9 && intclsid2 == 12)

   {

      stri6 = req.responseText;

   }

   else if (intclsid1 == 13 && intclsid2 == 16)

   {

      stri11 = req.responseText;

   }

   else if (intclsid1 == 17 && intclsid2 == 17)

   {

      stri14 = req.responseText;

   }

   else if (intclsid1 == 18 && intclsid2 == 18)

   {

      stri12 = req.responseText;

   }

   $("shipin_listmap_right").innerHTML = req.responseText;

}



var intclassid1 = 0, intclassid2 = 0;

var strp1 = "";

var strp2 = "";

var strp3 = "";

function getkjbllist(intcls1,intcls2)

{

   var isupdated = 0;

   intclassid1 = intcls1;

   intclassid2 = intcls2;

   if (intclassid1 == 337 && intclassid2 == 342)

   {

      if (strp1 != "")

      {

         isupdated = 1;

         $("list-keji").innerHTML = strp1;

      }

   }

   else if (intclassid1 == 332 && intclassid2 == 336 )

   {

      if (strp2 != "")

      {

         isupdated = 1;

         $("list-keji").innerHTML = strp2;

      }

   }

   else if (intclassid1 == 347 && intclassid2 == 347)

   {

      if (strp3 != "")

      {

         isupdated = 1;

         $("list-keji").innerHTML = strp3;

      }

   }

   if (isupdated == 0)

   {

      var mytest = new Ajax.Request('/ajax_getkjbllist.asp?classid1=' + intcls1+'&classid2='+intcls2,

      {

         method : 'get', onComplete : showkjbllist

      }

      );

   }

}

function showkjbllist(req)

{

   if (intclassid1 == 337 && intclassid2 == 342)

   {

      strp1 = req.responseText;

   }

   else if (intclassid1 == 332 && intclassid2 == 336)

   {

      strp2 = req.responseText;

   }

   else if (intclassid1 == 347 && intclassid2 == 347)

   {

      strp3 = req.responseText;

   }

   $("list-keji").innerHTML = req.responseText;

}



///////////////////////////////////////////////
////////////// 用户登录验证////////////////////
//////////////////////////////////////////////



function ajax_login()
{
   var a;
   if ($('roles').checked)
   {
      a = $('roles').value;
   }
   else
   {
      a = $('rolet').value;
   }

   if($('username').value == '')
   {
      alert('用户名不能为空！');
      $('username').focus();
      return false;
   }
   else if($('username').value == '用户名:')
   {
      alert('请输入您的用户名！');
      $('username').focus();
      return false;
   }
   else if($('passwordin') ==null)
   {
      alert('请输入密码！');
      $('passwordout').focus();
      return false;
   }
   else if($('username').value.length < 2)
   {
      alert('用户名长度必须大于2,小于16位')
      $('username').focus();
      return false;
   }
   else if($('username').value.length > 16)
   {
      alert('用户名长度必须大于2,小于16位')
      $('username').focus();
      return false;
   }
   else if($('passwordin').value.length < 2)
   {
      alert('密码长度必须大于2,小于16位')
      $('passwordin').value = '';
      $('passwordin').focus();
      return false;
   }
   else if($('passwordin').value.length > 16)
   {
      alert('密码长度必须大于2,小于16位')
      $('passwordin').value = '';
      $('passwordin').focus();
      return false;
   }

   var pars = 'username=' + $('username').value + '&password=' + $('passwordin').value + '&role=' + a + '&isauto=' + $('autologin').checked;
   var mytest = new Ajax.Request('/checklogin.asp?' + pars+"&"+"t="+Math.random(),
   {
      method : 'get', onComplete : showcontent
   }
   );
   
   pars = 'action=chk&username=' + $('username').value + '&password=' + $('passwordin').value + '&codestr=1&CookieDate=2&userhidden=2'
   var mytestbbs = new Ajax.Request('/bbs/loginek360.asp?' + pars+"&"+"t="+Math.random(),
   {
      method : 'get', onComplete : showcontent1
   }
   );
}

//电子教材登录
function ajax_dzlogin()
{


   if($('userdz').value == '')
   {
      alert('卡号不能为空！');
      $('userdz').focus();
      return false;
   }
   else if($('passdz').value =='')
   {
      alert('请输入密码！');
      $('passdz').focus();
      return false;
   }
   else if($('passdz').value.length < 2)
   {
      alert('请正确输入密码！')
      $('passdz').value = '';
      $('passdz').focus();
      return false;
   }
   else if($('passdz').value.length > 16)
   {
      alert('请正确输入密码！')
      $('passdz').value = '';
      $('passdz').focus();
      return false;
   }

   var pars = 'username=' + $('userdz').value + '&password=' + $('passdz').value + '&role=1&isauto=1';
   var mytest = new Ajax.Request('/checkdzlogin.asp?' + pars+"&"+"t="+Math.random(),
   {
      method : 'get', onComplete : showcontentdz
   }
   );
   
   pars = 'action=chk&username=' + $('userdz').value + '&password=' + $('passdz').value + '&codestr=1&CookieDate=2&userhidden=2'
   var mytestbbs = new Ajax.Request('/bbs/loginek360.asp?' + pars+"&"+"t="+Math.random(),
   {
      method : 'get', onComplete : showcontent1
   }
   );
}


function showcontent1(req)
{
	if (req.responseText.indexOf('loginsucess')<0)
	{
		//alert ("同步登陆bbs失败！不会影响你正常使用网站！");
	}
}

function showcontent(req)
{
   if (req.responseText.indexOf('valid=9') > - 1)
   {
      $("loginajax").innerHTML = req.responseText.replace('valid=9', '');
	//alert('登录成功！');
   }
   else if (req.responseText.indexOf('valid=0') > - 1)
   {
      alert('用户名不存在！');
      $('username').focus();
   }
   else if (req.responseText.indexOf('valid=-1') > - 1)
   {
      alert('该用户已经登录,请不要重复登陆！');
      $('username').focus();
   }
   else if (req.responseText.indexOf('valid=1') > - 1)
   {
      alert('该用户已经被删除！');
      $('username').focus();
   }
   else if (req.responseText.indexOf('valid=2') > - 1)
   {
      alert('用户密码不正确！');
      $('passwordin').value = '';
      $('passwordin').focus();
   }
   else if (req.responseText.indexOf('valid=3') > - 1)
   {
      alert('用户角色不正确！');
   }
   else if (req.responseText.indexOf('valid=4') > - 1)
   {
      alert('用户未通过审核！');
      $('username').focus();
   }
   else if (req.responseText.indexOf('valid=7') > - 1)
   {
      alert('登录失败！');
      $('username').focus();
   }
}

//电子
function showcontentdz(req)
{
   if (req.responseText.indexOf('valid=9') > - 1)
   {
      $("dianjiaologin").innerHTML = req.responseText.replace('valid=9', '');
		//alert('登录成功！');
		window.location.href='/membercenter/Member_centerek360.html';
   }
   else if (req.responseText.indexOf('valid=0') > - 1)
   {
      alert('该卡号不存在！');//用户名不存在！
      $('username').focus();
   }
   else if (req.responseText.indexOf('valid=-1') > - 1)
   {
      alert('该卡号已经登录,请不要重复登陆！');
      $('username').focus();
   }
   else if (req.responseText.indexOf('valid=1') > - 1)
   {
      alert('该卡号已经被删除！');
      $('username').focus();
   }
   else if (req.responseText.indexOf('valid=2') > - 1)
   {
      alert('密码不正确！');
      $('passwordin').value = '';
      $('passwordin').focus();
   }
   else if (req.responseText.indexOf('valid=3') > - 1)
   {
      alert('登录失败！');
   }
   else if (req.responseText.indexOf('valid=4') > - 1)
   {
      alert('该卡号通过审核！');
      $('username').focus();
   }
   else if (req.responseText.indexOf('valid=7') > - 1)
   {
      alert('登录失败！');
   }
}



function ajax_logout()

{

   var mytest = new Ajax.Request('/checklogout.asp'+"?"+"t="+Math.random(),

   {

      method : 'get', onComplete : showlogout

   }

   );

    var mytestbbs = new Ajax.Request('/bbs/logout.asp'+"?"+"t="+Math.random(),

   {

      method : 'get', onComplete : showlogoutbbs

   }

   );

}

function showlogoutbbs()

{

	//alert ("bbs同步退出成功");

}

function ajax_logout1()

{

   var mytest = new Ajax.Request('/checklogout.asp'+"?"+"t="+Math.random(),

   {

      method : 'get', onComplete : showlogout1

   }

   );

   var mytestbbs = new Ajax.Request('/bbs/logout.asp'+"?"+"t="+Math.random(),

   {

      method : 'get', onComplete : showlogoutbbs

   }

   );

}

function showlogout1(req)

{

  location.href  = "/";

}

function myturn(surl){
window.setTimeout("window.location='"+surl+"'","1000");
}

function showlogout(req) 

{

   $('loginajax').innerHTML = req.responseText;

}



function clearusername()

{

   if ($('username').value == '用户名:')

   {

      $('username').value = '';

      $('username').focus();

   }

}



function checkdefaultname()
{
   if ($('username').value == '')
   {
      $('username').value = '用户名:';
   }
}



function passwordsetfocus()
{
   $('pwddiv').innerHTML = '<input name="passwordin" type="password" class="input" id="passwordin" title="请在此输入密码" size="15" maxlength="16" onblur="javascipt:passwordlostfocus();"  onKeyDown="if (event.keyCode==13) ajax_login()"/>'
   $('passwordin').value=''
   $('passwordin').focus();
   $('passwordin').focus();
}

function ekgo(tourl)
{
    window.setTimeout("window.navigate(tourl)",1);
}


function passwordlostfocus()
{
   if ($('passwordin').value=='')
   {
      $('pwddiv').innerHTML = '<input name="passwordout" type="text" class="input" id="passwordout" title="请在此输入密码" value="密  码:" size="15" maxlength="16" onfocus="javascipt:passwordsetfocus();"  onKeyDown="if (event.keyCode==13) ajax_login()"/>'
   }
}





function bookmarkit()
{
	window.external.addfavorite('http://www.ek360.com/','国家教育在线')
}




function checkcondition()
{
	if (($("input").value=="" || $("input").value=="最多20个汉字") && $("subject").value==0 && $("grade").value==0 && $("teachsourceversion").value==0 && $("materialtype").value==0)
	{
		alert("请选择条件");
		return false;
	}
}



function checkcondition2()

{

	if ($("zysstitle").value=="" || $("zysstitle").value=="输入资料标题")

	{

		alert("请输入资料标题");	

		return false;

	}

}



function checkconditionwz()

{

	if ($("input").value=="")

	{
		alert("请输入要搜索的关键字");

		return false;
	}



	if ($("condi").value==0)
	{
		$('mainform').action='/index_schek360.html';$('mainform').submit();
	}
	else if ($("condi").value==1)
	{
		$('mainform').action='/resources/resources_schek360.html?id=2';$('mainform').submit();
	}
	else if ($("condi").value==2)
	{
		$('mainform').action='/index_moviesch.html';$('mainform').submit();
	}
	return true;

}

function getsubjectindex()

{

   var grade=$('grade').value;

   if (grade>0){

	   var para="grade="+grade;

	   var mytest = new Ajax.Request("/lxcy/ajax_getsubjectindex.asp?"+para,

	   {

		  method : 'get', onComplete : showsubjectindex

	   }

	   );

   }

}

function showsubjectindex(req)

{

   $('kemu').innerHTML = req.responseText;

}


// -->
