function send_request(callback, urladdress, isReturnData){      
        var xmlhttp = getXMLHttpRequest();
        xmlhttp.onreadystatechange = function(){
            	if (xmlhttp.readyState == 4) {//readystate 为4即数据传输结束
 				    try{
				    	if(xmlhttp.status == 200){
							if(isReturnData && isReturnData==true){
								callback(xmlhttp.responseText);
							}
						}else{
							callback("抱歉，没找到此页面:"+ urladdress +"");
						}
			        } catch(e){
			        	callback("抱歉，发送请求失败，请重试 " + e);
			        }
			   }
        }
        xmlhttp.open("GET", urladdress, true);
        xmlhttp.send(null);
}

function getXMLHttpRequest() {
        var xmlhttp;
		if (window.XMLHttpRequest) {
			try {
				xmlhttp = new XMLHttpRequest();
				xmlhttp.overrideMimeType("text/html;charset=UTF-8");//设定以UTF-8编码识别数据
			} catch (e) {}
		} else if (window.ActiveXObject) {
			try {
				xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (e) {
				try {
					xmlhttp = new ActiveXObject("Msxml2.XMLHttp");
				} catch (e) {
					try {
						xmlhttp = new ActiveXObject("Msxml3.XMLHttp");
					} catch (e) {}
				}
			}
		}
        return xmlhttp;
}



/*
	//获取cookie
  function getCookieValue(sName)   
  {     
      var aCookie = document.cookie.split("; "); 
      for(var i=0; i<aCookie.length; i++)   
      {      
          var   aCrumb = aCookie[i].split("="); 

          if(sName ==aCrumb[0])     
              return unescape(aCrumb[1]);   
      }       
      return null;  
  }   
  
  //将字符串转换为date类型。例：parseDate(' 2006-1-1 15:14:16 ') return new Date(2006,0,1,15,14,16); 
  function parseDate(str){          
  if(typeof str == 'string'){          
    var results = str.match(/^ *(\d{4})-(\d{1,2})-(\d{1,2}) *$/);          
    if(results && results.length>3)          
      return new Date(parseInt(results[1]),parseInt(results[2]) -1,parseInt(results[3]));           
    results = str.match(/^ *(\d{4})-(\d{1,2})-(\d{1,2}) +(\d{1,2}):(\d{1,2}):(\d{1,2}) *$/);          
    if(results && results.length>6)          
     return new Date(parseInt(results[1]),parseInt(results[2]) -1,parseInt(results[3]),parseInt(results[4]),parseInt(results[5]),parseInt(results[6]));           
    results = str.match(/^ *(\d{4})-(\d{1,2})-(\d{1,2}) +(\d{1,2}):(\d{1,2}):(\d{1,2})\.(\d{1,9}) *$/);          
    if(results && results.length>7)          
      return new Date(parseInt(results[1]),parseInt(results[2]) -1,parseInt(results[3]),parseInt(results[4]),parseInt(results[5]),parseInt(results[6]),parseInt(results[7]));           
  }          
  return null;          
}          
  

function updateOnline(){
	var cookieValue = getCookieValue("currentTime");
	if(cookieValue != ""){
		var value = cookieValue.replace(/^\"|\"$/g,''); 
		var date =   parseDate(value);
		var curDate = new Date();
		if(curDate.getMinutes() - date.getMinutes() >= 3){
			send_request(function(value){}, "/searchSchoolUser/updateOnlineUser.action?t="+( new Date().getTime()), false);
		}
	}
}


function updateOnlineUser(){
	window.setInterval(updateOnline,180000);
}
*/

