// JavaScript Document
  function process_check_box(id)
      {
       
		var retstr;
		var readflag;
		var newsubstr='';
		var newsublen=0;
		
		var intid;
		
		intid=parseInt(id);
		
		var url;
	    url=window.location.href;
        //alert(window.location.href);
        var point;
	    point=url.lastIndexOf('/')+1;
        var strstr= url.substring(0,point);
        //url 除过最后的文件------------------
	    //alert(str);
		
		
		infoBoard=document.getElementById("msgtext"); 
        infoBoard.innerText='查询中...'; 
        myurl=strstr+"process_check_box.php?rand="+Math.random()*10000
        myurl=myurl+"&id="+intid;
		
        retstr=openUrl2(myurl); 
        //alert("服务器返回值："+retstr);
		
		readflag=retstr.substring(0,1);
		//alert(readflag);
		newsublen=strlen(retstr);
		//alert(newsublen);
		newsubstr=retstr.substring(1,newsublen); 
		//alert(readflag);
						
        switch(readflag){ 
        
        case "1": 
			   window.location.reload();
			   infoBoard.innerHTML='<font color=green size=-1>'+newsubstr+'</font>';
			   break; 
	   case "2": 
			   alert('软件提示:在正式考试模式下，不可以选择  【Internet】 场次');
			   window.location.reload();
			   break; 
	   case "3": 
			   alert('软件提示:在学习模式下，只能选择【Internet】场次');
			   window.location.reload();
			   break; 
			   
        case "0": 
                infoBoard.innerHTML='<font color=#000000> none！</font>'; break; 
	    default: 
                infoBoard.innerHTML='<font color=red>!</font>查询失败';break; 	
						
       } 
       return; 
     } 

   function strlen(str) 
   {
        var len = 0;
        for (var i = 0; i<str.length;i++)
	   {
          if (str.charCodeAt(i)>255) len+= 2; 
	      else 
	       len ++;
        }
       return len;
    }


function openUrl2(url)
 
 { 
    var objxml=new ActiveXObject("Microsoft.XMLHttp") 
    objxml.open("GET",url,false); 
    objxml.send(); 
	
    retInfo=objxml.responseText; 
    //-----------------------最重要，将%20 解码成空格，Visit W3School!") ==》Visit%20W3School%21
	retInfo=unescape(retInfo);
    if (objxml.status=="200")
	{ 
      return retInfo; 
    } 
    else
	{ 
      return "-2"; 
     } 
} 