function creat(){
if(typeof XMLHttpRequest !="undefined"){
var oXHR=new XMLHttpRequest();
return oXHR;
}else if(window.ActiveXObject){
var aversions=["MSXML2.XMLHttp.8.0","MSXML2.XMLHttp.7.0","MSXML2.XMLHttp.6.0","MSXML2.XMLHttp.5.0","MSXML2.XMLHttp.4.0","MSXML2.XMLHttp.3.0"];
for(i=0;i<aversions.length;i++){
try{
var oXHR=new ActiveXObject(aversions[i]);
return oXHR;
}catch(oError){}
   }
 }
}

function getData(t1,t2){
	var d=creat();
	var date=new Date();
	var year=date.getYear();
	year=year<2000?year+1900:year;
	var t1v=0,t2v=0,current=0;
	var yearStr="vc_stat_year";
	//var pre="http://www.cshtz.gov.cn";
	var urlp=["/lm/front/mailstat.jsp?sysid=001&sess=0","/lm/front/mailstat.jsp?sysid=002&sess=0","/lm/front/mailstat.jsp?sysid=003&sess=0"];
	var url=new Array();
	 for(var j=0;j<urlp.length;j++){
	      url.push(urlp[j]);
	 }
	for(var i=1;i<year-2010;i++){
	      for(var j=0;j<urlp.length;j++){
	           url.push(urlp[j]+"&"+yearStr+"="+(year-i));
	      }
	}
	d.open("GET",url[current],true);
	d.onreadystatechange=function(){
		if(d.readyState==4&&(d.status==200||d.status==302)){
			html=d.responseText;
			var start=html.indexOf("countstart>")+11;
			var end=html.indexOf("<",start);
			var countt=html.substr(start,end-start);
			countt=parseInt(countt);
			start=html.indexOf("replystart>")+11;
			end=html.indexOf("<",start);
			var replyt=html.substr(start,end-start);
			replyt=parseInt(replyt);
			t1v+=countt;
			t2v+=replyt;
			current++;
			if(current<url.length){
				d.open("GET",url[current],true);
				d.send(null);
			}else{
				//window.title="t1:"+t1v+"t2:"+t2v;
				document.getElementById(t1).innerHTML=t1v;
				document.getElementById(t2).innerHTML=t2v;
			}
		}
	}
	d.send(null);
}

getData("count_span","reply_span");
